snowtransfer 0.10.7 → 0.10.8
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 +215 -11
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +11 -11
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { EventEmitter } from 'events';
|
|
2
|
-
import { Response, FormData
|
|
3
|
-
import { RESTGetAPIAuditLogQuery, RESTGetAPIAuditLogResult, RESTGetAPIAutoModerationRulesResult, RESTGetAPIAutoModerationRuleResult, RESTPostAPIAutoModerationRuleJSONBody, RESTPostAPIAutoModerationRuleResult, RESTPatchAPIAutoModerationRuleJSONBody, RESTPatchAPIAutoModerationRuleResult, RESTDeleteAPIAutoModerationRuleResult, RESTGetAPIGatewayResult, RESTGetAPIGatewayBotResult, RESTGetAPIChannelResult, RESTPatchAPIChannelJSONBody, RESTPatchAPIChannelResult, APIThreadChannel, RESTDeleteAPIChannelResult, RESTGetAPIChannelMessagesQuery, RESTGetAPIChannelMessagesResult, RESTGetAPIChannelMessageResult, RESTPostAPIChannelMessageJSONBody, RESTPostAPIChannelMessageResult, RESTPostAPIChannelMessageCrosspostResult, RESTPutAPIChannelMessageReactionResult, RESTDeleteAPIChannelMessageUserReactionResult, RESTDeleteAPIChannelMessageReactionResult, RESTGetAPIChannelMessageReactionUsersQuery, RESTGetAPIChannelMessageReactionUsersResult, RESTDeleteAPIChannelAllMessageReactionsResult, RESTPatchAPIChannelMessageJSONBody, RESTPatchAPIChannelMessageResult, RESTDeleteAPIChannelMessageResult, RESTPostAPIChannelMessagesBulkDeleteResult, RESTPutAPIChannelPermissionJSONBody, RESTPutAPIChannelPermissionResult, RESTGetAPIChannelInvitesResult, RESTPostAPIChannelInviteJSONBody, RESTPostAPIChannelInviteResult, RESTDeleteAPIChannelPermissionResult, RESTPostAPIChannelFollowersResult, RESTPostAPIChannelTypingResult, RESTGetAPIChannelPinsResult, RESTPutAPIChannelPinResult, RESTDeleteAPIChannelPinResult, RESTPostAPIChannelMessagesThreadsJSONBody, RESTPostAPIChannelMessagesThreadsResult, RESTPostAPIChannelThreadsJSONBody, APITextBasedChannel, ChannelType, RESTPutAPIChannelThreadMembersResult, RESTDeleteAPIChannelThreadMembersResult, RESTGetAPIChannelThreadMemberResult, RESTGetAPIChannelThreadMembersQuery, RESTGetAPIChannelThreadMembersResult, RESTGetAPIChannelThreadsArchivedQuery, RESTGetAPIChannelThreadsArchivedPublicResult, RESTGetAPIChannelThreadsArchivedPrivateResult, RESTGetAPIChannelUsersThreadsArchivedResult, RESTGetAPIGuildEmojisResult, RESTGetAPIGuildEmojiResult, RESTPostAPIGuildEmojiJSONBody, RESTPostAPIGuildEmojiResult, RESTPatchAPIGuildEmojiJSONBody, RESTPatchAPIGuildEmojiResult, RESTDeleteAPIGuildEmojiResult, RESTGetAPIStickerResult, RESTGetAPIGuildStickersResult, RESTGetAPIGuildStickerResult, RESTPostAPIGuildStickerFormDataBody, RESTPostAPIGuildStickerResult, RESTPatchAPIGuildStickerJSONBody, RESTPatchAPIGuildStickerResult, RESTDeleteAPIGuildStickerResult, RESTPostAPIGuildsJSONBody, RESTPostAPIGuildsResult, RESTGetAPIGuildResult, RESTGetAPIGuildPreviewResult, RESTPatchAPIGuildJSONBody, RESTPatchAPIGuildResult, RESTDeleteAPIGuildResult, RESTGetAPIGuildChannelsResult, RESTPostAPIGuildChannelJSONBody, RESTPostAPIGuildChannelResult, RESTPatchAPIGuildChannelPositionsJSONBody, RESTPatchAPIGuildChannelPositionsResult, RESTGetAPIGuildThreadsResult, RESTGetAPIGuildMemberResult, RESTGetAPIGuildMembersQuery, RESTGetAPIGuildMembersResult, RESTGetAPIGuildMembersSearchQuery, RESTGetAPIGuildMembersSearchResult, RESTPutAPIGuildMemberJSONBody, RESTPutAPIGuildMemberResult, RESTPatchAPIGuildMemberJSONBody, RESTPatchAPIGuildMemberResult, RESTPatchAPICurrentGuildMemberJSONBody, APIGuildMember, RESTPutAPIGuildMemberRoleResult, RESTDeleteAPIGuildMemberRoleResult, RESTDeleteAPIGuildMemberResult, RESTGetAPIGuildBansQuery, RESTGetAPIGuildBansResult, RESTGetAPIGuildBanResult, RESTPutAPIGuildBanJSONBody, RESTPutAPIGuildBanResult, RESTDeleteAPIGuildBanResult, RESTGetAPIGuildRolesResult, RESTPostAPIGuildRoleJSONBody, RESTPostAPIGuildRoleResult, RESTPatchAPIGuildRolePositionsJSONBody, RESTPatchAPIGuildRolePositionsResult, RESTPatchAPIGuildRoleJSONBody, RESTPatchAPIGuildRoleResult, RESTDeleteAPIGuildRoleResult, RESTGetAPIGuildPruneCountQuery, RESTGetAPIGuildPruneCountResult, RESTPostAPIGuildPruneJSONBody, RESTPostAPIGuildPruneResult, RESTGetAPIGuildVoiceRegionsResult, RESTGetAPIGuildInvitesResult, RESTGetAPIGuildIntegrationsResult, RESTDeleteAPIGuildIntegrationResult, RESTGetAPIGuildWidgetSettingsResult, RESTPatchAPIGuildWidgetSettingsJSONBody, RESTPatchAPIGuildWidgetSettingsResult, APIGuildWidget, RESTGetAPIGuildVanityUrlResult, RESTGetAPIGuildWelcomeScreenResult, RESTPatchAPIGuildWelcomeScreenJSONBody, RESTPatchAPIGuildWelcomeScreenResult, RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody, RESTPatchAPIGuildVoiceStateCurrentMemberResult, RESTPatchAPIGuildVoiceStateUserJSONBody, RESTPatchAPIGuildVoiceStateUserResult, RESTGetAPIGuildScheduledEventsResult, RESTPostAPIGuildScheduledEventJSONBody, RESTPostAPIGuildScheduledEventResult, RESTGetAPIGuildScheduledEventResult, RESTPatchAPIGuildScheduledEventJSONBody, RESTPatchAPIGuildScheduledEventResult, RESTDeleteAPIGuildScheduledEventResult, RESTGetAPIGuildScheduledEventUsersQuery, RESTGetAPIGuildScheduledEventUsersResult, RESTGetAPITemplateResult, RESTPostAPITemplateCreateGuildJSONBody, RESTPostAPITemplateCreateGuildResult, RESTGetAPIGuildTemplatesResult, RESTPostAPIGuildTemplatesJSONBody, RESTPostAPIGuildTemplatesResult, RESTPutAPIGuildTemplateSyncResult, RESTPatchAPIGuildTemplateJSONBody, RESTPatchAPIGuildTemplateResult, RESTDeleteAPIGuildTemplateResult, RESTPostAPIChannelWebhookJSONBody, RESTPostAPIChannelWebhookResult, RESTGetAPIChannelWebhooksResult, RESTGetAPIGuildWebhooksResult, RESTGetAPIWebhookResult, RESTPatchAPIWebhookWithTokenJSONBody, RESTPatchAPIWebhookWithTokenResult, RESTPatchAPIWebhookJSONBody, RESTPatchAPIWebhookResult, RESTDeleteAPIWebhookResult, RESTPostAPIWebhookWithTokenJSONBody, RESTPostAPIWebhookWithTokenQuery, RESTPostAPIWebhookWithTokenResult, RESTPostAPIWebhookWithTokenWaitResult, RESTPostAPIWebhookWithTokenSlackQuery, RESTPostAPIWebhookWithTokenSlackResult, RESTPostAPIWebhookWithTokenSlackWaitResult, RESTPostAPIWebhookWithTokenGitHubQuery, RESTPostAPIWebhookWithTokenGitHubResult, RESTPostAPIWebhookWithTokenGitHubWaitResult, RESTGetAPIWebhookWithTokenMessageResult, RESTPatchAPIWebhookWithTokenMessageJSONBody, RESTPatchAPIWebhookWithTokenMessageResult, RESTDeleteAPIWebhookWithTokenMessageResult, RESTGetAPIApplicationCommandsResult, RESTPostAPIApplicationCommandsJSONBody, RESTPostAPIApplicationCommandsResult, RESTGetAPIApplicationCommandResult, RESTPatchAPIApplicationCommandJSONBody, RESTPatchAPIApplicationCommandResult, RESTPutAPIApplicationCommandsJSONBody, RESTPutAPIApplicationCommandsResult, RESTGetAPIApplicationGuildCommandsResult, RESTPostAPIApplicationGuildCommandsJSONBody, RESTPostAPIApplicationGuildCommandsResult, RESTGetAPIApplicationGuildCommandResult, RESTPatchAPIApplicationGuildCommandJSONBody, RESTPatchAPIApplicationGuildCommandResult, RESTPutAPIApplicationGuildCommandsJSONBody, RESTPutAPIApplicationGuildCommandsResult, RESTGetAPIApplicationCommandPermissionsResult, RESTPutAPIApplicationCommandPermissionsJSONBody, RESTPutAPIApplicationCommandPermissionsResult, RESTPostAPIInteractionCallbackJSONBody, RESTGetAPIInteractionOriginalResponseResult, RESTPatchAPIInteractionOriginalResponseJSONBody, RESTPatchAPIInteractionOriginalResponseResult, RESTDeleteAPIInteractionOriginalResponseResult, RESTPostAPIInteractionFollowupJSONBody, RESTPostAPIInteractionFollowupResult, RESTGetAPIInteractionFollowupResult, RESTPatchAPIInteractionFollowupJSONBody, RESTPatchAPIInteractionFollowupResult, RESTDeleteAPIInteractionFollowupResult, RESTGetAPIInviteQuery, RESTGetAPIInviteResult, RESTDeleteAPIInviteResult, RESTPostAPIStageInstanceJSONBody, RESTPostAPIStageInstanceResult, RESTGetAPIStageInstanceResult, RESTPatchAPIStageInstanceJSONBody, RESTPatchAPIStageInstanceResult, RESTDeleteAPIStageInstanceResult, RESTGetAPICurrentUserResult, RESTGetAPIUserResult, RESTPatchAPICurrentUserJSONBody, RESTPatchAPICurrentUserResult, RESTGetAPICurrentUserGuildsQuery, RESTGetAPICurrentUserGuildsResult, RESTDeleteAPICurrentUserGuildResult, RESTPostAPICurrentUserCreateDMChannelResult, RESTGetAPICurrentUserConnectionsResult, RESTGetAPICurrentUserApplicationRoleConnectionResult, RESTPutAPICurrentUserApplicationRoleConnectionJSONBody, RESTPutAPICurrentUserApplicationRoleConnectionResult, RESTGetAPIVoiceRegionsResult,
|
|
2
|
+
import { Response, FormData } from 'undici';
|
|
3
|
+
import { RESTGetAPIAuditLogQuery, RESTGetAPIAuditLogResult, RESTGetAPIAutoModerationRulesResult, RESTGetAPIAutoModerationRuleResult, RESTPostAPIAutoModerationRuleJSONBody, RESTPostAPIAutoModerationRuleResult, RESTPatchAPIAutoModerationRuleJSONBody, RESTPatchAPIAutoModerationRuleResult, RESTDeleteAPIAutoModerationRuleResult, RESTGetAPIGatewayResult, RESTGetAPIGatewayBotResult, RESTGetAPIChannelResult, RESTPatchAPIChannelJSONBody, RESTPatchAPIChannelResult, APIThreadChannel, RESTDeleteAPIChannelResult, RESTGetAPIChannelMessagesQuery, RESTGetAPIChannelMessagesResult, RESTGetAPIChannelMessageResult, RESTPostAPIChannelMessageJSONBody, RESTPostAPIChannelMessageResult, RESTPostAPIChannelMessageCrosspostResult, RESTPutAPIChannelMessageReactionResult, RESTDeleteAPIChannelMessageUserReactionResult, RESTDeleteAPIChannelMessageReactionResult, RESTGetAPIChannelMessageReactionUsersQuery, RESTGetAPIChannelMessageReactionUsersResult, RESTDeleteAPIChannelAllMessageReactionsResult, RESTPatchAPIChannelMessageJSONBody, RESTPatchAPIChannelMessageResult, RESTDeleteAPIChannelMessageResult, RESTPostAPIChannelMessagesBulkDeleteResult, RESTPutAPIChannelPermissionJSONBody, RESTPutAPIChannelPermissionResult, RESTGetAPIChannelInvitesResult, RESTPostAPIChannelInviteJSONBody, RESTPostAPIChannelInviteResult, RESTDeleteAPIChannelPermissionResult, RESTPostAPIChannelFollowersResult, RESTPostAPIChannelTypingResult, RESTGetAPIChannelPinsResult, RESTPutAPIChannelPinResult, RESTDeleteAPIChannelPinResult, RESTPostAPIChannelMessagesThreadsJSONBody, RESTPostAPIChannelMessagesThreadsResult, RESTPostAPIChannelThreadsJSONBody, APITextBasedChannel, ChannelType, RESTPutAPIChannelThreadMembersResult, RESTDeleteAPIChannelThreadMembersResult, RESTGetAPIChannelThreadMemberResult, RESTGetAPIChannelThreadMembersQuery, RESTGetAPIChannelThreadMembersResult, RESTGetAPIChannelThreadsArchivedQuery, RESTGetAPIChannelThreadsArchivedPublicResult, RESTGetAPIChannelThreadsArchivedPrivateResult, RESTGetAPIChannelUsersThreadsArchivedResult, RESTGetAPIGuildEmojisResult, RESTGetAPIGuildEmojiResult, RESTPostAPIGuildEmojiJSONBody, RESTPostAPIGuildEmojiResult, RESTPatchAPIGuildEmojiJSONBody, RESTPatchAPIGuildEmojiResult, RESTDeleteAPIGuildEmojiResult, RESTGetAPIStickerResult, RESTGetAPIGuildStickersResult, RESTGetAPIGuildStickerResult, RESTPostAPIGuildStickerFormDataBody, RESTPostAPIGuildStickerResult, RESTPatchAPIGuildStickerJSONBody, RESTPatchAPIGuildStickerResult, RESTDeleteAPIGuildStickerResult, RESTPostAPIGuildsJSONBody, RESTPostAPIGuildsResult, RESTGetAPIGuildResult, RESTGetAPIGuildPreviewResult, RESTPatchAPIGuildJSONBody, RESTPatchAPIGuildResult, RESTDeleteAPIGuildResult, RESTGetAPIGuildChannelsResult, RESTPostAPIGuildChannelJSONBody, RESTPostAPIGuildChannelResult, RESTPatchAPIGuildChannelPositionsJSONBody, RESTPatchAPIGuildChannelPositionsResult, RESTGetAPIGuildThreadsResult, RESTGetAPIGuildMemberResult, RESTGetAPIGuildMembersQuery, RESTGetAPIGuildMembersResult, RESTGetAPIGuildMembersSearchQuery, RESTGetAPIGuildMembersSearchResult, RESTPutAPIGuildMemberJSONBody, RESTPutAPIGuildMemberResult, RESTPatchAPIGuildMemberJSONBody, RESTPatchAPIGuildMemberResult, RESTPatchAPICurrentGuildMemberJSONBody, APIGuildMember, RESTPutAPIGuildMemberRoleResult, RESTDeleteAPIGuildMemberRoleResult, RESTDeleteAPIGuildMemberResult, RESTGetAPIGuildBansQuery, RESTGetAPIGuildBansResult, RESTGetAPIGuildBanResult, RESTPutAPIGuildBanJSONBody, RESTPutAPIGuildBanResult, RESTDeleteAPIGuildBanResult, RESTGetAPIGuildRolesResult, RESTPostAPIGuildRoleJSONBody, RESTPostAPIGuildRoleResult, RESTPatchAPIGuildRolePositionsJSONBody, RESTPatchAPIGuildRolePositionsResult, RESTPatchAPIGuildRoleJSONBody, RESTPatchAPIGuildRoleResult, RESTDeleteAPIGuildRoleResult, RESTGetAPIGuildPruneCountQuery, RESTGetAPIGuildPruneCountResult, RESTPostAPIGuildPruneJSONBody, RESTPostAPIGuildPruneResult, RESTGetAPIGuildVoiceRegionsResult, RESTGetAPIGuildInvitesResult, RESTGetAPIGuildIntegrationsResult, RESTDeleteAPIGuildIntegrationResult, RESTGetAPIGuildWidgetSettingsResult, RESTPatchAPIGuildWidgetSettingsJSONBody, RESTPatchAPIGuildWidgetSettingsResult, APIGuildWidget, RESTGetAPIGuildVanityUrlResult, RESTGetAPIGuildWelcomeScreenResult, RESTPatchAPIGuildWelcomeScreenJSONBody, RESTPatchAPIGuildWelcomeScreenResult, RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody, RESTPatchAPIGuildVoiceStateCurrentMemberResult, RESTPatchAPIGuildVoiceStateUserJSONBody, RESTPatchAPIGuildVoiceStateUserResult, RESTGetAPIGuildScheduledEventsResult, RESTPostAPIGuildScheduledEventJSONBody, RESTPostAPIGuildScheduledEventResult, RESTGetAPIGuildScheduledEventResult, RESTPatchAPIGuildScheduledEventJSONBody, RESTPatchAPIGuildScheduledEventResult, RESTDeleteAPIGuildScheduledEventResult, RESTGetAPIGuildScheduledEventUsersQuery, RESTGetAPIGuildScheduledEventUsersResult, RESTGetAPITemplateResult, RESTPostAPITemplateCreateGuildJSONBody, RESTPostAPITemplateCreateGuildResult, RESTGetAPIGuildTemplatesResult, RESTPostAPIGuildTemplatesJSONBody, RESTPostAPIGuildTemplatesResult, RESTPutAPIGuildTemplateSyncResult, RESTPatchAPIGuildTemplateJSONBody, RESTPatchAPIGuildTemplateResult, RESTDeleteAPIGuildTemplateResult, RESTPostAPIChannelWebhookJSONBody, RESTPostAPIChannelWebhookResult, RESTGetAPIChannelWebhooksResult, RESTGetAPIGuildWebhooksResult, RESTGetAPIWebhookResult, RESTPatchAPIWebhookWithTokenJSONBody, RESTPatchAPIWebhookWithTokenResult, RESTPatchAPIWebhookJSONBody, RESTPatchAPIWebhookResult, RESTDeleteAPIWebhookResult, RESTPostAPIWebhookWithTokenJSONBody, RESTPostAPIWebhookWithTokenQuery, RESTPostAPIWebhookWithTokenResult, RESTPostAPIWebhookWithTokenWaitResult, RESTPostAPIWebhookWithTokenSlackQuery, RESTPostAPIWebhookWithTokenSlackResult, RESTPostAPIWebhookWithTokenSlackWaitResult, RESTPostAPIWebhookWithTokenGitHubQuery, RESTPostAPIWebhookWithTokenGitHubResult, RESTPostAPIWebhookWithTokenGitHubWaitResult, RESTGetAPIWebhookWithTokenMessageResult, RESTPatchAPIWebhookWithTokenMessageJSONBody, RESTPatchAPIWebhookWithTokenMessageResult, RESTDeleteAPIWebhookWithTokenMessageResult, RESTGetAPIApplicationCommandsResult, RESTPostAPIApplicationCommandsJSONBody, RESTPostAPIApplicationCommandsResult, RESTGetAPIApplicationCommandResult, RESTPatchAPIApplicationCommandJSONBody, RESTPatchAPIApplicationCommandResult, RESTPutAPIApplicationCommandsJSONBody, RESTPutAPIApplicationCommandsResult, RESTGetAPIApplicationGuildCommandsResult, RESTPostAPIApplicationGuildCommandsJSONBody, RESTPostAPIApplicationGuildCommandsResult, RESTGetAPIApplicationGuildCommandResult, RESTPatchAPIApplicationGuildCommandJSONBody, RESTPatchAPIApplicationGuildCommandResult, RESTPutAPIApplicationGuildCommandsJSONBody, RESTPutAPIApplicationGuildCommandsResult, RESTGetAPIApplicationCommandPermissionsResult, RESTPutAPIApplicationCommandPermissionsJSONBody, RESTPutAPIApplicationCommandPermissionsResult, RESTPostAPIInteractionCallbackJSONBody, RESTGetAPIInteractionOriginalResponseResult, RESTPatchAPIInteractionOriginalResponseJSONBody, RESTPatchAPIInteractionOriginalResponseResult, RESTDeleteAPIInteractionOriginalResponseResult, RESTPostAPIInteractionFollowupJSONBody, RESTPostAPIInteractionFollowupResult, RESTGetAPIInteractionFollowupResult, RESTPatchAPIInteractionFollowupJSONBody, RESTPatchAPIInteractionFollowupResult, RESTDeleteAPIInteractionFollowupResult, RESTGetAPIInviteQuery, RESTGetAPIInviteResult, RESTDeleteAPIInviteResult, RESTPostAPIStageInstanceJSONBody, RESTPostAPIStageInstanceResult, RESTGetAPIStageInstanceResult, RESTPatchAPIStageInstanceJSONBody, RESTPatchAPIStageInstanceResult, RESTDeleteAPIStageInstanceResult, RESTGetAPICurrentUserResult, RESTGetAPIUserResult, RESTPatchAPICurrentUserJSONBody, RESTPatchAPICurrentUserResult, RESTGetAPICurrentUserGuildsQuery, RESTGetAPICurrentUserGuildsResult, RESTDeleteAPICurrentUserGuildResult, RESTPostAPICurrentUserCreateDMChannelResult, RESTGetAPICurrentUserConnectionsResult, RESTGetAPICurrentUserApplicationRoleConnectionResult, RESTPutAPICurrentUserApplicationRoleConnectionJSONBody, RESTPutAPICurrentUserApplicationRoleConnectionResult, RESTGetAPIVoiceRegionsResult, APIVoiceState } from 'discord-api-types/v10';
|
|
4
4
|
import { Readable } from 'stream';
|
|
5
5
|
import { ReadableStream } from 'stream/web';
|
|
6
|
-
import { Blob } from 'buffer';
|
|
6
|
+
import { Blob, File as File$1 } from 'buffer';
|
|
7
7
|
|
|
8
8
|
type HTTPMethod = "get" | "post" | "patch" | "head" | "put" | "delete" | "connect" | "options" | "trace";
|
|
9
9
|
type RESTPostAPIAttachmentsRefreshURLsResult = {
|
|
@@ -12,6 +12,9 @@ type RESTPostAPIAttachmentsRefreshURLsResult = {
|
|
|
12
12
|
refreshed: string;
|
|
13
13
|
}>;
|
|
14
14
|
};
|
|
15
|
+
/**
|
|
16
|
+
* @since 0.3.0
|
|
17
|
+
*/
|
|
15
18
|
declare class DiscordAPIError extends Error {
|
|
16
19
|
path: string;
|
|
17
20
|
method: HTTPMethod;
|
|
@@ -24,6 +27,7 @@ declare class DiscordAPIError extends Error {
|
|
|
24
27
|
}
|
|
25
28
|
/**
|
|
26
29
|
* Ratelimiter used for handling the ratelimits imposed by the rest api
|
|
30
|
+
* @since 0.1.0
|
|
27
31
|
* @protected
|
|
28
32
|
*/
|
|
29
33
|
declare class Ratelimiter<B extends typeof GlobalBucket = typeof GlobalBucket> {
|
|
@@ -60,6 +64,7 @@ declare class Ratelimiter<B extends typeof GlobalBucket = typeof GlobalBucket> {
|
|
|
60
64
|
/**
|
|
61
65
|
* Returns a key for saving ratelimits for routes
|
|
62
66
|
* (Taken from https://github.com/abalabahaha/eris/blob/master/lib/rest/RequestHandler.js) -> I luv u abal <3
|
|
67
|
+
* @since 0.1.0
|
|
63
68
|
* @param url url to reduce to a key something like /channels/266277541646434305/messages/266277541646434305/
|
|
64
69
|
* @param method method of the request, usual http methods like get, etc.
|
|
65
70
|
* @returns reduced url: /channels/266277541646434305/messages/:id/
|
|
@@ -67,6 +72,7 @@ declare class Ratelimiter<B extends typeof GlobalBucket = typeof GlobalBucket> {
|
|
|
67
72
|
routify(url: string, method: string): string;
|
|
68
73
|
/**
|
|
69
74
|
* Queue a rest call to be executed
|
|
75
|
+
* @since 0.1.0
|
|
70
76
|
* @param fn function to call once the ratelimit is ready
|
|
71
77
|
* @param url Endpoint of the request
|
|
72
78
|
* @param method Http method used by the request
|
|
@@ -75,6 +81,7 @@ declare class Ratelimiter<B extends typeof GlobalBucket = typeof GlobalBucket> {
|
|
|
75
81
|
}
|
|
76
82
|
/**
|
|
77
83
|
* Bucket used for saving ratelimits
|
|
84
|
+
* @since 0.1.0
|
|
78
85
|
* @protected
|
|
79
86
|
*/
|
|
80
87
|
declare class LocalBucket {
|
|
@@ -101,26 +108,36 @@ declare class LocalBucket {
|
|
|
101
108
|
constructor(limit?: number, reset?: number, remaining?: number);
|
|
102
109
|
/**
|
|
103
110
|
* Queue a function to be executed
|
|
111
|
+
* @since 0.1.0
|
|
104
112
|
* @param fn function to be executed
|
|
105
113
|
* @returns Result of the function if any
|
|
106
114
|
*/
|
|
107
115
|
queue<T>(fn: (bucket: this) => T): Promise<T>;
|
|
116
|
+
/**
|
|
117
|
+
* Reset/make the timeout of this bucket
|
|
118
|
+
* @since 0.8.3
|
|
119
|
+
* @param durationMS Timeframe in milliseconds until the ratelimit resets after
|
|
120
|
+
*/
|
|
108
121
|
makeResetTimeout(durationMS: number): void;
|
|
109
122
|
/**
|
|
110
123
|
* Check if there are any functions in the queue that haven't been executed yet
|
|
124
|
+
* @since 0.1.0
|
|
111
125
|
*/
|
|
112
126
|
checkQueue(): void;
|
|
113
127
|
/**
|
|
114
128
|
* Reset the remaining tokens to the base limit
|
|
129
|
+
* @since 0.1.0
|
|
115
130
|
*/
|
|
116
131
|
resetRemaining(): void;
|
|
117
132
|
/**
|
|
118
133
|
* Clear the current queue of events to be sent
|
|
134
|
+
* @since 0.1.0
|
|
119
135
|
*/
|
|
120
136
|
dropQueue(): void;
|
|
121
137
|
}
|
|
122
138
|
/**
|
|
123
139
|
* Extended bucket that respects global ratelimits
|
|
140
|
+
* @since 0.10.0
|
|
124
141
|
* @protected
|
|
125
142
|
*/
|
|
126
143
|
declare class GlobalBucket extends LocalBucket {
|
|
@@ -134,10 +151,12 @@ declare class GlobalBucket extends LocalBucket {
|
|
|
134
151
|
constructor(ratelimiter: Ratelimiter, routeKey: string);
|
|
135
152
|
/**
|
|
136
153
|
* Check if there are any functions in the queue that haven't been executed yet
|
|
154
|
+
* @since 0.10.0
|
|
137
155
|
*/
|
|
138
156
|
checkQueue(): void;
|
|
139
157
|
/**
|
|
140
158
|
* Reset the remaining tokens to the base limit
|
|
159
|
+
* @since 0.10.0
|
|
141
160
|
*/
|
|
142
161
|
resetRemaining(): void;
|
|
143
162
|
}
|
|
@@ -176,6 +195,7 @@ interface RequestHandler {
|
|
|
176
195
|
}
|
|
177
196
|
/**
|
|
178
197
|
* Request Handler class
|
|
198
|
+
* @since 0.1.0
|
|
179
199
|
*/
|
|
180
200
|
declare class RequestHandler extends EventEmitter {
|
|
181
201
|
ratelimiter: Ratelimiter;
|
|
@@ -207,6 +227,7 @@ declare class RequestHandler extends EventEmitter {
|
|
|
207
227
|
} & Partial<Omit<RequestHandler["options"], "headers">>);
|
|
208
228
|
/**
|
|
209
229
|
* Request a route from the discord api
|
|
230
|
+
* @since 0.1.0
|
|
210
231
|
* @param endpoint endpoint to request
|
|
211
232
|
* @param params URL query parameters to add on to the URL
|
|
212
233
|
* @param method http method to use
|
|
@@ -217,12 +238,14 @@ declare class RequestHandler extends EventEmitter {
|
|
|
217
238
|
request<T extends "json" | "multipart">(endpoint: string, params: Record<string, any> | undefined, method: HTTPMethod, dataType?: T, data?: T extends "json" ? any : FormData, extraHeaders?: Record<string, string>, retries?: number): Promise<any>;
|
|
218
239
|
/**
|
|
219
240
|
* Apply the received ratelimit headers to the ratelimit bucket
|
|
241
|
+
* @since 0.1.0
|
|
220
242
|
* @param bkt Ratelimit bucket to apply the headers to
|
|
221
243
|
* @param headers Http headers received from discord
|
|
222
244
|
*/
|
|
223
245
|
private _applyRatelimitHeaders;
|
|
224
246
|
/**
|
|
225
247
|
* Execute a normal json request
|
|
248
|
+
* @since 0.1.0
|
|
226
249
|
* @param endpoint Endpoint to use
|
|
227
250
|
* @param params URL query parameters to add on to the URL
|
|
228
251
|
* @param data Data to send
|
|
@@ -231,6 +254,7 @@ declare class RequestHandler extends EventEmitter {
|
|
|
231
254
|
private _request;
|
|
232
255
|
/**
|
|
233
256
|
* Execute a multipart/form-data request
|
|
257
|
+
* @since 0.1.0
|
|
234
258
|
* @param endpoint Endpoint to use
|
|
235
259
|
* @param params URL query parameters to add on to the URL
|
|
236
260
|
* @param method Http Method to use
|
|
@@ -242,6 +266,7 @@ declare class RequestHandler extends EventEmitter {
|
|
|
242
266
|
|
|
243
267
|
/**
|
|
244
268
|
* Methods for interacting with Guild Audit Logs
|
|
269
|
+
* @since 0.2.0
|
|
245
270
|
*/
|
|
246
271
|
declare class AuditLogMethods {
|
|
247
272
|
requestHandler: RequestHandler;
|
|
@@ -256,6 +281,7 @@ declare class AuditLogMethods {
|
|
|
256
281
|
constructor(requestHandler: RequestHandler);
|
|
257
282
|
/**
|
|
258
283
|
* Get the audit logs of the specified guild id
|
|
284
|
+
* @since 0.2.0
|
|
259
285
|
* @param guildId id of a guild
|
|
260
286
|
* @param options optional audit log filter values
|
|
261
287
|
* @returns An object with [audit log data](https://discord.com/developers/docs/resources/audit-log#audit-log-object)
|
|
@@ -278,6 +304,7 @@ declare class AuditLogMethods {
|
|
|
278
304
|
|
|
279
305
|
/**
|
|
280
306
|
* Methods for interacting with guild auto moderation
|
|
307
|
+
* @since 0.7.0
|
|
281
308
|
*/
|
|
282
309
|
declare class AutoModerationMethods {
|
|
283
310
|
requestHandler: RequestHandler;
|
|
@@ -292,6 +319,7 @@ declare class AutoModerationMethods {
|
|
|
292
319
|
constructor(requestHandler: RequestHandler);
|
|
293
320
|
/**
|
|
294
321
|
* Get all of the auto moderation rules from a guild
|
|
322
|
+
* @since 0.7.0
|
|
295
323
|
* @param guildId id of the guild
|
|
296
324
|
* @returns A list of [auto mod rules](https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object)
|
|
297
325
|
*
|
|
@@ -307,6 +335,7 @@ declare class AutoModerationMethods {
|
|
|
307
335
|
getAutoModerationRules(guildId: string): Promise<RESTGetAPIAutoModerationRulesResult>;
|
|
308
336
|
/**
|
|
309
337
|
* Get a auto moderation rules from a guild
|
|
338
|
+
* @since 0.7.0
|
|
310
339
|
* @param guildId id of the guild
|
|
311
340
|
* @param ruleId id of the rule
|
|
312
341
|
* @returns An [auto mod rule](https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object)
|
|
@@ -323,6 +352,7 @@ declare class AutoModerationMethods {
|
|
|
323
352
|
getAutoModerationRule(guildId: string, ruleId: string): Promise<RESTGetAPIAutoModerationRuleResult>;
|
|
324
353
|
/**
|
|
325
354
|
* Create an auto moderation rule for a guild
|
|
355
|
+
* @since 0.7.0
|
|
326
356
|
* @param guildId id of the guild
|
|
327
357
|
* @param data the data of the auto moderation rule
|
|
328
358
|
* @returns An [auto mod rule](https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object)
|
|
@@ -353,6 +383,7 @@ declare class AutoModerationMethods {
|
|
|
353
383
|
}): Promise<RESTPostAPIAutoModerationRuleResult>;
|
|
354
384
|
/**
|
|
355
385
|
* Edit an auto moderation rule for a guild
|
|
386
|
+
* @since 0.7.0
|
|
356
387
|
* @param guildId id of the guild
|
|
357
388
|
* @param ruleId id of the rule
|
|
358
389
|
* @param data the data of the auto moderation rule
|
|
@@ -377,6 +408,7 @@ declare class AutoModerationMethods {
|
|
|
377
408
|
}): Promise<RESTPatchAPIAutoModerationRuleResult>;
|
|
378
409
|
/**
|
|
379
410
|
* Deletes an auto moderation rule for a guild
|
|
411
|
+
* @since 0.7.0
|
|
380
412
|
* @param guildId id of the guild
|
|
381
413
|
* @param ruleId id of the rule
|
|
382
414
|
* @param reason Reason for deleting the rule
|
|
@@ -395,6 +427,7 @@ declare class AutoModerationMethods {
|
|
|
395
427
|
|
|
396
428
|
/**
|
|
397
429
|
* Methods for interacting with bot specific endpoints
|
|
430
|
+
* @since 0.1.0
|
|
398
431
|
*/
|
|
399
432
|
declare class BotMethods {
|
|
400
433
|
requestHandler: RequestHandler;
|
|
@@ -409,6 +442,7 @@ declare class BotMethods {
|
|
|
409
442
|
constructor(requestHandler: RequestHandler);
|
|
410
443
|
/**
|
|
411
444
|
* Get the gateway url to connect to
|
|
445
|
+
* @since 0.1.0
|
|
412
446
|
* @returns [Gateway data](https://discord.com/developers/docs/topics/gateway#get-gateway-example-response)
|
|
413
447
|
*
|
|
414
448
|
* @example
|
|
@@ -419,6 +453,7 @@ declare class BotMethods {
|
|
|
419
453
|
getGateway(): Promise<RESTGetAPIGatewayResult>;
|
|
420
454
|
/**
|
|
421
455
|
* Get the gateway url to connect to and a recommended amount of shards to use
|
|
456
|
+
* @since 0.1.0
|
|
422
457
|
* @returns [Gateway data](https://discord.com/developers/docs/topics/gateway#get-gateway-example-response)
|
|
423
458
|
*
|
|
424
459
|
* @example
|
|
@@ -431,6 +466,7 @@ declare class BotMethods {
|
|
|
431
466
|
|
|
432
467
|
/**
|
|
433
468
|
* Methods for interacting with Channels and Messages
|
|
469
|
+
* @since 0.1.0
|
|
434
470
|
*/
|
|
435
471
|
declare class ChannelMethods {
|
|
436
472
|
requestHandler: RequestHandler;
|
|
@@ -447,6 +483,7 @@ declare class ChannelMethods {
|
|
|
447
483
|
constructor(requestHandler: RequestHandler, disableEveryone: boolean);
|
|
448
484
|
/**
|
|
449
485
|
* Get a channel via Id
|
|
486
|
+
* @since 0.1.0
|
|
450
487
|
* @param channelId Id of the channel
|
|
451
488
|
* @returns [discord channel](https://discord.com/developers/docs/resources/channel#channel-object) object
|
|
452
489
|
*
|
|
@@ -457,6 +494,7 @@ declare class ChannelMethods {
|
|
|
457
494
|
getChannel(channelId: string): Promise<RESTGetAPIChannelResult>;
|
|
458
495
|
/**
|
|
459
496
|
* Update a guild channel or thread
|
|
497
|
+
* @since 0.1.0
|
|
460
498
|
* @param channelId Id of the guild channel
|
|
461
499
|
* @param data Data to send
|
|
462
500
|
* @returns [discord channel](https://discord.com/developers/docs/resources/channel#channel-object) object
|
|
@@ -493,6 +531,7 @@ declare class ChannelMethods {
|
|
|
493
531
|
* When deleting a category, this does **not** delete the child channels of a category. They will just have their `parent_id` removed.
|
|
494
532
|
*
|
|
495
533
|
* For community guilds, the rules channel and the community updates channel cannot be deleted.
|
|
534
|
+
* @since 0.1.0
|
|
496
535
|
* @param channelId Id of the channel
|
|
497
536
|
* @param reason Reason for deleting the channel
|
|
498
537
|
* @returns [discord channel](https://discord.com/developers/docs/resources/channel#channel-object) object
|
|
@@ -510,6 +549,7 @@ declare class ChannelMethods {
|
|
|
510
549
|
deleteChannel(channelId: string, reason?: string): Promise<RESTDeleteAPIChannelResult>;
|
|
511
550
|
/**
|
|
512
551
|
* Get a list of messages from a channel
|
|
552
|
+
* @since 0.1.0
|
|
513
553
|
* @param channelId Id of the channel
|
|
514
554
|
* @param options Options for getting channel messages
|
|
515
555
|
* @returns Array of [discord message](https://discord.com/developers/docs/resources/channel#message-object) objects
|
|
@@ -530,6 +570,7 @@ declare class ChannelMethods {
|
|
|
530
570
|
getChannelMessages(channelId: string, options?: RESTGetAPIChannelMessagesQuery): Promise<RESTGetAPIChannelMessagesResult>;
|
|
531
571
|
/**
|
|
532
572
|
* Get a single message via Id
|
|
573
|
+
* @since 0.1.0
|
|
533
574
|
* @param channelId Id of the channel
|
|
534
575
|
* @param messageId Id of the message
|
|
535
576
|
* @returns [discord message](https://discord.com/developers/docs/resources/channel#message-object) object
|
|
@@ -549,6 +590,7 @@ declare class ChannelMethods {
|
|
|
549
590
|
* Creates a new Message within a channel or thread
|
|
550
591
|
*
|
|
551
592
|
* **Make sure to use a filename with a proper extension (e.g. png, jpeg, etc.) when you want to upload files**
|
|
593
|
+
* @since 0.1.0
|
|
552
594
|
* @param channelId Id of the Channel or thread to send a message to
|
|
553
595
|
* @param data Data to send, if data is a string it will be used as the content of the message,
|
|
554
596
|
* if data is not a string you should take a look at the properties below to know what you may send
|
|
@@ -598,6 +640,7 @@ declare class ChannelMethods {
|
|
|
598
640
|
}): Promise<RESTPostAPIChannelMessageResult>;
|
|
599
641
|
/**
|
|
600
642
|
* Creates a new voice Message within a channel or thread
|
|
643
|
+
* @since 0.10.0
|
|
601
644
|
* @param channelId Id of the Channel or thread to send a message to
|
|
602
645
|
* @param data Buffer of the audio file to send. Tested file types are ogg, mp3, m4a, wav, flac. Other file types work, but some can only be embedded on mobile. Try it and see:tm:
|
|
603
646
|
* @param audioDurationSeconds The duration of the audio file in seconds
|
|
@@ -621,6 +664,7 @@ declare class ChannelMethods {
|
|
|
621
664
|
createVoiceMessage(channelId: string, data: Buffer, audioDurationSeconds: number, waveform?: string): Promise<RESTPostAPIChannelMessageResult>;
|
|
622
665
|
/**
|
|
623
666
|
* Crosspost a message in a news channel to all following channels
|
|
667
|
+
* @since 0.3.0
|
|
624
668
|
* @param channelId Id of the news channel
|
|
625
669
|
* @param messageId Id of the message
|
|
626
670
|
* @returns [discord message](https://discord.com/developers/docs/resources/channel#message-object) object
|
|
@@ -639,6 +683,7 @@ declare class ChannelMethods {
|
|
|
639
683
|
crosspostMessage(channelId: string, messageId: string): Promise<RESTPostAPIChannelMessageCrosspostResult>;
|
|
640
684
|
/**
|
|
641
685
|
* Adds a reaction to a message
|
|
686
|
+
* @since 0.1.0
|
|
642
687
|
* @param channelId Id of the channel
|
|
643
688
|
* @param messageId Id of the message
|
|
644
689
|
* @param emoji uri encoded reaction emoji to add
|
|
@@ -665,6 +710,7 @@ declare class ChannelMethods {
|
|
|
665
710
|
createReaction(channelId: string, messageId: string, emoji: string): Promise<RESTPutAPIChannelMessageReactionResult>;
|
|
666
711
|
/**
|
|
667
712
|
* Delete a reaction added by the current user from a message
|
|
713
|
+
* @since 0.1.0
|
|
668
714
|
* @param channelId Id of the channel
|
|
669
715
|
* @param messageId Id of the message
|
|
670
716
|
* @param emoji reaction emoji
|
|
@@ -688,6 +734,7 @@ declare class ChannelMethods {
|
|
|
688
734
|
deleteReactionSelf(channelId: string, messageId: string, emoji: string): Promise<RESTDeleteAPIChannelMessageUserReactionResult>;
|
|
689
735
|
/**
|
|
690
736
|
* Delete a reaction from a message in a guild channel
|
|
737
|
+
* @since 0.1.0
|
|
691
738
|
* @param channelId Id of the guild channel
|
|
692
739
|
* @param messageId Id of the message
|
|
693
740
|
* @param emoji reaction emoji
|
|
@@ -715,6 +762,7 @@ declare class ChannelMethods {
|
|
|
715
762
|
deleteReaction(channelId: string, messageId: string, emoji: string, userId: string): Promise<RESTDeleteAPIChannelMessageUserReactionResult>;
|
|
716
763
|
/**
|
|
717
764
|
* Get a list of users that reacted with a certain emoji on a certain message
|
|
765
|
+
* @since 0.1.0
|
|
718
766
|
* @param channelId Id of the channel
|
|
719
767
|
* @param messageId Id of the message
|
|
720
768
|
* @param emoji reaction emoji
|
|
@@ -734,6 +782,7 @@ declare class ChannelMethods {
|
|
|
734
782
|
getReactions(channelId: string, messageId: string, emoji: string, options?: RESTGetAPIChannelMessageReactionUsersQuery): Promise<RESTGetAPIChannelMessageReactionUsersResult>;
|
|
735
783
|
/**
|
|
736
784
|
* Delete all reactions from a message in a guild channel
|
|
785
|
+
* @since 0.1.0
|
|
737
786
|
* @param channelId Id of the guild channel
|
|
738
787
|
* @param messageId Id of the message
|
|
739
788
|
* @returns Resolves the Promise on successful execution
|
|
@@ -751,6 +800,7 @@ declare class ChannelMethods {
|
|
|
751
800
|
deleteAllReactions(channelId: string, messageId: string): Promise<RESTDeleteAPIChannelAllMessageReactionsResult>;
|
|
752
801
|
/**
|
|
753
802
|
* Edit a message sent by the current user or edit the message flags of another user's message
|
|
803
|
+
* @since 0.1.0
|
|
754
804
|
* @param channelId Id of the channel
|
|
755
805
|
* @param messageId Id of the message
|
|
756
806
|
* @param data Data to send
|
|
@@ -779,6 +829,7 @@ declare class ChannelMethods {
|
|
|
779
829
|
}): Promise<RESTPatchAPIChannelMessageResult>;
|
|
780
830
|
/**
|
|
781
831
|
* Delete a message
|
|
832
|
+
* @since 0.1.0
|
|
782
833
|
* @param channelId Id of the channel
|
|
783
834
|
* @param messageId Id of the message
|
|
784
835
|
* @param reason Reason for deleting the message
|
|
@@ -797,6 +848,7 @@ declare class ChannelMethods {
|
|
|
797
848
|
deleteMessage(channelId: string, messageId: string, reason?: string): Promise<RESTDeleteAPIChannelMessageResult>;
|
|
798
849
|
/**
|
|
799
850
|
* Bulk delete messages from a guild channel, messages may not be older than 2 weeks
|
|
851
|
+
* @since 0.1.0
|
|
800
852
|
* @param channelId Id of the guild channel
|
|
801
853
|
* @param messages array of message ids to delete
|
|
802
854
|
* @param reason Reason for deleting the messages
|
|
@@ -815,6 +867,7 @@ declare class ChannelMethods {
|
|
|
815
867
|
bulkDeleteMessages(channelId: string, messages: Array<string>, reason?: string): Promise<RESTPostAPIChannelMessagesBulkDeleteResult>;
|
|
816
868
|
/**
|
|
817
869
|
* Modify the permission overwrites of a guild channel
|
|
870
|
+
* @since 0.1.0
|
|
818
871
|
* @param channelId Id of the guild channel
|
|
819
872
|
* @param permissionId Id of the permission overwrite
|
|
820
873
|
* @param data modified [permission overwrite](https://discord.com/developers/docs/resources/channel#edit-channel-permissions-json-params) object
|
|
@@ -837,6 +890,7 @@ declare class ChannelMethods {
|
|
|
837
890
|
}): Promise<RESTPutAPIChannelPermissionResult>;
|
|
838
891
|
/**
|
|
839
892
|
* Get a list of invites for a guild channel
|
|
893
|
+
* @since 0.1.0
|
|
840
894
|
* @param channelId Id of the guild channel
|
|
841
895
|
* @returns Array of [invite objects](https://discord.com/developers/docs/resources/invite#invite-object) (with metadata)
|
|
842
896
|
*
|
|
@@ -854,6 +908,7 @@ declare class ChannelMethods {
|
|
|
854
908
|
* Create an invite for a guild channel
|
|
855
909
|
*
|
|
856
910
|
* If no data argument is passed, the invite will be created with the defaults
|
|
911
|
+
* @since 0.1.0
|
|
857
912
|
* @param channelId Id of the channel
|
|
858
913
|
* @param data invite data (optional)
|
|
859
914
|
* @returns [Invite object](https://discord.com/developers/docs/resources/invite#invite-object) (with metadata)
|
|
@@ -873,6 +928,7 @@ declare class ChannelMethods {
|
|
|
873
928
|
}): Promise<RESTPostAPIChannelInviteResult>;
|
|
874
929
|
/**
|
|
875
930
|
* Delete a permission overwrite from a guild channel
|
|
931
|
+
* @since 0.1.0
|
|
876
932
|
* @param channelId Id of the guild channel
|
|
877
933
|
* @param permissionId Id of the permission overwrite
|
|
878
934
|
* @param reason Reason for deleting the permission
|
|
@@ -892,8 +948,9 @@ declare class ChannelMethods {
|
|
|
892
948
|
*/
|
|
893
949
|
deleteChannelPermission(channelId: string, permissionId: string, reason?: string): Promise<RESTDeleteAPIChannelPermissionResult>;
|
|
894
950
|
/**
|
|
895
|
-
* Follow
|
|
896
|
-
* @
|
|
951
|
+
* Follow an announcement channel to another channel
|
|
952
|
+
* @since 0.7.0
|
|
953
|
+
* @param channelId The Id of the announcement channel
|
|
897
954
|
* @param webhookChannelId The Id of the channel messages will be sent to
|
|
898
955
|
* @returns A [followed channel](https://discord.com/developers/docs/resources/channel#followed-channel-object) object
|
|
899
956
|
*
|
|
@@ -911,6 +968,7 @@ declare class ChannelMethods {
|
|
|
911
968
|
* Send an indicator that the current user is typing within a channel.
|
|
912
969
|
*
|
|
913
970
|
* **You should generally avoid this method unless used for longer computations (>1s)**
|
|
971
|
+
* @since 0.1.0
|
|
914
972
|
* @param channelId Id of the channel
|
|
915
973
|
* @returns Resolves the Promise on successful execution
|
|
916
974
|
*
|
|
@@ -927,6 +985,7 @@ declare class ChannelMethods {
|
|
|
927
985
|
startChannelTyping(channelId: string): Promise<RESTPostAPIChannelTypingResult>;
|
|
928
986
|
/**
|
|
929
987
|
* Get a list of pinned messages for a channel
|
|
988
|
+
* @since 0.1.0
|
|
930
989
|
* @param channelId Id of the channel
|
|
931
990
|
* @returns Array of [message objects](https://discord.com/developers/docs/resources/channel#message-object)
|
|
932
991
|
*
|
|
@@ -942,6 +1001,7 @@ declare class ChannelMethods {
|
|
|
942
1001
|
getChannelPinnedMessages(channelId: string): Promise<RESTGetAPIChannelPinsResult>;
|
|
943
1002
|
/**
|
|
944
1003
|
* Pin a message within a channel
|
|
1004
|
+
* @since 0.1.0
|
|
945
1005
|
* @param channelId Id of the channel
|
|
946
1006
|
* @param messageId Id of the message
|
|
947
1007
|
* @param reason Reason for pinning the message
|
|
@@ -961,6 +1021,7 @@ declare class ChannelMethods {
|
|
|
961
1021
|
addChannelPinnedMessage(channelId: string, messageId: string, reason?: string): Promise<RESTPutAPIChannelPinResult>;
|
|
962
1022
|
/**
|
|
963
1023
|
* Remove a pinned message from a channel
|
|
1024
|
+
* @since 0.1.0
|
|
964
1025
|
* @param channelId Id of the channel
|
|
965
1026
|
* @param messageId Id of the message
|
|
966
1027
|
* @param reason Reason for removing the pinned message
|
|
@@ -980,6 +1041,7 @@ declare class ChannelMethods {
|
|
|
980
1041
|
removeChannelPinnedMessage(channelId: string, messageId: string, reason?: string): Promise<RESTDeleteAPIChannelPinResult>;
|
|
981
1042
|
/**
|
|
982
1043
|
* Creates a public thread off a message in a guild channel
|
|
1044
|
+
* @since 0.3.0
|
|
983
1045
|
* @param channelId Id of the guild channel
|
|
984
1046
|
* @param messageId Id of the message
|
|
985
1047
|
* @param options Thread meta data
|
|
@@ -1000,6 +1062,7 @@ declare class ChannelMethods {
|
|
|
1000
1062
|
}): Promise<RESTPostAPIChannelMessagesThreadsResult>;
|
|
1001
1063
|
/**
|
|
1002
1064
|
* Creates a thread under a guild channel without a message
|
|
1065
|
+
* @since 0.3.0
|
|
1003
1066
|
* @param channelId Id of the guild channel
|
|
1004
1067
|
* @param options Thread meta data
|
|
1005
1068
|
* @returns [thread channel](https://discord.com/developers/docs/resources/channel#channel-object) object
|
|
@@ -1029,6 +1092,7 @@ declare class ChannelMethods {
|
|
|
1029
1092
|
}): Promise<APITextBasedChannel<ChannelType.PrivateThread>>;
|
|
1030
1093
|
/**
|
|
1031
1094
|
* Join a thread
|
|
1095
|
+
* @since 0.3.0
|
|
1032
1096
|
* @param threadId Id of the thread
|
|
1033
1097
|
* @returns Resolves the Promise on successful execution
|
|
1034
1098
|
*
|
|
@@ -1045,6 +1109,7 @@ declare class ChannelMethods {
|
|
|
1045
1109
|
* Add a user to a thread
|
|
1046
1110
|
*
|
|
1047
1111
|
* CurrentUser must be a member of the thread
|
|
1112
|
+
* @since 0.3.0
|
|
1048
1113
|
* @param threadId Id of the thread
|
|
1049
1114
|
* @param userId Id of the user to add
|
|
1050
1115
|
* @returns Resolves the Promise on successful execution
|
|
@@ -1061,6 +1126,7 @@ declare class ChannelMethods {
|
|
|
1061
1126
|
addThreadMember(threadId: string, userId: string): Promise<RESTPutAPIChannelThreadMembersResult>;
|
|
1062
1127
|
/**
|
|
1063
1128
|
* Leave a thread
|
|
1129
|
+
* @since 0.3.0
|
|
1064
1130
|
* @param threadId Id of the thread
|
|
1065
1131
|
* @returns Resolves the Promise on successful execution
|
|
1066
1132
|
*
|
|
@@ -1071,6 +1137,7 @@ declare class ChannelMethods {
|
|
|
1071
1137
|
leaveThread(threadId: string): Promise<RESTDeleteAPIChannelThreadMembersResult>;
|
|
1072
1138
|
/**
|
|
1073
1139
|
* Remove a user from a thread
|
|
1140
|
+
* @since 0.3.0
|
|
1074
1141
|
* @param threadId Id of the thread
|
|
1075
1142
|
* @param userId Id of the user to remove
|
|
1076
1143
|
* @returns Resolves the Promise on successful execution
|
|
@@ -1086,6 +1153,7 @@ declare class ChannelMethods {
|
|
|
1086
1153
|
removeThreadMember(threadId: string, userId: string): Promise<RESTDeleteAPIChannelThreadMembersResult>;
|
|
1087
1154
|
/**
|
|
1088
1155
|
* Gets a member of a thread
|
|
1156
|
+
* @since 0.3.0
|
|
1089
1157
|
* @param threadId Id of the thread
|
|
1090
1158
|
* @param userId Id of the user
|
|
1091
1159
|
* @param withMember If a member object should be present
|
|
@@ -1102,6 +1170,7 @@ declare class ChannelMethods {
|
|
|
1102
1170
|
getThreadMember(threadId: string, userId: string, withMember?: boolean): Promise<RESTGetAPIChannelThreadMemberResult>;
|
|
1103
1171
|
/**
|
|
1104
1172
|
* Gets all members within a thread
|
|
1173
|
+
* @since 0.3.0
|
|
1105
1174
|
* @param channelId Id of the Thread
|
|
1106
1175
|
* @param options Options for getting members
|
|
1107
1176
|
* @returns Array of [thread members](https://discord.com/developers/docs/resources/channel#thread-member-object)
|
|
@@ -1121,6 +1190,7 @@ declare class ChannelMethods {
|
|
|
1121
1190
|
getThreadMembers(channelId: string, options?: RESTGetAPIChannelThreadMembersQuery): Promise<RESTGetAPIChannelThreadMembersResult>;
|
|
1122
1191
|
/**
|
|
1123
1192
|
* Gets all threads that are public and archived within a guild channel
|
|
1193
|
+
* @since 0.3.0
|
|
1124
1194
|
* @param channelId Id of the guild channel
|
|
1125
1195
|
* @param options Options for getting threads
|
|
1126
1196
|
* @returns Object containing [public threads](https://discord.com/developers/docs/resources/channel#channel-object), [thread members](https://discord.com/developers/docs/resources/channel#thread-member-object) of the CurrentUser, and if there are more results in the pagination
|
|
@@ -1139,6 +1209,7 @@ declare class ChannelMethods {
|
|
|
1139
1209
|
* Gets all threads that are private and archived within a guild channel
|
|
1140
1210
|
*
|
|
1141
1211
|
* CurrentUser must be a member of the thread if they do not have MANAGE_THREADS permissions
|
|
1212
|
+
* @since 0.3.0
|
|
1142
1213
|
* @param channelId Id of the Channel
|
|
1143
1214
|
* @param options Options for getting threads
|
|
1144
1215
|
* @returns Object containing [private threads](https://discord.com/developers/docs/resources/channel#channel-object), [thread members](https://discord.com/developers/docs/resources/channel#thread-member-object) of the CurrentUser, and if there are more results in the pagination
|
|
@@ -1158,6 +1229,7 @@ declare class ChannelMethods {
|
|
|
1158
1229
|
* Gets all threads that are private and archived within a guild channel that the CurrentUser is apart of
|
|
1159
1230
|
*
|
|
1160
1231
|
* CurrentUser must be a member of the thread if they do not have MANAGE_THREADS permissions
|
|
1232
|
+
* @since 0.3.0
|
|
1161
1233
|
* @param channelId Id of the Channel
|
|
1162
1234
|
* @param options Option for getting threads
|
|
1163
1235
|
* @returns Object containing [private threads](https://discord.com/developers/docs/resources/channel#channel-object), [thread members](https://discord.com/developers/docs/resources/channel#thread-member-object) of the CurrentUser, and if there are more results in the pagination
|
|
@@ -1173,6 +1245,7 @@ declare class ChannelMethods {
|
|
|
1173
1245
|
getChannelArchivedPrivateThreadsUser(channelId: string, options?: RESTGetAPIChannelThreadsArchivedQuery): Promise<RESTGetAPIChannelUsersThreadsArchivedResult>;
|
|
1174
1246
|
/**
|
|
1175
1247
|
* Refreshes Discord CDN attachments by URL to give you non-expired links. This also works on attachments the token may not have access to through means like guild bot presence
|
|
1248
|
+
* @since 0.10.7
|
|
1176
1249
|
* @param attachments A list of Discord CDN attachment URLs. Does not require the URL(s) to have the expiration info parameters
|
|
1177
1250
|
* @returns Object containing a list of the original URLs inputted and refreshed URLs
|
|
1178
1251
|
*
|
|
@@ -1184,7 +1257,8 @@ declare class ChannelMethods {
|
|
|
1184
1257
|
}
|
|
1185
1258
|
|
|
1186
1259
|
/**
|
|
1187
|
-
* Methods for interacting with emojis
|
|
1260
|
+
* Methods for interacting with guild assets like emojis and stickers
|
|
1261
|
+
* @since 0.3.0
|
|
1188
1262
|
*/
|
|
1189
1263
|
declare class GuildAssetsMethods {
|
|
1190
1264
|
requestHandler: RequestHandler;
|
|
@@ -1199,6 +1273,7 @@ declare class GuildAssetsMethods {
|
|
|
1199
1273
|
constructor(requestHandler: RequestHandler);
|
|
1200
1274
|
/**
|
|
1201
1275
|
* Get a list of emojis of a guild
|
|
1276
|
+
* @since 0.3.0
|
|
1202
1277
|
* @param guildId Id of the guild
|
|
1203
1278
|
* @returns Array of [emoji objects](https://discord.com/developers/docs/resources/emoji#emoji-object)
|
|
1204
1279
|
*
|
|
@@ -1209,6 +1284,7 @@ declare class GuildAssetsMethods {
|
|
|
1209
1284
|
getEmojis(guildId: string): Promise<RESTGetAPIGuildEmojisResult>;
|
|
1210
1285
|
/**
|
|
1211
1286
|
* Get an emoji via guildId + emojiId
|
|
1287
|
+
* @since 0.3.0
|
|
1212
1288
|
* @param guildId Id of the guild
|
|
1213
1289
|
* @param emojiId Id of the emoji
|
|
1214
1290
|
* @returns [Emoji object](https://discord.com/developers/docs/resources/emoji#emoji-object)
|
|
@@ -1220,6 +1296,7 @@ declare class GuildAssetsMethods {
|
|
|
1220
1296
|
getEmoji(guildId: string, emojiId: string): Promise<RESTGetAPIGuildEmojiResult>;
|
|
1221
1297
|
/**
|
|
1222
1298
|
* Create a new Emoji
|
|
1299
|
+
* @since 0.3.0
|
|
1223
1300
|
* @param guildId Id of the guild
|
|
1224
1301
|
* @param data Emoji data, check the example
|
|
1225
1302
|
* @returns [Emoji object](https://discord.com/developers/docs/resources/emoji#emoji-object)
|
|
@@ -1243,6 +1320,7 @@ declare class GuildAssetsMethods {
|
|
|
1243
1320
|
}): Promise<RESTPostAPIGuildEmojiResult>;
|
|
1244
1321
|
/**
|
|
1245
1322
|
* Update an existing emoji
|
|
1323
|
+
* @since 0.3.0
|
|
1246
1324
|
* @param {string} guildId Id of the guild
|
|
1247
1325
|
* @param {string} emojiId Id of the emoji
|
|
1248
1326
|
* @param {object} data Emoji data
|
|
@@ -1265,6 +1343,7 @@ declare class GuildAssetsMethods {
|
|
|
1265
1343
|
}): Promise<RESTPatchAPIGuildEmojiResult>;
|
|
1266
1344
|
/**
|
|
1267
1345
|
* Delete an emoji
|
|
1346
|
+
* @since 0.3.0
|
|
1268
1347
|
* @param guildId Id of the guild
|
|
1269
1348
|
* @param emojiId Id of the emoji
|
|
1270
1349
|
* @param reason Reason for deleting the emoji
|
|
@@ -1282,6 +1361,7 @@ declare class GuildAssetsMethods {
|
|
|
1282
1361
|
deleteEmoji(guildId: string, emojiId: string, reason?: string): Promise<RESTDeleteAPIGuildEmojiResult>;
|
|
1283
1362
|
/**
|
|
1284
1363
|
* Get a global sticker
|
|
1364
|
+
* @since 0.3.0
|
|
1285
1365
|
* @param stickerId Id of the sticker
|
|
1286
1366
|
* @returns [Sticker object](https://discord.com/developers/docs/resources/sticker#sticker-object)
|
|
1287
1367
|
*
|
|
@@ -1292,6 +1372,7 @@ declare class GuildAssetsMethods {
|
|
|
1292
1372
|
getSticker(stickerId: string): Promise<RESTGetAPIStickerResult>;
|
|
1293
1373
|
/**
|
|
1294
1374
|
* Get all guild stickers
|
|
1375
|
+
* @since 0.3.0
|
|
1295
1376
|
* @param guildId Id of the guild
|
|
1296
1377
|
* @returns An Array of [sticker objects](https://discord.com/developers/docs/resources/sticker#sticker-object)
|
|
1297
1378
|
*
|
|
@@ -1306,6 +1387,7 @@ declare class GuildAssetsMethods {
|
|
|
1306
1387
|
getGuildStickers(guildId: string): Promise<RESTGetAPIGuildStickersResult>;
|
|
1307
1388
|
/**
|
|
1308
1389
|
* Get a guild sticker
|
|
1390
|
+
* @since 0.3.0
|
|
1309
1391
|
* @param guildId Id of the guild
|
|
1310
1392
|
* @param stickerId Id of the sticker
|
|
1311
1393
|
* @returns A [sticker object](https://discord.com/developers/docs/resources/sticker#sticker-object)
|
|
@@ -1321,6 +1403,7 @@ declare class GuildAssetsMethods {
|
|
|
1321
1403
|
getGuildSticker(guildId: string, stickerId: string): Promise<RESTGetAPIGuildStickerResult>;
|
|
1322
1404
|
/**
|
|
1323
1405
|
* Create a guild sticker
|
|
1406
|
+
* @since 0.3.0
|
|
1324
1407
|
* @param guildId Id of the guild
|
|
1325
1408
|
* @param data Sticker data
|
|
1326
1409
|
* @returns A [sticker object](https://discord.com/developers/docs/resources/sticker#sticker-object)
|
|
@@ -1351,6 +1434,7 @@ declare class GuildAssetsMethods {
|
|
|
1351
1434
|
}): Promise<RESTPostAPIGuildStickerResult>;
|
|
1352
1435
|
/**
|
|
1353
1436
|
* Update a guild sticker
|
|
1437
|
+
* @since 0.3.0
|
|
1354
1438
|
* @param guildId Id of the guild
|
|
1355
1439
|
* @param stickerId Id of the sticker
|
|
1356
1440
|
* @param data Sticker data
|
|
@@ -1370,6 +1454,7 @@ declare class GuildAssetsMethods {
|
|
|
1370
1454
|
}): Promise<RESTPatchAPIGuildStickerResult>;
|
|
1371
1455
|
/**
|
|
1372
1456
|
* Delete a guild sticker
|
|
1457
|
+
* @since 0.3.0
|
|
1373
1458
|
* @param guildId Id of the guild
|
|
1374
1459
|
* @param stickerId Id of the sticker
|
|
1375
1460
|
* @param reason Reason for deleting the sticker
|
|
@@ -1389,6 +1474,7 @@ declare class GuildAssetsMethods {
|
|
|
1389
1474
|
|
|
1390
1475
|
/**
|
|
1391
1476
|
* Methods for interacting with Guilds
|
|
1477
|
+
* @since 0.1.0
|
|
1392
1478
|
*/
|
|
1393
1479
|
declare class GuildMethods {
|
|
1394
1480
|
requestHandler: RequestHandler;
|
|
@@ -1404,6 +1490,7 @@ declare class GuildMethods {
|
|
|
1404
1490
|
/**
|
|
1405
1491
|
* Create a new Guild, **limited to 10 guilds (you may create more if you are whitelisted)**
|
|
1406
1492
|
* Check the [discord docs](https://discord.com/developers/docs/resources/guild#create-guild) for more infos
|
|
1493
|
+
* @since 0.1.0
|
|
1407
1494
|
* @param data Data for the new guild
|
|
1408
1495
|
* @returns [Guild](https://discord.com/developers/docs/resources/guild#guild-object)
|
|
1409
1496
|
*
|
|
@@ -1420,6 +1507,7 @@ declare class GuildMethods {
|
|
|
1420
1507
|
* Get a guild via Id
|
|
1421
1508
|
*
|
|
1422
1509
|
* CurrentUser must be a member of the guild
|
|
1510
|
+
* @since 0.1.0
|
|
1423
1511
|
* @param guildId Id of the guild
|
|
1424
1512
|
* @param withCounts when true, will return approximate member and presence counts for the guild
|
|
1425
1513
|
* @returns [Guild object](https://discord.com/developers/docs/resources/guild#guild-object)
|
|
@@ -1431,6 +1519,7 @@ declare class GuildMethods {
|
|
|
1431
1519
|
getGuild(guildId: string, withCounts?: boolean): Promise<RESTGetAPIGuildResult>;
|
|
1432
1520
|
/**
|
|
1433
1521
|
* Gets a guild's preview. If the CurrentUser is not in the guild, the guild must be lurkable
|
|
1522
|
+
* @since 0.3.0
|
|
1434
1523
|
* @param guildId Id of the guild
|
|
1435
1524
|
* @returns [Guild preview](https://discord.com/developers/docs/resources/guild#guild-preview-object)
|
|
1436
1525
|
*
|
|
@@ -1441,6 +1530,7 @@ declare class GuildMethods {
|
|
|
1441
1530
|
getGuildPreview(guildId: string): Promise<RESTGetAPIGuildPreviewResult>;
|
|
1442
1531
|
/**
|
|
1443
1532
|
* Update a guild
|
|
1533
|
+
* @since 0.1.0
|
|
1444
1534
|
* @param guildId Id of the guild
|
|
1445
1535
|
* @param data Updated guild data
|
|
1446
1536
|
* @returns [Guild object](https://discord.com/developers/docs/resources/guild#guild-object)
|
|
@@ -1464,6 +1554,7 @@ declare class GuildMethods {
|
|
|
1464
1554
|
* CurrentUser must be the owner of the guild
|
|
1465
1555
|
*
|
|
1466
1556
|
* **This action is irreversible, so use it with caution!**
|
|
1557
|
+
* @since 0.1.0
|
|
1467
1558
|
* @param guildId Id of the guild
|
|
1468
1559
|
* @returns Resolves the Promise on successful execution
|
|
1469
1560
|
*
|
|
@@ -1476,6 +1567,7 @@ declare class GuildMethods {
|
|
|
1476
1567
|
* Get a list of all channels for a guild. Does not include threads
|
|
1477
1568
|
*
|
|
1478
1569
|
* CurrentUser must be a member of the guild
|
|
1570
|
+
* @since 0.1.0
|
|
1479
1571
|
* @param guildId Id of the guild
|
|
1480
1572
|
* @returns list of [channels](https://discord.com/developers/docs/resources/channel#channel-object-channel-structure)
|
|
1481
1573
|
*
|
|
@@ -1486,6 +1578,7 @@ declare class GuildMethods {
|
|
|
1486
1578
|
getGuildChannels(guildId: string): Promise<RESTGetAPIGuildChannelsResult>;
|
|
1487
1579
|
/**
|
|
1488
1580
|
* Create a channel within a guild
|
|
1581
|
+
* @since 0.1.0
|
|
1489
1582
|
* @param guildId Id of the guild
|
|
1490
1583
|
* @param data channel properties
|
|
1491
1584
|
* @returns [channel object](https://discord.com/developers/docs/resources/channel#channel-object-channel-structure)
|
|
@@ -1509,6 +1602,7 @@ declare class GuildMethods {
|
|
|
1509
1602
|
createGuildChannel(guildId: string, data: RESTPostAPIGuildChannelJSONBody): Promise<RESTPostAPIGuildChannelResult>;
|
|
1510
1603
|
/**
|
|
1511
1604
|
* Batch update the positions of channels. Only those being moved needs to be included here
|
|
1605
|
+
* @since 0.1.0
|
|
1512
1606
|
* @param guildId Id of the guild
|
|
1513
1607
|
* @param data Positional data to send
|
|
1514
1608
|
* @param reason Reason for updating the channels' positions
|
|
@@ -1526,6 +1620,7 @@ declare class GuildMethods {
|
|
|
1526
1620
|
updateChannelPositions(guildId: string, data: RESTPatchAPIGuildChannelPositionsJSONBody, reason?: string): Promise<RESTPatchAPIGuildChannelPositionsResult>;
|
|
1527
1621
|
/**
|
|
1528
1622
|
* Returns all active threads in the guild, including public and private threads. Threads are ordered by their `id`, in descending order
|
|
1623
|
+
* @since 0.3.0
|
|
1529
1624
|
* @param guildId Id of the guild
|
|
1530
1625
|
* @returns All active threads and member objects of the CurrentUser that the CurrentUser has access to.
|
|
1531
1626
|
*
|
|
@@ -1538,6 +1633,7 @@ declare class GuildMethods {
|
|
|
1538
1633
|
* Get a guild member via Id
|
|
1539
1634
|
*
|
|
1540
1635
|
* CurrentUser must be a member of the guild
|
|
1636
|
+
* @since 0.1.0
|
|
1541
1637
|
* @param guildId Id of the guild
|
|
1542
1638
|
* @param memberId Id of the guild member
|
|
1543
1639
|
* @returns [guild member](https://discord.com/developers/docs/resources/guild#guild-member-object-guild-member-structure)
|
|
@@ -1551,6 +1647,7 @@ declare class GuildMethods {
|
|
|
1551
1647
|
* Get a list of guild members
|
|
1552
1648
|
*
|
|
1553
1649
|
* CurrentUser must be a member of the guild
|
|
1650
|
+
* @since 0.1.0
|
|
1554
1651
|
* @param guildId Id of the guild
|
|
1555
1652
|
* @param options query data
|
|
1556
1653
|
* @returns list of [guild members](https://discord.com/developers/docs/resources/guild#guild-member-object-guild-member-structure)
|
|
@@ -1567,6 +1664,7 @@ declare class GuildMethods {
|
|
|
1567
1664
|
getGuildMembers(guildId: string, options?: RESTGetAPIGuildMembersQuery): Promise<RESTGetAPIGuildMembersResult>;
|
|
1568
1665
|
/**
|
|
1569
1666
|
* Get a list of guild members that match a query
|
|
1667
|
+
* @since 0.3.0
|
|
1570
1668
|
* @param guildId Id of the guild
|
|
1571
1669
|
* @param options query data
|
|
1572
1670
|
* @returns list of [guild members](https://discord.com/developers/docs/resources/guild#guild-member-object-guild-member-structure)
|
|
@@ -1581,6 +1679,7 @@ declare class GuildMethods {
|
|
|
1581
1679
|
* Add a guild member to a guild via oauth2 access token
|
|
1582
1680
|
*
|
|
1583
1681
|
* CurrentUser must be a member of the guild
|
|
1682
|
+
* @since 0.1.0
|
|
1584
1683
|
* @param guildId Id of the guild
|
|
1585
1684
|
* @param memberId Id of the guild member
|
|
1586
1685
|
* @param data object containing the needed request data
|
|
@@ -1605,6 +1704,7 @@ declare class GuildMethods {
|
|
|
1605
1704
|
addGuildMember(guildId: string, memberId: string, data: RESTPutAPIGuildMemberJSONBody): Promise<RESTPutAPIGuildMemberResult>;
|
|
1606
1705
|
/**
|
|
1607
1706
|
* Update properties of a guild member
|
|
1707
|
+
* @since 0.1.0
|
|
1608
1708
|
* @param guildId Id of the guild
|
|
1609
1709
|
* @param memberId Id of the guild member
|
|
1610
1710
|
* @param data Updated properties
|
|
@@ -1631,6 +1731,7 @@ declare class GuildMethods {
|
|
|
1631
1731
|
updateGuildMember(guildId: string, memberId: string, data: RESTPatchAPIGuildMemberJSONBody): Promise<RESTPatchAPIGuildMemberResult>;
|
|
1632
1732
|
/**
|
|
1633
1733
|
* Update the nick of the CurrentMember
|
|
1734
|
+
* @since 0.1.0
|
|
1634
1735
|
* @param guildId Id of the guild
|
|
1635
1736
|
* @param data object with a nick property and optionally, a reason property
|
|
1636
1737
|
* @returns Resolves the Promise on successful execution
|
|
@@ -1652,6 +1753,7 @@ declare class GuildMethods {
|
|
|
1652
1753
|
}): Promise<APIGuildMember>;
|
|
1653
1754
|
/**
|
|
1654
1755
|
* Add a role to a guild member
|
|
1756
|
+
* @since 0.1.0
|
|
1655
1757
|
* @param guildId Id of the guild
|
|
1656
1758
|
* @param memberId Id of the guild member
|
|
1657
1759
|
* @param roleId Id of the role
|
|
@@ -1670,6 +1772,7 @@ declare class GuildMethods {
|
|
|
1670
1772
|
addGuildMemberRole(guildId: string, memberId: string, roleId: string, reason?: string): Promise<RESTPutAPIGuildMemberRoleResult>;
|
|
1671
1773
|
/**
|
|
1672
1774
|
* Remove a role from a guild member
|
|
1775
|
+
* @since 0.1.0
|
|
1673
1776
|
* @param guildId Id of the guild
|
|
1674
1777
|
* @param memberId Id of the guild member
|
|
1675
1778
|
* @param roleId Id of the role
|
|
@@ -1688,6 +1791,7 @@ declare class GuildMethods {
|
|
|
1688
1791
|
removeGuildMemberRole(guildId: string, memberId: string, roleId: string, reason?: string): Promise<RESTDeleteAPIGuildMemberRoleResult>;
|
|
1689
1792
|
/**
|
|
1690
1793
|
* Remove a guild member (aka kick them)
|
|
1794
|
+
* @since 0.1.0
|
|
1691
1795
|
* @param guildId Id of the guild
|
|
1692
1796
|
* @param memberId Id of the guild member
|
|
1693
1797
|
* @param reason Reason for kicking the member
|
|
@@ -1705,6 +1809,7 @@ declare class GuildMethods {
|
|
|
1705
1809
|
removeGuildMember(guildId: string, memberId: string, reason?: string): Promise<RESTDeleteAPIGuildMemberResult>;
|
|
1706
1810
|
/**
|
|
1707
1811
|
* Get bans of a guild
|
|
1812
|
+
* @since 0.1.0
|
|
1708
1813
|
* @param guildId Id of the guild
|
|
1709
1814
|
* @param options Query string options
|
|
1710
1815
|
* @returns List of [bans](https://discord.com/developers/docs/resources/guild#ban-object-ban-structure)
|
|
@@ -1720,6 +1825,7 @@ declare class GuildMethods {
|
|
|
1720
1825
|
getGuildBans(guildId: string, options?: RESTGetAPIGuildBansQuery): Promise<RESTGetAPIGuildBansResult>;
|
|
1721
1826
|
/**
|
|
1722
1827
|
* Get a specific ban of a guild member
|
|
1828
|
+
* @since 0.4.2
|
|
1723
1829
|
* @param guildId Id of the guild
|
|
1724
1830
|
* @param memberId Id of the member
|
|
1725
1831
|
* @returns [ban](https://discord.com/developers/docs/resources/guild#ban-object-ban-structure) object
|
|
@@ -1737,6 +1843,7 @@ declare class GuildMethods {
|
|
|
1737
1843
|
getGuildBan(guildId: string, memberId: string): Promise<RESTGetAPIGuildBanResult>;
|
|
1738
1844
|
/**
|
|
1739
1845
|
* Ban a guild member
|
|
1846
|
+
* @since 0.1.0
|
|
1740
1847
|
* @param guildId Id of the guild
|
|
1741
1848
|
* @param memberId Id of the guild member
|
|
1742
1849
|
* @param data object with a reason and a delete_message_days property
|
|
@@ -1760,6 +1867,7 @@ declare class GuildMethods {
|
|
|
1760
1867
|
}): Promise<RESTPutAPIGuildBanResult>;
|
|
1761
1868
|
/**
|
|
1762
1869
|
* Remove a ban of a user
|
|
1870
|
+
* @since 0.1.0
|
|
1763
1871
|
* @param guildId Id of the guild
|
|
1764
1872
|
* @param memberId Id of the guild member
|
|
1765
1873
|
* @param reason Reason for removing the ban
|
|
@@ -1777,6 +1885,7 @@ declare class GuildMethods {
|
|
|
1777
1885
|
removeGuildBan(guildId: string, memberId: string, reason?: string): Promise<RESTDeleteAPIGuildBanResult>;
|
|
1778
1886
|
/**
|
|
1779
1887
|
* Get a list of roles for a guild
|
|
1888
|
+
* @since 0.1.0
|
|
1780
1889
|
* @param guildId Id of the guild
|
|
1781
1890
|
* @returns array of [roles](https://discord.com/developers/docs/topics/permissions#role-object)
|
|
1782
1891
|
*
|
|
@@ -1791,6 +1900,7 @@ declare class GuildMethods {
|
|
|
1791
1900
|
getGuildRoles(guildId: string): Promise<RESTGetAPIGuildRolesResult>;
|
|
1792
1901
|
/**
|
|
1793
1902
|
* Create a new Role
|
|
1903
|
+
* @since 0.1.0
|
|
1794
1904
|
* @param guildId Id of the guild
|
|
1795
1905
|
* @param data data with role properties
|
|
1796
1906
|
* @returns [role](https://discord.com/developers/docs/resources/channel#channel-object-channel-structure)
|
|
@@ -1813,6 +1923,7 @@ declare class GuildMethods {
|
|
|
1813
1923
|
}): Promise<RESTPostAPIGuildRoleResult>;
|
|
1814
1924
|
/**
|
|
1815
1925
|
* Modify the positions of roles
|
|
1926
|
+
* @since 0.1.0
|
|
1816
1927
|
* @param guildId Id of the guild
|
|
1817
1928
|
* @param data Role data to update
|
|
1818
1929
|
* @param reason Reason for moving the roles
|
|
@@ -1829,6 +1940,7 @@ declare class GuildMethods {
|
|
|
1829
1940
|
updateGuildRolePositions(guildId: string, data: RESTPatchAPIGuildRolePositionsJSONBody, reason?: string): Promise<RESTPatchAPIGuildRolePositionsResult>;
|
|
1830
1941
|
/**
|
|
1831
1942
|
* Update a guild role
|
|
1943
|
+
* @since 0.1.0
|
|
1832
1944
|
* @param guildId Id of the guild
|
|
1833
1945
|
* @param roleId Id of the role
|
|
1834
1946
|
* @param data updated properties of the role
|
|
@@ -1848,6 +1960,7 @@ declare class GuildMethods {
|
|
|
1848
1960
|
updateGuildRole(guildId: string, roleId: string, data: RESTPatchAPIGuildRoleJSONBody): Promise<RESTPatchAPIGuildRoleResult>;
|
|
1849
1961
|
/**
|
|
1850
1962
|
* Delete a role from the guild
|
|
1963
|
+
* @since 0.1.0
|
|
1851
1964
|
* @param guildId Id of the guild
|
|
1852
1965
|
* @param roleId Id of the role
|
|
1853
1966
|
* @param reason Reason for deleting the role
|
|
@@ -1865,6 +1978,7 @@ declare class GuildMethods {
|
|
|
1865
1978
|
removeGuildRole(guildId: string, roleId: string, reason?: string): Promise<RESTDeleteAPIGuildRoleResult>;
|
|
1866
1979
|
/**
|
|
1867
1980
|
* Get the amount of members that would be pruned when a prune with the passed amount of days would be started
|
|
1981
|
+
* @since 0.1.0
|
|
1868
1982
|
* @param guildId Id of the guild
|
|
1869
1983
|
* @param options Object with prune data
|
|
1870
1984
|
* @returns Object with a "pruned" key indicating the amount of members that would be pruned
|
|
@@ -1880,6 +1994,7 @@ declare class GuildMethods {
|
|
|
1880
1994
|
getGuildPruneCount(guildId: string, options?: RESTGetAPIGuildPruneCountQuery): Promise<RESTGetAPIGuildPruneCountResult>;
|
|
1881
1995
|
/**
|
|
1882
1996
|
* Start a prune
|
|
1997
|
+
* @since 0.1.0
|
|
1883
1998
|
* @param guildId Id of the guild
|
|
1884
1999
|
* @param data Object with prune data
|
|
1885
2000
|
* @returns Object with a "pruned" key indicating the amount of members that were pruned
|
|
@@ -1906,6 +2021,7 @@ declare class GuildMethods {
|
|
|
1906
2021
|
}>;
|
|
1907
2022
|
/**
|
|
1908
2023
|
* Get a list of voice regions for the guild, includes vip-regions unlike voice.getVoiceRegions
|
|
2024
|
+
* @since 0.1.0
|
|
1909
2025
|
* @param guildId Id of the guild
|
|
1910
2026
|
* @returns List of [voice regions](https://discord.com/developers/docs/resources/voice#voice-region-object)
|
|
1911
2027
|
*
|
|
@@ -1916,6 +2032,7 @@ declare class GuildMethods {
|
|
|
1916
2032
|
getGuildVoiceRegions(guildId: string): Promise<RESTGetAPIGuildVoiceRegionsResult>;
|
|
1917
2033
|
/**
|
|
1918
2034
|
* Get invites for a guild
|
|
2035
|
+
* @since 0.1.0
|
|
1919
2036
|
* @param guildId Id of the guild
|
|
1920
2037
|
* @returns List of [invites](https://discord.com/developers/docs/resources/invite#invite-object) (with metadata)
|
|
1921
2038
|
*
|
|
@@ -1930,6 +2047,7 @@ declare class GuildMethods {
|
|
|
1930
2047
|
getGuildInvites(guildId: string): Promise<RESTGetAPIGuildInvitesResult>;
|
|
1931
2048
|
/**
|
|
1932
2049
|
* Get integrations for a guild
|
|
2050
|
+
* @since 0.1.0
|
|
1933
2051
|
* @param guildId Id of the guild
|
|
1934
2052
|
* @returns List of [integration objects](https://discord.com/developers/docs/resources/guild#integration-object)
|
|
1935
2053
|
*
|
|
@@ -1944,6 +2062,7 @@ declare class GuildMethods {
|
|
|
1944
2062
|
getGuildIntegrations(guildId: string): Promise<RESTGetAPIGuildIntegrationsResult>;
|
|
1945
2063
|
/**
|
|
1946
2064
|
* Delete a guild integration
|
|
2065
|
+
* @since 0.1.0
|
|
1947
2066
|
* @param guildId Id of the guild
|
|
1948
2067
|
* @param integrationId Id of the integration
|
|
1949
2068
|
* @param reason Reason for removing the integration
|
|
@@ -1960,6 +2079,7 @@ declare class GuildMethods {
|
|
|
1960
2079
|
removeGuildIntegration(guildId: string, integrationId: string, reason?: string): Promise<RESTDeleteAPIGuildIntegrationResult>;
|
|
1961
2080
|
/**
|
|
1962
2081
|
* Get a guild widget settings object
|
|
2082
|
+
* @since 0.3.0
|
|
1963
2083
|
* @param guildId Id of the guild
|
|
1964
2084
|
* @returns [Guild Widget settings](https://discord.com/developers/docs/resources/guild#guild-widget-settings-object-guild-widget-settings-structure)
|
|
1965
2085
|
*
|
|
@@ -1974,6 +2094,7 @@ declare class GuildMethods {
|
|
|
1974
2094
|
getGuildWidgetSettings(guildId: string): Promise<RESTGetAPIGuildWidgetSettingsResult>;
|
|
1975
2095
|
/**
|
|
1976
2096
|
* Update a guild widget settings object
|
|
2097
|
+
* @since 0.3.0
|
|
1977
2098
|
* @param guildId Id of the guild
|
|
1978
2099
|
* @param data widget settings
|
|
1979
2100
|
* @returns Updated [Guild Widget settings](https://discord.com/developers/docs/resources/guild#guild-widget-settings-object-guild-widget-settings-structure)
|
|
@@ -1992,6 +2113,7 @@ declare class GuildMethods {
|
|
|
1992
2113
|
}>): Promise<RESTPatchAPIGuildWidgetSettingsResult>;
|
|
1993
2114
|
/**
|
|
1994
2115
|
* Gets a guild widget object
|
|
2116
|
+
* @since 0.3.0
|
|
1995
2117
|
* @param guildId Id of the guild
|
|
1996
2118
|
* @returns [Guild Widget](https://discord.com/developers/docs/resources/guild#guild-widget-object)
|
|
1997
2119
|
*
|
|
@@ -2002,6 +2124,7 @@ declare class GuildMethods {
|
|
|
2002
2124
|
getGuildWidget(guildId: string): Promise<APIGuildWidget>;
|
|
2003
2125
|
/**
|
|
2004
2126
|
* Get a guild's vanity URL code
|
|
2127
|
+
* @since 0.3.0
|
|
2005
2128
|
* @param guildId Id of the guild
|
|
2006
2129
|
* @returns partial [invite object](https://discord.com/developers/docs/resources/guild#get-guild-vanity-url-example-partial-invite-object)
|
|
2007
2130
|
*
|
|
@@ -2016,6 +2139,7 @@ declare class GuildMethods {
|
|
|
2016
2139
|
getGuildVanityURL(guildId: string): Promise<RESTGetAPIGuildVanityUrlResult>;
|
|
2017
2140
|
/**
|
|
2018
2141
|
* Get a guild's welcome screen object
|
|
2142
|
+
* @since 0.3.0
|
|
2019
2143
|
* @param guildId Id of the guild
|
|
2020
2144
|
* @returns [Guild Welcome Screen](https://discord.com/developers/docs/resources/guild#welcome-screen-object)
|
|
2021
2145
|
*
|
|
@@ -2030,6 +2154,7 @@ declare class GuildMethods {
|
|
|
2030
2154
|
getGuildWelcomeScreen(guildId: string): Promise<RESTGetAPIGuildWelcomeScreenResult>;
|
|
2031
2155
|
/**
|
|
2032
2156
|
* Update a guild welcome screen object
|
|
2157
|
+
* @since 0.3.0
|
|
2033
2158
|
* @param guildId Id of guild
|
|
2034
2159
|
* @param data Welcome screen data
|
|
2035
2160
|
* @returns [Guild Welcome Screen](https://discord.com/developers/docs/resources/guild#welcome-screen-object)
|
|
@@ -2048,6 +2173,7 @@ declare class GuildMethods {
|
|
|
2048
2173
|
}): Promise<RESTPatchAPIGuildWelcomeScreenResult>;
|
|
2049
2174
|
/**
|
|
2050
2175
|
* Updates the current user's voice state in a stage channel
|
|
2176
|
+
* @since 0.3.0
|
|
2051
2177
|
* @param guildId Id of the guild
|
|
2052
2178
|
* @param data Data of the voice state
|
|
2053
2179
|
* @returns Resolves the Promise on successful execution
|
|
@@ -2065,6 +2191,7 @@ declare class GuildMethods {
|
|
|
2065
2191
|
updateCurrentUserVoiceState(guildId: string, data: RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody): Promise<RESTPatchAPIGuildVoiceStateCurrentMemberResult>;
|
|
2066
2192
|
/**
|
|
2067
2193
|
* Updates a user's voice state in a stage channel
|
|
2194
|
+
* @since 0.3.0
|
|
2068
2195
|
* @param guildId Id of the guild
|
|
2069
2196
|
* @param userId Id of the user
|
|
2070
2197
|
* @param data Data of the voice state
|
|
@@ -2084,6 +2211,7 @@ declare class GuildMethods {
|
|
|
2084
2211
|
|
|
2085
2212
|
/**
|
|
2086
2213
|
* Methods for interacting with Guild Scheduled Events
|
|
2214
|
+
* @since 0.3.6
|
|
2087
2215
|
*/
|
|
2088
2216
|
declare class GuildScheduledEventMethods {
|
|
2089
2217
|
requestHandler: RequestHandler;
|
|
@@ -2098,6 +2226,7 @@ declare class GuildScheduledEventMethods {
|
|
|
2098
2226
|
constructor(requestHandler: RequestHandler);
|
|
2099
2227
|
/**
|
|
2100
2228
|
* Get all scheduled events for a guild
|
|
2229
|
+
* @since 0.3.6
|
|
2101
2230
|
* @param guildId The Id of the guild
|
|
2102
2231
|
* @param withCounts Include number of users subscribed to each event
|
|
2103
2232
|
* @returns An array of [guild scheduled events](https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-structure)
|
|
@@ -2109,6 +2238,7 @@ declare class GuildScheduledEventMethods {
|
|
|
2109
2238
|
listGuildScheduledEvents(guildId: string, withCounts?: boolean): Promise<RESTGetAPIGuildScheduledEventsResult>;
|
|
2110
2239
|
/**
|
|
2111
2240
|
* Create a scheduled event for a guild
|
|
2241
|
+
* @since 0.3.6
|
|
2112
2242
|
* @param guildId The Id of the guild
|
|
2113
2243
|
* @param data Data for the new scheduled event
|
|
2114
2244
|
* @returns A [scheduled event](https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-structure)
|
|
@@ -2135,6 +2265,7 @@ declare class GuildScheduledEventMethods {
|
|
|
2135
2265
|
createGuildScheduledEvent(guildId: string, data: RESTPostAPIGuildScheduledEventJSONBody): Promise<RESTPostAPIGuildScheduledEventResult>;
|
|
2136
2266
|
/**
|
|
2137
2267
|
* Get a specific scheduled event for a guild
|
|
2268
|
+
* @since 0.3.6
|
|
2138
2269
|
* @param guildId The Id of the guild
|
|
2139
2270
|
* @param eventId The Id of the event
|
|
2140
2271
|
* @param withCounts Include number of users subscribed to this event
|
|
@@ -2151,6 +2282,7 @@ declare class GuildScheduledEventMethods {
|
|
|
2151
2282
|
getGuildScheduledEvent(guildId: string, eventId: string, withCounts?: boolean): Promise<RESTGetAPIGuildScheduledEventResult>;
|
|
2152
2283
|
/**
|
|
2153
2284
|
* Edit the details of a scheduled event for a guild
|
|
2285
|
+
* @since 0.3.6
|
|
2154
2286
|
* @param guildId The Id of the guild
|
|
2155
2287
|
* @param eventId The Id of the event
|
|
2156
2288
|
* @param data Edited scheduled event data
|
|
@@ -2173,6 +2305,7 @@ declare class GuildScheduledEventMethods {
|
|
|
2173
2305
|
editGuildScheduledEvent(guildId: string, eventId: string, data: RESTPatchAPIGuildScheduledEventJSONBody): Promise<RESTPatchAPIGuildScheduledEventResult>;
|
|
2174
2306
|
/**
|
|
2175
2307
|
* Delete a specific scheduled event for a guild
|
|
2308
|
+
* @since 0.3.6
|
|
2176
2309
|
* @param guildId The Id of the guild
|
|
2177
2310
|
* @param eventId The Id of the event
|
|
2178
2311
|
* @returns Resolves the promise on successful execution
|
|
@@ -2193,6 +2326,7 @@ declare class GuildScheduledEventMethods {
|
|
|
2193
2326
|
deleteGuildScheduledEvent(guildId: string, eventId: string): Promise<RESTDeleteAPIGuildScheduledEventResult>;
|
|
2194
2327
|
/**
|
|
2195
2328
|
* Get a list of users attending a specific event
|
|
2329
|
+
* @since 0.3.6
|
|
2196
2330
|
* @param guildId The Id of the guild
|
|
2197
2331
|
* @param eventId The Id of the event
|
|
2198
2332
|
* @param options Options for how to get users
|
|
@@ -2211,6 +2345,7 @@ declare class GuildScheduledEventMethods {
|
|
|
2211
2345
|
|
|
2212
2346
|
/**
|
|
2213
2347
|
* Methods for interacting with Guild Templates
|
|
2348
|
+
* @since 0.3.0
|
|
2214
2349
|
*/
|
|
2215
2350
|
declare class GuildTemplateMethods {
|
|
2216
2351
|
requestHandler: RequestHandler;
|
|
@@ -2225,6 +2360,7 @@ declare class GuildTemplateMethods {
|
|
|
2225
2360
|
constructor(requestHandler: RequestHandler);
|
|
2226
2361
|
/**
|
|
2227
2362
|
* Get a guild template by code
|
|
2363
|
+
* @since 0.3.0
|
|
2228
2364
|
* @param code The code for the template
|
|
2229
2365
|
* @returns A [guild template](https://discord.com/developers/docs/resources/guild-template#guild-template-object-guild-template-structure)
|
|
2230
2366
|
*
|
|
@@ -2235,6 +2371,7 @@ declare class GuildTemplateMethods {
|
|
|
2235
2371
|
getGuildTemplate(code: string): Promise<RESTGetAPITemplateResult>;
|
|
2236
2372
|
/**
|
|
2237
2373
|
* Creates a guild from a template. If using a bot account, the bot can only be in < 10 guilds (guild create limitation)
|
|
2374
|
+
* @since 0.3.0
|
|
2238
2375
|
* @param code The code of the template
|
|
2239
2376
|
* @param options Specific options for the new guild
|
|
2240
2377
|
* @returns A [guild](https://discord.com/developers/docs/resources/guild#guild-object-guild-structure)
|
|
@@ -2246,6 +2383,7 @@ declare class GuildTemplateMethods {
|
|
|
2246
2383
|
createGuildFromGuildTemplate(code: string, options: RESTPostAPITemplateCreateGuildJSONBody): Promise<RESTPostAPITemplateCreateGuildResult>;
|
|
2247
2384
|
/**
|
|
2248
2385
|
* Gets all templates from a guild
|
|
2386
|
+
* @since 0.3.0
|
|
2249
2387
|
* @param guildId The Id of the guild
|
|
2250
2388
|
* @returns An array of [guild templates](https://discord.com/developers/docs/resources/guild-template#guild-template-object-guild-template-structure)
|
|
2251
2389
|
*
|
|
@@ -2260,6 +2398,7 @@ declare class GuildTemplateMethods {
|
|
|
2260
2398
|
getGuildTemplates(guildId: string): Promise<RESTGetAPIGuildTemplatesResult>;
|
|
2261
2399
|
/**
|
|
2262
2400
|
* Creates a template from the current state of the guild
|
|
2401
|
+
* @since 0.3.0
|
|
2263
2402
|
* @param guildId The Id of the guild
|
|
2264
2403
|
* @param data Metadata for the template
|
|
2265
2404
|
* @returns A [guild tempalte](https://discord.com/developers/docs/resources/guild-template#guild-template-object-guild-template-structure)
|
|
@@ -2275,6 +2414,7 @@ declare class GuildTemplateMethods {
|
|
|
2275
2414
|
createGuildTemplate(guildId: string, data: RESTPostAPIGuildTemplatesJSONBody): Promise<RESTPostAPIGuildTemplatesResult>;
|
|
2276
2415
|
/**
|
|
2277
2416
|
* Updates a guild template to match the current state of the guild
|
|
2417
|
+
* @since 0.3.0
|
|
2278
2418
|
* @param guildId The Id of the guild
|
|
2279
2419
|
* @param code The code of the template
|
|
2280
2420
|
* @returns A [guild template](https://discord.com/developers/docs/resources/guild-template#guild-template-object-guild-template-structure)
|
|
@@ -2290,6 +2430,7 @@ declare class GuildTemplateMethods {
|
|
|
2290
2430
|
syncGuildTemplate(guildId: string, code: string): Promise<RESTPutAPIGuildTemplateSyncResult>;
|
|
2291
2431
|
/**
|
|
2292
2432
|
* Updates a guild template's metadata
|
|
2433
|
+
* @since 0.3.0
|
|
2293
2434
|
* @param guildId The Id of the guild
|
|
2294
2435
|
* @param code The code of the template
|
|
2295
2436
|
* @param data Metadata for the template
|
|
@@ -2306,6 +2447,7 @@ declare class GuildTemplateMethods {
|
|
|
2306
2447
|
modifyGuildTemplate(guildId: string, code: string, data: RESTPatchAPIGuildTemplateJSONBody): Promise<RESTPatchAPIGuildTemplateResult>;
|
|
2307
2448
|
/**
|
|
2308
2449
|
* Deletes a template from a guild
|
|
2450
|
+
* @since 0.3.0
|
|
2309
2451
|
* @param guildId The Id of the guild
|
|
2310
2452
|
* @param code The code of the template
|
|
2311
2453
|
* @returns A [guild template](https://discord.com/developers/docs/resources/guild-template#guild-template-object-guild-template-structure)
|
|
@@ -2323,6 +2465,7 @@ declare class GuildTemplateMethods {
|
|
|
2323
2465
|
|
|
2324
2466
|
/**
|
|
2325
2467
|
* Methods for handling webhook interactions
|
|
2468
|
+
* @since 0.1.0
|
|
2326
2469
|
*/
|
|
2327
2470
|
declare class WebhookMethods {
|
|
2328
2471
|
requestHandler: RequestHandler;
|
|
@@ -2339,6 +2482,7 @@ declare class WebhookMethods {
|
|
|
2339
2482
|
constructor(requestHandler: RequestHandler, disableEveryone: boolean);
|
|
2340
2483
|
/**
|
|
2341
2484
|
* Create a new Webhook
|
|
2485
|
+
* @since 0.1.0
|
|
2342
2486
|
* @param channelId Id of the channel
|
|
2343
2487
|
* @param data Object with webhook properties
|
|
2344
2488
|
* @returns [Webhook Object](https://discord.com/developers/docs/resources/webhook#webhook-object-webhook-structure)
|
|
@@ -2358,6 +2502,7 @@ declare class WebhookMethods {
|
|
|
2358
2502
|
createWebhook(channelId: string, data: RESTPostAPIChannelWebhookJSONBody): Promise<RESTPostAPIChannelWebhookResult>;
|
|
2359
2503
|
/**
|
|
2360
2504
|
* Get all webhooks within a channel
|
|
2505
|
+
* @since 0.5.0
|
|
2361
2506
|
* @param channelId Id of the channel
|
|
2362
2507
|
* @returns Array of [Webhook Objects](https://discord.com/developers/docs/resources/webhook#webhook-object-webhook-structure)
|
|
2363
2508
|
*
|
|
@@ -2373,6 +2518,7 @@ declare class WebhookMethods {
|
|
|
2373
2518
|
getChannelWebhooks(channelId: string): Promise<RESTGetAPIChannelWebhooksResult>;
|
|
2374
2519
|
/**
|
|
2375
2520
|
* Get all webhooks within a guild
|
|
2521
|
+
* @since 0.5.0
|
|
2376
2522
|
* @param guildId Id of the guild
|
|
2377
2523
|
* @returns Array of [Webhook Objects](https://discord.com/developers/docs/resources/webhook#webhook-object-webhook-structure)
|
|
2378
2524
|
*
|
|
@@ -2388,6 +2534,7 @@ declare class WebhookMethods {
|
|
|
2388
2534
|
getGuildWebhooks(guildId: string): Promise<RESTGetAPIGuildWebhooksResult>;
|
|
2389
2535
|
/**
|
|
2390
2536
|
* Get a single Webhook via Id
|
|
2537
|
+
* @since 0.1.0
|
|
2391
2538
|
* @param webhookId Id of the webhook
|
|
2392
2539
|
* @param token Webhook token
|
|
2393
2540
|
* @returns [Webhook Object](https://discord.com/developers/docs/resources/webhook#webhook-object-webhook-structure)
|
|
@@ -2404,6 +2551,7 @@ declare class WebhookMethods {
|
|
|
2404
2551
|
getWebhook(webhookId: string, token?: string): Promise<RESTGetAPIWebhookResult>;
|
|
2405
2552
|
/**
|
|
2406
2553
|
* Update a webhook
|
|
2554
|
+
* @since 0.1.0
|
|
2407
2555
|
* @param webhookId Id of the webhook
|
|
2408
2556
|
* @param data Updated Webhook properties
|
|
2409
2557
|
* @param token Webhook token
|
|
@@ -2429,6 +2577,7 @@ declare class WebhookMethods {
|
|
|
2429
2577
|
}): Promise<RESTPatchAPIWebhookResult>;
|
|
2430
2578
|
/**
|
|
2431
2579
|
* Delete a Webhook
|
|
2580
|
+
* @since 0.1.0
|
|
2432
2581
|
* @param webhookId Id of the webhook
|
|
2433
2582
|
* @param token Webhook token
|
|
2434
2583
|
* @returns Resolves the Promise on successful execution
|
|
@@ -2445,6 +2594,7 @@ declare class WebhookMethods {
|
|
|
2445
2594
|
deleteWebhook(webhookId: string, token?: string): Promise<RESTDeleteAPIWebhookResult>;
|
|
2446
2595
|
/**
|
|
2447
2596
|
* Send a message via Webhook
|
|
2597
|
+
* @since 0.1.0
|
|
2448
2598
|
* @param webhookId Id of the webhook
|
|
2449
2599
|
* @param token webhook token
|
|
2450
2600
|
* @param data Webhook data to send
|
|
@@ -2476,6 +2626,7 @@ declare class WebhookMethods {
|
|
|
2476
2626
|
}): Promise<RESTPostAPIWebhookWithTokenWaitResult>;
|
|
2477
2627
|
/**
|
|
2478
2628
|
* Execute a slack style Webhook
|
|
2629
|
+
* @since 0.1.0
|
|
2479
2630
|
* @param webhookId Id of the Webhook
|
|
2480
2631
|
* @param token Webhook token
|
|
2481
2632
|
* @param data Check [Slack's documentation](https://api.slack.com/incoming-webhooks)
|
|
@@ -2494,6 +2645,7 @@ declare class WebhookMethods {
|
|
|
2494
2645
|
}): Promise<RESTPostAPIWebhookWithTokenSlackWaitResult>;
|
|
2495
2646
|
/**
|
|
2496
2647
|
* Executes a github style Webhook
|
|
2648
|
+
* @since 0.3.0
|
|
2497
2649
|
* @param webhookId Id of the Webhook
|
|
2498
2650
|
* @param token Webhook token
|
|
2499
2651
|
* @param data Check [GitHub's documentation](https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#webhook-payload-object)
|
|
@@ -2508,6 +2660,7 @@ declare class WebhookMethods {
|
|
|
2508
2660
|
}): Promise<RESTPostAPIWebhookWithTokenGitHubWaitResult>;
|
|
2509
2661
|
/**
|
|
2510
2662
|
* Get a single message from a specific Webhook via Id
|
|
2663
|
+
* @since 0.3.0
|
|
2511
2664
|
* @param webhookId Id of the Webhook
|
|
2512
2665
|
* @param token Webhook token
|
|
2513
2666
|
* @param messageId Id of the message
|
|
@@ -2517,6 +2670,7 @@ declare class WebhookMethods {
|
|
|
2517
2670
|
getWebhookMessage(webhookId: string, token: string, messageId: string, threadId?: string): Promise<RESTGetAPIWebhookWithTokenMessageResult>;
|
|
2518
2671
|
/**
|
|
2519
2672
|
* Edit a message sent by a Webhook
|
|
2673
|
+
* @since 0.3.0
|
|
2520
2674
|
* @param webhookId Id of the Webhook
|
|
2521
2675
|
* @param token Webhook token
|
|
2522
2676
|
* @param messageId Id of the message
|
|
@@ -2536,6 +2690,7 @@ declare class WebhookMethods {
|
|
|
2536
2690
|
}): Promise<RESTPatchAPIWebhookWithTokenMessageResult>;
|
|
2537
2691
|
/**
|
|
2538
2692
|
* Delete a message sent by a Webhook
|
|
2693
|
+
* @since 0.3.0
|
|
2539
2694
|
* @param webhookId Id of the Webhook
|
|
2540
2695
|
* @param token Webhook token
|
|
2541
2696
|
* @param messageId Id of the message
|
|
@@ -2547,6 +2702,7 @@ declare class WebhookMethods {
|
|
|
2547
2702
|
|
|
2548
2703
|
/**
|
|
2549
2704
|
* Methods for interacting with slash command specific endpoints
|
|
2705
|
+
* @since 0.3.0
|
|
2550
2706
|
*/
|
|
2551
2707
|
declare class InteractionMethods {
|
|
2552
2708
|
requestHandler: RequestHandler;
|
|
@@ -2563,6 +2719,7 @@ declare class InteractionMethods {
|
|
|
2563
2719
|
constructor(requestHandler: RequestHandler, webhooks: WebhookMethods);
|
|
2564
2720
|
/**
|
|
2565
2721
|
* Fetch all global commands for your application
|
|
2722
|
+
* @since 0.3.0
|
|
2566
2723
|
* @param appId The Id of the application
|
|
2567
2724
|
* @param withLocalizations Whether or not to include localizations
|
|
2568
2725
|
* @returns An Array of [application command](https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-structure) objects
|
|
@@ -2574,6 +2731,7 @@ declare class InteractionMethods {
|
|
|
2574
2731
|
getApplicationCommands(appId: string, withLocalizations?: boolean): Promise<RESTGetAPIApplicationCommandsResult>;
|
|
2575
2732
|
/**
|
|
2576
2733
|
* Create a new global command. New global commands will be available in all guilds after 1 hour
|
|
2734
|
+
* @since 0.3.0
|
|
2577
2735
|
* @param appId The Id of the application
|
|
2578
2736
|
* @param data The command data
|
|
2579
2737
|
* @returns An [application command](https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-structure) object
|
|
@@ -2585,6 +2743,7 @@ declare class InteractionMethods {
|
|
|
2585
2743
|
createApplicationCommand(appId: string, data: RESTPostAPIApplicationCommandsJSONBody): Promise<RESTPostAPIApplicationCommandsResult>;
|
|
2586
2744
|
/**
|
|
2587
2745
|
* Fetch a global command for your application
|
|
2746
|
+
* @since 0.3.0
|
|
2588
2747
|
* @param appId The Id of the application
|
|
2589
2748
|
* @param cmdId The Id of the command
|
|
2590
2749
|
* @returns An [application command](https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-structure) object
|
|
@@ -2596,6 +2755,7 @@ declare class InteractionMethods {
|
|
|
2596
2755
|
getApplicationCommand(appId: string, cmdId: string): Promise<RESTGetAPIApplicationCommandResult>;
|
|
2597
2756
|
/**
|
|
2598
2757
|
* Edit a global command. Updates will be available in all guilds after 1 hour
|
|
2758
|
+
* @since 0.3.0
|
|
2599
2759
|
* @param appId The Id of the application
|
|
2600
2760
|
* @param cmdId The Id of the command
|
|
2601
2761
|
* @param data The command data
|
|
@@ -2608,6 +2768,7 @@ declare class InteractionMethods {
|
|
|
2608
2768
|
editApplicationCommand(appId: string, cmdId: string, data: RESTPatchAPIApplicationCommandJSONBody): Promise<RESTPatchAPIApplicationCommandResult>;
|
|
2609
2769
|
/**
|
|
2610
2770
|
* Deletes a global command
|
|
2771
|
+
* @since 0.3.0
|
|
2611
2772
|
* @param appId The Id of the application
|
|
2612
2773
|
* @param cmdId The Id of the command
|
|
2613
2774
|
* @returns Resolves the Promise on successful execution
|
|
@@ -2620,6 +2781,7 @@ declare class InteractionMethods {
|
|
|
2620
2781
|
/**
|
|
2621
2782
|
* Takes a list of application commands, overwriting existing commands that are registered globally for this application.
|
|
2622
2783
|
* Updates will be available in all guilds after 1 hour
|
|
2784
|
+
* @since 0.3.0
|
|
2623
2785
|
* @param appId The Id of the application
|
|
2624
2786
|
* @param data Array of commands
|
|
2625
2787
|
* @returns An Array of [application command](https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-structure) objects
|
|
@@ -2631,6 +2793,7 @@ declare class InteractionMethods {
|
|
|
2631
2793
|
bulkOverwriteApplicationCommands(appId: string, data: RESTPutAPIApplicationCommandsJSONBody): Promise<RESTPutAPIApplicationCommandsResult>;
|
|
2632
2794
|
/**
|
|
2633
2795
|
* Fetch all of the guild commands for your application for a specific guild.
|
|
2796
|
+
* @since 0.3.0
|
|
2634
2797
|
* @param appId The Id of the application
|
|
2635
2798
|
* @param guildId The Id of the guild
|
|
2636
2799
|
* @param withLocalizations Whether or not to include localizations
|
|
@@ -2643,6 +2806,7 @@ declare class InteractionMethods {
|
|
|
2643
2806
|
getGuildApplicationCommands(appId: string, guildId: string, withLocalizations?: boolean): Promise<RESTGetAPIApplicationGuildCommandsResult>;
|
|
2644
2807
|
/**
|
|
2645
2808
|
* Create a new guild command. New guild commands will be available in the guild immediately.
|
|
2809
|
+
* @since 0.3.0
|
|
2646
2810
|
* @param appId The Id of the application
|
|
2647
2811
|
* @param guildId The Id of the guild
|
|
2648
2812
|
* @param data Command data
|
|
@@ -2655,6 +2819,7 @@ declare class InteractionMethods {
|
|
|
2655
2819
|
createGuildApplicationCommand(appId: string, guildId: string, data: RESTPostAPIApplicationGuildCommandsJSONBody): Promise<RESTPostAPIApplicationGuildCommandsResult>;
|
|
2656
2820
|
/**
|
|
2657
2821
|
* Fetch a guild command for your application
|
|
2822
|
+
* @since 0.3.0
|
|
2658
2823
|
* @param appId The Id of the application
|
|
2659
2824
|
* @param guildId The Id of the guild
|
|
2660
2825
|
* @param cmdId The Id of the command
|
|
@@ -2667,6 +2832,7 @@ declare class InteractionMethods {
|
|
|
2667
2832
|
getGuildApplicationCommand(appId: string, guildId: string, cmdId: string): Promise<RESTGetAPIApplicationGuildCommandResult>;
|
|
2668
2833
|
/**
|
|
2669
2834
|
* Edit a guild command. Updates for guild commands will be available immediately.
|
|
2835
|
+
* @since 0.3.0
|
|
2670
2836
|
* @param appId The Id of the application
|
|
2671
2837
|
* @param guildId The Id of the guild
|
|
2672
2838
|
* @param cmdId The Id of the command
|
|
@@ -2680,6 +2846,7 @@ declare class InteractionMethods {
|
|
|
2680
2846
|
editGuildApplicationCommand(appId: string, guildId: string, cmdId: string, data: RESTPatchAPIApplicationGuildCommandJSONBody): Promise<RESTPatchAPIApplicationGuildCommandResult>;
|
|
2681
2847
|
/**
|
|
2682
2848
|
* Delete a guild command
|
|
2849
|
+
* @since 0.3.0
|
|
2683
2850
|
* @param appId The Id of the application
|
|
2684
2851
|
* @param guildId The Id of the guild
|
|
2685
2852
|
* @param cmdId The Id of the command
|
|
@@ -2692,6 +2859,7 @@ declare class InteractionMethods {
|
|
|
2692
2859
|
deleteGuildApplicationCommand(appId: string, guildId: string, cmdId: string): Promise<never>;
|
|
2693
2860
|
/**
|
|
2694
2861
|
* Takes a list of application commands, overwriting existing commands for the guild
|
|
2862
|
+
* @since 0.5.0
|
|
2695
2863
|
* @param appId The Id of the application
|
|
2696
2864
|
* @param guildId The Id of the guild
|
|
2697
2865
|
* @param data Array of commands
|
|
@@ -2704,6 +2872,7 @@ declare class InteractionMethods {
|
|
|
2704
2872
|
bulkOverwriteGuildApplicationCommands(appId: string, guildId: string, data: RESTPutAPIApplicationGuildCommandsJSONBody): Promise<RESTPutAPIApplicationGuildCommandsResult>;
|
|
2705
2873
|
/**
|
|
2706
2874
|
* Fetches command permissions for all or a specific command for your application in a guild
|
|
2875
|
+
* @since 0.3.0
|
|
2707
2876
|
* @param appId The Id of the application
|
|
2708
2877
|
* @param guildId The Id of the guild
|
|
2709
2878
|
* @param cmdId The Id of the command
|
|
@@ -2723,6 +2892,7 @@ declare class InteractionMethods {
|
|
|
2723
2892
|
getGuildApplicationCommandPermissions(appId: string, guildId: string, cmdId: string): Promise<RESTGetAPIApplicationCommandPermissionsResult>;
|
|
2724
2893
|
/**
|
|
2725
2894
|
* Edits command permissions for a specific command for your application in a guild. You can only add up to 10 permission overwrites for a command.
|
|
2895
|
+
* @since 0.5.0
|
|
2726
2896
|
* @param appId The Id of the application
|
|
2727
2897
|
* @param guildId The Id of the guild
|
|
2728
2898
|
* @param cmdId The Id of the command
|
|
@@ -2740,6 +2910,7 @@ declare class InteractionMethods {
|
|
|
2740
2910
|
* When uploading attachments to respond to message interactions, you must provide the top level files property
|
|
2741
2911
|
* which needs to match attachments array length and each element needs to match the same indexes as where their filename is defined (the top level files property gets deleted before it's appended to payload_json).
|
|
2742
2912
|
* Should you have a more elegant solution, possibly rewriting the interface with the request handler, please submit a PR/issue.
|
|
2913
|
+
* @since 0.3.0
|
|
2743
2914
|
* @param interactionId The Id of the interaction
|
|
2744
2915
|
* @param token The token of the interaction
|
|
2745
2916
|
* @param data Response data
|
|
@@ -2758,6 +2929,7 @@ declare class InteractionMethods {
|
|
|
2758
2929
|
}): Promise<void>;
|
|
2759
2930
|
/**
|
|
2760
2931
|
* Returns the initial Interaction response
|
|
2932
|
+
* @since 0.3.0
|
|
2761
2933
|
* @param appId The Id of the application
|
|
2762
2934
|
* @param token The token of the interaction
|
|
2763
2935
|
* @returns A [message](https://discord.com/developers/docs/resources/channel#message-object) object
|
|
@@ -2769,6 +2941,7 @@ declare class InteractionMethods {
|
|
|
2769
2941
|
getOriginalInteractionResponse(appId: string, token: string): Promise<RESTGetAPIInteractionOriginalResponseResult>;
|
|
2770
2942
|
/**
|
|
2771
2943
|
* Edits the initial Interaction response
|
|
2944
|
+
* @since 0.3.0
|
|
2772
2945
|
* @param appId The Id of the application
|
|
2773
2946
|
* @param token The token of the interaction
|
|
2774
2947
|
* @param data New response data
|
|
@@ -2786,6 +2959,7 @@ declare class InteractionMethods {
|
|
|
2786
2959
|
}): Promise<RESTPatchAPIInteractionOriginalResponseResult>;
|
|
2787
2960
|
/**
|
|
2788
2961
|
* Deletes the initial Interaction response
|
|
2962
|
+
* @since 0.3.0
|
|
2789
2963
|
* @param appId The Id of the application
|
|
2790
2964
|
* @param token The token of the interaction
|
|
2791
2965
|
* @returns Resolves the Promise on successful execution
|
|
@@ -2797,6 +2971,7 @@ declare class InteractionMethods {
|
|
|
2797
2971
|
deleteOriginalInteractionResponse(appId: string, token: string): Promise<RESTDeleteAPIInteractionOriginalResponseResult>;
|
|
2798
2972
|
/**
|
|
2799
2973
|
* Create a followup message for an Interaction
|
|
2974
|
+
* @since 0.3.0
|
|
2800
2975
|
* @param appId The Id of the application
|
|
2801
2976
|
* @param token The token of the interaction
|
|
2802
2977
|
* @param data Message data
|
|
@@ -2814,6 +2989,7 @@ declare class InteractionMethods {
|
|
|
2814
2989
|
}): Promise<RESTPostAPIInteractionFollowupResult>;
|
|
2815
2990
|
/**
|
|
2816
2991
|
* Get a followup message for an Interaction
|
|
2992
|
+
* @since 0.3.0
|
|
2817
2993
|
* @param appId The Id of the application
|
|
2818
2994
|
* @param token The token of the interaction
|
|
2819
2995
|
* @param messageId The Id of the message
|
|
@@ -2826,6 +3002,7 @@ declare class InteractionMethods {
|
|
|
2826
3002
|
getFollowupMessage(appId: string, token: string, messageId: string): Promise<RESTGetAPIInteractionFollowupResult>;
|
|
2827
3003
|
/**
|
|
2828
3004
|
* Edits a followup message for an Interaction
|
|
3005
|
+
* @since 0.3.0
|
|
2829
3006
|
* @param appId The Id of the application
|
|
2830
3007
|
* @param token The token of the interaction
|
|
2831
3008
|
* @param messageId The Id of the message
|
|
@@ -2844,6 +3021,7 @@ declare class InteractionMethods {
|
|
|
2844
3021
|
}): Promise<RESTPatchAPIInteractionFollowupResult>;
|
|
2845
3022
|
/**
|
|
2846
3023
|
* Deletes a followup message for an Interaction
|
|
3024
|
+
* @since 0.3.0
|
|
2847
3025
|
* @param appId The Id of the application
|
|
2848
3026
|
* @param token The token of the interaction
|
|
2849
3027
|
* @param messageId The Id of the message
|
|
@@ -2858,6 +3036,7 @@ declare class InteractionMethods {
|
|
|
2858
3036
|
|
|
2859
3037
|
/**
|
|
2860
3038
|
* Methods for interacting with invites
|
|
3039
|
+
* @since 0.1.0
|
|
2861
3040
|
*/
|
|
2862
3041
|
declare class InviteMethods {
|
|
2863
3042
|
requestHandler: RequestHandler;
|
|
@@ -2872,6 +3051,7 @@ declare class InviteMethods {
|
|
|
2872
3051
|
constructor(requestHandler: RequestHandler);
|
|
2873
3052
|
/**
|
|
2874
3053
|
* Get the invite data on an invite id
|
|
3054
|
+
* @since 0.1.0
|
|
2875
3055
|
* @param inviteId Id of the invite
|
|
2876
3056
|
* @param options Query params for additional metadata fields
|
|
2877
3057
|
* @returns [Invite Object](https://discord.com/developers/docs/resources/invite#invite-object)
|
|
@@ -2884,6 +3064,7 @@ declare class InviteMethods {
|
|
|
2884
3064
|
getInvite(inviteId: string, options?: RESTGetAPIInviteQuery): Promise<RESTGetAPIInviteResult>;
|
|
2885
3065
|
/**
|
|
2886
3066
|
* Delete an invite
|
|
3067
|
+
* @since 0.1.0
|
|
2887
3068
|
* @param inviteId
|
|
2888
3069
|
* @returns [Invite Object](https://discord.com/developers/docs/resources/invite#invite-object)
|
|
2889
3070
|
*
|
|
@@ -2901,6 +3082,7 @@ declare class InviteMethods {
|
|
|
2901
3082
|
|
|
2902
3083
|
/**
|
|
2903
3084
|
* Methods for interacting with Stage instances
|
|
3085
|
+
* @since 0.3.0
|
|
2904
3086
|
*/
|
|
2905
3087
|
declare class StageInstanceMethods {
|
|
2906
3088
|
requestHandler: RequestHandler;
|
|
@@ -2915,6 +3097,7 @@ declare class StageInstanceMethods {
|
|
|
2915
3097
|
constructor(requestHandler: RequestHandler);
|
|
2916
3098
|
/**
|
|
2917
3099
|
* Creates a new stage instance associated to a stage channel
|
|
3100
|
+
* @since 0.3.0
|
|
2918
3101
|
* @param data The options for creating a stage instance
|
|
2919
3102
|
* @returns a [stage instance](https://discord.com/developers/docs/resources/stage-instance#auto-closing-stage-instance-structure) object
|
|
2920
3103
|
*
|
|
@@ -2934,6 +3117,7 @@ declare class StageInstanceMethods {
|
|
|
2934
3117
|
}): Promise<RESTPostAPIStageInstanceResult>;
|
|
2935
3118
|
/**
|
|
2936
3119
|
* Gets the stage instance associated to a stage channel if it exists
|
|
3120
|
+
* @since 0.3.0
|
|
2937
3121
|
* @param channelId Id of the stage channel
|
|
2938
3122
|
* @returns a [stage instance](https://discord.com/developers/docs/resources/stage-instance#auto-closing-stage-instance-structure) object
|
|
2939
3123
|
*
|
|
@@ -2944,6 +3128,7 @@ declare class StageInstanceMethods {
|
|
|
2944
3128
|
getStageInstance(channelId: string): Promise<RESTGetAPIStageInstanceResult>;
|
|
2945
3129
|
/**
|
|
2946
3130
|
* Updates an existing stage instance
|
|
3131
|
+
* @since 0.3.0
|
|
2947
3132
|
* @param channelId Id of the stage channel
|
|
2948
3133
|
* @param data The new data to send
|
|
2949
3134
|
* @returns a [stage instance](https://discord.com/developers/docs/resources/stage-instance#auto-closing-stage-instance-structure) object
|
|
@@ -2963,6 +3148,7 @@ declare class StageInstanceMethods {
|
|
|
2963
3148
|
}): Promise<RESTPatchAPIStageInstanceResult>;
|
|
2964
3149
|
/**
|
|
2965
3150
|
* Delete an existing stage instance
|
|
3151
|
+
* @since 0.3.0
|
|
2966
3152
|
* @param channelId Id of the stage channel
|
|
2967
3153
|
* @param reason Reason for deleting the stage instance
|
|
2968
3154
|
* @returns a [stage instance](https://discord.com/developers/docs/resources/stage-instance#auto-closing-stage-instance-structure) object
|
|
@@ -2982,6 +3168,7 @@ declare class StageInstanceMethods {
|
|
|
2982
3168
|
|
|
2983
3169
|
/**
|
|
2984
3170
|
* Methods for interacting with users
|
|
3171
|
+
* @since 0.1.0
|
|
2985
3172
|
*/
|
|
2986
3173
|
declare class UserMethods {
|
|
2987
3174
|
requestHandler: RequestHandler;
|
|
@@ -2996,6 +3183,7 @@ declare class UserMethods {
|
|
|
2996
3183
|
constructor(requestHandler: RequestHandler);
|
|
2997
3184
|
/**
|
|
2998
3185
|
* Get information about the CurrentUser
|
|
3186
|
+
* @since 0.1.0
|
|
2999
3187
|
* @returns A [user object](https://discord.com/developers/docs/resources/user#user-object)
|
|
3000
3188
|
*
|
|
3001
3189
|
* | OAUTH2 Scopes | Condition |
|
|
@@ -3010,6 +3198,7 @@ declare class UserMethods {
|
|
|
3010
3198
|
getSelf(): Promise<RESTGetAPICurrentUserResult>;
|
|
3011
3199
|
/**
|
|
3012
3200
|
* Get information about a user via Id
|
|
3201
|
+
* @since 0.1.0
|
|
3013
3202
|
* @param userId Id of the user
|
|
3014
3203
|
* @returns [user object](https://discord.com/developers/docs/resources/user#user-object)
|
|
3015
3204
|
*
|
|
@@ -3020,6 +3209,7 @@ declare class UserMethods {
|
|
|
3020
3209
|
getUser(userId: string): Promise<RESTGetAPIUserResult>;
|
|
3021
3210
|
/**
|
|
3022
3211
|
* Update the current user
|
|
3212
|
+
* @since 0.1.0
|
|
3023
3213
|
* @param data The new data of the CurrentUser
|
|
3024
3214
|
* @returns [user object](https://discord.com/developers/docs/resources/user#user-object)
|
|
3025
3215
|
*
|
|
@@ -3035,6 +3225,7 @@ declare class UserMethods {
|
|
|
3035
3225
|
updateSelf(data: RESTPatchAPICurrentUserJSONBody): Promise<RESTPatchAPICurrentUserResult>;
|
|
3036
3226
|
/**
|
|
3037
3227
|
* Get guilds of the current user
|
|
3228
|
+
* @since 0.1.0
|
|
3038
3229
|
* @param options Options for getting guilds
|
|
3039
3230
|
* @returns Array of [partial guild objects](https://discord.com/developers/docs/resources/guild#guild-object)
|
|
3040
3231
|
*
|
|
@@ -3045,6 +3236,7 @@ declare class UserMethods {
|
|
|
3045
3236
|
getGuilds(options?: RESTGetAPICurrentUserGuildsQuery): Promise<RESTGetAPICurrentUserGuildsResult>;
|
|
3046
3237
|
/**
|
|
3047
3238
|
* Leaves a guild
|
|
3239
|
+
* @since 0.1.0
|
|
3048
3240
|
* @param guildId Id of the guild
|
|
3049
3241
|
* @returns Resolves the Promise on successful execution
|
|
3050
3242
|
*
|
|
@@ -3057,6 +3249,7 @@ declare class UserMethods {
|
|
|
3057
3249
|
* Create a direct message channel with another user
|
|
3058
3250
|
*
|
|
3059
3251
|
* **You can not create a dm with another bot**
|
|
3252
|
+
* @since 0.1.0
|
|
3060
3253
|
* @param userId Id of the user to create the direct message channel with
|
|
3061
3254
|
* @returns A [DM channel](https://discord.com/developers/docs/resources/channel#channel-object)
|
|
3062
3255
|
*
|
|
@@ -3069,7 +3262,7 @@ declare class UserMethods {
|
|
|
3069
3262
|
createDirectMessageChannel(userId: string): Promise<RESTPostAPICurrentUserCreateDMChannelResult>;
|
|
3070
3263
|
/**
|
|
3071
3264
|
* Create a group direct message channel with other users
|
|
3072
|
-
*
|
|
3265
|
+
* @since 0.7.0
|
|
3073
3266
|
* @param data An object containing a list of access tokens with gdm.join and optionally, a nickname dictionary keyed by user IDs with strings as values
|
|
3074
3267
|
* @returns A [DM channel](https://discord.com/developers/docs/resources/channel#channel-object)
|
|
3075
3268
|
*
|
|
@@ -3091,6 +3284,7 @@ declare class UserMethods {
|
|
|
3091
3284
|
}): Promise<RESTPostAPICurrentUserCreateDMChannelResult>;
|
|
3092
3285
|
/**
|
|
3093
3286
|
* Returns a list of connections for the current user
|
|
3287
|
+
* @since 0.7.0
|
|
3094
3288
|
* @returns A list of [connections](https://discord.com/developers/docs/resources/user#connection-object)
|
|
3095
3289
|
*
|
|
3096
3290
|
* | OAUTH2 Scopes | Condition |
|
|
@@ -3105,6 +3299,7 @@ declare class UserMethods {
|
|
|
3105
3299
|
getConnections(): Promise<RESTGetAPICurrentUserConnectionsResult>;
|
|
3106
3300
|
/**
|
|
3107
3301
|
* Gets a role connection for the current user
|
|
3302
|
+
* @since 0.7.0
|
|
3108
3303
|
* @param appId Id of the application
|
|
3109
3304
|
* @returns An [Application role connection](https://discord.com/developers/docs/resources/user#application-role-connection-object)
|
|
3110
3305
|
*
|
|
@@ -3120,6 +3315,7 @@ declare class UserMethods {
|
|
|
3120
3315
|
getApplicationRoleConnection(appId: string): Promise<RESTGetAPICurrentUserApplicationRoleConnectionResult>;
|
|
3121
3316
|
/**
|
|
3122
3317
|
* Updates a role connection for the current user
|
|
3318
|
+
* @since 0.7.0
|
|
3123
3319
|
* @param appId Id of the application
|
|
3124
3320
|
* @returns An [Application role connection](https://discord.com/developers/docs/resources/user#application-role-connection-object)
|
|
3125
3321
|
*
|
|
@@ -3137,6 +3333,7 @@ declare class UserMethods {
|
|
|
3137
3333
|
|
|
3138
3334
|
/**
|
|
3139
3335
|
* Methods for interacting with some voice
|
|
3336
|
+
* @since 0.1.0
|
|
3140
3337
|
*/
|
|
3141
3338
|
declare class VoiceMethods {
|
|
3142
3339
|
requestHandler: RequestHandler;
|
|
@@ -3151,6 +3348,7 @@ declare class VoiceMethods {
|
|
|
3151
3348
|
constructor(requestHandler: RequestHandler);
|
|
3152
3349
|
/**
|
|
3153
3350
|
* Get currently available voice regions that can be used when creating servers
|
|
3351
|
+
* @since 0.1.0
|
|
3154
3352
|
* @returns Array of [voice region](https://discord.com/developers/docs/resources/voice#voice-region-object) objects
|
|
3155
3353
|
*
|
|
3156
3354
|
* @example
|
|
@@ -3160,17 +3358,19 @@ declare class VoiceMethods {
|
|
|
3160
3358
|
getVoiceRegions(): Promise<RESTGetAPIVoiceRegionsResult>;
|
|
3161
3359
|
/**
|
|
3162
3360
|
* Get the CurrentUser's voice state for a guild
|
|
3361
|
+
* @since 0.10.6
|
|
3163
3362
|
* @param guildId Id of the guild
|
|
3164
3363
|
* @returns A [voice state](https://discord.com/developers/docs/resources/voice#voice-state-object) object
|
|
3165
3364
|
*/
|
|
3166
|
-
getCurrentUserVoiceState(guildId: string): Promise<
|
|
3365
|
+
getCurrentUserVoiceState(guildId: string): Promise<APIVoiceState>;
|
|
3167
3366
|
/**
|
|
3168
3367
|
* Get a user's voice state for a guild
|
|
3368
|
+
* @since 0.10.6
|
|
3169
3369
|
* @param guildId Id of the guild
|
|
3170
3370
|
* @param userId Id of the user
|
|
3171
3371
|
* @returns A [voice state](https://discord.com/developers/docs/resources/voice#voice-state-object) object
|
|
3172
3372
|
*/
|
|
3173
|
-
getUserVoiceState(guildId: string, userId: string): Promise<
|
|
3373
|
+
getUserVoiceState(guildId: string, userId: string): Promise<APIVoiceState>;
|
|
3174
3374
|
}
|
|
3175
3375
|
|
|
3176
3376
|
declare const Constants: {
|
|
@@ -3189,11 +3389,12 @@ declare const Constants: {
|
|
|
3189
3389
|
standardMultipartHandler(data: {
|
|
3190
3390
|
files: Array<{
|
|
3191
3391
|
name: string;
|
|
3192
|
-
file: Buffer | Blob | File | Readable | ReadableStream;
|
|
3392
|
+
file: Buffer | Blob | File$1 | Readable | ReadableStream;
|
|
3193
3393
|
}>;
|
|
3194
3394
|
data?: any;
|
|
3195
3395
|
}): FormData;
|
|
3196
|
-
standardAddToFormHandler(form: FormData, name: string, value: Buffer | Blob | File | Readable | ReadableStream, filename?: string): void;
|
|
3396
|
+
standardAddToFormHandler(form: FormData, name: string, value: Buffer | Blob | File$1 | Readable | ReadableStream, filename?: string): void;
|
|
3397
|
+
replaceEveryone(content: string): string;
|
|
3197
3398
|
};
|
|
3198
3399
|
|
|
3199
3400
|
/**
|
|
@@ -3299,6 +3500,9 @@ declare const Endpoints: {
|
|
|
3299
3500
|
WEBHOOK_TOKEN_SLACK: (hookID: string, token: string) => `${ReturnType<typeof Endpoints.WEBHOOK_TOKEN>}/slack`;
|
|
3300
3501
|
};
|
|
3301
3502
|
|
|
3503
|
+
/**
|
|
3504
|
+
* @since 0.1.0
|
|
3505
|
+
*/
|
|
3302
3506
|
declare class SnowTransfer {
|
|
3303
3507
|
/** Options for this SnowTransfer instance */
|
|
3304
3508
|
options: {
|