snowtransfer 0.10.9 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/index.d.ts +205 -136
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +12 -13
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
Part of the WeatherStack
|
|
7
7
|
|
|
8
8
|
SnowTransfer is a small library specially made to **only** cover the REST/HTTP area of the discord api.
|
|
9
|
-
It makes no assumptions about the rest of your stack, therefore you can use it anywhere as long as you use node
|
|
9
|
+
It makes no assumptions about the rest of your stack, therefore you can use it anywhere as long as you use node 16.15.0 or higher.
|
|
10
10
|
|
|
11
11
|
### Some of the things that make SnowTransfer awesome:
|
|
12
12
|
- No requirement for other components
|
|
@@ -27,7 +27,7 @@ I've written a general whitepaper on the idea of microservice bots, which you ca
|
|
|
27
27
|
You can find the docs at [https://daswolke.github.io/SnowTransfer/](https://daswolke.github.io/SnowTransfer/)
|
|
28
28
|
|
|
29
29
|
### Installation:
|
|
30
|
-
To install SnowTransfer, make sure that you have node
|
|
30
|
+
To install SnowTransfer, make sure that you have node 16.15.0 or higher and npm installed on your computer.
|
|
31
31
|
|
|
32
32
|
Then run the following command in a terminal `npm install snowtransfer`
|
|
33
33
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { EventEmitter } from 'events';
|
|
2
|
-
import {
|
|
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';
|
|
2
|
+
import { RESTGetAPIAuditLogQuery, RESTGetAPIAuditLogResult, RESTGetAPIAutoModerationRulesResult, RESTGetAPIAutoModerationRuleResult, RESTPostAPIAutoModerationRuleJSONBody, RESTPostAPIAutoModerationRuleResult, RESTPatchAPIAutoModerationRuleJSONBody, RESTPatchAPIAutoModerationRuleResult, RESTDeleteAPIAutoModerationRuleResult, RESTGetAPIGatewayResult, RESTGetAPIGatewayBotResult, APIApplication, 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, RESTPostOAuth2AccessTokenResult } from 'discord-api-types/v10';
|
|
4
3
|
import { Readable } from 'stream';
|
|
5
4
|
import { ReadableStream } from 'stream/web';
|
|
6
5
|
import { Blob, File as File$1 } from 'buffer';
|
|
@@ -12,18 +11,77 @@ type RESTPostAPIAttachmentsRefreshURLsResult = {
|
|
|
12
11
|
refreshed: string;
|
|
13
12
|
}>;
|
|
14
13
|
};
|
|
14
|
+
type RatelimitInfo = {
|
|
15
|
+
message: string;
|
|
16
|
+
retry_after: number;
|
|
17
|
+
global: boolean;
|
|
18
|
+
code?: number;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Interface for Queue types to implement
|
|
22
|
+
* @since 0.12.0
|
|
23
|
+
*/
|
|
24
|
+
interface Queue {
|
|
25
|
+
/**
|
|
26
|
+
* Array of functions waiting to be executed
|
|
27
|
+
*/
|
|
28
|
+
calls: Array<() => any>;
|
|
29
|
+
/**
|
|
30
|
+
* If the queue is currently executing functions
|
|
31
|
+
*/
|
|
32
|
+
running: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* If the queue is blocked from executing functions
|
|
35
|
+
*/
|
|
36
|
+
blocked: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Queue a function to be executed
|
|
39
|
+
* @since 0.12.0
|
|
40
|
+
* @param fn function to be executed
|
|
41
|
+
* @returns Result of the function if any
|
|
42
|
+
*/
|
|
43
|
+
enqueue<T>(fn: () => T): Promise<T>;
|
|
44
|
+
/**
|
|
45
|
+
* Set if this queue should be blocked from executing functions
|
|
46
|
+
* @since 0.12.0
|
|
47
|
+
* @param blocked If this queue should be blocked from executing functions
|
|
48
|
+
*/
|
|
49
|
+
setBlocked(blocked: boolean): void;
|
|
50
|
+
/**
|
|
51
|
+
* @since 0.12.0
|
|
52
|
+
* Drop the queue of functions
|
|
53
|
+
*/
|
|
54
|
+
drop(): void;
|
|
55
|
+
}
|
|
15
56
|
/**
|
|
16
57
|
* @since 0.3.0
|
|
17
58
|
*/
|
|
18
59
|
declare class DiscordAPIError extends Error {
|
|
19
60
|
path: string;
|
|
20
|
-
method:
|
|
61
|
+
method: string;
|
|
21
62
|
code: number;
|
|
22
63
|
httpStatus: number;
|
|
23
64
|
constructor(path: string, error: {
|
|
24
65
|
message?: string;
|
|
25
66
|
code?: number;
|
|
26
|
-
}, method:
|
|
67
|
+
}, method: string, status: number);
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* A structure to queue (async) functions to run one at a time, waiting for each one to finish before continuing
|
|
71
|
+
* @since 0.12.0
|
|
72
|
+
* @protected
|
|
73
|
+
*/
|
|
74
|
+
declare class AsyncSequentialQueue implements Queue {
|
|
75
|
+
calls: Array<() => any>;
|
|
76
|
+
private _blocked;
|
|
77
|
+
private _running;
|
|
78
|
+
get blocked(): boolean;
|
|
79
|
+
get running(): boolean;
|
|
80
|
+
enqueue<T>(fn: () => T): Promise<T>;
|
|
81
|
+
setBlocked(blocked: boolean): void;
|
|
82
|
+
drop(): void;
|
|
83
|
+
private _tryRun;
|
|
84
|
+
private _next;
|
|
27
85
|
}
|
|
28
86
|
/**
|
|
29
87
|
* Ratelimiter used for handling the ratelimits imposed by the rest api
|
|
@@ -31,36 +89,24 @@ declare class DiscordAPIError extends Error {
|
|
|
31
89
|
* @protected
|
|
32
90
|
*/
|
|
33
91
|
declare class Ratelimiter<B extends typeof GlobalBucket = typeof GlobalBucket> {
|
|
92
|
+
BucketConstructor: B;
|
|
34
93
|
/**
|
|
35
|
-
*
|
|
36
|
-
*/
|
|
37
|
-
buckets: {
|
|
38
|
-
[routeKey: string]: InstanceType<B>;
|
|
39
|
-
};
|
|
40
|
-
/**
|
|
41
|
-
* If you're being globally rate limited
|
|
42
|
-
*/
|
|
43
|
-
private _global;
|
|
44
|
-
/**
|
|
45
|
-
* Timeframe in milliseconds until when the global rate limit resets
|
|
46
|
-
*/
|
|
47
|
-
globalReset: number;
|
|
48
|
-
/**
|
|
49
|
-
* Timeout that resets the global ratelimit once the timeframe has passed
|
|
94
|
+
* A Map of Buckets keyed by route keys that store rate limit info
|
|
50
95
|
*/
|
|
51
|
-
|
|
96
|
+
buckets: Map<string, InstanceType<B>>;
|
|
52
97
|
/**
|
|
53
|
-
* The
|
|
98
|
+
* The bucket that limits how many requests per second you can make globally
|
|
54
99
|
*/
|
|
55
|
-
|
|
100
|
+
globalBucket: LocalBucket;
|
|
56
101
|
/**
|
|
57
102
|
* If you're being globally rate limited
|
|
58
103
|
*/
|
|
59
104
|
get global(): boolean;
|
|
60
105
|
/**
|
|
61
|
-
*
|
|
106
|
+
* Construct a new Ratelimiter
|
|
107
|
+
* @param BucketConstructor The constructor function to call new on when creating buckets to cache and use
|
|
62
108
|
*/
|
|
63
|
-
|
|
109
|
+
constructor(BucketConstructor?: B);
|
|
64
110
|
/**
|
|
65
111
|
* Returns a key for saving ratelimits for routes
|
|
66
112
|
* (Taken from https://github.com/abalabahaha/eris/blob/master/lib/rest/RequestHandler.js) -> I luv u abal <3
|
|
@@ -78,6 +124,11 @@ declare class Ratelimiter<B extends typeof GlobalBucket = typeof GlobalBucket> {
|
|
|
78
124
|
* @param method Http method used by the request
|
|
79
125
|
*/
|
|
80
126
|
queue<T>(fn: (bucket: InstanceType<B>) => T, url: string, method: string): Promise<T>;
|
|
127
|
+
/**
|
|
128
|
+
* Set if this Ratelimiter is hitting a global ratelimit for `ms` duration
|
|
129
|
+
* @param ms How long in milliseconds this Ratelimiter is globally ratelimited for
|
|
130
|
+
*/
|
|
131
|
+
setGlobal(ms: number): void;
|
|
81
132
|
}
|
|
82
133
|
/**
|
|
83
134
|
* Bucket used for saving ratelimits
|
|
@@ -88,17 +139,14 @@ declare class LocalBucket {
|
|
|
88
139
|
limit: number;
|
|
89
140
|
reset: number;
|
|
90
141
|
/**
|
|
91
|
-
*
|
|
142
|
+
* The backing Queue of functions passed to this bucket
|
|
92
143
|
*/
|
|
93
|
-
|
|
144
|
+
queue: Queue;
|
|
94
145
|
/**
|
|
95
|
-
*
|
|
96
|
-
*/
|
|
97
|
-
fnQueue: Array<() => any>;
|
|
98
|
-
/**
|
|
99
|
-
* Timeout that calls the reset function once the timeframe passed
|
|
146
|
+
* Remaining amount of executions during the current timeframe
|
|
100
147
|
*/
|
|
101
|
-
|
|
148
|
+
remaining: number;
|
|
149
|
+
private resetTimeout;
|
|
102
150
|
/**
|
|
103
151
|
* Create a new base bucket
|
|
104
152
|
* @param limit Number of functions that may be executed during the timeframe set in reset
|
|
@@ -108,22 +156,17 @@ declare class LocalBucket {
|
|
|
108
156
|
constructor(limit?: number, reset?: number, remaining?: number);
|
|
109
157
|
/**
|
|
110
158
|
* Queue a function to be executed
|
|
111
|
-
* @since 0.
|
|
159
|
+
* @since 0.12.0
|
|
112
160
|
* @param fn function to be executed
|
|
113
161
|
* @returns Result of the function if any
|
|
114
162
|
*/
|
|
115
|
-
|
|
163
|
+
enqueue<T>(fn: (bkt: this) => T): Promise<T>;
|
|
116
164
|
/**
|
|
117
165
|
* Reset/make the timeout of this bucket
|
|
118
166
|
* @since 0.8.3
|
|
119
|
-
* @param
|
|
120
|
-
*/
|
|
121
|
-
makeResetTimeout(durationMS: number): void;
|
|
122
|
-
/**
|
|
123
|
-
* Check if there are any functions in the queue that haven't been executed yet
|
|
124
|
-
* @since 0.1.0
|
|
167
|
+
* @param ms Timeframe in milliseconds until the ratelimit resets after
|
|
125
168
|
*/
|
|
126
|
-
|
|
169
|
+
makeResetTimeout(ms: number): void;
|
|
127
170
|
/**
|
|
128
171
|
* Reset the remaining tokens to the base limit
|
|
129
172
|
* @since 0.1.0
|
|
@@ -141,19 +184,14 @@ declare class LocalBucket {
|
|
|
141
184
|
* @protected
|
|
142
185
|
*/
|
|
143
186
|
declare class GlobalBucket extends LocalBucket {
|
|
144
|
-
ratelimiter: Ratelimiter;
|
|
145
|
-
routeKey: string;
|
|
187
|
+
readonly ratelimiter: Ratelimiter;
|
|
188
|
+
readonly routeKey: string;
|
|
146
189
|
/**
|
|
147
190
|
* Create a new bucket that respects global rate limits
|
|
148
191
|
* @param ratelimiter ratelimiter used for ratelimiting requests. Assigned by ratelimiter
|
|
149
192
|
* @param routeKey Key used internally to routify requests. Assigned by ratelimiter
|
|
150
193
|
*/
|
|
151
|
-
constructor(ratelimiter: Ratelimiter, routeKey: string);
|
|
152
|
-
/**
|
|
153
|
-
* Check if there are any functions in the queue that haven't been executed yet
|
|
154
|
-
* @since 0.10.0
|
|
155
|
-
*/
|
|
156
|
-
checkQueue(): void;
|
|
194
|
+
constructor(ratelimiter: Ratelimiter, routeKey: string, limit?: number, reset?: number, remaining?: number);
|
|
157
195
|
/**
|
|
158
196
|
* Reset the remaining tokens to the base limit
|
|
159
197
|
* @since 0.10.0
|
|
@@ -163,7 +201,7 @@ declare class GlobalBucket extends LocalBucket {
|
|
|
163
201
|
type HandlerEvents = {
|
|
164
202
|
request: [string, {
|
|
165
203
|
endpoint: string;
|
|
166
|
-
method:
|
|
204
|
+
method: string;
|
|
167
205
|
dataType: "json" | "multipart";
|
|
168
206
|
data: any;
|
|
169
207
|
}];
|
|
@@ -173,7 +211,7 @@ type HandlerEvents = {
|
|
|
173
211
|
timeout: number;
|
|
174
212
|
remaining: number;
|
|
175
213
|
limit: number;
|
|
176
|
-
method:
|
|
214
|
+
method: string;
|
|
177
215
|
path: string;
|
|
178
216
|
route: string;
|
|
179
217
|
}];
|
|
@@ -235,7 +273,8 @@ declare class RequestHandler extends EventEmitter {
|
|
|
235
273
|
* @param data data to send, if any
|
|
236
274
|
* @returns Result of the request
|
|
237
275
|
*/
|
|
238
|
-
request
|
|
276
|
+
request(endpoint: string, params: Record<string, any> | undefined, method: HTTPMethod, dataType: "json", data?: any, extraHeaders?: Record<string, string>, retries?: number): Promise<any>;
|
|
277
|
+
request(endpoint: string, params: Record<string, any> | undefined, method: HTTPMethod, dataType: "multipart", data?: FormData, extraHeaders?: Record<string, string>, retries?: number): Promise<any>;
|
|
239
278
|
/**
|
|
240
279
|
* Apply the received ratelimit headers to the ratelimit bucket
|
|
241
280
|
* @since 0.1.0
|
|
@@ -462,6 +501,16 @@ declare class BotMethods {
|
|
|
462
501
|
* // result should be something like { url: "wss://gateway.discord.gg", shards: 1, session_start_limit: { total: 1000, remaining: 999, reset_after: 14400000, max_concurrency: 1 } }
|
|
463
502
|
*/
|
|
464
503
|
getGatewayBot(): Promise<RESTGetAPIGatewayBotResult>;
|
|
504
|
+
/**
|
|
505
|
+
* Get the Application Object for the CurrentUser
|
|
506
|
+
* @since 0.11.0
|
|
507
|
+
* @returns An [Application object](https://discord.com/developers/docs/resources/application#application-object-application-structure)
|
|
508
|
+
*
|
|
509
|
+
* @example
|
|
510
|
+
* const client = new SnowTransfer("TOKEN")
|
|
511
|
+
* const result = await client.bot.getApplicationInfo()
|
|
512
|
+
*/
|
|
513
|
+
getApplicationInfo(): Promise<APIApplication>;
|
|
465
514
|
}
|
|
466
515
|
|
|
467
516
|
/**
|
|
@@ -3373,6 +3422,24 @@ declare class VoiceMethods {
|
|
|
3373
3422
|
getUserVoiceState(guildId: string, userId: string): Promise<APIVoiceState>;
|
|
3374
3423
|
}
|
|
3375
3424
|
|
|
3425
|
+
/**
|
|
3426
|
+
* Get an oauth token after being authorized
|
|
3427
|
+
* @since 0.11.0
|
|
3428
|
+
* @param clientId The ID of your application. For older bots, this is different from your bot's user ID
|
|
3429
|
+
* @param redirectURI The URI Discord will redirect the user to after they authorize
|
|
3430
|
+
* @param clientSecret The secret of your client you can obtain from the Application page
|
|
3431
|
+
* @param code The code returned from Discord from the oauth authorize flow
|
|
3432
|
+
* @returns The authorization
|
|
3433
|
+
*
|
|
3434
|
+
* @example
|
|
3435
|
+
* const { tokenless } = require("snowtransfer")
|
|
3436
|
+
* const result = await tokenless.getOauth2Token(id, redirectURI, secret, code)
|
|
3437
|
+
*/
|
|
3438
|
+
declare function getOauth2Token(clientId: string, redirectURI: string, clientSecret: string, code: string): Promise<RESTPostOAuth2AccessTokenResult>;
|
|
3439
|
+
declare const _default: {
|
|
3440
|
+
getOauth2Token: typeof getOauth2Token;
|
|
3441
|
+
};
|
|
3442
|
+
|
|
3376
3443
|
declare const Constants: {
|
|
3377
3444
|
REST_API_VERSION: 10;
|
|
3378
3445
|
GET_CHANNEL_MESSAGES_MIN_RESULTS: 1;
|
|
@@ -3386,6 +3453,7 @@ declare const Constants: {
|
|
|
3386
3453
|
OK_STATUS_CODES: Set<number>;
|
|
3387
3454
|
DO_NOT_RETRY_STATUS_CODES: Set<number>;
|
|
3388
3455
|
DEFAULT_RETRY_LIMIT: number;
|
|
3456
|
+
GLOBAL_REQUESTS_PER_SECOND: number;
|
|
3389
3457
|
standardMultipartHandler(data: {
|
|
3390
3458
|
files: Array<{
|
|
3391
3459
|
name: string;
|
|
@@ -3406,98 +3474,99 @@ declare const Endpoints: {
|
|
|
3406
3474
|
BASE_URL: `/api/v${typeof Constants.REST_API_VERSION}`;
|
|
3407
3475
|
BASE_HOST: "https://discord.com";
|
|
3408
3476
|
CDN_URL: "https://cdn.discordapp.com";
|
|
3409
|
-
APPLICATION_COMMAND: (
|
|
3410
|
-
APPLICATION_COMMANDS: (
|
|
3411
|
-
APPLICATION_GUILD_COMMANDS_PERMISSIONS: (
|
|
3412
|
-
APPLICATION_GUILD_COMMAND_PERMISSIONS: (
|
|
3413
|
-
APPLICATION_GUILD_COMMAND: (
|
|
3414
|
-
APPLICATION_GUILD_COMMANDS: (
|
|
3477
|
+
APPLICATION_COMMAND: (appId: string, cmdId: string) => `${ReturnType<typeof Endpoints.APPLICATION_COMMANDS>}/{cmd_id}`;
|
|
3478
|
+
APPLICATION_COMMANDS: (appId: string) => "/applications/{app_id}/commands";
|
|
3479
|
+
APPLICATION_GUILD_COMMANDS_PERMISSIONS: (appId: string, guildId: string) => `${ReturnType<typeof Endpoints.APPLICATION_GUILD_COMMANDS>}/permissions`;
|
|
3480
|
+
APPLICATION_GUILD_COMMAND_PERMISSIONS: (appId: string, guildId: string, cmdId: string) => `${ReturnType<typeof Endpoints.APPLICATION_GUILD_COMMAND>}/permissions`;
|
|
3481
|
+
APPLICATION_GUILD_COMMAND: (appId: string, guildId: string, cmdId: string) => `${ReturnType<typeof Endpoints.APPLICATION_GUILD_COMMANDS>}/{cmd_id}`;
|
|
3482
|
+
APPLICATION_GUILD_COMMANDS: (appId: string, guildId: string) => "/applications/{app_id}/guilds/{guild_id}/commands";
|
|
3415
3483
|
ATTACHMENTS_REFRESH_URLS: "/attachments/refresh-urls";
|
|
3416
|
-
CHANNEL: (
|
|
3417
|
-
CHANNEL_ATTACHMENTS: (
|
|
3418
|
-
CHANNEL_BULK_DELETE: (
|
|
3419
|
-
CHANNEL_FOLLOWERS: (
|
|
3420
|
-
CHANNEL_INVITES: (
|
|
3421
|
-
CHANNEL_MESSAGE: (
|
|
3422
|
-
CHANNEL_MESSAGE_CROSSPOST: (
|
|
3423
|
-
CHANNEL_MESSAGE_REACTION: (
|
|
3424
|
-
CHANNEL_MESSAGE_REACTION_USER: (
|
|
3425
|
-
CHANNEL_MESSAGE_REACTIONS: (
|
|
3426
|
-
CHANNEL_MESSAGE_THREADS: (
|
|
3427
|
-
CHANNEL_MESSAGES: (
|
|
3428
|
-
CHANNEL_PERMISSION: (
|
|
3429
|
-
CHANNEL_PERMISSIONS: (
|
|
3430
|
-
CHANNEL_PIN: (
|
|
3431
|
-
CHANNEL_PINS: (
|
|
3432
|
-
CHANNEL_RECIPIENT: (
|
|
3433
|
-
CHANNEL_THREADS: (
|
|
3434
|
-
CHANNEL_THREAD_MEMBER: (
|
|
3435
|
-
CHANNEL_THREAD_MEMBERS: (
|
|
3436
|
-
CHANNEL_THREADS_ARCHIVED_PRIVATE: (
|
|
3437
|
-
CHANNEL_THREADS_ARCHIVED_PRIVATE_USER: (
|
|
3438
|
-
CHANNEL_THREADS_ARCHIVED_PUBLIC: (
|
|
3439
|
-
CHANNEL_TYPING: (
|
|
3440
|
-
CHANNEL_WEBHOOKS: (
|
|
3484
|
+
CHANNEL: (chanId: string) => `${typeof Endpoints.CHANNELS}/{channel_id}`;
|
|
3485
|
+
CHANNEL_ATTACHMENTS: (chanId: string) => `${ReturnType<typeof Endpoints.CHANNEL>}/attachments`;
|
|
3486
|
+
CHANNEL_BULK_DELETE: (chanId: string) => `${ReturnType<typeof Endpoints.CHANNEL_MESSAGES>}/bulk-delete`;
|
|
3487
|
+
CHANNEL_FOLLOWERS: (chanId: string) => `${ReturnType<typeof Endpoints.CHANNEL>}/followers`;
|
|
3488
|
+
CHANNEL_INVITES: (chanId: string) => `${ReturnType<typeof Endpoints.CHANNEL>}/invites`;
|
|
3489
|
+
CHANNEL_MESSAGE: (chanId: string, msgId: string) => `${ReturnType<typeof Endpoints.CHANNEL_MESSAGES>}/{message_id}`;
|
|
3490
|
+
CHANNEL_MESSAGE_CROSSPOST: (chanId: string, msgId: string) => `${ReturnType<typeof Endpoints.CHANNEL_MESSAGE>}/crosspost`;
|
|
3491
|
+
CHANNEL_MESSAGE_REACTION: (chanId: string, msgId: string, reaction: string) => `${ReturnType<typeof Endpoints.CHANNEL_MESSAGE_REACTIONS>}/{reaction}`;
|
|
3492
|
+
CHANNEL_MESSAGE_REACTION_USER: (chanId: string, msgId: string, reaction: string, userId: string) => `${ReturnType<typeof Endpoints.CHANNEL_MESSAGE_REACTION>}/{user_id}`;
|
|
3493
|
+
CHANNEL_MESSAGE_REACTIONS: (chanId: string, msgId: string) => `${ReturnType<typeof Endpoints.CHANNEL_MESSAGE>}/reactions`;
|
|
3494
|
+
CHANNEL_MESSAGE_THREADS: (chanId: string, msgId: string) => `${ReturnType<typeof Endpoints.CHANNEL_MESSAGE>}/threads`;
|
|
3495
|
+
CHANNEL_MESSAGES: (chanId: string) => `${ReturnType<typeof Endpoints.CHANNEL>}/messages`;
|
|
3496
|
+
CHANNEL_PERMISSION: (chanId: string, permId: string) => `${ReturnType<typeof Endpoints.CHANNEL_PERMISSIONS>}/{perm_id}`;
|
|
3497
|
+
CHANNEL_PERMISSIONS: (chanId: string) => `${ReturnType<typeof Endpoints.CHANNEL>}/permissions`;
|
|
3498
|
+
CHANNEL_PIN: (chanId: string, msgId: string) => `${ReturnType<typeof Endpoints.CHANNEL_PINS>}/{message_id}`;
|
|
3499
|
+
CHANNEL_PINS: (chanId: string) => `${ReturnType<typeof Endpoints.CHANNEL>}/pins`;
|
|
3500
|
+
CHANNEL_RECIPIENT: (chanId: string, userId: string) => `${ReturnType<typeof Endpoints.CHANNEL>}/recipients/{user_id}`;
|
|
3501
|
+
CHANNEL_THREADS: (chanId: string) => `${ReturnType<typeof Endpoints.CHANNEL>}/threads`;
|
|
3502
|
+
CHANNEL_THREAD_MEMBER: (chanId: string, memberId: string) => `${ReturnType<typeof Endpoints.CHANNEL_THREAD_MEMBERS>}/{member_id}`;
|
|
3503
|
+
CHANNEL_THREAD_MEMBERS: (chanId: string) => `${ReturnType<typeof Endpoints.CHANNEL>}/thread-members`;
|
|
3504
|
+
CHANNEL_THREADS_ARCHIVED_PRIVATE: (chanId: string) => `${ReturnType<typeof Endpoints.CHANNEL_THREADS>}/archived/private`;
|
|
3505
|
+
CHANNEL_THREADS_ARCHIVED_PRIVATE_USER: (chanId: string) => `${ReturnType<typeof Endpoints.CHANNEL>}/users/@me/threads/archived/private`;
|
|
3506
|
+
CHANNEL_THREADS_ARCHIVED_PUBLIC: (chanId: string) => `${ReturnType<typeof Endpoints.CHANNEL_THREADS>}/archived/public`;
|
|
3507
|
+
CHANNEL_TYPING: (chanId: string) => `${ReturnType<typeof Endpoints.CHANNEL>}/typing`;
|
|
3508
|
+
CHANNEL_WEBHOOKS: (chanId: string) => `${ReturnType<typeof Endpoints.CHANNEL>}/webhooks`;
|
|
3441
3509
|
CHANNELS: "/channels";
|
|
3442
3510
|
GATEWAY: "/gateway";
|
|
3443
3511
|
GATEWAY_BOT: "/gateway/bot";
|
|
3444
|
-
GUILD: (
|
|
3445
|
-
GUILD_AUDIT_LOGS: (
|
|
3446
|
-
GUILD_AUTO_MOD_RULE: (
|
|
3447
|
-
GUILD_AUTO_MOD_RULES: (
|
|
3448
|
-
GUILD_BAN: (
|
|
3449
|
-
GUILD_BANS: (
|
|
3450
|
-
GUILD_CHANNELS: (
|
|
3451
|
-
GUILD_EMOJI: (
|
|
3452
|
-
GUILD_EMOJIS: (
|
|
3453
|
-
GUILD_INVITES: (
|
|
3454
|
-
GUILD_INTEGRATION: (
|
|
3455
|
-
GUILD_INTEGRATIONS: (
|
|
3456
|
-
GUILD_MEMBER: (
|
|
3457
|
-
GUILD_MEMBER_ROLE: (
|
|
3458
|
-
GUILD_MEMBERS: (
|
|
3459
|
-
GUILD_MEMBERS_SEARCH: (
|
|
3460
|
-
GUILD_PREVIEW: (
|
|
3461
|
-
GUILD_PRUNE: (
|
|
3462
|
-
GUILD_ROLE: (
|
|
3463
|
-
GUILD_ROLES: (
|
|
3464
|
-
GUILD_SCHEDULED_EVENTS: (
|
|
3465
|
-
GUILD_SCHEDULED_EVENT: (
|
|
3466
|
-
GUILD_SCHEDULED_EVENT_USERS: (
|
|
3467
|
-
GUILD_STICKER: (
|
|
3468
|
-
GUILD_STICKERS: (
|
|
3469
|
-
GUILD_TEMPLATE: (
|
|
3470
|
-
GUILD_THREADS_ACTIVE: (
|
|
3471
|
-
GUILD_TEMPLATES: (
|
|
3472
|
-
GUILD_VANITY: (
|
|
3473
|
-
GUILD_VOICE_REGIONS: (
|
|
3474
|
-
GUILD_VOICE_STATE_USER: (
|
|
3475
|
-
GUILD_WEBHOOKS: (
|
|
3476
|
-
GUILD_WELCOME_SCREEN: (
|
|
3477
|
-
GUILD_WIDGET: (
|
|
3478
|
-
GUILD_WIDGET_SETTINGS: (
|
|
3512
|
+
GUILD: (guildId: string) => `${typeof Endpoints.GUILDS}/{guild_id}`;
|
|
3513
|
+
GUILD_AUDIT_LOGS: (guildId: string) => `${ReturnType<typeof Endpoints.GUILD>}/audit-logs`;
|
|
3514
|
+
GUILD_AUTO_MOD_RULE: (guildId: string, ruleId: string) => `${ReturnType<typeof Endpoints.GUILD_AUTO_MOD_RULES>}/{rule_id}`;
|
|
3515
|
+
GUILD_AUTO_MOD_RULES: (guildId: string) => `${ReturnType<typeof Endpoints.GUILD>}/auto-moderation/rules`;
|
|
3516
|
+
GUILD_BAN: (guildId: string, memberId: string) => `${ReturnType<typeof Endpoints.GUILD_BANS>}/{member_id}`;
|
|
3517
|
+
GUILD_BANS: (guildId: string) => `${ReturnType<typeof Endpoints.GUILD>}/bans`;
|
|
3518
|
+
GUILD_CHANNELS: (guildId: string) => `${ReturnType<typeof Endpoints.GUILD>}/channels`;
|
|
3519
|
+
GUILD_EMOJI: (guildId: string, emojiId: string) => `${ReturnType<typeof Endpoints.GUILD_EMOJIS>}/{emoji_id}`;
|
|
3520
|
+
GUILD_EMOJIS: (guildId: string) => `${ReturnType<typeof Endpoints.GUILD>}/emojis`;
|
|
3521
|
+
GUILD_INVITES: (guildId: string) => `${ReturnType<typeof Endpoints.GUILD>}/invites`;
|
|
3522
|
+
GUILD_INTEGRATION: (guildId: string, integrationId: string) => `${ReturnType<typeof Endpoints.GUILD_INTEGRATIONS>}/{integration_id}`;
|
|
3523
|
+
GUILD_INTEGRATIONS: (guildId: string) => `${ReturnType<typeof Endpoints.GUILD>}/integrations`;
|
|
3524
|
+
GUILD_MEMBER: (guildId: string, memberId: string) => `${ReturnType<typeof Endpoints.GUILD_MEMBERS>}/{member_id}`;
|
|
3525
|
+
GUILD_MEMBER_ROLE: (guildId: string, memberId: string, roleId: string) => `${ReturnType<typeof Endpoints.GUILD_MEMBER>}/roles/{role_id}`;
|
|
3526
|
+
GUILD_MEMBERS: (guildId: string) => `${ReturnType<typeof Endpoints.GUILD>}/members`;
|
|
3527
|
+
GUILD_MEMBERS_SEARCH: (guildId: string) => `${ReturnType<typeof Endpoints.GUILD_MEMBERS>}/search`;
|
|
3528
|
+
GUILD_PREVIEW: (guildId: string) => `${ReturnType<typeof Endpoints.GUILD>}/preview`;
|
|
3529
|
+
GUILD_PRUNE: (guildId: string) => `${ReturnType<typeof Endpoints.GUILD>}/prune`;
|
|
3530
|
+
GUILD_ROLE: (guildId: string, roleId: string) => `${ReturnType<typeof Endpoints.GUILD_ROLES>}/{role_id}`;
|
|
3531
|
+
GUILD_ROLES: (guildId: string) => `${ReturnType<typeof Endpoints.GUILD>}/roles`;
|
|
3532
|
+
GUILD_SCHEDULED_EVENTS: (guildId: string) => `${ReturnType<typeof Endpoints.GUILD>}/scheduled-events`;
|
|
3533
|
+
GUILD_SCHEDULED_EVENT: (guildId: string, eventId: string) => `${ReturnType<typeof Endpoints.GUILD_SCHEDULED_EVENTS>}/{event_id}`;
|
|
3534
|
+
GUILD_SCHEDULED_EVENT_USERS: (guildId: string, eventId: string) => `${ReturnType<typeof Endpoints.GUILD_SCHEDULED_EVENT>}/users`;
|
|
3535
|
+
GUILD_STICKER: (guildId: string, stickerId: string) => `${ReturnType<typeof Endpoints.GUILD_STICKERS>}/{sticker_id}`;
|
|
3536
|
+
GUILD_STICKERS: (guildId: string) => `${ReturnType<typeof Endpoints.GUILD>}/stickers`;
|
|
3537
|
+
GUILD_TEMPLATE: (guildId: string, code: string) => `${ReturnType<typeof Endpoints.GUILD_TEMPLATES>}/{code}`;
|
|
3538
|
+
GUILD_THREADS_ACTIVE: (guildId: string) => `${ReturnType<typeof Endpoints.GUILD>}/threads/active`;
|
|
3539
|
+
GUILD_TEMPLATES: (guildId: string) => `${ReturnType<typeof Endpoints.GUILD>}/templates`;
|
|
3540
|
+
GUILD_VANITY: (guildId: string) => `${ReturnType<typeof Endpoints.GUILD>}/vanity-url`;
|
|
3541
|
+
GUILD_VOICE_REGIONS: (guildId: string) => `${ReturnType<typeof Endpoints.GUILD>}/regions`;
|
|
3542
|
+
GUILD_VOICE_STATE_USER: (guildId: string, memberId: string) => `${ReturnType<typeof Endpoints.GUILD>}/voice-states/{member_id}`;
|
|
3543
|
+
GUILD_WEBHOOKS: (guildId: string) => `${ReturnType<typeof Endpoints.GUILD>}/webhooks`;
|
|
3544
|
+
GUILD_WELCOME_SCREEN: (guildId: string) => `${ReturnType<typeof Endpoints.GUILD>}/welcome-screen`;
|
|
3545
|
+
GUILD_WIDGET: (guildId: string) => `${ReturnType<typeof Endpoints.GUILD>}/widget.json`;
|
|
3546
|
+
GUILD_WIDGET_SETTINGS: (guildId: string) => `${ReturnType<typeof Endpoints.GUILD>}/widget`;
|
|
3479
3547
|
GUILDS: "/guilds";
|
|
3480
|
-
INTERACTION_CALLBACK: (
|
|
3481
|
-
INVITES: (
|
|
3482
|
-
OAUTH2_APPLICATION: (
|
|
3483
|
-
|
|
3548
|
+
INTERACTION_CALLBACK: (interactionId: string, token: string) => "/interactions/{interaction_id}/{token}/callback";
|
|
3549
|
+
INVITES: (inviteId: string) => "/invites/{invite_id}";
|
|
3550
|
+
OAUTH2_APPLICATION: (appId: string) => "/oauth2/applications/{app_id}";
|
|
3551
|
+
OAUTH2_TOKEN: "/api/oauth2/token";
|
|
3552
|
+
STAGE_INSTANCE_CHANNEL: (chanId: string) => `${typeof Endpoints.STAGE_INSTANCES}/{channel_id}`;
|
|
3484
3553
|
STAGE_INSTANCES: "/stage-instances";
|
|
3485
|
-
STICKER: (
|
|
3554
|
+
STICKER: (stickerId: string) => "/stickers/{sticker_id}";
|
|
3486
3555
|
TEMPLATE: (code: string) => "/guilds/templates/{code}";
|
|
3487
|
-
USER: (
|
|
3488
|
-
USER_APPLICATION_ROLE_CONNECTION: (
|
|
3489
|
-
USER_CHANNELS: (
|
|
3490
|
-
USER_CONNECTIONS: (
|
|
3491
|
-
USER_GUILD: (
|
|
3492
|
-
USER_GUILDS: (
|
|
3493
|
-
USER_GUILD_VOICE_STATE: (
|
|
3556
|
+
USER: (userId: string) => `${typeof Endpoints.USERS}/{user_id}`;
|
|
3557
|
+
USER_APPLICATION_ROLE_CONNECTION: (userId: string, appId: string) => `${ReturnType<typeof Endpoints.USER>}/applications/{app_id}/role-connection`;
|
|
3558
|
+
USER_CHANNELS: (userId: string) => `${ReturnType<typeof Endpoints.USER>}/channels`;
|
|
3559
|
+
USER_CONNECTIONS: (userId: string) => `${ReturnType<typeof Endpoints.USER>}/connections`;
|
|
3560
|
+
USER_GUILD: (userId: string, guildId: string) => `${ReturnType<typeof Endpoints.USER_GUILDS>}/{guild_id}`;
|
|
3561
|
+
USER_GUILDS: (userId: string) => `${ReturnType<typeof Endpoints.USER>}/guilds`;
|
|
3562
|
+
USER_GUILD_VOICE_STATE: (guildId: string, userId: string) => `${ReturnType<typeof Endpoints.GUILD>}/voice-states/{user_id}`;
|
|
3494
3563
|
USERS: "/users";
|
|
3495
3564
|
VOICE_REGIONS: "/voice/regions";
|
|
3496
|
-
WEBHOOK: (
|
|
3497
|
-
WEBHOOK_TOKEN: (
|
|
3498
|
-
WEBHOOK_TOKEN_GITHUB: (
|
|
3499
|
-
WEBHOOK_TOKEN_MESSAGE: (
|
|
3500
|
-
WEBHOOK_TOKEN_SLACK: (
|
|
3565
|
+
WEBHOOK: (hookId: string) => "/webhooks/{hook_id}";
|
|
3566
|
+
WEBHOOK_TOKEN: (hookId: string, token: string) => `${ReturnType<typeof Endpoints.WEBHOOK>}/{token}`;
|
|
3567
|
+
WEBHOOK_TOKEN_GITHUB: (hookId: string, token: string) => `${ReturnType<typeof Endpoints.WEBHOOK_TOKEN>}/github`;
|
|
3568
|
+
WEBHOOK_TOKEN_MESSAGE: (hookId: string, token: string, msgId: string) => `${ReturnType<typeof Endpoints.WEBHOOK_TOKEN>}/messages/{message_id}`;
|
|
3569
|
+
WEBHOOK_TOKEN_SLACK: (hookId: string, token: string) => `${ReturnType<typeof Endpoints.WEBHOOK_TOKEN>}/slack`;
|
|
3501
3570
|
};
|
|
3502
3571
|
|
|
3503
3572
|
/**
|
|
@@ -3559,4 +3628,4 @@ declare class SnowTransfer {
|
|
|
3559
3628
|
constructor(token?: string, options?: Partial<SnowTransfer["options"]>);
|
|
3560
3629
|
}
|
|
3561
3630
|
|
|
3562
|
-
export { AuditLogMethods, AutoModerationMethods, BotMethods, ChannelMethods, Constants, DiscordAPIError, Endpoints, GlobalBucket, GuildAssetsMethods, GuildMethods, GuildScheduledEventMethods, GuildTemplateMethods, type HTTPMethod, type HandlerEvents, InteractionMethods, InviteMethods, LocalBucket, type RESTPostAPIAttachmentsRefreshURLsResult, Ratelimiter, RequestHandler, SnowTransfer, StageInstanceMethods, UserMethods, VoiceMethods, WebhookMethods };
|
|
3631
|
+
export { AsyncSequentialQueue, AuditLogMethods, AutoModerationMethods, BotMethods, ChannelMethods, Constants, DiscordAPIError, Endpoints, GlobalBucket, GuildAssetsMethods, GuildMethods, GuildScheduledEventMethods, GuildTemplateMethods, type HTTPMethod, type HandlerEvents, InteractionMethods, InviteMethods, LocalBucket, type Queue, type RESTPostAPIAttachmentsRefreshURLsResult, type RatelimitInfo, Ratelimiter, RequestHandler, SnowTransfer, StageInstanceMethods, UserMethods, VoiceMethods, WebhookMethods, _default as tokenless };
|