@satorijs/adapter-discord 3.4.2 → 3.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -31,6 +31,8 @@ export interface GuildScheduledEvent {
31
31
  creator?: User;
32
32
  /** the number of users subscribed to the scheduled event */
33
33
  user_count?: integer;
34
+ /** the cover image hash of the scheduled event */
35
+ image?: string;
34
36
  }
35
37
  export declare namespace GuildScheduledEvent {
36
38
  /** https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-privacy-level */
@@ -79,6 +81,8 @@ export declare namespace GuildScheduledEvent {
79
81
  description?: string;
80
82
  /** the entity type of the scheduled event */
81
83
  entity_type: EntityType;
84
+ /** the cover image of the scheduled event */
85
+ image?: string;
82
86
  }
83
87
  /** https://discord.com/developers/docs/resources/guild-scheduled-event#get-guild-scheduled-event-query-string-params */
84
88
  interface GetParams {
@@ -105,6 +109,8 @@ export declare namespace GuildScheduledEvent {
105
109
  entity_type?: EntityType;
106
110
  /** the status of the scheduled event */
107
111
  status?: Status;
112
+ /** the cover image of the scheduled event */
113
+ image?: string;
108
114
  }
109
115
  }
110
116
  /** https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-user-object-guild-scheduled-event-user-structure */
@@ -13,6 +13,8 @@ export interface StageInstance {
13
13
  privacy_level: integer;
14
14
  /** Whether or not Stage Discovery is disabled */
15
15
  discoverable_disabled: boolean;
16
+ /** The id of the scheduled event for this Stage instance */
17
+ guild_scheduled_event_id?: snowflake;
16
18
  }
17
19
  export declare namespace StageInstance {
18
20
  namespace Event {
@@ -32,6 +34,8 @@ export declare namespace StageInstance {
32
34
  topic: string;
33
35
  /** The privacy level of the Stage instance (default GUILD_ONLY) */
34
36
  privacy_level?: integer;
37
+ /** Notify @everyone that a Stage instance has started */
38
+ send_start_notification?: boolean;
35
39
  }
36
40
  /** https://discord.com/developers/docs/resources/stage-instance#modify-stage-instance-json-params */
37
41
  interface Modify {
@@ -12,7 +12,7 @@ export interface Sticker {
12
12
  /** autocomplete/suggestion tags for the sticker (max 200 characters) */
13
13
  tags: string;
14
14
  /** Deprecated previously the sticker asset hash, now an empty string */
15
- asset: string;
15
+ asset?: string;
16
16
  /** type of sticker */
17
17
  type: Sticker.Type;
18
18
  /** type of sticker format */
@@ -38,7 +38,8 @@ export declare namespace Sticker {
38
38
  enum FormatType {
39
39
  PNG = 1,
40
40
  APNG = 2,
41
- LOTTIE = 3
41
+ LOTTIE = 3,
42
+ GIF = 4
42
43
  }
43
44
  /** https://discord.com/developers/docs/resources/sticker#sticker-item-object-sticker-item-structure */
44
45
  interface Item {
@@ -67,7 +68,7 @@ export declare namespace Sticker {
67
68
  banner_asset_id: snowflake;
68
69
  }
69
70
  namespace Event {
70
- /** https://discord.com/developers/docs/topics/gateway#guild-stickers-update-guild-stickers-update-event-fields */
71
+ /** https://discord.com/developers/docs/topics/gateway-events#guild-stickers-update-guild-stickers-update-event-fields */
71
72
  interface Update {
72
73
  /** id of the guild */
73
74
  guild_id: snowflake;
@@ -1,4 +1,4 @@
1
- import { Channel, integer, snowflake, timestamp } from '.';
1
+ import { AllowedMentions, Attachment, Channel, Component, Embed, GuildMember, integer, snowflake, timestamp } from '.';
2
2
  declare module './channel' {
3
3
  interface Channel {
4
4
  /** an approximate count of messages in a thread, stops counting at 50 */
@@ -23,6 +23,8 @@ export interface ThreadMember {
23
23
  join_timestamp: timestamp;
24
24
  /** any user-thread settings, currently only used for notifications */
25
25
  flags: integer;
26
+ /** additional information about the user */
27
+ member?: GuildMember;
26
28
  }
27
29
  /** https://discord.com/developers/docs/resources/channel#thread-metadata-object-thread-metadata-structure */
28
30
  export interface ThreadMetadata {
@@ -36,6 +38,8 @@ export interface ThreadMetadata {
36
38
  locked: boolean;
37
39
  /** whether non-moderators can add other non-moderators to a thread; only available on private threads */
38
40
  invitable?: boolean;
41
+ /** timestamp when the thread was created; only populated for threads created after 2022-01-09 */
42
+ create_timestamp?: timestamp;
39
43
  }
40
44
  /** @see https://discord.com/developers/docs/resources/guild#list-active-guild-threads */
41
45
  export interface ListActiveGuildThreadsResult {
@@ -47,8 +51,8 @@ export interface ListActiveGuildThreadsResult {
47
51
  export interface Thread extends Channel {
48
52
  }
49
53
  export declare namespace Thread {
50
- /** https://discord.com/developers/docs/resources/channel#start-thread-with-message-json-params */
51
- interface StartWithMessageParams {
54
+ /** https://discord.com/developers/docs/resources/channel#start-thread-from-message */
55
+ interface StartFromMessageParams {
52
56
  /** 1-100 character channel name */
53
57
  name: string;
54
58
  /** duration in minutes to automatically archive the thread after recent activity, can be set to: 60, 1440, 4320, 10080 */
@@ -69,6 +73,40 @@ export declare namespace Thread {
69
73
  /** amount of seconds a user has to wait before sending another message (0-21600) */
70
74
  rate_limit_per_user?: integer;
71
75
  }
76
+ /** https://discord.com/developers/docs/resources/channel#start-thread-in-forum-channel-forum-thread-message-params-object */
77
+ interface StartThreadInFormChannelParams {
78
+ /** 1-100 character channel name */
79
+ name: string;
80
+ /** duration in minutes to automatically archive the thread after recent activity, can be set to: 60, 1440, 4320, 10080 */
81
+ auto_archive_duration?: integer;
82
+ /** amount of seconds a user has to wait before sending another message (0-21600) */
83
+ rate_limit_per_user?: integer;
84
+ /** contents of the first message in the forum thread */
85
+ message: FormThreadMessageParams;
86
+ /** the IDs of the set of tags that have been applied to a thread in a GUILD_FORUM channel */
87
+ applied_tags?: snowflake[];
88
+ }
89
+ /** https://discord.com/developers/docs/resources/channel#start-thread-in-forum-channel-forum-thread-message-params-object */
90
+ interface FormThreadMessageParams {
91
+ /** Message contents (up to 2000 characters) */
92
+ content?: string;
93
+ /** Embedded rich content (up to 6000 characters) */
94
+ embeds?: Embed[];
95
+ /** Allowed mentions for the message */
96
+ allowed_mentions?: AllowedMentions;
97
+ /** Components to include with the message */
98
+ components?: Component[];
99
+ /** IDs of up to 3 stickers in the server to send in the message */
100
+ sticker_ids?: snowflake[];
101
+ /** Contents of the file being sent. */
102
+ files: any[];
103
+ /** JSON-encoded body of non-file params, only for multipart/form-data requests. */
104
+ payload_json?: string;
105
+ /** Attachment objects with filename and description. */
106
+ attachments?: Partial<Attachment>[];
107
+ /** Message flags combined as a bitfield (only SUPPRESS_EMBEDS can be set) */
108
+ flags?: integer;
109
+ }
72
110
  /** https://discord.com/developers/docs/resources/channel#list-active-threads-response-body */
73
111
  interface List {
74
112
  /** the active threads */
@@ -100,7 +138,7 @@ export declare namespace Thread {
100
138
  limit?: integer;
101
139
  }
102
140
  namespace Event {
103
- /** https://discord.com/developers/docs/topics/gateway#thread-list-sync-thread-list-sync-event-fields */
141
+ /** https://discord.com/developers/docs/topics/gateway-events#thread-list-sync-thread-list-sync-event-fields */
104
142
  interface ListSync {
105
143
  /** the id of the guild */
106
144
  guild_id: snowflake;
@@ -113,7 +151,7 @@ export declare namespace Thread {
113
151
  }
114
152
  interface MemberUpdate extends ThreadMember {
115
153
  }
116
- /** https://discord.com/developers/docs/topics/gateway#thread-members-update-thread-members-update-event-fields */
154
+ /** https://discord.com/developers/docs/topics/gateway-events#thread-members-update-thread-members-update-event-fields */
117
155
  interface MembersUpdate {
118
156
  /** the id of the thread */
119
157
  id: snowflake;
@@ -147,9 +185,14 @@ declare module './internal' {
147
185
  listActiveGuildThreads(guild_id: snowflake): Promise<ListActiveGuildThreadsResult>;
148
186
  /**
149
187
  * Creates a new thread from an existing message. Returns a channel on success, and a 400 BAD REQUEST on invalid parameters. Fires a Thread Create Gateway event.
150
- * @see https://discord.com/developers/docs/resources/channel#start-thread-with-message
188
+ * @see https://discord.com/developers/docs/resources/channel#start-thread-from-message
189
+ */
190
+ startThreadFromMessage(channel_id: snowflake, message_id: snowflake, params: Thread.StartFromMessageParams): Promise<Channel>;
191
+ /**
192
+ * Creates a new thread in a forum channel, and sends a message within the created thread. Returns a channel, with a nested message object, on success, and a 400 BAD REQUEST on invalid parameters. Fires a Thread Create and Message Create Gateway event.
193
+ * @see https://discord.com/developers/docs/resources/channel#start-thread-in-forum-channel
151
194
  */
152
- startThreadWithMessage(channel_id: snowflake, message_id: snowflake, params: Thread.StartWithMessageParams): Promise<Channel>;
195
+ startThreadInForumChannel(channel_id: snowflake, params: Thread.StartThreadInFormChannelParams): Promise<Channel>;
153
196
  /**
154
197
  * Creates a new thread that is not connected to an existing message. The created thread defaults to a GUILD_PRIVATE_THREAD*. Returns a channel on success, and a 400 BAD REQUEST on invalid parameters. Fires a Thread Create Gateway event.
155
198
  * @see https://discord.com/developers/docs/resources/channel#start-thread-without-message
@@ -28,7 +28,7 @@ export interface User {
28
28
  /** the flags on a user's account */
29
29
  flags?: integer;
30
30
  /** the type of Nitro subscription on a user's account */
31
- premium_type?: integer;
31
+ premium_type?: PremiumType;
32
32
  /** the public flags on a user's account */
33
33
  public_flags?: integer;
34
34
  }
@@ -58,7 +58,16 @@ export declare enum UserFlag {
58
58
  BUG_HUNTER_LEVEL_2 = 16384,
59
59
  VERIFIED_BOT = 65536,
60
60
  EARLY_VERIFIED_BOT_DEVELOPER = 131072,
61
- DISCORD_CERTIFIED_MODERATOR = 262144
61
+ DISCORD_CERTIFIED_MODERATOR = 262144,
62
+ BOT_HTTP_INTERACTIONS = 524288,
63
+ ACTIVE_DEVELOPER = 4194304
64
+ }
65
+ /** https://discord.com/developers/docs/resources/user#user-object-premium-types */
66
+ export declare enum PremiumType {
67
+ NONE = 0,
68
+ NITRO_CLASSIC = 1,
69
+ NITRO = 2,
70
+ NITRO_BASIC = 3
62
71
  }
63
72
  /** https://discord.com/developers/docs/resources/user#connection-object-connection-structure */
64
73
  export interface Connection {
@@ -78,6 +87,8 @@ export interface Connection {
78
87
  friend_sync: boolean;
79
88
  /** whether activities related to this connection will be shown in presence updates */
80
89
  show_activity: boolean;
90
+ /** whether this connection has a corresponding third party OAuth2 token */
91
+ two_way_link: boolean;
81
92
  /** visibility of this connection */
82
93
  visibility: integer;
83
94
  }
@@ -59,7 +59,7 @@ export interface VoiceRegion {
59
59
  }
60
60
  export interface VoiceStateUpdateEvent extends VoiceState {
61
61
  }
62
- /** https://discord.com/developers/docs/topics/gateway#voice-server-update-voice-server-update-event-fields */
62
+ /** https://discord.com/developers/docs/topics/gateway-events#voice-server-update-voice-server-update-event-fields */
63
63
  export interface VoiceServerUpdateEvent {
64
64
  /** voice connection token */
65
65
  token: string;
@@ -1,4 +1,4 @@
1
- import { AllowedMentions, Attachment, Channel, Component, Embed, Guild, Message, snowflake, User } from '.';
1
+ import { AllowedMentions, Attachment, Channel, Component, Embed, Guild, integer, Message, snowflake, User } from '.';
2
2
  /** https://discord.com/developers/docs/resources/webhook#webhook-object-webhook-structure */
3
3
  export interface Webhook {
4
4
  /** the id of the webhook */
@@ -81,6 +81,10 @@ export declare namespace Webhook {
81
81
  payload_json: string;
82
82
  /** attachment objects with filename and description */
83
83
  attachments: Partial<Attachment>[];
84
+ /** message flags combined as a bitfield (only SUPPRESS_EMBEDS can be set) */
85
+ flags: integer;
86
+ /** name of thread to create (requires the webhook channel to be a forum channel) */
87
+ thread_name: string;
84
88
  }
85
89
  /** https://discord.com/developers/docs/resources/webhook#get-webhook-message-query-string-params */
86
90
  interface MessageParams {
@@ -105,7 +109,7 @@ export declare namespace Webhook {
105
109
  attachments: Partial<Attachment>[];
106
110
  }
107
111
  }
108
- /** https://discord.com/developers/docs/topics/gateway#webhooks-update-webhook-update-event-fields */
112
+ /** https://discord.com/developers/docs/topics/gateway-events#webhooks-update-webhooks-update-event-fields */
109
113
  export interface WebhooksUpdateEvent {
110
114
  /** id of the guild */
111
115
  guild_id: snowflake;
package/lib/ws.d.ts CHANGED
@@ -7,13 +7,12 @@ export declare class WsClient extends Adapter.WsClient<DiscordBot> {
7
7
  _ping: NodeJS.Timeout;
8
8
  _sessionId: string;
9
9
  _resumeUrl: string;
10
- prepare(): import("ws").WebSocket;
10
+ prepare(): Promise<import("ws").WebSocket>;
11
11
  heartbeat(): void;
12
12
  accept(): void;
13
13
  }
14
14
  export declare namespace WsClient {
15
15
  interface Config extends Adapter.WsClient.Config {
16
- gateway?: string;
17
16
  intents?: number;
18
17
  }
19
18
  const Config: Schema<Config>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@satorijs/adapter-discord",
3
3
  "description": "Discord Adapter for Satorijs",
4
- "version": "3.4.2",
4
+ "version": "3.4.4",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [
@@ -29,7 +29,7 @@
29
29
  "satori"
30
30
  ],
31
31
  "peerDependencies": {
32
- "@satorijs/satori": "^2.0.1"
32
+ "@satorijs/satori": "^2.1.1"
33
33
  },
34
34
  "dependencies": {
35
35
  "file-type": "^16.5.4",