disgroove 2.2.7-dev.fca4921 → 3.0.0-dev.281727f
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 +334 -301
- package/dist/lib/Client.js +580 -475
- package/dist/lib/constants.d.ts +36 -24
- package/dist/lib/constants.js +40 -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 +96 -91
- package/dist/lib/rest/Endpoints.js +115 -104
- 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 +4 -4
- package/dist/lib/types/message-components.d.ts +0 -234
- /package/dist/lib/types/{message-components.js → components.js} +0 -0
|
@@ -1,215 +1,217 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.
|
|
5
|
-
exports.voiceRegions = exports.sticker = exports.stageInstances = exports.stageInstance = exports.invite = exports.interactionCallback = exports.oauth2TokenRevocation = exports.oauth2TokenExchange = exports.oauth2Authorization = void 0;
|
|
3
|
+
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.guildRoleMemberCounts = 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
|
+
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 = exports.channelInvites = 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 = exports.oauth2Application = 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
|
|
61
|
+
const guildRoleMemberCounts = (guildId) => `guilds/${guildId}/roles/member-counts`;
|
|
62
|
+
exports.guildRoleMemberCounts = guildRoleMemberCounts;
|
|
63
|
+
const guildRoles = (guildId) => `guilds/${guildId}/roles`;
|
|
62
64
|
exports.guildRoles = guildRoles;
|
|
63
|
-
const guildScheduledEvent = (
|
|
65
|
+
const guildScheduledEvent = (guildId, guildScheduledEventId) => `guilds/${guildId}/scheduled-events/${guildScheduledEventId}`;
|
|
64
66
|
exports.guildScheduledEvent = guildScheduledEvent;
|
|
65
|
-
const guildScheduledEvents = (
|
|
67
|
+
const guildScheduledEvents = (guildId) => `guilds/${guildId}/scheduled-events`;
|
|
66
68
|
exports.guildScheduledEvents = guildScheduledEvents;
|
|
67
|
-
const guildScheduledEventUsers = (
|
|
69
|
+
const guildScheduledEventUsers = (guildId, guildScheduledEventId) => `guilds/${guildId}/scheduled-events/${guildScheduledEventId}/users`;
|
|
68
70
|
exports.guildScheduledEventUsers = guildScheduledEventUsers;
|
|
69
|
-
const guildSoundboardSound = (
|
|
71
|
+
const guildSoundboardSound = (guildId, soundId) => `guilds/${guildId}/soundboard-sounds/${soundId}`;
|
|
70
72
|
exports.guildSoundboardSound = guildSoundboardSound;
|
|
71
|
-
const guildSoundboardSounds = (
|
|
73
|
+
const guildSoundboardSounds = (guildId) => `guilds/${guildId}/soundboard-sounds`;
|
|
72
74
|
exports.guildSoundboardSounds = guildSoundboardSounds;
|
|
73
|
-
const guildSticker = (
|
|
75
|
+
const guildSticker = (guildId, stickerId) => `guilds/${guildId}/stickers/${stickerId}`;
|
|
74
76
|
exports.guildSticker = guildSticker;
|
|
75
|
-
const guildStickers = (
|
|
77
|
+
const guildStickers = (guildId) => `guilds/${guildId}/stickers`;
|
|
76
78
|
exports.guildStickers = guildStickers;
|
|
77
|
-
const guildTemplate = (
|
|
79
|
+
const guildTemplate = (guildId, code) => `guilds/${guildId}/templates/${code}`;
|
|
78
80
|
exports.guildTemplate = guildTemplate;
|
|
79
|
-
const guildTemplates = (
|
|
81
|
+
const guildTemplates = (guildId) => `guilds/${guildId}/templates`;
|
|
80
82
|
exports.guildTemplates = guildTemplates;
|
|
81
|
-
const guildVanityURL = (
|
|
83
|
+
const guildVanityURL = (guildId) => `guilds/${guildId}/vanity-url`;
|
|
82
84
|
exports.guildVanityURL = guildVanityURL;
|
|
83
|
-
const guildVoiceRegions = (
|
|
85
|
+
const guildVoiceRegions = (guildId) => `guilds/${guildId}/regions`;
|
|
84
86
|
exports.guildVoiceRegions = guildVoiceRegions;
|
|
85
|
-
const guildVoiceState = (
|
|
87
|
+
const guildVoiceState = (guildId, userId = "@me") => `guilds/${guildId}/voice-states/${userId}`;
|
|
86
88
|
exports.guildVoiceState = guildVoiceState;
|
|
87
|
-
const guildWebhooks = (
|
|
89
|
+
const guildWebhooks = (guildId) => `guilds/${guildId}/webhooks`;
|
|
88
90
|
exports.guildWebhooks = guildWebhooks;
|
|
89
|
-
const guildWelcomeScreen = (
|
|
91
|
+
const guildWelcomeScreen = (guildId) => `guilds/${guildId}/welcome-screen`;
|
|
90
92
|
exports.guildWelcomeScreen = guildWelcomeScreen;
|
|
91
|
-
const guildWidgetImage = (
|
|
93
|
+
const guildWidgetImage = (guildId) => `guilds/${guildId}/widget.png`;
|
|
92
94
|
exports.guildWidgetImage = guildWidgetImage;
|
|
93
|
-
const guildWidgetJSON = (
|
|
95
|
+
const guildWidgetJSON = (guildId) => `guilds/${guildId}/widget.json`;
|
|
94
96
|
exports.guildWidgetJSON = guildWidgetJSON;
|
|
95
|
-
const guildWidgetSettings = (
|
|
97
|
+
const guildWidgetSettings = (guildId) => `guilds/${guildId}/widget`;
|
|
96
98
|
exports.guildWidgetSettings = guildWidgetSettings;
|
|
97
99
|
const template = (code) => `guilds/templates/${code}`;
|
|
98
100
|
exports.template = template;
|
|
99
101
|
// Channels
|
|
100
|
-
const channel = (
|
|
102
|
+
const channel = (channelId) => `channels/${channelId}`;
|
|
101
103
|
exports.channel = channel;
|
|
102
|
-
const channelBulkDelete = (
|
|
104
|
+
const channelBulkDelete = (channelId) => `channels/${channelId}/messages/bulk-delete`;
|
|
103
105
|
exports.channelBulkDelete = channelBulkDelete;
|
|
104
|
-
const channelFollowers = (
|
|
106
|
+
const channelFollowers = (channelId) => `channels/${channelId}/followers`;
|
|
105
107
|
exports.channelFollowers = channelFollowers;
|
|
106
|
-
const channelInvites = (
|
|
108
|
+
const channelInvites = (channelId) => `channels/${channelId}/invites`;
|
|
107
109
|
exports.channelInvites = channelInvites;
|
|
108
|
-
const channelMessage = (
|
|
110
|
+
const channelMessage = (channelId, messageId) => `channels/${channelId}/messages/${messageId}`;
|
|
109
111
|
exports.channelMessage = channelMessage;
|
|
110
|
-
const channelMessageAllReactions = (
|
|
111
|
-
? `channels/${
|
|
112
|
-
: `channels/${
|
|
112
|
+
const channelMessageAllReactions = (channelId, messageId, emoji) => emoji
|
|
113
|
+
? `channels/${channelId}/messages/${messageId}/reactions/${emoji}`
|
|
114
|
+
: `channels/${channelId}/messages/${messageId}/reactions`;
|
|
113
115
|
exports.channelMessageAllReactions = channelMessageAllReactions;
|
|
114
|
-
const channelMessageCrosspost = (
|
|
116
|
+
const channelMessageCrosspost = (channelId, messageId) => `channels/${channelId}/messages/${messageId}/crosspost`;
|
|
115
117
|
exports.channelMessageCrosspost = channelMessageCrosspost;
|
|
116
|
-
const channelMessageReaction = (
|
|
118
|
+
const channelMessageReaction = (channelId, messageId, emoji, userId = "@me") => `channels/${channelId}/messages/${messageId}/reactions/${emoji}/${userId}`;
|
|
117
119
|
exports.channelMessageReaction = channelMessageReaction;
|
|
118
|
-
const channelMessages = (
|
|
120
|
+
const channelMessages = (channelId) => `channels/${channelId}/messages`;
|
|
119
121
|
exports.channelMessages = channelMessages;
|
|
120
|
-
const channelPermission = (
|
|
122
|
+
const channelPermission = (channelId, overwriteId) => `channels/${channelId}/permissions/${overwriteId}`;
|
|
121
123
|
exports.channelPermission = channelPermission;
|
|
122
|
-
const channelPin = (
|
|
124
|
+
const channelPin = (channelId, messageId) => `channels/${channelId}/messages/pins/${messageId}`;
|
|
123
125
|
exports.channelPin = channelPin;
|
|
124
|
-
const channelPins = (
|
|
126
|
+
const channelPins = (channelId) => `channels/${channelId}/messages/pins`;
|
|
125
127
|
exports.channelPins = channelPins;
|
|
126
|
-
const channelRecipient = (
|
|
128
|
+
const channelRecipient = (channelId, userId) => `channels/${channelId}/recipients/${userId}`;
|
|
127
129
|
exports.channelRecipient = channelRecipient;
|
|
128
|
-
const channelThreads = (
|
|
129
|
-
? `channels/${
|
|
130
|
-
: `channels/${
|
|
130
|
+
const channelThreads = (channelId, archivedStatus, joined) => joined
|
|
131
|
+
? `channels/${channelId}/users/@me/threads/archived/${archivedStatus}`
|
|
132
|
+
: `channels/${channelId}/threads/archived/${archivedStatus}`;
|
|
131
133
|
exports.channelThreads = channelThreads;
|
|
132
|
-
const channelTyping = (
|
|
134
|
+
const channelTyping = (channelId) => `channels/${channelId}/typing`;
|
|
133
135
|
exports.channelTyping = channelTyping;
|
|
134
|
-
const channelWebhooks = (
|
|
136
|
+
const channelWebhooks = (channelId) => `channels/${channelId}/webhooks`;
|
|
135
137
|
exports.channelWebhooks = channelWebhooks;
|
|
136
|
-
const threads = (
|
|
137
|
-
? `channels/${
|
|
138
|
-
: `channels/${
|
|
138
|
+
const threads = (channelId, messageId) => messageId
|
|
139
|
+
? `channels/${channelId}/messages/${messageId}/threads`
|
|
140
|
+
: `channels/${channelId}/threads`;
|
|
139
141
|
exports.threads = threads;
|
|
140
|
-
const threadMembers = (
|
|
141
|
-
? `channels/${
|
|
142
|
-
: `channels/${
|
|
142
|
+
const threadMembers = (threadId, userId) => userId
|
|
143
|
+
? `channels/${threadId}/thread-members`
|
|
144
|
+
: `channels/${threadId}/thread-members/${userId}`;
|
|
143
145
|
exports.threadMembers = threadMembers;
|
|
144
|
-
const pollAnswerVoters = (
|
|
146
|
+
const pollAnswerVoters = (channelId, messageId, answerId) => `channels/${channelId}/polls/${messageId}/answers/${answerId}`;
|
|
145
147
|
exports.pollAnswerVoters = pollAnswerVoters;
|
|
146
|
-
const pollExpire = (
|
|
148
|
+
const pollExpire = (channelId, messageId) => `channels/${channelId}/polls/${messageId}/expire`;
|
|
147
149
|
exports.pollExpire = pollExpire;
|
|
148
150
|
// Users
|
|
149
|
-
const user = (
|
|
151
|
+
const user = (userId = "@me") => `users/${userId}`;
|
|
150
152
|
exports.user = user;
|
|
151
|
-
const userApplicationRoleConnection = (
|
|
153
|
+
const userApplicationRoleConnection = (applicationId) => `users/@me/applications/${applicationId}/role-connection`;
|
|
152
154
|
exports.userApplicationRoleConnection = userApplicationRoleConnection;
|
|
153
155
|
const userChannels = () => "users/@me/channels";
|
|
154
156
|
exports.userChannels = userChannels;
|
|
155
157
|
const userConnections = () => "users/@me/connections";
|
|
156
158
|
exports.userConnections = userConnections;
|
|
157
|
-
const userGuild = (
|
|
159
|
+
const userGuild = (guildId) => `users/@me/guilds/${guildId}`;
|
|
158
160
|
exports.userGuild = userGuild;
|
|
159
161
|
const userGuilds = () => "users/@me/guilds";
|
|
160
162
|
exports.userGuilds = userGuilds;
|
|
161
163
|
// Applications
|
|
162
|
-
const applicationActivityInstance = (
|
|
164
|
+
const applicationActivityInstance = (applicationId, instanceId) => `applications/${applicationId}/activity-instances/${instanceId}`;
|
|
163
165
|
exports.applicationActivityInstance = applicationActivityInstance;
|
|
164
|
-
const applicationCommand = (
|
|
166
|
+
const applicationCommand = (applicationId, commandId) => `applications/${applicationId}/commands/${commandId}`;
|
|
165
167
|
exports.applicationCommand = applicationCommand;
|
|
166
|
-
const applicationCommands = (
|
|
168
|
+
const applicationCommands = (applicationId) => `applications/${applicationId}/commands`;
|
|
167
169
|
exports.applicationCommands = applicationCommands;
|
|
168
|
-
const applicationCommandPermissions = (
|
|
170
|
+
const applicationCommandPermissions = (applicationId, guildId, commandId) => `applications/${applicationId}/guilds/${guildId}/commands/${commandId}/permissions`;
|
|
169
171
|
exports.applicationCommandPermissions = applicationCommandPermissions;
|
|
170
172
|
const applicationUser = () => "applications/@me";
|
|
171
173
|
exports.applicationUser = applicationUser;
|
|
172
|
-
const applicationEmoji = (
|
|
174
|
+
const applicationEmoji = (applicationId, emojiId) => `applications/${applicationId}/emojis/${emojiId}`;
|
|
173
175
|
exports.applicationEmoji = applicationEmoji;
|
|
174
|
-
const applicationEmojis = (
|
|
176
|
+
const applicationEmojis = (applicationId) => `applications/${applicationId}/emojis`;
|
|
175
177
|
exports.applicationEmojis = applicationEmojis;
|
|
176
|
-
const applicationEntitlement = (
|
|
178
|
+
const applicationEntitlement = (applicationId, entitlementId) => `applications/${applicationId}/entitlements/${entitlementId}`;
|
|
177
179
|
exports.applicationEntitlement = applicationEntitlement;
|
|
178
|
-
const applicationEntitlementConsume = (
|
|
180
|
+
const applicationEntitlementConsume = (applicationId, entitlementId) => `applications/${applicationId}/entitlements/${entitlementId}/consume`;
|
|
179
181
|
exports.applicationEntitlementConsume = applicationEntitlementConsume;
|
|
180
|
-
const applicationEntitlements = (
|
|
182
|
+
const applicationEntitlements = (applicationId) => `applications/${applicationId}/entitlements`;
|
|
181
183
|
exports.applicationEntitlements = applicationEntitlements;
|
|
182
|
-
const applicationGuildCommand = (
|
|
184
|
+
const applicationGuildCommand = (applicationId, guildId, commandId) => `applications/${applicationId}/guilds/${guildId}/commands/${commandId}`;
|
|
183
185
|
exports.applicationGuildCommand = applicationGuildCommand;
|
|
184
|
-
const applicationGuildCommands = (
|
|
186
|
+
const applicationGuildCommands = (applicationId, guildId) => `applications/${applicationId}/guilds/${guildId}/commands`;
|
|
185
187
|
exports.applicationGuildCommands = applicationGuildCommands;
|
|
186
|
-
const applicationRoleConnectionMetadata = (
|
|
188
|
+
const applicationRoleConnectionMetadata = (applicationId) => `applications/${applicationId}/role-connections/metadata`;
|
|
187
189
|
exports.applicationRoleConnectionMetadata = applicationRoleConnectionMetadata;
|
|
188
|
-
const applicationSKUs = (
|
|
190
|
+
const applicationSKUs = (applicationId) => `applications/${applicationId}/skus`;
|
|
189
191
|
exports.applicationSKUs = applicationSKUs;
|
|
190
|
-
const guildApplicationCommandsPermissions = (
|
|
192
|
+
const guildApplicationCommandsPermissions = (applicationId, guildId) => `applications/${applicationId}/guilds/${guildId}/commands/permissions`;
|
|
191
193
|
exports.guildApplicationCommandsPermissions = guildApplicationCommandsPermissions;
|
|
192
194
|
// Webhooks
|
|
193
|
-
const webhook = (
|
|
194
|
-
? `webhooks/${
|
|
195
|
-
: `webhooks/${
|
|
195
|
+
const webhook = (webhookId, webhookToken) => webhookToken
|
|
196
|
+
? `webhooks/${webhookId}/${webhookToken}`
|
|
197
|
+
: `webhooks/${webhookId}`;
|
|
196
198
|
exports.webhook = webhook;
|
|
197
|
-
const webhookMessage = (
|
|
199
|
+
const webhookMessage = (webhookId, webhookToken, messageId = "@original") => `webhooks/${webhookId}/${webhookToken}/messages/${messageId}`;
|
|
198
200
|
exports.webhookMessage = webhookMessage;
|
|
199
|
-
const webhookPlatform = (
|
|
201
|
+
const webhookPlatform = (webhookId, webhookToken, platform) => `webhooks/${webhookId}/${webhookToken}/${platform}`;
|
|
200
202
|
exports.webhookPlatform = webhookPlatform;
|
|
201
203
|
// Sticker packs
|
|
202
|
-
const stickerPack = (
|
|
204
|
+
const stickerPack = (packId) => `sticker-packs/${packId}`;
|
|
203
205
|
exports.stickerPack = stickerPack;
|
|
204
206
|
const stickerPacks = () => "sticker-packs";
|
|
205
207
|
exports.stickerPacks = stickerPacks;
|
|
206
208
|
// Subscriptions
|
|
207
|
-
const skuSubscription = (
|
|
209
|
+
const skuSubscription = (skuId, subscriptionId) => `skus/${skuId}/subscriptions/${subscriptionId}`;
|
|
208
210
|
exports.skuSubscription = skuSubscription;
|
|
209
|
-
const skuSubscriptions = (
|
|
211
|
+
const skuSubscriptions = (skuId) => `skus/${skuId}/subscriptions`;
|
|
210
212
|
exports.skuSubscriptions = skuSubscriptions;
|
|
211
213
|
// Soundboards
|
|
212
|
-
const sendSoundboardSound = (
|
|
214
|
+
const sendSoundboardSound = (channelId) => `channels/${channelId}/send-soundboard-sound`;
|
|
213
215
|
exports.sendSoundboardSound = sendSoundboardSound;
|
|
214
216
|
const soundboardDefaultSounds = () => `soundboard-default-sounds`;
|
|
215
217
|
exports.soundboardDefaultSounds = soundboardDefaultSounds;
|
|
@@ -230,15 +232,24 @@ exports.oauth2TokenExchange = oauth2TokenExchange;
|
|
|
230
232
|
const oauth2TokenRevocation = () => "oauth2/token/revoke";
|
|
231
233
|
exports.oauth2TokenRevocation = oauth2TokenRevocation;
|
|
232
234
|
// Misc
|
|
233
|
-
const interactionCallback = (
|
|
235
|
+
const interactionCallback = (interactionId, interactionToken) => `interactions/${interactionId}/${interactionToken}/callback`;
|
|
234
236
|
exports.interactionCallback = interactionCallback;
|
|
235
237
|
const invite = (code) => `invites/${code}`;
|
|
236
238
|
exports.invite = invite;
|
|
237
|
-
const stageInstance = (
|
|
239
|
+
const stageInstance = (channelId) => `stage-instances/${channelId}`;
|
|
238
240
|
exports.stageInstance = stageInstance;
|
|
239
241
|
const stageInstances = () => "stage-instances";
|
|
240
242
|
exports.stageInstances = stageInstances;
|
|
241
|
-
const sticker = (
|
|
243
|
+
const sticker = (stickerId) => `stickers/${stickerId}`;
|
|
242
244
|
exports.sticker = sticker;
|
|
243
245
|
const voiceRegions = () => "voice/regions";
|
|
244
246
|
exports.voiceRegions = voiceRegions;
|
|
247
|
+
// Lobbies
|
|
248
|
+
const lobbies = () => "lobbies";
|
|
249
|
+
exports.lobbies = lobbies;
|
|
250
|
+
const lobby = (lobbyId) => `lobbies/${lobbyId}`;
|
|
251
|
+
exports.lobby = lobby;
|
|
252
|
+
const lobbyMember = (lobbyId, userId = "@me") => `lobbies/${lobbyId}/members/${userId}`;
|
|
253
|
+
exports.lobbyMember = lobbyMember;
|
|
254
|
+
const lobbyChannelLinking = (lobbyId) => `lobbies/${lobbyId}/channel-linking`;
|
|
255
|
+
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,
|