@satorijs/adapter-discord 3.4.1 → 3.4.3

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.
@@ -0,0 +1,51 @@
1
+ import { Locale } from '.';
2
+ export declare namespace ApplicationRoleConnection {
3
+ /** https://discord.com/developers/docs/resources/application-role-connection-metadata#application-role-connection-metadata-object-application-role-connection-metadata-structure */
4
+ interface Metadata {
5
+ /** type of metadata value */
6
+ type: MetadataType;
7
+ /** dictionary key for the metadata field (must be a-z, 0-9, or _ characters; 1-50 characters) */
8
+ key: string;
9
+ /** name of the metadata field (1-100 characters) */
10
+ name: string;
11
+ /** translations of the name */
12
+ name_localizations?: Record<Locale, string>;
13
+ /** description of the metadata field (1-200 characters) */
14
+ description: string;
15
+ /** translations of the description */
16
+ description_localizations?: Record<Locale, string>;
17
+ }
18
+ /** https://discord.com/developers/docs/resources/application-role-connection-metadata#application-role-connection-metadata-object-application-role-connection-metadata-type */
19
+ enum MetadataType {
20
+ /** the metadata value (integer) is less than or equal to the guild's configured value (integer) */
21
+ INTEGER_LESS_THAN_OR_EQUAL = 1,
22
+ /** the metadata value (integer) is greater than or equal to the guild's configured value (integer) */
23
+ INTEGER_GREATER_THAN_OR_EQUAL = 2,
24
+ /** the metadata value (integer) is equal to the guild's configured value (integer) */
25
+ INTEGER_EQUAL = 3,
26
+ /** the metadata value (integer) is not equal to the guild's configured value (integer) */
27
+ INTEGER_NOT_EQUAL = 4,
28
+ /** the metadata value (ISO8601 string) is less than or equal to the guild's configured value (integer; days before current date) */
29
+ DATETIME_LESS_THAN_OR_EQUAL = 5,
30
+ /** the metadata value (ISO8601 string) is greater than or equal to the guild's configured value (integer; days before current date) */
31
+ DATETIME_GREATER_THAN_OR_EQUAL = 6,
32
+ /** the metadata value (integer) is equal to the guild's configured value (integer; 1) */
33
+ BOOLEAN_EQUAL = 7,
34
+ /** the metadata value (integer) is not equal to the guild's configured value (integer; 1) */
35
+ BOOLEAN_NOT_EQUAL = 8
36
+ }
37
+ }
38
+ declare module './internal' {
39
+ interface Internal {
40
+ /**
41
+ * Returns a list of application role connection metadata objects for the given application.
42
+ * @see https://discord.com/developers/docs/resources/application-role-connection-metadata#get-application-role-connection-metadata-records
43
+ */
44
+ getApplicationRoleConnectionMetadataRecords(): Promise<ApplicationRoleConnection.Metadata[]>;
45
+ /**
46
+ * Updates and returns a list of application role connection metadata objects for the given application.
47
+ * @see https://discord.com/developers/docs/resources/application-role-connection-metadata#update-application-role-connection-metadata-records
48
+ */
49
+ updateApplicationRoleConnectionMetadataRecords(): Promise<ApplicationRoleConnection.Metadata[]>;
50
+ }
51
+ }
@@ -21,7 +21,7 @@ export interface Application {
21
21
  privacy_policy_url?: string;
22
22
  /** partial user object containing info on the owner of the application */
23
23
  owner?: Partial<User>;
24
- /** if this application is a game sold on Discord, this field will be the summary field for the store page of its primary sku */
24
+ /** deprecated, if this application is a game sold on Discord, this field will be the summary field for the store page of its primary sku */
25
25
  summary: string;
26
26
  /** the hex encoded key for verification in interactions and the GameSDK's GetTicket */
27
27
  verify_key: string;
@@ -37,6 +37,20 @@ export interface Application {
37
37
  cover_image?: string;
38
38
  /** the application's public flags */
39
39
  flags?: integer;
40
+ /** up to 5 tags describing the content and functionality of the application */
41
+ tags?: [string, string?, string?, string?, string?];
42
+ /** settings for the application's default in-app authorization link, if enabled */
43
+ install_params?: InstallParams;
44
+ /** the application's default custom authorization link, if enabled */
45
+ custom_install_url?: string;
46
+ /** the application's role connection verification entry point, which when configured will render the app as a verification method in the guild role verification configuration */
47
+ role_connections_verification_url?: string;
48
+ }
49
+ export interface InstallParams {
50
+ /** the scopes to add the application to the server with */
51
+ scopes: string[];
52
+ /** the permissions to request for the bot role */
53
+ permissions: string;
40
54
  }
41
55
  /** https://discord.com/developers/docs/resources/application#application-object-application-flags */
42
56
  export declare enum ApplicationFlag {
@@ -45,9 +59,12 @@ export declare enum ApplicationFlag {
45
59
  GATEWAY_GUILD_MEMBERS = 16384,
46
60
  GATEWAY_GUILD_MEMBERS_LIMITED = 32768,
47
61
  VERIFICATION_PENDING_GUILD_LIMIT = 65536,
48
- EMBEDDED = 131072
62
+ EMBEDDED = 131072,
63
+ GATEWAY_MESSAGE_CONTENT = 262144,
64
+ GATEWAY_MESSAGE_CONTENT_LIMITED = 524288,
65
+ APPLICATION_COMMAND_BADGE = 8388608
49
66
  }
50
- /** https://discord.com/developers/docs/topics/gateway#ready-ready-event-fields */
67
+ /** https://discord.com/developers/docs/topics/gateway-events#ready-ready-event-fields */
51
68
  export interface ReadyEvent {
52
69
  /** gateway version */
53
70
  v: integer;
@@ -57,6 +74,8 @@ export interface ReadyEvent {
57
74
  guilds: Partial<Guild>[];
58
75
  /** used for resuming connections */
59
76
  session_id: string;
77
+ /** gateway URL for resuming connections */
78
+ resume_gateway_url: string;
60
79
  /** the shard information associated with this session, if sent when identifying */
61
80
  shard?: [shard_id: integer, num_shards: integer];
62
81
  /** contains id and flags */
@@ -1,8 +1,14 @@
1
- import { Channel, integer, Integration, snowflake, User, Webhook } from '.';
1
+ import { ApplicationCommand, AutoModerationRule, Channel, GuildScheduledEvent, integer, Integration, snowflake, User, Webhook } from '.';
2
2
  /** https://discord.com/developers/docs/resources/audit-log#audit-log-object-audit-log-structure */
3
3
  export interface AuditLog {
4
+ /** list of application commands referenced in the audit log */
5
+ application_commands: ApplicationCommand[];
4
6
  /** list of audit log entries */
5
7
  audit_log_entries: AuditLog.Entry[];
8
+ /** list of auto moderation rules referenced in the audit log */
9
+ auto_moderation_rules: AutoModerationRule[];
10
+ /** list of guild scheduled events referenced in the audit log */
11
+ guild_scheduled_events: GuildScheduledEvent[];
6
12
  /** list of partial integration objects */
7
13
  integrations: Partial<Integration>[];
8
14
  /** list of threads found in the audit log* */
@@ -143,6 +149,12 @@ export declare namespace AuditLog {
143
149
  }
144
150
  /** https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-optional-audit-entry-info */
145
151
  interface OptionalInfo {
152
+ /** ID of the app whose permissions were targeted */
153
+ application_id: snowflake;
154
+ /** name of the Auto Moderation rule that was triggered */
155
+ auto_moderation_rule_name: string;
156
+ /** trigger type of the Auto Moderation rule that was triggered */
157
+ auto_moderation_rule_trigger_type: string;
146
158
  /** channel in which the entities were targeted */
147
159
  channel_id: snowflake;
148
160
  /** number of entities that were targeted */
@@ -171,13 +183,15 @@ export declare namespace AuditLog {
171
183
  }
172
184
  /** https://discord.com/developers/docs/resources/audit-log#get-guild-audit-log-query-string-params */
173
185
  interface GetParams {
174
- /** filter the log for actions made by a user */
186
+ /** entries from a specific user ID */
175
187
  user_id?: snowflake;
176
- /** the type of audit log event */
188
+ /** entries for a specific audit log event */
177
189
  action_type?: Type;
178
- /** filter the log before a certain entry id */
190
+ /** entries that preceded a specific audit log entry ID */
179
191
  before?: snowflake;
180
- /** how many entries are returned (default 50, minimum 1, maximum 100) */
192
+ /** entries that succeeded a specific audit log entry ID */
193
+ after?: snowflake;
194
+ /** maximum number of entries (between 1-100) to return, defaults to 50 */
181
195
  limit?: integer;
182
196
  }
183
197
  }
@@ -55,6 +55,8 @@ export declare namespace AutoModerationRule {
55
55
  interface TriggerMetadata {
56
56
  /** associated with `KEYWORD`: substrings which will be searched for in content */
57
57
  keyword_filter: string[];
58
+ /** regular expression patterns which will be matched against content (Maximum of 10) */
59
+ regex_patterns: string[];
58
60
  /** associated with `KEYWORD_PRESET`: the internally pre-defined wordsets which will be searched for in content */
59
61
  presets: KeywordPresetType[];
60
62
  /** associated with `KEYWORD_PRESET`: substrings which will be exempt from triggering the preset trigger type */
@@ -8,14 +8,14 @@ export interface Ban {
8
8
  }
9
9
  export declare namespace Ban {
10
10
  namespace Event {
11
- /** https://discord.com/developers/docs/topics/gateway#guild-ban-add-guild-ban-add-event-fields */
11
+ /** https://discord.com/developers/docs/topics/gateway-events#guild-ban-add-guild-ban-add-event-fields */
12
12
  interface Add {
13
13
  /** id of the guild */
14
14
  guild_id: snowflake;
15
15
  /** the banned user */
16
16
  user: User;
17
17
  }
18
- /** https://discord.com/developers/docs/topics/gateway#guild-ban-remove-guild-ban-remove-event-fields */
18
+ /** https://discord.com/developers/docs/topics/gateway-events#guild-ban-remove-guild-ban-remove-event-fields */
19
19
  interface Remove {
20
20
  /** id of the guild */
21
21
  guild_id: snowflake;
@@ -34,10 +34,10 @@ export declare namespace Ban {
34
34
  }
35
35
  /** @see https://discord.com/developers/docs/resources/guild#create-guild-ban-json-params */
36
36
  interface CreateParams {
37
- /** number of days to delete messages for (0-7) */
37
+ /** number of days to delete messages for (0-7) (deprecated) */
38
38
  delete_message_days?: integer;
39
- /** reason for the ban (deprecated) */
40
- reason?: string;
39
+ /** number of seconds to delete messages for, between 0 and 604800 (7 days) */
40
+ delete_message_seconds?: integer;
41
41
  }
42
42
  }
43
43
  declare module './gateway' {
@@ -1,4 +1,4 @@
1
- import { GuildMember, integer, snowflake, timestamp, User } from '.';
1
+ import { GuildMember, integer, snowflake, ThreadMember, ThreadMetadata, timestamp, User } from '.';
2
2
  /** https://discord.com/developers/docs/resources/channel#channel-object-channel-structure */
3
3
  export interface Channel {
4
4
  /** the id of this channel */
@@ -41,8 +41,45 @@ export interface Channel {
41
41
  rtc_region?: string;
42
42
  /** the camera video quality mode of the voice channel, 1 when not present */
43
43
  video_quality_mode?: integer;
44
+ /** number of messages (not including the initial message or deleted messages) in a thread. */
45
+ message_count?: integer;
46
+ /** an approximate count of users in a thread, stops counting at 50 */
47
+ member_count?: integer;
48
+ /** thread-specific fields not needed by other channels */
49
+ thread_metadata?: ThreadMetadata;
50
+ /** thread member object for the current user, if they have joined the thread, only included on certain API endpoints */
51
+ member?: ThreadMember;
52
+ /** default duration, copied onto newly created threads, in minutes, threads will stop showing in the channel list after the specified period of inactivity, can be set to: 60, 1440, 4320, 10080 */
53
+ default_auto_archive_duration?: integer;
44
54
  /** computed permissions for the invoking user in the channel, including overwrites, only included when part of the resolved data received on a slash command interaction */
45
55
  permissions?: string;
56
+ /** channel flags combined as a bitfield */
57
+ flags?: integer;
58
+ /** number of messages ever sent in a thread, it's similar to message_count on message creation, but will not decrement the number when a message is deleted */
59
+ total_message_sent?: integer;
60
+ /** the set of tags that can be used in a GUILD_FORUM channel */
61
+ available_tags?: ForumTag[];
62
+ /** the IDs of the set of tags that have been applied to a thread in a GUILD_FORUM channel */
63
+ applied_tags?: snowflake[];
64
+ /** the emoji to show in the add reaction button on a thread in a GUILD_FORUM channel */
65
+ default_reaction_emoji?: DefaultReaction;
66
+ /** the initial rate_limit_per_user to set on newly created threads in a channel. this field is copied to the thread at creation time and does not live update. */
67
+ default_thread_rate_limit_per_user?: integer;
68
+ /** the default sort order type used to order posts in GUILD_FORUM channels. Defaults to null, which indicates a preferred sort order hasn't been set by a channel admin */
69
+ default_sort_order?: integer;
70
+ /** the default forum layout view used to display posts in GUILD_FORUM channels. Defaults to 0, which indicates a layout view has not been set by a channel admin */
71
+ default_forum_layout?: integer;
72
+ }
73
+ /** https://discord.com/developers/docs/resources/channel#role-subscription-data-object */
74
+ export interface RoleSubscriptionData {
75
+ /** the id of the sku and listing that the user is subscribed to */
76
+ role_subscription_listing_id: snowflake;
77
+ /** the name of the tier that the user is subscribed to */
78
+ tier_name: string;
79
+ /** the cumulative number of months that the user has been subscribed for */
80
+ total_months_subscribed: integer;
81
+ /** whether this notification is for a renewal rather than a new purchase */
82
+ is_renewal: boolean;
46
83
  }
47
84
  export declare namespace Channel {
48
85
  /** https://discord.com/developers/docs/resources/channel#channel-object-channel-types */
@@ -206,11 +243,16 @@ export interface FollowedChannel {
206
243
  webhook_id: snowflake;
207
244
  }
208
245
  /** https://discord.com/developers/docs/resources/channel#overwrite-object-overwrite-structure */
246
+ export declare enum OverwriteType {
247
+ ROLE = 0,
248
+ MEMBER = 1
249
+ }
250
+ /** https://discord.com/developers/docs/resources/channel#overwrite-object-overwrite-structure */
209
251
  export interface Overwrite {
210
252
  /** role or user id */
211
253
  id: snowflake;
212
254
  /** either 0 (role) or 1 (member) */
213
- type: integer;
255
+ type: OverwriteType;
214
256
  /** permission bit set */
215
257
  allow: string;
216
258
  /** permission bit set */
@@ -242,7 +284,7 @@ export interface ChannelUpdateEvent extends Channel {
242
284
  }
243
285
  export interface ChannelDeleteEvent extends Channel {
244
286
  }
245
- /** https://discord.com/developers/docs/topics/gateway#channel-pins-update-channel-pins-update-event-fields */
287
+ /** https://discord.com/developers/docs/topics/gateway-events#channel-pins-update-channel-pins-update-event-fields */
246
288
  export interface ChannelPinsUpdateEvent {
247
289
  /** the id of the guild */
248
290
  guild_id?: snowflake;
@@ -251,7 +293,7 @@ export interface ChannelPinsUpdateEvent {
251
293
  /** the time at which the most recent pinned message was pinned */
252
294
  last_pin_timestamp?: timestamp;
253
295
  }
254
- /** https://discord.com/developers/docs/topics/gateway#typing-start-typing-start-event-fields */
296
+ /** https://discord.com/developers/docs/topics/gateway-events#typing-start-typing-start-event-fields */
255
297
  export interface TypingStartEvent {
256
298
  /** id of the channel */
257
299
  channel_id: snowflake;
@@ -264,6 +306,26 @@ export interface TypingStartEvent {
264
306
  /** the member who started typing if this happened in a guild */
265
307
  member?: GuildMember;
266
308
  }
309
+ /** https://discord.com/developers/docs/resources/channel#forum-tag-object */
310
+ export interface ForumTag {
311
+ /** the id of the tag */
312
+ id: snowflake;
313
+ /** the name of the tag (0-20 characters) */
314
+ name: string;
315
+ /** whether this tag can only be added to or removed from threads by a member with the MANAGE_THREADS permission */
316
+ moderated: boolean;
317
+ /** the id of a guild's custom emoji */
318
+ emoji_id?: snowflake;
319
+ /** the unicode character of the emoji */
320
+ emoji_name?: string;
321
+ }
322
+ /** https://discord.com/developers/docs/resources/channel#default-reaction-object */
323
+ export interface DefaultReaction {
324
+ /** the id of a guild's custom emoji */
325
+ emoji_id?: snowflake;
326
+ /** the unicode character of the emoji */
327
+ emoji_name?: string;
328
+ }
267
329
  declare module './gateway' {
268
330
  interface GatewayEvents {
269
331
  /** new guild channel created */
@@ -1,4 +1,4 @@
1
- import { Channel, Locale, snowflake } from '.';
1
+ import { Channel, integer, Locale, snowflake } from '.';
2
2
  /** https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-structure */
3
3
  export interface ApplicationCommand {
4
4
  /** unique id of the command */
@@ -25,6 +25,8 @@ export interface ApplicationCommand {
25
25
  dm_permission?: boolean;
26
26
  /** whether the command is enabled by default when the app is added to a guild */
27
27
  default_permission?: boolean;
28
+ /** Indicates whether the command is age-restricted, defaults to false */
29
+ nsfw?: boolean;
28
30
  /** autoincrementing version identifier updated during substantial record changes */
29
31
  version: snowflake;
30
32
  }
@@ -44,8 +46,12 @@ export declare namespace ApplicationCommand {
44
46
  type: OptionType;
45
47
  /** 1-32 character name */
46
48
  name: string;
49
+ /** Localization dictionary for the `name` field. Values follow the same restrictions as `name` */
50
+ name_localizations?: Record<Locale, string>;
47
51
  /** 1-100 character description */
48
52
  description: string;
53
+ /** Localization dictionary for the `description` field. Values follow the same restrictions as `description` */
54
+ description_localizations?: Record<Locale, string>;
49
55
  /** if the parameter is required or optional--default false */
50
56
  required?: boolean;
51
57
  /** choices for STRING, INTEGER, and NUMBER types for the user to pick from, max 25 */
@@ -54,6 +60,16 @@ export declare namespace ApplicationCommand {
54
60
  options?: Option[];
55
61
  /** if the option is a channel type, the channels shown will be restricted to these types */
56
62
  channel_types?: Channel.Type[];
63
+ /** if the option is an `INTEGER` or `NUMBER` type, the minimum value permitted. integer for `INTEGER` options, double for `NUMBER` options */
64
+ min_value?: number;
65
+ /** if the option is an `INTEGER` or `NUMBER` type, the maximum value permitted. integer for `INTEGER` options, double for `NUMBER` options */
66
+ max_value?: number;
67
+ /** For option type `STRING`, the minimum allowed length (minimum of 0, maximum of 6000) */
68
+ min_length?: integer;
69
+ /** For option type `STRING`, the minimum allowed length (maximum of 1, maximum of 6000) */
70
+ max_length?: integer;
71
+ /** If autocomplete interactions are enabled for this `STRING`, `INTEGER`, or `NUMBER` type option */
72
+ autocomplete?: boolean;
57
73
  }
58
74
  /** https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-type */
59
75
  enum OptionType {
@@ -70,7 +86,9 @@ export declare namespace ApplicationCommand {
70
86
  /** Includes users and roles */
71
87
  MENTIONABLE = 9,
72
88
  /** Any double between -2^53 and 2^53 */
73
- NUMBER = 10
89
+ NUMBER = 10,
90
+ /** attachment object */
91
+ ATTACHMENT = 11
74
92
  }
75
93
  /** https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-choice-structure */
76
94
  interface OptionChoice {
@@ -78,6 +96,8 @@ export declare namespace ApplicationCommand {
78
96
  name: string;
79
97
  /** value of the choice, up to 100 characters if string */
80
98
  value: string | number;
99
+ /** localization dictionary for the name field. Values follow the same restrictions as name */
100
+ name_localizations?: Record<Locale, string>;
81
101
  }
82
102
  /** https://discord.com/developers/docs/interactions/application-commands#application-command-permissions-object-guild-application-command-permissions-structure */
83
103
  interface GuildPermissions {
@@ -115,25 +135,45 @@ export declare namespace ApplicationCommand {
115
135
  interface Create {
116
136
  /** 1-32 character name */
117
137
  name: string;
138
+ /** localization dictionary for the name field. Values follow the same restrictions as name */
139
+ name_localizations?: Record<Locale, string>;
118
140
  /** 1-100 character description */
119
- description: string;
141
+ description?: string;
142
+ /** localization dictionary for the description field. Values follow the same restrictions as description */
143
+ description_localizations?: Record<Locale, string>;
120
144
  /** the parameters for the command */
121
145
  options?: Option[];
146
+ /** set of permissions represented as a bit set */
147
+ default_member_permissions?: string;
148
+ /** Indicates whether the command is available in DMs with the app, only for globally-scoped commands. By default, commands are visible. */
149
+ dm_permission?: boolean;
122
150
  /** whether the command is enabled by default when the app is added to a guild */
123
151
  default_permission?: boolean;
124
152
  /** the type of command, defaults 1 if not set */
125
153
  type?: Type;
154
+ /** indicates whether the command is age-restricted */
155
+ nsfw?: boolean;
126
156
  }
127
157
  /** https://discord.com/developers/docs/interactions/application-commands#edit-global-application-command-json-params */
128
158
  interface Edit {
129
159
  /** 1-32 character name */
130
- name?: string;
160
+ name: string;
161
+ /** localization dictionary for the name field. Values follow the same restrictions as name */
162
+ name_localizations?: Record<Locale, string>;
131
163
  /** 1-100 character description */
132
164
  description?: string;
165
+ /** localization dictionary for the description field. Values follow the same restrictions as description */
166
+ description_localizations?: Record<Locale, string>;
133
167
  /** the parameters for the command */
134
168
  options?: Option[];
169
+ /** set of permissions represented as a bit set */
170
+ default_member_permissions?: string;
171
+ /** Indicates whether the command is available in DMs with the app, only for globally-scoped commands. By default, commands are visible. */
172
+ dm_permission?: boolean;
135
173
  /** whether the command is enabled by default when the app is added to a guild */
136
174
  default_permission?: boolean;
175
+ /** indicates whether the command is age-restricted */
176
+ nsfw?: boolean;
137
177
  }
138
178
  /** https://discord.com/developers/docs/interactions/application-commands#edit-application-command-permissions-json-params */
139
179
  interface EditPermissions {
@@ -1,31 +1,5 @@
1
- import { Emoji, integer } from '.';
2
- /** https://discord.com/developers/docs/interactions/message-components#component-object-component-structure */
3
- export interface Component {
4
- /** component type */
5
- type: ComponentType;
6
- /** a developer-defined identifier for the component, max 100 characters */
7
- custom_id?: string;
8
- /** whether the component is disabled, default false */
9
- disabled?: boolean;
10
- /** one of button styles */
11
- style?: integer;
12
- /** text that appears on the button, max 80 characters */
13
- label?: string;
14
- /** name, id, and animated */
15
- emoji?: Partial<Emoji>;
16
- /** a url for link-style buttons */
17
- url?: string;
18
- /** the choices in the select, max 25 */
19
- options?: SelectOption[];
20
- /** custom placeholder text if nothing is selected, max 100 characters */
21
- placeholder?: string;
22
- /** the minimum number of items that must be chosen; default 1, min 0, max 25 */
23
- min_values?: integer;
24
- /** the maximum number of items that can be chosen; default 1, max 25 */
25
- max_values?: integer;
26
- /** a list of child components */
27
- components?: Component[];
28
- }
1
+ import { Channel, Emoji, integer } from '.';
2
+ export type Component = Button | SelectMenu | TextInput | ActionRow;
29
3
  /** https://discord.com/developers/docs/interactions/message-components#component-object-component-types */
30
4
  export declare enum ComponentType {
31
5
  /** A container for other components */
@@ -35,14 +9,27 @@ export declare enum ComponentType {
35
9
  /** A select menu for picking from choices */
36
10
  SELECT_MENU = 3,
37
11
  /** A text input object */
38
- TEXT_INPUT = 4
12
+ TEXT_INPUT = 4,
13
+ /** Select menu for users */
14
+ USER_SELECT = 5,
15
+ /** Select menu for roles */
16
+ ROLE_SELECT = 6,
17
+ /** Select menu for mentionables (users and roles) */
18
+ MENTIONABLE_SELECT = 7,
19
+ /** Select menu for channels */
20
+ CHANNEL_SELECT = 8
21
+ }
22
+ /** https://discord.com/developers/docs/interactions/message-components#action-rows */
23
+ export interface ActionRow {
24
+ type: ComponentType.ACTION_ROW;
25
+ components: Component[];
39
26
  }
40
27
  /** https://discord.com/developers/docs/interactions/message-components#button-object-button-structure */
41
28
  export interface Button {
42
29
  /** 2 for a button */
43
30
  type: ComponentType.BUTTON;
44
31
  /** one of button styles */
45
- style: integer;
32
+ style: ButtonStyles;
46
33
  /** text that appears on the button, max 80 characters */
47
34
  label?: string;
48
35
  /** name, id, and animated */
@@ -54,14 +41,29 @@ export interface Button {
54
41
  /** whether the button is disabled (default false) */
55
42
  disabled?: boolean;
56
43
  }
44
+ /** https://discord.com/developers/docs/interactions/message-components#button-object-button-styles */
45
+ export declare const enum ButtonStyles {
46
+ /** blurple */
47
+ PRIMARY = 1,
48
+ /** grey */
49
+ SECONDARY = 2,
50
+ /** green */
51
+ SUCCESS = 3,
52
+ /** red */
53
+ DANGER = 4,
54
+ /** grey, navigates to a URL */
55
+ LINK = 5
56
+ }
57
57
  /** https://discord.com/developers/docs/interactions/message-components#select-menu-object-select-menu-structure */
58
58
  export interface SelectMenu {
59
59
  /** 3 for a select menu */
60
- type: ComponentType.SELECT_MENU;
60
+ type: ComponentType.SELECT_MENU | ComponentType.USER_SELECT | ComponentType.ROLE_SELECT | ComponentType.MENTIONABLE_SELECT | ComponentType.CHANNEL_SELECT;
61
61
  /** a developer-defined identifier for the button, max 100 characters */
62
62
  custom_id: string;
63
63
  /** the choices in the select, max 25 */
64
64
  options: SelectOption[];
65
+ /** list of channel types to include in the channel select component (type 8) */
66
+ channel_types?: Channel.Type[];
65
67
  /** custom placeholder text if nothing is selected, max 100 characters */
66
68
  placeholder?: string;
67
69
  /** the minimum number of items that must be chosen; default 1, min 0, max 25 */
@@ -20,7 +20,7 @@ export interface Emoji {
20
20
  }
21
21
  export declare namespace Emoji {
22
22
  namespace Event {
23
- /** https://discord.com/developers/docs/topics/gateway#guild-emojis-update-guild-emojis-update-event-fields */
23
+ /** https://discord.com/developers/docs/topics/gateway-events#guild-emojis-update-guild-emojis-update-event-fields */
24
24
  interface Update {
25
25
  /** id of the guild */
26
26
  guild_id: snowflake;
@@ -1,5 +1,5 @@
1
1
  import { Activity, integer, snowflake, StatusType } from '.';
2
- /** https://discord.com/developers/docs/topics/gateway#payloads-gateway-payload-structure */
2
+ /** https://discord.com/developers/docs/topics/gateway-events#payload-structure */
3
3
  export interface GatewayPayloadStructure<O extends GatewayOpcode, T extends keyof GatewayEvents, D> {
4
4
  /** opcode for the payload */
5
5
  op: O;
@@ -173,11 +173,11 @@ export declare enum GatewayIntent {
173
173
  * - AUTO_MODERATION_RULE_UPDATE
174
174
  * - AUTO_MODERATION_RULE_DELETE
175
175
  */
176
- AUTO_MODERATION_CONFIGURATION = 131072,
176
+ AUTO_MODERATION_CONFIGURATION = 1048576,
177
177
  /**
178
178
  * - AUTO_MODERATION_ACTION_EXECUTION
179
179
  */
180
- AUTO_MODERATION_EXECUTION = 262144
180
+ AUTO_MODERATION_EXECUTION = 2097152
181
181
  }
182
182
  export interface GatewayParams {
183
183
  [GatewayOpcode.HELLO]: HelloParams;
@@ -187,10 +187,10 @@ export interface GatewayParams {
187
187
  [GatewayOpcode.VOICE_STATE_UPDATE]: VoiceStateUpdateParams;
188
188
  [GatewayOpcode.PRESENCE_UPDATE]: PresenceUpdateParams;
189
189
  }
190
- /** https://discord.com/developers/docs/topics/gateway#commands-and-events-gateway-events */
190
+ /** https://discord.com/developers/docs/topics/gateway-events#gateway-events */
191
191
  export interface GatewayEvents {
192
192
  }
193
- /** https://discord.com/developers/docs/topics/gateway#identify-identify-structure */
193
+ /** https://discord.com/developers/docs/topics/gateway-events#identify-identify-structure */
194
194
  export interface IdentifyParams {
195
195
  /** authentication token */
196
196
  token: string;
@@ -216,7 +216,7 @@ export interface ConnectionProperties {
216
216
  /** Your library name */
217
217
  device: string;
218
218
  }
219
- /** https://discord.com/developers/docs/topics/gateway#resume-resume-structure */
219
+ /** https://discord.com/developers/docs/topics/gateway-events#resume-resume-structure */
220
220
  export interface ResumeParams {
221
221
  /** session token */
222
222
  token: string;
@@ -225,7 +225,7 @@ export interface ResumeParams {
225
225
  /** last sequence number received */
226
226
  seq: integer;
227
227
  }
228
- /** https://discord.com/developers/docs/topics/gateway#request-guild-members-guild-request-members-structure */
228
+ /** https://discord.com/developers/docs/topics/gateway-events#request-guild-members-guild-request-members-structure */
229
229
  export interface RequestGuildMembersParams {
230
230
  /** id of the guild to get members for */
231
231
  guild_id: snowflake;
@@ -240,7 +240,7 @@ export interface RequestGuildMembersParams {
240
240
  /** nonce to identify the Guild Members Chunk response */
241
241
  nonce?: string;
242
242
  }
243
- /** https://discord.com/developers/docs/topics/gateway#update-voice-state-gateway-voice-state-update-structure */
243
+ /** https://discord.com/developers/docs/topics/gateway-events#update-voice-state-gateway-voice-state-update-structure */
244
244
  export interface VoiceStateUpdateParams {
245
245
  /** id of the guild */
246
246
  guild_id: snowflake;
@@ -251,7 +251,7 @@ export interface VoiceStateUpdateParams {
251
251
  /** is the client deafened */
252
252
  self_deaf: boolean;
253
253
  }
254
- /** https://discord.com/developers/docs/topics/gateway#update-presence-gateway-presence-update-structure */
254
+ /** https://discord.com/developers/docs/topics/gateway-events#update-presence-gateway-presence-update-structure */
255
255
  export interface PresenceUpdateParams {
256
256
  /** unix time (in milliseconds) of when the client went idle, or null if the client is not idle */
257
257
  since?: integer;
@@ -262,12 +262,12 @@ export interface PresenceUpdateParams {
262
262
  /** whether or not the client is afk */
263
263
  afk: boolean;
264
264
  }
265
- /** https://discord.com/developers/docs/topics/gateway#hello-hello-structure */
265
+ /** https://discord.com/developers/docs/topics/gateway-events#hello-hello-structure */
266
266
  export interface HelloParams {
267
267
  /** the interval (in milliseconds) the client should heartbeat with */
268
268
  heartbeat_interval: integer;
269
269
  }
270
- /** https://discord.com/developers/docs/topics/gateway#session-start-limit-object-session-start-limit-structure */
270
+ /** https://discord.com/developers/docs/topics/gateway-events#session-start-limit-object-session-start-limit-structure */
271
271
  export interface SessionStartLimit {
272
272
  /** The total number of session starts the current user is allowed */
273
273
  total: integer;
@@ -21,6 +21,8 @@ export interface GuildMember {
21
21
  pending?: boolean;
22
22
  /** total permissions of the member in the channel, including overwrites, returned when in the interaction object */
23
23
  permissions?: string;
24
+ /** when the user's timeout will expire and the user will be able to communicate in the guild again, null or a time in the past if the user is not timed out */
25
+ communication_disabled_until?: timestamp;
24
26
  }
25
27
  export declare namespace GuildMember {
26
28
  namespace Params {
@@ -89,19 +91,19 @@ export declare namespace GuildMember {
89
91
  }
90
92
  }
91
93
  namespace Event {
92
- /** https://discord.com/developers/docs/topics/gateway#guild-member-add-guild-member-add-extra-fields */
94
+ /** https://discord.com/developers/docs/topics/gateway-events#guild-member-add-guild-member-add-extra-fields */
93
95
  interface Add extends GuildMember {
94
96
  /** id of the guild */
95
97
  guild_id: snowflake;
96
98
  }
97
- /** https://discord.com/developers/docs/topics/gateway#guild-member-remove-guild-member-remove-event-fields */
99
+ /** https://discord.com/developers/docs/topics/gateway-events#guild-member-remove-guild-member-remove-event-fields */
98
100
  interface Remove {
99
101
  /** the id of the guild */
100
102
  guild_id: snowflake;
101
103
  /** the user who was removed */
102
104
  user: User;
103
105
  }
104
- /** https://discord.com/developers/docs/topics/gateway#guild-member-update-guild-member-update-event-fields */
106
+ /** https://discord.com/developers/docs/topics/gateway-events#guild-member-update-guild-member-update-event-fields */
105
107
  interface Update {
106
108
  /** the id of the guild */
107
109
  guild_id: snowflake;
@@ -123,8 +125,10 @@ export declare namespace GuildMember {
123
125
  mute?: boolean;
124
126
  /** whether the user has not yet passed the guild's Membership Screening requirements */
125
127
  pending?: boolean;
128
+ /** when the user's timeout will expire and the user will be able to communicate in the guild again, null or a time in the past if the user is not timed out */
129
+ communication_disabled_until?: timestamp;
126
130
  }
127
- /** https://discord.com/developers/docs/topics/gateway#guild-members-chunk-guild-members-chunk-event-fields */
131
+ /** https://discord.com/developers/docs/topics/gateway-events#guild-members-chunk-guild-members-chunk-event-fields */
128
132
  interface Chunk {
129
133
  /** the id of the guild */
130
134
  guild_id: snowflake;