@discordjs/core 0.1.1-dev.1669637061-8376e2d.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.
- package/LICENSE +191 -0
- package/README.md +115 -0
- package/dist/index.d.ts +1328 -0
- package/dist/index.js +870 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +849 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +73 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,1328 @@
|
|
|
1
|
+
import { REST, RawFile } from '@discordjs/rest';
|
|
2
|
+
import * as discord_api_types_v10 from 'discord-api-types/v10';
|
|
3
|
+
import { Snowflake, RESTGetAPIApplicationCommandsQuery, RESTGetAPIApplicationCommandsResult, RESTPostAPIApplicationCommandsJSONBody, RESTPatchAPIApplicationCommandJSONBody, RESTPutAPIApplicationCommandsJSONBody, RESTPutAPIApplicationCommandsResult, RESTGetAPIApplicationGuildCommandsQuery, RESTGetAPIGuildApplicationCommandsPermissionsResult, RESTPutAPIApplicationCommandPermissionsJSONBody, RESTPostAPIChannelMessageJSONBody, RESTGetAPIChannelMessageReactionUsersQuery, RESTGetAPIChannelMessageReactionUsersResult, RESTPatchAPIChannelJSONBody, RESTGetAPIChannelMessagesQuery, RESTGetAPIChannelMessagesResult, RESTGetAPIChannelPinsResult, RESTPostAPIChannelInviteJSONBody, RESTGetAPIChannelInvitesResult, RESTGetAPIChannelThreadsArchivedQuery, RESTGetAPIChannelUsersThreadsArchivedResult, RESTPostAPIGuildsJSONBody, RESTPatchAPIGuildJSONBody, RESTGetAPIGuildMembersQuery, RESTGetAPIGuildChannelsResult, RESTPostAPIGuildChannelJSONBody, RESTPatchAPIGuildChannelPositionsJSONBody, RESTGetAPIGuildBansResult, RESTPutAPIGuildBanJSONBody, RESTGetAPIGuildRolesResult, RESTPostAPIGuildRoleJSONBody, RESTPatchAPIGuildRolePositionsJSONBody, RESTPatchAPIGuildRolePositionsResult, RESTPatchAPIGuildRoleJSONBody, GuildMFALevel, RESTGetAPIGuildPruneCountQuery, RESTGetAPIGuildPruneCountResult, RESTPostAPIGuildPruneJSONBody, RESTGetAPIGuildVoiceRegionsResult, RESTGetAPIGuildInvitesResult, RESTGetAPIGuildIntegrationsResult, RESTPatchAPIGuildWidgetSettingsJSONBody, RESTGetAPIGuildVanityUrlResult, GuildWidgetStyle, RESTPatchAPIGuildWelcomeScreenJSONBody, RESTPatchAPIGuildVoiceStateUserJSONBody, RESTGetAPIGuildEmojisResult, RESTPostAPIGuildEmojiJSONBody, RESTPatchAPIGuildEmojiJSONBody, RESTGetAPIGuildScheduledEventsQuery, RESTGetAPIGuildScheduledEventsResult, RESTPostAPIGuildScheduledEventJSONBody, RESTGetAPIGuildScheduledEventQuery, RESTPatchAPIGuildScheduledEventJSONBody, RESTGetAPIGuildScheduledEventUsersQuery, RESTGetAPIGuildScheduledEventUsersResult, RESTGetAPIGuildTemplatesResult, RESTPatchAPIGuildTemplateJSONBody, RESTGetAPIGuildStickersResult, RESTPostAPIGuildStickerFormDataBody, RESTPatchAPIGuildStickerJSONBody, RESTGetAPIAuditLogQuery, RESTGetAPIAutoModerationRulesResult, RESTPostAPIAutoModerationRuleJSONBody, RESTPatchAPIAutoModerationRuleJSONBody, RESTGetAPIGuildMembersSearchQuery, RESTGetAPIGuildMembersSearchResult, RESTPatchAPIGuildMemberJSONBody, RESTPostAPITemplateCreateGuildJSONBody, RESTPostAPIChannelWebhookJSONBody, RESTPatchAPIWebhookJSONBody, RESTPostAPIWebhookWithTokenJSONBody, RESTPostAPIWebhookWithTokenQuery, RESTPostAPIWebhookWithTokenWaitResult, RESTPostAPIWebhookWithTokenSlackQuery, RESTPostAPIWebhookWithTokenGitHubQuery, RESTPatchAPIWebhookWithTokenMessageJSONBody, APIInteractionResponseCallbackData, APICommandAutocompleteInteractionResponseCallbackData, APIModalInteractionResponseCallbackData, RESTGetAPIInviteQuery, RESTGetNitroStickerPacksResult, RESTPostAPIChannelThreadsJSONBody, RESTPostAPIGuildForumThreadsJSONBody, APIThreadChannel, APIThreadMember, RESTGetAPIChannelThreadMembersResult, RESTGetAPICurrentUserGuildsQuery, RESTGetAPICurrentUserGuildsResult, RESTPatchAPICurrentUserJSONBody, RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody, GatewayDispatchEvents, GatewayChannelCreateDispatchData, GatewayChannelDeleteDispatchData, GatewayChannelPinsUpdateDispatchData, GatewayChannelUpdateDispatchData, GatewayGuildBanAddDispatchData, GatewayGuildBanRemoveDispatchData, GatewayGuildCreateDispatchData, GatewayGuildDeleteDispatchData, GatewayGuildEmojisUpdateDispatchData, GatewayGuildIntegrationsUpdateDispatchData, GatewayGuildMemberAddDispatchData, GatewayGuildMemberRemoveDispatchData, GatewayGuildMemberUpdateDispatchData, GatewayGuildMembersChunkDispatchData, GatewayGuildRoleCreateDispatchData, GatewayGuildRoleDeleteDispatchData, GatewayGuildRoleUpdateDispatchData, GatewayGuildScheduledEventCreateDispatchData, GatewayGuildScheduledEventDeleteDispatchData, GatewayGuildScheduledEventUpdateDispatchData, GatewayGuildScheduledEventUserAddDispatchData, GatewayGuildScheduledEventUserRemoveDispatchData, GatewayGuildStickersUpdateDispatchData, GatewayGuildUpdateDispatchData, GatewayIntegrationCreateDispatchData, GatewayIntegrationDeleteDispatchData, GatewayIntegrationUpdateDispatchData, GatewayInteractionCreateDispatchData, GatewayInviteCreateDispatchData, GatewayInviteDeleteDispatchData, GatewayMessageCreateDispatchData, GatewayMessageDeleteDispatchData, GatewayMessageDeleteBulkDispatchData, GatewayMessageReactionAddDispatchData, GatewayMessageReactionRemoveDispatchData, GatewayMessageReactionRemoveAllDispatchData, GatewayMessageReactionRemoveEmojiDispatchData, GatewayMessageUpdateDispatchData, GatewayPresenceUpdateDispatchData, GatewayReadyDispatchData, GatewayStageInstanceCreateDispatchData, GatewayStageInstanceDeleteDispatchData, GatewayStageInstanceUpdateDispatchData, GatewayThreadCreateDispatchData, GatewayThreadDeleteDispatchData, GatewayThreadListSyncDispatchData, GatewayThreadMemberUpdateDispatchData, GatewayThreadMembersUpdateDispatchData, GatewayThreadUpdateDispatchData, GatewayUserUpdateDispatchData, GatewayVoiceServerUpdateDispatchData, GatewayVoiceStateUpdateDispatchData, GatewayWebhooksUpdateDispatchData, GatewayTypingStartDispatchData, GatewayAutoModerationActionExecutionDispatchData, GatewayAutoModerationRuleCreateDispatchData, GatewayAutoModerationRuleDeleteDispatchData, GatewayAutoModerationRuleUpdateDispatchData } from 'discord-api-types/v10';
|
|
4
|
+
export * from 'discord-api-types/v10';
|
|
5
|
+
import { WebSocketManager } from '@discordjs/ws';
|
|
6
|
+
import { AsyncEventEmitter } from '@vladfrangu/async_event_emitter';
|
|
7
|
+
import * as discord_api_types_utils_internals from 'discord-api-types/utils/internals';
|
|
8
|
+
|
|
9
|
+
declare class ApplicationCommandsAPI {
|
|
10
|
+
private readonly rest;
|
|
11
|
+
constructor(rest: REST);
|
|
12
|
+
/**
|
|
13
|
+
* Fetches all global commands for a application
|
|
14
|
+
*
|
|
15
|
+
* @param applicationId - The application id to fetch commands for
|
|
16
|
+
* @param options - The options to use when fetching commands
|
|
17
|
+
*/
|
|
18
|
+
getGlobalCommands(applicationId: Snowflake, options?: RESTGetAPIApplicationCommandsQuery): Promise<RESTGetAPIApplicationCommandsResult>;
|
|
19
|
+
/**
|
|
20
|
+
* Creates a new global command
|
|
21
|
+
*
|
|
22
|
+
* @param applicationId - The application id to create the command for
|
|
23
|
+
* @param data - The data to use when creating the command
|
|
24
|
+
*/
|
|
25
|
+
createGlobalCommand(applicationId: Snowflake, data: RESTPostAPIApplicationCommandsJSONBody): Promise<discord_api_types_v10.APIApplicationCommand>;
|
|
26
|
+
/**
|
|
27
|
+
* Fetches a global command
|
|
28
|
+
*
|
|
29
|
+
* @param applicationId - The application id to fetch the command from
|
|
30
|
+
* @param commandId - The command id to fetch
|
|
31
|
+
*/
|
|
32
|
+
getGlobalCommand(applicationId: Snowflake, commandId: Snowflake): Promise<discord_api_types_v10.APIApplicationCommand>;
|
|
33
|
+
/**
|
|
34
|
+
* Edits a global command
|
|
35
|
+
*
|
|
36
|
+
* @param applicationId - The application id of the command
|
|
37
|
+
* @param commandId - The id of the command to edit
|
|
38
|
+
* @param data - The data to use when editing the command
|
|
39
|
+
*/
|
|
40
|
+
editGlobalCommand(applicationId: Snowflake, commandId: Snowflake, data: RESTPatchAPIApplicationCommandJSONBody): Promise<discord_api_types_v10.APIApplicationCommand>;
|
|
41
|
+
/**
|
|
42
|
+
* Deletes a global command
|
|
43
|
+
*
|
|
44
|
+
* @param applicationId - The application id of the command
|
|
45
|
+
* @param commandId - The id of the command to delete
|
|
46
|
+
*/
|
|
47
|
+
deleteGlobalCommand(applicationId: Snowflake, commandId: Snowflake): Promise<void>;
|
|
48
|
+
/**
|
|
49
|
+
* Overwrites global commands
|
|
50
|
+
*
|
|
51
|
+
* @param applicationId - The application id to overwrite commands for
|
|
52
|
+
* @param data - The data to use when overwriting commands
|
|
53
|
+
*/
|
|
54
|
+
bulkOverwriteGlobalCommands(applicationId: Snowflake, data: RESTPutAPIApplicationCommandsJSONBody): Promise<RESTPutAPIApplicationCommandsResult>;
|
|
55
|
+
/**
|
|
56
|
+
* Fetches all commands for a guild
|
|
57
|
+
*
|
|
58
|
+
* @param applicationId - The application id to fetch commands for
|
|
59
|
+
* @param guildId - The guild id to fetch commands for
|
|
60
|
+
* @param data - The data to use when fetching commands
|
|
61
|
+
*/
|
|
62
|
+
getGuildCommands(applicationId: Snowflake, guildId: Snowflake, data?: RESTGetAPIApplicationGuildCommandsQuery): Promise<RESTGetAPIApplicationCommandsResult>;
|
|
63
|
+
/**
|
|
64
|
+
* Creates a new command for a guild
|
|
65
|
+
*
|
|
66
|
+
* @param applicationId - The application id to create the command for
|
|
67
|
+
* @param guildId - The guild id to create the command for
|
|
68
|
+
* @param data - The data to use when creating the command
|
|
69
|
+
*/
|
|
70
|
+
createGuildCommand(applicationId: Snowflake, guildId: Snowflake, data: RESTPostAPIApplicationCommandsJSONBody): Promise<discord_api_types_v10.APIApplicationCommand>;
|
|
71
|
+
/**
|
|
72
|
+
* Fetches a guild command
|
|
73
|
+
*
|
|
74
|
+
* @param applicationId - The application id to fetch the command from
|
|
75
|
+
* @param guildId - The guild id to fetch the command from
|
|
76
|
+
* @param commandId - The command id to fetch
|
|
77
|
+
*/
|
|
78
|
+
getGuildCommand(applicationId: Snowflake, guildId: Snowflake, commandId: Snowflake): Promise<discord_api_types_v10.APIApplicationCommand>;
|
|
79
|
+
/**
|
|
80
|
+
* Edits a guild command
|
|
81
|
+
*
|
|
82
|
+
* @param applicationId - The application id of the command
|
|
83
|
+
* @param guildId - The guild id of the command
|
|
84
|
+
* @param commandId - The command id to edit
|
|
85
|
+
* @param data - The data to use when editing the command
|
|
86
|
+
*/
|
|
87
|
+
editGuildCommand(applicationId: Snowflake, guildId: Snowflake, commandId: Snowflake, data: RESTPatchAPIApplicationCommandJSONBody): Promise<discord_api_types_v10.APIApplicationCommand>;
|
|
88
|
+
/**
|
|
89
|
+
* Deletes a guild command
|
|
90
|
+
*
|
|
91
|
+
* @param applicationId - The application id of the command
|
|
92
|
+
* @param guildId - The guild id of the command
|
|
93
|
+
* @param commandId - The id of the command to delete
|
|
94
|
+
*/
|
|
95
|
+
deleteGuildCommand(applicationId: Snowflake, guildId: Snowflake, commandId: Snowflake): Promise<void>;
|
|
96
|
+
/**
|
|
97
|
+
* Bulk overwrites guild commands
|
|
98
|
+
*
|
|
99
|
+
* @param applicationId - The application id to overwrite commands for
|
|
100
|
+
* @param guildId - The guild id to overwrite commands for
|
|
101
|
+
* @param data - The data to use when overwriting commands
|
|
102
|
+
*/
|
|
103
|
+
bulkOverwriteGuildCommands(applicationId: Snowflake, guildId: Snowflake, data: RESTPutAPIApplicationCommandsJSONBody): Promise<RESTPutAPIApplicationCommandsResult>;
|
|
104
|
+
/**
|
|
105
|
+
* Fetches the permissions for a guild command
|
|
106
|
+
*
|
|
107
|
+
* @param applicationId - The application id to get the permissions for
|
|
108
|
+
* @param guildId - The guild id of the command
|
|
109
|
+
* @param commandId - The command id to get the permissions for
|
|
110
|
+
*/
|
|
111
|
+
getGuildCommandPermissions(applicationId: Snowflake, guildId: Snowflake, commandId: Snowflake): Promise<discord_api_types_v10.APIGuildApplicationCommandPermissions>;
|
|
112
|
+
/**
|
|
113
|
+
* Fetches all permissions for all commands in a guild
|
|
114
|
+
*
|
|
115
|
+
* @param applicationId - The application id to get the permissions for
|
|
116
|
+
* @param guildId - The guild id to get the permissions for
|
|
117
|
+
*/
|
|
118
|
+
getGuildCommandsPermissions(applicationId: Snowflake, guildId: Snowflake): Promise<RESTGetAPIGuildApplicationCommandsPermissionsResult>;
|
|
119
|
+
/**
|
|
120
|
+
* Edits the permissions for a guild command
|
|
121
|
+
*
|
|
122
|
+
* @param userToken - The token of the user to edit permissions on behalf of
|
|
123
|
+
* @param applicationId - The application id to edit the permissions for
|
|
124
|
+
* @param guildId - The guild id to edit the permissions for
|
|
125
|
+
* @param commandId - The id of the command to edit the permissions for
|
|
126
|
+
* @param data - The data to use when editing the permissions
|
|
127
|
+
*/
|
|
128
|
+
editGuildCommandPermissions(userToken: string, applicationId: Snowflake, guildId: Snowflake, commandId: Snowflake, data: RESTPutAPIApplicationCommandPermissionsJSONBody): Promise<discord_api_types_v10.APIGuildApplicationCommandPermissions>;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
declare class ChannelsAPI {
|
|
132
|
+
private readonly rest;
|
|
133
|
+
constructor(rest: REST);
|
|
134
|
+
/**
|
|
135
|
+
* Sends a message in a channel
|
|
136
|
+
*
|
|
137
|
+
* @param channelId - The id of the channel to send the message in
|
|
138
|
+
* @param data - The data to use when sending the message
|
|
139
|
+
*/
|
|
140
|
+
createMessage(channelId: Snowflake, { files, ...body }: RESTPostAPIChannelMessageJSONBody & {
|
|
141
|
+
files?: RawFile[];
|
|
142
|
+
}): Promise<discord_api_types_v10.APIMessage>;
|
|
143
|
+
/**
|
|
144
|
+
* Edits a message
|
|
145
|
+
*
|
|
146
|
+
* @param channelId - The id of the channel the message is in
|
|
147
|
+
* @param messageId - The id of the message to edit
|
|
148
|
+
* @param data - The data to use when editing the message
|
|
149
|
+
*/
|
|
150
|
+
editMessage(channelId: Snowflake, messageId: Snowflake, { files, ...body }: RESTPostAPIChannelMessageJSONBody & {
|
|
151
|
+
files?: RawFile[];
|
|
152
|
+
}): Promise<discord_api_types_v10.APIMessage>;
|
|
153
|
+
/**
|
|
154
|
+
* Fetches the reactions for a message
|
|
155
|
+
*
|
|
156
|
+
* @param channelId - The id of the channel the message is in
|
|
157
|
+
* @param messageId - The id of the message to get the reactions for
|
|
158
|
+
* @param emoji - The emoji to get the reactions for
|
|
159
|
+
* @param options - The options to use when fetching the reactions
|
|
160
|
+
*/
|
|
161
|
+
getMessageReactions(channelId: Snowflake, messageId: Snowflake, emoji: string, options?: RESTGetAPIChannelMessageReactionUsersQuery): Promise<RESTGetAPIChannelMessageReactionUsersResult>;
|
|
162
|
+
/**
|
|
163
|
+
* Deletes a reaction for the current user
|
|
164
|
+
*
|
|
165
|
+
* @param channelId - The id of the channel the message is in
|
|
166
|
+
* @param messageId - The id of the message to delete the reaction for
|
|
167
|
+
* @param emoji - The emoji to delete the reaction for
|
|
168
|
+
*/
|
|
169
|
+
deleteOwnMessageReaction(channelId: Snowflake, messageId: Snowflake, emoji: string): Promise<void>;
|
|
170
|
+
/**
|
|
171
|
+
* Deletes a reaction for a user
|
|
172
|
+
*
|
|
173
|
+
* @param channelId - The id of the channel the message is in
|
|
174
|
+
* @param messageId - The id of the message to delete the reaction for
|
|
175
|
+
* @param emoji - The emoji to delete the reaction for
|
|
176
|
+
* @param userId - The id of the user to delete the reaction for
|
|
177
|
+
*/
|
|
178
|
+
deleteUserMessageReaction(channelId: Snowflake, messageId: Snowflake, emoji: string, userId: Snowflake): Promise<void>;
|
|
179
|
+
/**
|
|
180
|
+
* Deletes all reactions for a message
|
|
181
|
+
*
|
|
182
|
+
* @param channelId - The id of the channel the message is in
|
|
183
|
+
* @param messageId - The id of the message to delete the reactions for
|
|
184
|
+
*/
|
|
185
|
+
deleteAllMessageReactions(channelId: Snowflake, messageId: Snowflake): Promise<void>;
|
|
186
|
+
/**
|
|
187
|
+
* Deletes all reactions of an emoji for a message
|
|
188
|
+
*
|
|
189
|
+
* @param channelId - The id of the channel the message is in
|
|
190
|
+
* @param messageId - The id of the message to delete the reactions for
|
|
191
|
+
* @param emoji - The emoji to delete the reactions for
|
|
192
|
+
*/
|
|
193
|
+
deleteAllMessageReactionsForEmoji(channelId: Snowflake, messageId: Snowflake, emoji: string): Promise<void>;
|
|
194
|
+
/**
|
|
195
|
+
* Adds a reaction to a message
|
|
196
|
+
*
|
|
197
|
+
* @param channelId - The id of the channel the message is in
|
|
198
|
+
* @param messageId - The id of the message to add the reaction to
|
|
199
|
+
* @param emoji - The emoji to add the reaction with
|
|
200
|
+
*/
|
|
201
|
+
addMessageReaction(channelId: Snowflake, messageId: Snowflake, emoji: string): Promise<void>;
|
|
202
|
+
/**
|
|
203
|
+
* Fetches a channel
|
|
204
|
+
*
|
|
205
|
+
* @param channelId - The id of the channel
|
|
206
|
+
*/
|
|
207
|
+
get(channelId: Snowflake): Promise<discord_api_types_v10.APIChannel>;
|
|
208
|
+
/**
|
|
209
|
+
* Edits a channel
|
|
210
|
+
*
|
|
211
|
+
* @param channelId - The id of the channel to edit
|
|
212
|
+
* @param data - The new channel data
|
|
213
|
+
*/
|
|
214
|
+
edit(channelId: Snowflake, data: RESTPatchAPIChannelJSONBody): Promise<discord_api_types_v10.APIChannel>;
|
|
215
|
+
/**
|
|
216
|
+
* Deletes a channel
|
|
217
|
+
*
|
|
218
|
+
* @param channelId - The id of the channel to delete
|
|
219
|
+
*/
|
|
220
|
+
delete(channelId: Snowflake): Promise<discord_api_types_v10.APIChannel>;
|
|
221
|
+
/**
|
|
222
|
+
* Fetches the messages of a channel
|
|
223
|
+
*
|
|
224
|
+
* @param channelId - The id of the channel to fetch messages from
|
|
225
|
+
* @param options - The options to use when fetching messages
|
|
226
|
+
*/
|
|
227
|
+
getMessages(channelId: Snowflake, options?: RESTGetAPIChannelMessagesQuery): Promise<RESTGetAPIChannelMessagesResult>;
|
|
228
|
+
/**
|
|
229
|
+
* Shows a typing indicator in a channel
|
|
230
|
+
*
|
|
231
|
+
* @param channelId - The id of the channel to show the typing indicator in
|
|
232
|
+
*/
|
|
233
|
+
showTyping(channelId: Snowflake): Promise<void>;
|
|
234
|
+
/**
|
|
235
|
+
* Fetches the pinned messages of a channel
|
|
236
|
+
*
|
|
237
|
+
* @param channelId - The id of the channel to fetch pinned messages from
|
|
238
|
+
*/
|
|
239
|
+
getPins(channelId: Snowflake): Promise<RESTGetAPIChannelPinsResult>;
|
|
240
|
+
/**
|
|
241
|
+
* Pins a message in a channel
|
|
242
|
+
*
|
|
243
|
+
* @param channelId - The id of the channel to pin the message in
|
|
244
|
+
* @param messageId - The id of the message to pin
|
|
245
|
+
* @param reason - The reason for pinning the message
|
|
246
|
+
*/
|
|
247
|
+
pinMessage(channelId: Snowflake, messageId: Snowflake, reason?: string): Promise<void>;
|
|
248
|
+
/**
|
|
249
|
+
* Deletes a message
|
|
250
|
+
*
|
|
251
|
+
* @param channelId - The id of the channel the message is in
|
|
252
|
+
* @param messageId - The id of the message to delete
|
|
253
|
+
* @param reason - The reason for deleting the message
|
|
254
|
+
*/
|
|
255
|
+
deleteMessage(channelId: Snowflake, messageId: Snowflake, reason?: string): Promise<void>;
|
|
256
|
+
/**
|
|
257
|
+
* Bulk deletes messages
|
|
258
|
+
*
|
|
259
|
+
* @param channelId - The id of the channel the messages are in
|
|
260
|
+
* @param messageIds - The ids of the messages to delete
|
|
261
|
+
*/
|
|
262
|
+
bulkDeleteMessages(channelId: Snowflake, messageIds: Snowflake[], reason?: string): Promise<void>;
|
|
263
|
+
/**
|
|
264
|
+
* Fetches a message
|
|
265
|
+
*
|
|
266
|
+
* @param channelId - The id of the channel the message is in
|
|
267
|
+
* @param messageId - The id of the message to fetch
|
|
268
|
+
*/
|
|
269
|
+
getMessage(channelId: Snowflake, messageId: Snowflake): Promise<discord_api_types_v10.APIMessage>;
|
|
270
|
+
/**
|
|
271
|
+
* Crossposts a message
|
|
272
|
+
*
|
|
273
|
+
* @param channelId - The id of the channel the message is in
|
|
274
|
+
* @param messageId - The id of the message to crosspost
|
|
275
|
+
*/
|
|
276
|
+
crosspostMessage(channelId: Snowflake, messageId: Snowflake): Promise<discord_api_types_v10.APIMessage>;
|
|
277
|
+
/**
|
|
278
|
+
* Unpins a message in a channel
|
|
279
|
+
*
|
|
280
|
+
* @param channelId - The id of the channel to unpin the message in
|
|
281
|
+
* @param messageId - The id of the message to unpin
|
|
282
|
+
* @param reason - The reason for unpinning the message
|
|
283
|
+
*/
|
|
284
|
+
unpinMessage(channelId: Snowflake, messageId: Snowflake, reason?: string): Promise<void>;
|
|
285
|
+
/**
|
|
286
|
+
* Follows an announcement channel
|
|
287
|
+
*
|
|
288
|
+
* @param channelId - The id of the announcement channel to follow
|
|
289
|
+
* @param webhookChannelId - The id of the webhook channel to follow the announcements in
|
|
290
|
+
*/
|
|
291
|
+
followAnnouncements(channelId: Snowflake, webhookChannelId: Snowflake): Promise<discord_api_types_v10.APIFollowedChannel>;
|
|
292
|
+
/**
|
|
293
|
+
* Creates a new invite for a channel
|
|
294
|
+
*
|
|
295
|
+
* @param channelId - The id of the channel to create an invite for
|
|
296
|
+
* @param data - The data to use when creating the invite
|
|
297
|
+
*/
|
|
298
|
+
createInvite(channelId: Snowflake, data: RESTPostAPIChannelInviteJSONBody, reason?: string): Promise<discord_api_types_v10.APIExtendedInvite>;
|
|
299
|
+
/**
|
|
300
|
+
* Fetches the invites of a channel
|
|
301
|
+
*
|
|
302
|
+
* @param channelId - The id of the channel to fetch invites from
|
|
303
|
+
*/
|
|
304
|
+
getInvites(channelId: Snowflake): Promise<RESTGetAPIChannelInvitesResult>;
|
|
305
|
+
/**
|
|
306
|
+
* Fetches the archived threads of a channel
|
|
307
|
+
*
|
|
308
|
+
* @param channelId - The id of the channel to fetch archived threads from
|
|
309
|
+
* @param archivedStatus - The archived status of the threads to fetch
|
|
310
|
+
* @param options - The options to use when fetching archived threads
|
|
311
|
+
*/
|
|
312
|
+
getArchivedThreads(channelId: Snowflake, archivedStatus: 'private' | 'public', options?: RESTGetAPIChannelThreadsArchivedQuery): Promise<RESTGetAPIChannelUsersThreadsArchivedResult>;
|
|
313
|
+
/**
|
|
314
|
+
* Fetches the private joined archived threads of a channel
|
|
315
|
+
*
|
|
316
|
+
* @param channelId - The id of the channel to fetch joined archived threads from
|
|
317
|
+
* @param options - The options to use when fetching joined archived threads
|
|
318
|
+
*/
|
|
319
|
+
getJoinedPrivateArchivedThreads(channelId: Snowflake, options?: RESTGetAPIChannelThreadsArchivedQuery): Promise<RESTGetAPIChannelUsersThreadsArchivedResult>;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
declare class GuildsAPI {
|
|
323
|
+
private readonly rest;
|
|
324
|
+
constructor(rest: REST);
|
|
325
|
+
/**
|
|
326
|
+
* Fetches a guild
|
|
327
|
+
*
|
|
328
|
+
* @param guildId - The id of the guild
|
|
329
|
+
*/
|
|
330
|
+
get(guildId: string): Promise<discord_api_types_v10.APIGuild>;
|
|
331
|
+
/**
|
|
332
|
+
* Fetches a guild preview
|
|
333
|
+
*
|
|
334
|
+
* @param guildId - The id of the guild to fetch the preview from
|
|
335
|
+
*/
|
|
336
|
+
getPreview(guildId: Snowflake): Promise<discord_api_types_v10.APIGuildPreview>;
|
|
337
|
+
/**
|
|
338
|
+
* Creates a guild
|
|
339
|
+
*
|
|
340
|
+
* @param data - The guild to create
|
|
341
|
+
*/
|
|
342
|
+
create(data: RESTPostAPIGuildsJSONBody): Promise<discord_api_types_v10.APIGuild>;
|
|
343
|
+
/**
|
|
344
|
+
* Edits a guild
|
|
345
|
+
*
|
|
346
|
+
* @param guildId - The id of the guild to edit
|
|
347
|
+
* @param data - The new guild data
|
|
348
|
+
* @param reason - The reason for editing this guild
|
|
349
|
+
*/
|
|
350
|
+
edit(guildId: Snowflake, data: RESTPatchAPIGuildJSONBody, reason?: string): Promise<discord_api_types_v10.APIGuild>;
|
|
351
|
+
/**
|
|
352
|
+
* Deletes a guild
|
|
353
|
+
*
|
|
354
|
+
* @param guildId - The id of the guild to delete
|
|
355
|
+
* @param reason - The reason for deleting this guild
|
|
356
|
+
*/
|
|
357
|
+
delete(guildId: Snowflake, reason?: string): Promise<void>;
|
|
358
|
+
/**
|
|
359
|
+
* Fetches all the members of a guild
|
|
360
|
+
*
|
|
361
|
+
* @param guildId - The id of the guild
|
|
362
|
+
* @param options - The options to use when fetching the guild members
|
|
363
|
+
*/
|
|
364
|
+
getMembers(guildId: Snowflake, options?: RESTGetAPIGuildMembersQuery): Promise<discord_api_types_v10.APIGuildMember>;
|
|
365
|
+
/**
|
|
366
|
+
* Fetches a guild's channels
|
|
367
|
+
*
|
|
368
|
+
* @param guildId - The id of the guild to fetch the channels from
|
|
369
|
+
*/
|
|
370
|
+
getChannels(guildId: Snowflake): Promise<RESTGetAPIGuildChannelsResult>;
|
|
371
|
+
/**
|
|
372
|
+
* Creates a guild channel
|
|
373
|
+
*
|
|
374
|
+
* @param guildId - The id of the guild to create the channel in
|
|
375
|
+
* @param data - The data to create the new channel
|
|
376
|
+
* @param reason - The reason for creating this channel
|
|
377
|
+
*/
|
|
378
|
+
createChannel(guildId: Snowflake, data: RESTPostAPIGuildChannelJSONBody, reason?: string): Promise<discord_api_types_v10.APIChannel>;
|
|
379
|
+
/**
|
|
380
|
+
* Edits a guild channel's positions
|
|
381
|
+
*
|
|
382
|
+
* @param guildId - The id of the guild to edit the channel positions from
|
|
383
|
+
* @param data - The data to edit the channel positions with
|
|
384
|
+
* @param reason - The reason for editing the channel positions
|
|
385
|
+
*/
|
|
386
|
+
setChannelPositions(guildId: Snowflake, data: RESTPatchAPIGuildChannelPositionsJSONBody, reason?: string): Promise<void>;
|
|
387
|
+
/**
|
|
388
|
+
* Fetches the active threads in a guild
|
|
389
|
+
*
|
|
390
|
+
* @param guildId - The id of the guild to fetch the active threads from
|
|
391
|
+
*/
|
|
392
|
+
getActiveThreads(guildId: Snowflake): Promise<discord_api_types_v10.APIThreadList>;
|
|
393
|
+
/**
|
|
394
|
+
* Fetches a guild member ban
|
|
395
|
+
*
|
|
396
|
+
* @param guildId - The id of the guild to fetch the ban from
|
|
397
|
+
*/
|
|
398
|
+
getMemberBans(guildId: Snowflake): Promise<RESTGetAPIGuildBansResult>;
|
|
399
|
+
/**
|
|
400
|
+
* Bans a user from a guild
|
|
401
|
+
*
|
|
402
|
+
* @param guildId - The id of the guild to ban the member in
|
|
403
|
+
* @param userId - The id of the user to ban
|
|
404
|
+
* @param options - Options for banning the user
|
|
405
|
+
* @param reason - The reason for banning the user
|
|
406
|
+
*/
|
|
407
|
+
banUser(guildId: Snowflake, userId: Snowflake, options?: RESTPutAPIGuildBanJSONBody, reason?: string): Promise<void>;
|
|
408
|
+
/**
|
|
409
|
+
* Unbans a user from a guild
|
|
410
|
+
*
|
|
411
|
+
* @param guildId - The id of the guild to unban the member in
|
|
412
|
+
* @param userId - The id of the user to unban
|
|
413
|
+
* @param reason - The reason for unbanning the user
|
|
414
|
+
*/
|
|
415
|
+
unbanUser(guildId: Snowflake, userId: Snowflake, reason?: string): Promise<void>;
|
|
416
|
+
/**
|
|
417
|
+
* Gets all the roles in a guild
|
|
418
|
+
*
|
|
419
|
+
* @param guildId - The id of the guild to fetch the roles from
|
|
420
|
+
*/
|
|
421
|
+
getRoles(guildId: Snowflake): Promise<RESTGetAPIGuildRolesResult>;
|
|
422
|
+
/**
|
|
423
|
+
* Creates a guild role
|
|
424
|
+
*
|
|
425
|
+
* @param guildId - The id of the guild to create the role in
|
|
426
|
+
* @param data - The data to create the role with
|
|
427
|
+
* @param reason - The reason for creating the role
|
|
428
|
+
*/
|
|
429
|
+
createRole(guildId: Snowflake, data: RESTPostAPIGuildRoleJSONBody, reason?: string): Promise<discord_api_types_v10.APIRole>;
|
|
430
|
+
/**
|
|
431
|
+
* Sets role positions in a guild
|
|
432
|
+
*
|
|
433
|
+
* @param guildId - The id of the guild to set role positions for
|
|
434
|
+
* @param data - The data for setting a role position
|
|
435
|
+
* @param reason - The reason for setting the role position
|
|
436
|
+
*/
|
|
437
|
+
setRolePositions(guildId: Snowflake, data: RESTPatchAPIGuildRolePositionsJSONBody, reason?: string): Promise<RESTPatchAPIGuildRolePositionsResult>;
|
|
438
|
+
/**
|
|
439
|
+
* Edits a guild role
|
|
440
|
+
*
|
|
441
|
+
* @param guildId - The id of the guild to edit the role in
|
|
442
|
+
* @param roleId - The id of the role to edit
|
|
443
|
+
* @param data - data for editing the role
|
|
444
|
+
* @param reason - The reason for editing the role
|
|
445
|
+
*/
|
|
446
|
+
editRole(guildId: Snowflake, roleId: Snowflake, data: RESTPatchAPIGuildRoleJSONBody, reason?: string): Promise<discord_api_types_v10.APIRole>;
|
|
447
|
+
/**
|
|
448
|
+
* Deletes a guild role
|
|
449
|
+
*
|
|
450
|
+
* @param guildId - The id of the guild to delete the role in
|
|
451
|
+
* @param roleId - The id of the role to delete
|
|
452
|
+
* @param reason - The reason for deleting the role
|
|
453
|
+
*/
|
|
454
|
+
deleteRole(guildId: Snowflake, roleId: Snowflake, reason?: string): Promise<void>;
|
|
455
|
+
/**
|
|
456
|
+
* Edits the multi-factor-authentication (MFA) level of a guild
|
|
457
|
+
*
|
|
458
|
+
* @param guildId - The id of the guild to edit the MFA level for
|
|
459
|
+
* @param level - The new MFA level
|
|
460
|
+
* @param reason - The reason for editing the MFA level
|
|
461
|
+
*/
|
|
462
|
+
editMFALevel(guildId: Snowflake, level: GuildMFALevel, reason?: string): Promise<discord_api_types_v10.RESTPostAPIGuildsMFAJSONBody>;
|
|
463
|
+
/**
|
|
464
|
+
* Fetch the number of members that can be pruned from a guild
|
|
465
|
+
*
|
|
466
|
+
* @param guildId - The id of the guild to fetch the number of pruned members from
|
|
467
|
+
* @param options - The options for fetching the number of pruned members
|
|
468
|
+
*/
|
|
469
|
+
getPruneCount(guildId: Snowflake, options?: RESTGetAPIGuildPruneCountQuery): Promise<RESTGetAPIGuildPruneCountResult>;
|
|
470
|
+
/**
|
|
471
|
+
* Prunes members in a guild
|
|
472
|
+
*
|
|
473
|
+
* @param guildId - The id of the guild to prune members in
|
|
474
|
+
* @param options - The options for pruning members
|
|
475
|
+
* @param reason - The reason for pruning members
|
|
476
|
+
*/
|
|
477
|
+
beginPrune(guildId: Snowflake, options?: RESTPostAPIGuildPruneJSONBody, reason?: string): Promise<RESTGetAPIGuildPruneCountResult>;
|
|
478
|
+
/**
|
|
479
|
+
* Fetches voice regions for a guild
|
|
480
|
+
*
|
|
481
|
+
* @param guildId - The id of the guild to fetch the voice regions from
|
|
482
|
+
*/
|
|
483
|
+
getVoiceRegions(guildId: Snowflake): Promise<RESTGetAPIGuildVoiceRegionsResult>;
|
|
484
|
+
/**
|
|
485
|
+
* Fetches the invites for a guild
|
|
486
|
+
*
|
|
487
|
+
* @param guildId - The id of the guild to fetch the invites from
|
|
488
|
+
*/
|
|
489
|
+
getInvites(guildId: Snowflake): Promise<RESTGetAPIGuildInvitesResult>;
|
|
490
|
+
/**
|
|
491
|
+
* Fetches the integrations for a guild
|
|
492
|
+
*
|
|
493
|
+
* @param guildId - The id of the guild to fetch the integrations from
|
|
494
|
+
*/
|
|
495
|
+
getIntegrations(guildId: Snowflake): Promise<RESTGetAPIGuildIntegrationsResult>;
|
|
496
|
+
/**
|
|
497
|
+
* Deletes an integration from a guild
|
|
498
|
+
*
|
|
499
|
+
* @param guildId - The id of the guild to delete the integration from
|
|
500
|
+
* @param integrationId - The id of the integration to delete
|
|
501
|
+
* @param reason - The reason for deleting the integration
|
|
502
|
+
*/
|
|
503
|
+
deleteIntegration(guildId: Snowflake, integrationId: Snowflake, reason?: string): Promise<void>;
|
|
504
|
+
/**
|
|
505
|
+
* Fetches the widget settings for a guild
|
|
506
|
+
*
|
|
507
|
+
* @param guildId - The id of the guild to fetch the widget settings from
|
|
508
|
+
*/
|
|
509
|
+
getWidgetSettings(guildId: Snowflake): Promise<ArrayBuffer>;
|
|
510
|
+
/**
|
|
511
|
+
* Edits the widget settings for a guild
|
|
512
|
+
*
|
|
513
|
+
* @param guildId - The id of the guild to edit the widget settings from
|
|
514
|
+
* @param data - The new widget settings data
|
|
515
|
+
* @param reason - The reason for editing the widget settings
|
|
516
|
+
*/
|
|
517
|
+
editWidgetSettings(guildId: Snowflake, data: RESTPatchAPIGuildWidgetSettingsJSONBody, reason?: string): Promise<discord_api_types_v10.APIGuildWidgetSettings>;
|
|
518
|
+
/**
|
|
519
|
+
* Fetches the widget for a guild
|
|
520
|
+
*
|
|
521
|
+
* @param guildId - The id of the guild to fetch the widget from
|
|
522
|
+
*/
|
|
523
|
+
getWidget(guildId: Snowflake): Promise<discord_api_types_v10.APIGuildWidget>;
|
|
524
|
+
/**
|
|
525
|
+
* Fetches the vanity url for a guild
|
|
526
|
+
*
|
|
527
|
+
* @param guildId - The id of the guild to fetch the vanity url from
|
|
528
|
+
*/
|
|
529
|
+
getVanityURL(guildId: Snowflake): Promise<RESTGetAPIGuildVanityUrlResult>;
|
|
530
|
+
/**
|
|
531
|
+
* Fetches the widget image for a guild
|
|
532
|
+
*
|
|
533
|
+
* @param guildId - The id of the guild to fetch the widget image from
|
|
534
|
+
* @param style - The style of the widget image
|
|
535
|
+
*/
|
|
536
|
+
getWidgetImage(guildId: Snowflake, style?: GuildWidgetStyle): Promise<ArrayBuffer>;
|
|
537
|
+
/**
|
|
538
|
+
* Fetches the welcome screen for a guild
|
|
539
|
+
*
|
|
540
|
+
* @param guildId - The id of the guild to fetch the welcome screen from
|
|
541
|
+
*/
|
|
542
|
+
getWelcomeScreen(guildId: Snowflake): Promise<discord_api_types_v10.APIGuildWelcomeScreen>;
|
|
543
|
+
/**
|
|
544
|
+
* Edits the welcome screen for a guild
|
|
545
|
+
*
|
|
546
|
+
* @param guildId - The id of the guild to edit the welcome screen for
|
|
547
|
+
* @param data - The new welcome screen data
|
|
548
|
+
* @param reason - The reason for editing the welcome screen
|
|
549
|
+
*/
|
|
550
|
+
editWelcomeScreen(guildId: Snowflake, data?: RESTPatchAPIGuildWelcomeScreenJSONBody, reason?: string): Promise<discord_api_types_v10.APIGuildWelcomeScreen>;
|
|
551
|
+
/**
|
|
552
|
+
* Edits a user's voice state in a guild
|
|
553
|
+
*
|
|
554
|
+
* @param guildId - The id of the guild to edit the current user's voice state in
|
|
555
|
+
* @param userId - The id of the user to edit the voice state for
|
|
556
|
+
* @param data - The data for editing the voice state
|
|
557
|
+
* @param reason - The reason for editing the voice state
|
|
558
|
+
*/
|
|
559
|
+
editUserVoiceState(guildId: Snowflake, userId: Snowflake, data: RESTPatchAPIGuildVoiceStateUserJSONBody, reason?: string): Promise<void>;
|
|
560
|
+
/**
|
|
561
|
+
* Fetches all emojis for a guild
|
|
562
|
+
*
|
|
563
|
+
* @param guildId - The id of the guild to fetch the emojis from
|
|
564
|
+
*/
|
|
565
|
+
getEmojis(guildId: Snowflake): Promise<RESTGetAPIGuildEmojisResult>;
|
|
566
|
+
/**
|
|
567
|
+
* Fetches an emoji for a guild
|
|
568
|
+
*
|
|
569
|
+
* @param guildId - The id of the guild to fetch the emoji from
|
|
570
|
+
* @param emojiId - The id of the emoji to fetch
|
|
571
|
+
*/
|
|
572
|
+
getEmoji(guildId: Snowflake, emojiId: Snowflake): Promise<discord_api_types_v10.APIEmoji>;
|
|
573
|
+
/**
|
|
574
|
+
* Creates a new emoji for a guild
|
|
575
|
+
*
|
|
576
|
+
* @param guildId - The id of the guild to create the emoji from
|
|
577
|
+
* @param data - The data for creating the emoji
|
|
578
|
+
* @param reason - The reason for creating the emoji
|
|
579
|
+
*/
|
|
580
|
+
createEmoji(guildId: Snowflake, data: RESTPostAPIGuildEmojiJSONBody, reason?: string): Promise<discord_api_types_v10.APIEmoji>;
|
|
581
|
+
/**
|
|
582
|
+
* Edits an emoji for a guild
|
|
583
|
+
*
|
|
584
|
+
* @param guildId - The id of the guild to edit the emoji from
|
|
585
|
+
* @param emojiId - The id of the emoji to edit
|
|
586
|
+
* @param data - The data for editing the emoji
|
|
587
|
+
* @param reason - The reason for editing the emoji
|
|
588
|
+
*/
|
|
589
|
+
editEmoji(guildId: Snowflake, emojiId: Snowflake, data: RESTPatchAPIGuildEmojiJSONBody, reason?: string): Promise<discord_api_types_v10.APIEmoji>;
|
|
590
|
+
/**
|
|
591
|
+
* Deletes an emoji for a guild
|
|
592
|
+
*
|
|
593
|
+
* @param guildId - The id of the guild to delete the emoji from
|
|
594
|
+
* @param emojiId - The id of the emoji to delete
|
|
595
|
+
* @param reason - The reason for deleting the emoji
|
|
596
|
+
*/
|
|
597
|
+
deleteEmoji(guildId: Snowflake, emojiId: Snowflake, reason?: string): Promise<void>;
|
|
598
|
+
/**
|
|
599
|
+
* Fetches all scheduled events for a guild
|
|
600
|
+
*
|
|
601
|
+
* @param guildId - The id of the guild to fetch the scheduled events from
|
|
602
|
+
* @param options - The options for fetching the scheduled events
|
|
603
|
+
*/
|
|
604
|
+
getScheduledEvents(guildId: Snowflake, options?: RESTGetAPIGuildScheduledEventsQuery): Promise<RESTGetAPIGuildScheduledEventsResult>;
|
|
605
|
+
/**
|
|
606
|
+
* Creates a new scheduled event for a guild
|
|
607
|
+
*
|
|
608
|
+
* @param guildId - The id of the guild to create the scheduled event from
|
|
609
|
+
* @param data - The data to create the event with
|
|
610
|
+
* @param reason - The reason for creating the scheduled event
|
|
611
|
+
*/
|
|
612
|
+
createScheduledEvent(guildId: Snowflake, data: RESTPostAPIGuildScheduledEventJSONBody, reason?: string): Promise<discord_api_types_v10.APIGuildScheduledEvent>;
|
|
613
|
+
/**
|
|
614
|
+
* Fetches a scheduled event for a guild
|
|
615
|
+
*
|
|
616
|
+
* @param guildId - The id of the guild to fetch the scheduled event from
|
|
617
|
+
* @param eventId - The id of the scheduled event to fetch
|
|
618
|
+
* @param options - The options for fetching the scheduled event
|
|
619
|
+
*/
|
|
620
|
+
getScheduledEvent(guildId: Snowflake, eventId: Snowflake, options?: RESTGetAPIGuildScheduledEventQuery): Promise<discord_api_types_v10.APIGuildScheduledEvent>;
|
|
621
|
+
/**
|
|
622
|
+
* Edits a scheduled event for a guild
|
|
623
|
+
*
|
|
624
|
+
* @param guildId - The id of the guild to edit the scheduled event from
|
|
625
|
+
* @param eventId - The id of the scheduled event to edit
|
|
626
|
+
* @param data - The new event data
|
|
627
|
+
* @param reason - The reason for editing the scheduled event
|
|
628
|
+
*/
|
|
629
|
+
editScheduledEvent(guildId: Snowflake, eventId: Snowflake, data: RESTPatchAPIGuildScheduledEventJSONBody, reason?: string): Promise<discord_api_types_v10.APIGuildScheduledEvent>;
|
|
630
|
+
/**
|
|
631
|
+
* Deletes a scheduled event for a guild
|
|
632
|
+
*
|
|
633
|
+
* @param guildId - The id of the guild to delete the scheduled event from
|
|
634
|
+
* @param eventId - The id of the scheduled event to delete
|
|
635
|
+
* @param reason - The reason for deleting the scheduled event
|
|
636
|
+
*/
|
|
637
|
+
deleteScheduledEvent(guildId: Snowflake, eventId: Snowflake, reason?: string): Promise<void>;
|
|
638
|
+
/**
|
|
639
|
+
* Gets all users that are interested in a scheduled event
|
|
640
|
+
*
|
|
641
|
+
* @param guildId - The id of the guild to fetch the scheduled event users from
|
|
642
|
+
* @param eventId - The id of the scheduled event to fetch the users for
|
|
643
|
+
* @param options - The options for fetching the scheduled event users
|
|
644
|
+
*/
|
|
645
|
+
getScheduledEventUsers(guildId: Snowflake, eventId: Snowflake, options?: RESTGetAPIGuildScheduledEventUsersQuery): Promise<RESTGetAPIGuildScheduledEventUsersResult>;
|
|
646
|
+
/**
|
|
647
|
+
* Fetches all the templates for a guild
|
|
648
|
+
*
|
|
649
|
+
* @param guildId - The id of the guild to fetch the templates from
|
|
650
|
+
*/
|
|
651
|
+
getTemplates(guildId: Snowflake): Promise<RESTGetAPIGuildTemplatesResult>;
|
|
652
|
+
/**
|
|
653
|
+
* Syncs a template for a guild
|
|
654
|
+
*
|
|
655
|
+
* @param guildId - The id of the guild to sync the template from
|
|
656
|
+
* @param templateCode - The code of the template to sync
|
|
657
|
+
*/
|
|
658
|
+
syncTemplate(guildId: Snowflake, templateCode: string): Promise<discord_api_types_v10.APITemplate>;
|
|
659
|
+
/**
|
|
660
|
+
* Edits a template for a guild
|
|
661
|
+
*
|
|
662
|
+
* @param guildId - The id of the guild to edit the template from
|
|
663
|
+
* @param templateCode - The code of the template to edit
|
|
664
|
+
* @param data - The data for editing the template
|
|
665
|
+
*/
|
|
666
|
+
editTemplate(guildId: Snowflake, templateCode: string, data: RESTPatchAPIGuildTemplateJSONBody): Promise<discord_api_types_v10.APITemplate>;
|
|
667
|
+
/**
|
|
668
|
+
* Deletes a template for a guild
|
|
669
|
+
*
|
|
670
|
+
* @param guildId - The id of the guild to delete the template from
|
|
671
|
+
* @param templateCode - The code of the template to delete
|
|
672
|
+
*/
|
|
673
|
+
deleteTemplate(guildId: Snowflake, templateCode: string): Promise<void>;
|
|
674
|
+
/**
|
|
675
|
+
* Fetches all the stickers for a guild
|
|
676
|
+
*
|
|
677
|
+
* @param guildId - The id of the guild to fetch the stickers from
|
|
678
|
+
*/
|
|
679
|
+
getStickers(guildId: Snowflake): Promise<RESTGetAPIGuildStickersResult>;
|
|
680
|
+
/**
|
|
681
|
+
* Fetches a sticker for a guild
|
|
682
|
+
*
|
|
683
|
+
* @param guildId - The id of the guild to fetch the sticker from
|
|
684
|
+
* @param stickerId - The id of the sticker to fetch
|
|
685
|
+
*/
|
|
686
|
+
getSticker(guildId: Snowflake, stickerId: Snowflake): Promise<discord_api_types_v10.APISticker>;
|
|
687
|
+
/**
|
|
688
|
+
* Creates a sticker for a guild
|
|
689
|
+
*
|
|
690
|
+
* @param guildId - The id of the guild to create the sticker for
|
|
691
|
+
* @param data - The data for creating the sticker
|
|
692
|
+
* @param reason - The reason for creating the sticker
|
|
693
|
+
*/
|
|
694
|
+
createSticker(guildId: Snowflake, { file, ...body }: Omit<RESTPostAPIGuildStickerFormDataBody, 'file'> & {
|
|
695
|
+
file: RawFile;
|
|
696
|
+
}, reason?: string): Promise<discord_api_types_v10.APISticker>;
|
|
697
|
+
/**
|
|
698
|
+
* Edits a sticker for a guild
|
|
699
|
+
*
|
|
700
|
+
* @param guildId - The id of the guild to edit the sticker from
|
|
701
|
+
* @param stickerId - The id of the sticker to edit
|
|
702
|
+
* @param data - The data for editing the sticker
|
|
703
|
+
* @param reason - The reason for editing the sticker
|
|
704
|
+
*/
|
|
705
|
+
editSticker(guildId: Snowflake, stickerId: Snowflake, data: RESTPatchAPIGuildStickerJSONBody, reason?: string): Promise<discord_api_types_v10.APISticker>;
|
|
706
|
+
/**
|
|
707
|
+
* Deletes a sticker for a guild
|
|
708
|
+
*
|
|
709
|
+
* @param guildId - The id of the guild to delete the sticker from
|
|
710
|
+
* @param stickerId - The id of the sticker to delete
|
|
711
|
+
* @param reason - The reason for deleting the sticker
|
|
712
|
+
*/
|
|
713
|
+
deleteSticker(guildId: Snowflake, stickerId: Snowflake, reason?: string): Promise<void>;
|
|
714
|
+
/**
|
|
715
|
+
* Fetches the audit logs for a guild
|
|
716
|
+
*
|
|
717
|
+
* @param guildId - The id of the guild to fetch the audit logs from
|
|
718
|
+
* @param options - The options for fetching the audit logs
|
|
719
|
+
*/
|
|
720
|
+
getAuditLogs(guildId: Snowflake, options?: RESTGetAPIAuditLogQuery): Promise<discord_api_types_v10.APIAuditLog>;
|
|
721
|
+
/**
|
|
722
|
+
* Fetches all auto moderation rules for a guild
|
|
723
|
+
*
|
|
724
|
+
* @param guildId - The id of the guild to fetch the auto moderation rules from
|
|
725
|
+
*/
|
|
726
|
+
getAutoModerationRules(guildId: Snowflake): Promise<RESTGetAPIAutoModerationRulesResult>;
|
|
727
|
+
/**
|
|
728
|
+
* Fetches an auto moderation rule for a guild
|
|
729
|
+
*
|
|
730
|
+
* @param guildId - The id of the guild to fetch the auto moderation rule from
|
|
731
|
+
* @param ruleId - The id of the auto moderation rule to fetch
|
|
732
|
+
*/
|
|
733
|
+
getAutoModerationRule(guildId: Snowflake, ruleId: Snowflake): Promise<discord_api_types_v10.APIAutoModerationRule>;
|
|
734
|
+
/**
|
|
735
|
+
* Creates a new auto moderation rule for a guild
|
|
736
|
+
*
|
|
737
|
+
* @param guildId - The id of the guild to create the auto moderation rule from
|
|
738
|
+
* @param data - The data for creating the auto moderation rule
|
|
739
|
+
*/
|
|
740
|
+
createAutoModerationRule(guildId: Snowflake, data: RESTPostAPIAutoModerationRuleJSONBody, reason?: string): Promise<discord_api_types_v10.APIAutoModerationRule>;
|
|
741
|
+
/**
|
|
742
|
+
* Edits an auto moderation rule for a guild
|
|
743
|
+
*
|
|
744
|
+
* @param guildId - The id of the guild to edit the auto moderation rule from
|
|
745
|
+
* @param ruleId - The id of the auto moderation rule to edit
|
|
746
|
+
* @param data - The data for editing the auto moderation rule
|
|
747
|
+
* @param reason - The reason for editing the auto moderation rule
|
|
748
|
+
*/
|
|
749
|
+
editAutoModerationRule(guildId: Snowflake, ruleId: Snowflake, data: RESTPatchAPIAutoModerationRuleJSONBody, reason?: string): Promise<RESTPatchAPIAutoModerationRuleJSONBody>;
|
|
750
|
+
/**
|
|
751
|
+
* Deletes an auto moderation rule for a guild
|
|
752
|
+
*
|
|
753
|
+
* @param guildId - The id of the guild to delete the auto moderation rule from
|
|
754
|
+
* @param ruleId - The id of the auto moderation rule to delete
|
|
755
|
+
* @param reason - The reason for deleting the auto moderation rule
|
|
756
|
+
*/
|
|
757
|
+
deleteAutoModerationRule(guildId: Snowflake, ruleId: Snowflake, reason?: string): Promise<void>;
|
|
758
|
+
/**
|
|
759
|
+
* Fetches a guild member
|
|
760
|
+
*
|
|
761
|
+
* @param guildId - The id of the guild
|
|
762
|
+
* @param userId - The id of the user
|
|
763
|
+
*/
|
|
764
|
+
getMember(guildId: Snowflake, userId: Snowflake): Promise<discord_api_types_v10.APIGuildMember>;
|
|
765
|
+
/**
|
|
766
|
+
* Searches for guild members
|
|
767
|
+
*
|
|
768
|
+
* @param guildId - The id of the guild to search in
|
|
769
|
+
* @param query - The query to search for
|
|
770
|
+
* @param limit - The maximum number of members to return
|
|
771
|
+
*/
|
|
772
|
+
searchForMembers(guildId: Snowflake, options: RESTGetAPIGuildMembersSearchQuery): Promise<RESTGetAPIGuildMembersSearchResult>;
|
|
773
|
+
/**
|
|
774
|
+
* Edits a guild member
|
|
775
|
+
*
|
|
776
|
+
* @param guildId - The id of the guild
|
|
777
|
+
* @param userId - The id of the user
|
|
778
|
+
* @param data - The data to use when editing the guild member
|
|
779
|
+
* @param reason - The reason for editing this guild member
|
|
780
|
+
*/
|
|
781
|
+
editMember(guildId: Snowflake, userId: Snowflake, data?: RESTPatchAPIGuildMemberJSONBody, reason?: string): Promise<discord_api_types_v10.APIGuildMember>;
|
|
782
|
+
/**
|
|
783
|
+
* Adds a role to a guild member
|
|
784
|
+
*
|
|
785
|
+
* @param guildId - The id of the guild
|
|
786
|
+
* @param userId - The id of the user
|
|
787
|
+
* @param roleId - The id of the role
|
|
788
|
+
* @param reason - The reason for adding this role to the guild member
|
|
789
|
+
*/
|
|
790
|
+
addRoleToMember(guildId: Snowflake, userId: Snowflake, roleId: Snowflake, reason?: string): Promise<void>;
|
|
791
|
+
/**
|
|
792
|
+
* Removes a role from a guild member
|
|
793
|
+
*
|
|
794
|
+
* @param guildId - The id of the guild
|
|
795
|
+
* @param userId - The id of the user
|
|
796
|
+
* @param roleId - The id of the role
|
|
797
|
+
* @param reason - The reason for removing this role from the guild member
|
|
798
|
+
*/
|
|
799
|
+
removeRoleFromMember(guildId: Snowflake, userId: Snowflake, roleId: Snowflake, reason?: string): Promise<void>;
|
|
800
|
+
/**
|
|
801
|
+
* Fetches a guild template
|
|
802
|
+
*
|
|
803
|
+
* @param templateCode - The code of the template
|
|
804
|
+
*/
|
|
805
|
+
getTemplate(templateCode: string): Promise<discord_api_types_v10.APITemplate>;
|
|
806
|
+
/**
|
|
807
|
+
* Creates a new template
|
|
808
|
+
*
|
|
809
|
+
* @param templateCode - The code of the template
|
|
810
|
+
* @param data - The data to use when creating the template
|
|
811
|
+
*/
|
|
812
|
+
createTemplate(templateCode: string, data: RESTPostAPITemplateCreateGuildJSONBody): Promise<discord_api_types_v10.APITemplate>;
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
declare class WebhooksAPI {
|
|
816
|
+
private readonly rest;
|
|
817
|
+
constructor(rest: REST);
|
|
818
|
+
/**
|
|
819
|
+
* Fetches a webhook
|
|
820
|
+
*
|
|
821
|
+
* @param id - The id of the webhook
|
|
822
|
+
* @param token - The token of the webhook
|
|
823
|
+
*/
|
|
824
|
+
get(id: Snowflake, token?: string): Promise<discord_api_types_v10.APIWebhook>;
|
|
825
|
+
/**
|
|
826
|
+
* Creates a new webhook
|
|
827
|
+
*
|
|
828
|
+
* @param channelId - The id of the channel to create the webhook in
|
|
829
|
+
* @param data - The data to use when creating the webhook
|
|
830
|
+
* @param reason - The reason for creating the webhook
|
|
831
|
+
*/
|
|
832
|
+
create(channelId: Snowflake, data: RESTPostAPIChannelWebhookJSONBody, reason?: string): Promise<never>;
|
|
833
|
+
/**
|
|
834
|
+
* Edits a webhook
|
|
835
|
+
*
|
|
836
|
+
* @param id - The id of the webhook to edit
|
|
837
|
+
* @param webhook - The new webhook data
|
|
838
|
+
* @param options - The options to use when editing the webhook
|
|
839
|
+
*/
|
|
840
|
+
edit(id: Snowflake, webhook: RESTPatchAPIWebhookJSONBody, { token, reason }?: {
|
|
841
|
+
reason?: string;
|
|
842
|
+
token?: string;
|
|
843
|
+
}): Promise<discord_api_types_v10.APIWebhook>;
|
|
844
|
+
/**
|
|
845
|
+
* Deletes a webhook
|
|
846
|
+
*
|
|
847
|
+
* @param id - The id of the webhook to delete
|
|
848
|
+
* @param options - The options to use when deleting the webhook
|
|
849
|
+
*/
|
|
850
|
+
delete(id: Snowflake, { token, reason }?: {
|
|
851
|
+
reason?: string;
|
|
852
|
+
token?: string;
|
|
853
|
+
}): Promise<void>;
|
|
854
|
+
/**
|
|
855
|
+
* Executes a webhook and returns the created message
|
|
856
|
+
*
|
|
857
|
+
* @param id - The id of the webhook
|
|
858
|
+
* @param token - The token of the webhook
|
|
859
|
+
* @param data - The data to use when executing the webhook
|
|
860
|
+
*/
|
|
861
|
+
execute(id: Snowflake, token: string, data: RESTPostAPIWebhookWithTokenJSONBody & RESTPostAPIWebhookWithTokenQuery & {
|
|
862
|
+
files?: RawFile[];
|
|
863
|
+
wait: true;
|
|
864
|
+
}): Promise<RESTPostAPIWebhookWithTokenWaitResult>;
|
|
865
|
+
/**
|
|
866
|
+
* Executes a webhook
|
|
867
|
+
*
|
|
868
|
+
* @param id - The id of the webhook
|
|
869
|
+
* @param token - The token of the webhook
|
|
870
|
+
* @param data - The data to use when executing the webhook
|
|
871
|
+
*/
|
|
872
|
+
execute(id: Snowflake, token: string, data: RESTPostAPIWebhookWithTokenJSONBody & RESTPostAPIWebhookWithTokenQuery & {
|
|
873
|
+
files?: RawFile[];
|
|
874
|
+
wait?: false;
|
|
875
|
+
}): Promise<void>;
|
|
876
|
+
/**
|
|
877
|
+
* Executes a slack webhook
|
|
878
|
+
*
|
|
879
|
+
* @param id - The id of the webhook
|
|
880
|
+
* @param token - The token of the webhook
|
|
881
|
+
* @param options - The options to use when executing the webhook
|
|
882
|
+
*/
|
|
883
|
+
executeSlack(id: Snowflake, token: string, body: unknown, options?: RESTPostAPIWebhookWithTokenSlackQuery): Promise<void>;
|
|
884
|
+
/**
|
|
885
|
+
* Executes a github webhook
|
|
886
|
+
*
|
|
887
|
+
* @param id - The id of the webhook
|
|
888
|
+
* @param token - The token of the webhook
|
|
889
|
+
* @param options - The options to use when executing the webhook
|
|
890
|
+
*/
|
|
891
|
+
executeGitHub(id: Snowflake, token: string, body: unknown, options?: RESTPostAPIWebhookWithTokenGitHubQuery): Promise<void>;
|
|
892
|
+
/**
|
|
893
|
+
* Fetches an associated message from a webhook
|
|
894
|
+
*
|
|
895
|
+
* @param id - The id of the webhook
|
|
896
|
+
* @param token - The token of the webhook
|
|
897
|
+
* @param messageId - The id of the message to fetch
|
|
898
|
+
* @param options - The options to use when fetching the message
|
|
899
|
+
*/
|
|
900
|
+
getMessage(id: Snowflake, token: string, messageId: Snowflake, options?: {
|
|
901
|
+
thread_id?: string;
|
|
902
|
+
}): Promise<discord_api_types_v10.APIMessage>;
|
|
903
|
+
/**
|
|
904
|
+
* Edits an associated message from a webhook
|
|
905
|
+
*
|
|
906
|
+
* @param id - The id of the webhook
|
|
907
|
+
* @param token - The token of the webhook
|
|
908
|
+
* @param messageId - The id of the message to edit
|
|
909
|
+
* @param data - The data to use when editing the message
|
|
910
|
+
*/
|
|
911
|
+
editMessage(id: Snowflake, token: string, messageId: Snowflake, { thread_id, ...body }: RESTPatchAPIWebhookWithTokenMessageJSONBody & {
|
|
912
|
+
thread_id?: string;
|
|
913
|
+
}): Promise<discord_api_types_v10.APIMessage>;
|
|
914
|
+
/**
|
|
915
|
+
* Deletes an associated message from a webhook
|
|
916
|
+
*
|
|
917
|
+
* @param id - The id of the webhook
|
|
918
|
+
* @param token - The token of the webhook
|
|
919
|
+
* @param messageId - The id of the message to delete
|
|
920
|
+
* @param options - The options to use when deleting the message
|
|
921
|
+
*/
|
|
922
|
+
deleteMessage(id: Snowflake, token: string, messageId: Snowflake, options?: {
|
|
923
|
+
thread_id?: string;
|
|
924
|
+
}): Promise<void>;
|
|
925
|
+
}
|
|
926
|
+
|
|
927
|
+
declare class InteractionsAPI {
|
|
928
|
+
private readonly rest;
|
|
929
|
+
private readonly webhooks;
|
|
930
|
+
constructor(rest: REST, webhooks: WebhooksAPI);
|
|
931
|
+
/**
|
|
932
|
+
* Replies to an interaction
|
|
933
|
+
*
|
|
934
|
+
* @param interactionId - The id of the interaction
|
|
935
|
+
* @param interactionToken - The token of the interaction
|
|
936
|
+
* @param data - The data to use when replying
|
|
937
|
+
*/
|
|
938
|
+
reply(interactionId: Snowflake, interactionToken: string, { files, ...data }: APIInteractionResponseCallbackData & {
|
|
939
|
+
files?: RawFile[];
|
|
940
|
+
}): Promise<void>;
|
|
941
|
+
/**
|
|
942
|
+
* Defers the reply to an interaction
|
|
943
|
+
*
|
|
944
|
+
* @param interactionId - The id of the interaction
|
|
945
|
+
* @param interactionToken - The token of the interaction
|
|
946
|
+
*/
|
|
947
|
+
defer(interactionId: Snowflake, interactionToken: string): Promise<void>;
|
|
948
|
+
/**
|
|
949
|
+
* Defers an update from a message component interaction
|
|
950
|
+
*
|
|
951
|
+
* @param interactionId - The id of the interaction
|
|
952
|
+
* @param interactionToken - The token of the interaction
|
|
953
|
+
*/
|
|
954
|
+
deferMessageUpdate(interactionId: Snowflake, interactionToken: string): Promise<void>;
|
|
955
|
+
/**
|
|
956
|
+
* Reply to a deferred interaction
|
|
957
|
+
*
|
|
958
|
+
* @param applicationId - The application id of the interaction
|
|
959
|
+
* @param interactionToken - The token of the interaction
|
|
960
|
+
* @param data - The data to use when replying
|
|
961
|
+
*/
|
|
962
|
+
followUp(applicationId: Snowflake, interactionToken: string, data: APIInteractionResponseCallbackData & {
|
|
963
|
+
files?: RawFile[];
|
|
964
|
+
}): Promise<void>;
|
|
965
|
+
/**
|
|
966
|
+
* Edits the initial reply to an interaction
|
|
967
|
+
*
|
|
968
|
+
* @param applicationId - The application id of the interaction
|
|
969
|
+
* @param interactionToken - The token of the interaction
|
|
970
|
+
* @param data - The data to use when editing the reply
|
|
971
|
+
* @param messageId - The id of the message to edit. If omitted, the original reply will be edited
|
|
972
|
+
*/
|
|
973
|
+
editReply(applicationId: Snowflake, interactionToken: string, data: APIInteractionResponseCallbackData & {
|
|
974
|
+
files?: RawFile[];
|
|
975
|
+
}, messageId?: string): Promise<discord_api_types_v10.APIMessage>;
|
|
976
|
+
/**
|
|
977
|
+
* Fetches the initial reply to an interaction
|
|
978
|
+
*
|
|
979
|
+
* @param applicationId - The application id of the interaction
|
|
980
|
+
* @param interactionToken - The token of the interaction
|
|
981
|
+
*/
|
|
982
|
+
getOriginalReply(applicationId: Snowflake, interactionToken: string): Promise<discord_api_types_v10.APIMessage>;
|
|
983
|
+
/**
|
|
984
|
+
* Deletes the initial reply to an interaction
|
|
985
|
+
*
|
|
986
|
+
* @param applicationId - The application id of the interaction
|
|
987
|
+
* @param interactionToken - The token of the interaction
|
|
988
|
+
*/
|
|
989
|
+
deleteReply(applicationId: Snowflake, interactionToken: string): Promise<void>;
|
|
990
|
+
/**
|
|
991
|
+
* Updates the the message the component interaction was triggered on
|
|
992
|
+
*
|
|
993
|
+
* @param interactionId - The id of the interaction
|
|
994
|
+
* @param interactionToken - The token of the interaction
|
|
995
|
+
* @param data - The data to use when updating the interaction
|
|
996
|
+
*/
|
|
997
|
+
updateMessage(interactionId: Snowflake, interactionToken: string, { files, ...data }: APIInteractionResponseCallbackData & {
|
|
998
|
+
files?: RawFile[];
|
|
999
|
+
}): Promise<void>;
|
|
1000
|
+
/**
|
|
1001
|
+
* Sends an autocomplete response to an interaction
|
|
1002
|
+
*
|
|
1003
|
+
* @param interactionId - The id of the interaction
|
|
1004
|
+
* @param interactionToken - The token of the interaction
|
|
1005
|
+
* @param data - Data for the autocomplete response
|
|
1006
|
+
*/
|
|
1007
|
+
createAutocompleteResponse(interactionId: Snowflake, interactionToken: string, data: APICommandAutocompleteInteractionResponseCallbackData): Promise<void>;
|
|
1008
|
+
/**
|
|
1009
|
+
* Sends a modal response to an interaction
|
|
1010
|
+
*
|
|
1011
|
+
* @param interactionId - The id of the interaction
|
|
1012
|
+
* @param interactionToken - The token of the interaction
|
|
1013
|
+
* @param data - The modal to send
|
|
1014
|
+
*/
|
|
1015
|
+
createModal(interactionId: Snowflake, interactionToken: string, data: APIModalInteractionResponseCallbackData): Promise<void>;
|
|
1016
|
+
}
|
|
1017
|
+
|
|
1018
|
+
declare class InvitesAPI {
|
|
1019
|
+
private readonly rest;
|
|
1020
|
+
constructor(rest: REST);
|
|
1021
|
+
/**
|
|
1022
|
+
* Fetches an invite
|
|
1023
|
+
*
|
|
1024
|
+
* @param code - The invite code
|
|
1025
|
+
*/
|
|
1026
|
+
get(code: string, options?: RESTGetAPIInviteQuery): Promise<discord_api_types_v10.APIInvite>;
|
|
1027
|
+
/**
|
|
1028
|
+
* Deletes an invite
|
|
1029
|
+
*
|
|
1030
|
+
* @param code - The invite code
|
|
1031
|
+
* @param reason - The reason for deleting the invite
|
|
1032
|
+
*/
|
|
1033
|
+
delete(code: string, reason?: string): Promise<void>;
|
|
1034
|
+
}
|
|
1035
|
+
|
|
1036
|
+
declare class StickersAPI {
|
|
1037
|
+
private readonly rest;
|
|
1038
|
+
constructor(rest: REST);
|
|
1039
|
+
/**
|
|
1040
|
+
* Fetches all of the nitro sticker packs
|
|
1041
|
+
*/
|
|
1042
|
+
getNitroStickers(): Promise<RESTGetNitroStickerPacksResult>;
|
|
1043
|
+
/**
|
|
1044
|
+
* Fetches a sticker
|
|
1045
|
+
*
|
|
1046
|
+
* @param stickerId - The id of the sticker
|
|
1047
|
+
*/
|
|
1048
|
+
get(stickerId: Snowflake): Promise<discord_api_types_v10.APISticker>;
|
|
1049
|
+
}
|
|
1050
|
+
|
|
1051
|
+
interface StartThreadOptions extends RESTPostAPIChannelThreadsJSONBody {
|
|
1052
|
+
message_id?: string;
|
|
1053
|
+
}
|
|
1054
|
+
interface StartForumThreadOptions extends RESTPostAPIGuildForumThreadsJSONBody {
|
|
1055
|
+
message: RESTPostAPIGuildForumThreadsJSONBody['message'] & {
|
|
1056
|
+
files?: RawFile[];
|
|
1057
|
+
};
|
|
1058
|
+
}
|
|
1059
|
+
declare class ThreadsAPI {
|
|
1060
|
+
private readonly rest;
|
|
1061
|
+
constructor(rest: REST);
|
|
1062
|
+
/**
|
|
1063
|
+
* Fetches a thread
|
|
1064
|
+
*
|
|
1065
|
+
* @param channelId - The id of the channel to fetch the thread from
|
|
1066
|
+
* @param threadId - The id of the thread
|
|
1067
|
+
*/
|
|
1068
|
+
get(channelId: Snowflake, threadId: Snowflake): Promise<APIThreadChannel>;
|
|
1069
|
+
/**
|
|
1070
|
+
* Creates a new thread
|
|
1071
|
+
*
|
|
1072
|
+
* @param channelId - The id of the channel to start the thread in
|
|
1073
|
+
* @param data - The data to use when starting the thread
|
|
1074
|
+
*/
|
|
1075
|
+
create(channelId: Snowflake, { message_id, ...body }: StartThreadOptions): Promise<discord_api_types_v10.APIChannel>;
|
|
1076
|
+
/**
|
|
1077
|
+
* Creates a new forum post
|
|
1078
|
+
*
|
|
1079
|
+
* @param channelId - The id of the forum channel to start the thread in
|
|
1080
|
+
* @param data - The data to use when starting the thread
|
|
1081
|
+
*/
|
|
1082
|
+
createForumThread(channelId: Snowflake, { message, ...optionsBody }: StartForumThreadOptions): Promise<APIThreadChannel>;
|
|
1083
|
+
/**
|
|
1084
|
+
* Adds the current user to a thread
|
|
1085
|
+
*
|
|
1086
|
+
* @param threadId - The id of the thread to join
|
|
1087
|
+
*/
|
|
1088
|
+
join(threadId: Snowflake): Promise<void>;
|
|
1089
|
+
/**
|
|
1090
|
+
* Adds a member to a thread
|
|
1091
|
+
*
|
|
1092
|
+
* @param threadId - The id of the thread to add the member to
|
|
1093
|
+
* @param userId - The id of the user to add to the thread
|
|
1094
|
+
*/
|
|
1095
|
+
addMember(threadId: Snowflake, userId: Snowflake): Promise<void>;
|
|
1096
|
+
/**
|
|
1097
|
+
* Removes the current user from a thread
|
|
1098
|
+
*
|
|
1099
|
+
* @param threadId - The id of the thread to leave
|
|
1100
|
+
*/
|
|
1101
|
+
leave(threadId: Snowflake): Promise<void>;
|
|
1102
|
+
/**
|
|
1103
|
+
* Removes a member from a thread
|
|
1104
|
+
*
|
|
1105
|
+
* @param threadId - The id of the thread to remove the member from
|
|
1106
|
+
* @param userId - The id of the user to remove from the thread
|
|
1107
|
+
*/
|
|
1108
|
+
removeMember(threadId: Snowflake, userId: Snowflake): Promise<void>;
|
|
1109
|
+
/**
|
|
1110
|
+
* Fetches a member of a thread
|
|
1111
|
+
*
|
|
1112
|
+
* @param threadId - The id of the thread to fetch the member from
|
|
1113
|
+
* @param userId - The id of the user
|
|
1114
|
+
*/
|
|
1115
|
+
getMember(threadId: Snowflake, userId: Snowflake): Promise<APIThreadMember>;
|
|
1116
|
+
/**
|
|
1117
|
+
* Fetches all members of a thread
|
|
1118
|
+
*
|
|
1119
|
+
* @param threadId - The id of the thread to fetch the members from
|
|
1120
|
+
*/
|
|
1121
|
+
getAllMembers(threadId: Snowflake): Promise<RESTGetAPIChannelThreadMembersResult>;
|
|
1122
|
+
}
|
|
1123
|
+
|
|
1124
|
+
declare class UsersAPI {
|
|
1125
|
+
private readonly rest;
|
|
1126
|
+
constructor(rest: REST);
|
|
1127
|
+
/**
|
|
1128
|
+
* Fetches a user by their id
|
|
1129
|
+
*
|
|
1130
|
+
* @param userId - The id of the user to fetch
|
|
1131
|
+
*/
|
|
1132
|
+
get(userId: Snowflake): Promise<discord_api_types_v10.APIUser>;
|
|
1133
|
+
/**
|
|
1134
|
+
* Returns the user object of the requester's account
|
|
1135
|
+
*/
|
|
1136
|
+
getCurrent(): Promise<discord_api_types_v10.APIUser>;
|
|
1137
|
+
/**
|
|
1138
|
+
* Returns a list of partial guild objects the current user is a member of
|
|
1139
|
+
*
|
|
1140
|
+
* @param options - The options to use when fetching the current user's guilds
|
|
1141
|
+
*/
|
|
1142
|
+
getGuilds(options?: RESTGetAPICurrentUserGuildsQuery): Promise<RESTGetAPICurrentUserGuildsResult>;
|
|
1143
|
+
/**
|
|
1144
|
+
* Leaves the guild with the given id
|
|
1145
|
+
*
|
|
1146
|
+
* @param guildId - The id of the guild
|
|
1147
|
+
*/
|
|
1148
|
+
leaveGuild(guildId: Snowflake): Promise<void>;
|
|
1149
|
+
/**
|
|
1150
|
+
* Edits the current user
|
|
1151
|
+
*
|
|
1152
|
+
* @param user - The new data for the current user
|
|
1153
|
+
*/
|
|
1154
|
+
edit(user: RESTPatchAPICurrentUserJSONBody): Promise<discord_api_types_v10.APIUser>;
|
|
1155
|
+
/**
|
|
1156
|
+
* Fetches the guild member for the current user
|
|
1157
|
+
*
|
|
1158
|
+
* @param guildId - The id of the guild
|
|
1159
|
+
*/
|
|
1160
|
+
getGuildMember(guildId: Snowflake): Promise<discord_api_types_v10.APIGuildMember>;
|
|
1161
|
+
/**
|
|
1162
|
+
* Edits the guild member for the current user
|
|
1163
|
+
*
|
|
1164
|
+
* @param guildId - The id of the guild
|
|
1165
|
+
* @param member - The new data for the guild member
|
|
1166
|
+
* @param reason - The reason for editing this guild member
|
|
1167
|
+
*/
|
|
1168
|
+
editGuildMember(guildId: Snowflake, member?: RESTPatchAPIGuildMemberJSONBody, reason?: string): Promise<discord_api_types_v10.APIGuildMember>;
|
|
1169
|
+
/**
|
|
1170
|
+
* Sets the voice state for the current user
|
|
1171
|
+
*
|
|
1172
|
+
* @param guildId - The id of the guild
|
|
1173
|
+
* @param options - The options to use when setting the voice state
|
|
1174
|
+
*/
|
|
1175
|
+
setVoiceState(guildId: Snowflake, options?: RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody): Promise<never>;
|
|
1176
|
+
/**
|
|
1177
|
+
* Opens a new DM channel with a user
|
|
1178
|
+
*
|
|
1179
|
+
* @param userId - The id of the user to open a DM channel with
|
|
1180
|
+
*/
|
|
1181
|
+
createDM(userId: Snowflake): Promise<discord_api_types_v10.APIChannel>;
|
|
1182
|
+
}
|
|
1183
|
+
|
|
1184
|
+
declare class VoiceAPI {
|
|
1185
|
+
private readonly rest;
|
|
1186
|
+
constructor(rest: REST);
|
|
1187
|
+
/**
|
|
1188
|
+
* Fetches all voice regions
|
|
1189
|
+
*/
|
|
1190
|
+
getVoiceRegions(): Promise<discord_api_types_v10.RESTGetAPIVoiceRegionsResult>;
|
|
1191
|
+
}
|
|
1192
|
+
|
|
1193
|
+
declare class API {
|
|
1194
|
+
readonly rest: REST;
|
|
1195
|
+
readonly applicationCommands: ApplicationCommandsAPI;
|
|
1196
|
+
readonly channels: ChannelsAPI;
|
|
1197
|
+
readonly guilds: GuildsAPI;
|
|
1198
|
+
readonly interactions: InteractionsAPI;
|
|
1199
|
+
readonly invites: InvitesAPI;
|
|
1200
|
+
readonly stickers: StickersAPI;
|
|
1201
|
+
readonly threads: ThreadsAPI;
|
|
1202
|
+
readonly users: UsersAPI;
|
|
1203
|
+
readonly voice: VoiceAPI;
|
|
1204
|
+
readonly webhooks: WebhooksAPI;
|
|
1205
|
+
constructor(rest: REST);
|
|
1206
|
+
}
|
|
1207
|
+
|
|
1208
|
+
interface IntrinsicProps {
|
|
1209
|
+
/**
|
|
1210
|
+
* The REST API
|
|
1211
|
+
*/
|
|
1212
|
+
api: API;
|
|
1213
|
+
/**
|
|
1214
|
+
* The id of the shard that emitted the event
|
|
1215
|
+
*/
|
|
1216
|
+
shardId: number;
|
|
1217
|
+
}
|
|
1218
|
+
interface WithIntrinsicProps<T> extends IntrinsicProps {
|
|
1219
|
+
data: T;
|
|
1220
|
+
}
|
|
1221
|
+
interface MappedEvents {
|
|
1222
|
+
[GatewayDispatchEvents.ChannelCreate]: [WithIntrinsicProps<GatewayChannelCreateDispatchData>];
|
|
1223
|
+
[GatewayDispatchEvents.ChannelDelete]: [WithIntrinsicProps<GatewayChannelDeleteDispatchData>];
|
|
1224
|
+
[GatewayDispatchEvents.ChannelPinsUpdate]: [WithIntrinsicProps<GatewayChannelPinsUpdateDispatchData>];
|
|
1225
|
+
[GatewayDispatchEvents.ChannelUpdate]: [WithIntrinsicProps<GatewayChannelUpdateDispatchData>];
|
|
1226
|
+
[GatewayDispatchEvents.GuildBanAdd]: [WithIntrinsicProps<GatewayGuildBanAddDispatchData>];
|
|
1227
|
+
[GatewayDispatchEvents.GuildBanRemove]: [WithIntrinsicProps<GatewayGuildBanRemoveDispatchData>];
|
|
1228
|
+
[GatewayDispatchEvents.GuildCreate]: [WithIntrinsicProps<GatewayGuildCreateDispatchData>];
|
|
1229
|
+
[GatewayDispatchEvents.GuildDelete]: [WithIntrinsicProps<GatewayGuildDeleteDispatchData>];
|
|
1230
|
+
[GatewayDispatchEvents.GuildEmojisUpdate]: [WithIntrinsicProps<GatewayGuildEmojisUpdateDispatchData>];
|
|
1231
|
+
[GatewayDispatchEvents.GuildIntegrationsUpdate]: [WithIntrinsicProps<GatewayGuildIntegrationsUpdateDispatchData>];
|
|
1232
|
+
[GatewayDispatchEvents.GuildMemberAdd]: [WithIntrinsicProps<GatewayGuildMemberAddDispatchData>];
|
|
1233
|
+
[GatewayDispatchEvents.GuildMemberRemove]: [WithIntrinsicProps<GatewayGuildMemberRemoveDispatchData>];
|
|
1234
|
+
[GatewayDispatchEvents.GuildMemberUpdate]: [WithIntrinsicProps<GatewayGuildMemberUpdateDispatchData>];
|
|
1235
|
+
[GatewayDispatchEvents.GuildMembersChunk]: [WithIntrinsicProps<GatewayGuildMembersChunkDispatchData>];
|
|
1236
|
+
[GatewayDispatchEvents.GuildRoleCreate]: [WithIntrinsicProps<GatewayGuildRoleCreateDispatchData>];
|
|
1237
|
+
[GatewayDispatchEvents.GuildRoleDelete]: [WithIntrinsicProps<GatewayGuildRoleDeleteDispatchData>];
|
|
1238
|
+
[GatewayDispatchEvents.GuildRoleUpdate]: [WithIntrinsicProps<GatewayGuildRoleUpdateDispatchData>];
|
|
1239
|
+
[GatewayDispatchEvents.GuildScheduledEventCreate]: [WithIntrinsicProps<GatewayGuildScheduledEventCreateDispatchData>];
|
|
1240
|
+
[GatewayDispatchEvents.GuildScheduledEventDelete]: [WithIntrinsicProps<GatewayGuildScheduledEventDeleteDispatchData>];
|
|
1241
|
+
[GatewayDispatchEvents.GuildScheduledEventUpdate]: [WithIntrinsicProps<GatewayGuildScheduledEventUpdateDispatchData>];
|
|
1242
|
+
[GatewayDispatchEvents.GuildScheduledEventUserAdd]: [
|
|
1243
|
+
WithIntrinsicProps<GatewayGuildScheduledEventUserAddDispatchData>
|
|
1244
|
+
];
|
|
1245
|
+
[GatewayDispatchEvents.GuildScheduledEventUserRemove]: [
|
|
1246
|
+
WithIntrinsicProps<GatewayGuildScheduledEventUserRemoveDispatchData>
|
|
1247
|
+
];
|
|
1248
|
+
[GatewayDispatchEvents.GuildStickersUpdate]: [WithIntrinsicProps<GatewayGuildStickersUpdateDispatchData>];
|
|
1249
|
+
[GatewayDispatchEvents.GuildUpdate]: [WithIntrinsicProps<GatewayGuildUpdateDispatchData>];
|
|
1250
|
+
[GatewayDispatchEvents.IntegrationCreate]: [WithIntrinsicProps<GatewayIntegrationCreateDispatchData>];
|
|
1251
|
+
[GatewayDispatchEvents.IntegrationDelete]: [WithIntrinsicProps<GatewayIntegrationDeleteDispatchData>];
|
|
1252
|
+
[GatewayDispatchEvents.IntegrationUpdate]: [WithIntrinsicProps<GatewayIntegrationUpdateDispatchData>];
|
|
1253
|
+
[GatewayDispatchEvents.InteractionCreate]: [WithIntrinsicProps<GatewayInteractionCreateDispatchData>];
|
|
1254
|
+
[GatewayDispatchEvents.InviteCreate]: [WithIntrinsicProps<GatewayInviteCreateDispatchData>];
|
|
1255
|
+
[GatewayDispatchEvents.InviteDelete]: [WithIntrinsicProps<GatewayInviteDeleteDispatchData>];
|
|
1256
|
+
[GatewayDispatchEvents.MessageCreate]: [WithIntrinsicProps<GatewayMessageCreateDispatchData>];
|
|
1257
|
+
[GatewayDispatchEvents.MessageDelete]: [WithIntrinsicProps<GatewayMessageDeleteDispatchData>];
|
|
1258
|
+
[GatewayDispatchEvents.MessageDeleteBulk]: [WithIntrinsicProps<GatewayMessageDeleteBulkDispatchData>];
|
|
1259
|
+
[GatewayDispatchEvents.MessageReactionAdd]: [WithIntrinsicProps<GatewayMessageReactionAddDispatchData>];
|
|
1260
|
+
[GatewayDispatchEvents.MessageReactionRemove]: [WithIntrinsicProps<GatewayMessageReactionRemoveDispatchData>];
|
|
1261
|
+
[GatewayDispatchEvents.MessageReactionRemoveAll]: [WithIntrinsicProps<GatewayMessageReactionRemoveAllDispatchData>];
|
|
1262
|
+
[GatewayDispatchEvents.MessageReactionRemoveEmoji]: [
|
|
1263
|
+
WithIntrinsicProps<GatewayMessageReactionRemoveEmojiDispatchData>
|
|
1264
|
+
];
|
|
1265
|
+
[GatewayDispatchEvents.MessageUpdate]: [WithIntrinsicProps<GatewayMessageUpdateDispatchData>];
|
|
1266
|
+
[GatewayDispatchEvents.PresenceUpdate]: [WithIntrinsicProps<GatewayPresenceUpdateDispatchData>];
|
|
1267
|
+
[GatewayDispatchEvents.Ready]: [WithIntrinsicProps<GatewayReadyDispatchData>];
|
|
1268
|
+
[GatewayDispatchEvents.StageInstanceCreate]: [WithIntrinsicProps<GatewayStageInstanceCreateDispatchData>];
|
|
1269
|
+
[GatewayDispatchEvents.StageInstanceDelete]: [WithIntrinsicProps<GatewayStageInstanceDeleteDispatchData>];
|
|
1270
|
+
[GatewayDispatchEvents.StageInstanceUpdate]: [WithIntrinsicProps<GatewayStageInstanceUpdateDispatchData>];
|
|
1271
|
+
[GatewayDispatchEvents.ThreadCreate]: [WithIntrinsicProps<GatewayThreadCreateDispatchData>];
|
|
1272
|
+
[GatewayDispatchEvents.ThreadDelete]: [WithIntrinsicProps<GatewayThreadDeleteDispatchData>];
|
|
1273
|
+
[GatewayDispatchEvents.ThreadListSync]: [WithIntrinsicProps<GatewayThreadListSyncDispatchData>];
|
|
1274
|
+
[GatewayDispatchEvents.ThreadMemberUpdate]: [WithIntrinsicProps<GatewayThreadMemberUpdateDispatchData>];
|
|
1275
|
+
[GatewayDispatchEvents.ThreadMembersUpdate]: [WithIntrinsicProps<GatewayThreadMembersUpdateDispatchData>];
|
|
1276
|
+
[GatewayDispatchEvents.ThreadUpdate]: [WithIntrinsicProps<GatewayThreadUpdateDispatchData>];
|
|
1277
|
+
[GatewayDispatchEvents.UserUpdate]: [WithIntrinsicProps<GatewayUserUpdateDispatchData>];
|
|
1278
|
+
[GatewayDispatchEvents.VoiceServerUpdate]: [WithIntrinsicProps<GatewayVoiceServerUpdateDispatchData>];
|
|
1279
|
+
[GatewayDispatchEvents.VoiceStateUpdate]: [WithIntrinsicProps<GatewayVoiceStateUpdateDispatchData>];
|
|
1280
|
+
[GatewayDispatchEvents.WebhooksUpdate]: [WithIntrinsicProps<GatewayWebhooksUpdateDispatchData>];
|
|
1281
|
+
[GatewayDispatchEvents.Resumed]: [WithIntrinsicProps<never>];
|
|
1282
|
+
[GatewayDispatchEvents.TypingStart]: [WithIntrinsicProps<GatewayTypingStartDispatchData>];
|
|
1283
|
+
[GatewayDispatchEvents.AutoModerationActionExecution]: [
|
|
1284
|
+
WithIntrinsicProps<GatewayAutoModerationActionExecutionDispatchData>
|
|
1285
|
+
];
|
|
1286
|
+
[GatewayDispatchEvents.AutoModerationRuleCreate]: [WithIntrinsicProps<GatewayAutoModerationRuleCreateDispatchData>];
|
|
1287
|
+
[GatewayDispatchEvents.AutoModerationRuleDelete]: [WithIntrinsicProps<GatewayAutoModerationRuleDeleteDispatchData>];
|
|
1288
|
+
[GatewayDispatchEvents.AutoModerationRuleUpdate]: [WithIntrinsicProps<GatewayAutoModerationRuleUpdateDispatchData>];
|
|
1289
|
+
}
|
|
1290
|
+
type ManagerShardEventsMap = {
|
|
1291
|
+
[K in keyof MappedEvents]: MappedEvents[K];
|
|
1292
|
+
};
|
|
1293
|
+
interface ClientOptions {
|
|
1294
|
+
rest: REST;
|
|
1295
|
+
ws: WebSocketManager;
|
|
1296
|
+
}
|
|
1297
|
+
declare function createClient({ rest, ws }: ClientOptions): AsyncEventEmitter<ManagerShardEventsMap>;
|
|
1298
|
+
|
|
1299
|
+
interface DescriptiveRawFile extends RawFile {
|
|
1300
|
+
description?: string;
|
|
1301
|
+
}
|
|
1302
|
+
/**
|
|
1303
|
+
* A utility function to create a form data payload given an array of file buffers
|
|
1304
|
+
*
|
|
1305
|
+
* @param files - The files to create a form data payload for
|
|
1306
|
+
* @param options - The additional options for the form data payload
|
|
1307
|
+
*/
|
|
1308
|
+
declare function withFiles(files: DescriptiveRawFile[], options: APIInteractionResponseCallbackData): {
|
|
1309
|
+
body: {
|
|
1310
|
+
attachments: {
|
|
1311
|
+
id: string;
|
|
1312
|
+
description: string | undefined;
|
|
1313
|
+
}[];
|
|
1314
|
+
content?: string | undefined;
|
|
1315
|
+
tts?: boolean | undefined;
|
|
1316
|
+
embeds?: discord_api_types_utils_internals.AddUndefinedToPossiblyUndefinedPropertiesOfInterface<discord_api_types_v10.APIEmbed>[] | undefined;
|
|
1317
|
+
allowed_mentions?: discord_api_types_utils_internals.AddUndefinedToPossiblyUndefinedPropertiesOfInterface<discord_api_types_v10.APIAllowedMentions> | undefined;
|
|
1318
|
+
components?: discord_api_types_utils_internals.AddUndefinedToPossiblyUndefinedPropertiesOfInterface<discord_api_types_v10.APIActionRowComponent<discord_api_types_v10.APIMessageActionRowComponent>>[] | undefined;
|
|
1319
|
+
flags?: discord_api_types_v10.MessageFlags;
|
|
1320
|
+
thread_name?: string | undefined;
|
|
1321
|
+
};
|
|
1322
|
+
files: {
|
|
1323
|
+
name: string;
|
|
1324
|
+
data: string | number | boolean | Buffer;
|
|
1325
|
+
}[];
|
|
1326
|
+
};
|
|
1327
|
+
|
|
1328
|
+
export { API, ApplicationCommandsAPI, ChannelsAPI, ClientOptions, DescriptiveRawFile, GuildsAPI, InteractionsAPI, IntrinsicProps, InvitesAPI, ManagerShardEventsMap, MappedEvents, StartForumThreadOptions, StartThreadOptions, StickersAPI, ThreadsAPI, UsersAPI, VoiceAPI, WebhooksAPI, WithIntrinsicProps, createClient, withFiles };
|