@koishijs/plugin-adapter-discord 2.1.2 → 3.1.0

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.
@@ -1,368 +0,0 @@
1
- import { GuildMember, integer, snowflake, timestamp, User } from '.';
2
- /** https://discord.com/developers/docs/resources/channel#channel-object-channel-structure */
3
- export interface Channel {
4
- /** the id of this channel */
5
- id: snowflake;
6
- /** the type of channel */
7
- type: Channel.Type;
8
- /** the id of the guild (may be missing for some channel objects received over gateway guild dispatches) */
9
- guild_id?: snowflake;
10
- /** sorting position of the channel */
11
- position?: integer;
12
- /** explicit permission overwrites for members and roles */
13
- permission_overwrites?: Overwrite[];
14
- /** the name of the channel (1-100 characters) */
15
- name?: string;
16
- /** the channel topic (0-1024 characters) */
17
- topic?: string;
18
- /** whether the channel is nsfw */
19
- nsfw?: boolean;
20
- /** the id of the last message sent in this channel (may not point to an existing or valid message) */
21
- last_message_id?: snowflake;
22
- /** the bitrate (in bits) of the voice channel */
23
- bitrate?: integer;
24
- /** the user limit of the voice channel */
25
- user_limit?: integer;
26
- /** amount of seconds a user has to wait before sending another message (0-21600); bots, as well as users with the permission manage_messages or manage_channel, are unaffected */
27
- rate_limit_per_user?: integer;
28
- /** the recipients of the DM */
29
- recipients?: User[];
30
- /** icon hash */
31
- icon?: string;
32
- /** id of the creator of the group DM or thread */
33
- owner_id?: snowflake;
34
- /** application id of the group DM creator if it is bot-created */
35
- application_id?: snowflake;
36
- /** for guild channels: id of the parent category for a channel (each parent category can contain up to 50 channels), for threads: id of the text channel this thread was created */
37
- parent_id?: snowflake;
38
- /** when the last pinned message was pinned. This may be null in events such as GUILD_CREATE when a message is not pinned. */
39
- last_pin_timestamp?: timestamp;
40
- /** voice region id for the voice channel, automatic when set to null */
41
- rtc_region?: string;
42
- /** the camera video quality mode of the voice channel, 1 when not present */
43
- video_quality_mode?: integer;
44
- /** 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
- permissions?: string;
46
- }
47
- export declare namespace Channel {
48
- /** https://discord.com/developers/docs/resources/channel#channel-object-channel-types */
49
- enum Type {
50
- /** a text channel within a server */
51
- GUILD_TEXT = 0,
52
- /** a direct message between users */
53
- DM = 1,
54
- /** a voice channel within a server */
55
- GUILD_VOICE = 2,
56
- /** a direct message between multiple users */
57
- GROUP_DM = 3,
58
- /** an organizational category that contains up to 50 channels */
59
- GUILD_CATEGORY = 4,
60
- /** a channel that users can follow and crosspost into their own server */
61
- GUILD_NEWS = 5,
62
- /** a channel in which game developers can sell their game on Discord */
63
- GUILD_STORE = 6,
64
- /** a temporary sub-channel within a GUILD_NEWS channel */
65
- GUILD_NEWS_THREAD = 10,
66
- /** a temporary sub-channel within a GUILD_TEXT channel */
67
- GUILD_PUBLIC_THREAD = 11,
68
- /** a temporary sub-channel within a GUILD_TEXT channel that is only viewable by those invited and those with the MANAGE_THREADS permission */
69
- GUILD_PRIVATE_THREAD = 12,
70
- /** a voice channel for hosting events with an audience */
71
- GUILD_STAGE_VOICE = 13
72
- }
73
- namespace Params {
74
- /** https://discord.com/developers/docs/resources/user#create-dm-json-params */
75
- interface CreateDM {
76
- /** the recipient to open a DM channel with */
77
- recipient_id: snowflake;
78
- }
79
- /** https://discord.com/developers/docs/resources/user#create-group-dm-json-params */
80
- interface CreateGroupDM {
81
- /** access tokens of users that have granted your app the gdm.join scope */
82
- access_tokens: string[];
83
- /** a dictionary of user ids to their respective nicknames */
84
- nicks: Record<string, string>;
85
- }
86
- /** https://discord.com/developers/docs/resources/guild#create-guild-channel-json-params */
87
- interface Create {
88
- /** channel name (1-100 characters) */
89
- name: string;
90
- /** the type of channel */
91
- type: integer;
92
- /** channel topic (0-1024 characters) */
93
- topic: string;
94
- /** the bitrate (in bits) of the voice channel (voice only) */
95
- bitrate: integer;
96
- /** the user limit of the voice channel (voice only) */
97
- user_limit: integer;
98
- /** amount of seconds a user has to wait before sending another message (0-21600); bots, as well as users with the permission manage_messages or manage_channel, are unaffected */
99
- rate_limit_per_user: integer;
100
- /** sorting position of the channel */
101
- position: integer;
102
- /** the channel's permission overwrites */
103
- permission_overwrites: Overwrite[];
104
- /** id of the parent category for a channel */
105
- parent_id: snowflake;
106
- /** whether the channel is nsfw */
107
- nsfw: boolean;
108
- }
109
- /** https://discord.com/developers/docs/resources/guild#modify-guild-channel-positions-json-params */
110
- interface ModifyPositions {
111
- /** channel id */
112
- id: snowflake;
113
- /** sorting position of the channel */
114
- position?: integer;
115
- /** syncs the permission overwrites with the new parent, if moving to a new category */
116
- lock_permissions?: boolean;
117
- /** the new parent ID for the channel that is moved */
118
- parent_id?: snowflake;
119
- }
120
- type Modify = Modify.GroupDM | Modify.GuildChannel | Modify.Thread;
121
- namespace Modify {
122
- /** https://discord.com/developers/docs/resources/channel#modify-channel-json-params-group-dm */
123
- interface GroupDM {
124
- /** 1-100 character channel name */
125
- name: string;
126
- /** base64 encoded icon */
127
- icon: string;
128
- }
129
- /** https://discord.com/developers/docs/resources/channel#modify-channel-json-params-guild-channel */
130
- interface GuildChannel {
131
- /** 1-100 character channel name */
132
- name: string;
133
- /** the type of channel; only conversion between text and news is supported and only in guilds with the "NEWS" feature */
134
- type: integer;
135
- /** the position of the channel in the left-hand listing */
136
- position?: integer;
137
- /** 0-1024 character channel topic */
138
- topic?: string;
139
- /** whether the channel is nsfw */
140
- nsfw?: boolean;
141
- /** amount of seconds a user has to wait before sending another message (0-21600); bots, as well as users with the permission manage_messages or manage_channel, are unaffected */
142
- rate_limit_per_user?: integer;
143
- /** the bitrate (in bits) of the voice channel; 8000 to 96000 (128000 for VIP servers) */
144
- bitrate?: integer;
145
- /** the user limit of the voice channel; 0 refers to no limit, 1 to 99 refers to a user limit */
146
- user_limit?: integer;
147
- /** channel or category-specific permissions */
148
- permission_overwrites?: Overwrite[];
149
- /** id of the new parent category for a channel */
150
- parent_id?: snowflake;
151
- /** channel voice region id, automatic when set to null */
152
- rtc_region?: string;
153
- /** the camera video quality mode of the voice channel */
154
- video_quality_mode?: integer;
155
- /** the default duration that the clients use (not the API) for newly created threads in the channel, in minutes, to automatically archive the thread after recent activity */
156
- default_auto_archive_duration?: integer;
157
- }
158
- /** https://discord.com/developers/docs/resources/channel#modify-channel-json-params-thread */
159
- interface Thread {
160
- /** 1-100 character channel name */
161
- name: string;
162
- /** whether the thread is archived */
163
- archived: boolean;
164
- /** duration in minutes to automatically archive the thread after recent activity, can be set to: 60, 1440, 4320, 10080 */
165
- auto_archive_duration: integer;
166
- /** whether the thread is locked; when a thread is locked, only users with MANAGE_THREADS can unarchive it */
167
- locked: boolean;
168
- /** whether non-moderators can add other non-moderators to a thread; only available on private threads */
169
- invitable: boolean;
170
- /** amount of seconds a user has to wait before sending another message (0-21600); bots, as well as users with the permission manage_messages, manage_thread, or manage_channel, are unaffected */
171
- rate_limit_per_user?: integer;
172
- }
173
- }
174
- /** https://discord.com/developers/docs/resources/channel#edit-channel-permissions-json-params */
175
- interface EditPermissions {
176
- /** the bitwise value of all allowed permissions */
177
- allow: string;
178
- /** the bitwise value of all disallowed permissions */
179
- deny: string;
180
- /** 0 for a role or 1 for a member */
181
- type: integer;
182
- }
183
- /** https://discord.com/developers/docs/resources/channel#follow-news-channel-json-params */
184
- interface Follow {
185
- /** id of target channel */
186
- webhook_channel_id: snowflake;
187
- }
188
- /** https://discord.com/developers/docs/resources/channel#group-dm-add-recipient-json-params */
189
- interface AddRecipient {
190
- /** access token of a user that has granted your app the gdm.join scope */
191
- access_token: string;
192
- /** nickname of the user being added */
193
- nick: string;
194
- }
195
- }
196
- }
197
- /** https://discord.com/developers/docs/resources/channel#followed-channel-object-followed-channel-structure */
198
- export interface FollowedChannel {
199
- /** source channel id */
200
- channel_id: snowflake;
201
- /** created target webhook id */
202
- webhook_id: snowflake;
203
- }
204
- /** https://discord.com/developers/docs/resources/channel#overwrite-object-overwrite-structure */
205
- export interface Overwrite {
206
- /** role or user id */
207
- id: snowflake;
208
- /** either 0 (role) or 1 (member) */
209
- type: integer;
210
- /** permission bit set */
211
- allow: string;
212
- /** permission bit set */
213
- deny: string;
214
- }
215
- /** https://discord.com/developers/docs/resources/channel#allowed-mentions-object-allowed-mention-types */
216
- export declare enum AllowedMentionType {
217
- /** Controls role mentions */
218
- ROLE_MENTIONS = "roles",
219
- /** Controls user mentions */
220
- USER_MENTIONS = "users",
221
- /** Controls @everyone and @here mentions */
222
- EVERYONE_MENTIONS = "everyone"
223
- }
224
- /** https://discord.com/developers/docs/resources/channel#allowed-mentions-object-allowed-mentions-structure */
225
- export interface AllowedMentions {
226
- /** An array of allowed mention types to parse from the content. */
227
- parse: AllowedMentionType[];
228
- /** Array of role_ids to mention (Max size of 100) */
229
- roles: snowflake[];
230
- /** Array of user_ids to mention (Max size of 100) */
231
- users: snowflake[];
232
- /** For replies, whether to mention the author of the message being replied to (default false) */
233
- replied_user: boolean;
234
- }
235
- export interface ChannelCreateEvent extends Channel {
236
- }
237
- export interface ChannelUpdateEvent extends Channel {
238
- }
239
- export interface ChannelDeleteEvent extends Channel {
240
- }
241
- /** https://discord.com/developers/docs/topics/gateway#channel-pins-update-channel-pins-update-event-fields */
242
- export interface ChannelPinsUpdateEvent {
243
- /** the id of the guild */
244
- guild_id?: snowflake;
245
- /** the id of the channel */
246
- channel_id: snowflake;
247
- /** the time at which the most recent pinned message was pinned */
248
- last_pin_timestamp?: timestamp;
249
- }
250
- /** https://discord.com/developers/docs/topics/gateway#typing-start-typing-start-event-fields */
251
- export interface TypingStartEvent {
252
- /** id of the channel */
253
- channel_id: snowflake;
254
- /** id of the guild */
255
- guild_id?: snowflake;
256
- /** id of the user */
257
- user_id: snowflake;
258
- /** unix time (in seconds) of when the user started typing */
259
- timestamp: integer;
260
- /** the member who started typing if this happened in a guild */
261
- member?: GuildMember;
262
- }
263
- declare module './gateway' {
264
- interface GatewayEvents {
265
- /** new guild channel created */
266
- CHANNEL_CREATE: ChannelCreateEvent;
267
- /** channel was updated */
268
- CHANNEL_UPDATE: ChannelUpdateEvent;
269
- /** channel was deleted */
270
- CHANNEL_DELETE: ChannelDeleteEvent;
271
- /** message was pinned or unpinned */
272
- CHANNEL_PINS_UPDATE: ChannelPinsUpdateEvent;
273
- /** user started typing in a channel */
274
- TYPING_START: TypingStartEvent;
275
- }
276
- }
277
- export interface ChannelPosition {
278
- /** channel id */
279
- channel_id: snowflake;
280
- /** sorting position of the channel */
281
- position?: integer;
282
- /** syncs the permission overwrites with the new parent, if moving to a new category */
283
- lock_permissions?: boolean;
284
- /** the new parent ID for the channel that is moved */
285
- parent_id?: snowflake;
286
- }
287
- declare module './internal' {
288
- interface Internal {
289
- /**
290
- * Create a new DM channel with a user. Returns a DM channel object.
291
- * @see https://discord.com/developers/docs/resources/user#create-dm
292
- */
293
- createDM(params: Channel.Params.CreateDM): Promise<void>;
294
- /**
295
- * Create a new group DM channel with multiple users. Returns a DM channel object. This endpoint was intended to be used with the now-deprecated GameBridge SDK. DMs created with this endpoint will not be shown in the Discord client
296
- * @see https://discord.com/developers/docs/resources/user#create-group-dm
297
- */
298
- createGroupDM(params: Channel.Params.CreateGroupDM): Promise<void>;
299
- }
300
- }
301
- declare module './internal' {
302
- interface Internal {
303
- /**
304
- * Returns a list of guild channel objects. Does not include threads.
305
- * @see https://discord.com/developers/docs/resources/guild#get-guild-channels
306
- */
307
- getGuildChannels(guild_id: snowflake): Promise<Channel[]>;
308
- /**
309
- * Create a new channel object for the guild. Requires the MANAGE_CHANNELS permission. If setting permission overwrites, only permissions your bot has in the guild can be allowed/denied. Setting MANAGE_ROLES permission in channels is only possible for guild administrators. Returns the new channel object on success. Fires a Channel Create Gateway event.
310
- * @see https://discord.com/developers/docs/resources/guild#create-guild-channel
311
- */
312
- createGuildChannel(guild_id: snowflake, params: Channel.Params.Create): Promise<Channel>;
313
- /**
314
- * Modify the positions of a set of channel objects for the guild. Requires MANAGE_CHANNELS permission. Returns a 204 empty response on success. Fires multiple Channel Update Gateway events.
315
- * @see https://discord.com/developers/docs/resources/guild#modify-guild-channel-positions
316
- */
317
- modifyGuildChannelPositions(guild_id: snowflake, params: Channel.Params.ModifyPositions): Promise<void>;
318
- }
319
- }
320
- declare module './internal' {
321
- interface Internal {
322
- /**
323
- * Get a channel by ID. Returns a channel object. If the channel is a thread, a thread member object is included in the returned result.
324
- * @see https://discord.com/developers/docs/resources/channel#get-channel
325
- */
326
- getChannel(channel_id: snowflake): Promise<Channel>;
327
- /**
328
- * Update a channel's settings. Returns a channel on success, and a 400 BAD REQUEST on invalid parameters. All JSON parameters are optional.
329
- * @see https://discord.com/developers/docs/resources/channel#modify-channel
330
- */
331
- modifyChannel(channel_id: snowflake, params: Channel.Params.Modify): Promise<Channel>;
332
- /**
333
- * Delete a channel, or close a private message. Requires the MANAGE_CHANNELS permission for the guild, or MANAGE_THREADS if the channel is a thread. Deleting a category does not delete its child channels; they will have their parent_id removed and a Channel Update Gateway event will fire for each of them. Returns a channel object on success. Fires a Channel Delete Gateway event (or Thread Delete if the channel was a thread).
334
- * @see https://discord.com/developers/docs/resources/channel#deleteclose-channel
335
- */
336
- deleteChannel(channel_id: snowflake): Promise<Channel>;
337
- /**
338
- * Edit the channel permission overwrites for a user or role in a channel. Only usable for guild channels. Requires the MANAGE_ROLES permission. Only permissions your bot has in the guild or channel can be allowed/denied (unless your bot has a MANAGE_ROLES overwrite in the channel). Returns a 204 empty response on success. For more information about permissions, see permissions.
339
- * @see https://discord.com/developers/docs/resources/channel#edit-channel-permissions
340
- */
341
- editChannelPermissions(channel_id: snowflake, overwrite_id: string, params: Channel.Params.EditPermissions): Promise<void>;
342
- /**
343
- * Delete a channel permission overwrite for a user or role in a channel. Only usable for guild channels. Requires the MANAGE_ROLES permission. Returns a 204 empty response on success. For more information about permissions, see permissions
344
- * @see https://discord.com/developers/docs/resources/channel#delete-channel-permission
345
- */
346
- deleteChannelPermission(channel_id: snowflake, overwrite_id: string): Promise<void>;
347
- /**
348
- * Follow a News Channel to send messages to a target channel. Requires the MANAGE_WEBHOOKS permission in the target channel. Returns a followed channel object.
349
- * @see https://discord.com/developers/docs/resources/channel#follow-news-channel
350
- */
351
- followNewsChannel(channel_id: snowflake, params: Channel.Params.Follow): Promise<void>;
352
- /**
353
- * Post a typing indicator for the specified channel. Generally bots should not implement this route. However, if a bot is responding to a command and expects the computation to take a few seconds, this endpoint may be called to let the user know that the bot is processing their message. Returns a 204 empty response on success. Fires a Typing Start Gateway event.
354
- * @see https://discord.com/developers/docs/resources/channel#trigger-typing-indicator
355
- */
356
- triggerTypingIndicator(channel_id: snowflake): Promise<void>;
357
- /**
358
- * Adds a recipient to a Group DM using their access token.
359
- * @see https://discord.com/developers/docs/resources/channel#group-dm-add-recipient
360
- */
361
- groupDMAddRecipient(channel_id: snowflake, user_id: snowflake, params: Channel.Params.AddRecipient): Promise<void>;
362
- /**
363
- * Removes a recipient from a Group DM.
364
- * @see https://discord.com/developers/docs/resources/channel#group-dm-remove-recipient
365
- */
366
- groupDMRemoveRecipient(channel_id: snowflake, user_id: snowflake): Promise<void>;
367
- }
368
- }
@@ -1,214 +0,0 @@
1
- import { Channel, snowflake } from '.';
2
- /** https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-structure */
3
- export interface ApplicationCommand {
4
- /** unique id of the command */
5
- id: snowflake;
6
- /** the type of command, defaults 1 if not set */
7
- type?: ApplicationCommand.Type;
8
- /** unique id of the parent application */
9
- application_id: snowflake;
10
- /** guild id of the command, if not global */
11
- guild_id?: snowflake;
12
- /** 1-32 character name */
13
- name: string;
14
- /** 1-100 character description for CHAT_INPUT commands, empty string for USER and MESSAGE commands */
15
- description: string;
16
- /** the parameters for the command, max 25 */
17
- options?: ApplicationCommand.Option[];
18
- /** whether the command is enabled by default when the app is added to a guild */
19
- default_permission?: boolean;
20
- /** autoincrementing version identifier updated during substantial record changes */
21
- version: snowflake;
22
- }
23
- export declare namespace ApplicationCommand {
24
- /** https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-types */
25
- enum Type {
26
- /** Slash commands; a text-based command that shows up when a user types / */
27
- CHAT_INPUT = 1,
28
- /** A UI-based command that shows up when you right click or tap on a user */
29
- USER = 2,
30
- /** A UI-based command that shows up when you right click or tap on a message */
31
- MESSAGE = 3
32
- }
33
- /** https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-structure */
34
- interface Option {
35
- /** the type of option */
36
- type: OptionType;
37
- /** 1-32 character name */
38
- name: string;
39
- /** 1-100 character description */
40
- description: string;
41
- /** if the parameter is required or optional--default false */
42
- required?: boolean;
43
- /** choices for STRING, INTEGER, and NUMBER types for the user to pick from, max 25 */
44
- choices?: OptionChoice[];
45
- /** if the option is a subcommand or subcommand group type, this nested options will be the parameters */
46
- options?: Option[];
47
- /** if the option is a channel type, the channels shown will be restricted to these types */
48
- channel_types?: Channel.Type[];
49
- }
50
- /** https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-type */
51
- enum OptionType {
52
- SUB_COMMAND = 1,
53
- SUB_COMMAND_GROUP = 2,
54
- STRING = 3,
55
- /** Any integer between -2^53 and 2^53 */
56
- INTEGER = 4,
57
- BOOLEAN = 5,
58
- USER = 6,
59
- /** Includes all channel types + categories */
60
- CHANNEL = 7,
61
- ROLE = 8,
62
- /** Includes users and roles */
63
- MENTIONABLE = 9,
64
- /** Any double between -2^53 and 2^53 */
65
- NUMBER = 10
66
- }
67
- /** https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-choice-structure */
68
- interface OptionChoice {
69
- /** 1-100 character choice name */
70
- name: string;
71
- /** value of the choice, up to 100 characters if string */
72
- value: string | number;
73
- }
74
- /** https://discord.com/developers/docs/interactions/application-commands#application-command-permissions-object-guild-application-command-permissions-structure */
75
- interface GuildPermissions {
76
- /** the id of the command */
77
- id: snowflake;
78
- /** the id of the application the command belongs to */
79
- application_id: snowflake;
80
- /** the id of the guild */
81
- guild_id: snowflake;
82
- /** the permissions for the command in the guild */
83
- permissions: Permissions[];
84
- }
85
- /** https://discord.com/developers/docs/interactions/application-commands#application-command-permissions-object-application-command-permissions-structure */
86
- interface Permissions {
87
- /** the id of the role or user */
88
- id: snowflake;
89
- /** role or user */
90
- type: PermissionType;
91
- /** true to allow, false, to disallow */
92
- permission: boolean;
93
- }
94
- /** https://discord.com/developers/docs/interactions/application-commands#application-command-permissions-object-application-command-permission-type */
95
- enum PermissionType {
96
- ROLE = 1,
97
- USER = 2
98
- }
99
- namespace Params {
100
- /** https://discord.com/developers/docs/interactions/application-commands#create-global-application-command-json-params */
101
- interface Create {
102
- /** 1-32 character name */
103
- name: string;
104
- /** 1-100 character description */
105
- description: string;
106
- /** the parameters for the command */
107
- options?: Option[];
108
- /** whether the command is enabled by default when the app is added to a guild */
109
- default_permission?: boolean;
110
- /** the type of command, defaults 1 if not set */
111
- type?: Type;
112
- }
113
- /** https://discord.com/developers/docs/interactions/application-commands#edit-global-application-command-json-params */
114
- interface Edit {
115
- /** 1-32 character name */
116
- name?: string;
117
- /** 1-100 character description */
118
- description?: string;
119
- /** the parameters for the command */
120
- options?: Option[];
121
- /** whether the command is enabled by default when the app is added to a guild */
122
- default_permission?: boolean;
123
- }
124
- /** https://discord.com/developers/docs/interactions/application-commands#edit-application-command-permissions-json-params */
125
- interface EditPermissions {
126
- /** the permissions for the command in the guild */
127
- permissions: Permissions[];
128
- }
129
- }
130
- }
131
- declare module './internal' {
132
- interface Internal {
133
- /**
134
- * Fetch all of the global commands for your application. Returns an array of application command objects.
135
- * @see https://discord.com/developers/docs/interactions/application-commands#get-global-application-commands
136
- */
137
- getGlobalApplicationCommands(application_id: snowflake): Promise<ApplicationCommand[]>;
138
- /**
139
- * Creating a command with the same name as an existing command for your application will overwrite the old command.
140
- * @see https://discord.com/developers/docs/interactions/application-commands#create-global-application-command
141
- */
142
- createGlobalApplicationCommand(application_id: snowflake, param: ApplicationCommand.Params.Create): Promise<ApplicationCommand>;
143
- /**
144
- * Takes a list of application commands, overwriting the existing global command list for this application. Updates will be available in all guilds after 1 hour. Returns 200 and a list of application command objects. Commands that do not already exist will count toward daily application command create limits.
145
- * @see https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-global-application-commands
146
- */
147
- bulkOverwriteGlobalApplicationCommands(application_id: snowflake): Promise<ApplicationCommand[]>;
148
- /**
149
- * Fetch a global command for your application. Returns an application command object.
150
- * @see https://discord.com/developers/docs/interactions/application-commands#get-global-application-command
151
- */
152
- getGlobalApplicationCommand(application_id: snowflake, command_id: snowflake): Promise<ApplicationCommand>;
153
- /**
154
- * All parameters for this endpoint are optional.
155
- * @see https://discord.com/developers/docs/interactions/application-commands#edit-global-application-command
156
- */
157
- editGlobalApplicationCommand(application_id: snowflake, command_id: snowflake, param: ApplicationCommand.Params.Edit): Promise<ApplicationCommand>;
158
- /**
159
- * Deletes a global command. Returns 204 No Content on success.
160
- * @see https://discord.com/developers/docs/interactions/application-commands#delete-global-application-command
161
- */
162
- deleteGlobalApplicationCommand(application_id: snowflake, command_id: snowflake): Promise<void>;
163
- /**
164
- * Fetch all of the guild commands for your application for a specific guild. Returns an array of application command objects.
165
- * @see https://discord.com/developers/docs/interactions/application-commands#get-guild-application-commands
166
- */
167
- getGuildApplicationCommands(application_id: snowflake, guild_id: snowflake): Promise<ApplicationCommand[]>;
168
- /**
169
- * Creating a command with the same name as an existing command for your application will overwrite the old command.
170
- * @see https://discord.com/developers/docs/interactions/application-commands#create-guild-application-command
171
- */
172
- createGuildApplicationCommand(application_id: snowflake, guild_id: snowflake, param: ApplicationCommand.Params.Create): Promise<ApplicationCommand>;
173
- /**
174
- * Takes a list of application commands, overwriting the existing command list for this application for the targeted guild. Returns 200 and a list of application command objects.
175
- * @see https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-guild-application-commands
176
- */
177
- bulkOverwriteGuildApplicationCommands(application_id: snowflake, guild_id: snowflake): Promise<void>;
178
- /**
179
- * Fetches command permissions for all commands for your application in a guild. Returns an array of guild application command permissions objects.
180
- * @see https://discord.com/developers/docs/interactions/application-commands#get-guild-application-command-permissions
181
- */
182
- getGuildApplicationCommandPermissions(application_id: snowflake, guild_id: snowflake): Promise<ApplicationCommand.GuildPermissions[]>;
183
- /**
184
- * This endpoint will overwrite all existing permissions for all commands in a guild, including slash commands, user commands, and message commands.
185
- * @see https://discord.com/developers/docs/interactions/application-commands#batch-edit-application-command-permissions
186
- */
187
- batchEditApplicationCommandPermissions(application_id: snowflake, guild_id: snowflake, permissions: Partial<ApplicationCommand.GuildPermissions>[]): Promise<void>;
188
- /**
189
- * Fetch a guild command for your application. Returns an application command object.
190
- * @see https://discord.com/developers/docs/interactions/application-commands#get-guild-application-command
191
- */
192
- getGuildApplicationCommand(application_id: snowflake, guild_id: snowflake, command_id: snowflake): Promise<ApplicationCommand>;
193
- /**
194
- * All parameters for this endpoint are optional.
195
- * @see https://discord.com/developers/docs/interactions/application-commands#edit-guild-application-command
196
- */
197
- editGuildApplicationCommand(application_id: snowflake, guild_id: snowflake, command_id: snowflake, param: ApplicationCommand.Params.Edit): Promise<ApplicationCommand>;
198
- /**
199
- * Delete a guild command. Returns 204 No Content on success.
200
- * @see https://discord.com/developers/docs/interactions/application-commands#delete-guild-application-command
201
- */
202
- deleteGuildApplicationCommand(application_id: snowflake, guild_id: snowflake, command_id: snowflake): Promise<void>;
203
- /**
204
- * Fetches command permissions for a specific command for your application in a guild. Returns a guild application command permissions object.
205
- * @see https://discord.com/developers/docs/interactions/application-commands#get-application-command-permissions
206
- */
207
- getApplicationCommandPermissions(application_id: snowflake, guild_id: snowflake, command_id: snowflake): Promise<ApplicationCommand.GuildPermissions>;
208
- /**
209
- * This endpoint will overwrite existing permissions for the command in that guild
210
- * @see https://discord.com/developers/docs/interactions/application-commands#edit-application-command-permissions
211
- */
212
- editApplicationCommandPermissions(application_id: snowflake, guild_id: snowflake, command_id: snowflake, param: ApplicationCommand.Params.EditPermissions): Promise<ApplicationCommand.GuildPermissions>;
213
- }
214
- }
@@ -1,84 +0,0 @@
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: integer;
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
- }
29
- /** https://discord.com/developers/docs/interactions/message-components#component-object-component-types */
30
- export declare enum ComponentType {
31
- /** A container for other components */
32
- ACTION_ROW = 1,
33
- /** A button object */
34
- BUTTON = 2,
35
- /** A select menu for picking from choices */
36
- SELECT_MENU = 3
37
- }
38
- /** https://discord.com/developers/docs/interactions/message-components#button-object-button-structure */
39
- export interface Button {
40
- /** 2 for a button */
41
- type: integer;
42
- /** one of button styles */
43
- style: integer;
44
- /** text that appears on the button, max 80 characters */
45
- label?: string;
46
- /** name, id, and animated */
47
- emoji?: Partial<Emoji>;
48
- /** a developer-defined identifier for the button, max 100 characters */
49
- custom_id?: string;
50
- /** a url for link-style buttons */
51
- url?: string;
52
- /** whether the button is disabled (default false) */
53
- disabled?: boolean;
54
- }
55
- /** https://discord.com/developers/docs/interactions/message-components#select-menu-object-select-menu-structure */
56
- export interface SelectMenu {
57
- /** 3 for a select menu */
58
- type: integer;
59
- /** a developer-defined identifier for the button, max 100 characters */
60
- custom_id: string;
61
- /** the choices in the select, max 25 */
62
- options: SelectOption[];
63
- /** custom placeholder text if nothing is selected, max 100 characters */
64
- placeholder?: string;
65
- /** the minimum number of items that must be chosen; default 1, min 0, max 25 */
66
- min_values?: integer;
67
- /** the maximum number of items that can be chosen; default 1, max 25 */
68
- max_values?: integer;
69
- /** disable the select, default false */
70
- disabled?: boolean;
71
- }
72
- /** https://discord.com/developers/docs/interactions/message-components#select-menu-object-select-option-structure */
73
- export interface SelectOption {
74
- /** the user-facing name of the option, max 100 characters */
75
- label: string;
76
- /** the dev-define value of the option, max 100 characters */
77
- value: string;
78
- /** an additional description of the option, max 100 characters */
79
- description?: string;
80
- /** id, name, and animated */
81
- emoji?: Partial<Emoji>;
82
- /** will render this option as selected by default */
83
- default?: boolean;
84
- }