disgroove 2.2.7-dev.fca4921 → 3.0.0-dev.2cf2b90
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +9 -9
- package/README.md +48 -48
- package/dist/lib/Client.d.ts +332 -301
- package/dist/lib/Client.js +562 -462
- package/dist/lib/constants.d.ts +35 -24
- package/dist/lib/constants.js +39 -27
- package/dist/lib/gateway/Dispatcher.d.ts +104 -0
- package/dist/lib/gateway/Dispatcher.js +471 -0
- package/dist/lib/gateway/Shard.d.ts +12 -21
- package/dist/lib/gateway/Shard.js +121 -570
- package/dist/lib/gateway/Transmitter.d.ts +22 -0
- package/dist/lib/gateway/Transmitter.js +93 -0
- package/dist/lib/gateway/WebSocketManager.d.ts +22 -0
- package/dist/lib/gateway/WebSocketManager.js +93 -0
- package/dist/lib/index.d.ts +5 -1
- package/dist/lib/index.js +5 -1
- package/dist/lib/rest/Endpoints.d.ts +95 -91
- package/dist/lib/rest/Endpoints.js +111 -102
- package/dist/lib/rest/RequestManager.d.ts +1 -3
- package/dist/lib/rest/RequestManager.js +17 -7
- package/dist/lib/rest/index.js +17 -7
- package/dist/lib/transformers/ApplicationCommands.js +4 -4
- package/dist/lib/transformers/Applications.d.ts +2 -0
- package/dist/lib/transformers/Applications.js +110 -4
- package/dist/lib/transformers/AuditLogs.js +10 -10
- package/dist/lib/transformers/AutoModeration.js +6 -6
- package/dist/lib/transformers/Channels.js +16 -16
- package/dist/lib/transformers/Components.d.ts +15 -3
- package/dist/lib/transformers/Components.js +309 -156
- package/dist/lib/transformers/Entitlements.d.ts +2 -2
- package/dist/lib/transformers/Entitlements.js +16 -16
- package/dist/lib/transformers/GuildScheduledEvents.js +8 -8
- package/dist/lib/transformers/GuildTemplates.js +4 -4
- package/dist/lib/transformers/Guilds.js +28 -28
- package/dist/lib/transformers/Interactions.js +330 -55
- package/dist/lib/transformers/Lobbies.d.ts +7 -0
- package/dist/lib/transformers/Lobbies.js +38 -0
- package/dist/lib/transformers/Messages.d.ts +4 -3
- package/dist/lib/transformers/Messages.js +38 -52
- package/dist/lib/transformers/Polls.js +2 -2
- package/dist/lib/transformers/Presences.d.ts +3 -3
- package/dist/lib/transformers/Presences.js +6 -6
- package/dist/lib/transformers/Roles.js +8 -8
- package/dist/lib/transformers/SKUs.js +2 -2
- package/dist/lib/transformers/Soundboards.js +6 -6
- package/dist/lib/transformers/StageInstances.js +6 -6
- package/dist/lib/transformers/Stickers.js +3 -3
- package/dist/lib/transformers/Subscriptions.js +8 -8
- package/dist/lib/transformers/Teams.js +4 -4
- package/dist/lib/transformers/Users.js +6 -6
- package/dist/lib/transformers/Voice.js +8 -8
- package/dist/lib/transformers/Webhooks.js +6 -6
- package/dist/lib/transformers/index.d.ts +2 -1
- package/dist/lib/transformers/index.js +2 -1
- package/dist/lib/types/application-command.d.ts +9 -4
- package/dist/lib/types/application-role-connection-metadata.d.ts +1 -0
- package/dist/lib/types/application.d.ts +12 -7
- package/dist/lib/types/audit-log.d.ts +9 -5
- package/dist/lib/types/auto-moderation.d.ts +7 -3
- package/dist/lib/types/channel.d.ts +17 -23
- package/dist/lib/types/common.d.ts +2 -0
- package/dist/lib/types/components.d.ts +510 -0
- package/dist/lib/types/emoji.d.ts +1 -0
- package/dist/lib/types/entitlements.d.ts +5 -4
- package/dist/lib/types/gateway-events.d.ts +406 -207
- package/dist/lib/types/guild-scheduled-event.d.ts +10 -5
- package/dist/lib/types/guild-template.d.ts +3 -2
- package/dist/lib/types/guild.d.ts +40 -22
- package/dist/lib/types/interaction.d.ts +35 -18
- package/dist/lib/types/invite.d.ts +5 -2
- package/dist/lib/types/lobby.d.ts +31 -0
- package/dist/lib/types/lobby.js +2 -0
- package/dist/lib/types/message.d.ts +32 -20
- package/dist/lib/types/poll.d.ts +7 -1
- package/dist/lib/types/role.d.ts +8 -5
- package/dist/lib/types/sku.d.ts +2 -1
- package/dist/lib/types/soundboard.d.ts +4 -3
- package/dist/lib/types/stage-instance.d.ts +4 -3
- package/dist/lib/types/sticker.d.ts +8 -5
- package/dist/lib/types/subscription.d.ts +6 -5
- package/dist/lib/types/team.d.ts +4 -2
- package/dist/lib/types/user.d.ts +10 -3
- package/dist/lib/types/voice.d.ts +6 -4
- package/dist/lib/types/webhook.d.ts +4 -3
- package/dist/lib/utils/CDN.d.ts +22 -22
- package/dist/lib/utils/CDN.js +22 -22
- package/dist/lib/utils/errors.d.ts +3 -1
- package/dist/lib/utils/errors.js +4 -0
- package/dist/lib/utils/formatters.d.ts +7 -7
- package/dist/lib/utils/formatters.js +28 -29
- package/dist/lib/utils/index.d.ts +1 -0
- package/dist/lib/utils/index.js +18 -7
- package/dist/lib/utils/permissions.d.ts +2 -0
- package/dist/lib/utils/permissions.js +7 -0
- package/dist/package.json +4 -4
- package/package.json +5 -5
- package/dist/lib/types/message-components.d.ts +0 -234
- /package/dist/lib/types/{message-components.js → components.js} +0 -0
|
@@ -2,214 +2,214 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.channelInvites = exports.channelFollowers = exports.channelBulkDelete = exports.channel = exports.template = exports.guildWidgetSettings = exports.guildWidgetJSON = exports.guildWidgetImage = exports.guildWelcomeScreen = exports.guildWebhooks = exports.guildVoiceState = exports.guildVoiceRegions = exports.guildVanityURL = exports.guildTemplates = exports.guildTemplate = exports.guildStickers = exports.guildSticker = exports.guildSoundboardSounds = exports.guildSoundboardSound = exports.guildScheduledEventUsers = exports.guildScheduledEvents = exports.guildScheduledEvent = exports.guildRoles = exports.guildRole = exports.guildPrune = exports.guildPreview = exports.guildOnboarding = exports.guildMemberVerification = exports.guildMembersSearch = exports.guildMembers = exports.guildMemberRole = exports.guildMember = exports.guildMFA = exports.guildInvites = exports.guildIntegrations = exports.guildIntegration = exports.guildIncidentsActions = exports.guildEmojis = exports.guildEmoji = exports.guildMemberNickname = exports.guildChannels = exports.guildBulkBan = exports.guildBans = exports.guildBan = exports.guildAutoModerationRules = exports.guildAutoModerationRule = exports.guildAuditLog = exports.guildActiveThreads = exports.guilds = exports.guild = void 0;
|
|
4
4
|
exports.oauth2Application = exports.oauth2Authorize = exports.gatewayBot = exports.gateway = exports.soundboardDefaultSounds = exports.sendSoundboardSound = exports.skuSubscriptions = exports.skuSubscription = exports.stickerPacks = exports.stickerPack = exports.webhookPlatform = exports.webhookMessage = exports.webhook = exports.guildApplicationCommandsPermissions = exports.applicationSKUs = exports.applicationRoleConnectionMetadata = exports.applicationGuildCommands = exports.applicationGuildCommand = exports.applicationEntitlements = exports.applicationEntitlementConsume = exports.applicationEntitlement = exports.applicationEmojis = exports.applicationEmoji = exports.applicationUser = exports.applicationCommandPermissions = exports.applicationCommands = exports.applicationCommand = exports.applicationActivityInstance = exports.userGuilds = exports.userGuild = exports.userConnections = exports.userChannels = exports.userApplicationRoleConnection = exports.user = exports.pollExpire = exports.pollAnswerVoters = exports.threadMembers = exports.threads = exports.channelWebhooks = exports.channelTyping = exports.channelThreads = exports.channelRecipient = exports.channelPins = exports.channelPin = exports.channelPermission = exports.channelMessages = exports.channelMessageReaction = exports.channelMessageCrosspost = exports.channelMessageAllReactions = exports.channelMessage = void 0;
|
|
5
|
-
exports.voiceRegions = exports.sticker = exports.stageInstances = exports.stageInstance = exports.invite = exports.interactionCallback = exports.oauth2TokenRevocation = exports.oauth2TokenExchange = exports.oauth2Authorization = void 0;
|
|
5
|
+
exports.lobbyChannelLinking = exports.lobbyMember = exports.lobby = exports.lobbies = exports.voiceRegions = exports.sticker = exports.stageInstances = exports.stageInstance = exports.invite = exports.interactionCallback = exports.oauth2TokenRevocation = exports.oauth2TokenExchange = exports.oauth2Authorization = void 0;
|
|
6
6
|
// Guilds
|
|
7
|
-
const guild = (
|
|
7
|
+
const guild = (guildId) => `guilds/${guildId}`;
|
|
8
8
|
exports.guild = guild;
|
|
9
9
|
const guilds = () => "guilds";
|
|
10
10
|
exports.guilds = guilds;
|
|
11
|
-
const guildActiveThreads = (
|
|
11
|
+
const guildActiveThreads = (guildId) => `guilds/${guildId}/threads/active`;
|
|
12
12
|
exports.guildActiveThreads = guildActiveThreads;
|
|
13
|
-
const guildAuditLog = (
|
|
13
|
+
const guildAuditLog = (guildId) => `guilds/${guildId}/audit-logs`;
|
|
14
14
|
exports.guildAuditLog = guildAuditLog;
|
|
15
|
-
const guildAutoModerationRule = (
|
|
15
|
+
const guildAutoModerationRule = (guildId, ruleId) => `guilds/${guildId}/auto-moderation/rules/${ruleId}`;
|
|
16
16
|
exports.guildAutoModerationRule = guildAutoModerationRule;
|
|
17
|
-
const guildAutoModerationRules = (
|
|
17
|
+
const guildAutoModerationRules = (guildId) => `guilds/${guildId}/auto-moderation/rules`;
|
|
18
18
|
exports.guildAutoModerationRules = guildAutoModerationRules;
|
|
19
|
-
const guildBan = (
|
|
19
|
+
const guildBan = (guildId, userId) => `guilds/${guildId}/bans/${userId}`;
|
|
20
20
|
exports.guildBan = guildBan;
|
|
21
|
-
const guildBans = (
|
|
21
|
+
const guildBans = (guildId) => `guilds/${guildId}/bans`;
|
|
22
22
|
exports.guildBans = guildBans;
|
|
23
|
-
const guildBulkBan = (
|
|
23
|
+
const guildBulkBan = (guildId) => `guilds/${guildId}/bulk-ban`;
|
|
24
24
|
exports.guildBulkBan = guildBulkBan;
|
|
25
|
-
const guildChannels = (
|
|
25
|
+
const guildChannels = (guildId) => `guilds/${guildId}/channels`;
|
|
26
26
|
exports.guildChannels = guildChannels;
|
|
27
|
-
const guildMemberNickname = (
|
|
27
|
+
const guildMemberNickname = (guildId) => `guilds/${guildId}/members/@me/nick`;
|
|
28
28
|
exports.guildMemberNickname = guildMemberNickname;
|
|
29
|
-
const guildEmoji = (
|
|
29
|
+
const guildEmoji = (guildId, emojiId) => `guilds/${guildId}/emojis/${emojiId}`;
|
|
30
30
|
exports.guildEmoji = guildEmoji;
|
|
31
|
-
const guildEmojis = (
|
|
31
|
+
const guildEmojis = (guildId) => `guilds/${guildId}/emojis`;
|
|
32
32
|
exports.guildEmojis = guildEmojis;
|
|
33
|
-
const guildIncidentsActions = (
|
|
33
|
+
const guildIncidentsActions = (guildId) => `guilds/${guildId}/incidents-actions`;
|
|
34
34
|
exports.guildIncidentsActions = guildIncidentsActions;
|
|
35
|
-
const guildIntegration = (
|
|
35
|
+
const guildIntegration = (guildId, integrationId) => `guilds/${guildId}/integrations/${integrationId}`;
|
|
36
36
|
exports.guildIntegration = guildIntegration;
|
|
37
|
-
const guildIntegrations = (
|
|
37
|
+
const guildIntegrations = (guildId) => `guilds/${guildId}/integrations`;
|
|
38
38
|
exports.guildIntegrations = guildIntegrations;
|
|
39
|
-
const guildInvites = (
|
|
39
|
+
const guildInvites = (guildId) => `guilds/${guildId}/invites`;
|
|
40
40
|
exports.guildInvites = guildInvites;
|
|
41
|
-
const guildMFA = (
|
|
41
|
+
const guildMFA = (guildId) => `guilds/${guildId}/mfa`;
|
|
42
42
|
exports.guildMFA = guildMFA;
|
|
43
|
-
const guildMember = (
|
|
43
|
+
const guildMember = (guildId, userId = "@me") => `guilds/${guildId}/members/${userId}`;
|
|
44
44
|
exports.guildMember = guildMember;
|
|
45
|
-
const guildMemberRole = (
|
|
45
|
+
const guildMemberRole = (guildId, memberId, roleId) => `guilds/${guildId}/members/${memberId}/roles/${roleId}`;
|
|
46
46
|
exports.guildMemberRole = guildMemberRole;
|
|
47
|
-
const guildMembers = (
|
|
47
|
+
const guildMembers = (guildId) => `guilds/${guildId}/members`;
|
|
48
48
|
exports.guildMembers = guildMembers;
|
|
49
|
-
const guildMembersSearch = (
|
|
49
|
+
const guildMembersSearch = (guildId) => `guilds/${guildId}/members/search`;
|
|
50
50
|
exports.guildMembersSearch = guildMembersSearch;
|
|
51
|
-
const guildMemberVerification = (
|
|
51
|
+
const guildMemberVerification = (guildId) => `guilds/${guildId}/member-verification`;
|
|
52
52
|
exports.guildMemberVerification = guildMemberVerification;
|
|
53
|
-
const guildOnboarding = (
|
|
53
|
+
const guildOnboarding = (guildId) => `guilds/${guildId}/onboarding`;
|
|
54
54
|
exports.guildOnboarding = guildOnboarding;
|
|
55
|
-
const guildPreview = (
|
|
55
|
+
const guildPreview = (guildId) => `guilds/${guildId}/preview`;
|
|
56
56
|
exports.guildPreview = guildPreview;
|
|
57
|
-
const guildPrune = (
|
|
57
|
+
const guildPrune = (guildId) => `guilds/${guildId}/prune`;
|
|
58
58
|
exports.guildPrune = guildPrune;
|
|
59
|
-
const guildRole = (
|
|
59
|
+
const guildRole = (guildId, roleId) => `guilds/${guildId}/roles/${roleId}`;
|
|
60
60
|
exports.guildRole = guildRole;
|
|
61
|
-
const guildRoles = (
|
|
61
|
+
const guildRoles = (guildId) => `guilds/${guildId}/roles`;
|
|
62
62
|
exports.guildRoles = guildRoles;
|
|
63
|
-
const guildScheduledEvent = (
|
|
63
|
+
const guildScheduledEvent = (guildId, guildScheduledEventId) => `guilds/${guildId}/scheduled-events/${guildScheduledEventId}`;
|
|
64
64
|
exports.guildScheduledEvent = guildScheduledEvent;
|
|
65
|
-
const guildScheduledEvents = (
|
|
65
|
+
const guildScheduledEvents = (guildId) => `guilds/${guildId}/scheduled-events`;
|
|
66
66
|
exports.guildScheduledEvents = guildScheduledEvents;
|
|
67
|
-
const guildScheduledEventUsers = (
|
|
67
|
+
const guildScheduledEventUsers = (guildId, guildScheduledEventId) => `guilds/${guildId}/scheduled-events/${guildScheduledEventId}/users`;
|
|
68
68
|
exports.guildScheduledEventUsers = guildScheduledEventUsers;
|
|
69
|
-
const guildSoundboardSound = (
|
|
69
|
+
const guildSoundboardSound = (guildId, soundId) => `guilds/${guildId}/soundboard-sounds/${soundId}`;
|
|
70
70
|
exports.guildSoundboardSound = guildSoundboardSound;
|
|
71
|
-
const guildSoundboardSounds = (
|
|
71
|
+
const guildSoundboardSounds = (guildId) => `guilds/${guildId}/soundboard-sounds`;
|
|
72
72
|
exports.guildSoundboardSounds = guildSoundboardSounds;
|
|
73
|
-
const guildSticker = (
|
|
73
|
+
const guildSticker = (guildId, stickerId) => `guilds/${guildId}/stickers/${stickerId}`;
|
|
74
74
|
exports.guildSticker = guildSticker;
|
|
75
|
-
const guildStickers = (
|
|
75
|
+
const guildStickers = (guildId) => `guilds/${guildId}/stickers`;
|
|
76
76
|
exports.guildStickers = guildStickers;
|
|
77
|
-
const guildTemplate = (
|
|
77
|
+
const guildTemplate = (guildId, code) => `guilds/${guildId}/templates/${code}`;
|
|
78
78
|
exports.guildTemplate = guildTemplate;
|
|
79
|
-
const guildTemplates = (
|
|
79
|
+
const guildTemplates = (guildId) => `guilds/${guildId}/templates`;
|
|
80
80
|
exports.guildTemplates = guildTemplates;
|
|
81
|
-
const guildVanityURL = (
|
|
81
|
+
const guildVanityURL = (guildId) => `guilds/${guildId}/vanity-url`;
|
|
82
82
|
exports.guildVanityURL = guildVanityURL;
|
|
83
|
-
const guildVoiceRegions = (
|
|
83
|
+
const guildVoiceRegions = (guildId) => `guilds/${guildId}/regions`;
|
|
84
84
|
exports.guildVoiceRegions = guildVoiceRegions;
|
|
85
|
-
const guildVoiceState = (
|
|
85
|
+
const guildVoiceState = (guildId, userId = "@me") => `guilds/${guildId}/voice-states/${userId}`;
|
|
86
86
|
exports.guildVoiceState = guildVoiceState;
|
|
87
|
-
const guildWebhooks = (
|
|
87
|
+
const guildWebhooks = (guildId) => `guilds/${guildId}/webhooks`;
|
|
88
88
|
exports.guildWebhooks = guildWebhooks;
|
|
89
|
-
const guildWelcomeScreen = (
|
|
89
|
+
const guildWelcomeScreen = (guildId) => `guilds/${guildId}/welcome-screen`;
|
|
90
90
|
exports.guildWelcomeScreen = guildWelcomeScreen;
|
|
91
|
-
const guildWidgetImage = (
|
|
91
|
+
const guildWidgetImage = (guildId) => `guilds/${guildId}/widget.png`;
|
|
92
92
|
exports.guildWidgetImage = guildWidgetImage;
|
|
93
|
-
const guildWidgetJSON = (
|
|
93
|
+
const guildWidgetJSON = (guildId) => `guilds/${guildId}/widget.json`;
|
|
94
94
|
exports.guildWidgetJSON = guildWidgetJSON;
|
|
95
|
-
const guildWidgetSettings = (
|
|
95
|
+
const guildWidgetSettings = (guildId) => `guilds/${guildId}/widget`;
|
|
96
96
|
exports.guildWidgetSettings = guildWidgetSettings;
|
|
97
97
|
const template = (code) => `guilds/templates/${code}`;
|
|
98
98
|
exports.template = template;
|
|
99
99
|
// Channels
|
|
100
|
-
const channel = (
|
|
100
|
+
const channel = (channelId) => `channels/${channelId}`;
|
|
101
101
|
exports.channel = channel;
|
|
102
|
-
const channelBulkDelete = (
|
|
102
|
+
const channelBulkDelete = (channelId) => `channels/${channelId}/messages/bulk-delete`;
|
|
103
103
|
exports.channelBulkDelete = channelBulkDelete;
|
|
104
|
-
const channelFollowers = (
|
|
104
|
+
const channelFollowers = (channelId) => `channels/${channelId}/followers`;
|
|
105
105
|
exports.channelFollowers = channelFollowers;
|
|
106
|
-
const channelInvites = (
|
|
106
|
+
const channelInvites = (channelId) => `channels/${channelId}/invites`;
|
|
107
107
|
exports.channelInvites = channelInvites;
|
|
108
|
-
const channelMessage = (
|
|
108
|
+
const channelMessage = (channelId, messageId) => `channels/${channelId}/messages/${messageId}`;
|
|
109
109
|
exports.channelMessage = channelMessage;
|
|
110
|
-
const channelMessageAllReactions = (
|
|
111
|
-
? `channels/${
|
|
112
|
-
: `channels/${
|
|
110
|
+
const channelMessageAllReactions = (channelId, messageId, emoji) => emoji
|
|
111
|
+
? `channels/${channelId}/messages/${messageId}/reactions/${emoji}`
|
|
112
|
+
: `channels/${channelId}/messages/${messageId}/reactions`;
|
|
113
113
|
exports.channelMessageAllReactions = channelMessageAllReactions;
|
|
114
|
-
const channelMessageCrosspost = (
|
|
114
|
+
const channelMessageCrosspost = (channelId, messageId) => `channels/${channelId}/messages/${messageId}/crosspost`;
|
|
115
115
|
exports.channelMessageCrosspost = channelMessageCrosspost;
|
|
116
|
-
const channelMessageReaction = (
|
|
116
|
+
const channelMessageReaction = (channelId, messageId, emoji, userId = "@me") => `channels/${channelId}/messages/${messageId}/reactions/${emoji}/${userId}`;
|
|
117
117
|
exports.channelMessageReaction = channelMessageReaction;
|
|
118
|
-
const channelMessages = (
|
|
118
|
+
const channelMessages = (channelId) => `channels/${channelId}/messages`;
|
|
119
119
|
exports.channelMessages = channelMessages;
|
|
120
|
-
const channelPermission = (
|
|
120
|
+
const channelPermission = (channelId, overwriteId) => `channels/${channelId}/permissions/${overwriteId}`;
|
|
121
121
|
exports.channelPermission = channelPermission;
|
|
122
|
-
const channelPin = (
|
|
122
|
+
const channelPin = (channelId, messageId) => `channels/${channelId}/messages/pins/${messageId}`;
|
|
123
123
|
exports.channelPin = channelPin;
|
|
124
|
-
const channelPins = (
|
|
124
|
+
const channelPins = (channelId) => `channels/${channelId}/messages/pins`;
|
|
125
125
|
exports.channelPins = channelPins;
|
|
126
|
-
const channelRecipient = (
|
|
126
|
+
const channelRecipient = (channelId, userId) => `channels/${channelId}/recipients/${userId}`;
|
|
127
127
|
exports.channelRecipient = channelRecipient;
|
|
128
|
-
const channelThreads = (
|
|
129
|
-
? `channels/${
|
|
130
|
-
: `channels/${
|
|
128
|
+
const channelThreads = (channelId, archivedStatus, joined) => joined
|
|
129
|
+
? `channels/${channelId}/users/@me/threads/archived/${archivedStatus}`
|
|
130
|
+
: `channels/${channelId}/threads/archived/${archivedStatus}`;
|
|
131
131
|
exports.channelThreads = channelThreads;
|
|
132
|
-
const channelTyping = (
|
|
132
|
+
const channelTyping = (channelId) => `channels/${channelId}/typing`;
|
|
133
133
|
exports.channelTyping = channelTyping;
|
|
134
|
-
const channelWebhooks = (
|
|
134
|
+
const channelWebhooks = (channelId) => `channels/${channelId}/webhooks`;
|
|
135
135
|
exports.channelWebhooks = channelWebhooks;
|
|
136
|
-
const threads = (
|
|
137
|
-
? `channels/${
|
|
138
|
-
: `channels/${
|
|
136
|
+
const threads = (channelId, messageId) => messageId
|
|
137
|
+
? `channels/${channelId}/messages/${messageId}/threads`
|
|
138
|
+
: `channels/${channelId}/threads`;
|
|
139
139
|
exports.threads = threads;
|
|
140
|
-
const threadMembers = (
|
|
141
|
-
? `channels/${
|
|
142
|
-
: `channels/${
|
|
140
|
+
const threadMembers = (threadId, userId) => userId
|
|
141
|
+
? `channels/${threadId}/thread-members`
|
|
142
|
+
: `channels/${threadId}/thread-members/${userId}`;
|
|
143
143
|
exports.threadMembers = threadMembers;
|
|
144
|
-
const pollAnswerVoters = (
|
|
144
|
+
const pollAnswerVoters = (channelId, messageId, answerId) => `channels/${channelId}/polls/${messageId}/answers/${answerId}`;
|
|
145
145
|
exports.pollAnswerVoters = pollAnswerVoters;
|
|
146
|
-
const pollExpire = (
|
|
146
|
+
const pollExpire = (channelId, messageId) => `channels/${channelId}/polls/${messageId}/expire`;
|
|
147
147
|
exports.pollExpire = pollExpire;
|
|
148
148
|
// Users
|
|
149
|
-
const user = (
|
|
149
|
+
const user = (userId = "@me") => `users/${userId}`;
|
|
150
150
|
exports.user = user;
|
|
151
|
-
const userApplicationRoleConnection = (
|
|
151
|
+
const userApplicationRoleConnection = (applicationId) => `users/@me/applications/${applicationId}/role-connection`;
|
|
152
152
|
exports.userApplicationRoleConnection = userApplicationRoleConnection;
|
|
153
153
|
const userChannels = () => "users/@me/channels";
|
|
154
154
|
exports.userChannels = userChannels;
|
|
155
155
|
const userConnections = () => "users/@me/connections";
|
|
156
156
|
exports.userConnections = userConnections;
|
|
157
|
-
const userGuild = (
|
|
157
|
+
const userGuild = (guildId) => `users/@me/guilds/${guildId}`;
|
|
158
158
|
exports.userGuild = userGuild;
|
|
159
159
|
const userGuilds = () => "users/@me/guilds";
|
|
160
160
|
exports.userGuilds = userGuilds;
|
|
161
161
|
// Applications
|
|
162
|
-
const applicationActivityInstance = (
|
|
162
|
+
const applicationActivityInstance = (applicationId, instanceId) => `applications/${applicationId}/activity-instances/${instanceId}`;
|
|
163
163
|
exports.applicationActivityInstance = applicationActivityInstance;
|
|
164
|
-
const applicationCommand = (
|
|
164
|
+
const applicationCommand = (applicationId, commandId) => `applications/${applicationId}/commands/${commandId}`;
|
|
165
165
|
exports.applicationCommand = applicationCommand;
|
|
166
|
-
const applicationCommands = (
|
|
166
|
+
const applicationCommands = (applicationId) => `applications/${applicationId}/commands`;
|
|
167
167
|
exports.applicationCommands = applicationCommands;
|
|
168
|
-
const applicationCommandPermissions = (
|
|
168
|
+
const applicationCommandPermissions = (applicationId, guildId, commandId) => `applications/${applicationId}/guilds/${guildId}/commands/${commandId}/permissions`;
|
|
169
169
|
exports.applicationCommandPermissions = applicationCommandPermissions;
|
|
170
170
|
const applicationUser = () => "applications/@me";
|
|
171
171
|
exports.applicationUser = applicationUser;
|
|
172
|
-
const applicationEmoji = (
|
|
172
|
+
const applicationEmoji = (applicationId, emojiId) => `applications/${applicationId}/emojis/${emojiId}`;
|
|
173
173
|
exports.applicationEmoji = applicationEmoji;
|
|
174
|
-
const applicationEmojis = (
|
|
174
|
+
const applicationEmojis = (applicationId) => `applications/${applicationId}/emojis`;
|
|
175
175
|
exports.applicationEmojis = applicationEmojis;
|
|
176
|
-
const applicationEntitlement = (
|
|
176
|
+
const applicationEntitlement = (applicationId, entitlementId) => `applications/${applicationId}/entitlements/${entitlementId}`;
|
|
177
177
|
exports.applicationEntitlement = applicationEntitlement;
|
|
178
|
-
const applicationEntitlementConsume = (
|
|
178
|
+
const applicationEntitlementConsume = (applicationId, entitlementId) => `applications/${applicationId}/entitlements/${entitlementId}/consume`;
|
|
179
179
|
exports.applicationEntitlementConsume = applicationEntitlementConsume;
|
|
180
|
-
const applicationEntitlements = (
|
|
180
|
+
const applicationEntitlements = (applicationId) => `applications/${applicationId}/entitlements`;
|
|
181
181
|
exports.applicationEntitlements = applicationEntitlements;
|
|
182
|
-
const applicationGuildCommand = (
|
|
182
|
+
const applicationGuildCommand = (applicationId, guildId, commandId) => `applications/${applicationId}/guilds/${guildId}/commands/${commandId}`;
|
|
183
183
|
exports.applicationGuildCommand = applicationGuildCommand;
|
|
184
|
-
const applicationGuildCommands = (
|
|
184
|
+
const applicationGuildCommands = (applicationId, guildId) => `applications/${applicationId}/guilds/${guildId}/commands`;
|
|
185
185
|
exports.applicationGuildCommands = applicationGuildCommands;
|
|
186
|
-
const applicationRoleConnectionMetadata = (
|
|
186
|
+
const applicationRoleConnectionMetadata = (applicationId) => `applications/${applicationId}/role-connections/metadata`;
|
|
187
187
|
exports.applicationRoleConnectionMetadata = applicationRoleConnectionMetadata;
|
|
188
|
-
const applicationSKUs = (
|
|
188
|
+
const applicationSKUs = (applicationId) => `applications/${applicationId}/skus`;
|
|
189
189
|
exports.applicationSKUs = applicationSKUs;
|
|
190
|
-
const guildApplicationCommandsPermissions = (
|
|
190
|
+
const guildApplicationCommandsPermissions = (applicationId, guildId) => `applications/${applicationId}/guilds/${guildId}/commands/permissions`;
|
|
191
191
|
exports.guildApplicationCommandsPermissions = guildApplicationCommandsPermissions;
|
|
192
192
|
// Webhooks
|
|
193
|
-
const webhook = (
|
|
194
|
-
? `webhooks/${
|
|
195
|
-
: `webhooks/${
|
|
193
|
+
const webhook = (webhookId, webhookToken) => webhookToken
|
|
194
|
+
? `webhooks/${webhookId}/${webhookToken}`
|
|
195
|
+
: `webhooks/${webhookId}`;
|
|
196
196
|
exports.webhook = webhook;
|
|
197
|
-
const webhookMessage = (
|
|
197
|
+
const webhookMessage = (webhookId, webhookToken, messageId = "@original") => `webhooks/${webhookId}/${webhookToken}/messages/${messageId}`;
|
|
198
198
|
exports.webhookMessage = webhookMessage;
|
|
199
|
-
const webhookPlatform = (
|
|
199
|
+
const webhookPlatform = (webhookId, webhookToken, platform) => `webhooks/${webhookId}/${webhookToken}/${platform}`;
|
|
200
200
|
exports.webhookPlatform = webhookPlatform;
|
|
201
201
|
// Sticker packs
|
|
202
|
-
const stickerPack = (
|
|
202
|
+
const stickerPack = (packId) => `sticker-packs/${packId}`;
|
|
203
203
|
exports.stickerPack = stickerPack;
|
|
204
204
|
const stickerPacks = () => "sticker-packs";
|
|
205
205
|
exports.stickerPacks = stickerPacks;
|
|
206
206
|
// Subscriptions
|
|
207
|
-
const skuSubscription = (
|
|
207
|
+
const skuSubscription = (skuId, subscriptionId) => `skus/${skuId}/subscriptions/${subscriptionId}`;
|
|
208
208
|
exports.skuSubscription = skuSubscription;
|
|
209
|
-
const skuSubscriptions = (
|
|
209
|
+
const skuSubscriptions = (skuId) => `skus/${skuId}/subscriptions`;
|
|
210
210
|
exports.skuSubscriptions = skuSubscriptions;
|
|
211
211
|
// Soundboards
|
|
212
|
-
const sendSoundboardSound = (
|
|
212
|
+
const sendSoundboardSound = (channelId) => `channels/${channelId}/send-soundboard-sound`;
|
|
213
213
|
exports.sendSoundboardSound = sendSoundboardSound;
|
|
214
214
|
const soundboardDefaultSounds = () => `soundboard-default-sounds`;
|
|
215
215
|
exports.soundboardDefaultSounds = soundboardDefaultSounds;
|
|
@@ -230,15 +230,24 @@ exports.oauth2TokenExchange = oauth2TokenExchange;
|
|
|
230
230
|
const oauth2TokenRevocation = () => "oauth2/token/revoke";
|
|
231
231
|
exports.oauth2TokenRevocation = oauth2TokenRevocation;
|
|
232
232
|
// Misc
|
|
233
|
-
const interactionCallback = (
|
|
233
|
+
const interactionCallback = (interactionId, interactionToken) => `interactions/${interactionId}/${interactionToken}/callback`;
|
|
234
234
|
exports.interactionCallback = interactionCallback;
|
|
235
235
|
const invite = (code) => `invites/${code}`;
|
|
236
236
|
exports.invite = invite;
|
|
237
|
-
const stageInstance = (
|
|
237
|
+
const stageInstance = (channelId) => `stage-instances/${channelId}`;
|
|
238
238
|
exports.stageInstance = stageInstance;
|
|
239
239
|
const stageInstances = () => "stage-instances";
|
|
240
240
|
exports.stageInstances = stageInstances;
|
|
241
|
-
const sticker = (
|
|
241
|
+
const sticker = (stickerId) => `stickers/${stickerId}`;
|
|
242
242
|
exports.sticker = sticker;
|
|
243
243
|
const voiceRegions = () => "voice/regions";
|
|
244
244
|
exports.voiceRegions = voiceRegions;
|
|
245
|
+
// Lobbies
|
|
246
|
+
const lobbies = () => "lobbies";
|
|
247
|
+
exports.lobbies = lobbies;
|
|
248
|
+
const lobby = (lobbyId) => `lobbies/${lobbyId}`;
|
|
249
|
+
exports.lobby = lobby;
|
|
250
|
+
const lobbyMember = (lobbyId, userId = "@me") => `lobbies/${lobbyId}/members/${userId}`;
|
|
251
|
+
exports.lobbyMember = lobbyMember;
|
|
252
|
+
const lobbyChannelLinking = (lobbyId) => `lobbies/${lobbyId}/channel-linking`;
|
|
253
|
+
exports.lobbyChannelLinking = lobbyChannelLinking;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
/// <reference types="node" />
|
|
3
1
|
import { type JSONErrorCodes } from "../constants";
|
|
4
2
|
export declare enum RESTMethods {
|
|
5
3
|
Get = "GET",
|
|
@@ -23,7 +21,7 @@ export interface ErrorResponse {
|
|
|
23
21
|
errors: Record<string, unknown>;
|
|
24
22
|
}
|
|
25
23
|
export interface FileData {
|
|
26
|
-
contents:
|
|
24
|
+
contents: BlobPart;
|
|
27
25
|
name: string;
|
|
28
26
|
}
|
|
29
27
|
export declare class RequestManager {
|
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
36
|
exports.RequestManager = exports.RESTMethods = void 0;
|
|
27
37
|
const constants_1 = require("../constants");
|
package/dist/lib/rest/index.js
CHANGED
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
26
36
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
27
37
|
};
|
|
@@ -6,8 +6,8 @@ class ApplicationCommands {
|
|
|
6
6
|
return {
|
|
7
7
|
id: command.id,
|
|
8
8
|
type: command.type,
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
applicationId: command.application_id,
|
|
10
|
+
guildId: command.guild_id,
|
|
11
11
|
name: command.name,
|
|
12
12
|
nameLocalizations: command.name_localizations,
|
|
13
13
|
description: command.description,
|
|
@@ -27,8 +27,8 @@ class ApplicationCommands {
|
|
|
27
27
|
return {
|
|
28
28
|
id: command.id,
|
|
29
29
|
type: command.type,
|
|
30
|
-
application_id: command.
|
|
31
|
-
guild_id: command.
|
|
30
|
+
application_id: command.applicationId,
|
|
31
|
+
guild_id: command.guildId,
|
|
32
32
|
name: command.name,
|
|
33
33
|
name_localizations: command.nameLocalizations,
|
|
34
34
|
description: command.description,
|
|
@@ -2,4 +2,6 @@ import type { RawApplication, Application } from "../types/application";
|
|
|
2
2
|
export declare class Applications {
|
|
3
3
|
static applicationFromRaw(application: RawApplication): Application;
|
|
4
4
|
static applicationToRaw(application: Application): RawApplication;
|
|
5
|
+
static partialApplicationFromRaw(application: Partial<RawApplication>): Partial<Application>;
|
|
6
|
+
static partialApplicationToRaw(application: Partial<Application>): Partial<RawApplication>;
|
|
5
7
|
}
|
|
@@ -21,11 +21,11 @@ class Applications {
|
|
|
21
21
|
: undefined,
|
|
22
22
|
verifyKey: application.verify_key,
|
|
23
23
|
team: application.team !== null ? Teams_1.Teams.teamFromRaw(application.team) : null,
|
|
24
|
-
|
|
24
|
+
guildId: application.guild_id,
|
|
25
25
|
guild: application.guild !== undefined
|
|
26
26
|
? Guilds_1.Guilds.guildFromRaw(application.guild)
|
|
27
27
|
: undefined,
|
|
28
|
-
|
|
28
|
+
primarySKUId: application.primary_sku_id,
|
|
29
29
|
slug: application.slug,
|
|
30
30
|
coverImage: application.cover_image,
|
|
31
31
|
flags: application.flags,
|
|
@@ -71,11 +71,117 @@ class Applications {
|
|
|
71
71
|
: undefined,
|
|
72
72
|
verify_key: application.verifyKey,
|
|
73
73
|
team: application.team !== null ? Teams_1.Teams.teamToRaw(application.team) : null,
|
|
74
|
-
guild_id: application.
|
|
74
|
+
guild_id: application.guildId,
|
|
75
75
|
guild: application.guild !== undefined
|
|
76
76
|
? Guilds_1.Guilds.guildToRaw(application.guild)
|
|
77
77
|
: undefined,
|
|
78
|
-
primary_sku_id: application.
|
|
78
|
+
primary_sku_id: application.primarySKUId,
|
|
79
|
+
slug: application.slug,
|
|
80
|
+
cover_image: application.coverImage,
|
|
81
|
+
flags: application.flags,
|
|
82
|
+
approximate_guild_count: application.approximateGuildCount,
|
|
83
|
+
approximate_user_install_count: application.approximateUserInstallCount,
|
|
84
|
+
approximate_user_authorization_count: application.approximateUserAuthorizationCount,
|
|
85
|
+
redirect_uris: application.redirectURIs,
|
|
86
|
+
interactions_endpoint_url: application.interactionsEndpointURL,
|
|
87
|
+
role_connections_verification_url: application.roleConnectionsVerificationURL,
|
|
88
|
+
event_webhooks_url: application.eventWebhooksURL,
|
|
89
|
+
event_webhooks_status: application.eventWebhooksStatus,
|
|
90
|
+
event_webhooks_types: application.eventWebhooksTypes,
|
|
91
|
+
tags: application.tags,
|
|
92
|
+
install_params: application.installParams,
|
|
93
|
+
integration_types_config: application.integrationTypesConfig !== undefined
|
|
94
|
+
? {
|
|
95
|
+
"0": {
|
|
96
|
+
oauth2_install_params: application.integrationTypesConfig?.[0].oauth2InstallParams,
|
|
97
|
+
},
|
|
98
|
+
"1": {
|
|
99
|
+
oauth2_install_params: application.integrationTypesConfig?.[1].oauth2InstallParams,
|
|
100
|
+
},
|
|
101
|
+
}
|
|
102
|
+
: undefined,
|
|
103
|
+
custom_install_url: application.customInstallURL,
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
static partialApplicationFromRaw(application) {
|
|
107
|
+
return {
|
|
108
|
+
id: application.id,
|
|
109
|
+
name: application.name,
|
|
110
|
+
icon: application.icon,
|
|
111
|
+
description: application.description,
|
|
112
|
+
rpcOrigins: application.rpc_origins,
|
|
113
|
+
botPublic: application.bot_public,
|
|
114
|
+
botRequireCodeGrant: application.bot_require_code_grant,
|
|
115
|
+
termsOfServiceURL: application.terms_of_service_url,
|
|
116
|
+
privacyPolicyURL: application.privacy_policy_url,
|
|
117
|
+
owner: application.owner !== undefined
|
|
118
|
+
? Users_1.Users.userFromRaw(application.owner)
|
|
119
|
+
: undefined,
|
|
120
|
+
verifyKey: application.verify_key,
|
|
121
|
+
team: application.team !== undefined
|
|
122
|
+
? application.team !== null
|
|
123
|
+
? Teams_1.Teams.teamFromRaw(application.team)
|
|
124
|
+
: null
|
|
125
|
+
: undefined,
|
|
126
|
+
guildId: application.guild_id,
|
|
127
|
+
guild: application.guild !== undefined
|
|
128
|
+
? Guilds_1.Guilds.guildFromRaw(application.guild)
|
|
129
|
+
: undefined,
|
|
130
|
+
primarySKUId: application.primary_sku_id,
|
|
131
|
+
slug: application.slug,
|
|
132
|
+
coverImage: application.cover_image,
|
|
133
|
+
flags: application.flags,
|
|
134
|
+
approximateGuildCount: application.approximate_guild_count,
|
|
135
|
+
approximateUserInstallCount: application.approximate_user_install_count,
|
|
136
|
+
approximateUserAuthorizationCount: application.approximate_user_authorization_count,
|
|
137
|
+
redirectURIs: application.redirect_uris,
|
|
138
|
+
interactionsEndpointURL: application.interactions_endpoint_url,
|
|
139
|
+
roleConnectionsVerificationURL: application.role_connections_verification_url,
|
|
140
|
+
eventWebhooksURL: application.event_webhooks_url,
|
|
141
|
+
eventWebhooksStatus: application.event_webhooks_status,
|
|
142
|
+
eventWebhooksTypes: application.event_webhooks_types,
|
|
143
|
+
tags: application.tags,
|
|
144
|
+
installParams: application.install_params,
|
|
145
|
+
integrationTypesConfig: application.integration_types_config !== undefined
|
|
146
|
+
? {
|
|
147
|
+
"0": {
|
|
148
|
+
oauth2InstallParams: application.integration_types_config?.[0]
|
|
149
|
+
.oauth2_install_params,
|
|
150
|
+
},
|
|
151
|
+
"1": {
|
|
152
|
+
oauth2InstallParams: application.integration_types_config?.[1]
|
|
153
|
+
.oauth2_install_params,
|
|
154
|
+
},
|
|
155
|
+
}
|
|
156
|
+
: undefined,
|
|
157
|
+
customInstallURL: application.custom_install_url,
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
static partialApplicationToRaw(application) {
|
|
161
|
+
return {
|
|
162
|
+
id: application.id,
|
|
163
|
+
name: application.name,
|
|
164
|
+
icon: application.icon,
|
|
165
|
+
description: application.description,
|
|
166
|
+
rpc_origins: application.rpcOrigins,
|
|
167
|
+
bot_public: application.botPublic,
|
|
168
|
+
bot_require_code_grant: application.botRequireCodeGrant,
|
|
169
|
+
terms_of_service_url: application.termsOfServiceURL,
|
|
170
|
+
privacy_policy_url: application.privacyPolicyURL,
|
|
171
|
+
owner: application.owner !== undefined
|
|
172
|
+
? Users_1.Users.userToRaw(application.owner)
|
|
173
|
+
: undefined,
|
|
174
|
+
verify_key: application.verifyKey,
|
|
175
|
+
team: application.team !== undefined
|
|
176
|
+
? application.team !== null
|
|
177
|
+
? Teams_1.Teams.teamToRaw(application.team)
|
|
178
|
+
: null
|
|
179
|
+
: undefined,
|
|
180
|
+
guild_id: application.guildId,
|
|
181
|
+
guild: application.guild !== undefined
|
|
182
|
+
? Guilds_1.Guilds.guildToRaw(application.guild)
|
|
183
|
+
: undefined,
|
|
184
|
+
primary_sku_id: application.primarySKUId,
|
|
79
185
|
slug: application.slug,
|
|
80
186
|
cover_image: application.coverImage,
|
|
81
187
|
flags: application.flags,
|