@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.
- package/lib/index.js +145 -68
- package/lib/index.js.map +4 -4
- package/lib/types/application-role-connection.d.ts +51 -0
- package/lib/types/application.d.ts +22 -3
- package/lib/types/audit-log.d.ts +19 -5
- package/lib/types/auto-moderation.d.ts +2 -0
- package/lib/types/ban.d.ts +5 -5
- package/lib/types/channel.d.ts +66 -4
- package/lib/types/command.d.ts +43 -7
- package/lib/types/component.d.ts +33 -31
- package/lib/types/emoji.d.ts +1 -1
- package/lib/types/gateway.d.ts +22 -13
- package/lib/types/guild-member.d.ts +8 -4
- package/lib/types/guild.d.ts +24 -26
- package/lib/types/index.d.ts +1 -0
- package/lib/types/integration.d.ts +6 -6
- package/lib/types/interaction.d.ts +78 -45
- package/lib/types/invite.d.ts +5 -3
- package/lib/types/message.d.ts +15 -5
- package/lib/types/presence.d.ts +23 -24
- package/lib/types/reaction.d.ts +4 -4
- package/lib/types/role.d.ts +12 -4
- package/lib/types/scheduled-event.d.ts +6 -0
- package/lib/types/stage-instance.d.ts +4 -0
- package/lib/types/sticker.d.ts +4 -3
- package/lib/types/thread.d.ts +50 -7
- package/lib/types/user.d.ts +13 -2
- package/lib/types/voice.d.ts +1 -1
- package/lib/types/webhook.d.ts +6 -2
- package/lib/ws.d.ts +1 -2
- package/package.json +2 -2
|
@@ -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;
|
|
@@ -68,6 +85,8 @@ declare module './gateway' {
|
|
|
68
85
|
interface GatewayEvents {
|
|
69
86
|
/** contains the initial state information */
|
|
70
87
|
READY: ReadyEvent;
|
|
88
|
+
/** response to Resume */
|
|
89
|
+
RESUMED: {};
|
|
71
90
|
}
|
|
72
91
|
}
|
|
73
92
|
declare module './internal' {
|
package/lib/types/audit-log.d.ts
CHANGED
|
@@ -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
|
-
/**
|
|
186
|
+
/** entries from a specific user ID */
|
|
175
187
|
user_id?: snowflake;
|
|
176
|
-
/**
|
|
188
|
+
/** entries for a specific audit log event */
|
|
177
189
|
action_type?: Type;
|
|
178
|
-
/**
|
|
190
|
+
/** entries that preceded a specific audit log entry ID */
|
|
179
191
|
before?: snowflake;
|
|
180
|
-
/**
|
|
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 */
|
package/lib/types/ban.d.ts
CHANGED
|
@@ -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
|
-
/**
|
|
40
|
-
|
|
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' {
|
package/lib/types/channel.d.ts
CHANGED
|
@@ -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:
|
|
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 */
|
package/lib/types/command.d.ts
CHANGED
|
@@ -25,12 +25,10 @@ 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
|
-
/** for option type `STRING`, the minimum allowed length (minimum of `0`, maximum of `6000`) */
|
|
31
|
-
min_length?: integer;
|
|
32
|
-
/** for option type `STRING`, the maximum allowed length (minimum of `1`, maximum of `6000`) */
|
|
33
|
-
max_length?: integer;
|
|
34
32
|
}
|
|
35
33
|
export declare namespace ApplicationCommand {
|
|
36
34
|
/** https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-types */
|
|
@@ -48,8 +46,12 @@ export declare namespace ApplicationCommand {
|
|
|
48
46
|
type: OptionType;
|
|
49
47
|
/** 1-32 character name */
|
|
50
48
|
name: string;
|
|
49
|
+
/** Localization dictionary for the `name` field. Values follow the same restrictions as `name` */
|
|
50
|
+
name_localizations?: Record<Locale, string>;
|
|
51
51
|
/** 1-100 character description */
|
|
52
52
|
description: string;
|
|
53
|
+
/** Localization dictionary for the `description` field. Values follow the same restrictions as `description` */
|
|
54
|
+
description_localizations?: Record<Locale, string>;
|
|
53
55
|
/** if the parameter is required or optional--default false */
|
|
54
56
|
required?: boolean;
|
|
55
57
|
/** choices for STRING, INTEGER, and NUMBER types for the user to pick from, max 25 */
|
|
@@ -58,6 +60,16 @@ export declare namespace ApplicationCommand {
|
|
|
58
60
|
options?: Option[];
|
|
59
61
|
/** if the option is a channel type, the channels shown will be restricted to these types */
|
|
60
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;
|
|
61
73
|
}
|
|
62
74
|
/** https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-type */
|
|
63
75
|
enum OptionType {
|
|
@@ -74,7 +86,9 @@ export declare namespace ApplicationCommand {
|
|
|
74
86
|
/** Includes users and roles */
|
|
75
87
|
MENTIONABLE = 9,
|
|
76
88
|
/** Any double between -2^53 and 2^53 */
|
|
77
|
-
NUMBER = 10
|
|
89
|
+
NUMBER = 10,
|
|
90
|
+
/** attachment object */
|
|
91
|
+
ATTACHMENT = 11
|
|
78
92
|
}
|
|
79
93
|
/** https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-choice-structure */
|
|
80
94
|
interface OptionChoice {
|
|
@@ -82,6 +96,8 @@ export declare namespace ApplicationCommand {
|
|
|
82
96
|
name: string;
|
|
83
97
|
/** value of the choice, up to 100 characters if string */
|
|
84
98
|
value: string | number;
|
|
99
|
+
/** localization dictionary for the name field. Values follow the same restrictions as name */
|
|
100
|
+
name_localizations?: Record<Locale, string>;
|
|
85
101
|
}
|
|
86
102
|
/** https://discord.com/developers/docs/interactions/application-commands#application-command-permissions-object-guild-application-command-permissions-structure */
|
|
87
103
|
interface GuildPermissions {
|
|
@@ -119,25 +135,45 @@ export declare namespace ApplicationCommand {
|
|
|
119
135
|
interface Create {
|
|
120
136
|
/** 1-32 character name */
|
|
121
137
|
name: string;
|
|
138
|
+
/** localization dictionary for the name field. Values follow the same restrictions as name */
|
|
139
|
+
name_localizations?: Record<Locale, string>;
|
|
122
140
|
/** 1-100 character description */
|
|
123
|
-
description
|
|
141
|
+
description?: string;
|
|
142
|
+
/** localization dictionary for the description field. Values follow the same restrictions as description */
|
|
143
|
+
description_localizations?: Record<Locale, string>;
|
|
124
144
|
/** the parameters for the command */
|
|
125
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;
|
|
126
150
|
/** whether the command is enabled by default when the app is added to a guild */
|
|
127
151
|
default_permission?: boolean;
|
|
128
152
|
/** the type of command, defaults 1 if not set */
|
|
129
153
|
type?: Type;
|
|
154
|
+
/** indicates whether the command is age-restricted */
|
|
155
|
+
nsfw?: boolean;
|
|
130
156
|
}
|
|
131
157
|
/** https://discord.com/developers/docs/interactions/application-commands#edit-global-application-command-json-params */
|
|
132
158
|
interface Edit {
|
|
133
159
|
/** 1-32 character name */
|
|
134
|
-
name
|
|
160
|
+
name: string;
|
|
161
|
+
/** localization dictionary for the name field. Values follow the same restrictions as name */
|
|
162
|
+
name_localizations?: Record<Locale, string>;
|
|
135
163
|
/** 1-100 character description */
|
|
136
164
|
description?: string;
|
|
165
|
+
/** localization dictionary for the description field. Values follow the same restrictions as description */
|
|
166
|
+
description_localizations?: Record<Locale, string>;
|
|
137
167
|
/** the parameters for the command */
|
|
138
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;
|
|
139
173
|
/** whether the command is enabled by default when the app is added to a guild */
|
|
140
174
|
default_permission?: boolean;
|
|
175
|
+
/** indicates whether the command is age-restricted */
|
|
176
|
+
nsfw?: boolean;
|
|
141
177
|
}
|
|
142
178
|
/** https://discord.com/developers/docs/interactions/application-commands#edit-application-command-permissions-json-params */
|
|
143
179
|
interface EditPermissions {
|
package/lib/types/component.d.ts
CHANGED
|
@@ -1,31 +1,5 @@
|
|
|
1
|
-
import { Emoji, integer } from '.';
|
|
2
|
-
|
|
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:
|
|
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 */
|
package/lib/types/emoji.d.ts
CHANGED
|
@@ -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;
|
package/lib/types/gateway.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Activity, integer, snowflake, StatusType } from '.';
|
|
2
|
-
/** https://discord.com/developers/docs/topics/gateway#
|
|
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 =
|
|
176
|
+
AUTO_MODERATION_CONFIGURATION = 1048576,
|
|
177
177
|
/**
|
|
178
178
|
* - AUTO_MODERATION_ACTION_EXECUTION
|
|
179
179
|
*/
|
|
180
|
-
AUTO_MODERATION_EXECUTION =
|
|
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
|
|
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;
|
|
@@ -278,17 +278,26 @@ export interface SessionStartLimit {
|
|
|
278
278
|
/** The number of identify requests allowed per 5 seconds */
|
|
279
279
|
max_concurrency: integer;
|
|
280
280
|
}
|
|
281
|
+
/** https://discord.com/developers/docs/topics/gateway#get-gateway-example-response */
|
|
282
|
+
export interface GetGatewayResponse {
|
|
283
|
+
url: string;
|
|
284
|
+
}
|
|
285
|
+
/** https://discord.com/developers/docs/topics/gateway#get-gateway-bot-json-response */
|
|
286
|
+
export interface GetGatewayBotResponse extends GetGatewayResponse {
|
|
287
|
+
shards: integer;
|
|
288
|
+
session_start_limit: SessionStartLimit;
|
|
289
|
+
}
|
|
281
290
|
declare module './internal' {
|
|
282
291
|
interface Internal {
|
|
283
292
|
/**
|
|
284
293
|
* Returns an object with a single valid WSS URL, which the client can use for Connecting. Clients should cache this value and only call this endpoint to retrieve a new URL if they are unable to properly establish a connection using the cached version of the URL.
|
|
285
294
|
* @see https://discord.com/developers/docs/topics/gateway#get-gateway
|
|
286
295
|
*/
|
|
287
|
-
getGateway(): Promise<
|
|
296
|
+
getGateway(): Promise<GetGatewayResponse>;
|
|
288
297
|
/**
|
|
289
298
|
* Returns an object based on the information in Get Gateway, plus additional metadata that can help during the operation of large or sharded bots. Unlike the Get Gateway, this route should not be cached for extended periods of time as the value is not guaranteed to be the same per-call, and changes as the bot joins/leaves guilds.
|
|
290
299
|
* @see https://discord.com/developers/docs/topics/gateway#get-gateway-bot
|
|
291
300
|
*/
|
|
292
|
-
getGatewayBot(): Promise<
|
|
301
|
+
getGatewayBot(): Promise<GetGatewayBotResponse>;
|
|
293
302
|
}
|
|
294
303
|
}
|