disgroove 2.1.3 → 2.2.0-dev.15819eb
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/Client.d.ts +213 -195
- package/dist/lib/constants.d.ts +1 -1
- package/dist/lib/constants.js +7 -7
- package/dist/lib/gateway/Shard.d.ts +2 -1
- package/dist/lib/gateway/Shard.js +2 -0
- package/dist/lib/index.d.ts +0 -1
- package/dist/lib/index.js +0 -1
- package/dist/lib/rest/CDN.d.ts +21 -20
- package/dist/lib/rest/Endpoints.d.ts +82 -81
- package/dist/lib/rest/RequestManager.d.ts +7 -0
- package/dist/lib/rest/RequestManager.js +1 -5
- package/dist/lib/types/application-command.d.ts +21 -21
- package/dist/lib/types/application-role-connection-metadata.d.ts +1 -1
- package/dist/lib/types/application.d.ts +10 -7
- package/dist/lib/types/audit-log.d.ts +21 -14
- package/dist/lib/types/auto-moderation.d.ts +13 -12
- package/dist/lib/types/channel.d.ts +96 -88
- package/dist/lib/types/common.d.ts +4 -0
- package/dist/lib/types/common.js +2 -0
- package/dist/lib/types/emoji.d.ts +6 -5
- package/dist/lib/types/entitlements.d.ts +19 -18
- package/dist/lib/types/gateway-events.d.ts +158 -149
- package/dist/lib/types/guild-scheduled-event.d.ts +21 -19
- package/dist/lib/types/guild-template.d.ts +11 -9
- package/dist/lib/types/guild.d.ts +84 -79
- package/dist/lib/types/interaction.d.ts +38 -29
- package/dist/lib/types/invite.d.ts +9 -4
- package/dist/lib/types/message-components.d.ts +4 -3
- package/dist/lib/types/role.d.ts +9 -8
- package/dist/lib/types/sku.d.ts +5 -4
- package/dist/lib/types/stage-instance.d.ts +11 -10
- package/dist/lib/types/sticker.d.ts +18 -17
- package/dist/lib/types/team.d.ts +8 -7
- package/dist/lib/types/user.d.ts +11 -9
- package/dist/lib/types/voice.d.ts +12 -11
- package/dist/lib/types/webhook.d.ts +15 -10
- package/dist/package.json +3 -3
- package/package.json +1 -1
- package/dist/lib/types/index.d.ts +0 -26
- package/dist/lib/types/index.js +0 -40
package/dist/lib/constants.d.ts
CHANGED
@@ -77,7 +77,7 @@ export declare enum InteractionType {
|
|
77
77
|
ModalSubmit = 5
|
78
78
|
}
|
79
79
|
/** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-context-types */
|
80
|
-
export declare enum
|
80
|
+
export declare enum InteractionContextTypes {
|
81
81
|
Guild = 0,
|
82
82
|
BotDM = 1,
|
83
83
|
PrivateChannel = 2
|
package/dist/lib/constants.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.LayoutType = exports.InviteTargetTypes = exports.InviteTypes = exports.GuildScheduledEventStatus = exports.GuildScheduledEventEntityTypes = exports.GuildScheduledEventPrivacyLevel = exports.ImageWidgetStyleOptions = exports.PromptTypes = exports.OnboardingMode = exports.IntegrationExpireBehaviors = exports.GuildMemberFlags = exports.MutableGuildFeatures = exports.GuildFeatures = exports.SystemChannelFlags = exports.PremiumTier = exports.GuildNSFWLevel = exports.VerificationLevel = exports.MFALevel = exports.ExplicitContentFilterLevel = exports.DefaultMessageNotificationLevel = exports.ReactionTypes = exports.AllowedMentionTypes = exports.AttachmentFlags = exports.MessageFlags = exports.MessageActivityTypes = exports.MessageTypes = exports.ForumLayoutTypes = exports.SortOrderTypes = exports.ChannelFlags = exports.VideoQualityModes = exports.ChannelTypes = exports.ActionTypes = exports.EventTypes = exports.KeywordPresetTypes = exports.TriggerTypes = exports.AuditLogEvents = exports.ApplicationRoleConnectionMetadataType = exports.ApplicationFlags = exports.ApplicationIntegrationTypes = exports.TextInputStyles = exports.ButtonStyles = exports.InteractionCallbackType = exports.ComponentTypes = exports.
|
3
|
+
exports.LayoutType = exports.InviteTargetTypes = exports.InviteTypes = exports.GuildScheduledEventStatus = exports.GuildScheduledEventEntityTypes = exports.GuildScheduledEventPrivacyLevel = exports.ImageWidgetStyleOptions = exports.PromptTypes = exports.OnboardingMode = exports.IntegrationExpireBehaviors = exports.GuildMemberFlags = exports.MutableGuildFeatures = exports.GuildFeatures = exports.SystemChannelFlags = exports.PremiumTier = exports.GuildNSFWLevel = exports.VerificationLevel = exports.MFALevel = exports.ExplicitContentFilterLevel = exports.DefaultMessageNotificationLevel = exports.ReactionTypes = exports.AllowedMentionTypes = exports.AttachmentFlags = exports.MessageFlags = exports.MessageActivityTypes = exports.MessageTypes = exports.ForumLayoutTypes = exports.SortOrderTypes = exports.ChannelFlags = exports.VideoQualityModes = exports.ChannelTypes = exports.ActionTypes = exports.EventTypes = exports.KeywordPresetTypes = exports.TriggerTypes = exports.AuditLogEvents = exports.ApplicationRoleConnectionMetadataType = exports.ApplicationFlags = exports.ApplicationIntegrationTypes = exports.TextInputStyles = exports.ButtonStyles = exports.InteractionCallbackType = exports.ComponentTypes = exports.InteractionContextTypes = exports.InteractionType = exports.ApplicationCommandPermissionType = exports.ApplicationCommandOptionType = exports.ApplicationCommandTypes = exports.Locales = exports.ImageFormats = void 0;
|
4
4
|
exports.EntitlementTypes = exports.SkuFlags = exports.SkuTypes = exports.MembershipState = exports.TeamMemberRoleTypes = exports.RoleFlags = exports.BitwisePermissionFlags = exports.RPCCloseEventCodes = exports.RPCErrorCodes = exports.JSONErrorCodes = exports.HTTPResponseCodes = exports.VoiceCloseEventCodes = exports.VoiceOPCodes = exports.GatewayCloseEventCodes = exports.GatewayOPCodes = exports.OAuth2Scopes = exports.ActivityFlags = exports.ActivityType = exports.GatewayEvents = exports.StatusTypes = exports.GatewayIntents = exports.DeviceType = exports.WebhookTypes = exports.VisibilityTypes = exports.Services = exports.PremiumTypes = exports.UserFlags = exports.StickerFormatTypes = exports.StickerTypes = exports.PrivacyLevel = void 0;
|
5
5
|
/** https://discord.com/developers/docs/reference#image-formatting-image-formats */
|
6
6
|
var ImageFormats;
|
@@ -87,12 +87,12 @@ var InteractionType;
|
|
87
87
|
InteractionType[InteractionType["ModalSubmit"] = 5] = "ModalSubmit";
|
88
88
|
})(InteractionType || (exports.InteractionType = InteractionType = {}));
|
89
89
|
/** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-context-types */
|
90
|
-
var
|
91
|
-
(function (
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
})(
|
90
|
+
var InteractionContextTypes;
|
91
|
+
(function (InteractionContextTypes) {
|
92
|
+
InteractionContextTypes[InteractionContextTypes["Guild"] = 0] = "Guild";
|
93
|
+
InteractionContextTypes[InteractionContextTypes["BotDM"] = 1] = "BotDM";
|
94
|
+
InteractionContextTypes[InteractionContextTypes["PrivateChannel"] = 2] = "PrivateChannel";
|
95
|
+
})(InteractionContextTypes || (exports.InteractionContextTypes = InteractionContextTypes = {}));
|
96
96
|
/** https://discord.com/developers/docs/interactions/message-components#component-object-component-types */
|
97
97
|
var ComponentTypes;
|
98
98
|
(function (ComponentTypes) {
|
@@ -1,12 +1,13 @@
|
|
1
1
|
import WebSocket from "ws";
|
2
2
|
import { StatusTypes } from "../constants";
|
3
|
-
import type { Activity } from "../types";
|
4
3
|
import { Client } from "../Client";
|
4
|
+
import type { Activity } from "../types/gateway-events";
|
5
5
|
export declare class Shard {
|
6
6
|
id: number;
|
7
7
|
private heartbeatInterval;
|
8
8
|
client: Client;
|
9
9
|
ws: WebSocket;
|
10
|
+
sessionId: string;
|
10
11
|
constructor(id: number, client: Client);
|
11
12
|
/** https://discord.com/developers/docs/topics/gateway-events#update-presence */
|
12
13
|
setPresence(options: {
|
@@ -36,6 +36,7 @@ class Shard {
|
|
36
36
|
heartbeatInterval;
|
37
37
|
client;
|
38
38
|
ws;
|
39
|
+
sessionId;
|
39
40
|
constructor(id, client) {
|
40
41
|
this.id = id;
|
41
42
|
this.client = client;
|
@@ -105,6 +106,7 @@ class Shard {
|
|
105
106
|
switch (packet.t) {
|
106
107
|
case "READY":
|
107
108
|
{
|
109
|
+
this.sessionId = packet.d.session_id;
|
108
110
|
this.client.user = this.client.util.toCamelCase(packet.d.user);
|
109
111
|
this.client.guilds = new Map();
|
110
112
|
this.client.application = packet.d.application;
|
package/dist/lib/index.d.ts
CHANGED
package/dist/lib/index.js
CHANGED
@@ -16,7 +16,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
17
17
|
__exportStar(require("./gateway"), exports);
|
18
18
|
__exportStar(require("./rest"), exports);
|
19
|
-
__exportStar(require("./types"), exports);
|
20
19
|
__exportStar(require("./utils"), exports);
|
21
20
|
__exportStar(require("./Client"), exports);
|
22
21
|
__exportStar(require("./constants"), exports);
|
package/dist/lib/rest/CDN.d.ts
CHANGED
@@ -1,21 +1,22 @@
|
|
1
|
-
|
2
|
-
export declare const
|
3
|
-
export declare const
|
4
|
-
export declare const
|
5
|
-
export declare const
|
1
|
+
import type { snowflake } from "../types/common";
|
2
|
+
export declare const achievementIcon: (applicationId: snowflake, achievementId: snowflake, iconHash: string) => `https://cdn.discordapp.com/app-assets/${string}/achievements/${string}/icons/${string}.png`;
|
3
|
+
export declare const applicationAsset: (applicationId: snowflake, assetId: snowflake) => `https://cdn.discordapp.com/app-assets/${string}/${string}.png`;
|
4
|
+
export declare const applicationCover: (applicationId: snowflake, coverImage: string) => `https://cdn.discordapp.com/app-icons/${string}/${string}.png`;
|
5
|
+
export declare const applicationIcon: (applicationId: snowflake, icon: string) => `https://cdn.discordapp.com/app-icons/${string}/${string}.png`;
|
6
|
+
export declare const customEmoji: (emojiId: snowflake) => `https://cdn.discordapp.com/emojis/${string}.png`;
|
6
7
|
export declare const defaultUserAvatar: (index: string) => `https://cdn.discordapp.com/embed/avatars/${string}.png`;
|
7
|
-
export declare const guildBanner: (guildId:
|
8
|
-
export declare const guildDiscoverySplash: (guildId:
|
9
|
-
export declare const guildIcon: (guildId:
|
10
|
-
export declare const guildMemberAvatar: (guildId:
|
11
|
-
export declare const guildMemberBanner: (guildId:
|
12
|
-
export declare const guildScheduledEventCover: (scheduledEventId:
|
13
|
-
export declare const guildSplash: (guildId:
|
14
|
-
export declare const roleIcon: (roleId:
|
15
|
-
export declare const stickerPackBanner: (assetId:
|
16
|
-
export declare const sticker: (stickerId:
|
17
|
-
export declare const storePageAsset: (applicationId:
|
18
|
-
export declare const teamIcon: (teamId:
|
19
|
-
export declare const userAvatar: (userId:
|
20
|
-
export declare const userAvatarDecoration: (userId:
|
21
|
-
export declare const userBanner: (userId:
|
8
|
+
export declare const guildBanner: (guildId: snowflake, banner: string) => `https://cdn.discordapp.com/banners/${string}/${string}.png`;
|
9
|
+
export declare const guildDiscoverySplash: (guildId: snowflake, splash: string) => `https://cdn.discordapp.com/discovery-splashes/${string}/${string}.png`;
|
10
|
+
export declare const guildIcon: (guildId: snowflake, icon: string) => `https://cdn.discordapp.com/icons/${string}/${string}.png`;
|
11
|
+
export declare const guildMemberAvatar: (guildId: snowflake, userId: snowflake, avatar: string) => `https://cdn.discordapp.com/guilds/${string}/users/${string}/avatars/${string}.png`;
|
12
|
+
export declare const guildMemberBanner: (guildId: snowflake, userId: snowflake, banner: string) => `https://cdn.discordapp.com/guilds/${string}/users/${string}/banners/${string}.png`;
|
13
|
+
export declare const guildScheduledEventCover: (scheduledEventId: snowflake, coverImage: string) => `https://cdn.discordapp.com/guild-events/${string}/${string}.png`;
|
14
|
+
export declare const guildSplash: (guildId: snowflake, splash: string) => `https://cdn.discordapp.com/splashes/${string}/${string}.png`;
|
15
|
+
export declare const roleIcon: (roleId: snowflake, icon: string) => `https://cdn.discordapp.com/role-icons/${string}/${string}.png`;
|
16
|
+
export declare const stickerPackBanner: (assetId: snowflake) => `https://cdn.discordapp.com/app-assets/710982414301790216/store/${string}.png`;
|
17
|
+
export declare const sticker: (stickerId: snowflake) => `https://cdn.discordapp.com/stickers/${string}.png`;
|
18
|
+
export declare const storePageAsset: (applicationId: snowflake, assetId: snowflake) => `https://cdn.discordapp.com/app-assets/${string}/store/${string}`;
|
19
|
+
export declare const teamIcon: (teamId: snowflake, icon: string) => `https://cdn.discordapp.com/team-icons/${string}/${string}.png`;
|
20
|
+
export declare const userAvatar: (userId: snowflake, avatar: string) => `https://cdn.discordapp.com/avatars/${string}/${string}.png`;
|
21
|
+
export declare const userAvatarDecoration: (userId: snowflake, avatarDecoration: string) => `https://cdn.discordapp.com/avatar-decorations/${string}/${string}.png`;
|
22
|
+
export declare const userBanner: (userId: snowflake, banner: string) => `https://cdn.discordapp.com/banners/${string}/${string}.png`;
|
@@ -1,87 +1,88 @@
|
|
1
|
-
|
2
|
-
export declare const
|
1
|
+
import type { snowflake } from "../types/common";
|
2
|
+
export declare const bulkGuildBan: (guildId: snowflake) => `guilds/${string}/bulk-ban`;
|
3
|
+
export declare const guild: (guildId: snowflake) => `guilds/${string}`;
|
3
4
|
export declare const guilds: () => "guilds";
|
4
|
-
export declare const guildActiveThreads: (guildId:
|
5
|
-
export declare const guildAuditLog: (guildId:
|
6
|
-
export declare const guildAutoModerationRule: (guildId:
|
7
|
-
export declare const guildAutoModerationRules: (guildId:
|
8
|
-
export declare const guildBan: (guildId:
|
9
|
-
export declare const guildBans: (guildId:
|
10
|
-
export declare const guildChannels: (guildId:
|
11
|
-
export declare const guildCurrentMemberNickname: (guildId:
|
12
|
-
export declare const guildEmoji: (guildId:
|
13
|
-
export declare const guildEmojis: (guildId:
|
14
|
-
export declare const guildIntegration: (guildId:
|
15
|
-
export declare const guildIntegrations: (guildId:
|
16
|
-
export declare const guildInvites: (guildId:
|
17
|
-
export declare const guildMFA: (guildId:
|
18
|
-
export declare const guildMember: (guildId:
|
19
|
-
export declare const guildMemberRole: (guildId:
|
20
|
-
export declare const guildMembers: (guildId:
|
21
|
-
export declare const guildMembersSearch: (guildId:
|
22
|
-
export declare const guildMemberVerification: (guildId:
|
23
|
-
export declare const guildOnboarding: (guildId:
|
24
|
-
export declare const guildPreview: (guildId:
|
25
|
-
export declare const guildPrune: (guildId:
|
26
|
-
export declare const guildRole: (guildId:
|
27
|
-
export declare const guildRoles: (guildId:
|
28
|
-
export declare const guildScheduledEvent: (guildId:
|
29
|
-
export declare const guildScheduledEvents: (guildId:
|
30
|
-
export declare const guildScheduledEventUsers: (guildId:
|
31
|
-
export declare const guildSticker: (guildId:
|
32
|
-
export declare const guildStickers: (guildId:
|
33
|
-
export declare const guildTemplate: (guildId:
|
34
|
-
export declare const guildTemplates: (guildId:
|
35
|
-
export declare const guildVanityUrl: (guildId:
|
36
|
-
export declare const guildVoiceRegions: (guildId:
|
37
|
-
export declare const guildVoiceState: (guildId:
|
38
|
-
export declare const guildWebhooks: (guildId:
|
39
|
-
export declare const guildWelcomeScreen: (guildId:
|
40
|
-
export declare const guildWidgetImage: (guildId:
|
41
|
-
export declare const guildWidgetJSON: (guildId:
|
42
|
-
export declare const guildWidgetSettings: (guildId:
|
5
|
+
export declare const guildActiveThreads: (guildId: snowflake) => `guilds/${string}/threads/active`;
|
6
|
+
export declare const guildAuditLog: (guildId: snowflake) => `guilds/${string}/audit-logs`;
|
7
|
+
export declare const guildAutoModerationRule: (guildId: snowflake, ruleId: snowflake) => `guilds/${string}/auto-moderation/rules/${string}`;
|
8
|
+
export declare const guildAutoModerationRules: (guildId: snowflake) => `guilds/${string}/auto-moderation/rules`;
|
9
|
+
export declare const guildBan: (guildId: snowflake, userId: snowflake) => `guilds/${string}/bans/${string}`;
|
10
|
+
export declare const guildBans: (guildId: snowflake) => `guilds/${string}/bans`;
|
11
|
+
export declare const guildChannels: (guildId: snowflake) => `guilds/${string}/channels`;
|
12
|
+
export declare const guildCurrentMemberNickname: (guildId: snowflake) => `guilds/${string}/members/@me/nick`;
|
13
|
+
export declare const guildEmoji: (guildId: snowflake, emojiId: snowflake) => `guilds/${string}/emojis/${string}`;
|
14
|
+
export declare const guildEmojis: (guildId: snowflake) => `guilds/${string}/emojis`;
|
15
|
+
export declare const guildIntegration: (guildId: snowflake, integrationId: snowflake) => `guilds/${string}/integrations/${string}`;
|
16
|
+
export declare const guildIntegrations: (guildId: snowflake) => `guilds/${string}/integrations`;
|
17
|
+
export declare const guildInvites: (guildId: snowflake) => `guilds/${string}/invites`;
|
18
|
+
export declare const guildMFA: (guildId: snowflake) => `guilds/${string}/mfa`;
|
19
|
+
export declare const guildMember: (guildId: snowflake, userId?: snowflake | "@me") => `guilds/${string}/members/${string}`;
|
20
|
+
export declare const guildMemberRole: (guildId: snowflake, memberId: snowflake, roleId: snowflake) => `guilds/${string}/members/${string}/roles/${string}`;
|
21
|
+
export declare const guildMembers: (guildId: snowflake) => `guilds/${string}/members`;
|
22
|
+
export declare const guildMembersSearch: (guildId: snowflake) => `guilds/${string}/members/search`;
|
23
|
+
export declare const guildMemberVerification: (guildId: snowflake) => `guilds/${string}/member-verification`;
|
24
|
+
export declare const guildOnboarding: (guildId: snowflake) => `guilds/${string}/onboarding`;
|
25
|
+
export declare const guildPreview: (guildId: snowflake) => `guilds/${string}/preview`;
|
26
|
+
export declare const guildPrune: (guildId: snowflake) => `guilds/${string}/prune`;
|
27
|
+
export declare const guildRole: (guildId: snowflake, roleId: snowflake) => `guilds/${string}/roles/${string}`;
|
28
|
+
export declare const guildRoles: (guildId: snowflake) => `guilds/${string}/roles`;
|
29
|
+
export declare const guildScheduledEvent: (guildId: snowflake, guildScheduledEventId: snowflake) => `guilds/${string}/scheduled-events/${string}`;
|
30
|
+
export declare const guildScheduledEvents: (guildId: snowflake) => `guilds/${string}/scheduled-events`;
|
31
|
+
export declare const guildScheduledEventUsers: (guildId: snowflake, guildScheduledEventId: snowflake) => `guilds/${string}/scheduled-events/${string}/users`;
|
32
|
+
export declare const guildSticker: (guildId: snowflake, stickerId: snowflake) => `guilds/${string}/stickers/${string}`;
|
33
|
+
export declare const guildStickers: (guildId: snowflake) => `guilds/${string}/stickers`;
|
34
|
+
export declare const guildTemplate: (guildId: snowflake, code: string) => `guilds/${string}/templates/${string}`;
|
35
|
+
export declare const guildTemplates: (guildId: snowflake) => `guilds/${string}/templates`;
|
36
|
+
export declare const guildVanityUrl: (guildId: snowflake) => `guilds/${string}/vanity-url`;
|
37
|
+
export declare const guildVoiceRegions: (guildId: snowflake) => `guilds/${string}/regions`;
|
38
|
+
export declare const guildVoiceState: (guildId: snowflake, userId?: snowflake | "@me") => `guilds/${string}/voice-states/${string}`;
|
39
|
+
export declare const guildWebhooks: (guildId: snowflake) => `guilds/${string}/webhooks`;
|
40
|
+
export declare const guildWelcomeScreen: (guildId: snowflake) => `guilds/${string}/welcome-screen`;
|
41
|
+
export declare const guildWidgetImage: (guildId: snowflake) => `guilds/${string}/widget.png`;
|
42
|
+
export declare const guildWidgetJSON: (guildId: snowflake) => `guilds/${string}/widget.json`;
|
43
|
+
export declare const guildWidgetSettings: (guildId: snowflake) => `guilds/${string}/widget`;
|
43
44
|
export declare const template: (code: string) => `guilds/templates/${string}`;
|
44
|
-
export declare const channel: (channelId:
|
45
|
-
export declare const channelBulkDelete: (channelId:
|
46
|
-
export declare const channelFollowers: (channelId:
|
47
|
-
export declare const channelInvites: (channelId:
|
48
|
-
export declare const channelMessage: (channelId:
|
49
|
-
export declare const channelMessageAllReactions: (channelId:
|
50
|
-
export declare const channelMessageCrosspost: (channelId:
|
51
|
-
export declare const channelMessageReaction: (channelId:
|
52
|
-
export declare const channelMessages: (channelId:
|
53
|
-
export declare const channelPermission: (channelId:
|
54
|
-
export declare const channelPin: (channelId:
|
55
|
-
export declare const channelPins: (channelId:
|
56
|
-
export declare const channelRecipient: (channelId:
|
57
|
-
export declare const channelThreads: (channelId:
|
58
|
-
export declare const channelTyping: (channelId:
|
59
|
-
export declare const channelWebhooks: (channelId:
|
60
|
-
export declare const threads: (channelId:
|
61
|
-
export declare const threadMembers: (threadId:
|
62
|
-
export declare const pollAnswerVoters: (channelId:
|
63
|
-
export declare const pollExpire: (channelId:
|
64
|
-
export declare const user: (userId?:
|
65
|
-
export declare const userApplicationRoleConnection: (applicationId:
|
45
|
+
export declare const channel: (channelId: snowflake) => `channels/${string}`;
|
46
|
+
export declare const channelBulkDelete: (channelId: snowflake) => `channels/${string}/messages/bulk-delete`;
|
47
|
+
export declare const channelFollowers: (channelId: snowflake) => `channels/${string}/followers`;
|
48
|
+
export declare const channelInvites: (channelId: snowflake) => `channels/${string}/invites`;
|
49
|
+
export declare const channelMessage: (channelId: snowflake, messageId: snowflake) => `channels/${string}/messages/${string}`;
|
50
|
+
export declare const channelMessageAllReactions: (channelId: snowflake, messageId: snowflake, emoji?: string) => `channels/${string}/messages/${string}/reactions/${string}` | `channels/${string}/messages/${string}/reactions`;
|
51
|
+
export declare const channelMessageCrosspost: (channelId: snowflake, messageId: snowflake) => `channels/${string}/messages/${string}/crosspost`;
|
52
|
+
export declare const channelMessageReaction: (channelId: snowflake, messageId: snowflake, emoji: string, userId?: snowflake | "@me") => `channels/${string}/messages/${string}/reactions/${string}/${string}`;
|
53
|
+
export declare const channelMessages: (channelId: snowflake) => `channels/${string}/messages`;
|
54
|
+
export declare const channelPermission: (channelId: snowflake, overwriteId: snowflake) => `channels/${string}/permissions/${string}`;
|
55
|
+
export declare const channelPin: (channelId: snowflake, messageId: snowflake) => `channels/${string}/pins/${string}`;
|
56
|
+
export declare const channelPins: (channelId: snowflake) => `channels/${string}/pins`;
|
57
|
+
export declare const channelRecipient: (channelId: snowflake, userId: snowflake) => `channels/${string}/recipients/${string}`;
|
58
|
+
export declare const channelThreads: (channelId: snowflake, archivedStatus: "public" | "private", joined: boolean) => `channels/${string}/threads/archived/private` | `channels/${string}/threads/archived/public`;
|
59
|
+
export declare const channelTyping: (channelId: snowflake) => `channels/${string}/typing`;
|
60
|
+
export declare const channelWebhooks: (channelId: snowflake) => `channels/${string}/webhooks`;
|
61
|
+
export declare const threads: (channelId: snowflake, messageId?: snowflake) => `channels/${string}/threads`;
|
62
|
+
export declare const threadMembers: (threadId: snowflake, userId?: snowflake | "@me") => `channels/${string}/thread-members` | `channels/${string}/thread-members/${string}`;
|
63
|
+
export declare const pollAnswerVoters: (channelId: snowflake, messageId: snowflake, answerId: snowflake) => `channels/${string}/polls/${string}/answers/${string}`;
|
64
|
+
export declare const pollExpire: (channelId: snowflake, messageId: snowflake) => `channels/${string}/polls/${string}/expire`;
|
65
|
+
export declare const user: (userId?: snowflake | "@me") => `users/${string}`;
|
66
|
+
export declare const userApplicationRoleConnection: (applicationId: snowflake) => `users/@me/applications/${string}/role-connection`;
|
66
67
|
export declare const userChannels: () => "users/@me/channels";
|
67
68
|
export declare const userConnections: () => "users/@me/connections";
|
68
|
-
export declare const userGuild: (guildId:
|
69
|
+
export declare const userGuild: (guildId: snowflake) => `users/@me/guilds/${string}`;
|
69
70
|
export declare const userGuilds: () => "users/@me/guilds";
|
70
|
-
export declare const applicationCommand: (applicationId:
|
71
|
-
export declare const applicationCommands: (applicationId:
|
72
|
-
export declare const applicationCommandPermissions: (applicationId:
|
71
|
+
export declare const applicationCommand: (applicationId: snowflake, commandId: snowflake) => `applications/${string}/commands/${string}`;
|
72
|
+
export declare const applicationCommands: (applicationId: snowflake) => `applications/${string}/commands`;
|
73
|
+
export declare const applicationCommandPermissions: (applicationId: snowflake, guildId: snowflake, commandId: snowflake) => `applications/${string}/guilds/${string}/commands/${string}/permissions`;
|
73
74
|
export declare const applicationCurrentUser: () => "applications/@me";
|
74
|
-
export declare const applicationEntitlement: (applicationId:
|
75
|
-
export declare const applicationEntitlementConsume: (applicationId:
|
76
|
-
export declare const applicationEntitlements: (applicationId:
|
77
|
-
export declare const applicationGuildCommand: (applicationId:
|
78
|
-
export declare const applicationGuildCommands: (applicationId:
|
79
|
-
export declare const applicationRoleConnectionMetadata: (applicationId:
|
80
|
-
export declare const applicationSkus: (applicationId:
|
81
|
-
export declare const guildApplicationCommandsPermissions: (applicationId:
|
82
|
-
export declare const webhook: (webhookId:
|
83
|
-
export declare const webhookMessage: (webhookId:
|
84
|
-
export declare const webhookPlatform: (webhookId:
|
75
|
+
export declare const applicationEntitlement: (applicationId: snowflake, entitlementId: snowflake) => `applications/${string}/entitlements/${string}`;
|
76
|
+
export declare const applicationEntitlementConsume: (applicationId: snowflake, entitlementId: snowflake) => `applications/${string}/entitlements/${string}/consume`;
|
77
|
+
export declare const applicationEntitlements: (applicationId: snowflake) => `applications/${string}/entitlements`;
|
78
|
+
export declare const applicationGuildCommand: (applicationId: snowflake, guildId: snowflake, commandId: snowflake) => `applications/${string}/guilds/${string}/commands/${string}`;
|
79
|
+
export declare const applicationGuildCommands: (applicationId: snowflake, guildId: snowflake) => `applications/${string}/guilds/${string}/commands`;
|
80
|
+
export declare const applicationRoleConnectionMetadata: (applicationId: snowflake) => `applications/${string}/role-connections/metadata`;
|
81
|
+
export declare const applicationSkus: (applicationId: snowflake) => `applications/${string}/skus`;
|
82
|
+
export declare const guildApplicationCommandsPermissions: (applicationId: snowflake, guildId: snowflake) => `applications/${string}/guilds/${string}/commands/permissions`;
|
83
|
+
export declare const webhook: (webhookId: snowflake, webhookToken?: string) => `webhooks/${string}`;
|
84
|
+
export declare const webhookMessage: (webhookId: snowflake, webhookToken: string, messageId?: snowflake | "@original") => `webhooks/${string}/${string}/messages/${string}`;
|
85
|
+
export declare const webhookPlatform: (webhookId: snowflake, webhookToken: string, platform: "github" | "slack") => `webhooks/${string}/${string}/github` | `webhooks/${string}/${string}/slack`;
|
85
86
|
export declare const gateway: () => "gateway";
|
86
87
|
export declare const gatewayBot: () => "gateway/bot";
|
87
88
|
export declare const oauth2Authorization: () => "oauth2/authorize";
|
@@ -89,10 +90,10 @@ export declare const oauth2CurrentApplication: () => "oauth2/applications/@me";
|
|
89
90
|
export declare const oauth2CurrentAuthorization: () => "oauth2/@me";
|
90
91
|
export declare const oauth2TokenExchange: () => "oauth2/token";
|
91
92
|
export declare const oauth2TokenRevocation: () => "oauth2/token/revoke";
|
92
|
-
export declare const interactionCallback: (interactionId:
|
93
|
+
export declare const interactionCallback: (interactionId: snowflake, interactionToken: string) => `interactions/${string}/${string}/callback`;
|
93
94
|
export declare const invite: (code: string) => `invites/${string}`;
|
94
|
-
export declare const stageInstance: (channelId:
|
95
|
+
export declare const stageInstance: (channelId: snowflake) => `stage-instances/${string}`;
|
95
96
|
export declare const stageInstances: () => "stage-instances";
|
96
|
-
export declare const sticker: (stickerId:
|
97
|
+
export declare const sticker: (stickerId: snowflake) => `stickers/${string}`;
|
97
98
|
export declare const stickerPacks: () => "sticker-packs";
|
98
99
|
export declare const voiceRegions: () => "voice/regions";
|
@@ -1,4 +1,5 @@
|
|
1
1
|
/// <reference types="node" />
|
2
|
+
import { JSONErrorCodes } from "../constants";
|
2
3
|
export declare enum RESTMethods {
|
3
4
|
Get = "GET",
|
4
5
|
Post = "POST",
|
@@ -14,6 +15,12 @@ export interface RequestData {
|
|
14
15
|
query?: Partial<Record<string, string | number | boolean | Array<string>>>;
|
15
16
|
authorization?: boolean;
|
16
17
|
}
|
18
|
+
/** https://discord.com/developers/docs/reference#error-messages */
|
19
|
+
export interface ErrorResponse {
|
20
|
+
code: JSONErrorCodes;
|
21
|
+
message: string;
|
22
|
+
errors: Record<string, unknown>;
|
23
|
+
}
|
17
24
|
export interface File {
|
18
25
|
contents: Buffer;
|
19
26
|
name: string;
|
@@ -104,11 +104,7 @@ class RequestManager {
|
|
104
104
|
}
|
105
105
|
else {
|
106
106
|
const responseJSON = await response.json();
|
107
|
-
reject(responseJSON
|
108
|
-
typeof responseJSON === "object" &&
|
109
|
-
"code" in responseJSON &&
|
110
|
-
"message" in responseJSON &&
|
111
|
-
responseJSON.code !== 0
|
107
|
+
reject(responseJSON.code !== 0
|
112
108
|
? new utils_1.RESTError(`[${responseJSON.code}] ${responseJSON.message}`)
|
113
109
|
: new utils_1.HTTPError(`[${response.status}] ${response.statusText}`));
|
114
110
|
}
|
@@ -1,11 +1,11 @@
|
|
1
|
-
import type {
|
2
|
-
import type {
|
1
|
+
import type { ApplicationCommandTypes, ApplicationCommandOptionType, ChannelTypes, ApplicationCommandPermissionType, ApplicationIntegrationTypes, InteractionContextTypes } from "../constants";
|
2
|
+
import type { snowflake, LocaleMap } from "./common";
|
3
3
|
/** https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-structure */
|
4
4
|
export interface RawApplicationCommand {
|
5
|
-
id:
|
5
|
+
id: snowflake;
|
6
6
|
type?: ApplicationCommandTypes;
|
7
|
-
application_id:
|
8
|
-
guild_id?:
|
7
|
+
application_id: snowflake;
|
8
|
+
guild_id?: snowflake;
|
9
9
|
name: string;
|
10
10
|
name_localizations?: LocaleMap | null;
|
11
11
|
description: string;
|
@@ -15,9 +15,9 @@ export interface RawApplicationCommand {
|
|
15
15
|
dm_permission?: boolean;
|
16
16
|
default_permission?: boolean | null;
|
17
17
|
integration_types?: Array<ApplicationIntegrationTypes>;
|
18
|
-
contexts?: Array<
|
18
|
+
contexts?: Array<InteractionContextTypes>;
|
19
19
|
nsfw?: boolean;
|
20
|
-
version:
|
20
|
+
version: snowflake;
|
21
21
|
}
|
22
22
|
/** https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-structure */
|
23
23
|
export interface RawApplicationCommandOption {
|
@@ -44,22 +44,22 @@ export interface RawApplicationCommandOptionChoice {
|
|
44
44
|
}
|
45
45
|
/** https://discord.com/developers/docs/interactions/application-commands#application-command-permissions-object-guild-application-command-permissions-structure */
|
46
46
|
export interface RawGuildApplicationCommandPermissions {
|
47
|
-
id:
|
48
|
-
application_id:
|
49
|
-
guild_id:
|
47
|
+
id: snowflake;
|
48
|
+
application_id: snowflake;
|
49
|
+
guild_id: snowflake;
|
50
50
|
permissions: Array<RawApplicationCommandPermission>;
|
51
51
|
}
|
52
52
|
/** https://discord.com/developers/docs/interactions/application-commands#application-command-permissions-object-application-command-permissions-structure */
|
53
53
|
export interface RawApplicationCommandPermission {
|
54
|
-
id:
|
54
|
+
id: snowflake;
|
55
55
|
type: ApplicationCommandPermissionType;
|
56
56
|
permission: boolean;
|
57
57
|
}
|
58
58
|
export interface ApplicationCommand {
|
59
|
-
id:
|
59
|
+
id: snowflake;
|
60
60
|
type?: ApplicationCommandTypes;
|
61
|
-
applicationId:
|
62
|
-
guildId?:
|
61
|
+
applicationId: snowflake;
|
62
|
+
guildId?: snowflake;
|
63
63
|
name: string;
|
64
64
|
nameLocalizations?: LocaleMap | null;
|
65
65
|
description: string;
|
@@ -69,7 +69,7 @@ export interface ApplicationCommand {
|
|
69
69
|
dmPermission?: boolean;
|
70
70
|
defaultPermission?: boolean | null;
|
71
71
|
integrationTypes?: Array<ApplicationIntegrationTypes>;
|
72
|
-
contexts?: Array<
|
72
|
+
contexts?: Array<InteractionContextTypes>;
|
73
73
|
nsfw?: boolean;
|
74
74
|
version: string;
|
75
75
|
}
|
@@ -95,13 +95,13 @@ export interface ApplicationCommandOptionChoice {
|
|
95
95
|
value: string;
|
96
96
|
}
|
97
97
|
export interface GuildApplicationCommandPermissions {
|
98
|
-
id:
|
99
|
-
applicationId:
|
100
|
-
guildId:
|
98
|
+
id: snowflake;
|
99
|
+
applicationId: snowflake;
|
100
|
+
guildId: snowflake;
|
101
101
|
permissions: Array<ApplicationCommandPermission>;
|
102
102
|
}
|
103
103
|
export interface ApplicationCommandPermission {
|
104
|
-
id:
|
104
|
+
id: snowflake;
|
105
105
|
type: ApplicationCommandPermissionType;
|
106
106
|
permission: boolean;
|
107
107
|
}
|
@@ -129,7 +129,7 @@ export interface EditGlobalApplicationCommandParams {
|
|
129
129
|
nsfw?: boolean;
|
130
130
|
}
|
131
131
|
export type BulkEditGlobalApplicationCommandsParams = Array<{
|
132
|
-
id?:
|
132
|
+
id?: snowflake;
|
133
133
|
name: string;
|
134
134
|
nameLocalizations?: LocaleMap | null;
|
135
135
|
description?: string;
|
@@ -163,7 +163,7 @@ export interface EditGuildApplicationCommandParams {
|
|
163
163
|
nsfw?: boolean;
|
164
164
|
}
|
165
165
|
export type BulkEditGuildApplicationCommandsParams = Array<{
|
166
|
-
id?:
|
166
|
+
id?: snowflake;
|
167
167
|
name: string;
|
168
168
|
nameLocalizations?: LocaleMap | null;
|
169
169
|
description?: string;
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import type { LocaleMap } from ".";
|
2
1
|
import type { ApplicationRoleConnectionMetadataType } from "../constants";
|
2
|
+
import type { LocaleMap } from "./common";
|
3
3
|
/** https://discord.com/developers/docs/resources/application-role-connection-metadata#application-role-connection-metadata-object-application-role-connection-metadata-structure */
|
4
4
|
export interface RawApplicationRoleConnectionMetadata {
|
5
5
|
type: ApplicationRoleConnectionMetadataType;
|
@@ -1,8 +1,11 @@
|
|
1
|
-
import type { RawUser, RawTeam, Team, User, RawGuild, Guild } from ".";
|
2
1
|
import type { ApplicationFlags, ApplicationIntegrationTypes, OAuth2Scopes } from "../constants";
|
2
|
+
import type { snowflake } from "./common";
|
3
|
+
import type { RawGuild, Guild } from "./guild";
|
4
|
+
import type { RawTeam, Team } from "./team";
|
5
|
+
import type { RawUser, User } from "./user";
|
3
6
|
/** https://discord.com/developers/docs/resources/application#application-object-application-structure */
|
4
7
|
export interface RawApplication {
|
5
|
-
id:
|
8
|
+
id: snowflake;
|
6
9
|
name: string;
|
7
10
|
icon: string | null;
|
8
11
|
description: string;
|
@@ -14,9 +17,9 @@ export interface RawApplication {
|
|
14
17
|
owner?: RawUser;
|
15
18
|
verify_key: string;
|
16
19
|
team: RawTeam | null;
|
17
|
-
guild_id?:
|
20
|
+
guild_id?: snowflake;
|
18
21
|
guild?: RawGuild;
|
19
|
-
primary_sku_id?:
|
22
|
+
primary_sku_id?: snowflake;
|
20
23
|
slug?: string;
|
21
24
|
cover_image?: string;
|
22
25
|
flags?: ApplicationFlags;
|
@@ -39,7 +42,7 @@ export interface RawInstallParams {
|
|
39
42
|
permissions: string;
|
40
43
|
}
|
41
44
|
export interface Application {
|
42
|
-
id:
|
45
|
+
id: snowflake;
|
43
46
|
name: string;
|
44
47
|
icon: string | null;
|
45
48
|
description: string;
|
@@ -51,9 +54,9 @@ export interface Application {
|
|
51
54
|
owner?: User;
|
52
55
|
verifyKey: string;
|
53
56
|
team: Team | null;
|
54
|
-
guildId?:
|
57
|
+
guildId?: snowflake;
|
55
58
|
guild?: Guild;
|
56
|
-
primarySkuId?:
|
59
|
+
primarySkuId?: snowflake;
|
57
60
|
slug?: string;
|
58
61
|
coverImage?: string;
|
59
62
|
flags?: ApplicationFlags;
|
@@ -1,5 +1,12 @@
|
|
1
|
-
import type { RawApplicationCommand, RawGuildScheduledEvent, RawAutoModerationRule, RawIntegration, RawChannel, RawUser, RawWebhook, User, ApplicationCommand, AutoModerationRule, GuildScheduledEvent, Integration, Channel, Webhook } from ".";
|
2
1
|
import type { AuditLogEvents } from "../constants";
|
2
|
+
import type { RawApplicationCommand, ApplicationCommand } from "./application-command";
|
3
|
+
import type { RawAutoModerationRule, AutoModerationRule } from "./auto-moderation";
|
4
|
+
import type { RawChannel, Channel } from "./channel";
|
5
|
+
import type { snowflake } from "./common";
|
6
|
+
import type { RawIntegration, Integration } from "./guild";
|
7
|
+
import type { RawGuildScheduledEvent, GuildScheduledEvent } from "./guild-scheduled-event";
|
8
|
+
import type { RawUser, User } from "./user";
|
9
|
+
import type { RawWebhook, Webhook } from "./webhook";
|
3
10
|
/** https://discord.com/developers/docs/resources/audit-log#audit-log-object-audit-log-structure */
|
4
11
|
export interface RawAuditLog {
|
5
12
|
application_commands: Array<RawApplicationCommand>;
|
@@ -15,23 +22,23 @@ export interface RawAuditLog {
|
|
15
22
|
export interface RawAuditLogEntry {
|
16
23
|
target_id: string | null;
|
17
24
|
changes?: Array<RawAuditLogChange>;
|
18
|
-
user_id:
|
19
|
-
id:
|
25
|
+
user_id: snowflake | null;
|
26
|
+
id: snowflake;
|
20
27
|
action_type: AuditLogEvents;
|
21
28
|
options?: RawOptionalAuditLogEntryInfo;
|
22
29
|
reason?: string;
|
23
30
|
}
|
24
31
|
/** https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-optional-audit-entry-info */
|
25
32
|
export interface RawOptionalAuditLogEntryInfo {
|
26
|
-
application_id:
|
33
|
+
application_id: snowflake;
|
27
34
|
auto_moderation_rule_name: string;
|
28
35
|
auto_moderation_rule_trigger_type: string;
|
29
|
-
channel_id:
|
36
|
+
channel_id: snowflake;
|
30
37
|
count: string;
|
31
38
|
delete_member_days: string;
|
32
|
-
id:
|
39
|
+
id: snowflake;
|
33
40
|
members_removed: string;
|
34
|
-
message_id:
|
41
|
+
message_id: snowflake;
|
35
42
|
role_name: string;
|
36
43
|
type: string;
|
37
44
|
integration_type: string;
|
@@ -53,24 +60,24 @@ export interface AuditLog {
|
|
53
60
|
webhooks: Array<Webhook>;
|
54
61
|
}
|
55
62
|
export interface AuditLogEntry {
|
56
|
-
targetId:
|
63
|
+
targetId: snowflake | null;
|
57
64
|
changes?: Array<AuditLogChange>;
|
58
|
-
userId:
|
59
|
-
id:
|
65
|
+
userId: snowflake | null;
|
66
|
+
id: snowflake;
|
60
67
|
actionType: AuditLogEvents;
|
61
68
|
options?: OptionalAuditLogEntryInfo;
|
62
69
|
reason?: string;
|
63
70
|
}
|
64
71
|
export interface OptionalAuditLogEntryInfo {
|
65
|
-
applicationId:
|
72
|
+
applicationId: snowflake;
|
66
73
|
autoModerationRuleName: string;
|
67
74
|
autoModerationRuleTriggerType: string;
|
68
|
-
channelId:
|
75
|
+
channelId: snowflake;
|
69
76
|
count: string;
|
70
77
|
deleteMemberDays: string;
|
71
|
-
id:
|
78
|
+
id: snowflake;
|
72
79
|
membersRemoved: string;
|
73
|
-
messageId:
|
80
|
+
messageId: snowflake;
|
74
81
|
roleName: string;
|
75
82
|
type: string;
|
76
83
|
integrationType: string;
|