@discordeno/rest 19.0.0-next.024fbe3 → 19.0.0-next.05fc3fb
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/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -2
- package/dist/index.js.map +1 -0
- package/dist/invalidBucket.d.ts.map +1 -1
- package/dist/invalidBucket.js +84 -2
- package/dist/invalidBucket.js.map +1 -0
- package/dist/manager.d.ts +1 -3572
- package/dist/manager.d.ts.map +1 -1
- package/dist/manager.js +1577 -2
- package/dist/manager.js.map +1 -0
- package/dist/queue.d.ts +9 -1
- package/dist/queue.d.ts.map +1 -1
- package/dist/queue.js +153 -2
- package/dist/queue.js.map +1 -0
- package/dist/types.d.ts +2421 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/dist/typings/routes.d.ts +238 -0
- package/dist/typings/routes.d.ts.map +1 -0
- package/dist/typings/routes.js +3 -0
- package/dist/typings/routes.js.map +1 -0
- package/package.json +17 -16
package/dist/manager.d.ts
CHANGED
|
@@ -1,3574 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { ApplicationCommandPermissions, BigString, Camelize, CreateApplicationCommand, CreateAutoModerationRuleOptions, CreateChannelInvite, CreateForumPostWithMessage, CreateGuildChannel, CreateGuildEmoji, CreateMessageOptions, CreateScheduledEvent, CreateStageInstance, DeleteWebhookMessageOptions, DiscordActiveThreads, DiscordApplication, DiscordApplicationCommand, DiscordApplicationCommandPermissions, DiscordArchivedThreads, DiscordAutoModerationRule, DiscordChannel, DiscordEmoji, DiscordFollowedChannel, DiscordGetGatewayBot, DiscordIntegration, DiscordInvite, DiscordInviteMetadata, DiscordMember, DiscordMemberWithUser, DiscordMessage, DiscordScheduledEvent, DiscordStageInstance, DiscordStickerPack, DiscordTemplate, DiscordThreadMember, DiscordUser, DiscordWebhook, EditAutoModerationRuleOptions, EditChannelPermissionOverridesOptions, EditMessage, EditScheduledEvent, EditStageInstanceOptions, ExecuteWebhook, GetGuildPruneCountQuery, GetInvite, GetMessagesOptions, GetScheduledEvents, GetScheduledEventUsers, GetWebhookMessageOptions, InteractionCallbackData, InteractionResponse, ListArchivedThreads, ListGuildMembers, ModifyChannel, ModifyGuildChannelPositions, ModifyGuildEmoji, ModifyWebhook, SearchMembers, StartThreadWithMessage, StartThreadWithoutMessage, WithReason } from '@discordeno/types';
|
|
3
|
-
import type { InvalidRequestBucket } from './invalidBucket.js';
|
|
1
|
+
import type { CreateRestManagerOptions, RestManager } from './types.js';
|
|
4
2
|
export declare function createRestManager(options: CreateRestManagerOptions): RestManager;
|
|
5
|
-
export interface CreateRestManagerOptions {
|
|
6
|
-
/** The bot token which will be used to make requests. */
|
|
7
|
-
token: string;
|
|
8
|
-
/**
|
|
9
|
-
* For old bots that have a different bot id and application id.
|
|
10
|
-
* @default bot id from token
|
|
11
|
-
*/
|
|
12
|
-
applicationId?: BigString;
|
|
13
|
-
/**
|
|
14
|
-
* The base url to connect to. If you create a proxy rest, that url would go here.
|
|
15
|
-
* IT SHOULD NOT END WITH A /
|
|
16
|
-
* @default https://discord.com/api
|
|
17
|
-
*/
|
|
18
|
-
baseUrl?: string;
|
|
19
|
-
/**
|
|
20
|
-
* The api versions which can be used to make requests.
|
|
21
|
-
* @default 10
|
|
22
|
-
*/
|
|
23
|
-
version?: ApiVersions;
|
|
24
|
-
}
|
|
25
|
-
export interface RestManager {
|
|
26
|
-
/** The bot token which will be used to make requests. */
|
|
27
|
-
token: string;
|
|
28
|
-
/** The application id. Normally this is not required for recent bots but old bot's application id is sometimes different from the bot id so it is required for those bots. */
|
|
29
|
-
applicationId: bigint;
|
|
30
|
-
/** The api version to use when making requests. Only the latest supported version will be tested. */
|
|
31
|
-
version: ApiVersions;
|
|
32
|
-
/**
|
|
33
|
-
* The base url to connect to. If you create a proxy rest, that url would go here.
|
|
34
|
-
* IT SHOULD NOT END WITH A /
|
|
35
|
-
* @default https://discord.com/api
|
|
36
|
-
*/
|
|
37
|
-
baseUrl: string;
|
|
38
|
-
/** The maximum amount of times a request should be retried. Defaults to Infinity */
|
|
39
|
-
maxRetryCount: number;
|
|
40
|
-
/** Whether or not the manager is rate limited globally across all requests. Defaults to false. */
|
|
41
|
-
globallyRateLimited: boolean;
|
|
42
|
-
/** Whether or not the rate limited paths are being processed to allow requests to be made once time is up. Defaults to false. */
|
|
43
|
-
processingRateLimitedPaths: boolean;
|
|
44
|
-
/** The queues that hold all the requests to be processed. */
|
|
45
|
-
queues: Map<string, Queue>;
|
|
46
|
-
/** The paths that are currently rate limited. */
|
|
47
|
-
rateLimitedPaths: Map<string, RestRateLimitedPath>;
|
|
48
|
-
/** The bucket for handling any invalid requests. */
|
|
49
|
-
invalidBucket: InvalidRequestBucket;
|
|
50
|
-
/** The routes that are available for this manager. */
|
|
51
|
-
routes: {
|
|
52
|
-
/** Route to get a bots session info. */
|
|
53
|
-
sessionInfo: () => string;
|
|
54
|
-
/** A specific user route. */
|
|
55
|
-
user: (id: BigString) => string;
|
|
56
|
-
/** Current bot user route. */
|
|
57
|
-
userBot: () => string;
|
|
58
|
-
oauth2Application: () => string;
|
|
59
|
-
gatewayBot: () => string;
|
|
60
|
-
nitroStickerPacks: () => string;
|
|
61
|
-
/** Routes for webhook related routes. */
|
|
62
|
-
webhooks: {
|
|
63
|
-
/** Route for managing the original message sent by a webhook. */
|
|
64
|
-
original: (webhookId: BigString, token: string, options?: {
|
|
65
|
-
threadId?: BigString;
|
|
66
|
-
}) => string;
|
|
67
|
-
/** Route for webhook with a id. */
|
|
68
|
-
id: (webhookId: BigString) => string;
|
|
69
|
-
/** Route for handling a webhook with a token. */
|
|
70
|
-
webhook: (webhookId: BigString, token: string, options?: {
|
|
71
|
-
wait?: boolean;
|
|
72
|
-
threadId?: BigString;
|
|
73
|
-
}) => string;
|
|
74
|
-
/** Route for handling a message that was sent through a webhook. */
|
|
75
|
-
message: (webhookId: BigString, token: string, messageId: BigString, options?: {
|
|
76
|
-
threadId?: BigString;
|
|
77
|
-
}) => string;
|
|
78
|
-
};
|
|
79
|
-
/** Routes for channel related endpoints. */
|
|
80
|
-
channels: {
|
|
81
|
-
/** Route for non-specific dm channel. */
|
|
82
|
-
dm: () => string;
|
|
83
|
-
/** Route for non-specific webhook in a channel. */
|
|
84
|
-
webhooks: (channelId: BigString) => string;
|
|
85
|
-
/** Route for a specific channel. */
|
|
86
|
-
channel: (channelId: BigString) => string;
|
|
87
|
-
/** Route for following a specific channel. */
|
|
88
|
-
follow: (channelId: BigString) => string;
|
|
89
|
-
/** Route for managing a forum with a message. */
|
|
90
|
-
forum: (channelId: BigString) => string;
|
|
91
|
-
/** Route for a specific channel's invites. */
|
|
92
|
-
invites: (channelId: BigString) => string;
|
|
93
|
-
/** Route for a specific message */
|
|
94
|
-
message: (channelId: BigString, id: BigString) => string;
|
|
95
|
-
/** Route for handling non-specific messages. */
|
|
96
|
-
messages: (channelId: BigString, options?: GetMessagesOptions) => string;
|
|
97
|
-
/** Route for handling a specific overwrite. */
|
|
98
|
-
overwrite: (channelId: BigString, overwriteId: BigString) => string;
|
|
99
|
-
/** Route for handling crossposting a specific message. */
|
|
100
|
-
crosspost: (channelId: BigString, messageId: BigString) => string;
|
|
101
|
-
/** Route for handling non-specific stages */
|
|
102
|
-
stages: () => string;
|
|
103
|
-
/** Route for handling a specific stage */
|
|
104
|
-
stage: (channelId: BigString) => string;
|
|
105
|
-
/** Routes for handling thread related to a channel. */
|
|
106
|
-
threads: {
|
|
107
|
-
/** Route for thread a specific message. */
|
|
108
|
-
message: (channelId: BigString, messageId: BigString) => string;
|
|
109
|
-
/** Route for thread without a message. */
|
|
110
|
-
all: (channelId: BigString) => string;
|
|
111
|
-
/** Route for active threads. */
|
|
112
|
-
active: (guildId: BigString) => string;
|
|
113
|
-
/** Route for members in a thread. */
|
|
114
|
-
members: (channelId: BigString) => string;
|
|
115
|
-
/** Route for the bot member in a thread. */
|
|
116
|
-
me: (channelId: BigString) => string;
|
|
117
|
-
/** Route for a specific member in a thread. */
|
|
118
|
-
user: (channelId: BigString, userId: BigString) => string;
|
|
119
|
-
/** Route for handling archived threads. */
|
|
120
|
-
archived: (channelId: BigString) => string;
|
|
121
|
-
/** Route for handling publically archived threads. */
|
|
122
|
-
public: (channelId: BigString, options?: ListArchivedThreads) => string;
|
|
123
|
-
/** Route for handling private archived threads. */
|
|
124
|
-
private: (channelId: BigString, options?: ListArchivedThreads) => string;
|
|
125
|
-
/** Route for handling private archived threads that the bot has joined. */
|
|
126
|
-
joined: (channelId: BigString, options?: ListArchivedThreads) => string;
|
|
127
|
-
};
|
|
128
|
-
/** Route for handling typing indicators in a c«hannel. */
|
|
129
|
-
typing: (channelId: BigString) => string;
|
|
130
|
-
};
|
|
131
|
-
/** Routes for guild related endpoints. */
|
|
132
|
-
guilds: {
|
|
133
|
-
/** Routes for a guilds automoderation. */
|
|
134
|
-
automod: {
|
|
135
|
-
/** Route for handling a guild's automoderation. */
|
|
136
|
-
rules: (guildId: BigString) => string;
|
|
137
|
-
/** Route for handling a specific automoderation rule guild's */
|
|
138
|
-
rule: (guildId: BigString, ruleId: BigString) => string;
|
|
139
|
-
};
|
|
140
|
-
/** Routes for handling a guild's scheduled events. */
|
|
141
|
-
events: {
|
|
142
|
-
/** Route for handling non-specific scheduled event. */
|
|
143
|
-
events: (guildId: BigString, withUserCount?: boolean) => string;
|
|
144
|
-
/** Route for handling a specific scheduled event. */
|
|
145
|
-
event: (guildId: BigString, eventId: BigString, withUserCount?: boolean) => string;
|
|
146
|
-
/** Route for handling a scheduled event users. */
|
|
147
|
-
users: (guildId: BigString, eventId: BigString, options?: GetScheduledEventUsers) => string;
|
|
148
|
-
};
|
|
149
|
-
/** Route for handling non-specific channels in a guild */
|
|
150
|
-
channels: (guildId: BigString) => string;
|
|
151
|
-
/** Route for handling a specific emoji. */
|
|
152
|
-
emoji: (guildId: BigString, id: BigString) => string;
|
|
153
|
-
/** Route for handling non-specific emojis. */
|
|
154
|
-
emojis: (guildId: BigString) => string;
|
|
155
|
-
/** Route for handling a specific integration. */
|
|
156
|
-
integration: (guildId: BigString, integrationId: BigString) => string;
|
|
157
|
-
/** Route for handling non-specific integrations. */
|
|
158
|
-
integrations: (guildId: BigString) => string;
|
|
159
|
-
/** Route for handling a specific guild invite. */
|
|
160
|
-
invite: (inviteCode: string, options?: GetInvite) => string;
|
|
161
|
-
/** Route for handling non-specific invites in a guild. */
|
|
162
|
-
invites: (guildId: BigString) => string;
|
|
163
|
-
/** Route for handling non-specific webhooks in a guild */
|
|
164
|
-
webhooks: (guildId: BigString) => string;
|
|
165
|
-
/** Routes for handling a guild's members. */
|
|
166
|
-
members: {
|
|
167
|
-
/** Route for handling a specific guild member's ban. */
|
|
168
|
-
ban: (guildId: BigString, userId: BigString) => string;
|
|
169
|
-
/** Route for handling a the bot guild member. */
|
|
170
|
-
bot: (guildId: BigString) => string;
|
|
171
|
-
/** Route for handling a specific guild member. */
|
|
172
|
-
member: (guildId: BigString, userId: BigString) => string;
|
|
173
|
-
/** Route for handling non-specific guild members. */
|
|
174
|
-
members: (guildId: BigString, options?: ListGuildMembers) => string;
|
|
175
|
-
/** Route for handling member searching in a guild. */
|
|
176
|
-
search: (guildId: BigString, query: string, options?: {
|
|
177
|
-
limit?: number;
|
|
178
|
-
}) => string;
|
|
179
|
-
/** Route for handling pruning guild members. */
|
|
180
|
-
prune: (guildId: BigString, options?: GetGuildPruneCountQuery) => string;
|
|
181
|
-
};
|
|
182
|
-
/** Routes for handling a guild's templates. */
|
|
183
|
-
templates: {
|
|
184
|
-
/** Route for handling a specifc guild's templates with a code only. */
|
|
185
|
-
code: (code: string) => string;
|
|
186
|
-
/** Route for handling a specific guild's template with a guild id and code. */
|
|
187
|
-
guild: (guildId: BigString, code: string) => string;
|
|
188
|
-
/** Route for handling non-specific guild's templates. */
|
|
189
|
-
all: (guildId: BigString) => string;
|
|
190
|
-
};
|
|
191
|
-
};
|
|
192
|
-
/** Routes for interaction related endpoints. */
|
|
193
|
-
interactions: {
|
|
194
|
-
/** Routes for interaction command related endpoints. */
|
|
195
|
-
commands: {
|
|
196
|
-
/** Route for non-specific commands. */
|
|
197
|
-
commands: (applicationId: BigString) => string;
|
|
198
|
-
/** Route for guild related commands. */
|
|
199
|
-
guilds: {
|
|
200
|
-
/** Route for non-specific guild commands. */
|
|
201
|
-
all: (applicationId: BigString, guildId: BigString) => string;
|
|
202
|
-
/** Route for a specific guild command. */
|
|
203
|
-
one: (applicationId: BigString, guildId: BigString, commandId: BigString, withLocalizations?: boolean) => string;
|
|
204
|
-
};
|
|
205
|
-
/** Route for non-specific command permissions. */
|
|
206
|
-
permissions: (applicationId: BigString, guildId: BigString) => string;
|
|
207
|
-
/** Route for a specific command's permission. */
|
|
208
|
-
permission: (applicationId: BigString, guildId: BigString, commandId: BigString) => string;
|
|
209
|
-
/** Route for a specific command. */
|
|
210
|
-
command: (applicationId: BigString, commandId: BigString, withLocalizations?: boolean) => string;
|
|
211
|
-
};
|
|
212
|
-
/** Routes for interaction response related endpoints. */
|
|
213
|
-
responses: {
|
|
214
|
-
/** Route for handling a callback response with id and token. */
|
|
215
|
-
callback: (interactionId: BigString, token: string) => string;
|
|
216
|
-
/** Route for handling the original response using id and token. */
|
|
217
|
-
original: (interactionId: BigString, token: string) => string;
|
|
218
|
-
/** Route for handling a followup message from a interaction response. */
|
|
219
|
-
message: (applicationId: BigString, token: string, messageId: BigString) => string;
|
|
220
|
-
};
|
|
221
|
-
};
|
|
222
|
-
};
|
|
223
|
-
/** Check the rate limits for a url or a bucket. */
|
|
224
|
-
checkRateLimits: (url: string) => number | false;
|
|
225
|
-
/** Creates the request body and headers that are necessary to send a request. Will handle different types of methods and everything necessary for discord. */
|
|
226
|
-
createRequest: (options: CreateRequestBodyOptions) => RequestBody;
|
|
227
|
-
/** This will create a infinite loop running in 1 seconds using tail recursion to keep rate limits clean. When a rate limit resets, this will remove it so the queue can proceed. */
|
|
228
|
-
processRateLimitedPaths: () => void;
|
|
229
|
-
/** Processes the rate limit headers and determines if it needs to be rate limited and returns the bucket id if available */
|
|
230
|
-
processHeaders: (url: string, headers: Headers) => string | undefined;
|
|
231
|
-
/** Sends a request to the api. */
|
|
232
|
-
sendRequest: (options: SendRequestOptions) => Promise<void>;
|
|
233
|
-
/** Split a url to separate rate limit buckets based on major/minor parameters. */
|
|
234
|
-
simplifyUrl: (url: string, method: RequestMethods) => string;
|
|
235
|
-
/** Make a request to be sent to the api. */
|
|
236
|
-
makeRequest: <T = unknown>(method: RequestMethods, url: string, body?: Record<string, any>, options?: Record<string, any>) => Promise<T>;
|
|
237
|
-
/** Takes a request and processes it into a queue. */
|
|
238
|
-
processRequest: (request: SendRequestOptions) => void;
|
|
239
|
-
/** Make a get request to the api */
|
|
240
|
-
get: <T = void>(url: string) => Promise<Camelize<T>>;
|
|
241
|
-
/** Make a post request to the api. */
|
|
242
|
-
post: <T = void>(url: string, body?: Record<string, any>) => Promise<Camelize<T>>;
|
|
243
|
-
/** Make a put request to the api. */
|
|
244
|
-
put: <T = void>(url: string, body?: Record<string, any>, options?: Record<string, any>) => Promise<Camelize<T>>;
|
|
245
|
-
/** Make a delete request to the api. */
|
|
246
|
-
delete: (url: string, body?: Record<string, any>) => Promise<void>;
|
|
247
|
-
/** Make a patch request to the api. */
|
|
248
|
-
patch: <T = void>(url: string, body?: Record<string, any>) => Promise<Camelize<T>>;
|
|
249
|
-
/** Helper methods related to channels */
|
|
250
|
-
channels: {
|
|
251
|
-
/** Methods related to messages in a channel */
|
|
252
|
-
messages: {
|
|
253
|
-
/**
|
|
254
|
-
* Sends a message to a channel.
|
|
255
|
-
*
|
|
256
|
-
* @param channelId - The ID of the channel to send the message in.
|
|
257
|
-
* @param options - The parameters for the creation of the message.
|
|
258
|
-
* @returns An instance of the created {@link DiscordMessage}.
|
|
259
|
-
*
|
|
260
|
-
* @remarks
|
|
261
|
-
* Requires that the bot user be able to see the contents of the channel the message is to be sent in.
|
|
262
|
-
*
|
|
263
|
-
* If sending a message to a guild channel:
|
|
264
|
-
* - Requires the `SEND_MESSAGES` permission.
|
|
265
|
-
*
|
|
266
|
-
* If sending a TTS message:
|
|
267
|
-
* - Requires the `SEND_TTS_MESSAGES` permission.
|
|
268
|
-
*
|
|
269
|
-
* If sending a message as a reply to another message:
|
|
270
|
-
* - Requires the `READ_MESSAGE_HISTORY` permission.
|
|
271
|
-
* - The message being replied to cannot be a system message.
|
|
272
|
-
*
|
|
273
|
-
* ⚠️ The maximum size of a request (accounting for any attachments and message content) for bot users is _8 MiB_.
|
|
274
|
-
*
|
|
275
|
-
* Fires a _Message Create_ gateway event.
|
|
276
|
-
*
|
|
277
|
-
* @see {@link https://discord.com/developers/docs/resources/channel#create-message}
|
|
278
|
-
*/
|
|
279
|
-
send: (channelId: BigString, options: CreateMessageOptions) => Promise<Camelize<DiscordMessage>>;
|
|
280
|
-
/**
|
|
281
|
-
* Edits a message.
|
|
282
|
-
*
|
|
283
|
-
* @param channelId - The ID of the channel to edit the message in.
|
|
284
|
-
* @param messageId - The IDs of the message to edit.
|
|
285
|
-
* @param options - The parameters for the edit of the message.
|
|
286
|
-
* @returns An instance of the edited {@link Message}.
|
|
287
|
-
*
|
|
288
|
-
* @remarks
|
|
289
|
-
* If editing another user's message:
|
|
290
|
-
* - Requires the `MANAGE_MESSAGES` permission.
|
|
291
|
-
* - Only the {@link EditMessage.flags | flags} property of the {@link options} object parameter can be edited.
|
|
292
|
-
*
|
|
293
|
-
* Fires a _Message Update_ gateway event.
|
|
294
|
-
*
|
|
295
|
-
* @see {@link https://discord.com/developers/docs/resources/channel#edit-message}
|
|
296
|
-
*/
|
|
297
|
-
edit: (channelId: BigString, messageId: BigString, options: EditMessage) => Promise<Camelize<DiscordMessage>>;
|
|
298
|
-
/**
|
|
299
|
-
* Cross-posts a message posted in an announcement channel to subscribed channels.
|
|
300
|
-
*
|
|
301
|
-
* @param channelId - The ID of the announcement channel.
|
|
302
|
-
* @param messageId - The ID of the message to cross-post.
|
|
303
|
-
* @returns An instance of the cross-posted {@link Message}.
|
|
304
|
-
*
|
|
305
|
-
* @remarks
|
|
306
|
-
* Requires the `SEND_MESSAGES` permission.
|
|
307
|
-
*
|
|
308
|
-
* If not cross-posting own message:
|
|
309
|
-
* - Requires the `MANAGE_MESSAGES` permission.
|
|
310
|
-
*
|
|
311
|
-
* Fires a _Message Create_ event in the guilds the subscribed channels are in.
|
|
312
|
-
*
|
|
313
|
-
* @see {@link https://discord.com/developers/docs/resources/channel#crosspost-message}
|
|
314
|
-
*/
|
|
315
|
-
publish: (channelId: BigString, messageId: BigString) => Promise<Camelize<DiscordMessage>>;
|
|
316
|
-
/**
|
|
317
|
-
* Deletes a message from a channel.
|
|
318
|
-
*
|
|
319
|
-
* @param channelId - The ID of the channel to delete the message from.
|
|
320
|
-
* @param messageId - The ID of the message to delete from the channel.
|
|
321
|
-
*
|
|
322
|
-
* @remarks
|
|
323
|
-
* If not deleting own message:
|
|
324
|
-
* - Requires the `MANAGE_MESSAGES` permission.
|
|
325
|
-
*
|
|
326
|
-
* Fires a _Message Delete_ gateway event.
|
|
327
|
-
*
|
|
328
|
-
* @see {@link https://discord.com/developers/docs/resources/channel#delete-message}
|
|
329
|
-
*/
|
|
330
|
-
delete: (channelId: BigString, messageId: BigString, reason?: string) => Promise<void>;
|
|
331
|
-
};
|
|
332
|
-
/**
|
|
333
|
-
* Gets a channel by its ID.
|
|
334
|
-
*
|
|
335
|
-
* @param id - The ID of the channel to get.
|
|
336
|
-
* @returns An instance of {@link DiscordChannel}.
|
|
337
|
-
*
|
|
338
|
-
* @remarks
|
|
339
|
-
* If the channel is a thread, a {@link ThreadMember} object is included in the result.
|
|
340
|
-
*
|
|
341
|
-
* @see {@link https://discord.com/developers/docs/resources/channel#get-channel}
|
|
342
|
-
*/
|
|
343
|
-
get: (id: BigString) => Promise<Camelize<DiscordChannel>>;
|
|
344
|
-
/**
|
|
345
|
-
* Creates a channel within a guild.
|
|
346
|
-
*
|
|
347
|
-
* @param guildId - The ID of the guild to create the channel within.
|
|
348
|
-
* @param options - The parameters for the creation of the channel.
|
|
349
|
-
* @returns An instance of the created {@link DiscordChannel}.
|
|
350
|
-
*
|
|
351
|
-
* @remarks
|
|
352
|
-
* Requires the `MANAGE_CHANNELS` permission.
|
|
353
|
-
*
|
|
354
|
-
* If setting permission overwrites, only the permissions the bot user has in the guild can be allowed or denied.
|
|
355
|
-
*
|
|
356
|
-
* Setting the `MANAGE_ROLES` permission is only possible for guild administrators.
|
|
357
|
-
*
|
|
358
|
-
* Fires a _Channel Create_ gateway event.
|
|
359
|
-
*
|
|
360
|
-
* @see {@link https://discord.com/developers/docs/resources/guild#create-guild-channel}
|
|
361
|
-
*/
|
|
362
|
-
create: (guildId: BigString, options: CreateGuildChannel) => Promise<Camelize<DiscordChannel>>;
|
|
363
|
-
/**
|
|
364
|
-
* Deletes a channel from within a guild.
|
|
365
|
-
*
|
|
366
|
-
* @param channelId - The ID of the channel to delete.
|
|
367
|
-
* @returns An instance of the deleted {@link Channel}.
|
|
368
|
-
*
|
|
369
|
-
* @remarks
|
|
370
|
-
* For community guilds, the _Rules_, _Guidelines_ and _Community Update_ channels cannot be deleted.
|
|
371
|
-
*
|
|
372
|
-
* If the channel is a thread:
|
|
373
|
-
* - Requires the `MANAGE_THREADS` permission.
|
|
374
|
-
*
|
|
375
|
-
* - Fires a _Thread Delete_ gateway event.
|
|
376
|
-
*
|
|
377
|
-
* Otherwise:
|
|
378
|
-
* - Requires the `MANAGE_CHANNELS` permission.
|
|
379
|
-
*
|
|
380
|
-
* - ⚠️ Deleting a category channel does not delete its child channels.
|
|
381
|
-
* Instead, they will have their `parent_id` property removed, and a `Channel Update` gateway event will fire for each of them.
|
|
382
|
-
*
|
|
383
|
-
* - Fires a _Channel Delete_ gateway event.
|
|
384
|
-
*
|
|
385
|
-
* @see {@link https://discord.com/developers/docs/resources/channel#deleteclose-channel}
|
|
386
|
-
*/
|
|
387
|
-
delete: (channelId: BigString, reason?: string) => Promise<void>;
|
|
388
|
-
/**
|
|
389
|
-
* Edits a channel's settings.
|
|
390
|
-
*
|
|
391
|
-
* @param channelId - The ID of the channel to edit.
|
|
392
|
-
* @param options - The parameters for the edit of the channel.
|
|
393
|
-
* @returns An instance of the edited {@link DiscordChannel}.
|
|
394
|
-
*
|
|
395
|
-
* @remarks
|
|
396
|
-
* If editing a channel of type {@link ChannelTypes.GroupDm}:
|
|
397
|
-
* - Fires a _Channel Update_ gateway event.
|
|
398
|
-
*
|
|
399
|
-
* If editing a thread channel:
|
|
400
|
-
* - Requires the `MANAGE_THREADS` permission __unless__ if setting the `archived` property to `false` when the `locked` property is also `false`, in which case only the `SEND_MESSAGES` permission is required.
|
|
401
|
-
*
|
|
402
|
-
* - Fires a _Thread Update_ gateway event.
|
|
403
|
-
*
|
|
404
|
-
* If editing a guild channel:
|
|
405
|
-
* - Requires the `MANAGE_CHANNELS` permission.
|
|
406
|
-
*
|
|
407
|
-
* - If modifying permission overrides:
|
|
408
|
-
* - Requires the `MANAGE_ROLES` permission.
|
|
409
|
-
*
|
|
410
|
-
* - Only permissions the bot user has in the guild or parent channel can be allowed/denied __unless__ the bot user has a `MANAGE_ROLES` permission override in the channel.
|
|
411
|
-
*
|
|
412
|
-
* - If modifying a channel of type {@link ChannelTypes.GuildCategory}:
|
|
413
|
-
* - Fires a _Channel Update_ gateway event for each child channel impacted in this change.
|
|
414
|
-
* - Otherwise:
|
|
415
|
-
* - Fires a _Channel Update_ gateway event.
|
|
416
|
-
*/
|
|
417
|
-
edit: (channelId: BigString, options: ModifyChannel) => Promise<Camelize<DiscordChannel>>;
|
|
418
|
-
/**
|
|
419
|
-
* Follows an announcement channel, allowing messages posted within it to be cross-posted into the target channel.
|
|
420
|
-
*
|
|
421
|
-
* @param sourceChannelId - The ID of the announcement channel to follow.
|
|
422
|
-
* @param targetChannelId - The ID of the target channel - the channel to cross-post to.
|
|
423
|
-
* @returns An instance of {@link DiscordFollowedChannel}.
|
|
424
|
-
*
|
|
425
|
-
* @remarks
|
|
426
|
-
* Requires the `MANAGE_WEBHOOKS` permission in the __target channel__.
|
|
427
|
-
*
|
|
428
|
-
* Fires a _Webhooks Update_ gateway event.
|
|
429
|
-
*
|
|
430
|
-
* @see {@link https://discord.com/developers/docs/resources/channel#follow-announcement-channel}
|
|
431
|
-
*/
|
|
432
|
-
follow: (sourceChannelId: BigString, targetChannelId: BigString) => Promise<Camelize<DiscordFollowedChannel>>;
|
|
433
|
-
/** Forum related helpers in a channel */
|
|
434
|
-
forums: {
|
|
435
|
-
/**
|
|
436
|
-
* Creates a new thread in a forum channel, and sends a message within the created thread.
|
|
437
|
-
*
|
|
438
|
-
* @param channelId - The ID of the forum channel to create the thread within.
|
|
439
|
-
* @param options - The parameters for the creation of the thread.
|
|
440
|
-
* @returns An instance of {@link DiscordChannel} with a nested {@link Message} object.
|
|
441
|
-
*
|
|
442
|
-
* @remarks
|
|
443
|
-
* Requires the `CREATE_MESSAGES` permission.
|
|
444
|
-
*
|
|
445
|
-
* Fires a _Thread Create_ gateway event.
|
|
446
|
-
* Fires a _Message Create_ gateway event.
|
|
447
|
-
*
|
|
448
|
-
* @see {@link https://discord.com/developers/docs/resources/channel#start-thread-in-forum-channel}
|
|
449
|
-
*
|
|
450
|
-
* @experimental
|
|
451
|
-
*/
|
|
452
|
-
post: (channelId: BigString, options: CreateForumPostWithMessage) => Promise<Camelize<DiscordChannel>>;
|
|
453
|
-
};
|
|
454
|
-
/** Permission related helpers in a channel */
|
|
455
|
-
permissions: {
|
|
456
|
-
/**
|
|
457
|
-
* Edits the permission overrides for a user or role in a channel.
|
|
458
|
-
*
|
|
459
|
-
* @param channelId - The ID of the channel to edit the permission overrides of.
|
|
460
|
-
* @param options - The permission override.
|
|
461
|
-
*
|
|
462
|
-
* @remarks
|
|
463
|
-
* Requires the `MANAGE_ROLES` permission.
|
|
464
|
-
*
|
|
465
|
-
* Only permissions the bot user has in the guild or parent channel can be allowed/denied __unless__ the bot user has a `MANAGE_ROLES` permission override in the channel.
|
|
466
|
-
*
|
|
467
|
-
* Fires a _Channel Update_ gateway event.
|
|
468
|
-
*
|
|
469
|
-
* @see {@link https://discord.com/developers/docs/resources/channel#edit-channel-permissions}
|
|
470
|
-
*/
|
|
471
|
-
edit: (channelId: BigString, options: EditChannelPermissionOverridesOptions) => Promise<void>;
|
|
472
|
-
/**
|
|
473
|
-
* Deletes a permission override for a user or role in a channel.
|
|
474
|
-
*
|
|
475
|
-
* @param channelId - The ID of the channel to delete the permission override of.
|
|
476
|
-
* @param overwriteId - The ID of the permission override to delete.
|
|
477
|
-
*
|
|
478
|
-
* @remarks
|
|
479
|
-
* Requires the `MANAGE_ROLES` permission.
|
|
480
|
-
*
|
|
481
|
-
* Fires a _Channel Update_ gateway event.
|
|
482
|
-
*
|
|
483
|
-
* @see {@link https://discord.com/developers/docs/resources/channel#delete-channel-permission}
|
|
484
|
-
*/
|
|
485
|
-
delete: (channelId: BigString, overwriteId: BigString, reason?: string) => Promise<void>;
|
|
486
|
-
};
|
|
487
|
-
threads: {
|
|
488
|
-
get: {
|
|
489
|
-
/**
|
|
490
|
-
* Gets the list of all active threads for a guild.
|
|
491
|
-
*
|
|
492
|
-
* @param guildId - The ID of the guild to get the threads of.
|
|
493
|
-
* @returns An instance of {@link DiscordActiveThreads}.
|
|
494
|
-
*
|
|
495
|
-
* @remarks
|
|
496
|
-
* Returns both public and private threads.
|
|
497
|
-
*
|
|
498
|
-
* Threads are ordered by the `id` property in descending order.
|
|
499
|
-
*
|
|
500
|
-
* @see {@link https://discord.com/developers/docs/resources/guild#list-active-guild-threads}
|
|
501
|
-
*/
|
|
502
|
-
active: (guildId: BigString) => Promise<Camelize<DiscordActiveThreads>>;
|
|
503
|
-
/** Methods related to getting archived threads. */
|
|
504
|
-
archived: {
|
|
505
|
-
/**
|
|
506
|
-
* Gets the list of private archived threads for a channel.
|
|
507
|
-
*
|
|
508
|
-
* @param channelId - The ID of the channel to get the archived threads for.
|
|
509
|
-
* @param options - The parameters for the fetching of threads.
|
|
510
|
-
* @returns An instance of {@link DiscordArchivedThreads}.
|
|
511
|
-
*
|
|
512
|
-
* @remarks
|
|
513
|
-
* Requires the `READ_MESSAGE_HISTORY` permission.
|
|
514
|
-
* Requires the `MANAGE_THREADS` permission.
|
|
515
|
-
*
|
|
516
|
-
* Returns threads of type {@link ChannelTypes.GuildPrivateThread}.
|
|
517
|
-
*
|
|
518
|
-
* Threads are ordered by the `archive_timestamp` property included in the metadata of the object in descending order.
|
|
519
|
-
*
|
|
520
|
-
* @see {@link https://discord.com/developers/docs/resources/channel#list-private-archived-threads}
|
|
521
|
-
*/
|
|
522
|
-
private: (channelId: BigString, options?: ListArchivedThreads) => Promise<Camelize<DiscordArchivedThreads>>;
|
|
523
|
-
/**
|
|
524
|
-
* Gets the list of private archived threads the bot is a member of for a channel.
|
|
525
|
-
*
|
|
526
|
-
* @param channelId - The ID of the channel to get the archived threads for.
|
|
527
|
-
* @param options - The parameters for the fetching of threads.
|
|
528
|
-
* @returns An instance of {@link DiscordArchivedThreads}.
|
|
529
|
-
*
|
|
530
|
-
* @remarks
|
|
531
|
-
* Requires the `READ_MESSAGE_HISTORY` permission.
|
|
532
|
-
*
|
|
533
|
-
* Returns threads of type {@link ChannelTypes.GuildPrivateThread}.
|
|
534
|
-
*
|
|
535
|
-
* Threads are ordered by the `id` property in descending order.
|
|
536
|
-
*
|
|
537
|
-
* @see {@link https://discord.com/developers/docs/resources/channel#list-joined-private-archived-threads}
|
|
538
|
-
*/
|
|
539
|
-
joined: (channelId: BigString, options?: ListArchivedThreads) => Promise<Camelize<DiscordArchivedThreads>>;
|
|
540
|
-
/**
|
|
541
|
-
* Gets the list of public archived threads for a channel.
|
|
542
|
-
*
|
|
543
|
-
* @param channelId - The ID of the channel to get the archived threads for.
|
|
544
|
-
* @param options - The parameters for the fetching of threads.
|
|
545
|
-
* @returns An instance of {@link ArchivedThreads}.
|
|
546
|
-
*
|
|
547
|
-
* @remarks
|
|
548
|
-
* Requires the `READ_MESSAGE_HISTORY` permission.
|
|
549
|
-
*
|
|
550
|
-
* If called on a channel of type {@link ChannelTypes.GuildText}, returns threads of type {@link ChannelTypes.GuildPublicThread}.
|
|
551
|
-
* If called on a channel of type {@link ChannelTypes.GuildNews}, returns threads of type {@link ChannelTypes.GuildNewsThread}.
|
|
552
|
-
*
|
|
553
|
-
* Threads are ordered by the `archive_timestamp` property included in the metadata of the object in descending order.
|
|
554
|
-
*
|
|
555
|
-
* @see {@link https://discord.com/developers/docs/resources/channel#list-public-archived-threads}
|
|
556
|
-
*/
|
|
557
|
-
public: (channelId: BigString, options?: ListArchivedThreads) => Promise<Camelize<DiscordArchivedThreads>>;
|
|
558
|
-
};
|
|
559
|
-
/**
|
|
560
|
-
* Gets a thread member by their user ID.
|
|
561
|
-
*
|
|
562
|
-
* @param channelId - The ID of the thread to get the thread member of.
|
|
563
|
-
* @param userId - The user ID of the thread member to get.
|
|
564
|
-
* @returns An instance of {@link DiscordThreadMember}.
|
|
565
|
-
*
|
|
566
|
-
* @see {@link https://discord.com/developers/docs/resources/channel#get-thread-member}
|
|
567
|
-
*/
|
|
568
|
-
member: (channelId: BigString, userId: BigString) => Promise<Camelize<DiscordThreadMember>>;
|
|
569
|
-
/**
|
|
570
|
-
* Gets the list of thread members for a thread.
|
|
571
|
-
*
|
|
572
|
-
* @param channelId - The ID of the thread to get the thread members of.
|
|
573
|
-
* @returns A collection of {@link DiscordThreadMember} assorted by user ID.
|
|
574
|
-
*
|
|
575
|
-
* @remarks
|
|
576
|
-
* Requires the application to have the `GUILD_MEMBERS` privileged intent enabled.
|
|
577
|
-
*
|
|
578
|
-
* @see {@link https://discord.com/developers/docs/resources/channel#list-thread-members}
|
|
579
|
-
*/
|
|
580
|
-
members: (channelId: BigString) => Promise<Camelize<DiscordThreadMember[]>>;
|
|
581
|
-
};
|
|
582
|
-
/**
|
|
583
|
-
* Adds the bot user to a thread.
|
|
584
|
-
*
|
|
585
|
-
* @param channelId - The ID of the thread to add the bot user to.
|
|
586
|
-
*
|
|
587
|
-
* @remarks
|
|
588
|
-
* Requires the thread not be archived.
|
|
589
|
-
*
|
|
590
|
-
* Fires a _Thread Members Update_ gateway event.
|
|
591
|
-
*
|
|
592
|
-
* @see {@link https://discord.com/developers/docs/resources/channel#join-thread}
|
|
593
|
-
*/
|
|
594
|
-
join: (channelId: BigString) => Promise<void>;
|
|
595
|
-
/**
|
|
596
|
-
* Removes the bot user from a thread.
|
|
597
|
-
*
|
|
598
|
-
* @param channelId - The ID of the thread to remove the bot user from.
|
|
599
|
-
*
|
|
600
|
-
* @remarks
|
|
601
|
-
* Requires the thread not be archived.
|
|
602
|
-
*
|
|
603
|
-
* Fires a _Thread Members Update_ gateway event.
|
|
604
|
-
*
|
|
605
|
-
* @see {@link https://discord.com/developers/docs/resources/channel#leave-thread}
|
|
606
|
-
*/
|
|
607
|
-
leave: (channelId: BigString) => Promise<void>;
|
|
608
|
-
/**
|
|
609
|
-
* Removes a member from a thread.
|
|
610
|
-
*
|
|
611
|
-
* @param channelId - The ID of the thread to remove the thread member of.
|
|
612
|
-
* @param userId - The user ID of the thread member to remove.
|
|
613
|
-
*
|
|
614
|
-
* @remarks
|
|
615
|
-
* If the thread is of type {@link ChannelTypes.GuildPrivateThread}, requires to be the creator of the thread.
|
|
616
|
-
* Otherwise, requires the `MANAGE_THREADS` permission.
|
|
617
|
-
*
|
|
618
|
-
* Requires the thread not be archived.
|
|
619
|
-
*
|
|
620
|
-
* Fires a _Thread Members Update_ gateway event.
|
|
621
|
-
*
|
|
622
|
-
* @see {@link https://discord.com/developers/docs/resources/channel#remove-thread-member}
|
|
623
|
-
*/
|
|
624
|
-
kick: (channelId: BigString, userId: BigString) => Promise<void>;
|
|
625
|
-
/** Methods related to creating a thread. */
|
|
626
|
-
create: {
|
|
627
|
-
with: {
|
|
628
|
-
/**
|
|
629
|
-
* Creates a thread, using an existing message as its point of origin.
|
|
630
|
-
*
|
|
631
|
-
* @param channelId - The ID of the channel in which to create the thread.
|
|
632
|
-
* @param messageId - The ID of the message to use as the thread's point of origin.
|
|
633
|
-
* @param options - The parameters to use for the creation of the thread.
|
|
634
|
-
* @returns An instance of the created {@link Channel | Thread}.
|
|
635
|
-
*
|
|
636
|
-
* @remarks
|
|
637
|
-
* If called on a channel of type {@link ChannelTypes.GuildText}, creates a {@link ChannelTypes.GuildPublicThread}.
|
|
638
|
-
* If called on a channel of type {@link ChannelTypes.GuildNews}, creates a {@link ChannelTypes.GuildNewsThread}.
|
|
639
|
-
* Does not work on channels of type {@link ChannelTypes.GuildForum}.
|
|
640
|
-
*
|
|
641
|
-
* The ID of the created thread will be the same as the ID of the source message.
|
|
642
|
-
*
|
|
643
|
-
* Fires a _Thread Create_ gateway event.
|
|
644
|
-
*
|
|
645
|
-
* @see {@link https://discord.com/developers/docs/resources/channel#start-thread-from-message}
|
|
646
|
-
*/
|
|
647
|
-
message: (channelId: BigString, messageId: BigString, options: StartThreadWithMessage) => Promise<Camelize<DiscordChannel>>;
|
|
648
|
-
};
|
|
649
|
-
without: {
|
|
650
|
-
/**
|
|
651
|
-
* Creates a thread without using a message as the thread's point of origin.
|
|
652
|
-
*
|
|
653
|
-
* @param channelId - The ID of the channel in which to create the thread.
|
|
654
|
-
* @param options - The parameters to use for the creation of the thread.
|
|
655
|
-
* @returns An instance of the created {@link DiscordChannel | Thread}.
|
|
656
|
-
*
|
|
657
|
-
* @remarks
|
|
658
|
-
* Creating a private thread requires the server to be boosted.
|
|
659
|
-
*
|
|
660
|
-
* Fires a _Thread Create_ gateway event.
|
|
661
|
-
*
|
|
662
|
-
* @see {@link https://discord.com/developers/docs/resources/channel#start-thread-without-message}
|
|
663
|
-
*/
|
|
664
|
-
message: (channelId: BigString, options: StartThreadWithoutMessage) => Promise<Camelize<DiscordChannel>>;
|
|
665
|
-
};
|
|
666
|
-
};
|
|
667
|
-
};
|
|
668
|
-
/**
|
|
669
|
-
* Edits the positions of a set of channels in a guild.
|
|
670
|
-
*
|
|
671
|
-
* @param guildId - The ID of the guild in which to edit the positions of the channels.
|
|
672
|
-
* @param channelPositions - A set of objects defining the updated positions of the channels.
|
|
673
|
-
*
|
|
674
|
-
* @remarks
|
|
675
|
-
* Requires the `MANAGE_CHANNELS` permission.
|
|
676
|
-
*
|
|
677
|
-
* Fires a _Channel Update_ gateway event for every channel impacted in this change.
|
|
678
|
-
*
|
|
679
|
-
* @see {@link https://discord.com/developers/docs/resources/guild#modify-guild-channel-positions}
|
|
680
|
-
*/
|
|
681
|
-
positions: (guildId: BigString, channelPositions: ModifyGuildChannelPositions[]) => Promise<void>;
|
|
682
|
-
/**
|
|
683
|
-
* Gets the list of invites for a channel.
|
|
684
|
-
*
|
|
685
|
-
* @param channelId - The ID of the channel to get the invites of.
|
|
686
|
-
* @returns A collection of {@link DiscordInviteMetadata} objects assorted by invite code.
|
|
687
|
-
*
|
|
688
|
-
* @remarks
|
|
689
|
-
* Requires the `MANAGE_CHANNELS` permission.
|
|
690
|
-
*
|
|
691
|
-
* Only usable for guild channels.
|
|
692
|
-
*
|
|
693
|
-
* @see {@link https://discord.com/developers/docs/resources/channel#get-channel-invites}
|
|
694
|
-
*/
|
|
695
|
-
invites: (channelId: BigString) => Promise<Camelize<DiscordInviteMetadata[]>>;
|
|
696
|
-
/** Stage related helpers for a channel. */
|
|
697
|
-
stages: {
|
|
698
|
-
/**
|
|
699
|
-
* Creates a stage instance associated with a stage channel.
|
|
700
|
-
*
|
|
701
|
-
* @param options - The parameters for the creation of the stage instance.
|
|
702
|
-
* @returns An instance of the created {@link DiscordStageInstance}.
|
|
703
|
-
*
|
|
704
|
-
* @remarks
|
|
705
|
-
* Requires the user to be a moderator of the stage channel.
|
|
706
|
-
*
|
|
707
|
-
* Fires a _Stage Instance Create_ gateway event.
|
|
708
|
-
*
|
|
709
|
-
* @see {@link https://discord.com/developers/docs/resources/stage-instance#create-stage-instance}
|
|
710
|
-
*/
|
|
711
|
-
create: (options: CreateStageInstance) => Promise<Camelize<DiscordStageInstance>>;
|
|
712
|
-
/**
|
|
713
|
-
* Deletes the stage instance associated with a stage channel, if one exists.
|
|
714
|
-
*
|
|
715
|
-
* @param channelId - The ID of the stage channel the stage instance is associated with.
|
|
716
|
-
*
|
|
717
|
-
* @remarks
|
|
718
|
-
* Requires the user to be a moderator of the stage channel.
|
|
719
|
-
*
|
|
720
|
-
* Fires a _Stage Instance Delete_ gateway event.
|
|
721
|
-
*
|
|
722
|
-
* @see {@link https://discord.com/developers/docs/resources/stage-instance#delete-stage-instance}
|
|
723
|
-
*/
|
|
724
|
-
delete: (channelId: BigString, reason?: string) => Promise<void>;
|
|
725
|
-
/**
|
|
726
|
-
* Edits a stage instance.
|
|
727
|
-
*
|
|
728
|
-
* @param channelId - The ID of the stage channel the stage instance is associated with.
|
|
729
|
-
* @returns An instance of the updated {@link DiscordStageInstance}.
|
|
730
|
-
*
|
|
731
|
-
* @remarks
|
|
732
|
-
* Requires the user to be a moderator of the stage channel.
|
|
733
|
-
*
|
|
734
|
-
* Fires a _Stage Instance Update_ event.
|
|
735
|
-
*
|
|
736
|
-
* @see {@link https://discord.com/developers/docs/resources/stage-instance#modify-stage-instance}
|
|
737
|
-
*/
|
|
738
|
-
edit: (channelId: BigString, data: EditStageInstanceOptions) => Promise<Camelize<DiscordStageInstance>>;
|
|
739
|
-
/**
|
|
740
|
-
* Gets the stage instance associated with a stage channel, if one exists.
|
|
741
|
-
*
|
|
742
|
-
* @param channelId - The ID of the stage channel the stage instance is associated with.
|
|
743
|
-
* @returns An instance of {@link DiscordStageInstance}.
|
|
744
|
-
*
|
|
745
|
-
* @see {@link https://discord.com/developers/docs/resources/stage-instance#get-stage-instance}
|
|
746
|
-
*/
|
|
747
|
-
get: (channelId: BigString) => Promise<Camelize<DiscordStageInstance>>;
|
|
748
|
-
};
|
|
749
|
-
/**
|
|
750
|
-
* Triggers a typing indicator for the bot user.
|
|
751
|
-
*
|
|
752
|
-
* @param channelId - The ID of the channel in which to trigger the typing indicator.
|
|
753
|
-
*
|
|
754
|
-
* @remarks
|
|
755
|
-
* Generally, bots should _not_ use this route.
|
|
756
|
-
*
|
|
757
|
-
* Fires a _Typing Start_ gateway event.
|
|
758
|
-
*
|
|
759
|
-
* @see {@link https://discord.com/developers/docs/resources/channel#trigger-typing-indicator}
|
|
760
|
-
*/
|
|
761
|
-
typing: (channelId: BigString) => Promise<void>;
|
|
762
|
-
};
|
|
763
|
-
/** Emoji related helper methods. */
|
|
764
|
-
emojis: {
|
|
765
|
-
/**
|
|
766
|
-
* Creates an emoji in a guild.
|
|
767
|
-
*
|
|
768
|
-
* @param guildId - The ID of the guild in which to create the emoji.
|
|
769
|
-
* @param options - The parameters for the creation of the emoji.
|
|
770
|
-
* @returns An instance of the created {@link DiscordEmoji}.
|
|
771
|
-
*
|
|
772
|
-
* @remarks
|
|
773
|
-
* Requires the `MANAGE_EMOJIS_AND_STICKERS` permission.
|
|
774
|
-
*
|
|
775
|
-
* Emojis have a maximum file size of 256 kilobits. Attempting to upload a larger emoji will cause the route to return 400 Bad Request.
|
|
776
|
-
*
|
|
777
|
-
* Fires a _Guild Emojis Update_ gateway event.
|
|
778
|
-
*
|
|
779
|
-
* @see {@link https://discord.com/developers/docs/resources/emoji#create-guild-emoji}
|
|
780
|
-
*/
|
|
781
|
-
create: (guildId: BigString, options: CreateGuildEmoji) => Promise<Camelize<DiscordEmoji>>;
|
|
782
|
-
/**
|
|
783
|
-
* Deletes an emoji from a guild.
|
|
784
|
-
*
|
|
785
|
-
* @param guildId - The ID of the guild from which to delete the emoji.
|
|
786
|
-
* @param id - The ID of the emoji to delete.
|
|
787
|
-
*
|
|
788
|
-
* @remarks
|
|
789
|
-
* Requires the `MANAGE_EMOJIS_AND_STICKERS` permission.
|
|
790
|
-
*
|
|
791
|
-
* Fires a _Guild Emojis Update_ gateway event.
|
|
792
|
-
*
|
|
793
|
-
* @see {@link https://discord.com/developers/docs/resources/emoji#delete-guild-emoji}
|
|
794
|
-
*/
|
|
795
|
-
delete: (guildId: BigString, id: BigString, reason?: string) => Promise<void>;
|
|
796
|
-
/**
|
|
797
|
-
* Edits an emoji.
|
|
798
|
-
*
|
|
799
|
-
* @param guildId - The ID of the guild in which to edit the emoji.
|
|
800
|
-
* @param id - The ID of the emoji to edit.
|
|
801
|
-
* @param options - The parameters for the edit of the emoji.
|
|
802
|
-
* @returns An instance of the updated {@link DiscordEmoji}.
|
|
803
|
-
*
|
|
804
|
-
* @remarks
|
|
805
|
-
* Requires the `MANAGE_EMOJIS_AND_STICKERS` permission.
|
|
806
|
-
*
|
|
807
|
-
* Fires a `Guild Emojis Update` gateway event.
|
|
808
|
-
*
|
|
809
|
-
* @see {@link https://discord.com/developers/docs/resources/emoji#modify-guild-emoji}
|
|
810
|
-
*/
|
|
811
|
-
edit: (guildId: BigString, id: BigString, options: ModifyGuildEmoji) => Promise<Camelize<DiscordEmoji>>;
|
|
812
|
-
/**
|
|
813
|
-
* Gets an emoji by its ID.
|
|
814
|
-
*
|
|
815
|
-
* @param guildId - The ID of the guild from which to get the emoji.
|
|
816
|
-
* @param emojiId - The ID of the emoji to get.
|
|
817
|
-
* @returns An instance of {@link DiscordEmoji}.
|
|
818
|
-
*
|
|
819
|
-
* @see {@link https://discord.com/developers/docs/resources/emoji#get-guild-emoji}
|
|
820
|
-
*/
|
|
821
|
-
get: (guildId: BigString, emojiId: BigString) => Promise<Camelize<DiscordEmoji>>;
|
|
822
|
-
};
|
|
823
|
-
/** Guild related helper methods */
|
|
824
|
-
guilds: {
|
|
825
|
-
automod: {
|
|
826
|
-
/**
|
|
827
|
-
* Creates an automod rule in a guild.
|
|
828
|
-
*
|
|
829
|
-
* @param guildId - The ID of the guild to create the rule in.
|
|
830
|
-
* @param options - The parameters for the creation of the rule.
|
|
831
|
-
* @returns An instance of the created {@link DiscordAutoModerationRule}.
|
|
832
|
-
*
|
|
833
|
-
* @remarks
|
|
834
|
-
* Requires the `MANAGE_GUILD` permission.
|
|
835
|
-
*
|
|
836
|
-
* Fires an _Auto Moderation Rule Create_ gateway event.
|
|
837
|
-
*
|
|
838
|
-
* @see {@link https://discord.com/developers/docs/resources/auto-moderation#create-auto-moderation-rule}
|
|
839
|
-
*/
|
|
840
|
-
create: (guildId: BigString, options: CreateAutoModerationRuleOptions) => Promise<Camelize<DiscordAutoModerationRule>>;
|
|
841
|
-
/**
|
|
842
|
-
* Deletes a scheduled event from a guild.
|
|
843
|
-
*
|
|
844
|
-
* @param guildId - The ID of the guild to delete the scheduled event from.
|
|
845
|
-
* @param eventId - The ID of the scheduled event to delete.
|
|
846
|
-
*
|
|
847
|
-
* @remarks
|
|
848
|
-
* Requires the `MANAGE_EVENTS` permission.
|
|
849
|
-
*
|
|
850
|
-
* Fires a _Guild Scheduled Event Delete_ gateway event.
|
|
851
|
-
*
|
|
852
|
-
* @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#delete-guild-scheduled-event}
|
|
853
|
-
*/
|
|
854
|
-
delete: (guildId: BigString, eventId: BigString) => Promise<void>;
|
|
855
|
-
/**
|
|
856
|
-
* Edits an automod rule.
|
|
857
|
-
*
|
|
858
|
-
* @param guildId - The ID of the guild to edit the rule in.
|
|
859
|
-
* @param ruleId - The ID of the rule to edit.
|
|
860
|
-
* @param options - The parameters for the edit of the rule.
|
|
861
|
-
* @returns An instance of the edited {@link DiscordAutoModerationRule}.
|
|
862
|
-
*
|
|
863
|
-
* @remarks
|
|
864
|
-
* Requires the `MANAGE_GUILD` permission.
|
|
865
|
-
*
|
|
866
|
-
* Fires an _Auto Moderation Rule Update_ gateway event.
|
|
867
|
-
*
|
|
868
|
-
* @see {@link https://discord.com/developers/docs/resources/auto-moderation#modify-auto-moderation-rule}
|
|
869
|
-
*/
|
|
870
|
-
edit: (guildId: BigString, ruleId: BigString, options: Partial<EditAutoModerationRuleOptions>) => Promise<Camelize<DiscordAutoModerationRule>>;
|
|
871
|
-
/** Methods related to getting automoderation data in a guild. */
|
|
872
|
-
get: {
|
|
873
|
-
/**
|
|
874
|
-
* Gets an automod rule by its ID.
|
|
875
|
-
*
|
|
876
|
-
* @param guildId - The ID of the guild to get the rule of.
|
|
877
|
-
* @param ruleId - The ID of the rule to get.
|
|
878
|
-
* @returns An instance of {@link DiscordAutoModerationRule}.
|
|
879
|
-
*
|
|
880
|
-
* @remarks
|
|
881
|
-
* Requires the `MANAGE_GUILD` permission.
|
|
882
|
-
*
|
|
883
|
-
* @see {@link https://discord.com/developers/docs/resources/auto-moderation#get-auto-moderation-rule}
|
|
884
|
-
*/
|
|
885
|
-
rule: (guildId: BigString, ruleId: BigString) => Promise<Camelize<DiscordAutoModerationRule>>;
|
|
886
|
-
/**
|
|
887
|
-
* Gets the list of automod rules for a guild.
|
|
888
|
-
*
|
|
889
|
-
* @param guildId - The ID of the guild to get the rules from.
|
|
890
|
-
* @returns A collection of {@link DiscordAutoModerationRule} objects assorted by rule ID.
|
|
891
|
-
*
|
|
892
|
-
* @remarks
|
|
893
|
-
* Requires the `MANAGE_GUILD` permission.
|
|
894
|
-
*
|
|
895
|
-
* @see {@link https://discord.com/developers/docs/resources/auto-moderation#list-auto-moderation-rules-for-guild}
|
|
896
|
-
*/
|
|
897
|
-
rules: (guildId: BigString) => Promise<Camelize<DiscordAutoModerationRule[]>>;
|
|
898
|
-
};
|
|
899
|
-
};
|
|
900
|
-
/**
|
|
901
|
-
* Gets the list of channels for a guild.
|
|
902
|
-
*
|
|
903
|
-
* @param guildId - The ID of the guild to get the channels of.
|
|
904
|
-
* @returns A collection of {@link DiscordChannel} objects assorted by channel ID.
|
|
905
|
-
*
|
|
906
|
-
* @remarks
|
|
907
|
-
* Excludes threads.
|
|
908
|
-
*
|
|
909
|
-
* @see {@link https://discord.com/developers/docs/resources/guild#get-guild-channels}
|
|
910
|
-
*/
|
|
911
|
-
channels: (guildId: BigString) => Promise<Camelize<DiscordChannel[]>>;
|
|
912
|
-
/**
|
|
913
|
-
* Gets the list of emojis for a guild.
|
|
914
|
-
*
|
|
915
|
-
* @param guildId - The ID of the guild which to get the emojis of.
|
|
916
|
-
* @returns A collection of {@link DiscordEmoji} objects assorted by emoji ID.
|
|
917
|
-
*
|
|
918
|
-
* @see {@link https://discord.com/developers/docs/resources/emoji#list-guild-emojis}
|
|
919
|
-
*/
|
|
920
|
-
emojis: (guildId: BigString) => Promise<Camelize<DiscordEmoji[]>>;
|
|
921
|
-
/** Methods related to a guild's scheduled events. */
|
|
922
|
-
events: {
|
|
923
|
-
/**
|
|
924
|
-
* Creates a scheduled event in a guild.
|
|
925
|
-
*
|
|
926
|
-
* @param guildId - The ID of the guild to create the scheduled event in.
|
|
927
|
-
* @param options - The parameters for the creation of the scheduled event.
|
|
928
|
-
* @returns An instance of the created {@link ScheduledEvent}.
|
|
929
|
-
*
|
|
930
|
-
* @remarks
|
|
931
|
-
* Requires the `MANAGE_EVENTS` permission.
|
|
932
|
-
*
|
|
933
|
-
* A guild can only have a maximum of 100 events with a status of {@link ScheduledEventStatus.Active} or {@link ScheduledEventStatus.Scheduled} (inclusive).
|
|
934
|
-
*
|
|
935
|
-
* Fires a _Guild Scheduled Event Create_ gateway event.
|
|
936
|
-
*
|
|
937
|
-
* @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#create-guild-scheduled-event}
|
|
938
|
-
*/
|
|
939
|
-
create: (guildId: BigString, options: CreateScheduledEvent) => Promise<Camelize<DiscordScheduledEvent>>;
|
|
940
|
-
/**
|
|
941
|
-
* Deletes a scheduled event from a guild.
|
|
942
|
-
*
|
|
943
|
-
* @param guildId - The ID of the guild to delete the scheduled event from.
|
|
944
|
-
* @param eventId - The ID of the scheduled event to delete.
|
|
945
|
-
*
|
|
946
|
-
* @remarks
|
|
947
|
-
* Requires the `MANAGE_EVENTS` permission.
|
|
948
|
-
*
|
|
949
|
-
* Fires a _Guild Scheduled Event Delete_ gateway event.
|
|
950
|
-
*
|
|
951
|
-
* @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#delete-guild-scheduled-event}
|
|
952
|
-
*/
|
|
953
|
-
delete: (guildId: BigString, eventId: BigString) => Promise<void>;
|
|
954
|
-
/**
|
|
955
|
-
* Edits a scheduled event.
|
|
956
|
-
*
|
|
957
|
-
* @param guildId - The ID of the guild to edit the scheduled event in.
|
|
958
|
-
* @param eventId - The ID of the scheduled event to edit.
|
|
959
|
-
* @returns An instance of the edited {@link ScheduledEvent}.
|
|
960
|
-
*
|
|
961
|
-
* @remarks
|
|
962
|
-
* Requires the `MANAGE_EVENTS` permission.
|
|
963
|
-
*
|
|
964
|
-
* To start or end an event, modify the event's `status` property.
|
|
965
|
-
*
|
|
966
|
-
* The `entity_metadata` property is discarded for events whose `entity_type` is not {@link ScheduledEventEntityType.External}.
|
|
967
|
-
*
|
|
968
|
-
* Fires a _Guild Scheduled Event Update_ gateway event.
|
|
969
|
-
*
|
|
970
|
-
* @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event}
|
|
971
|
-
*/
|
|
972
|
-
edit: (guildId: BigString, eventId: BigString, options: Partial<EditScheduledEvent>) => Promise<Camelize<DiscordScheduledEvent>>;
|
|
973
|
-
get: {
|
|
974
|
-
/**
|
|
975
|
-
* Gets a scheduled event by its ID.
|
|
976
|
-
*
|
|
977
|
-
* @param guildId - The ID of the guild to get the scheduled event from.
|
|
978
|
-
* @param eventId - The ID of the scheduled event to get.
|
|
979
|
-
* @param options - The parameters for the fetching of the scheduled event.
|
|
980
|
-
* @returns An instance of {@link ScheduledEvent}.
|
|
981
|
-
*
|
|
982
|
-
* @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#get-guild-scheduled-event}
|
|
983
|
-
*/
|
|
984
|
-
event: (guildId: BigString, eventId: BigString, options?: {
|
|
985
|
-
withUserCount?: boolean;
|
|
986
|
-
}) => Promise<Camelize<DiscordScheduledEvent>>;
|
|
987
|
-
/**
|
|
988
|
-
* Gets the list of scheduled events for a guild.
|
|
989
|
-
*
|
|
990
|
-
* @param guildId - The ID of the guild to get the scheduled events from.
|
|
991
|
-
* @param options - The parameters for the fetching of the scheduled events.
|
|
992
|
-
* @returns A collection of {@link ScheduledEvent} objects assorted by event ID.
|
|
993
|
-
*
|
|
994
|
-
* @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#list-scheduled-events-for-guild}
|
|
995
|
-
*/
|
|
996
|
-
events: (guildId: BigString, options?: GetScheduledEvents) => Promise<Camelize<DiscordScheduledEvent[]>>;
|
|
997
|
-
/**
|
|
998
|
-
* Gets the list of subscribers to a scheduled event from a guild.
|
|
999
|
-
*
|
|
1000
|
-
* @param guildId - The ID of the guild to get the subscribers to the scheduled event from.
|
|
1001
|
-
* @param eventId - The ID of the scheduled event to get the subscribers of.
|
|
1002
|
-
* @param options - The parameters for the fetching of the subscribers.
|
|
1003
|
-
* @returns A collection of {@link User} objects assorted by user ID.
|
|
1004
|
-
*
|
|
1005
|
-
* @remarks
|
|
1006
|
-
* Requires the `MANAGE_EVENTS` permission.
|
|
1007
|
-
*
|
|
1008
|
-
* Users are ordered by their IDs in _ascending_ order.
|
|
1009
|
-
*
|
|
1010
|
-
* @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#get-guild-scheduled-event-users}
|
|
1011
|
-
*/
|
|
1012
|
-
users: (guildId: BigString, eventId: BigString, options?: GetScheduledEventUsers) => Promise<Array<{
|
|
1013
|
-
user: Camelize<DiscordUser>;
|
|
1014
|
-
member?: Camelize<DiscordMember>;
|
|
1015
|
-
}>>;
|
|
1016
|
-
};
|
|
1017
|
-
};
|
|
1018
|
-
/** Methods related to a guild's integrations. */
|
|
1019
|
-
integrations: {
|
|
1020
|
-
/**
|
|
1021
|
-
* Gets the list of integrations attached to a guild.
|
|
1022
|
-
*
|
|
1023
|
-
* @param guildId - The ID of the guild to get the list of integrations from.
|
|
1024
|
-
* @returns A collection of {@link Integration} objects assorted by integration ID.
|
|
1025
|
-
*
|
|
1026
|
-
* @remarks
|
|
1027
|
-
* Requires the `MANAGE_GUILD` permission.
|
|
1028
|
-
*
|
|
1029
|
-
* @see {@link https://discord.com/developers/docs/resources/guild#get-guild-integrations}
|
|
1030
|
-
*/
|
|
1031
|
-
get: (guildId: BigString) => Promise<Camelize<DiscordIntegration[]>>;
|
|
1032
|
-
/**
|
|
1033
|
-
* Deletes an integration attached to a guild.
|
|
1034
|
-
*
|
|
1035
|
-
* @param guildId - The ID of the guild from which to delete the integration.
|
|
1036
|
-
* @param integrationId - The ID of the integration to delete from the guild.
|
|
1037
|
-
*
|
|
1038
|
-
* @remarks
|
|
1039
|
-
* Requires the `MANAGE_GUILD` permission.
|
|
1040
|
-
*
|
|
1041
|
-
* Deletes all webhooks associated with the integration, and kicks the associated bot if there is one.
|
|
1042
|
-
*
|
|
1043
|
-
* Fires a _Guild Integrations Update_ gateway event.
|
|
1044
|
-
* Fires a _Integration Delete_ gateway event.
|
|
1045
|
-
*
|
|
1046
|
-
* @see {@link https://discord.com/developers/docs/resources/guild#delete-guild-integration}
|
|
1047
|
-
*/
|
|
1048
|
-
delete: (guildId: BigString, integrationId: BigString) => Promise<void>;
|
|
1049
|
-
};
|
|
1050
|
-
/** Methods related to a guild's invites. */
|
|
1051
|
-
invites: {
|
|
1052
|
-
/**
|
|
1053
|
-
* Creates an invite to a channel in a guild.
|
|
1054
|
-
*
|
|
1055
|
-
* @param channelId - The ID of the channel to create the invite to.
|
|
1056
|
-
* @param options - The parameters for the creation of the invite.
|
|
1057
|
-
* @returns An instance of the created {@link DiscordInvite}.
|
|
1058
|
-
*
|
|
1059
|
-
* @remarks
|
|
1060
|
-
* Requires the `CREATE_INSTANT_INVITE` permission.
|
|
1061
|
-
*
|
|
1062
|
-
* Fires an _Invite Create_ gateway event.
|
|
1063
|
-
*
|
|
1064
|
-
* @privateRemarks
|
|
1065
|
-
* The request body is not optional, and an empty JSON object must be sent regardless of whether any fields are being transmitted.
|
|
1066
|
-
*
|
|
1067
|
-
* @see {@link https://discord.com/developers/docs/resources/channel#create-channel-invite}
|
|
1068
|
-
*/
|
|
1069
|
-
create: (channelId: BigString, options?: CreateChannelInvite) => Promise<Camelize<DiscordInvite>>;
|
|
1070
|
-
/**
|
|
1071
|
-
* Deletes an invite to a channel.
|
|
1072
|
-
*
|
|
1073
|
-
* @param inviteCode - The invite code of the invite to delete.
|
|
1074
|
-
*
|
|
1075
|
-
* @remarks
|
|
1076
|
-
* Requires the `MANAGE_CHANNELS` permission.
|
|
1077
|
-
*
|
|
1078
|
-
* Fires an _Invite Delete_ gateway event.
|
|
1079
|
-
*
|
|
1080
|
-
* @see {@link https://discord.com/developers/docs/resources/channel#delete-channel-invite}
|
|
1081
|
-
*/
|
|
1082
|
-
delete: (inviteCode: string, reason?: string) => Promise<void>;
|
|
1083
|
-
/**
|
|
1084
|
-
* Gets an invite to a channel by its invite code.
|
|
1085
|
-
*
|
|
1086
|
-
* @param inviteCode - The invite code of the invite to get.
|
|
1087
|
-
* @param options - The parameters for the fetching of the invite.
|
|
1088
|
-
* @returns An instance of {@link DiscordInviteMetadata}.
|
|
1089
|
-
*
|
|
1090
|
-
* @see {@link https://discord.com/developers/docs/resources/invite#get-invite}
|
|
1091
|
-
*/
|
|
1092
|
-
get: (inviteCode: string, options?: GetInvite) => Promise<Camelize<DiscordInviteMetadata>>;
|
|
1093
|
-
/**
|
|
1094
|
-
* Gets the list of invites for a guild.
|
|
1095
|
-
*
|
|
1096
|
-
* @param guildId - The ID of the guild to get the invites from.
|
|
1097
|
-
* @returns A collection of {@link DiscordInviteMetadata} objects assorted by invite code.
|
|
1098
|
-
*
|
|
1099
|
-
* @remarks
|
|
1100
|
-
* Requires the `MANAGE_GUILD` permission.
|
|
1101
|
-
*
|
|
1102
|
-
* @see {@link https://discord.com/developers/docs/resources/invite#get-invites}
|
|
1103
|
-
*/
|
|
1104
|
-
list: (guildId: BigString) => Promise<Camelize<DiscordInviteMetadata[]>>;
|
|
1105
|
-
};
|
|
1106
|
-
/** Methods related to a guild's templates. */
|
|
1107
|
-
templates: {
|
|
1108
|
-
/**
|
|
1109
|
-
* Creates a template from a guild.
|
|
1110
|
-
*
|
|
1111
|
-
* @param guildId - The ID of the guild to create the template from.
|
|
1112
|
-
* @param options - The parameters for the creation of the template.
|
|
1113
|
-
* @returns An instance of the created {@link Template}.
|
|
1114
|
-
*
|
|
1115
|
-
* @remarks
|
|
1116
|
-
* Requires the `MANAGE_GUILD` permission.
|
|
1117
|
-
*
|
|
1118
|
-
* Fires a _Guild Update_ gateway event.
|
|
1119
|
-
*
|
|
1120
|
-
* @see {@link https://discord.com/developers/docs/resources/guild-template#create-guild-template}
|
|
1121
|
-
*/
|
|
1122
|
-
create: (guildId: BigString, options: CreateTemplate) => Promise<Camelize<DiscordTemplate>>;
|
|
1123
|
-
/**
|
|
1124
|
-
* Deletes a template from a guild.
|
|
1125
|
-
*
|
|
1126
|
-
* @param guildId - The ID of the guild to delete the template from.
|
|
1127
|
-
* @param templateCode - The code of the template to delete.
|
|
1128
|
-
*
|
|
1129
|
-
* @remarks
|
|
1130
|
-
* Requires the `MANAGE_GUILD` permission.
|
|
1131
|
-
*
|
|
1132
|
-
* Fires a _Guild Update_ gateway event.
|
|
1133
|
-
*
|
|
1134
|
-
* @see {@link https://discord.com/developers/docs/resources/guild-template#delete-guild-template}
|
|
1135
|
-
*/
|
|
1136
|
-
delete: (guildId: BigString, templateCode: string) => Promise<void>;
|
|
1137
|
-
/**
|
|
1138
|
-
* Edits a template's settings.
|
|
1139
|
-
*
|
|
1140
|
-
* @param guildId - The ID of the guild to edit a template of.
|
|
1141
|
-
* @param templateCode - The code of the template to edit.
|
|
1142
|
-
* @param options - The parameters for the edit of the template.
|
|
1143
|
-
* @returns An instance of the edited {@link Template}.
|
|
1144
|
-
*
|
|
1145
|
-
* @remarks
|
|
1146
|
-
* Requires the `MANAGE_GUILD` permission.
|
|
1147
|
-
*
|
|
1148
|
-
* Fires a _Guild Update_ gateway event.
|
|
1149
|
-
*
|
|
1150
|
-
* @see {@link https://discord.com/developers/docs/resources/guild-template#modify-guild-template}
|
|
1151
|
-
*/
|
|
1152
|
-
edit: (guildId: BigString, templateCode: string, options: ModifyGuildTemplate) => Promise<Camelize<DiscordTemplate>>;
|
|
1153
|
-
/**
|
|
1154
|
-
* Gets a template by its code.
|
|
1155
|
-
*
|
|
1156
|
-
* @param templateCode - The code of the template to get.
|
|
1157
|
-
* @returns An instance of {@link Template}.
|
|
1158
|
-
*
|
|
1159
|
-
* @remarks
|
|
1160
|
-
* Requires the `MANAGE_GUILD` permission.
|
|
1161
|
-
*
|
|
1162
|
-
* @see {@link https://discord.com/developers/docs/resources/guild-template#get-guild-template}
|
|
1163
|
-
*/
|
|
1164
|
-
get: (templateCode: string) => Promise<Camelize<DiscordTemplate>>;
|
|
1165
|
-
/**
|
|
1166
|
-
* Gets the list of templates for a guild.
|
|
1167
|
-
*
|
|
1168
|
-
* @param guildId - The ID of the guild to get the list of templates for.
|
|
1169
|
-
* @returns A collection of {@link Template} objects assorted by template code.
|
|
1170
|
-
*
|
|
1171
|
-
* @remarks
|
|
1172
|
-
* Requires the `MANAGE_GUILD` permission.
|
|
1173
|
-
*
|
|
1174
|
-
* @see {@link https://discord.com/developers/docs/resources/guild-template#get-guild-templates}
|
|
1175
|
-
*/
|
|
1176
|
-
list: (guildId: BigString) => Promise<Camelize<DiscordTemplate[]>>;
|
|
1177
|
-
/**
|
|
1178
|
-
* Synchronises a template with the current state of a guild.
|
|
1179
|
-
*
|
|
1180
|
-
* @param guildId - The ID of the guild to synchronise a template of.
|
|
1181
|
-
* @returns An instance of the edited {@link Template}.
|
|
1182
|
-
*
|
|
1183
|
-
* @remarks
|
|
1184
|
-
* Requires the `MANAGE_GUILD` permission.
|
|
1185
|
-
*
|
|
1186
|
-
* Fires a _Guild Update_ gateway event.
|
|
1187
|
-
*
|
|
1188
|
-
* @see {@link https://discord.com/developers/docs/resources/guild-template#get-guild-templates}
|
|
1189
|
-
*/
|
|
1190
|
-
sync: (guildId: BigString) => Promise<Camelize<DiscordTemplate>>;
|
|
1191
|
-
};
|
|
1192
|
-
members: {
|
|
1193
|
-
/**
|
|
1194
|
-
* Bans a user from a guild.
|
|
1195
|
-
*
|
|
1196
|
-
* @param guildId - The ID of the guild to ban the user from.
|
|
1197
|
-
* @param userId - The ID of the user to ban from the guild.
|
|
1198
|
-
* @param options - The parameters for the creation of the ban.
|
|
1199
|
-
*
|
|
1200
|
-
* @remarks
|
|
1201
|
-
* Requires the `BAN_MEMBERS` permission.
|
|
1202
|
-
*
|
|
1203
|
-
* Fires a _Guild Ban Add_ gateway event.
|
|
1204
|
-
*
|
|
1205
|
-
* @see {@link https://discord.com/developers/docs/resources/guild#create-guild-ban}
|
|
1206
|
-
*/
|
|
1207
|
-
ban: (guildId: BigString, userId: BigString, options?: CreateGuildBan) => Promise<void>;
|
|
1208
|
-
/**
|
|
1209
|
-
* Edits the nickname of the bot user.
|
|
1210
|
-
*
|
|
1211
|
-
* @param guildId - The ID of the guild to edit the nickname of the bot user in.
|
|
1212
|
-
* @param options - The parameters for the edit of the nickname.
|
|
1213
|
-
* @returns An instance of the edited {@link DiscordMember}
|
|
1214
|
-
*
|
|
1215
|
-
* @remarks
|
|
1216
|
-
* Fires a _Guild Member Update_ gateway event.
|
|
1217
|
-
*
|
|
1218
|
-
* @see {@link https://discord.com/developers/docs/resources/guild#modify-current-member}
|
|
1219
|
-
*/
|
|
1220
|
-
editSelf: (guildId: BigString, options: EditBotMemberOptions) => Promise<Camelize<DiscordMember>>;
|
|
1221
|
-
/**
|
|
1222
|
-
* Edits a member's properties.
|
|
1223
|
-
*
|
|
1224
|
-
* @param guildId - The ID of the guild to edit the member of.
|
|
1225
|
-
* @param userId - The user ID of the member to edit.
|
|
1226
|
-
* @param options - The parameters for the edit of the user.
|
|
1227
|
-
*
|
|
1228
|
-
* @remarks
|
|
1229
|
-
* This endpoint requires various permissions depending on what is edited about the member.
|
|
1230
|
-
* To find out the required permission to enact a change, read the documentation of this endpoint's {@link ModifyGuildMember | parameters}.
|
|
1231
|
-
*
|
|
1232
|
-
* Fires a _Guild Member Update_ gateway event.
|
|
1233
|
-
*
|
|
1234
|
-
* @see {@link https://discord.com/developers/docs/resources/guild#modify-guild-member}
|
|
1235
|
-
*/
|
|
1236
|
-
edit: (guildId: BigString, userId: BigString, options: ModifyGuildMember) => Promise<Camelize<DiscordMember>>;
|
|
1237
|
-
/**
|
|
1238
|
-
* Gets or creates a DM channel with a user.
|
|
1239
|
-
*
|
|
1240
|
-
* @param userId - The ID of the user to create the DM channel with.
|
|
1241
|
-
* @returns An instance of {@link Channel}.
|
|
1242
|
-
*
|
|
1243
|
-
* @see {@link https://discord.com/developers/docs/resources/user#create-dm}
|
|
1244
|
-
*/
|
|
1245
|
-
dm: (userId: BigString) => Promise<Camelize<DiscordChannel>>;
|
|
1246
|
-
/**
|
|
1247
|
-
* Gets the member object by user ID.
|
|
1248
|
-
*
|
|
1249
|
-
* @param guildId - The ID of the guild to get the member object for.
|
|
1250
|
-
* @param userId - The ID of the user to get the member object for.
|
|
1251
|
-
* @returns An instance of {@link DiscordMemberWithUser}.
|
|
1252
|
-
*
|
|
1253
|
-
* @see {@link https://discord.com/developers/docs/resources/guild#get-guild-member}
|
|
1254
|
-
*/
|
|
1255
|
-
get: (guildId: BigString, userId: BigString) => Promise<Camelize<DiscordMemberWithUser>>;
|
|
1256
|
-
/**
|
|
1257
|
-
* Gets the list of members for a guild.
|
|
1258
|
-
*
|
|
1259
|
-
* @param guildId - The ID of the guild to get the list of members for.
|
|
1260
|
-
* @param options - The parameters for the fetching of the members.
|
|
1261
|
-
* @returns A collection of {@link DiscordMemberWithUser} objects assorted by user ID.
|
|
1262
|
-
*
|
|
1263
|
-
* @remarks
|
|
1264
|
-
* Requires the `GUILD_MEMBERS` intent.
|
|
1265
|
-
*
|
|
1266
|
-
* ⚠️ It is not recommended to use this endpoint with very large bots. Instead, opt to use `fetchMembers()`:
|
|
1267
|
-
* REST communication only permits 50 requests to be made per second, while gateways allow for up to 120 requests
|
|
1268
|
-
* per minute per shard. For more information, read {@link https://discord.com/developers/docs/topics/rate-limits#rate-limits}.
|
|
1269
|
-
*
|
|
1270
|
-
* @see {@link https://discord.com/developers/docs/resources/guild#list-guild-members}
|
|
1271
|
-
* @see {@link https://discord.com/developers/docs/topics/gateway#request-guild-members}
|
|
1272
|
-
* @see {@link https://discord.com/developers/docs/topics/rate-limits#rate-limits}
|
|
1273
|
-
*/
|
|
1274
|
-
list: (guildId: BigString, options: ListGuildMembers) => Promise<Camelize<DiscordMemberWithUser[]>>;
|
|
1275
|
-
/**
|
|
1276
|
-
* Kicks a member from a guild.
|
|
1277
|
-
*
|
|
1278
|
-
* @param guildId - The ID of the guild to kick the member from.
|
|
1279
|
-
* @param userId - The user ID of the member to kick from the guild.
|
|
1280
|
-
*
|
|
1281
|
-
* @remarks
|
|
1282
|
-
* Requires the `KICK_MEMBERS` permission.
|
|
1283
|
-
*
|
|
1284
|
-
* Fires a _Guild Member Remove_ gateway event.
|
|
1285
|
-
*
|
|
1286
|
-
* @see {@link https://discord.com/developers/docs/resources/guild#remove-guild-member}
|
|
1287
|
-
*/
|
|
1288
|
-
kick: (guildId: BigString, userId: BigString, reason?: string) => Promise<void>;
|
|
1289
|
-
/**
|
|
1290
|
-
* Initiates the process of pruning inactive members.
|
|
1291
|
-
*
|
|
1292
|
-
* @param guildId - The ID of the guild to prune the members of.
|
|
1293
|
-
* @param options - The parameters for the pruning of members.
|
|
1294
|
-
* @returns A number indicating how many members were pruned.
|
|
1295
|
-
*
|
|
1296
|
-
* @remarks
|
|
1297
|
-
* Requires the `KICK_MEMBERS` permission.
|
|
1298
|
-
*
|
|
1299
|
-
* ❗ Requests to this endpoint will time out for large guilds. To prevent this from happening, set the {@link BeginGuildPrune.computePruneCount} property of the {@link options} object parameter to `false`. This will begin the process of pruning, and immediately return `undefined`, rather than wait for the process to complete before returning the actual count of members that have been kicked.
|
|
1300
|
-
*
|
|
1301
|
-
* ⚠️ By default, this process will not remove members with a role. To include the members who have a _particular subset of roles_, specify the role(s) in the {@link BeginGuildPrune.includeRoles | includeRoles} property of the {@link options} object parameter.
|
|
1302
|
-
*
|
|
1303
|
-
* Fires a _Guild Member Remove_ gateway event for every member kicked.
|
|
1304
|
-
*
|
|
1305
|
-
* @see {@link https://discord.com/developers/docs/resources/guild#begin-guild-prune}
|
|
1306
|
-
*/
|
|
1307
|
-
prune: (guildId: BigString, options: BeginGuildPrune) => Promise<{
|
|
1308
|
-
pruned: number | null;
|
|
1309
|
-
}>;
|
|
1310
|
-
/**
|
|
1311
|
-
* Gets the list of members whose usernames or nicknames start with a provided string.
|
|
1312
|
-
*
|
|
1313
|
-
* @param guildId - The ID of the guild to search in.
|
|
1314
|
-
* @param query - The string to match usernames or nicknames against.
|
|
1315
|
-
* @param options - The parameters for searching through the members.
|
|
1316
|
-
* @returns A collection of {@link DiscordMember} objects assorted by user ID.
|
|
1317
|
-
*
|
|
1318
|
-
* @see {@link https://discord.com/developers/docs/resources/guild#search-guild-members}
|
|
1319
|
-
*/
|
|
1320
|
-
search: (guildId: BigString, query: string, options?: Omit<SearchMembers, 'query'>) => Promise<Camelize<DiscordMemberWithUser[]>>;
|
|
1321
|
-
/**
|
|
1322
|
-
* Unbans a user from a guild.
|
|
1323
|
-
*
|
|
1324
|
-
* @param guildId - The ID of the guild to unban the user in.
|
|
1325
|
-
* @param userId - The ID of the user to unban.
|
|
1326
|
-
*
|
|
1327
|
-
* @remarks
|
|
1328
|
-
* Requires the `BAN_MEMBERS` permission.
|
|
1329
|
-
*
|
|
1330
|
-
* Fires a _Guild Ban Remove_ gateway event.
|
|
1331
|
-
*
|
|
1332
|
-
* @see {@link https://discord.com/developers/docs/resources/guild#remove-guild-ban}
|
|
1333
|
-
*/
|
|
1334
|
-
unban: (guildId: BigString, userId: BigString) => Promise<void>;
|
|
1335
|
-
};
|
|
1336
|
-
/** Interaction related helper methods. */
|
|
1337
|
-
interactions: {
|
|
1338
|
-
/** Command related helper methods. */
|
|
1339
|
-
commands: {
|
|
1340
|
-
/** Methods for creating a command. */
|
|
1341
|
-
create: {
|
|
1342
|
-
/**
|
|
1343
|
-
* Creates an application command accessible globally; across different guilds and channels.
|
|
1344
|
-
*
|
|
1345
|
-
* @param command - The command to create.
|
|
1346
|
-
* @returns An instance of the created {@link ApplicationCommand}.
|
|
1347
|
-
*
|
|
1348
|
-
* @remarks
|
|
1349
|
-
* ⚠️ Creating a command with the same name as an existing command for your application will overwrite the old command.
|
|
1350
|
-
* ⚠️ Global commands once created are cached for periods of __an hour__, so changes made to existing commands will take an hour to surface.
|
|
1351
|
-
* ⚠️ You can only create up to 200 _new_ commands daily.
|
|
1352
|
-
*
|
|
1353
|
-
* @see {@link https://discord.com/developers/docs/interactions/application-commands#create-global-application-command}
|
|
1354
|
-
*/
|
|
1355
|
-
global: (command: CreateApplicationCommand) => Promise<Camelize<DiscordApplicationCommand>>;
|
|
1356
|
-
/**
|
|
1357
|
-
* Creates an application command only accessible in a specific guild.
|
|
1358
|
-
*
|
|
1359
|
-
* @param command - The command to create.
|
|
1360
|
-
* @param guildId - The ID of the guild to create the command for.
|
|
1361
|
-
* @returns An instance of the created {@link ApplicationCommand}.
|
|
1362
|
-
*
|
|
1363
|
-
* @remarks
|
|
1364
|
-
* ⚠️ Creating a command with the same name as an existing command for your application will overwrite the old command.
|
|
1365
|
-
* ⚠️ You can only create up to 200 _new_ commands daily.
|
|
1366
|
-
*
|
|
1367
|
-
* @see {@link https://discord.com/developers/docs/interactions/application-commands#create-guild-application-command}
|
|
1368
|
-
*/
|
|
1369
|
-
guild: (command: CreateApplicationCommand, guildId: BigString) => Promise<Camelize<DiscordApplicationCommand>>;
|
|
1370
|
-
};
|
|
1371
|
-
/** Methods for deleting a command. */
|
|
1372
|
-
delete: {
|
|
1373
|
-
/**
|
|
1374
|
-
* Deletes an application command registered globally.
|
|
1375
|
-
*
|
|
1376
|
-
* @param commandId - The ID of the command to delete.
|
|
1377
|
-
*
|
|
1378
|
-
* @see {@link https://discord.com/developers/docs/interactions/application-commands#delete-global-application-command}
|
|
1379
|
-
*/
|
|
1380
|
-
global: (commandId: BigString) => Promise<void>;
|
|
1381
|
-
/**
|
|
1382
|
-
* Deletes an application command registered in a guild.
|
|
1383
|
-
*
|
|
1384
|
-
* @param guildId - The ID of the guild to delete the command from.
|
|
1385
|
-
* @param commandId - The ID of the command to delete from the guild.
|
|
1386
|
-
*
|
|
1387
|
-
* @see {@link https://discord.com/developers/docs/interactions/application-commands#delete-guild-application-command}
|
|
1388
|
-
*/
|
|
1389
|
-
guild: (commandId: BigString, guildId: BigString) => Promise<void>;
|
|
1390
|
-
};
|
|
1391
|
-
/** Methods for editing a command. */
|
|
1392
|
-
edit: {
|
|
1393
|
-
/**
|
|
1394
|
-
* Edits a global application command.
|
|
1395
|
-
*
|
|
1396
|
-
* @param commandId - The ID of the command to edit.
|
|
1397
|
-
* @param options - The parameters for the edit of the command.
|
|
1398
|
-
* @returns An instance of the edited {@link ApplicationCommand}.
|
|
1399
|
-
*
|
|
1400
|
-
* @see {@link https://discord.com/developers/docs/interactions/application-commands#edit-global-application-command}
|
|
1401
|
-
*/
|
|
1402
|
-
global: (commandId: BigString, options: CreateApplicationCommand) => Promise<Camelize<DiscordApplicationCommand>>;
|
|
1403
|
-
/**
|
|
1404
|
-
* Edits an application command registered in a guild.
|
|
1405
|
-
*
|
|
1406
|
-
* @param guildId - The ID of the guild the command is registered in.
|
|
1407
|
-
* @param commandId - The ID of the command to edit.
|
|
1408
|
-
* @param options - The parameters for the edit of the command.
|
|
1409
|
-
* @returns An instance of the edited {@link ApplicationCommand}.
|
|
1410
|
-
*
|
|
1411
|
-
* @see {@link https://discord.com/developers/docs/interactions/application-commands#edit-guild-application-command}
|
|
1412
|
-
*/
|
|
1413
|
-
guild: (commandId: BigString, guildId: BigString, options: CreateApplicationCommand) => Promise<Camelize<DiscordApplicationCommand>>;
|
|
1414
|
-
/**
|
|
1415
|
-
* Edits the permissions for a guild application command.
|
|
1416
|
-
*
|
|
1417
|
-
* @param guildId - The ID of the guild the command is registered in.
|
|
1418
|
-
* @param commandId - The ID of the command to edit the permissions of.
|
|
1419
|
-
* @param bearerToken - The bearer token to use to make the request.
|
|
1420
|
-
* @param options - The parameters for the edit of the command permissions.
|
|
1421
|
-
* @returns An instance of the edited {@link ApplicationCommandPermission}.
|
|
1422
|
-
*
|
|
1423
|
-
* @remarks
|
|
1424
|
-
* The bearer token requires the `applications.commands.permissions.update` scope to be enabled, and to have access to the guild whose ID has been provided in the parameters.
|
|
1425
|
-
*
|
|
1426
|
-
* @see {@link https://discord.com/developers/docs/interactions/application-commands#edit-application-command-permissions}
|
|
1427
|
-
*/
|
|
1428
|
-
permissions: (guildId: BigString, commandId: BigString, bearerToken: string, options: ApplicationCommandPermissions[]) => Promise<Camelize<DiscordApplicationCommandPermissions>>;
|
|
1429
|
-
};
|
|
1430
|
-
/** Methods for getting a command. */
|
|
1431
|
-
get: {
|
|
1432
|
-
global: {
|
|
1433
|
-
/**
|
|
1434
|
-
* Gets a global application command by its ID.
|
|
1435
|
-
*
|
|
1436
|
-
* @param commandId - The ID of the command to get.
|
|
1437
|
-
* @returns An instance of {@link ApplicationCommand}.
|
|
1438
|
-
*
|
|
1439
|
-
* @see {@link https://discord.com/developers/docs/interactions/application-commands#get-global-application-command}
|
|
1440
|
-
*/
|
|
1441
|
-
one: (commandId: BigString) => Promise<Camelize<DiscordApplicationCommand>>;
|
|
1442
|
-
/**
|
|
1443
|
-
* Gets the list of your bot's global application commands.
|
|
1444
|
-
*
|
|
1445
|
-
* @returns A collection of {@link ApplicationCommand} objects assorted by command ID.
|
|
1446
|
-
*
|
|
1447
|
-
* @see {@link https://discord.com/developers/docs/interactions/application-commands#get-global-application-commands}
|
|
1448
|
-
*/
|
|
1449
|
-
all: () => Promise<Camelize<DiscordApplicationCommand[]>>;
|
|
1450
|
-
};
|
|
1451
|
-
guilds: {
|
|
1452
|
-
/**
|
|
1453
|
-
* Gets a guild application command by its ID.
|
|
1454
|
-
*
|
|
1455
|
-
* @param guildId - The ID of the guild the command is registered in.
|
|
1456
|
-
* @param commandId - The ID of the command to get.
|
|
1457
|
-
* @returns An instance of {@link ApplicationCommand}.
|
|
1458
|
-
*
|
|
1459
|
-
* @see {@link https://discord.com/developers/docs/interactions/application-commands#get-guild-application-command}
|
|
1460
|
-
*/
|
|
1461
|
-
one: (commandId: BigString, guildId: BigString) => Promise<Camelize<DiscordApplicationCommand>>;
|
|
1462
|
-
/**
|
|
1463
|
-
* Gets the list of application commands registered by your bot in a guild.
|
|
1464
|
-
*
|
|
1465
|
-
* @param guildId - The ID of the guild the commands are registered in.
|
|
1466
|
-
* @returns A collection of {@link ApplicationCommand} objects assorted by command ID.
|
|
1467
|
-
*
|
|
1468
|
-
* @see {@link https://discord.com/developers/docs/interactions/application-commands#get-global-application-commandss}
|
|
1469
|
-
*/
|
|
1470
|
-
all: (guildId: BigString) => Promise<Camelize<DiscordApplicationCommand[]>>;
|
|
1471
|
-
};
|
|
1472
|
-
/**
|
|
1473
|
-
* Gets the permissions of a guild application command.
|
|
1474
|
-
*
|
|
1475
|
-
* @param guildId - The ID of the guild the command is registered in.
|
|
1476
|
-
* @param commandId - The ID of the command to get the permissions of.
|
|
1477
|
-
* @returns An instance of {@link ApplicationCommandPermission}.
|
|
1478
|
-
*
|
|
1479
|
-
* @see {@link https://discord.com/developers/docs/interactions/application-commands#get-application-command-permissions}
|
|
1480
|
-
*/
|
|
1481
|
-
permission: (guildId: BigString, commandId: BigString) => Promise<Camelize<DiscordApplicationCommandPermissions>>;
|
|
1482
|
-
/**
|
|
1483
|
-
* Gets the permissions of all application commands registered in a guild by the ID of the guild.
|
|
1484
|
-
*
|
|
1485
|
-
* @param guildId - The ID of the guild to get the permissions objects of.
|
|
1486
|
-
* @returns A collection of {@link ApplicationCommandPermission} objects assorted by command ID.
|
|
1487
|
-
*
|
|
1488
|
-
* @see {@link https://discord.com/developers/docs/interactions/application-commands#get-guild-application-command-permissions}
|
|
1489
|
-
*/
|
|
1490
|
-
permissions: (guildId: BigString) => Promise<Camelize<DiscordApplicationCommandPermissions[]>>;
|
|
1491
|
-
};
|
|
1492
|
-
/** Methods for replacing existing commands in bulk. */
|
|
1493
|
-
replace: {
|
|
1494
|
-
/**
|
|
1495
|
-
* Re-registers the list of global application commands, overwriting the previous commands completely.
|
|
1496
|
-
*
|
|
1497
|
-
* @param commands - The list of commands to use to overwrite the previous list.
|
|
1498
|
-
* @returns A collection of {@link ApplicationCommand} objects assorted by command ID.
|
|
1499
|
-
*
|
|
1500
|
-
* @remarks
|
|
1501
|
-
* ❗ Commands that are not present in the `commands` array will be __deleted__.
|
|
1502
|
-
*
|
|
1503
|
-
* ⚠️ Commands that do not already exist will count towards the daily limit of _200_ new commands.
|
|
1504
|
-
*
|
|
1505
|
-
* @see {@link https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-global-application-commands}
|
|
1506
|
-
*/
|
|
1507
|
-
global: (commands: CreateApplicationCommand[]) => Promise<Camelize<DiscordApplicationCommand[]>>;
|
|
1508
|
-
/**
|
|
1509
|
-
* Re-registers the list of application commands registered in a guild, overwriting the previous commands completely.
|
|
1510
|
-
*
|
|
1511
|
-
* @param guildId - The ID of the guild whose list of commands to overwrite.
|
|
1512
|
-
* @param commands - The list of commands to use to overwrite the previous list.
|
|
1513
|
-
* @returns A collection of {@link ApplicationCommand} objects assorted by command ID.
|
|
1514
|
-
*
|
|
1515
|
-
* @remarks
|
|
1516
|
-
* ❗ Commands that are not present in the `commands` array will be __deleted__.
|
|
1517
|
-
*
|
|
1518
|
-
* ⚠️ Commands that do not already exist will count towards the daily limit of _200_ new commands.
|
|
1519
|
-
*
|
|
1520
|
-
* @see {@link https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-guild-application-commands}
|
|
1521
|
-
*/
|
|
1522
|
-
guild: (guildId: BigString, commands: CreateApplicationCommand[]) => Promise<Camelize<DiscordApplicationCommand[]>>;
|
|
1523
|
-
};
|
|
1524
|
-
};
|
|
1525
|
-
/** Response related helper methods. */
|
|
1526
|
-
responses: {
|
|
1527
|
-
/** Helper methods related to creating a response. */
|
|
1528
|
-
create: {
|
|
1529
|
-
/**
|
|
1530
|
-
* Sends a follow-up message to an interaction.
|
|
1531
|
-
*
|
|
1532
|
-
* @param token - The interaction token to use, provided in the original interaction.
|
|
1533
|
-
* @param options - The parameters for the creation of the message.
|
|
1534
|
-
* @returns An instance of the created {@link Message}.
|
|
1535
|
-
*
|
|
1536
|
-
* @remarks
|
|
1537
|
-
* ⚠️ Interaction tokens are only valid for _15 minutes_.
|
|
1538
|
-
*
|
|
1539
|
-
* By default, mentions are suppressed. To enable mentions, pass a mention object with the callback data.
|
|
1540
|
-
*
|
|
1541
|
-
* Unlike `sendMessage()`, this endpoint allows the bot user to act without:
|
|
1542
|
-
* - Needing to be able to see the contents of the channel that the message is in. (`READ_MESSAGES` permission.)
|
|
1543
|
-
* - Requiring the `MESSAGE_CONTENT` intent.
|
|
1544
|
-
*
|
|
1545
|
-
* Fires a _Message Create_ event.
|
|
1546
|
-
*
|
|
1547
|
-
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-followup-message}
|
|
1548
|
-
*/
|
|
1549
|
-
followup: (token: string, options: InteractionResponse) => Promise<Camelize<DiscordMessage>>;
|
|
1550
|
-
/**
|
|
1551
|
-
* Sends a response to an interaction.
|
|
1552
|
-
*
|
|
1553
|
-
* @param interactionId - The ID of the interaction to respond to.
|
|
1554
|
-
* @param token - The interaction token to use, provided in the original interaction.
|
|
1555
|
-
* @param options - The parameters for the creation of the message.
|
|
1556
|
-
* @returns An instance of the created {@link Message}.
|
|
1557
|
-
*
|
|
1558
|
-
* @remarks
|
|
1559
|
-
* ⚠️ Interaction tokens are only valid for _15 minutes_.
|
|
1560
|
-
*
|
|
1561
|
-
* By default, mentions are suppressed. To enable mentions, pass a mention object with the callback data.
|
|
1562
|
-
*
|
|
1563
|
-
* Unlike `sendMessage()`, this endpoint allows the bot user to act without:
|
|
1564
|
-
* - Needing to be able to see the contents of the channel that the message is in. (`READ_MESSAGES` permission.)
|
|
1565
|
-
* - Requiring the `MESSAGE_CONTENT` intent.
|
|
1566
|
-
*
|
|
1567
|
-
* Fires a _Message Create_ event.
|
|
1568
|
-
*
|
|
1569
|
-
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
|
|
1570
|
-
*/
|
|
1571
|
-
original: (interactionId: BigString, token: string, options: InteractionResponse) => Promise<void>;
|
|
1572
|
-
};
|
|
1573
|
-
/** Helper methods related to deleting a response. */
|
|
1574
|
-
delete: {
|
|
1575
|
-
/**
|
|
1576
|
-
* Deletes a follow-up message to an interaction.
|
|
1577
|
-
*
|
|
1578
|
-
* @param token - The interaction token to use, provided in the original interaction.
|
|
1579
|
-
* @param messageId - The ID of the message to delete.
|
|
1580
|
-
*
|
|
1581
|
-
* @remarks
|
|
1582
|
-
* Unlike `deleteMessage()`, this endpoint allows the bot user to act without needing to see the channel the message is in.
|
|
1583
|
-
*
|
|
1584
|
-
* Fires a _Message Delete_ event.
|
|
1585
|
-
*
|
|
1586
|
-
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#delete-followup-message}
|
|
1587
|
-
*/
|
|
1588
|
-
followup: (token: string, messageId: BigString) => Promise<void>;
|
|
1589
|
-
/**
|
|
1590
|
-
* Deletes the initial message response to an interaction.
|
|
1591
|
-
*
|
|
1592
|
-
* @param token - The interaction token to use, provided in the original interaction.
|
|
1593
|
-
*
|
|
1594
|
-
* @remarks
|
|
1595
|
-
* Unlike `deleteMessage()`, this endpoint allows the bot user to act without needing to see the channel the message is in.
|
|
1596
|
-
*
|
|
1597
|
-
* Fires a _Message Delete_ event.
|
|
1598
|
-
*
|
|
1599
|
-
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#delete-original-interaction-response}
|
|
1600
|
-
*/
|
|
1601
|
-
original: (token: string) => Promise<void>;
|
|
1602
|
-
};
|
|
1603
|
-
/** Helper methods related to editing a response. */
|
|
1604
|
-
edit: {
|
|
1605
|
-
/**
|
|
1606
|
-
* Edits a follow-up message to an interaction.
|
|
1607
|
-
*
|
|
1608
|
-
* @param token - The interaction token to use, provided in the original interaction.
|
|
1609
|
-
* @param messageId - The ID of the message to edit.
|
|
1610
|
-
* @param options - The parameters for the edit of the message.
|
|
1611
|
-
* @returns An instance of the edited {@link Message}.
|
|
1612
|
-
*
|
|
1613
|
-
* @remarks
|
|
1614
|
-
* Unlike `editMessage()`, this endpoint allows the bot user to act without needing to see the channel the message is in.
|
|
1615
|
-
*
|
|
1616
|
-
* Does not support ephemeral follow-up messages due to these being stateless.
|
|
1617
|
-
*
|
|
1618
|
-
* Fires a _Message Update_ event.
|
|
1619
|
-
*
|
|
1620
|
-
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#edit-followup-message}
|
|
1621
|
-
*/
|
|
1622
|
-
followup: (token: string, messageId: BigString, options: InteractionCallbackData) => Promise<Camelize<DiscordMessage>>;
|
|
1623
|
-
/**
|
|
1624
|
-
* Edits the initial message response to an interaction.
|
|
1625
|
-
*
|
|
1626
|
-
* @param token - The interaction token to use, provided in the original interaction.
|
|
1627
|
-
* @param options - The parameters for the edit of the response.
|
|
1628
|
-
* @returns An instance of the edited {@link Message}.
|
|
1629
|
-
*
|
|
1630
|
-
* @remarks
|
|
1631
|
-
* Unlike `editMessage()`, this endpoint allows the bot user to act without needing to see the channel the message is in.
|
|
1632
|
-
*
|
|
1633
|
-
* Does not support ephemeral follow-up messages due to these being stateless.
|
|
1634
|
-
*
|
|
1635
|
-
* Fires a _Message Update_ event.
|
|
1636
|
-
*
|
|
1637
|
-
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#edit-original-interaction-response}
|
|
1638
|
-
*/
|
|
1639
|
-
original: (token: string, options: InteractionCallbackData) => Promise<Camelize<DiscordMessage> | undefined>;
|
|
1640
|
-
};
|
|
1641
|
-
/** Helper methods related to getting a response. */
|
|
1642
|
-
get: {
|
|
1643
|
-
/**
|
|
1644
|
-
* Gets a follow-up message to an interaction by the ID of the message.
|
|
1645
|
-
*
|
|
1646
|
-
* @param token - The interaction token to use, provided in the original interaction.
|
|
1647
|
-
* @param messageId - The ID of the message to get.
|
|
1648
|
-
* @returns An instance of {@link Message}.
|
|
1649
|
-
*
|
|
1650
|
-
* @remarks
|
|
1651
|
-
* Unlike `getMessage()`, this endpoint allows the bot user to act without:
|
|
1652
|
-
* - Needing to be able to see the contents of the channel that the message is in. (`READ_MESSAGES` permission.)
|
|
1653
|
-
* - Requiring the `MESSAGE_CONTENT` intent.
|
|
1654
|
-
*
|
|
1655
|
-
* Does not support ephemeral follow-up messages due to these being stateless.
|
|
1656
|
-
*
|
|
1657
|
-
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#get-followup-message}
|
|
1658
|
-
*/
|
|
1659
|
-
followup: (token: string, messageId: BigString) => Promise<Camelize<DiscordMessage>>;
|
|
1660
|
-
/**
|
|
1661
|
-
* Gets the initial message response to an interaction.
|
|
1662
|
-
*
|
|
1663
|
-
* @param token - The interaction token to use, provided in the original interaction.
|
|
1664
|
-
* @returns An instance of {@link Message}.
|
|
1665
|
-
*
|
|
1666
|
-
* @remarks
|
|
1667
|
-
* Unlike `getMessage()`, this endpoint allows the bot user to act without:
|
|
1668
|
-
* - Needing to be able to see the contents of the channel that the message is in. (`READ_MESSAGES` permission.)
|
|
1669
|
-
* - Requiring the `MESSAGE_CONTENT` intent.
|
|
1670
|
-
*
|
|
1671
|
-
* Does not support ephemeral follow-up messages due to these being stateless.
|
|
1672
|
-
*
|
|
1673
|
-
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#get-original-interaction-response}
|
|
1674
|
-
*/
|
|
1675
|
-
original: (token: string) => Promise<Camelize<DiscordMessage>>;
|
|
1676
|
-
};
|
|
1677
|
-
};
|
|
1678
|
-
};
|
|
1679
|
-
};
|
|
1680
|
-
/** Webhook related helper methods. */
|
|
1681
|
-
webhooks: {
|
|
1682
|
-
/**
|
|
1683
|
-
* Creates a webhook.
|
|
1684
|
-
*
|
|
1685
|
-
* @param channelId - The ID of the channel to create the webhook in.
|
|
1686
|
-
* @param options - The parameters for the creation of the webhook.
|
|
1687
|
-
* @returns An instance of the created {@link DiscordWebhook}.
|
|
1688
|
-
*
|
|
1689
|
-
* @remarks
|
|
1690
|
-
* Requires the `MANAGE_WEBHOOKS` permission.
|
|
1691
|
-
*
|
|
1692
|
-
* ⚠️ The webhook name must not contain the string 'clyde' (case-insensitive).
|
|
1693
|
-
*
|
|
1694
|
-
* Fires a _Webhooks Update_ gateway event.
|
|
1695
|
-
*
|
|
1696
|
-
* @see {@link https://discord.com/developers/docs/resources/webhook#create-webhook}
|
|
1697
|
-
*/
|
|
1698
|
-
create: (channelId: BigString, options: CreateWebhook) => Promise<Camelize<DiscordWebhook>>;
|
|
1699
|
-
/** Methods to delete a webhook. */
|
|
1700
|
-
delete: {
|
|
1701
|
-
with: {
|
|
1702
|
-
/**
|
|
1703
|
-
* Deletes a webhook.
|
|
1704
|
-
*
|
|
1705
|
-
* @param id - The ID of the webhook to delete.
|
|
1706
|
-
*
|
|
1707
|
-
* @remarks
|
|
1708
|
-
* Requires the `MANAGE_WEBHOOKS` permission.
|
|
1709
|
-
*
|
|
1710
|
-
* Fires a _Webhooks Update_ gateway event.
|
|
1711
|
-
*
|
|
1712
|
-
* @see {@link https://discord.com/developers/docs/resources/webhook#delete-webhook}
|
|
1713
|
-
*/
|
|
1714
|
-
id: (id: BigString, reason?: string) => Promise<void>;
|
|
1715
|
-
/**
|
|
1716
|
-
* Deletes a webhook message using the webhook token, thereby bypassing the need for authentication + permissions.
|
|
1717
|
-
*
|
|
1718
|
-
* @param id - The ID of the webhook to delete the message belonging to.
|
|
1719
|
-
* @param token - The webhook token, used to delete the webhook.
|
|
1720
|
-
*
|
|
1721
|
-
* @remarks
|
|
1722
|
-
* Fires a _Message Delete_ gateway event.
|
|
1723
|
-
*
|
|
1724
|
-
* @see {@link https://discord.com/developers/docs/resources/webhook#delete-webhook-with-token}
|
|
1725
|
-
*/
|
|
1726
|
-
token: (id: BigString, token: string) => Promise<void>;
|
|
1727
|
-
};
|
|
1728
|
-
};
|
|
1729
|
-
/** Methods related to editing a webhook. */
|
|
1730
|
-
edit: {
|
|
1731
|
-
with: {
|
|
1732
|
-
/**
|
|
1733
|
-
* Edits a webhook.
|
|
1734
|
-
*
|
|
1735
|
-
* @param webhookId - The ID of the webhook to edit.
|
|
1736
|
-
* @returns An instance of the edited {@link DiscordWebhook}.
|
|
1737
|
-
*
|
|
1738
|
-
* @remarks
|
|
1739
|
-
* Requires the `MANAGE_WEBHOOKS` permission.
|
|
1740
|
-
*
|
|
1741
|
-
* Fires a _Webhooks Update_ gateway event.
|
|
1742
|
-
*
|
|
1743
|
-
* @see {@link https://discord.com/developers/docs/resources/webhook#edit-webhook}
|
|
1744
|
-
*/
|
|
1745
|
-
id: (webhookId: BigString, options: ModifyWebhook) => Promise<Camelize<DiscordWebhook>>;
|
|
1746
|
-
/**
|
|
1747
|
-
* Edits a webhook using the webhook token, thereby bypassing the need for authentication + permissions.
|
|
1748
|
-
*
|
|
1749
|
-
* @param webhookId - The ID of the webhook to edit.
|
|
1750
|
-
* @param token - The webhook token, used to edit the webhook.
|
|
1751
|
-
* @returns An instance of the edited {@link DiscordWebhook}.
|
|
1752
|
-
*
|
|
1753
|
-
* @remarks
|
|
1754
|
-
* Requires the `MANAGE_WEBHOOKS` permission.
|
|
1755
|
-
*
|
|
1756
|
-
* Fires a _Webhooks Update_ gateway event.
|
|
1757
|
-
*
|
|
1758
|
-
* @see {@link https://discord.com/developers/docs/resources/webhook#modify-webhook-with-token}
|
|
1759
|
-
*/
|
|
1760
|
-
token: (webhookId: BigString, token: string, options: Omit<ModifyWebhook, 'channelId'>) => Promise<Camelize<DiscordWebhook>>;
|
|
1761
|
-
};
|
|
1762
|
-
};
|
|
1763
|
-
/**
|
|
1764
|
-
* Executes a webhook, causing a message to be posted in the channel configured for the webhook.
|
|
1765
|
-
*
|
|
1766
|
-
* @param webhookId - The ID of the webhook to execute.
|
|
1767
|
-
* @param token - The webhook token, used to execute the webhook.
|
|
1768
|
-
* @param options - The parameters for the execution of the webhook.
|
|
1769
|
-
* @returns An instance of the created {@link DiscordMessage}, or `undefined` if the {@link ExecuteWebhook.wait | wait} property of the {@link options} object parameter is set to `false`.
|
|
1770
|
-
*
|
|
1771
|
-
* @remarks
|
|
1772
|
-
* If the webhook channel is a forum channel, you must provide a value for either `threadId` or `threadName`.
|
|
1773
|
-
*
|
|
1774
|
-
* @see {@link https://discord.com/developers/docs/resources/webhook#execute-webhook}
|
|
1775
|
-
*/
|
|
1776
|
-
execute: (webhookId: BigString, token: string, options: ExecuteWebhook) => Promise<Camelize<DiscordMessage> | undefined>;
|
|
1777
|
-
/** Methods related to getting webhooks. */
|
|
1778
|
-
get: {
|
|
1779
|
-
/**
|
|
1780
|
-
* Gets a list of webhooks for a channel.
|
|
1781
|
-
*
|
|
1782
|
-
* @param channelId - The ID of the channel which to get the webhooks of.
|
|
1783
|
-
* @returns A collection of {@link DiscordWebhook} objects assorted by webhook ID.
|
|
1784
|
-
*
|
|
1785
|
-
* @remarks
|
|
1786
|
-
* Requires the `MANAGE_WEBHOOKS` permission.
|
|
1787
|
-
*
|
|
1788
|
-
* @see {@link https://discord.com/developers/docs/resources/webhook#get-channel-webhooks}
|
|
1789
|
-
*/
|
|
1790
|
-
channel: (channelId: BigString) => Promise<Camelize<DiscordWebhook[]>>;
|
|
1791
|
-
/**
|
|
1792
|
-
* Gets the list of webhooks for a guild.
|
|
1793
|
-
*
|
|
1794
|
-
* @param guildId - The ID of the guild to get the list of webhooks for.
|
|
1795
|
-
* @returns A collection of {@link DiscordWebhook} objects assorted by webhook ID.
|
|
1796
|
-
*
|
|
1797
|
-
* @remarks
|
|
1798
|
-
* Requires the `MANAGE_WEBHOOKS` permission.
|
|
1799
|
-
*
|
|
1800
|
-
* @see {@link https://discord.com/developers/docs/resources/webhook#get-guild-webhooks}
|
|
1801
|
-
*/
|
|
1802
|
-
guild: (guildId: BigString) => Promise<Camelize<DiscordWebhook[]>>;
|
|
1803
|
-
/**
|
|
1804
|
-
* Gets a webhook message by its ID.
|
|
1805
|
-
*
|
|
1806
|
-
* @param webhookId - The ID of the webhook to get a message of.
|
|
1807
|
-
* @param token - The webhook token, used to get webhook messages.
|
|
1808
|
-
* @param messageId - the ID of the webhook message to get.
|
|
1809
|
-
* @param options - The parameters for the fetching of the message.
|
|
1810
|
-
* @returns An instance of {@link DiscordMessage}.
|
|
1811
|
-
*
|
|
1812
|
-
* @see {@link https://discord.com/developers/docs/resources/webhook#get-webhook-message}
|
|
1813
|
-
*/
|
|
1814
|
-
message: (webhookId: BigString, token: string, messageId: BigString, options?: GetWebhookMessageOptions) => Promise<Camelize<DiscordMessage>>;
|
|
1815
|
-
with: {
|
|
1816
|
-
/**
|
|
1817
|
-
* Gets a webhook by its ID.
|
|
1818
|
-
*
|
|
1819
|
-
* @param webhookId - The ID of the webhook to get.
|
|
1820
|
-
* @returns An instance of {@link DiscordWebhook}.
|
|
1821
|
-
*
|
|
1822
|
-
* @remarks
|
|
1823
|
-
* Requires the `MANAGE_WEBHOOKS` permission.
|
|
1824
|
-
*
|
|
1825
|
-
* @see {@link https://discord.com/developers/docs/resources/webhook#get-webhook}
|
|
1826
|
-
*/
|
|
1827
|
-
id: (webhookId: BigString) => Promise<Camelize<DiscordWebhook>>;
|
|
1828
|
-
/**
|
|
1829
|
-
* Gets a webhook using the webhook token, thereby bypassing the need for authentication + permissions.
|
|
1830
|
-
*
|
|
1831
|
-
* @param webhookId - The ID of the webhook to get.
|
|
1832
|
-
* @param token - The webhook token, used to get the webhook.
|
|
1833
|
-
* @returns An instance of {@link DiscordWebhook}.
|
|
1834
|
-
*
|
|
1835
|
-
* @see {@link https://discord.com/developers/docs/resources/webhook#get-webhook-with-token}
|
|
1836
|
-
*/
|
|
1837
|
-
token: (webhookId: BigString, token: string) => Promise<Camelize<DiscordWebhook>>;
|
|
1838
|
-
};
|
|
1839
|
-
};
|
|
1840
|
-
/** Methods related to message sent by a webhook. */
|
|
1841
|
-
messages: {
|
|
1842
|
-
/**
|
|
1843
|
-
* Deletes a webhook message.
|
|
1844
|
-
*
|
|
1845
|
-
* @param webhookId - The ID of the webhook to delete the message belonging to.
|
|
1846
|
-
* @param token - The webhook token, used to manage the webhook.
|
|
1847
|
-
* @param messageId - The ID of the message to delete.
|
|
1848
|
-
* @param options - The parameters for the deletion of the message.
|
|
1849
|
-
*
|
|
1850
|
-
* @remarks
|
|
1851
|
-
* Fires a _Message Delete_ gateway event.
|
|
1852
|
-
*
|
|
1853
|
-
* @see {@link https://discord.com/developers/docs/resources/webhook#delete-webhook}
|
|
1854
|
-
*/
|
|
1855
|
-
delete: (webhookId: BigString, token: string, messageId: BigString, options?: DeleteWebhookMessageOptions) => Promise<void>;
|
|
1856
|
-
/** Methods related to editing messages sent by a webhook. */
|
|
1857
|
-
edit: WebhookMessageEditor;
|
|
1858
|
-
};
|
|
1859
|
-
};
|
|
1860
|
-
/** User related helper methods. */
|
|
1861
|
-
users: {
|
|
1862
|
-
/**
|
|
1863
|
-
* Gets or creates a DM channel with a user.
|
|
1864
|
-
*
|
|
1865
|
-
* @param userId - The ID of the user to create the DM channel with.
|
|
1866
|
-
* @returns An instance of {@link DiscordChannel}.
|
|
1867
|
-
*
|
|
1868
|
-
* @see {@link https://discord.com/developers/docs/resources/user#create-dm}
|
|
1869
|
-
*/
|
|
1870
|
-
channel: (userId: BigString) => Promise<Camelize<DiscordChannel>>;
|
|
1871
|
-
};
|
|
1872
|
-
/**
|
|
1873
|
-
* Adds a member to a thread.
|
|
1874
|
-
*
|
|
1875
|
-
* @param channelId - The ID of the thread to add the member to.
|
|
1876
|
-
* @param userId - The user ID of the member to add to the thread.
|
|
1877
|
-
*
|
|
1878
|
-
* @remarks
|
|
1879
|
-
* Requires the ability to send messages in the thread.
|
|
1880
|
-
* Requires the thread not be archived.
|
|
1881
|
-
*
|
|
1882
|
-
* Fires a _Thread Members Update_ gateway event.
|
|
1883
|
-
*
|
|
1884
|
-
* @see {@link https://discord.com/developers/docs/resources/channel#add-thread-member}
|
|
1885
|
-
*/
|
|
1886
|
-
addThreadMember: (channelId: BigString, userId: BigString) => Promise<void>;
|
|
1887
|
-
/**
|
|
1888
|
-
* Creates an automod rule in a guild.
|
|
1889
|
-
*
|
|
1890
|
-
* @param guildId - The ID of the guild to create the rule in.
|
|
1891
|
-
* @param options - The parameters for the creation of the rule.
|
|
1892
|
-
* @returns An instance of the created {@link DiscordAutoModerationRule}.
|
|
1893
|
-
*
|
|
1894
|
-
* @remarks
|
|
1895
|
-
* Requires the `MANAGE_GUILD` permission.
|
|
1896
|
-
*
|
|
1897
|
-
* Fires an _Auto Moderation Rule Create_ gateway event.
|
|
1898
|
-
*
|
|
1899
|
-
* @see {@link https://discord.com/developers/docs/resources/auto-moderation#create-auto-moderation-rule}
|
|
1900
|
-
*/
|
|
1901
|
-
createAutomodRule: (guildId: BigString, options: CreateAutoModerationRuleOptions) => Promise<Camelize<DiscordAutoModerationRule>>;
|
|
1902
|
-
/**
|
|
1903
|
-
* Creates a channel within a guild.
|
|
1904
|
-
*
|
|
1905
|
-
* @param guildId - The ID of the guild to create the channel within.
|
|
1906
|
-
* @param options - The parameters for the creation of the channel.
|
|
1907
|
-
* @returns An instance of the created {@link DiscordChannel}.
|
|
1908
|
-
*
|
|
1909
|
-
* @remarks
|
|
1910
|
-
* Requires the `MANAGE_CHANNELS` permission.
|
|
1911
|
-
*
|
|
1912
|
-
* If setting permission overwrites, only the permissions the bot user has in the guild can be allowed or denied.
|
|
1913
|
-
*
|
|
1914
|
-
* Setting the `MANAGE_ROLES` permission is only possible for guild administrators.
|
|
1915
|
-
*
|
|
1916
|
-
* Fires a _Channel Create_ gateway event.
|
|
1917
|
-
*
|
|
1918
|
-
* @see {@link https://discord.com/developers/docs/resources/guild#create-guild-channel}
|
|
1919
|
-
*/
|
|
1920
|
-
createChannel: (guildId: BigString, options: CreateGuildChannel) => Promise<Camelize<DiscordChannel>>;
|
|
1921
|
-
/**
|
|
1922
|
-
* Creates an emoji in a guild.
|
|
1923
|
-
*
|
|
1924
|
-
* @param guildId - The ID of the guild in which to create the emoji.
|
|
1925
|
-
* @param options - The parameters for the creation of the emoji.
|
|
1926
|
-
* @returns An instance of the created {@link DiscordEmoji}.
|
|
1927
|
-
*
|
|
1928
|
-
* @remarks
|
|
1929
|
-
* Requires the `MANAGE_EMOJIS_AND_STICKERS` permission.
|
|
1930
|
-
*
|
|
1931
|
-
* Emojis have a maximum file size of 256 kilobits. Attempting to upload a larger emoji will cause the route to return 400 Bad Request.
|
|
1932
|
-
*
|
|
1933
|
-
* Fires a _Guild Emojis Update_ gateway event.
|
|
1934
|
-
*
|
|
1935
|
-
* @see {@link https://discord.com/developers/docs/resources/emoji#create-guild-emoji}
|
|
1936
|
-
*/
|
|
1937
|
-
createEmoji: (guildId: BigString, options: CreateGuildEmoji) => Promise<Camelize<DiscordEmoji>>;
|
|
1938
|
-
/**
|
|
1939
|
-
* Creates a new thread in a forum channel, and sends a message within the created thread.
|
|
1940
|
-
*
|
|
1941
|
-
* @param channelId - The ID of the forum channel to create the thread within.
|
|
1942
|
-
* @param options - The parameters for the creation of the thread.
|
|
1943
|
-
* @returns An instance of {@link DiscordChannel} with a nested {@link Message} object.
|
|
1944
|
-
*
|
|
1945
|
-
* @remarks
|
|
1946
|
-
* Requires the `CREATE_MESSAGES` permission.
|
|
1947
|
-
*
|
|
1948
|
-
* Fires a _Thread Create_ gateway event.
|
|
1949
|
-
* Fires a _Message Create_ gateway event.
|
|
1950
|
-
*
|
|
1951
|
-
* @see {@link https://discord.com/developers/docs/resources/channel#start-thread-in-forum-channel}
|
|
1952
|
-
*
|
|
1953
|
-
* @experimental
|
|
1954
|
-
*/
|
|
1955
|
-
createForumThread: (channelId: BigString, options: CreateForumPostWithMessage) => Promise<Camelize<DiscordChannel>>;
|
|
1956
|
-
/**
|
|
1957
|
-
* Creates an application command accessible globally; across different guilds and channels.
|
|
1958
|
-
*
|
|
1959
|
-
* @param command - The command to create.
|
|
1960
|
-
* @returns An instance of the created {@link ApplicationCommand}.
|
|
1961
|
-
*
|
|
1962
|
-
* @remarks
|
|
1963
|
-
* ⚠️ Creating a command with the same name as an existing command for your application will overwrite the old command.
|
|
1964
|
-
* ⚠️ Global commands once created are cached for periods of __an hour__, so changes made to existing commands will take an hour to surface.
|
|
1965
|
-
* ⚠️ You can only create up to 200 _new_ commands daily.
|
|
1966
|
-
*
|
|
1967
|
-
* @see {@link https://discord.com/developers/docs/interactions/application-commands#create-global-application-command}
|
|
1968
|
-
*/
|
|
1969
|
-
createGlobalApplicationCommand: (command: CreateApplicationCommand) => Promise<Camelize<DiscordApplicationCommand>>;
|
|
1970
|
-
/**
|
|
1971
|
-
* Creates an application command only accessible in a specific guild.
|
|
1972
|
-
*
|
|
1973
|
-
* @param command - The command to create.
|
|
1974
|
-
* @param guildId - The ID of the guild to create the command for.
|
|
1975
|
-
* @returns An instance of the created {@link ApplicationCommand}.
|
|
1976
|
-
*
|
|
1977
|
-
* @remarks
|
|
1978
|
-
* ⚠️ Creating a command with the same name as an existing command for your application will overwrite the old command.
|
|
1979
|
-
* ⚠️ You can only create up to 200 _new_ commands daily.
|
|
1980
|
-
*
|
|
1981
|
-
* @see {@link https://discord.com/developers/docs/interactions/application-commands#create-guild-application-command}
|
|
1982
|
-
*/
|
|
1983
|
-
createGuildApplicationCommand: (command: CreateApplicationCommand, guildId: BigString) => Promise<Camelize<DiscordApplicationCommand>>;
|
|
1984
|
-
/**
|
|
1985
|
-
* Creates a template from a guild.
|
|
1986
|
-
*
|
|
1987
|
-
* @param guildId - The ID of the guild to create the template from.
|
|
1988
|
-
* @param options - The parameters for the creation of the template.
|
|
1989
|
-
* @returns An instance of the created {@link Template}.
|
|
1990
|
-
*
|
|
1991
|
-
* @remarks
|
|
1992
|
-
* Requires the `MANAGE_GUILD` permission.
|
|
1993
|
-
*
|
|
1994
|
-
* Fires a _Guild Update_ gateway event.
|
|
1995
|
-
*
|
|
1996
|
-
* @see {@link https://discord.com/developers/docs/resources/guild-template#create-guild-template}
|
|
1997
|
-
*/
|
|
1998
|
-
createGuildTemplate: (guildId: BigString, options: CreateTemplate) => Promise<Camelize<DiscordTemplate>>;
|
|
1999
|
-
/**
|
|
2000
|
-
* Creates an invite to a channel in a guild.
|
|
2001
|
-
*
|
|
2002
|
-
* @param channelId - The ID of the channel to create the invite to.
|
|
2003
|
-
* @param options - The parameters for the creation of the invite.
|
|
2004
|
-
* @returns An instance of the created {@link DiscordInvite}.
|
|
2005
|
-
*
|
|
2006
|
-
* @remarks
|
|
2007
|
-
* Requires the `CREATE_INSTANT_INVITE` permission.
|
|
2008
|
-
*
|
|
2009
|
-
* Fires an _Invite Create_ gateway event.
|
|
2010
|
-
*
|
|
2011
|
-
* @privateRemarks
|
|
2012
|
-
* The request body is not optional, and an empty JSON object must be sent regardless of whether any fields are being transmitted.
|
|
2013
|
-
*
|
|
2014
|
-
* @see {@link https://discord.com/developers/docs/resources/channel#create-channel-invite}
|
|
2015
|
-
*/
|
|
2016
|
-
createInvite: (channelId: BigString, options?: CreateChannelInvite) => Promise<Camelize<DiscordInvite>>;
|
|
2017
|
-
/**
|
|
2018
|
-
* Creates a scheduled event in a guild.
|
|
2019
|
-
*
|
|
2020
|
-
* @param guildId - The ID of the guild to create the scheduled event in.
|
|
2021
|
-
* @param options - The parameters for the creation of the scheduled event.
|
|
2022
|
-
* @returns An instance of the created {@link ScheduledEvent}.
|
|
2023
|
-
*
|
|
2024
|
-
* @remarks
|
|
2025
|
-
* Requires the `MANAGE_EVENTS` permission.
|
|
2026
|
-
*
|
|
2027
|
-
* A guild can only have a maximum of 100 events with a status of {@link ScheduledEventStatus.Active} or {@link ScheduledEventStatus.Scheduled} (inclusive).
|
|
2028
|
-
*
|
|
2029
|
-
* Fires a _Guild Scheduled Event Create_ gateway event.
|
|
2030
|
-
*
|
|
2031
|
-
* @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#create-guild-scheduled-event}
|
|
2032
|
-
*/
|
|
2033
|
-
createScheduledEvent: (guildId: BigString, options: CreateScheduledEvent) => Promise<Camelize<DiscordScheduledEvent>>;
|
|
2034
|
-
/**
|
|
2035
|
-
* Creates a stage instance associated with a stage channel.
|
|
2036
|
-
*
|
|
2037
|
-
* @param options - The parameters for the creation of the stage instance.
|
|
2038
|
-
* @returns An instance of the created {@link DiscordStageInstance}.
|
|
2039
|
-
*
|
|
2040
|
-
* @remarks
|
|
2041
|
-
* Requires the user to be a moderator of the stage channel.
|
|
2042
|
-
*
|
|
2043
|
-
* Fires a _Stage Instance Create_ gateway event.
|
|
2044
|
-
*
|
|
2045
|
-
* @see {@link https://discord.com/developers/docs/resources/stage-instance#create-stage-instance}
|
|
2046
|
-
*/
|
|
2047
|
-
createStageInstance: (options: CreateStageInstance) => Promise<Camelize<DiscordStageInstance>>;
|
|
2048
|
-
/**
|
|
2049
|
-
* Creates a webhook.
|
|
2050
|
-
*
|
|
2051
|
-
* @param channelId - The ID of the channel to create the webhook in.
|
|
2052
|
-
* @param options - The parameters for the creation of the webhook.
|
|
2053
|
-
* @returns An instance of the created {@link DiscordWebhook}.
|
|
2054
|
-
*
|
|
2055
|
-
* @remarks
|
|
2056
|
-
* Requires the `MANAGE_WEBHOOKS` permission.
|
|
2057
|
-
*
|
|
2058
|
-
* ⚠️ The webhook name must not contain the string 'clyde' (case-insensitive).
|
|
2059
|
-
*
|
|
2060
|
-
* Fires a _Webhooks Update_ gateway event.
|
|
2061
|
-
*
|
|
2062
|
-
* @see {@link https://discord.com/developers/docs/resources/webhook#create-webhook}
|
|
2063
|
-
*/
|
|
2064
|
-
createWebhook: (channelId: BigString, options: CreateWebhook) => Promise<Camelize<DiscordWebhook>>;
|
|
2065
|
-
/**
|
|
2066
|
-
* Deletes an automod rule.
|
|
2067
|
-
*
|
|
2068
|
-
* @param guildId - The ID of the guild to delete the rule from.
|
|
2069
|
-
* @param ruleId - The ID of the automod rule to delete.
|
|
2070
|
-
*
|
|
2071
|
-
* @remarks
|
|
2072
|
-
* Requires the `MANAGE_GUILD` permission.
|
|
2073
|
-
*
|
|
2074
|
-
* Fires an _Auto Moderation Rule Delete_ gateway event.
|
|
2075
|
-
*
|
|
2076
|
-
* @see {@link https://discord.com/developers/docs/resources/auto-moderation#delete-auto-moderation-rule}
|
|
2077
|
-
*/
|
|
2078
|
-
deleteAutomodRule: (guildId: BigString, ruleId: BigString, reason?: string) => Promise<void>;
|
|
2079
|
-
/**
|
|
2080
|
-
* Deletes a channel from within a guild.
|
|
2081
|
-
*
|
|
2082
|
-
* @param channelId - The ID of the channel to delete.
|
|
2083
|
-
* @returns An instance of the deleted {@link Channel}.
|
|
2084
|
-
*
|
|
2085
|
-
* @remarks
|
|
2086
|
-
* For community guilds, the _Rules_, _Guidelines_ and _Community Update_ channels cannot be deleted.
|
|
2087
|
-
*
|
|
2088
|
-
* If the channel is a thread:
|
|
2089
|
-
* - Requires the `MANAGE_THREADS` permission.
|
|
2090
|
-
*
|
|
2091
|
-
* - Fires a _Thread Delete_ gateway event.
|
|
2092
|
-
*
|
|
2093
|
-
* Otherwise:
|
|
2094
|
-
* - Requires the `MANAGE_CHANNELS` permission.
|
|
2095
|
-
*
|
|
2096
|
-
* - ⚠️ Deleting a category channel does not delete its child channels.
|
|
2097
|
-
* Instead, they will have their `parent_id` property removed, and a `Channel Update` gateway event will fire for each of them.
|
|
2098
|
-
*
|
|
2099
|
-
* - Fires a _Channel Delete_ gateway event.
|
|
2100
|
-
*
|
|
2101
|
-
* @see {@link https://discord.com/developers/docs/resources/channel#deleteclose-channel}
|
|
2102
|
-
*/
|
|
2103
|
-
deleteChannel: (channelId: BigString, reason?: string) => Promise<void>;
|
|
2104
|
-
/**
|
|
2105
|
-
* Deletes a permission override for a user or role in a channel.
|
|
2106
|
-
*
|
|
2107
|
-
* @param channelId - The ID of the channel to delete the permission override of.
|
|
2108
|
-
* @param overwriteId - The ID of the permission override to delete.
|
|
2109
|
-
*
|
|
2110
|
-
* @remarks
|
|
2111
|
-
* Requires the `MANAGE_ROLES` permission.
|
|
2112
|
-
*
|
|
2113
|
-
* Fires a _Channel Update_ gateway event.
|
|
2114
|
-
*
|
|
2115
|
-
* @see {@link https://discord.com/developers/docs/resources/channel#delete-channel-permission}
|
|
2116
|
-
*/
|
|
2117
|
-
deleteChannelPermissionOverride: (channelId: BigString, overwriteId: BigString, reason?: string) => Promise<void>;
|
|
2118
|
-
/**
|
|
2119
|
-
* Deletes an emoji from a guild.
|
|
2120
|
-
*
|
|
2121
|
-
* @param guildId - The ID of the guild from which to delete the emoji.
|
|
2122
|
-
* @param id - The ID of the emoji to delete.
|
|
2123
|
-
*
|
|
2124
|
-
* @remarks
|
|
2125
|
-
* Requires the `MANAGE_EMOJIS_AND_STICKERS` permission.
|
|
2126
|
-
*
|
|
2127
|
-
* Fires a _Guild Emojis Update_ gateway event.
|
|
2128
|
-
*
|
|
2129
|
-
* @see {@link https://discord.com/developers/docs/resources/emoji#delete-guild-emoji}
|
|
2130
|
-
*/
|
|
2131
|
-
deleteEmoji: (guildId: BigString, id: BigString, reason?: string) => Promise<void>;
|
|
2132
|
-
/**
|
|
2133
|
-
* Deletes a follow-up message to an interaction.
|
|
2134
|
-
*
|
|
2135
|
-
* @param token - The interaction token to use, provided in the original interaction.
|
|
2136
|
-
* @param messageId - The ID of the message to delete.
|
|
2137
|
-
*
|
|
2138
|
-
* @remarks
|
|
2139
|
-
* Unlike `deleteMessage()`, this endpoint allows the bot user to act without needing to see the channel the message is in.
|
|
2140
|
-
*
|
|
2141
|
-
* Fires a _Message Delete_ event.
|
|
2142
|
-
*
|
|
2143
|
-
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#delete-followup-message}
|
|
2144
|
-
*/
|
|
2145
|
-
deleteFollowupMessage: (token: string, messageId: BigString) => Promise<void>;
|
|
2146
|
-
/**
|
|
2147
|
-
* Deletes an application command registered globally.
|
|
2148
|
-
*
|
|
2149
|
-
* @param commandId - The ID of the command to delete.
|
|
2150
|
-
*
|
|
2151
|
-
* @see {@link https://discord.com/developers/docs/interactions/application-commands#delete-global-application-command}
|
|
2152
|
-
*/
|
|
2153
|
-
deleteGlobalApplicationCommand: (commandId: BigString) => Promise<void>;
|
|
2154
|
-
/**
|
|
2155
|
-
* Deletes an application command registered in a guild.
|
|
2156
|
-
*
|
|
2157
|
-
* @param guildId - The ID of the guild to delete the command from.
|
|
2158
|
-
* @param commandId - The ID of the command to delete from the guild.
|
|
2159
|
-
*
|
|
2160
|
-
* @see {@link https://discord.com/developers/docs/interactions/application-commands#delete-guild-application-command}
|
|
2161
|
-
*/
|
|
2162
|
-
deleteGuildApplicationCommand: (commandId: BigString, guildId: BigString) => Promise<void>;
|
|
2163
|
-
/**
|
|
2164
|
-
* Deletes a template from a guild.
|
|
2165
|
-
*
|
|
2166
|
-
* @param guildId - The ID of the guild to delete the template from.
|
|
2167
|
-
* @param templateCode - The code of the template to delete.
|
|
2168
|
-
*
|
|
2169
|
-
* @remarks
|
|
2170
|
-
* Requires the `MANAGE_GUILD` permission.
|
|
2171
|
-
*
|
|
2172
|
-
* Fires a _Guild Update_ gateway event.
|
|
2173
|
-
*
|
|
2174
|
-
* @see {@link https://discord.com/developers/docs/resources/guild-template#delete-guild-template}
|
|
2175
|
-
*/
|
|
2176
|
-
deleteGuildTemplate: (guildId: BigString, templateCode: string) => Promise<void>;
|
|
2177
|
-
/**
|
|
2178
|
-
* Deletes an integration attached to a guild.
|
|
2179
|
-
*
|
|
2180
|
-
* @param guildId - The ID of the guild from which to delete the integration.
|
|
2181
|
-
* @param integrationId - The ID of the integration to delete from the guild.
|
|
2182
|
-
*
|
|
2183
|
-
* @remarks
|
|
2184
|
-
* Requires the `MANAGE_GUILD` permission.
|
|
2185
|
-
*
|
|
2186
|
-
* Deletes all webhooks associated with the integration, and kicks the associated bot if there is one.
|
|
2187
|
-
*
|
|
2188
|
-
* Fires a _Guild Integrations Update_ gateway event.
|
|
2189
|
-
* Fires a _Integration Delete_ gateway event.
|
|
2190
|
-
*
|
|
2191
|
-
* @see {@link https://discord.com/developers/docs/resources/guild#delete-guild-integration}
|
|
2192
|
-
*/
|
|
2193
|
-
deleteIntegration: (guildId: BigString, integrationId: BigString) => Promise<void>;
|
|
2194
|
-
/**
|
|
2195
|
-
* Deletes an invite to a channel.
|
|
2196
|
-
*
|
|
2197
|
-
* @param inviteCode - The invite code of the invite to delete.
|
|
2198
|
-
*
|
|
2199
|
-
* @remarks
|
|
2200
|
-
* Requires the `MANAGE_CHANNELS` permission.
|
|
2201
|
-
*
|
|
2202
|
-
* Fires an _Invite Delete_ gateway event.
|
|
2203
|
-
*
|
|
2204
|
-
* @see {@link https://discord.com/developers/docs/resources/channel#delete-channel-invite}
|
|
2205
|
-
*/
|
|
2206
|
-
deleteInvite: (inviteCode: string, reason?: string) => Promise<void>;
|
|
2207
|
-
/**
|
|
2208
|
-
* Deletes a message from a channel.
|
|
2209
|
-
*
|
|
2210
|
-
* @param channelId - The ID of the channel to delete the message from.
|
|
2211
|
-
* @param messageId - The ID of the message to delete from the channel.
|
|
2212
|
-
*
|
|
2213
|
-
* @remarks
|
|
2214
|
-
* If not deleting own message:
|
|
2215
|
-
* - Requires the `MANAGE_MESSAGES` permission.
|
|
2216
|
-
*
|
|
2217
|
-
* Fires a _Message Delete_ gateway event.
|
|
2218
|
-
*
|
|
2219
|
-
* @see {@link https://discord.com/developers/docs/resources/channel#delete-message}
|
|
2220
|
-
*/
|
|
2221
|
-
deleteMessage: (channelId: BigString, messageId: BigString, reason?: string) => Promise<void>;
|
|
2222
|
-
/**
|
|
2223
|
-
* Deletes the initial message response to an interaction.
|
|
2224
|
-
*
|
|
2225
|
-
* @param token - The interaction token to use, provided in the original interaction.
|
|
2226
|
-
*
|
|
2227
|
-
* @remarks
|
|
2228
|
-
* Unlike `deleteMessage()`, this endpoint allows the bot user to act without needing to see the channel the message is in.
|
|
2229
|
-
*
|
|
2230
|
-
* Fires a _Message Delete_ event.
|
|
2231
|
-
*
|
|
2232
|
-
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#delete-original-interaction-response}
|
|
2233
|
-
*/
|
|
2234
|
-
deleteOriginalInteractionResponse: (token: string) => Promise<void>;
|
|
2235
|
-
/**
|
|
2236
|
-
* Deletes a scheduled event from a guild.
|
|
2237
|
-
*
|
|
2238
|
-
* @param guildId - The ID of the guild to delete the scheduled event from.
|
|
2239
|
-
* @param eventId - The ID of the scheduled event to delete.
|
|
2240
|
-
*
|
|
2241
|
-
* @remarks
|
|
2242
|
-
* Requires the `MANAGE_EVENTS` permission.
|
|
2243
|
-
*
|
|
2244
|
-
* Fires a _Guild Scheduled Event Delete_ gateway event.
|
|
2245
|
-
*
|
|
2246
|
-
* @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#delete-guild-scheduled-event}
|
|
2247
|
-
*/
|
|
2248
|
-
deleteScheduledEvent: (guildId: BigString, eventId: BigString) => Promise<void>;
|
|
2249
|
-
/**
|
|
2250
|
-
* Deletes the stage instance associated with a stage channel, if one exists.
|
|
2251
|
-
*
|
|
2252
|
-
* @param channelId - The ID of the stage channel the stage instance is associated with.
|
|
2253
|
-
*
|
|
2254
|
-
* @remarks
|
|
2255
|
-
* Requires the user to be a moderator of the stage channel.
|
|
2256
|
-
*
|
|
2257
|
-
* Fires a _Stage Instance Delete_ gateway event.
|
|
2258
|
-
*
|
|
2259
|
-
* @see {@link https://discord.com/developers/docs/resources/stage-instance#delete-stage-instance}
|
|
2260
|
-
*/
|
|
2261
|
-
deleteStageInstance: (channelId: BigString, reason?: string) => Promise<void>;
|
|
2262
|
-
/**
|
|
2263
|
-
* Deletes a webhook.
|
|
2264
|
-
*
|
|
2265
|
-
* @param webhookId - The ID of the webhook to delete.
|
|
2266
|
-
*
|
|
2267
|
-
* @remarks
|
|
2268
|
-
* Requires the `MANAGE_WEBHOOKS` permission.
|
|
2269
|
-
*
|
|
2270
|
-
* Fires a _Webhooks Update_ gateway event.
|
|
2271
|
-
*
|
|
2272
|
-
* @see {@link https://discord.com/developers/docs/resources/webhook#delete-webhook}
|
|
2273
|
-
*/
|
|
2274
|
-
deleteWebhook: (webhookId: BigString, reason?: string) => Promise<void>;
|
|
2275
|
-
/**
|
|
2276
|
-
* Deletes a webhook message.
|
|
2277
|
-
*
|
|
2278
|
-
* @param webhookId - The ID of the webhook to delete the message belonging to.
|
|
2279
|
-
* @param token - The webhook token, used to manage the webhook.
|
|
2280
|
-
* @param messageId - The ID of the message to delete.
|
|
2281
|
-
* @param options - The parameters for the deletion of the message.
|
|
2282
|
-
*
|
|
2283
|
-
* @remarks
|
|
2284
|
-
* Fires a _Message Delete_ gateway event.
|
|
2285
|
-
*
|
|
2286
|
-
* @see {@link https://discord.com/developers/docs/resources/webhook#delete-webhook}
|
|
2287
|
-
*/
|
|
2288
|
-
deleteWebhookMessage: (webhookId: BigString, token: string, messageId: BigString, options?: DeleteWebhookMessageOptions) => Promise<void>;
|
|
2289
|
-
/**
|
|
2290
|
-
* Deletes a webhook message using the webhook token, thereby bypassing the need for authentication + permissions.
|
|
2291
|
-
*
|
|
2292
|
-
* @param webhookId - The ID of the webhook to delete the message belonging to.
|
|
2293
|
-
* @param token - The webhook token, used to delete the webhook.
|
|
2294
|
-
*
|
|
2295
|
-
* @remarks
|
|
2296
|
-
* Fires a _Message Delete_ gateway event.
|
|
2297
|
-
*
|
|
2298
|
-
* @see {@link https://discord.com/developers/docs/resources/webhook#delete-webhook-with-token}
|
|
2299
|
-
*/
|
|
2300
|
-
deleteWebhookWithToken: (webhookId: BigString, token: string) => Promise<void>;
|
|
2301
|
-
/**
|
|
2302
|
-
* Edits the permissions for a guild application command.
|
|
2303
|
-
*
|
|
2304
|
-
* @param guildId - The ID of the guild the command is registered in.
|
|
2305
|
-
* @param commandId - The ID of the command to edit the permissions of.
|
|
2306
|
-
* @param bearerToken - The bearer token to use to make the request.
|
|
2307
|
-
* @param options - The parameters for the edit of the command permissions.
|
|
2308
|
-
* @returns An instance of the edited {@link ApplicationCommandPermission}.
|
|
2309
|
-
*
|
|
2310
|
-
* @remarks
|
|
2311
|
-
* The bearer token requires the `applications.commands.permissions.update` scope to be enabled, and to have access to the guild whose ID has been provided in the parameters.
|
|
2312
|
-
*
|
|
2313
|
-
* @see {@link https://discord.com/developers/docs/interactions/application-commands#edit-application-command-permissions}
|
|
2314
|
-
*/
|
|
2315
|
-
editApplicationCommandPermissions: (guildId: BigString, commandId: BigString, bearerToken: string, options: ApplicationCommandPermissions[]) => Promise<Camelize<DiscordApplicationCommandPermissions>>;
|
|
2316
|
-
/**
|
|
2317
|
-
* Edits an automod rule.
|
|
2318
|
-
*
|
|
2319
|
-
* @param guildId - The ID of the guild to edit the rule in.
|
|
2320
|
-
* @param ruleId - The ID of the rule to edit.
|
|
2321
|
-
* @param options - The parameters for the edit of the rule.
|
|
2322
|
-
* @returns An instance of the edited {@link DiscordAutoModerationRule}.
|
|
2323
|
-
*
|
|
2324
|
-
* @remarks
|
|
2325
|
-
* Requires the `MANAGE_GUILD` permission.
|
|
2326
|
-
*
|
|
2327
|
-
* Fires an _Auto Moderation Rule Update_ gateway event.
|
|
2328
|
-
*
|
|
2329
|
-
* @see {@link https://discord.com/developers/docs/resources/auto-moderation#modify-auto-moderation-rule}
|
|
2330
|
-
*/
|
|
2331
|
-
editAutomodRule: (guildId: BigString, ruleId: BigString, options: Partial<EditAutoModerationRuleOptions>) => Promise<Camelize<DiscordAutoModerationRule>>;
|
|
2332
|
-
/**
|
|
2333
|
-
* Modifies the bot's username or avatar.
|
|
2334
|
-
* NOTE: username: if changed may cause the bot's discriminator to be randomized.
|
|
2335
|
-
*/
|
|
2336
|
-
editBotProfile: (options: {
|
|
2337
|
-
username?: string;
|
|
2338
|
-
botAvatarURL?: string | null;
|
|
2339
|
-
}) => Promise<Camelize<DiscordUser>>;
|
|
2340
|
-
/**
|
|
2341
|
-
* Edits a channel's settings.
|
|
2342
|
-
*
|
|
2343
|
-
* @param channelId - The ID of the channel to edit.
|
|
2344
|
-
* @param options - The parameters for the edit of the channel.
|
|
2345
|
-
* @returns An instance of the edited {@link DiscordChannel}.
|
|
2346
|
-
*
|
|
2347
|
-
* @remarks
|
|
2348
|
-
* If editing a channel of type {@link ChannelTypes.GroupDm}:
|
|
2349
|
-
* - Fires a _Channel Update_ gateway event.
|
|
2350
|
-
*
|
|
2351
|
-
* If editing a thread channel:
|
|
2352
|
-
* - Requires the `MANAGE_THREADS` permission __unless__ if setting the `archived` property to `false` when the `locked` property is also `false`, in which case only the `SEND_MESSAGES` permission is required.
|
|
2353
|
-
*
|
|
2354
|
-
* - Fires a _Thread Update_ gateway event.
|
|
2355
|
-
*
|
|
2356
|
-
* If editing a guild channel:
|
|
2357
|
-
* - Requires the `MANAGE_CHANNELS` permission.
|
|
2358
|
-
*
|
|
2359
|
-
* - If modifying permission overrides:
|
|
2360
|
-
* - Requires the `MANAGE_ROLES` permission.
|
|
2361
|
-
*
|
|
2362
|
-
* - Only permissions the bot user has in the guild or parent channel can be allowed/denied __unless__ the bot user has a `MANAGE_ROLES` permission override in the channel.
|
|
2363
|
-
*
|
|
2364
|
-
* - If modifying a channel of type {@link ChannelTypes.GuildCategory}:
|
|
2365
|
-
* - Fires a _Channel Update_ gateway event for each child channel impacted in this change.
|
|
2366
|
-
* - Otherwise:
|
|
2367
|
-
* - Fires a _Channel Update_ gateway event.
|
|
2368
|
-
*/
|
|
2369
|
-
editChannel: (channelId: BigString, options: ModifyChannel) => Promise<Camelize<DiscordChannel>>;
|
|
2370
|
-
/**
|
|
2371
|
-
* Edits the permission overrides for a user or role in a channel.
|
|
2372
|
-
*
|
|
2373
|
-
* @param channelId - The ID of the channel to edit the permission overrides of.
|
|
2374
|
-
* @param options - The permission override.
|
|
2375
|
-
*
|
|
2376
|
-
* @remarks
|
|
2377
|
-
* Requires the `MANAGE_ROLES` permission.
|
|
2378
|
-
*
|
|
2379
|
-
* Only permissions the bot user has in the guild or parent channel can be allowed/denied __unless__ the bot user has a `MANAGE_ROLES` permission override in the channel.
|
|
2380
|
-
*
|
|
2381
|
-
* Fires a _Channel Update_ gateway event.
|
|
2382
|
-
*
|
|
2383
|
-
* @see {@link https://discord.com/developers/docs/resources/channel#edit-channel-permissions}
|
|
2384
|
-
*/
|
|
2385
|
-
editChannelPermissionOverrides: (channelId: BigString, options: EditChannelPermissionOverridesOptions) => Promise<void>;
|
|
2386
|
-
/**
|
|
2387
|
-
* Edits the positions of a set of channels in a guild.
|
|
2388
|
-
*
|
|
2389
|
-
* @param guildId - The ID of the guild in which to edit the positions of the channels.
|
|
2390
|
-
* @param channelPositions - A set of objects defining the updated positions of the channels.
|
|
2391
|
-
*
|
|
2392
|
-
* @remarks
|
|
2393
|
-
* Requires the `MANAGE_CHANNELS` permission.
|
|
2394
|
-
*
|
|
2395
|
-
* Fires a _Channel Update_ gateway event for every channel impacted in this change.
|
|
2396
|
-
*
|
|
2397
|
-
* @see {@link https://discord.com/developers/docs/resources/guild#modify-guild-channel-positions}
|
|
2398
|
-
*/
|
|
2399
|
-
editChannelPositions: (guildId: BigString, channelPositions: ModifyGuildChannelPositions[]) => Promise<void>;
|
|
2400
|
-
/**
|
|
2401
|
-
* Edits an emoji.
|
|
2402
|
-
*
|
|
2403
|
-
* @param guildId - The ID of the guild in which to edit the emoji.
|
|
2404
|
-
* @param id - The ID of the emoji to edit.
|
|
2405
|
-
* @param options - The parameters for the edit of the emoji.
|
|
2406
|
-
* @returns An instance of the updated {@link DiscordEmoji}.
|
|
2407
|
-
*
|
|
2408
|
-
* @remarks
|
|
2409
|
-
* Requires the `MANAGE_EMOJIS_AND_STICKERS` permission.
|
|
2410
|
-
*
|
|
2411
|
-
* Fires a `Guild Emojis Update` gateway event.
|
|
2412
|
-
*
|
|
2413
|
-
* @see {@link https://discord.com/developers/docs/resources/emoji#modify-guild-emoji}
|
|
2414
|
-
*/
|
|
2415
|
-
editEmoji: (guildId: BigString, id: BigString, options: ModifyGuildEmoji) => Promise<Camelize<DiscordEmoji>>;
|
|
2416
|
-
/**
|
|
2417
|
-
* Edits a follow-up message to an interaction.
|
|
2418
|
-
*
|
|
2419
|
-
* @param token - The interaction token to use, provided in the original interaction.
|
|
2420
|
-
* @param messageId - The ID of the message to edit.
|
|
2421
|
-
* @param options - The parameters for the edit of the message.
|
|
2422
|
-
* @returns An instance of the edited {@link Message}.
|
|
2423
|
-
*
|
|
2424
|
-
* @remarks
|
|
2425
|
-
* Unlike `editMessage()`, this endpoint allows the bot user to act without needing to see the channel the message is in.
|
|
2426
|
-
*
|
|
2427
|
-
* Does not support ephemeral follow-up messages due to these being stateless.
|
|
2428
|
-
*
|
|
2429
|
-
* Fires a _Message Update_ event.
|
|
2430
|
-
*
|
|
2431
|
-
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#edit-followup-message}
|
|
2432
|
-
*/
|
|
2433
|
-
editFollowupMessage: (token: string, messageId: BigString, options: InteractionCallbackData) => Promise<Camelize<DiscordMessage>>;
|
|
2434
|
-
/**
|
|
2435
|
-
* Edits a global application command.
|
|
2436
|
-
*
|
|
2437
|
-
* @param commandId - The ID of the command to edit.
|
|
2438
|
-
* @param options - The parameters for the edit of the command.
|
|
2439
|
-
* @returns An instance of the edited {@link ApplicationCommand}.
|
|
2440
|
-
*
|
|
2441
|
-
* @see {@link https://discord.com/developers/docs/interactions/application-commands#edit-global-application-command}
|
|
2442
|
-
*/
|
|
2443
|
-
editGlobalApplicationCommand: (commandId: BigString, options: CreateApplicationCommand) => Promise<Camelize<DiscordApplicationCommand>>;
|
|
2444
|
-
/**
|
|
2445
|
-
* Edits an application command registered in a guild.
|
|
2446
|
-
*
|
|
2447
|
-
* @param guildId - The ID of the guild the command is registered in.
|
|
2448
|
-
* @param commandId - The ID of the command to edit.
|
|
2449
|
-
* @param options - The parameters for the edit of the command.
|
|
2450
|
-
* @returns An instance of the edited {@link ApplicationCommand}.
|
|
2451
|
-
*
|
|
2452
|
-
* @see {@link https://discord.com/developers/docs/interactions/application-commands#edit-guild-application-command}
|
|
2453
|
-
*/
|
|
2454
|
-
editGuildApplicationCommand: (commandId: BigString, guildId: BigString, options: CreateApplicationCommand) => Promise<Camelize<DiscordApplicationCommand>>;
|
|
2455
|
-
/**
|
|
2456
|
-
* Edits a template's settings.
|
|
2457
|
-
*
|
|
2458
|
-
* @param guildId - The ID of the guild to edit a template of.
|
|
2459
|
-
* @param templateCode - The code of the template to edit.
|
|
2460
|
-
* @param options - The parameters for the edit of the template.
|
|
2461
|
-
* @returns An instance of the edited {@link Template}.
|
|
2462
|
-
*
|
|
2463
|
-
* @remarks
|
|
2464
|
-
* Requires the `MANAGE_GUILD` permission.
|
|
2465
|
-
*
|
|
2466
|
-
* Fires a _Guild Update_ gateway event.
|
|
2467
|
-
*
|
|
2468
|
-
* @see {@link https://discord.com/developers/docs/resources/guild-template#modify-guild-template}
|
|
2469
|
-
*/
|
|
2470
|
-
editGuildTemplate: (guildId: BigString, templateCode: string, options: ModifyGuildTemplate) => Promise<Camelize<DiscordTemplate>>;
|
|
2471
|
-
/**
|
|
2472
|
-
* Edits a message.
|
|
2473
|
-
*
|
|
2474
|
-
* @param channelId - The ID of the channel to edit the message in.
|
|
2475
|
-
* @param messageId - The IDs of the message to edit.
|
|
2476
|
-
* @param options - The parameters for the edit of the message.
|
|
2477
|
-
* @returns An instance of the edited {@link Message}.
|
|
2478
|
-
*
|
|
2479
|
-
* @remarks
|
|
2480
|
-
* If editing another user's message:
|
|
2481
|
-
* - Requires the `MANAGE_MESSAGES` permission.
|
|
2482
|
-
* - Only the {@link EditMessage.flags | flags} property of the {@link options} object parameter can be edited.
|
|
2483
|
-
*
|
|
2484
|
-
* Fires a _Message Update_ gateway event.
|
|
2485
|
-
*
|
|
2486
|
-
* @see {@link https://discord.com/developers/docs/resources/channel#edit-message}
|
|
2487
|
-
*/
|
|
2488
|
-
editMessage: (channelId: BigString, messageId: BigString, options: EditMessage) => Promise<Camelize<DiscordMessage>>;
|
|
2489
|
-
/**
|
|
2490
|
-
* Edits the initial message response to an interaction.
|
|
2491
|
-
*
|
|
2492
|
-
* @param token - The interaction token to use, provided in the original interaction.
|
|
2493
|
-
* @param options - The parameters for the edit of the response.
|
|
2494
|
-
* @returns An instance of the edited {@link Message}.
|
|
2495
|
-
*
|
|
2496
|
-
* @remarks
|
|
2497
|
-
* Unlike `editMessage()`, this endpoint allows the bot user to act without needing to see the channel the message is in.
|
|
2498
|
-
*
|
|
2499
|
-
* Does not support ephemeral follow-up messages due to these being stateless.
|
|
2500
|
-
*
|
|
2501
|
-
* Fires a _Message Update_ event.
|
|
2502
|
-
*
|
|
2503
|
-
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#edit-original-interaction-response}
|
|
2504
|
-
*/
|
|
2505
|
-
editOriginalInteractionResponse: (token: string, options: InteractionCallbackData) => Promise<Camelize<DiscordMessage> | undefined>;
|
|
2506
|
-
/**
|
|
2507
|
-
* Edits the original webhook message.
|
|
2508
|
-
*
|
|
2509
|
-
* @param webhookId - The ID of the webhook to edit the original message of.
|
|
2510
|
-
* @param token - The webhook token, used to edit the message.
|
|
2511
|
-
* @param options - The parameters for the edit of the message.
|
|
2512
|
-
* @returns An instance of the edited {@link DiscordMessage}.
|
|
2513
|
-
*
|
|
2514
|
-
* @remarks
|
|
2515
|
-
* Fires a _Message Update_ gateway event.
|
|
2516
|
-
*
|
|
2517
|
-
* @see {@link https://discord.com/developers/docs/resources/webhook#edit-webhook-message}
|
|
2518
|
-
*/
|
|
2519
|
-
editOriginalWebhookMessage: (webhookId: BigString, token: string, options: InteractionCallbackData & {
|
|
2520
|
-
threadId?: BigString;
|
|
2521
|
-
}) => Promise<Camelize<DiscordMessage>>;
|
|
2522
|
-
/**
|
|
2523
|
-
* Edits a scheduled event.
|
|
2524
|
-
*
|
|
2525
|
-
* @param guildId - The ID of the guild to edit the scheduled event in.
|
|
2526
|
-
* @param eventId - The ID of the scheduled event to edit.
|
|
2527
|
-
* @returns An instance of the edited {@link ScheduledEvent}.
|
|
2528
|
-
*
|
|
2529
|
-
* @remarks
|
|
2530
|
-
* Requires the `MANAGE_EVENTS` permission.
|
|
2531
|
-
*
|
|
2532
|
-
* To start or end an event, modify the event's `status` property.
|
|
2533
|
-
*
|
|
2534
|
-
* The `entity_metadata` property is discarded for events whose `entity_type` is not {@link ScheduledEventEntityType.External}.
|
|
2535
|
-
*
|
|
2536
|
-
* Fires a _Guild Scheduled Event Update_ gateway event.
|
|
2537
|
-
*
|
|
2538
|
-
* @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event}
|
|
2539
|
-
*/
|
|
2540
|
-
editScheduledEvent: (guildId: BigString, eventId: BigString, options: Partial<EditScheduledEvent>) => Promise<Camelize<DiscordScheduledEvent>>;
|
|
2541
|
-
/**
|
|
2542
|
-
* Edits a stage instance.
|
|
2543
|
-
*
|
|
2544
|
-
* @param channelId - The ID of the stage channel the stage instance is associated with.
|
|
2545
|
-
* @returns An instance of the updated {@link DiscordStageInstance}.
|
|
2546
|
-
*
|
|
2547
|
-
* @remarks
|
|
2548
|
-
* Requires the user to be a moderator of the stage channel.
|
|
2549
|
-
*
|
|
2550
|
-
* Fires a _Stage Instance Update_ event.
|
|
2551
|
-
*
|
|
2552
|
-
* @see {@link https://discord.com/developers/docs/resources/stage-instance#modify-stage-instance}
|
|
2553
|
-
*/
|
|
2554
|
-
editStageInstance: (channelId: BigString, data: EditStageInstanceOptions) => Promise<Camelize<DiscordStageInstance>>;
|
|
2555
|
-
/**
|
|
2556
|
-
* Edits a webhook.
|
|
2557
|
-
*
|
|
2558
|
-
* @param webhookId - The ID of the webhook to edit.
|
|
2559
|
-
* @returns An instance of the edited {@link DiscordWebhook}.
|
|
2560
|
-
*
|
|
2561
|
-
* @remarks
|
|
2562
|
-
* Requires the `MANAGE_WEBHOOKS` permission.
|
|
2563
|
-
*
|
|
2564
|
-
* Fires a _Webhooks Update_ gateway event.
|
|
2565
|
-
*
|
|
2566
|
-
* @see {@link https://discord.com/developers/docs/resources/webhook#edit-webhook}
|
|
2567
|
-
*/
|
|
2568
|
-
editWebhook: (webhookId: BigString, options: ModifyWebhook) => Promise<Camelize<DiscordWebhook>>;
|
|
2569
|
-
/**
|
|
2570
|
-
* Edits a webhook message.
|
|
2571
|
-
*
|
|
2572
|
-
* @param webhookId - The ID of the webhook to edit the message of.
|
|
2573
|
-
* @param token - The webhook token, used to edit the message.
|
|
2574
|
-
* @param messageId - The ID of the message to edit.
|
|
2575
|
-
* @param options - The parameters for the edit of the message.
|
|
2576
|
-
* @returns An instance of the edited {@link DiscordMessage}.
|
|
2577
|
-
*
|
|
2578
|
-
* @remarks
|
|
2579
|
-
* Fires a _Message Update_ gateway event.
|
|
2580
|
-
*
|
|
2581
|
-
* @see {@link https://discord.com/developers/docs/resources/webhook#edit-webhook-message}
|
|
2582
|
-
*/
|
|
2583
|
-
editWebhookMessage: (webhookId: BigString, token: string, messageId: BigString, options: InteractionCallbackData & {
|
|
2584
|
-
threadId?: BigString;
|
|
2585
|
-
}) => Promise<Camelize<DiscordMessage>>;
|
|
2586
|
-
/**
|
|
2587
|
-
* Edits a webhook using the webhook token, thereby bypassing the need for authentication + permissions.
|
|
2588
|
-
*
|
|
2589
|
-
* @param webhookId - The ID of the webhook to edit.
|
|
2590
|
-
* @param token - The webhook token, used to edit the webhook.
|
|
2591
|
-
* @returns An instance of the edited {@link DiscordWebhook}.
|
|
2592
|
-
*
|
|
2593
|
-
* @remarks
|
|
2594
|
-
* Requires the `MANAGE_WEBHOOKS` permission.
|
|
2595
|
-
*
|
|
2596
|
-
* Fires a _Webhooks Update_ gateway event.
|
|
2597
|
-
*
|
|
2598
|
-
* @see {@link https://discord.com/developers/docs/resources/webhook#modify-webhook-with-token}
|
|
2599
|
-
*/
|
|
2600
|
-
editWebhookWithToken: (webhookId: BigString, token: string, options: Omit<ModifyWebhook, 'channelId'>) => Promise<Camelize<DiscordWebhook>>;
|
|
2601
|
-
/**
|
|
2602
|
-
* Executes a webhook, causing a message to be posted in the channel configured for the webhook.
|
|
2603
|
-
*
|
|
2604
|
-
* @param webhookId - The ID of the webhook to execute.
|
|
2605
|
-
* @param token - The webhook token, used to execute the webhook.
|
|
2606
|
-
* @param options - The parameters for the execution of the webhook.
|
|
2607
|
-
* @returns An instance of the created {@link DiscordMessage}, or `undefined` if the {@link ExecuteWebhook.wait | wait} property of the {@link options} object parameter is set to `false`.
|
|
2608
|
-
*
|
|
2609
|
-
* @remarks
|
|
2610
|
-
* If the webhook channel is a forum channel, you must provide a value for either `threadId` or `threadName`.
|
|
2611
|
-
*
|
|
2612
|
-
* @see {@link https://discord.com/developers/docs/resources/webhook#execute-webhook}
|
|
2613
|
-
*/
|
|
2614
|
-
executeWebhook: (webhookId: BigString, token: string, options: ExecuteWebhook) => Promise<Camelize<DiscordMessage> | undefined>;
|
|
2615
|
-
/**
|
|
2616
|
-
* Follows an announcement channel, allowing messages posted within it to be cross-posted into the target channel.
|
|
2617
|
-
*
|
|
2618
|
-
* @param sourceChannelId - The ID of the announcement channel to follow.
|
|
2619
|
-
* @param targetChannelId - The ID of the target channel - the channel to cross-post to.
|
|
2620
|
-
* @returns An instance of {@link DiscordFollowedChannel}.
|
|
2621
|
-
*
|
|
2622
|
-
* @remarks
|
|
2623
|
-
* Requires the `MANAGE_WEBHOOKS` permission in the __target channel__.
|
|
2624
|
-
*
|
|
2625
|
-
* Fires a _Webhooks Update_ gateway event.
|
|
2626
|
-
*
|
|
2627
|
-
* @see {@link https://discord.com/developers/docs/resources/channel#follow-announcement-channel}
|
|
2628
|
-
*/
|
|
2629
|
-
followAnnouncement: (sourceChannelId: BigString, targetChannelId: BigString) => Promise<Camelize<DiscordFollowedChannel>>;
|
|
2630
|
-
/**
|
|
2631
|
-
* Gets the list of all active threads for a guild.
|
|
2632
|
-
*
|
|
2633
|
-
* @param guildId - The ID of the guild to get the threads of.
|
|
2634
|
-
* @returns An instance of {@link DiscordActiveThreads}.
|
|
2635
|
-
*
|
|
2636
|
-
* @remarks
|
|
2637
|
-
* Returns both public and private threads.
|
|
2638
|
-
*
|
|
2639
|
-
* Threads are ordered by the `id` property in descending order.
|
|
2640
|
-
*
|
|
2641
|
-
* @see {@link https://discord.com/developers/docs/resources/guild#list-active-guild-threads}
|
|
2642
|
-
*/
|
|
2643
|
-
getActiveThreads: (guildId: BigString) => Promise<Camelize<DiscordActiveThreads>>;
|
|
2644
|
-
/** Get the applications info */
|
|
2645
|
-
getApplicationInfo: () => Promise<Camelize<DiscordApplication>>;
|
|
2646
|
-
/**
|
|
2647
|
-
* Gets the permissions of a guild application command.
|
|
2648
|
-
*
|
|
2649
|
-
* @param guildId - The ID of the guild the command is registered in.
|
|
2650
|
-
* @param commandId - The ID of the command to get the permissions of.
|
|
2651
|
-
* @returns An instance of {@link ApplicationCommandPermission}.
|
|
2652
|
-
*
|
|
2653
|
-
* @see {@link https://discord.com/developers/docs/interactions/application-commands#get-application-command-permissions}
|
|
2654
|
-
*/
|
|
2655
|
-
getApplicationCommandPermission: (guildId: BigString, commandId: BigString) => Promise<Camelize<DiscordApplicationCommandPermissions>>;
|
|
2656
|
-
/**
|
|
2657
|
-
* Gets the permissions of all application commands registered in a guild by the ID of the guild.
|
|
2658
|
-
*
|
|
2659
|
-
* @param guildId - The ID of the guild to get the permissions objects of.
|
|
2660
|
-
* @returns A collection of {@link ApplicationCommandPermission} objects assorted by command ID.
|
|
2661
|
-
*
|
|
2662
|
-
* @see {@link https://discord.com/developers/docs/interactions/application-commands#get-guild-application-command-permissions}
|
|
2663
|
-
*/
|
|
2664
|
-
getApplicationCommandPermissions: (guildId: BigString) => Promise<Camelize<DiscordApplicationCommandPermissions[]>>;
|
|
2665
|
-
/**
|
|
2666
|
-
* Gets an automod rule by its ID.
|
|
2667
|
-
*
|
|
2668
|
-
* @param guildId - The ID of the guild to get the rule of.
|
|
2669
|
-
* @param ruleId - The ID of the rule to get.
|
|
2670
|
-
* @returns An instance of {@link DiscordAutoModerationRule}.
|
|
2671
|
-
*
|
|
2672
|
-
* @remarks
|
|
2673
|
-
* Requires the `MANAGE_GUILD` permission.
|
|
2674
|
-
*
|
|
2675
|
-
* @see {@link https://discord.com/developers/docs/resources/auto-moderation#get-auto-moderation-rule}
|
|
2676
|
-
*/
|
|
2677
|
-
getAutomodRule: (guildId: BigString, ruleId: BigString) => Promise<Camelize<DiscordAutoModerationRule>>;
|
|
2678
|
-
/**
|
|
2679
|
-
* Gets the list of automod rules for a guild.
|
|
2680
|
-
*
|
|
2681
|
-
* @param guildId - The ID of the guild to get the rules from.
|
|
2682
|
-
* @returns A collection of {@link DiscordAutoModerationRule} objects assorted by rule ID.
|
|
2683
|
-
*
|
|
2684
|
-
* @remarks
|
|
2685
|
-
* Requires the `MANAGE_GUILD` permission.
|
|
2686
|
-
*
|
|
2687
|
-
* @see {@link https://discord.com/developers/docs/resources/auto-moderation#list-auto-moderation-rules-for-guild}
|
|
2688
|
-
*/
|
|
2689
|
-
getAutomodRules: (guildId: BigString) => Promise<Camelize<DiscordAutoModerationRule[]>>;
|
|
2690
|
-
/**
|
|
2691
|
-
* Gets a channel by its ID.
|
|
2692
|
-
*
|
|
2693
|
-
* @param channelId - The ID of the channel to get.
|
|
2694
|
-
* @returns An instance of {@link DiscordChannel}.
|
|
2695
|
-
*
|
|
2696
|
-
* @remarks
|
|
2697
|
-
* If the channel is a thread, a {@link ThreadMember} object is included in the result.
|
|
2698
|
-
*
|
|
2699
|
-
* @see {@link https://discord.com/developers/docs/resources/channel#get-channel}
|
|
2700
|
-
*/
|
|
2701
|
-
getChannel: (channelId: BigString) => Promise<Camelize<DiscordChannel>>;
|
|
2702
|
-
/**
|
|
2703
|
-
* Gets the list of invites for a channel.
|
|
2704
|
-
*
|
|
2705
|
-
* @param channelId - The ID of the channel to get the invites of.
|
|
2706
|
-
* @returns A collection of {@link DiscordInviteMetadata} objects assorted by invite code.
|
|
2707
|
-
*
|
|
2708
|
-
* @remarks
|
|
2709
|
-
* Requires the `MANAGE_CHANNELS` permission.
|
|
2710
|
-
*
|
|
2711
|
-
* Only usable for guild channels.
|
|
2712
|
-
*
|
|
2713
|
-
* @see {@link https://discord.com/developers/docs/resources/channel#get-channel-invites}
|
|
2714
|
-
*/
|
|
2715
|
-
getChannelInvites: (channelId: BigString) => Promise<Camelize<DiscordInviteMetadata[]>>;
|
|
2716
|
-
/**
|
|
2717
|
-
* Gets the list of channels for a guild.
|
|
2718
|
-
*
|
|
2719
|
-
* @param guildId - The ID of the guild to get the channels of.
|
|
2720
|
-
* @returns A collection of {@link DiscordChannel} objects assorted by channel ID.
|
|
2721
|
-
*
|
|
2722
|
-
* @remarks
|
|
2723
|
-
* Excludes threads.
|
|
2724
|
-
*
|
|
2725
|
-
* @see {@link https://discord.com/developers/docs/resources/guild#get-guild-channels}
|
|
2726
|
-
*/
|
|
2727
|
-
getChannels: (guildId: BigString) => Promise<Camelize<DiscordChannel[]>>;
|
|
2728
|
-
/**
|
|
2729
|
-
* Gets a list of webhooks for a channel.
|
|
2730
|
-
*
|
|
2731
|
-
* @param channelId - The ID of the channel which to get the webhooks of.
|
|
2732
|
-
* @returns A collection of {@link DiscordWebhook} objects assorted by webhook ID.
|
|
2733
|
-
*
|
|
2734
|
-
* @remarks
|
|
2735
|
-
* Requires the `MANAGE_WEBHOOKS` permission.
|
|
2736
|
-
*
|
|
2737
|
-
* @see {@link https://discord.com/developers/docs/resources/webhook#get-channel-webhooks}
|
|
2738
|
-
*/
|
|
2739
|
-
getChannelWebhooks: (channelId: BigString) => Promise<Camelize<DiscordWebhook[]>>;
|
|
2740
|
-
/**
|
|
2741
|
-
* Gets or creates a DM channel with a user.
|
|
2742
|
-
*
|
|
2743
|
-
* @param userId - The ID of the user to create the DM channel with.
|
|
2744
|
-
* @returns An instance of {@link DiscordChannel}.
|
|
2745
|
-
*
|
|
2746
|
-
* @see {@link https://discord.com/developers/docs/resources/user#create-dm}
|
|
2747
|
-
*/
|
|
2748
|
-
getDmChannel: (userId: BigString) => Promise<Camelize<DiscordChannel>>;
|
|
2749
|
-
/**
|
|
2750
|
-
* Gets an emoji by its ID.
|
|
2751
|
-
*
|
|
2752
|
-
* @param guildId - The ID of the guild from which to get the emoji.
|
|
2753
|
-
* @param emojiId - The ID of the emoji to get.
|
|
2754
|
-
* @returns An instance of {@link DiscordEmoji}.
|
|
2755
|
-
*
|
|
2756
|
-
* @see {@link https://discord.com/developers/docs/resources/emoji#get-guild-emoji}
|
|
2757
|
-
*/
|
|
2758
|
-
getEmoji: (guildId: BigString, emojiId: BigString) => Promise<Camelize<DiscordEmoji>>;
|
|
2759
|
-
/**
|
|
2760
|
-
* Gets the list of emojis for a guild.
|
|
2761
|
-
*
|
|
2762
|
-
* @param guildId - The ID of the guild which to get the emojis of.
|
|
2763
|
-
* @returns A collection of {@link DiscordEmoji} objects assorted by emoji ID.
|
|
2764
|
-
*
|
|
2765
|
-
* @see {@link https://discord.com/developers/docs/resources/emoji#list-guild-emojis}
|
|
2766
|
-
*/
|
|
2767
|
-
getEmojis: (guildId: BigString) => Promise<Camelize<DiscordEmoji[]>>;
|
|
2768
|
-
/**
|
|
2769
|
-
* Gets a follow-up message to an interaction by the ID of the message.
|
|
2770
|
-
*
|
|
2771
|
-
* @param token - The interaction token to use, provided in the original interaction.
|
|
2772
|
-
* @param messageId - The ID of the message to get.
|
|
2773
|
-
* @returns An instance of {@link Message}.
|
|
2774
|
-
*
|
|
2775
|
-
* @remarks
|
|
2776
|
-
* Unlike `getMessage()`, this endpoint allows the bot user to act without:
|
|
2777
|
-
* - Needing to be able to see the contents of the channel that the message is in. (`READ_MESSAGES` permission.)
|
|
2778
|
-
* - Requiring the `MESSAGE_CONTENT` intent.
|
|
2779
|
-
*
|
|
2780
|
-
* Does not support ephemeral follow-up messages due to these being stateless.
|
|
2781
|
-
*
|
|
2782
|
-
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#get-followup-message}
|
|
2783
|
-
*/
|
|
2784
|
-
getFollowupMessage: (token: string, messageId: BigString) => Promise<Camelize<DiscordMessage>>;
|
|
2785
|
-
/** Get the bots Gateway metadata that can help during the operation of large or sharded bots. */
|
|
2786
|
-
getGatewayBot: () => Promise<Camelize<DiscordGetGatewayBot>>;
|
|
2787
|
-
/**
|
|
2788
|
-
* Gets a global application command by its ID.
|
|
2789
|
-
*
|
|
2790
|
-
* @param commandId - The ID of the command to get.
|
|
2791
|
-
* @returns An instance of {@link ApplicationCommand}.
|
|
2792
|
-
*
|
|
2793
|
-
* @see {@link https://discord.com/developers/docs/interactions/application-commands#get-global-application-command}
|
|
2794
|
-
*/
|
|
2795
|
-
getGlobalApplicationCommand: (commandId: BigString) => Promise<Camelize<DiscordApplicationCommand>>;
|
|
2796
|
-
/**
|
|
2797
|
-
* Gets the list of your bot's global application commands.
|
|
2798
|
-
*
|
|
2799
|
-
* @returns A collection of {@link ApplicationCommand} objects assorted by command ID.
|
|
2800
|
-
*
|
|
2801
|
-
* @see {@link https://discord.com/developers/docs/interactions/application-commands#get-global-application-commands}
|
|
2802
|
-
*/
|
|
2803
|
-
getGlobalApplicationCommands: () => Promise<Camelize<DiscordApplicationCommand[]>>;
|
|
2804
|
-
/**
|
|
2805
|
-
* Gets a guild application command by its ID.
|
|
2806
|
-
*
|
|
2807
|
-
* @param guildId - The ID of the guild the command is registered in.
|
|
2808
|
-
* @param commandId - The ID of the command to get.
|
|
2809
|
-
* @returns An instance of {@link ApplicationCommand}.
|
|
2810
|
-
*
|
|
2811
|
-
* @see {@link https://discord.com/developers/docs/interactions/application-commands#get-guild-application-command}
|
|
2812
|
-
*/
|
|
2813
|
-
getGuildApplicationCommand: (commandId: BigString, guildId: BigString) => Promise<Camelize<DiscordApplicationCommand>>;
|
|
2814
|
-
/**
|
|
2815
|
-
* Gets the list of application commands registered by your bot in a guild.
|
|
2816
|
-
*
|
|
2817
|
-
* @param guildId - The ID of the guild the commands are registered in.
|
|
2818
|
-
* @returns A collection of {@link ApplicationCommand} objects assorted by command ID.
|
|
2819
|
-
*
|
|
2820
|
-
* @see {@link https://discord.com/developers/docs/interactions/application-commands#get-global-application-commandss}
|
|
2821
|
-
*/
|
|
2822
|
-
getGuildApplicationCommands: (guildId: BigString) => Promise<Camelize<DiscordApplicationCommand[]>>;
|
|
2823
|
-
/**
|
|
2824
|
-
* Gets a template by its code.
|
|
2825
|
-
*
|
|
2826
|
-
* @param templateCode - The code of the template to get.
|
|
2827
|
-
* @returns An instance of {@link Template}.
|
|
2828
|
-
*
|
|
2829
|
-
* @remarks
|
|
2830
|
-
* Requires the `MANAGE_GUILD` permission.
|
|
2831
|
-
*
|
|
2832
|
-
* @see {@link https://discord.com/developers/docs/resources/guild-template#get-guild-template}
|
|
2833
|
-
*/
|
|
2834
|
-
getGuildTemplate: (templateCode: string) => Promise<Camelize<DiscordTemplate>>;
|
|
2835
|
-
/**
|
|
2836
|
-
* Gets the list of templates for a guild.
|
|
2837
|
-
*
|
|
2838
|
-
* @param guildId - The ID of the guild to get the list of templates for.
|
|
2839
|
-
* @returns A collection of {@link Template} objects assorted by template code.
|
|
2840
|
-
*
|
|
2841
|
-
* @remarks
|
|
2842
|
-
* Requires the `MANAGE_GUILD` permission.
|
|
2843
|
-
*
|
|
2844
|
-
* @see {@link https://discord.com/developers/docs/resources/guild-template#get-guild-templates}
|
|
2845
|
-
*/
|
|
2846
|
-
getGuildTemplates: (guildId: BigString) => Promise<Camelize<DiscordTemplate[]>>;
|
|
2847
|
-
/**
|
|
2848
|
-
* Gets the list of webhooks for a guild.
|
|
2849
|
-
*
|
|
2850
|
-
* @param guildId - The ID of the guild to get the list of webhooks for.
|
|
2851
|
-
* @returns A collection of {@link DiscordWebhook} objects assorted by webhook ID.
|
|
2852
|
-
*
|
|
2853
|
-
* @remarks
|
|
2854
|
-
* Requires the `MANAGE_WEBHOOKS` permission.
|
|
2855
|
-
*
|
|
2856
|
-
* @see {@link https://discord.com/developers/docs/resources/webhook#get-guild-webhooks}
|
|
2857
|
-
*/
|
|
2858
|
-
getGuildWebhooks: (guildId: BigString) => Promise<Camelize<DiscordWebhook[]>>;
|
|
2859
|
-
/**
|
|
2860
|
-
* Gets the list of integrations attached to a guild.
|
|
2861
|
-
*
|
|
2862
|
-
* @param guildId - The ID of the guild to get the list of integrations from.
|
|
2863
|
-
* @returns A collection of {@link Integration} objects assorted by integration ID.
|
|
2864
|
-
*
|
|
2865
|
-
* @remarks
|
|
2866
|
-
* Requires the `MANAGE_GUILD` permission.
|
|
2867
|
-
*
|
|
2868
|
-
* @see {@link https://discord.com/developers/docs/resources/guild#get-guild-integrations}
|
|
2869
|
-
*/
|
|
2870
|
-
getIntegrations: (guildId: BigString) => Promise<Camelize<DiscordIntegration[]>>;
|
|
2871
|
-
/**
|
|
2872
|
-
* Gets an invite to a channel by its invite code.
|
|
2873
|
-
*
|
|
2874
|
-
* @param inviteCode - The invite code of the invite to get.
|
|
2875
|
-
* @param options - The parameters for the fetching of the invite.
|
|
2876
|
-
* @returns An instance of {@link DiscordInviteMetadata}.
|
|
2877
|
-
*
|
|
2878
|
-
* @see {@link https://discord.com/developers/docs/resources/invite#get-invite}
|
|
2879
|
-
*/
|
|
2880
|
-
getInvite: (inviteCode: string, options?: GetInvite) => Promise<Camelize<DiscordInviteMetadata>>;
|
|
2881
|
-
/**
|
|
2882
|
-
* Gets the list of invites for a guild.
|
|
2883
|
-
*
|
|
2884
|
-
* @param guildId - The ID of the guild to get the invites from.
|
|
2885
|
-
* @returns A collection of {@link InviteMetadata | Invite} objects assorted by invite code.
|
|
2886
|
-
*
|
|
2887
|
-
* @remarks
|
|
2888
|
-
* Requires the `MANAGE_GUILD` permission.
|
|
2889
|
-
*
|
|
2890
|
-
* @see {@link https://discord.com/developers/docs/resources/invite#get-invites}
|
|
2891
|
-
*/
|
|
2892
|
-
getInvites: (guildId: BigString) => Promise<Camelize<DiscordInviteMetadata[]>>;
|
|
2893
|
-
/**
|
|
2894
|
-
* Returns the list of sticker packs available to Nitro subscribers.
|
|
2895
|
-
*
|
|
2896
|
-
* @param bot The bot instance to use to make the request.
|
|
2897
|
-
* @returns A collection of {@link StickerPack} objects assorted by sticker ID.
|
|
2898
|
-
*
|
|
2899
|
-
* @see {@link https://discord.com/developers/docs/resources/sticker#list-nitro-sticker-packs}
|
|
2900
|
-
*/
|
|
2901
|
-
getNitroStickerPacks: () => Promise<Camelize<DiscordStickerPack[]>>;
|
|
2902
|
-
/**
|
|
2903
|
-
* Gets the initial message response to an interaction.
|
|
2904
|
-
*
|
|
2905
|
-
* @param token - The interaction token to use, provided in the original interaction.
|
|
2906
|
-
* @returns An instance of {@link Message}.
|
|
2907
|
-
*
|
|
2908
|
-
* @remarks
|
|
2909
|
-
* Unlike `getMessage()`, this endpoint allows the bot user to act without:
|
|
2910
|
-
* - Needing to be able to see the contents of the channel that the message is in. (`READ_MESSAGES` permission.)
|
|
2911
|
-
* - Requiring the `MESSAGE_CONTENT` intent.
|
|
2912
|
-
*
|
|
2913
|
-
* Does not support ephemeral follow-up messages due to these being stateless.
|
|
2914
|
-
*
|
|
2915
|
-
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#get-original-interaction-response}
|
|
2916
|
-
*/
|
|
2917
|
-
getOriginalInteractionResponse: (token: string) => Promise<Camelize<DiscordMessage>>;
|
|
2918
|
-
/**
|
|
2919
|
-
* Gets the list of private archived threads for a channel.
|
|
2920
|
-
*
|
|
2921
|
-
* @param channelId - The ID of the channel to get the archived threads for.
|
|
2922
|
-
* @param options - The parameters for the fetching of threads.
|
|
2923
|
-
* @returns An instance of {@link DiscordArchivedThreads}.
|
|
2924
|
-
*
|
|
2925
|
-
* @remarks
|
|
2926
|
-
* Requires the `READ_MESSAGE_HISTORY` permission.
|
|
2927
|
-
* Requires the `MANAGE_THREADS` permission.
|
|
2928
|
-
*
|
|
2929
|
-
* Returns threads of type {@link ChannelTypes.GuildPrivateThread}.
|
|
2930
|
-
*
|
|
2931
|
-
* Threads are ordered by the `archive_timestamp` property included in the metadata of the object in descending order.
|
|
2932
|
-
*
|
|
2933
|
-
* @see {@link https://discord.com/developers/docs/resources/channel#list-private-archived-threads}
|
|
2934
|
-
*/
|
|
2935
|
-
getPrivateArchivedThreads: (channelId: BigString, options?: ListArchivedThreads) => Promise<Camelize<DiscordArchivedThreads>>;
|
|
2936
|
-
/**
|
|
2937
|
-
* Gets the list of private archived threads the bot is a member of for a channel.
|
|
2938
|
-
*
|
|
2939
|
-
* @param channelId - The ID of the channel to get the archived threads for.
|
|
2940
|
-
* @param options - The parameters for the fetching of threads.
|
|
2941
|
-
* @returns An instance of {@link DiscordArchivedThreads}.
|
|
2942
|
-
*
|
|
2943
|
-
* @remarks
|
|
2944
|
-
* Requires the `READ_MESSAGE_HISTORY` permission.
|
|
2945
|
-
*
|
|
2946
|
-
* Returns threads of type {@link ChannelTypes.GuildPrivateThread}.
|
|
2947
|
-
*
|
|
2948
|
-
* Threads are ordered by the `id` property in descending order.
|
|
2949
|
-
*
|
|
2950
|
-
* @see {@link https://discord.com/developers/docs/resources/channel#list-joined-private-archived-threads}
|
|
2951
|
-
*/
|
|
2952
|
-
getPrivateJoinedArchivedThreads: (channelId: BigString, options?: ListArchivedThreads) => Promise<Camelize<DiscordArchivedThreads>>;
|
|
2953
|
-
/**
|
|
2954
|
-
* Gets the list of public archived threads for a channel.
|
|
2955
|
-
*
|
|
2956
|
-
* @param channelId - The ID of the channel to get the archived threads for.
|
|
2957
|
-
* @param options - The parameters for the fetching of threads.
|
|
2958
|
-
* @returns An instance of {@link ArchivedThreads}.
|
|
2959
|
-
*
|
|
2960
|
-
* @remarks
|
|
2961
|
-
* Requires the `READ_MESSAGE_HISTORY` permission.
|
|
2962
|
-
*
|
|
2963
|
-
* If called on a channel of type {@link ChannelTypes.GuildText}, returns threads of type {@link ChannelTypes.GuildPublicThread}.
|
|
2964
|
-
* If called on a channel of type {@link ChannelTypes.GuildNews}, returns threads of type {@link ChannelTypes.GuildNewsThread}.
|
|
2965
|
-
*
|
|
2966
|
-
* Threads are ordered by the `archive_timestamp` property included in the metadata of the object in descending order.
|
|
2967
|
-
*
|
|
2968
|
-
* @see {@link https://discord.com/developers/docs/resources/channel#list-public-archived-threads}
|
|
2969
|
-
*/
|
|
2970
|
-
getPublicArchivedThreads: (channelId: BigString, options?: ListArchivedThreads) => Promise<Camelize<DiscordArchivedThreads>>;
|
|
2971
|
-
/**
|
|
2972
|
-
* Gets a scheduled event by its ID.
|
|
2973
|
-
*
|
|
2974
|
-
* @param guildId - The ID of the guild to get the scheduled event from.
|
|
2975
|
-
* @param eventId - The ID of the scheduled event to get.
|
|
2976
|
-
* @param options - The parameters for the fetching of the scheduled event.
|
|
2977
|
-
* @returns An instance of {@link ScheduledEvent}.
|
|
2978
|
-
*
|
|
2979
|
-
* @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#get-guild-scheduled-event}
|
|
2980
|
-
*/
|
|
2981
|
-
getScheduledEvent: (guildId: BigString, eventId: BigString, options?: {
|
|
2982
|
-
withUserCount?: boolean;
|
|
2983
|
-
}) => Promise<Camelize<DiscordScheduledEvent>>;
|
|
2984
|
-
/**
|
|
2985
|
-
* Gets the list of scheduled events for a guild.
|
|
2986
|
-
*
|
|
2987
|
-
* @param guildId - The ID of the guild to get the scheduled events from.
|
|
2988
|
-
* @param options - The parameters for the fetching of the scheduled events.
|
|
2989
|
-
* @returns A collection of {@link ScheduledEvent} objects assorted by event ID.
|
|
2990
|
-
*
|
|
2991
|
-
* @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#list-scheduled-events-for-guild}
|
|
2992
|
-
*/
|
|
2993
|
-
getScheduledEvents: (guildId: BigString, options?: GetScheduledEvents) => Promise<Camelize<DiscordScheduledEvent[]>>;
|
|
2994
|
-
/**
|
|
2995
|
-
* Gets the list of subscribers to a scheduled event from a guild.
|
|
2996
|
-
*
|
|
2997
|
-
* @param guildId - The ID of the guild to get the subscribers to the scheduled event from.
|
|
2998
|
-
* @param eventId - The ID of the scheduled event to get the subscribers of.
|
|
2999
|
-
* @param options - The parameters for the fetching of the subscribers.
|
|
3000
|
-
* @returns A collection of {@link User} objects assorted by user ID.
|
|
3001
|
-
*
|
|
3002
|
-
* @remarks
|
|
3003
|
-
* Requires the `MANAGE_EVENTS` permission.
|
|
3004
|
-
*
|
|
3005
|
-
* Users are ordered by their IDs in _ascending_ order.
|
|
3006
|
-
*
|
|
3007
|
-
* @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#get-guild-scheduled-event-users}
|
|
3008
|
-
*/
|
|
3009
|
-
getScheduledEventUsers: (guildId: BigString, eventId: BigString, options?: GetScheduledEventUsers) => Promise<Array<{
|
|
3010
|
-
user: Camelize<DiscordUser>;
|
|
3011
|
-
member?: Camelize<DiscordMember>;
|
|
3012
|
-
}>>;
|
|
3013
|
-
/** Get the bots Gateway metadata that can help during the operation of large or sharded bots. */
|
|
3014
|
-
getSessionInfo: () => Promise<Camelize<DiscordGetGatewayBot>>;
|
|
3015
|
-
/**
|
|
3016
|
-
* Gets the stage instance associated with a stage channel, if one exists.
|
|
3017
|
-
*
|
|
3018
|
-
* @param channelId - The ID of the stage channel the stage instance is associated with.
|
|
3019
|
-
* @returns An instance of {@link DiscordStageInstance}.
|
|
3020
|
-
*
|
|
3021
|
-
* @see {@link https://discord.com/developers/docs/resources/stage-instance#get-stage-instance}
|
|
3022
|
-
*/
|
|
3023
|
-
getStageInstance: (channelId: BigString) => Promise<Camelize<DiscordStageInstance>>;
|
|
3024
|
-
/**
|
|
3025
|
-
* Gets a thread member by their user ID.
|
|
3026
|
-
*
|
|
3027
|
-
* @param channelId - The ID of the thread to get the thread member of.
|
|
3028
|
-
* @param userId - The user ID of the thread member to get.
|
|
3029
|
-
* @returns An instance of {@link DiscordThreadMember}.
|
|
3030
|
-
*
|
|
3031
|
-
* @see {@link https://discord.com/developers/docs/resources/channel#get-thread-member}
|
|
3032
|
-
*/
|
|
3033
|
-
getThreadMember: (channelId: BigString, userId: BigString) => Promise<Camelize<DiscordThreadMember>>;
|
|
3034
|
-
/**
|
|
3035
|
-
* Gets the list of thread members for a thread.
|
|
3036
|
-
*
|
|
3037
|
-
* @param channelId - The ID of the thread to get the thread members of.
|
|
3038
|
-
* @returns A collection of {@link DiscordThreadMember} assorted by user ID.
|
|
3039
|
-
*
|
|
3040
|
-
* @remarks
|
|
3041
|
-
* Requires the application to have the `GUILD_MEMBERS` privileged intent enabled.
|
|
3042
|
-
*
|
|
3043
|
-
* @see {@link https://discord.com/developers/docs/resources/channel#list-thread-members}
|
|
3044
|
-
*/
|
|
3045
|
-
getThreadMembers: (channelId: BigString) => Promise<Camelize<DiscordThreadMember[]>>;
|
|
3046
|
-
/**
|
|
3047
|
-
* Get a user's data from the api
|
|
3048
|
-
*
|
|
3049
|
-
* @param id The user's id
|
|
3050
|
-
* @returns {Camelize<DiscordUser>}
|
|
3051
|
-
*/
|
|
3052
|
-
getUser: (id: BigString) => Promise<Camelize<DiscordUser>>;
|
|
3053
|
-
/**
|
|
3054
|
-
* Gets a webhook by its ID.
|
|
3055
|
-
*
|
|
3056
|
-
* @param webhookId - The ID of the webhook to get.
|
|
3057
|
-
* @returns An instance of {@link DiscordWebhook}.
|
|
3058
|
-
*
|
|
3059
|
-
* @remarks
|
|
3060
|
-
* Requires the `MANAGE_WEBHOOKS` permission.
|
|
3061
|
-
*
|
|
3062
|
-
* @see {@link https://discord.com/developers/docs/resources/webhook#get-webhook}
|
|
3063
|
-
*/
|
|
3064
|
-
getWebhook: (webhookId: BigString) => Promise<Camelize<DiscordWebhook>>;
|
|
3065
|
-
/**
|
|
3066
|
-
* Gets a webhook message by its ID.
|
|
3067
|
-
*
|
|
3068
|
-
* @param webhookId - The ID of the webhook to get a message of.
|
|
3069
|
-
* @param token - The webhook token, used to get webhook messages.
|
|
3070
|
-
* @param messageId - the ID of the webhook message to get.
|
|
3071
|
-
* @param options - The parameters for the fetching of the message.
|
|
3072
|
-
* @returns An instance of {@link DiscordMessage}.
|
|
3073
|
-
*
|
|
3074
|
-
* @see {@link https://discord.com/developers/docs/resources/webhook#get-webhook-message}
|
|
3075
|
-
*/
|
|
3076
|
-
getWebhookMessage: (webhookId: BigString, token: string, messageId: BigString, options?: GetWebhookMessageOptions) => Promise<Camelize<DiscordMessage>>;
|
|
3077
|
-
/**
|
|
3078
|
-
* Gets a webhook using the webhook token, thereby bypassing the need for authentication + permissions.
|
|
3079
|
-
*
|
|
3080
|
-
* @param webhookId - The ID of the webhook to get.
|
|
3081
|
-
* @param token - The webhook token, used to get the webhook.
|
|
3082
|
-
* @returns An instance of {@link DiscordWebhook}.
|
|
3083
|
-
*
|
|
3084
|
-
* @see {@link https://discord.com/developers/docs/resources/webhook#get-webhook-with-token}
|
|
3085
|
-
*/
|
|
3086
|
-
getWebhookWithToken: (webhookId: BigString, token: string) => Promise<Camelize<DiscordWebhook>>;
|
|
3087
|
-
/**
|
|
3088
|
-
* Adds the bot user to a thread.
|
|
3089
|
-
*
|
|
3090
|
-
* @param channelId - The ID of the thread to add the bot user to.
|
|
3091
|
-
*
|
|
3092
|
-
* @remarks
|
|
3093
|
-
* Requires the thread not be archived.
|
|
3094
|
-
*
|
|
3095
|
-
* Fires a _Thread Members Update_ gateway event.
|
|
3096
|
-
*
|
|
3097
|
-
* @see {@link https://discord.com/developers/docs/resources/channel#join-thread}
|
|
3098
|
-
*/
|
|
3099
|
-
joinThread: (channelId: BigString) => Promise<void>;
|
|
3100
|
-
/**
|
|
3101
|
-
* Removes the bot user from a thread.
|
|
3102
|
-
*
|
|
3103
|
-
* @param channelId - The ID of the thread to remove the bot user from.
|
|
3104
|
-
*
|
|
3105
|
-
* @remarks
|
|
3106
|
-
* Requires the thread not be archived.
|
|
3107
|
-
*
|
|
3108
|
-
* Fires a _Thread Members Update_ gateway event.
|
|
3109
|
-
*
|
|
3110
|
-
* @see {@link https://discord.com/developers/docs/resources/channel#leave-thread}
|
|
3111
|
-
*/
|
|
3112
|
-
leaveThread: (channelId: BigString) => Promise<void>;
|
|
3113
|
-
/**
|
|
3114
|
-
* Cross-posts a message posted in an announcement channel to subscribed channels.
|
|
3115
|
-
*
|
|
3116
|
-
* @param channelId - The ID of the announcement channel.
|
|
3117
|
-
* @param messageId - The ID of the message to cross-post.
|
|
3118
|
-
* @returns An instance of the cross-posted {@link Message}.
|
|
3119
|
-
*
|
|
3120
|
-
* @remarks
|
|
3121
|
-
* Requires the `SEND_MESSAGES` permission.
|
|
3122
|
-
*
|
|
3123
|
-
* If not cross-posting own message:
|
|
3124
|
-
* - Requires the `MANAGE_MESSAGES` permission.
|
|
3125
|
-
*
|
|
3126
|
-
* Fires a _Message Create_ event in the guilds the subscribed channels are in.
|
|
3127
|
-
*
|
|
3128
|
-
* @see {@link https://discord.com/developers/docs/resources/channel#crosspost-message}
|
|
3129
|
-
*/
|
|
3130
|
-
publishMessage: (channelId: BigString, messageId: BigString) => Promise<Camelize<DiscordMessage>>;
|
|
3131
|
-
/**
|
|
3132
|
-
* Removes a member from a thread.
|
|
3133
|
-
*
|
|
3134
|
-
* @param channelId - The ID of the thread to remove the thread member of.
|
|
3135
|
-
* @param userId - The user ID of the thread member to remove.
|
|
3136
|
-
*
|
|
3137
|
-
* @remarks
|
|
3138
|
-
* If the thread is of type {@link ChannelTypes.GuildPrivateThread}, requires to be the creator of the thread.
|
|
3139
|
-
* Otherwise, requires the `MANAGE_THREADS` permission.
|
|
3140
|
-
*
|
|
3141
|
-
* Requires the thread not be archived.
|
|
3142
|
-
*
|
|
3143
|
-
* Fires a _Thread Members Update_ gateway event.
|
|
3144
|
-
*
|
|
3145
|
-
* @see {@link https://discord.com/developers/docs/resources/channel#remove-thread-member}
|
|
3146
|
-
*/
|
|
3147
|
-
removeThreadMember: (channelId: BigString, userId: BigString) => Promise<void>;
|
|
3148
|
-
/**
|
|
3149
|
-
* Sends a message to a channel.
|
|
3150
|
-
*
|
|
3151
|
-
* @param channelId - The ID of the channel to send the message in.
|
|
3152
|
-
* @param options - The parameters for the creation of the message.
|
|
3153
|
-
* @returns An instance of the created {@link DiscordMessage}.
|
|
3154
|
-
*
|
|
3155
|
-
* @remarks
|
|
3156
|
-
* Requires that the bot user be able to see the contents of the channel the message is to be sent in.
|
|
3157
|
-
*
|
|
3158
|
-
* If sending a message to a guild channel:
|
|
3159
|
-
* - Requires the `SEND_MESSAGES` permission.
|
|
3160
|
-
*
|
|
3161
|
-
* If sending a TTS message:
|
|
3162
|
-
* - Requires the `SEND_TTS_MESSAGES` permission.
|
|
3163
|
-
*
|
|
3164
|
-
* If sending a message as a reply to another message:
|
|
3165
|
-
* - Requires the `READ_MESSAGE_HISTORY` permission.
|
|
3166
|
-
* - The message being replied to cannot be a system message.
|
|
3167
|
-
*
|
|
3168
|
-
* ⚠️ The maximum size of a request (accounting for any attachments and message content) for bot users is _8 MiB_.
|
|
3169
|
-
*
|
|
3170
|
-
* Fires a _Message Create_ gateway event.
|
|
3171
|
-
*
|
|
3172
|
-
* @see {@link https://discord.com/developers/docs/resources/channel#create-message}
|
|
3173
|
-
*/
|
|
3174
|
-
sendMessage: (channelId: BigString, options: CreateMessageOptions) => Promise<Camelize<DiscordMessage>>;
|
|
3175
|
-
/**
|
|
3176
|
-
* Sends a follow-up message to an interaction.
|
|
3177
|
-
*
|
|
3178
|
-
* @param token - The interaction token to use, provided in the original interaction.
|
|
3179
|
-
* @param options - The parameters for the creation of the message.
|
|
3180
|
-
* @returns An instance of the created {@link Message}.
|
|
3181
|
-
*
|
|
3182
|
-
* @remarks
|
|
3183
|
-
* ⚠️ Interaction tokens are only valid for _15 minutes_.
|
|
3184
|
-
*
|
|
3185
|
-
* By default, mentions are suppressed. To enable mentions, pass a mention object with the callback data.
|
|
3186
|
-
*
|
|
3187
|
-
* Unlike `sendMessage()`, this endpoint allows the bot user to act without:
|
|
3188
|
-
* - Needing to be able to see the contents of the channel that the message is in. (`READ_MESSAGES` permission.)
|
|
3189
|
-
* - Requiring the `MESSAGE_CONTENT` intent.
|
|
3190
|
-
*
|
|
3191
|
-
* Fires a _Message Create_ event.
|
|
3192
|
-
*
|
|
3193
|
-
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-followup-message}
|
|
3194
|
-
*/
|
|
3195
|
-
sendFollowupMessage: (token: string, options: InteractionResponse) => Promise<Camelize<DiscordMessage>>;
|
|
3196
|
-
/**
|
|
3197
|
-
* Sends a response to an interaction.
|
|
3198
|
-
*
|
|
3199
|
-
* @param interactionId - The ID of the interaction to respond to.
|
|
3200
|
-
* @param token - The interaction token to use, provided in the original interaction.
|
|
3201
|
-
* @param options - The parameters for the creation of the message.
|
|
3202
|
-
* @returns An instance of the created {@link Message}.
|
|
3203
|
-
*
|
|
3204
|
-
* @remarks
|
|
3205
|
-
* ⚠️ Interaction tokens are only valid for _15 minutes_.
|
|
3206
|
-
*
|
|
3207
|
-
* By default, mentions are suppressed. To enable mentions, pass a mention object with the callback data.
|
|
3208
|
-
*
|
|
3209
|
-
* Unlike `sendMessage()`, this endpoint allows the bot user to act without:
|
|
3210
|
-
* - Needing to be able to see the contents of the channel that the message is in. (`READ_MESSAGES` permission.)
|
|
3211
|
-
* - Requiring the `MESSAGE_CONTENT` intent.
|
|
3212
|
-
*
|
|
3213
|
-
* Fires a _Message Create_ event.
|
|
3214
|
-
*
|
|
3215
|
-
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
|
|
3216
|
-
*/
|
|
3217
|
-
sendInteractionResponse: (interactionId: BigString, token: string, options: InteractionResponse) => Promise<void>;
|
|
3218
|
-
/**
|
|
3219
|
-
* Creates a thread, using an existing message as its point of origin.
|
|
3220
|
-
*
|
|
3221
|
-
* @param channelId - The ID of the channel in which to create the thread.
|
|
3222
|
-
* @param messageId - The ID of the message to use as the thread's point of origin.
|
|
3223
|
-
* @param options - The parameters to use for the creation of the thread.
|
|
3224
|
-
* @returns An instance of the created {@link Channel | Thread}.
|
|
3225
|
-
*
|
|
3226
|
-
* @remarks
|
|
3227
|
-
* If called on a channel of type {@link ChannelTypes.GuildText}, creates a {@link ChannelTypes.GuildPublicThread}.
|
|
3228
|
-
* If called on a channel of type {@link ChannelTypes.GuildNews}, creates a {@link ChannelTypes.GuildNewsThread}.
|
|
3229
|
-
* Does not work on channels of type {@link ChannelTypes.GuildForum}.
|
|
3230
|
-
*
|
|
3231
|
-
* The ID of the created thread will be the same as the ID of the source message.
|
|
3232
|
-
*
|
|
3233
|
-
* Fires a _Thread Create_ gateway event.
|
|
3234
|
-
*
|
|
3235
|
-
* @see {@link https://discord.com/developers/docs/resources/channel#start-thread-from-message}
|
|
3236
|
-
*/
|
|
3237
|
-
startThreadWithMessage: (channelId: BigString, messageId: BigString, options: StartThreadWithMessage) => Promise<Camelize<DiscordChannel>>;
|
|
3238
|
-
/**
|
|
3239
|
-
* Creates a thread without using a message as the thread's point of origin.
|
|
3240
|
-
*
|
|
3241
|
-
* @param channelId - The ID of the channel in which to create the thread.
|
|
3242
|
-
* @param options - The parameters to use for the creation of the thread.
|
|
3243
|
-
* @returns An instance of the created {@link DiscordChannel | Thread}.
|
|
3244
|
-
*
|
|
3245
|
-
* @remarks
|
|
3246
|
-
* Creating a private thread requires the server to be boosted.
|
|
3247
|
-
*
|
|
3248
|
-
* Fires a _Thread Create_ gateway event.
|
|
3249
|
-
*
|
|
3250
|
-
* @see {@link https://discord.com/developers/docs/resources/channel#start-thread-without-message}
|
|
3251
|
-
*/
|
|
3252
|
-
startThreadWithoutMessage: (channelId: BigString, options: StartThreadWithoutMessage) => Promise<Camelize<DiscordChannel>>;
|
|
3253
|
-
/**
|
|
3254
|
-
* Synchronises a template with the current state of a guild.
|
|
3255
|
-
*
|
|
3256
|
-
* @param guildId - The ID of the guild to synchronise a template of.
|
|
3257
|
-
* @returns An instance of the edited {@link Template}.
|
|
3258
|
-
*
|
|
3259
|
-
* @remarks
|
|
3260
|
-
* Requires the `MANAGE_GUILD` permission.
|
|
3261
|
-
*
|
|
3262
|
-
* Fires a _Guild Update_ gateway event.
|
|
3263
|
-
*
|
|
3264
|
-
* @see {@link https://discord.com/developers/docs/resources/guild-template#get-guild-templates}
|
|
3265
|
-
*/
|
|
3266
|
-
syncGuildTemplate: (guildId: BigString) => Promise<Camelize<DiscordTemplate>>;
|
|
3267
|
-
/**
|
|
3268
|
-
* Triggers a typing indicator for the bot user.
|
|
3269
|
-
*
|
|
3270
|
-
* @param channelId - The ID of the channel in which to trigger the typing indicator.
|
|
3271
|
-
*
|
|
3272
|
-
* @remarks
|
|
3273
|
-
* Generally, bots should _not_ use this route.
|
|
3274
|
-
*
|
|
3275
|
-
* Fires a _Typing Start_ gateway event.
|
|
3276
|
-
*
|
|
3277
|
-
* @see {@link https://discord.com/developers/docs/resources/channel#trigger-typing-indicator}
|
|
3278
|
-
*/
|
|
3279
|
-
triggerTypingIndicator: (channelId: BigString) => Promise<void>;
|
|
3280
|
-
/**
|
|
3281
|
-
* Re-registers the list of global application commands, overwriting the previous commands completely.
|
|
3282
|
-
*
|
|
3283
|
-
* @param commands - The list of commands to use to overwrite the previous list.
|
|
3284
|
-
* @returns A collection of {@link ApplicationCommand} objects assorted by command ID.
|
|
3285
|
-
*
|
|
3286
|
-
* @remarks
|
|
3287
|
-
* ❗ Commands that are not present in the `commands` array will be __deleted__.
|
|
3288
|
-
*
|
|
3289
|
-
* ⚠️ Commands that do not already exist will count towards the daily limit of _200_ new commands.
|
|
3290
|
-
*
|
|
3291
|
-
* @see {@link https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-global-application-commands}
|
|
3292
|
-
*/
|
|
3293
|
-
upsertGlobalApplicationCommands: (commands: CreateApplicationCommand[]) => Promise<Camelize<DiscordApplicationCommand[]>>;
|
|
3294
|
-
/**
|
|
3295
|
-
* Re-registers the list of application commands registered in a guild, overwriting the previous commands completely.
|
|
3296
|
-
*
|
|
3297
|
-
* @param guildId - The ID of the guild whose list of commands to overwrite.
|
|
3298
|
-
* @param commands - The list of commands to use to overwrite the previous list.
|
|
3299
|
-
* @returns A collection of {@link ApplicationCommand} objects assorted by command ID.
|
|
3300
|
-
*
|
|
3301
|
-
* @remarks
|
|
3302
|
-
* ❗ Commands that are not present in the `commands` array will be __deleted__.
|
|
3303
|
-
*
|
|
3304
|
-
* ⚠️ Commands that do not already exist will count towards the daily limit of _200_ new commands.
|
|
3305
|
-
*
|
|
3306
|
-
* @see {@link https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-guild-application-commands}
|
|
3307
|
-
*/
|
|
3308
|
-
upsertGuildApplicationCommands: (guildId: BigString, commands: CreateApplicationCommand[]) => Promise<Camelize<DiscordApplicationCommand[]>>;
|
|
3309
|
-
/**
|
|
3310
|
-
* Bans a user from a guild.
|
|
3311
|
-
*
|
|
3312
|
-
|
|
3313
|
-
* @param guildId - The ID of the guild to ban the user from.
|
|
3314
|
-
* @param userId - The ID of the user to ban from the guild.
|
|
3315
|
-
* @param options - The parameters for the creation of the ban.
|
|
3316
|
-
*
|
|
3317
|
-
* @remarks
|
|
3318
|
-
* Requires the `BAN_MEMBERS` permission.
|
|
3319
|
-
*
|
|
3320
|
-
* Fires a _Guild Ban Add_ gateway event.
|
|
3321
|
-
*
|
|
3322
|
-
* @see {@link https://discord.com/developers/docs/resources/guild#create-guild-ban}
|
|
3323
|
-
*/
|
|
3324
|
-
banMember: (guildId: BigString, userId: BigString, options?: CreateGuildBan) => Promise<void>;
|
|
3325
|
-
/**
|
|
3326
|
-
* Edits the nickname of the bot user.
|
|
3327
|
-
*
|
|
3328
|
-
* @param guildId - The ID of the guild to edit the nickname of the bot user in.
|
|
3329
|
-
* @param options - The parameters for the edit of the nickname.
|
|
3330
|
-
* @returns An instance of the edited {@link DiscordMember}
|
|
3331
|
-
*
|
|
3332
|
-
* @remarks
|
|
3333
|
-
* Fires a _Guild Member Update_ gateway event.
|
|
3334
|
-
*
|
|
3335
|
-
* @see {@link https://discord.com/developers/docs/resources/guild#modify-current-member}
|
|
3336
|
-
*/
|
|
3337
|
-
editBotMember: (guildId: BigString, options: EditBotMemberOptions) => Promise<Camelize<DiscordMember>>;
|
|
3338
|
-
/**
|
|
3339
|
-
* Edits a member's properties.
|
|
3340
|
-
*
|
|
3341
|
-
* @param guildId - The ID of the guild to edit the member of.
|
|
3342
|
-
* @param userId - The user ID of the member to edit.
|
|
3343
|
-
* @param options - The parameters for the edit of the user.
|
|
3344
|
-
*
|
|
3345
|
-
* @remarks
|
|
3346
|
-
* This endpoint requires various permissions depending on what is edited about the member.
|
|
3347
|
-
* To find out the required permission to enact a change, read the documentation of this endpoint's {@link ModifyGuildMember | parameters}.
|
|
3348
|
-
*
|
|
3349
|
-
* Fires a _Guild Member Update_ gateway event.
|
|
3350
|
-
*
|
|
3351
|
-
* @see {@link https://discord.com/developers/docs/resources/guild#modify-guild-member}
|
|
3352
|
-
*/
|
|
3353
|
-
editMember: (guildId: BigString, userId: BigString, options: ModifyGuildMember) => Promise<Camelize<DiscordMember>>;
|
|
3354
|
-
/**
|
|
3355
|
-
* Gets the member object by user ID.
|
|
3356
|
-
*
|
|
3357
|
-
|
|
3358
|
-
* @param guildId - The ID of the guild to get the member object for.
|
|
3359
|
-
* @param userId - The ID of the user to get the member object for.
|
|
3360
|
-
* @returns An instance of {@link DiscordMemberWithUser}.
|
|
3361
|
-
*
|
|
3362
|
-
* @see {@link https://discord.com/developers/docs/resources/guild#get-guild-member}
|
|
3363
|
-
*/
|
|
3364
|
-
getMember: (guildId: BigString, userId: BigString) => Promise<Camelize<DiscordMemberWithUser>>;
|
|
3365
|
-
/**
|
|
3366
|
-
* Gets the list of members for a guild.
|
|
3367
|
-
*
|
|
3368
|
-
* @param guildId - The ID of the guild to get the list of members for.
|
|
3369
|
-
* @param options - The parameters for the fetching of the members.
|
|
3370
|
-
* @returns A collection of {@link DiscordMemberWithUser} objects assorted by user ID.
|
|
3371
|
-
*
|
|
3372
|
-
* @remarks
|
|
3373
|
-
* Requires the `GUILD_MEMBERS` intent.
|
|
3374
|
-
*
|
|
3375
|
-
* ⚠️ It is not recommended to use this endpoint with very large bots. Instead, opt to use `fetchMembers()`:
|
|
3376
|
-
* REST communication only permits 50 requests to be made per second, while gateways allow for up to 120 requests
|
|
3377
|
-
* per minute per shard. For more information, read {@link https://discord.com/developers/docs/topics/rate-limits#rate-limits}.
|
|
3378
|
-
*
|
|
3379
|
-
* @see {@link https://discord.com/developers/docs/resources/guild#list-guild-members}
|
|
3380
|
-
* @see {@link https://discord.com/developers/docs/topics/gateway#request-guild-members}
|
|
3381
|
-
* @see {@link https://discord.com/developers/docs/topics/rate-limits#rate-limits}
|
|
3382
|
-
*/
|
|
3383
|
-
getMembers: (guildId: BigString, options: ListGuildMembers) => Promise<Camelize<DiscordMemberWithUser[]>>;
|
|
3384
|
-
/**
|
|
3385
|
-
* Kicks a member from a guild.
|
|
3386
|
-
*
|
|
3387
|
-
|
|
3388
|
-
* @param guildId - The ID of the guild to kick the member from.
|
|
3389
|
-
* @param userId - The user ID of the member to kick from the guild.
|
|
3390
|
-
*
|
|
3391
|
-
* @remarks
|
|
3392
|
-
* Requires the `KICK_MEMBERS` permission.
|
|
3393
|
-
*
|
|
3394
|
-
* Fires a _Guild Member Remove_ gateway event.
|
|
3395
|
-
*
|
|
3396
|
-
* @see {@link https://discord.com/developers/docs/resources/guild#remove-guild-member}
|
|
3397
|
-
*/
|
|
3398
|
-
kickMember: (guildId: BigString, userId: BigString, reason?: string) => Promise<void>;
|
|
3399
|
-
/**
|
|
3400
|
-
* Initiates the process of pruning inactive members.
|
|
3401
|
-
*
|
|
3402
|
-
|
|
3403
|
-
* @param guildId - The ID of the guild to prune the members of.
|
|
3404
|
-
* @param options - The parameters for the pruning of members.
|
|
3405
|
-
* @returns A number indicating how many members were pruned.
|
|
3406
|
-
*
|
|
3407
|
-
* @remarks
|
|
3408
|
-
* Requires the `KICK_MEMBERS` permission.
|
|
3409
|
-
*
|
|
3410
|
-
* ❗ Requests to this endpoint will time out for large guilds. To prevent this from happening, set the {@link BeginGuildPrune.computePruneCount} property of the {@link options} object parameter to `false`. This will begin the process of pruning, and immediately return `undefined`, rather than wait for the process to complete before returning the actual count of members that have been kicked.
|
|
3411
|
-
*
|
|
3412
|
-
* ⚠️ By default, this process will not remove members with a role. To include the members who have a _particular subset of roles_, specify the role(s) in the {@link BeginGuildPrune.includeRoles | includeRoles} property of the {@link options} object parameter.
|
|
3413
|
-
*
|
|
3414
|
-
* Fires a _Guild Member Remove_ gateway event for every member kicked.
|
|
3415
|
-
*
|
|
3416
|
-
* @see {@link https://discord.com/developers/docs/resources/guild#begin-guild-prune}
|
|
3417
|
-
*/
|
|
3418
|
-
pruneMembers: (guildId: BigString, options: BeginGuildPrune) => Promise<{
|
|
3419
|
-
pruned: number | null;
|
|
3420
|
-
}>;
|
|
3421
|
-
/**
|
|
3422
|
-
* Gets the list of members whose usernames or nicknames start with a provided string.
|
|
3423
|
-
*
|
|
3424
|
-
|
|
3425
|
-
* @param guildId - The ID of the guild to search in.
|
|
3426
|
-
* @param query - The string to match usernames or nicknames against.
|
|
3427
|
-
* @param options - The parameters for searching through the members.
|
|
3428
|
-
* @returns A collection of {@link DiscordMember} objects assorted by user ID.
|
|
3429
|
-
*
|
|
3430
|
-
* @see {@link https://discord.com/developers/docs/resources/guild#search-guild-members}
|
|
3431
|
-
*/
|
|
3432
|
-
searchMembers: (guildId: BigString, query: string, options?: Omit<SearchMembers, 'query'>) => Promise<Camelize<DiscordMemberWithUser[]>>;
|
|
3433
|
-
/**
|
|
3434
|
-
* Unbans a user from a guild.
|
|
3435
|
-
*
|
|
3436
|
-
|
|
3437
|
-
* @param guildId - The ID of the guild to unban the user in.
|
|
3438
|
-
* @param userId - The ID of the user to unban.
|
|
3439
|
-
*
|
|
3440
|
-
* @remarks
|
|
3441
|
-
* Requires the `BAN_MEMBERS` permission.
|
|
3442
|
-
*
|
|
3443
|
-
* Fires a _Guild Ban Remove_ gateway event.
|
|
3444
|
-
*
|
|
3445
|
-
* @see {@link https://discord.com/developers/docs/resources/guild#remove-guild-ban}
|
|
3446
|
-
*/
|
|
3447
|
-
unbanMember: (guildId: BigString, userId: BigString) => Promise<void>;
|
|
3448
|
-
}
|
|
3449
|
-
export type RequestMethods = 'GET' | 'POST' | 'DELETE' | 'PATCH' | 'PUT';
|
|
3450
|
-
export type ApiVersions = 9 | 10;
|
|
3451
|
-
export interface CreateWebhook extends WithReason {
|
|
3452
|
-
/** Name of the webhook (1-80 characters) */
|
|
3453
|
-
name: string;
|
|
3454
|
-
/** Image url for the default webhook avatar */
|
|
3455
|
-
avatar?: string | null;
|
|
3456
|
-
}
|
|
3457
|
-
export interface CreateRequestBodyOptions {
|
|
3458
|
-
headers?: Record<string, string>;
|
|
3459
|
-
method: RequestMethods;
|
|
3460
|
-
body?: Record<string, unknown>;
|
|
3461
|
-
unauthorized?: boolean;
|
|
3462
|
-
url?: string;
|
|
3463
|
-
}
|
|
3464
|
-
export interface RequestBody {
|
|
3465
|
-
headers: Record<string, string>;
|
|
3466
|
-
body: string | FormData;
|
|
3467
|
-
method: RequestMethods;
|
|
3468
|
-
}
|
|
3469
|
-
export interface SendRequestOptions {
|
|
3470
|
-
/** The url to send the request to. */
|
|
3471
|
-
url: string;
|
|
3472
|
-
/** The method to use when sending the request. */
|
|
3473
|
-
method: RequestMethods;
|
|
3474
|
-
/** The body to be sent in the request. */
|
|
3475
|
-
body?: Record<string, any>;
|
|
3476
|
-
/** The amount of times this request has been retried. */
|
|
3477
|
-
retryCount: number;
|
|
3478
|
-
/** Handler to retry a request should it be rate limited. */
|
|
3479
|
-
retryRequest?: (options: SendRequestOptions) => Promise<void>;
|
|
3480
|
-
/** Resolve handler when a request succeeds. */
|
|
3481
|
-
resolve: (value: any | PromiseLike<any>) => void;
|
|
3482
|
-
/** Reject handler when a request fails. */
|
|
3483
|
-
reject: (reason?: any) => void;
|
|
3484
|
-
/** If this request has a bucket id which it falls under for rate limit */
|
|
3485
|
-
bucketId?: string;
|
|
3486
|
-
/** Additional request options, used for things like overriding authorization header. */
|
|
3487
|
-
options?: Record<string, any>;
|
|
3488
|
-
}
|
|
3489
|
-
export interface RestRateLimitedPath {
|
|
3490
|
-
url: string;
|
|
3491
|
-
resetTimestamp: number;
|
|
3492
|
-
bucketId?: string;
|
|
3493
|
-
}
|
|
3494
|
-
export interface WebhookMessageEditor {
|
|
3495
|
-
/**
|
|
3496
|
-
* Edits a webhook message.
|
|
3497
|
-
*
|
|
3498
|
-
* @param webhookId - The ID of the webhook to edit the message of.
|
|
3499
|
-
* @param token - The webhook token, used to edit the message.
|
|
3500
|
-
* @param messageId - The ID of the message to edit.
|
|
3501
|
-
* @param options - The parameters for the edit of the message.
|
|
3502
|
-
* @returns An instance of the edited {@link DiscordMessage}.
|
|
3503
|
-
*
|
|
3504
|
-
* @remarks
|
|
3505
|
-
* Fires a _Message Update_ gateway event.
|
|
3506
|
-
*
|
|
3507
|
-
* @see {@link https://discord.com/developers/docs/resources/webhook#edit-webhook-message}
|
|
3508
|
-
*/
|
|
3509
|
-
(webhookId: BigString, token: string, messageId: BigString, options: InteractionCallbackData & {
|
|
3510
|
-
threadId?: BigString;
|
|
3511
|
-
}): Promise<Camelize<DiscordMessage>>;
|
|
3512
|
-
/**
|
|
3513
|
-
* Edits the original webhook message.
|
|
3514
|
-
*
|
|
3515
|
-
* @param webhookId - The ID of the webhook to edit the original message of.
|
|
3516
|
-
* @param token - The webhook token, used to edit the message.
|
|
3517
|
-
* @param options - The parameters for the edit of the message.
|
|
3518
|
-
* @returns An instance of the edited {@link DiscordMessage}.
|
|
3519
|
-
*
|
|
3520
|
-
* @remarks
|
|
3521
|
-
* Fires a _Message Update_ gateway event.
|
|
3522
|
-
*
|
|
3523
|
-
* @see {@link https://discord.com/developers/docs/resources/webhook#edit-webhook-message}
|
|
3524
|
-
*/
|
|
3525
|
-
original: (webhookId: BigString, token: string, options: InteractionCallbackData & {
|
|
3526
|
-
threadId?: BigString;
|
|
3527
|
-
}) => Promise<Camelize<DiscordMessage>>;
|
|
3528
|
-
}
|
|
3529
|
-
export interface CreateTemplate {
|
|
3530
|
-
/** Name which the template should have */
|
|
3531
|
-
name: string;
|
|
3532
|
-
/** Description of the template */
|
|
3533
|
-
description?: string;
|
|
3534
|
-
}
|
|
3535
|
-
/** https://discord.com/developers/docs/resources/template#modify-guild-template */
|
|
3536
|
-
export interface ModifyGuildTemplate {
|
|
3537
|
-
/** Name of the template (1-100 characters) */
|
|
3538
|
-
name?: string;
|
|
3539
|
-
/** Description of the template (0-120 characters) */
|
|
3540
|
-
description?: string | null;
|
|
3541
|
-
}
|
|
3542
|
-
/** https://discord.com/developers/docs/resources/guild#create-guild-ban */
|
|
3543
|
-
export interface CreateGuildBan extends WithReason {
|
|
3544
|
-
/** Number of seconds to delete messages for, between 0 and 604800 (7 days) */
|
|
3545
|
-
deleteMessageSeconds?: number;
|
|
3546
|
-
}
|
|
3547
|
-
export interface EditBotMemberOptions extends WithReason {
|
|
3548
|
-
nick?: string | null;
|
|
3549
|
-
}
|
|
3550
|
-
/** https://discord.com/developers/docs/resources/guild#modify-guild-member */
|
|
3551
|
-
export interface ModifyGuildMember {
|
|
3552
|
-
/** Value to set users nickname to. Requires the `MANAGE_NICKNAMES` permission */
|
|
3553
|
-
nick?: string | null;
|
|
3554
|
-
/** Array of role ids the member is assigned. Requires the `MANAGE_ROLES` permission */
|
|
3555
|
-
roles?: BigString[] | null;
|
|
3556
|
-
/** Whether the user is muted in voice channels. Will throw a 400 if the user is not in a voice channel. Requires the `MUTE_MEMBERS` permission */
|
|
3557
|
-
mute?: boolean | null;
|
|
3558
|
-
/** Whether the user is deafened in voice channels. Will throw a 400 if the user is not in a voice channel. Requires the `MOVE_MEMBERS` permission */
|
|
3559
|
-
deaf?: boolean | null;
|
|
3560
|
-
/** Id of channel to move user to (if they are connected to voice). Requires the `MOVE_MEMBERS` permission */
|
|
3561
|
-
channelId?: BigString | null;
|
|
3562
|
-
/** when the user's timeout will expire and the user will be able to communicate in the guild again (up to 28 days in the future), set to null to remove timeout. Requires the `MODERATE_MEMBERS` permission */
|
|
3563
|
-
communicationDisabledUntil?: number | null;
|
|
3564
|
-
}
|
|
3565
|
-
/** https://discord.com/developers/docs/resources/guild#begin-guild-prune */
|
|
3566
|
-
export interface BeginGuildPrune {
|
|
3567
|
-
/** Number of days to prune (1 or more), default: 7 */
|
|
3568
|
-
days?: number;
|
|
3569
|
-
/** Whether 'pruned' is returned, discouraged for large guilds, default: true */
|
|
3570
|
-
computePruneCount?: boolean;
|
|
3571
|
-
/** Role(s) ro include, default: none */
|
|
3572
|
-
includeRoles?: string[];
|
|
3573
|
-
}
|
|
3574
3
|
//# sourceMappingURL=manager.d.ts.map
|