snowtransfer 0.8.4 → 0.8.6
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 +59 -56
- 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,12 +1,14 @@
|
|
|
1
1
|
import { EventEmitter } from 'events';
|
|
2
2
|
import FormData from 'form-data';
|
|
3
|
-
import
|
|
3
|
+
import undici from 'undici';
|
|
4
|
+
import { ReadableStream } from 'stream/web';
|
|
4
5
|
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 } from 'discord-api-types/v10';
|
|
6
|
+
import { Readable } from 'stream';
|
|
5
7
|
|
|
6
8
|
type HTTPMethod = "get" | "post" | "patch" | "head" | "put" | "delete" | "connect" | "options" | "trace";
|
|
7
9
|
declare class DiscordAPIError extends Error {
|
|
8
|
-
method: HTTPMethod;
|
|
9
10
|
path: string;
|
|
11
|
+
method: HTTPMethod;
|
|
10
12
|
code: number;
|
|
11
13
|
httpStatus: number;
|
|
12
14
|
constructor(path: string, error: {
|
|
@@ -66,6 +68,8 @@ declare class Ratelimiter {
|
|
|
66
68
|
* @protected
|
|
67
69
|
*/
|
|
68
70
|
declare class LocalBucket {
|
|
71
|
+
ratelimiter: Ratelimiter;
|
|
72
|
+
routeKey: string;
|
|
69
73
|
/**
|
|
70
74
|
* array of functions waiting to be executed
|
|
71
75
|
*/
|
|
@@ -89,14 +93,6 @@ declare class LocalBucket {
|
|
|
89
93
|
* Timeout that calls the reset function once the timeframe passed
|
|
90
94
|
*/
|
|
91
95
|
resetTimeout: NodeJS.Timeout | null;
|
|
92
|
-
/**
|
|
93
|
-
* ratelimiter used for ratelimiting requests
|
|
94
|
-
*/
|
|
95
|
-
ratelimiter: Ratelimiter;
|
|
96
|
-
/**
|
|
97
|
-
* Key used internally to routify requests
|
|
98
|
-
*/
|
|
99
|
-
routeKey: string;
|
|
100
96
|
/**
|
|
101
97
|
* Create a new bucket
|
|
102
98
|
* @param ratelimiter ratelimiter used for ratelimiting requests
|
|
@@ -130,7 +126,7 @@ type HandlerEvents = {
|
|
|
130
126
|
dataType: "json" | "multipart";
|
|
131
127
|
data: any;
|
|
132
128
|
}];
|
|
133
|
-
done: [string,
|
|
129
|
+
done: [string, IResponse];
|
|
134
130
|
requestError: [string, Error];
|
|
135
131
|
rateLimit: [{
|
|
136
132
|
timeout: number;
|
|
@@ -214,22 +210,29 @@ declare class RequestHandler extends EventEmitter {
|
|
|
214
210
|
*/
|
|
215
211
|
private _multiPartRequest;
|
|
216
212
|
}
|
|
213
|
+
interface IResponse {
|
|
214
|
+
headers: undici.Headers;
|
|
215
|
+
status: number;
|
|
216
|
+
body: ReadableStream | null;
|
|
217
|
+
json(): Promise<unknown>;
|
|
218
|
+
text(): Promise<string>;
|
|
219
|
+
}
|
|
217
220
|
|
|
218
|
-
type ___RequestHandler_HTTPMethod = HTTPMethod;
|
|
219
221
|
type ___RequestHandler_DiscordAPIError = DiscordAPIError;
|
|
220
222
|
declare const ___RequestHandler_DiscordAPIError: typeof DiscordAPIError;
|
|
221
|
-
type
|
|
222
|
-
declare const ___RequestHandler_Ratelimiter: typeof Ratelimiter;
|
|
223
|
+
type ___RequestHandler_HTTPMethod = HTTPMethod;
|
|
223
224
|
type ___RequestHandler_LocalBucket = LocalBucket;
|
|
224
225
|
declare const ___RequestHandler_LocalBucket: typeof LocalBucket;
|
|
226
|
+
type ___RequestHandler_Ratelimiter = Ratelimiter;
|
|
227
|
+
declare const ___RequestHandler_Ratelimiter: typeof Ratelimiter;
|
|
225
228
|
type ___RequestHandler_RequestHandler = RequestHandler;
|
|
226
229
|
declare const ___RequestHandler_RequestHandler: typeof RequestHandler;
|
|
227
230
|
declare namespace ___RequestHandler {
|
|
228
231
|
export {
|
|
229
|
-
___RequestHandler_HTTPMethod as HTTPMethod,
|
|
230
232
|
___RequestHandler_DiscordAPIError as DiscordAPIError,
|
|
231
|
-
|
|
233
|
+
___RequestHandler_HTTPMethod as HTTPMethod,
|
|
232
234
|
___RequestHandler_LocalBucket as LocalBucket,
|
|
235
|
+
___RequestHandler_Ratelimiter as Ratelimiter,
|
|
233
236
|
___RequestHandler_RequestHandler as RequestHandler,
|
|
234
237
|
};
|
|
235
238
|
}
|
|
@@ -238,7 +241,7 @@ declare namespace ___RequestHandler {
|
|
|
238
241
|
* Methods for interacting with Guild Audit Logs
|
|
239
242
|
*/
|
|
240
243
|
declare class AuditLogMethods {
|
|
241
|
-
requestHandler: (typeof ___RequestHandler)["RequestHandler"]
|
|
244
|
+
requestHandler: InstanceType<(typeof ___RequestHandler)["RequestHandler"]>;
|
|
242
245
|
/**
|
|
243
246
|
* Create a new Audit Log Method Handler
|
|
244
247
|
*
|
|
@@ -247,7 +250,7 @@ declare class AuditLogMethods {
|
|
|
247
250
|
* You can access the methods listed via `client.auditLog.method`, where `client` is an initialized SnowTransfer instance
|
|
248
251
|
* @param requestHandler request handler that calls the rest api
|
|
249
252
|
*/
|
|
250
|
-
constructor(requestHandler:
|
|
253
|
+
constructor(requestHandler: InstanceType<(typeof ___RequestHandler)["RequestHandler"]>);
|
|
251
254
|
/**
|
|
252
255
|
* Get the audit logs of the specified guild id
|
|
253
256
|
* @param guildId id of a guild
|
|
@@ -274,7 +277,7 @@ declare class AuditLogMethods {
|
|
|
274
277
|
* Methods for interacting with guild auto moderation
|
|
275
278
|
*/
|
|
276
279
|
declare class AutoModerationMethods {
|
|
277
|
-
requestHandler: (typeof ___RequestHandler)["RequestHandler"]
|
|
280
|
+
requestHandler: InstanceType<(typeof ___RequestHandler)["RequestHandler"]>;
|
|
278
281
|
/**
|
|
279
282
|
* Create a new Auto Moderation Method Handler
|
|
280
283
|
*
|
|
@@ -283,7 +286,7 @@ declare class AutoModerationMethods {
|
|
|
283
286
|
* You can access the methods listed via `client.autoMod.method`, where `client` is an initialized SnowTransfer instance
|
|
284
287
|
* @param requestHandler request handler that calls the rest api
|
|
285
288
|
*/
|
|
286
|
-
constructor(requestHandler:
|
|
289
|
+
constructor(requestHandler: InstanceType<(typeof ___RequestHandler)["RequestHandler"]>);
|
|
287
290
|
/**
|
|
288
291
|
* Get all of the auto moderation rules from a guild
|
|
289
292
|
* @param guildId id of the guild
|
|
@@ -391,7 +394,7 @@ declare class AutoModerationMethods {
|
|
|
391
394
|
* Methods for interacting with bot specific endpoints
|
|
392
395
|
*/
|
|
393
396
|
declare class BotMethods {
|
|
394
|
-
requestHandler: (typeof ___RequestHandler)["RequestHandler"]
|
|
397
|
+
requestHandler: InstanceType<(typeof ___RequestHandler)["RequestHandler"]>;
|
|
395
398
|
/**
|
|
396
399
|
* Create a new Bot Method Handler
|
|
397
400
|
*
|
|
@@ -400,7 +403,7 @@ declare class BotMethods {
|
|
|
400
403
|
* You can access the methods listed via `client.bot.method`, where `client` is an initialized SnowTransfer instance
|
|
401
404
|
* @param requestHandler request handler that calls the rest api
|
|
402
405
|
*/
|
|
403
|
-
constructor(requestHandler:
|
|
406
|
+
constructor(requestHandler: InstanceType<(typeof ___RequestHandler)["RequestHandler"]>);
|
|
404
407
|
/**
|
|
405
408
|
* Get the gateway url to connect to
|
|
406
409
|
* @returns [Gateway data](https://discord.com/developers/docs/topics/gateway#get-gateway-example-response)
|
|
@@ -427,7 +430,7 @@ declare class BotMethods {
|
|
|
427
430
|
* Methods for interacting with Channels and Messages
|
|
428
431
|
*/
|
|
429
432
|
declare class ChannelMethods {
|
|
430
|
-
requestHandler: (typeof ___RequestHandler)["RequestHandler"]
|
|
433
|
+
requestHandler: InstanceType<(typeof ___RequestHandler)["RequestHandler"]>;
|
|
431
434
|
disableEveryone: boolean;
|
|
432
435
|
/**
|
|
433
436
|
* Create a new Channel Method handler
|
|
@@ -438,7 +441,7 @@ declare class ChannelMethods {
|
|
|
438
441
|
* @param requestHandler request handler that calls the rest api
|
|
439
442
|
* @param disableEveryone Disable [at]everyone/[at]here on outgoing messages
|
|
440
443
|
*/
|
|
441
|
-
constructor(requestHandler:
|
|
444
|
+
constructor(requestHandler: InstanceType<(typeof ___RequestHandler)["RequestHandler"]>, disableEveryone: boolean);
|
|
442
445
|
/**
|
|
443
446
|
* Get a channel via Id
|
|
444
447
|
* @param channelId Id of the channel
|
|
@@ -583,7 +586,7 @@ declare class ChannelMethods {
|
|
|
583
586
|
createMessage(channelId: string, data: string | RESTPostAPIChannelMessageJSONBody & {
|
|
584
587
|
files?: Array<{
|
|
585
588
|
name: string;
|
|
586
|
-
file: Buffer;
|
|
589
|
+
file: Buffer | Readable | ReadableStream;
|
|
587
590
|
}>;
|
|
588
591
|
}, options?: {
|
|
589
592
|
disableEveryone?: boolean;
|
|
@@ -740,7 +743,7 @@ declare class ChannelMethods {
|
|
|
740
743
|
editMessage(channelId: string, messageId: string, data: string | RESTPatchAPIChannelMessageJSONBody & {
|
|
741
744
|
files?: Array<{
|
|
742
745
|
name: string;
|
|
743
|
-
file: Buffer;
|
|
746
|
+
file: Buffer | Readable | ReadableStream;
|
|
744
747
|
}>;
|
|
745
748
|
}, options?: {
|
|
746
749
|
disableEveryone?: boolean;
|
|
@@ -1141,7 +1144,7 @@ declare class ChannelMethods {
|
|
|
1141
1144
|
* Methods for interacting with emojis
|
|
1142
1145
|
*/
|
|
1143
1146
|
declare class GuildAssetsMethods {
|
|
1144
|
-
requestHandler: (typeof ___RequestHandler)["RequestHandler"]
|
|
1147
|
+
requestHandler: InstanceType<(typeof ___RequestHandler)["RequestHandler"]>;
|
|
1145
1148
|
/**
|
|
1146
1149
|
* Create a new GuildAssets Method handler
|
|
1147
1150
|
*
|
|
@@ -1150,7 +1153,7 @@ declare class GuildAssetsMethods {
|
|
|
1150
1153
|
* You can access the methods listed via `client.guildAssets.method`, where `client` is an initialized SnowTransfer instance
|
|
1151
1154
|
* @param requestHandler request handler that calls the rest api
|
|
1152
1155
|
*/
|
|
1153
|
-
constructor(requestHandler:
|
|
1156
|
+
constructor(requestHandler: InstanceType<(typeof ___RequestHandler)["RequestHandler"]>);
|
|
1154
1157
|
/**
|
|
1155
1158
|
* Get a list of emojis of a guild
|
|
1156
1159
|
* @param guildId Id of the guild
|
|
@@ -1300,7 +1303,7 @@ declare class GuildAssetsMethods {
|
|
|
1300
1303
|
* const sticker = await client.guildAssets.createGuildSticker("guild id", stickerData)
|
|
1301
1304
|
*/
|
|
1302
1305
|
createGuildSticker(guildId: string, data: RESTPostAPIGuildStickerFormDataBody & {
|
|
1303
|
-
file: Buffer;
|
|
1306
|
+
file: Buffer | Readable | ReadableStream;
|
|
1304
1307
|
reason?: string;
|
|
1305
1308
|
}): Promise<RESTPostAPIGuildStickerResult>;
|
|
1306
1309
|
/**
|
|
@@ -1344,7 +1347,7 @@ declare class GuildAssetsMethods {
|
|
|
1344
1347
|
* Methods for interacting with Guilds
|
|
1345
1348
|
*/
|
|
1346
1349
|
declare class GuildMethods {
|
|
1347
|
-
requestHandler: (typeof ___RequestHandler)["RequestHandler"]
|
|
1350
|
+
requestHandler: InstanceType<(typeof ___RequestHandler)["RequestHandler"]>;
|
|
1348
1351
|
/**
|
|
1349
1352
|
* Create a new Guild Method Handler
|
|
1350
1353
|
*
|
|
@@ -1353,7 +1356,7 @@ declare class GuildMethods {
|
|
|
1353
1356
|
* You can access the methods listed via `client.guild.method`, where `client` is an initialized SnowTransfer instance
|
|
1354
1357
|
* @param requestHandler request handler that calls the rest api
|
|
1355
1358
|
*/
|
|
1356
|
-
constructor(requestHandler:
|
|
1359
|
+
constructor(requestHandler: InstanceType<(typeof ___RequestHandler)["RequestHandler"]>);
|
|
1357
1360
|
/**
|
|
1358
1361
|
* Create a new Guild, **limited to 10 guilds (you may create more if you are whitelisted)**
|
|
1359
1362
|
* Check the [discord docs](https://discord.com/developers/docs/resources/guild#create-guild) for more infos
|
|
@@ -2035,7 +2038,7 @@ declare class GuildMethods {
|
|
|
2035
2038
|
* Methods for interacting with Guild Scheduled Events
|
|
2036
2039
|
*/
|
|
2037
2040
|
declare class GuildScheduledEventMethods {
|
|
2038
|
-
requestHandler: (typeof ___RequestHandler)["RequestHandler"]
|
|
2041
|
+
requestHandler: InstanceType<(typeof ___RequestHandler)["RequestHandler"]>;
|
|
2039
2042
|
/**
|
|
2040
2043
|
* Create a new Guild Scheduled Event Method Handler
|
|
2041
2044
|
*
|
|
@@ -2044,7 +2047,7 @@ declare class GuildScheduledEventMethods {
|
|
|
2044
2047
|
* You can access the methods listed via `client.guildScheduledEvent.method`, where `client` is an initialized SnowTransfer instance
|
|
2045
2048
|
* @param requestHandler request handler that calls the rest api
|
|
2046
2049
|
*/
|
|
2047
|
-
constructor(requestHandler:
|
|
2050
|
+
constructor(requestHandler: InstanceType<(typeof ___RequestHandler)["RequestHandler"]>);
|
|
2048
2051
|
/**
|
|
2049
2052
|
* Get all scheduled events for a guild
|
|
2050
2053
|
* @param guildId The Id of the guild
|
|
@@ -2162,7 +2165,7 @@ declare class GuildScheduledEventMethods {
|
|
|
2162
2165
|
* Methods for interacting with Guild Templates
|
|
2163
2166
|
*/
|
|
2164
2167
|
declare class GuildTemplateMethods {
|
|
2165
|
-
requestHandler: (typeof ___RequestHandler)["RequestHandler"]
|
|
2168
|
+
requestHandler: InstanceType<(typeof ___RequestHandler)["RequestHandler"]>;
|
|
2166
2169
|
/**
|
|
2167
2170
|
* Create a new Guild Template Method Handler
|
|
2168
2171
|
*
|
|
@@ -2171,7 +2174,7 @@ declare class GuildTemplateMethods {
|
|
|
2171
2174
|
* You can access the methods listed via `client.guildTemplate.method`, where `client` is an initialized SnowTransfer instance
|
|
2172
2175
|
* @param requestHandler request handler that calls the rest api
|
|
2173
2176
|
*/
|
|
2174
|
-
constructor(requestHandler:
|
|
2177
|
+
constructor(requestHandler: InstanceType<(typeof ___RequestHandler)["RequestHandler"]>);
|
|
2175
2178
|
/**
|
|
2176
2179
|
* Get a guild template by code
|
|
2177
2180
|
* @param code The code for the template
|
|
@@ -2274,7 +2277,7 @@ declare class GuildTemplateMethods {
|
|
|
2274
2277
|
* Methods for handling webhook interactions
|
|
2275
2278
|
*/
|
|
2276
2279
|
declare class WebhookMethods {
|
|
2277
|
-
requestHandler: (typeof ___RequestHandler)["RequestHandler"]
|
|
2280
|
+
requestHandler: InstanceType<(typeof ___RequestHandler)["RequestHandler"]>;
|
|
2278
2281
|
disableEveryone: boolean;
|
|
2279
2282
|
/**
|
|
2280
2283
|
* Create a new Method Handler
|
|
@@ -2285,7 +2288,7 @@ declare class WebhookMethods {
|
|
|
2285
2288
|
* @param requestHandler request handler that calls the rest api
|
|
2286
2289
|
* @param disableEveryone Disable [at]everyone/[at]here on outgoing messages
|
|
2287
2290
|
*/
|
|
2288
|
-
constructor(requestHandler:
|
|
2291
|
+
constructor(requestHandler: InstanceType<(typeof ___RequestHandler)["RequestHandler"]>, disableEveryone: boolean);
|
|
2289
2292
|
/**
|
|
2290
2293
|
* Create a new Webhook
|
|
2291
2294
|
* @param channelId Id of the channel
|
|
@@ -2408,7 +2411,7 @@ declare class WebhookMethods {
|
|
|
2408
2411
|
executeWebhook(webhookId: string, token: string, data: RESTPostAPIWebhookWithTokenJSONBody & {
|
|
2409
2412
|
files?: Array<{
|
|
2410
2413
|
name: string;
|
|
2411
|
-
file: Buffer;
|
|
2414
|
+
file: Buffer | Readable | ReadableStream;
|
|
2412
2415
|
}>;
|
|
2413
2416
|
}, options?: RESTPostAPIWebhookWithTokenQuery & {
|
|
2414
2417
|
wait?: false;
|
|
@@ -2417,7 +2420,7 @@ declare class WebhookMethods {
|
|
|
2417
2420
|
executeWebhook(webhookId: string, token: string, data: RESTPostAPIWebhookWithTokenJSONBody & {
|
|
2418
2421
|
files?: Array<{
|
|
2419
2422
|
name: string;
|
|
2420
|
-
file: Buffer;
|
|
2423
|
+
file: Buffer | Readable | ReadableStream;
|
|
2421
2424
|
}>;
|
|
2422
2425
|
}, options: RESTPostAPIWebhookWithTokenQuery & {
|
|
2423
2426
|
wait: true;
|
|
@@ -2480,7 +2483,7 @@ declare class WebhookMethods {
|
|
|
2480
2483
|
thread_id?: string;
|
|
2481
2484
|
files?: Array<{
|
|
2482
2485
|
name: string;
|
|
2483
|
-
file: Buffer;
|
|
2486
|
+
file: Buffer | Readable | ReadableStream;
|
|
2484
2487
|
}>;
|
|
2485
2488
|
}): Promise<RESTPatchAPIWebhookWithTokenMessageResult>;
|
|
2486
2489
|
/**
|
|
@@ -2504,8 +2507,8 @@ declare namespace __Webhooks {
|
|
|
2504
2507
|
* Methods for interacting with slash command specific endpoints
|
|
2505
2508
|
*/
|
|
2506
2509
|
declare class InteractionMethods {
|
|
2507
|
-
requestHandler: (typeof ___RequestHandler)["RequestHandler"]
|
|
2508
|
-
webhooks:
|
|
2510
|
+
requestHandler: InstanceType<(typeof ___RequestHandler)["RequestHandler"]>;
|
|
2511
|
+
webhooks: InstanceType<typeof __Webhooks>;
|
|
2509
2512
|
/**
|
|
2510
2513
|
* Create a new Interaction Method Handler
|
|
2511
2514
|
*
|
|
@@ -2514,7 +2517,7 @@ declare class InteractionMethods {
|
|
|
2514
2517
|
* You can access the methods listed via `client.interaction.method`, where `client` is an initialized SnowTransfer instance
|
|
2515
2518
|
* @param requestHandler request handler that calls the rest api
|
|
2516
2519
|
*/
|
|
2517
|
-
constructor(requestHandler:
|
|
2520
|
+
constructor(requestHandler: InstanceType<(typeof ___RequestHandler)["RequestHandler"]>, webhooks: InstanceType<typeof __Webhooks>);
|
|
2518
2521
|
/**
|
|
2519
2522
|
* Fetch all global commands for your application
|
|
2520
2523
|
* @param appId The Id of the application
|
|
@@ -2707,7 +2710,7 @@ declare class InteractionMethods {
|
|
|
2707
2710
|
createInteractionResponse(interactionId: string, token: string, data: RESTPostAPIInteractionCallbackJSONBody & {
|
|
2708
2711
|
files?: Array<{
|
|
2709
2712
|
name: string;
|
|
2710
|
-
file: Buffer;
|
|
2713
|
+
file: Buffer | Readable | ReadableStream;
|
|
2711
2714
|
}>;
|
|
2712
2715
|
}): Promise<void>;
|
|
2713
2716
|
/**
|
|
@@ -2735,7 +2738,7 @@ declare class InteractionMethods {
|
|
|
2735
2738
|
editOriginalInteractionResponse(appId: string, token: string, data: RESTPatchAPIInteractionOriginalResponseJSONBody & {
|
|
2736
2739
|
files?: Array<{
|
|
2737
2740
|
name: string;
|
|
2738
|
-
file: Buffer;
|
|
2741
|
+
file: Buffer | Readable | ReadableStream;
|
|
2739
2742
|
}>;
|
|
2740
2743
|
}): Promise<RESTPatchAPIInteractionOriginalResponseResult>;
|
|
2741
2744
|
/**
|
|
@@ -2763,7 +2766,7 @@ declare class InteractionMethods {
|
|
|
2763
2766
|
createFollowupMessage(appId: string, token: string, data: RESTPostAPIInteractionFollowupJSONBody & {
|
|
2764
2767
|
files?: Array<{
|
|
2765
2768
|
name: string;
|
|
2766
|
-
file: Buffer;
|
|
2769
|
+
file: Buffer | Readable | ReadableStream;
|
|
2767
2770
|
}>;
|
|
2768
2771
|
}): Promise<RESTPostAPIInteractionFollowupResult>;
|
|
2769
2772
|
/**
|
|
@@ -2793,7 +2796,7 @@ declare class InteractionMethods {
|
|
|
2793
2796
|
editFollowupMessage(appId: string, token: string, messageId: string, data: RESTPatchAPIInteractionFollowupJSONBody & {
|
|
2794
2797
|
files?: Array<{
|
|
2795
2798
|
name: string;
|
|
2796
|
-
file: Buffer;
|
|
2799
|
+
file: Buffer | Readable | ReadableStream;
|
|
2797
2800
|
}>;
|
|
2798
2801
|
}): Promise<RESTPatchAPIInteractionFollowupResult>;
|
|
2799
2802
|
/**
|
|
@@ -2814,7 +2817,7 @@ declare class InteractionMethods {
|
|
|
2814
2817
|
* Methods for interacting with invites
|
|
2815
2818
|
*/
|
|
2816
2819
|
declare class InviteMethods {
|
|
2817
|
-
requestHandler: (typeof ___RequestHandler)["RequestHandler"]
|
|
2820
|
+
requestHandler: InstanceType<(typeof ___RequestHandler)["RequestHandler"]>;
|
|
2818
2821
|
/**
|
|
2819
2822
|
* Create a new Invite Method Handler
|
|
2820
2823
|
*
|
|
@@ -2823,7 +2826,7 @@ declare class InviteMethods {
|
|
|
2823
2826
|
* You can access the methods listed via `client.invite.method`, where `client` is an initialized SnowTransfer instance
|
|
2824
2827
|
* @param requestHandler request handler that calls the rest api
|
|
2825
2828
|
*/
|
|
2826
|
-
constructor(requestHandler:
|
|
2829
|
+
constructor(requestHandler: InstanceType<(typeof ___RequestHandler)["RequestHandler"]>);
|
|
2827
2830
|
/**
|
|
2828
2831
|
* Get the invite data on an invite id
|
|
2829
2832
|
* @param inviteId Id of the invite
|
|
@@ -2857,7 +2860,7 @@ declare class InviteMethods {
|
|
|
2857
2860
|
* Methods for interacting with Stage instances
|
|
2858
2861
|
*/
|
|
2859
2862
|
declare class StageInstanceMethods {
|
|
2860
|
-
requestHandler: (typeof ___RequestHandler)["RequestHandler"]
|
|
2863
|
+
requestHandler: InstanceType<(typeof ___RequestHandler)["RequestHandler"]>;
|
|
2861
2864
|
/**
|
|
2862
2865
|
* Create a new Stage Instance Method Handler
|
|
2863
2866
|
*
|
|
@@ -2866,7 +2869,7 @@ declare class StageInstanceMethods {
|
|
|
2866
2869
|
* You can access the methods listed via `client.stageInstance.method`, where `client` is an initialized SnowTransfer instance
|
|
2867
2870
|
* @param requestHandler request handler that calls the rest api
|
|
2868
2871
|
*/
|
|
2869
|
-
constructor(requestHandler:
|
|
2872
|
+
constructor(requestHandler: InstanceType<(typeof ___RequestHandler)["RequestHandler"]>);
|
|
2870
2873
|
/**
|
|
2871
2874
|
* Creates a new stage instance associated to a stage channel
|
|
2872
2875
|
* @param data The options for creating a stage instance
|
|
@@ -2937,7 +2940,7 @@ declare class StageInstanceMethods {
|
|
|
2937
2940
|
* Methods for interacting with users
|
|
2938
2941
|
*/
|
|
2939
2942
|
declare class UserMethods {
|
|
2940
|
-
requestHandler: (typeof ___RequestHandler)["RequestHandler"]
|
|
2943
|
+
requestHandler: InstanceType<(typeof ___RequestHandler)["RequestHandler"]>;
|
|
2941
2944
|
/**
|
|
2942
2945
|
* Create a new User Method handler
|
|
2943
2946
|
*
|
|
@@ -2946,7 +2949,7 @@ declare class UserMethods {
|
|
|
2946
2949
|
* You can access the methods listed via `client.user.method`, where `client` is an initialized SnowTransfer instance
|
|
2947
2950
|
* @param requestHandler
|
|
2948
2951
|
*/
|
|
2949
|
-
constructor(requestHandler:
|
|
2952
|
+
constructor(requestHandler: InstanceType<(typeof ___RequestHandler)["RequestHandler"]>);
|
|
2950
2953
|
/**
|
|
2951
2954
|
* Get information about the CurrentUser
|
|
2952
2955
|
* @returns A [user object](https://discord.com/developers/docs/resources/user#user-object)
|
|
@@ -3091,7 +3094,7 @@ declare class UserMethods {
|
|
|
3091
3094
|
* Methods for interacting with some voice
|
|
3092
3095
|
*/
|
|
3093
3096
|
declare class VoiceMethods {
|
|
3094
|
-
requestHandler: (typeof ___RequestHandler)["RequestHandler"]
|
|
3097
|
+
requestHandler: InstanceType<(typeof ___RequestHandler)["RequestHandler"]>;
|
|
3095
3098
|
/**
|
|
3096
3099
|
* Create a new Voice Method Handler
|
|
3097
3100
|
*
|
|
@@ -3100,7 +3103,7 @@ declare class VoiceMethods {
|
|
|
3100
3103
|
* You can access the methods listed via `client.voice.method`, where `client` is an initialized SnowTransfer instance
|
|
3101
3104
|
* @param requestHandler request handler that calls the rest api
|
|
3102
3105
|
*/
|
|
3103
|
-
constructor(requestHandler:
|
|
3106
|
+
constructor(requestHandler: InstanceType<(typeof ___RequestHandler)["RequestHandler"]>);
|
|
3104
3107
|
/**
|
|
3105
3108
|
* Get currently available voice regions that can be used when creating servers
|
|
3106
3109
|
* @returns Array of [voice region](https://discord.com/developers/docs/resources/voice#voice-region-object) objects
|
|
@@ -3126,7 +3129,7 @@ declare const Constants: {
|
|
|
3126
3129
|
standardMultipartHandler(data: {
|
|
3127
3130
|
files: Array<{
|
|
3128
3131
|
name: string;
|
|
3129
|
-
file: Buffer;
|
|
3132
|
+
file: Buffer | Readable | ReadableStream;
|
|
3130
3133
|
}>;
|
|
3131
3134
|
data?: any;
|
|
3132
3135
|
}): FormData;
|