disgroove 2.2.4 → 2.2.5-dev.3beface
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 +51 -4
- package/dist/lib/Client.js +190 -72
- package/dist/lib/constants.d.ts +36 -5
- package/dist/lib/constants.js +35 -3
- package/dist/lib/gateway/Shard.d.ts +3 -1
- package/dist/lib/gateway/Shard.js +28 -0
- package/dist/lib/rest/Endpoints.d.ts +4 -0
- package/dist/lib/rest/Endpoints.js +12 -3
- package/dist/lib/transformers/ApplicationCommands.js +2 -0
- package/dist/lib/transformers/Interactions.d.ts +3 -1
- package/dist/lib/transformers/Interactions.js +42 -0
- package/dist/lib/transformers/Soundboards.d.ts +5 -0
- package/dist/lib/transformers/Soundboards.js +31 -0
- package/dist/lib/transformers/index.d.ts +1 -0
- package/dist/lib/transformers/index.js +1 -0
- package/dist/lib/types/application-command.d.ts +3 -1
- package/dist/lib/types/gateway-events.d.ts +21 -0
- package/dist/lib/types/guild.d.ts +2 -0
- package/dist/lib/types/interaction.d.ts +44 -0
- package/dist/lib/types/soundboard.d.ts +23 -0
- package/dist/lib/types/soundboard.js +2 -0
- package/dist/lib/utils/CDN.d.ts +1 -0
- package/dist/lib/utils/CDN.js +3 -1
- package/dist/lib/utils/formatters.d.ts +2 -2
- package/dist/lib/utils/formatters.js +5 -2
- package/dist/package.json +1 -1
- package/package.json +1 -1
@@ -1,4 +1,4 @@
|
|
1
|
-
import type { ApplicationCommandTypes, ApplicationCommandOptionType, ChannelTypes, ApplicationCommandPermissionType, ApplicationIntegrationTypes, InteractionContextTypes } from "../constants";
|
1
|
+
import type { ApplicationCommandTypes, ApplicationCommandOptionType, ChannelTypes, ApplicationCommandPermissionType, ApplicationIntegrationTypes, InteractionContextTypes, EntryPointCommandHandlerTypes } from "../constants";
|
2
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 {
|
@@ -18,6 +18,7 @@ export interface RawApplicationCommand {
|
|
18
18
|
contexts?: Array<InteractionContextTypes>;
|
19
19
|
nsfw?: boolean;
|
20
20
|
version: snowflake;
|
21
|
+
handler?: EntryPointCommandHandlerTypes;
|
21
22
|
}
|
22
23
|
/** https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-structure */
|
23
24
|
export interface RawApplicationCommandOption {
|
@@ -72,6 +73,7 @@ export interface ApplicationCommand {
|
|
72
73
|
contexts?: Array<InteractionContextTypes>;
|
73
74
|
nsfw?: boolean;
|
74
75
|
version: string;
|
76
|
+
handler?: EntryPointCommandHandlerTypes;
|
75
77
|
}
|
76
78
|
export interface ApplicationCommandOption {
|
77
79
|
type: ApplicationCommandOptionType;
|
@@ -6,6 +6,7 @@ import type { snowflake, timestamp } from "./common";
|
|
6
6
|
import type { RawEmoji, Emoji } from "./emoji";
|
7
7
|
import type { RawGuildMember, GuildMember } from "./guild";
|
8
8
|
import type { RawGuildScheduledEvent, GuildScheduledEvent } from "./guild-scheduled-event";
|
9
|
+
import type { RawSoundboardSound, SoundboardSound } from "./soundboard";
|
9
10
|
import type { RawStageInstance, StageInstance } from "./stage-instance";
|
10
11
|
import type { RawUser, RawAvatarDecorationData, User, AvatarDecorationData } from "./user";
|
11
12
|
import type { RawVoiceState, VoiceState } from "./voice";
|
@@ -47,6 +48,10 @@ export interface RawRequestGuildMembers {
|
|
47
48
|
user_ids?: snowflake | Array<snowflake>;
|
48
49
|
nonce?: string;
|
49
50
|
}
|
51
|
+
/** https://discord.com/developers/docs/topics/gateway-events#request-soundboard-sounds-request-soundboard-sounds-structure */
|
52
|
+
export interface RequestSoundboardSounds {
|
53
|
+
guild_ids: Array<snowflake>;
|
54
|
+
}
|
50
55
|
/** https://discord.com/developers/docs/topics/gateway-events#update-presence-gateway-presence-update-structure */
|
51
56
|
export interface RawGatewayPresenceUpdate {
|
52
57
|
since: number | null;
|
@@ -113,6 +118,7 @@ export interface RawGuildCreateEventExtraFields {
|
|
113
118
|
presences?: Array<RawPresenceUpdateEventFields>;
|
114
119
|
stage_instances?: Array<RawStageInstance>;
|
115
120
|
guild_scheduled_events?: Array<RawGuildScheduledEvent>;
|
121
|
+
soundboard_sounds?: Array<RawSoundboardSound>;
|
116
122
|
}
|
117
123
|
/** https://discord.com/developers/docs/topics/gateway-events#guild-audit-log-entry-create-guild-audit-log-entry-create-extra-fields */
|
118
124
|
export interface RawGuildAuditLogEntryCreateExtraFields {
|
@@ -148,6 +154,7 @@ export interface RawGuildMemberUpdateEventFields {
|
|
148
154
|
user: RawUser;
|
149
155
|
nick?: string | null;
|
150
156
|
avatar: string | null;
|
157
|
+
banner: string | null;
|
151
158
|
joined_at?: timestamp | null;
|
152
159
|
premium_since?: number | null;
|
153
160
|
deaf?: boolean;
|
@@ -167,6 +174,11 @@ export interface RawGuildMembersChunkEventFields {
|
|
167
174
|
presences?: Array<RawPresenceUpdateEventFields>;
|
168
175
|
nonce?: string;
|
169
176
|
}
|
177
|
+
/** https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sound-delete-guild-soundboard-sound-delete-event-fields */
|
178
|
+
export interface RawGuildSoundboardSoundDeleteEventFields {
|
179
|
+
soundID: snowflake;
|
180
|
+
guildID: snowflake;
|
181
|
+
}
|
170
182
|
/** https://discord.com/developers/docs/topics/gateway-events#integration-create-integration-create-event-additional-fields */
|
171
183
|
export interface RawIntegrationCreateEventExtraFields {
|
172
184
|
guild_id: snowflake;
|
@@ -396,6 +408,9 @@ export interface RequestGuildMembers {
|
|
396
408
|
userIDs?: snowflake | Array<snowflake>;
|
397
409
|
nonce?: string;
|
398
410
|
}
|
411
|
+
export interface RequestSoundboardSounds {
|
412
|
+
guildIDs: Array<snowflake>;
|
413
|
+
}
|
399
414
|
export interface GatewayPresenceUpdate {
|
400
415
|
since: number | null;
|
401
416
|
activities: Array<Partial<Pick<Activity, "name" | "type" | "url" | "state">>>;
|
@@ -454,6 +469,7 @@ export interface GuildCreateEventExtraFields {
|
|
454
469
|
presences?: Array<PresenceUpdateEventFields>;
|
455
470
|
stageInstances?: Array<StageInstance>;
|
456
471
|
guildScheduledEvents?: Array<GuildScheduledEvent>;
|
472
|
+
soundboardSounds?: Array<SoundboardSound>;
|
457
473
|
}
|
458
474
|
export interface GuildAuditLogEntryCreateExtraFields {
|
459
475
|
guildID: snowflake;
|
@@ -482,6 +498,7 @@ export interface GuildMemberUpdateEventFields {
|
|
482
498
|
user: User;
|
483
499
|
nick?: string | null;
|
484
500
|
avatar: string | null;
|
501
|
+
banner: string | null;
|
485
502
|
joinedAt?: timestamp | null;
|
486
503
|
premiumSince?: number | null;
|
487
504
|
deaf?: boolean;
|
@@ -500,6 +517,10 @@ export interface GuildMembersChunkEventFields {
|
|
500
517
|
presences?: Array<PresenceUpdateEventFields>;
|
501
518
|
nonce?: string;
|
502
519
|
}
|
520
|
+
export interface GuildSoundboardSoundDeleteEventFields {
|
521
|
+
soundID: snowflake;
|
522
|
+
guildID: snowflake;
|
523
|
+
}
|
503
524
|
export interface IntegrationCreateEventExtraFields {
|
504
525
|
guildID: snowflake;
|
505
526
|
}
|
@@ -89,6 +89,7 @@ export interface RawGuildMember {
|
|
89
89
|
user?: RawUser;
|
90
90
|
nick?: string | null;
|
91
91
|
avatar?: string | null;
|
92
|
+
banner?: string | null;
|
92
93
|
roles: Array<snowflake>;
|
93
94
|
joined_at: timestamp;
|
94
95
|
premium_since?: number | null;
|
@@ -257,6 +258,7 @@ export interface GuildMember {
|
|
257
258
|
user?: User;
|
258
259
|
nick?: string | null;
|
259
260
|
avatar?: string | null;
|
261
|
+
banner?: string | null;
|
260
262
|
roles: Array<snowflake>;
|
261
263
|
joinedAt: string;
|
262
264
|
premiumSince?: number | null;
|
@@ -104,6 +104,30 @@ export interface RawInteractionCallbackData {
|
|
104
104
|
custom_id?: string;
|
105
105
|
title?: string;
|
106
106
|
}
|
107
|
+
/** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-callback-interaction-callback-response-object */
|
108
|
+
export interface RawInteractionCallbackResponse {
|
109
|
+
interaction: RawInteractionCallback;
|
110
|
+
resource?: RawInteractionResource;
|
111
|
+
}
|
112
|
+
/** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-callback-interaction-callback-object */
|
113
|
+
export interface RawInteractionCallback {
|
114
|
+
id: snowflake;
|
115
|
+
type: InteractionType;
|
116
|
+
activity_instance_id?: string;
|
117
|
+
response_message_id?: snowflake;
|
118
|
+
response_message_loading?: boolean;
|
119
|
+
response_message_ephemeral?: boolean;
|
120
|
+
}
|
121
|
+
/** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-callback-interaction-callback-resource-object */
|
122
|
+
export interface RawInteractionResource {
|
123
|
+
type: InteractionCallbackType;
|
124
|
+
activity_instance?: RawActivityInstanceResource;
|
125
|
+
message?: RawMessage;
|
126
|
+
}
|
127
|
+
/** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-callback-interaction-callback-activity-instance-resource */
|
128
|
+
export interface RawActivityInstanceResource {
|
129
|
+
id: string;
|
130
|
+
}
|
107
131
|
export interface Interaction {
|
108
132
|
id: snowflake;
|
109
133
|
applicationID: snowflake;
|
@@ -189,3 +213,23 @@ export interface InteractionCallbackData {
|
|
189
213
|
customID?: string;
|
190
214
|
title?: string;
|
191
215
|
}
|
216
|
+
export interface InteractionCallbackResponse {
|
217
|
+
interaction: InteractionCallback;
|
218
|
+
resource?: InteractionResource;
|
219
|
+
}
|
220
|
+
export interface InteractionCallback {
|
221
|
+
id: snowflake;
|
222
|
+
type: InteractionType;
|
223
|
+
activityInstanceID?: string;
|
224
|
+
responseMessageID?: snowflake;
|
225
|
+
responseMessageLoading?: boolean;
|
226
|
+
responseMessageEphemeral?: boolean;
|
227
|
+
}
|
228
|
+
export interface InteractionResource {
|
229
|
+
type: InteractionCallbackType;
|
230
|
+
activityInstance?: ActivityInstanceResource;
|
231
|
+
message?: Message;
|
232
|
+
}
|
233
|
+
export interface ActivityInstanceResource {
|
234
|
+
id: string;
|
235
|
+
}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import type { snowflake } from "./common";
|
2
|
+
import type { RawUser, User } from "./user";
|
3
|
+
/** https://discord.com/developers/docs/resources/soundboard#soundboard-sound-structure */
|
4
|
+
export interface RawSoundboardSound {
|
5
|
+
name: string;
|
6
|
+
sound_id: snowflake;
|
7
|
+
volume: number;
|
8
|
+
emoji_id: snowflake | null;
|
9
|
+
emoji_name: string | null;
|
10
|
+
guild_id?: snowflake;
|
11
|
+
available: boolean;
|
12
|
+
user?: RawUser;
|
13
|
+
}
|
14
|
+
export interface SoundboardSound {
|
15
|
+
name: string;
|
16
|
+
soundID: snowflake;
|
17
|
+
volume: number;
|
18
|
+
emojiID: snowflake | null;
|
19
|
+
emojiName: string | null;
|
20
|
+
guildID?: snowflake;
|
21
|
+
available: boolean;
|
22
|
+
user?: User;
|
23
|
+
}
|
package/dist/lib/utils/CDN.d.ts
CHANGED
@@ -18,6 +18,7 @@ export declare const roleIcon: (roleID: snowflake, icon: string, imageFormat?: I
|
|
18
18
|
export declare const stickerPackBanner: (assetID: snowflake, imageFormat?: ImageFormats.PNG | ImageFormats.JPEG | ImageFormats.JPG | ImageFormats.WebP) => `https://cdn.discordapp.com/${string}.jpg` | `https://cdn.discordapp.com/${string}.jpeg` | `https://cdn.discordapp.com/${string}.png` | `https://cdn.discordapp.com/${string}.webp` | `https://cdn.discordapp.com/${string}.gif` | `https://cdn.discordapp.com/${string}.json`;
|
19
19
|
export declare const sticker: (stickerID: snowflake, imageFormat?: ImageFormats.PNG | ImageFormats.Lottie | ImageFormats.GIF) => `https://cdn.discordapp.com/${string}.jpg` | `https://cdn.discordapp.com/${string}.jpeg` | `https://cdn.discordapp.com/${string}.png` | `https://cdn.discordapp.com/${string}.webp` | `https://cdn.discordapp.com/${string}.gif` | `https://cdn.discordapp.com/${string}.json`;
|
20
20
|
export declare const storePageAsset: (applicationID: snowflake, assetID: snowflake, imageFormat?: ImageFormats.PNG | ImageFormats.JPEG | ImageFormats.JPG | ImageFormats.WebP) => `https://cdn.discordapp.com/${string}.jpg` | `https://cdn.discordapp.com/${string}.jpeg` | `https://cdn.discordapp.com/${string}.png` | `https://cdn.discordapp.com/${string}.webp` | `https://cdn.discordapp.com/${string}.gif` | `https://cdn.discordapp.com/${string}.json`;
|
21
|
+
export declare const soundboardSound: (soundID: snowflake) => `https://cdn.discordapp.com/${string}.jpg` | `https://cdn.discordapp.com/${string}.jpeg` | `https://cdn.discordapp.com/${string}.png` | `https://cdn.discordapp.com/${string}.webp` | `https://cdn.discordapp.com/${string}.gif` | `https://cdn.discordapp.com/${string}.json`;
|
21
22
|
export declare const teamIcon: (teamID: snowflake, icon: string, imageFormat?: ImageFormats.PNG | ImageFormats.JPEG | ImageFormats.JPG | ImageFormats.WebP) => `https://cdn.discordapp.com/${string}.jpg` | `https://cdn.discordapp.com/${string}.jpeg` | `https://cdn.discordapp.com/${string}.png` | `https://cdn.discordapp.com/${string}.webp` | `https://cdn.discordapp.com/${string}.gif` | `https://cdn.discordapp.com/${string}.json`;
|
22
23
|
export declare const userAvatar: (userID: snowflake, avatar: string, imageFormat?: ImageFormats.PNG | ImageFormats.JPEG | ImageFormats.JPG | ImageFormats.WebP | ImageFormats.GIF) => `https://cdn.discordapp.com/${string}.jpg` | `https://cdn.discordapp.com/${string}.jpeg` | `https://cdn.discordapp.com/${string}.png` | `https://cdn.discordapp.com/${string}.webp` | `https://cdn.discordapp.com/${string}.gif` | `https://cdn.discordapp.com/${string}.json`;
|
23
24
|
export declare const userAvatarDecoration: (userID: snowflake, avatarDecoration: string) => `https://cdn.discordapp.com/${string}.jpg` | `https://cdn.discordapp.com/${string}.jpeg` | `https://cdn.discordapp.com/${string}.png` | `https://cdn.discordapp.com/${string}.webp` | `https://cdn.discordapp.com/${string}.gif` | `https://cdn.discordapp.com/${string}.json`;
|
package/dist/lib/utils/CDN.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
/* https://discord.com/developers/docs/reference#image-formatting */
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
-
exports.userBanner = exports.userAvatarDecoration = exports.userAvatar = exports.teamIcon = exports.storePageAsset = exports.sticker = exports.stickerPackBanner = exports.roleIcon = exports.guildSplash = exports.guildScheduledEventCover = exports.guildMemberBanner = exports.guildMemberAvatar = exports.guildIcon = exports.guildDiscoverySplash = exports.guildBanner = exports.defaultUserAvatar = exports.customEmoji = exports.applicationIcon = exports.applicationCover = exports.applicationAsset = exports.achievementIcon = exports.cdnURL = void 0;
|
4
|
+
exports.userBanner = exports.userAvatarDecoration = exports.userAvatar = exports.teamIcon = exports.soundboardSound = exports.storePageAsset = exports.sticker = exports.stickerPackBanner = exports.roleIcon = exports.guildSplash = exports.guildScheduledEventCover = exports.guildMemberBanner = exports.guildMemberAvatar = exports.guildIcon = exports.guildDiscoverySplash = exports.guildBanner = exports.defaultUserAvatar = exports.customEmoji = exports.applicationIcon = exports.applicationCover = exports.applicationAsset = exports.achievementIcon = exports.cdnURL = void 0;
|
5
5
|
const constants_1 = require("../constants");
|
6
6
|
const cdnURL = (cdnEndpoint, imageFormat = constants_1.ImageFormats.PNG) => `https://cdn.discordapp.com/${cdnEndpoint}.${imageFormat}`;
|
7
7
|
exports.cdnURL = cdnURL;
|
@@ -39,6 +39,8 @@ const sticker = (stickerID, imageFormat = constants_1.ImageFormats.PNG) => (0, e
|
|
39
39
|
exports.sticker = sticker;
|
40
40
|
const storePageAsset = (applicationID, assetID, imageFormat = constants_1.ImageFormats.PNG) => (0, exports.cdnURL)(`app-assets/${applicationID}/store/${assetID}`, imageFormat);
|
41
41
|
exports.storePageAsset = storePageAsset;
|
42
|
+
const soundboardSound = (soundID) => (0, exports.cdnURL)(`soundboard-sounds/${soundID}`);
|
43
|
+
exports.soundboardSound = soundboardSound;
|
42
44
|
const teamIcon = (teamID, icon, imageFormat = constants_1.ImageFormats.PNG) => (0, exports.cdnURL)(`team-icons/${teamID}/${icon}`, imageFormat);
|
43
45
|
exports.teamIcon = teamIcon;
|
44
46
|
const userAvatar = (userID, avatar, imageFormat = constants_1.ImageFormats.PNG) => (0, exports.cdnURL)(`avatars/${userID}/${avatar}`, imageFormat);
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import
|
1
|
+
import { GuildNavigationTypes, TimestampStyles } from "../constants";
|
2
2
|
import type { snowflake } from "../types/common";
|
3
3
|
/** https://discord.com/developers/docs/reference#message-formatting-formats */
|
4
4
|
export declare function userMention(userID: snowflake): string;
|
@@ -13,4 +13,4 @@ export declare function customEmoji(emojiName: string, emojiID: snowflake, anima
|
|
13
13
|
/** https://discord.com/developers/docs/reference#message-formatting-formats */
|
14
14
|
export declare function unixTimestamp(time: number, style?: TimestampStyles): string;
|
15
15
|
/** https://discord.com/developers/docs/reference#message-formatting-formats */
|
16
|
-
export declare function guildNavigation(guildID: snowflake, type: GuildNavigationTypes): string;
|
16
|
+
export declare function guildNavigation(guildID: snowflake, type: GuildNavigationTypes, roleID?: snowflake): string;
|
@@ -1,6 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.guildNavigation = exports.unixTimestamp = exports.customEmoji = exports.slashCommandMention = exports.roleMention = exports.channelMention = exports.userMention = void 0;
|
4
|
+
const constants_1 = require("../constants");
|
4
5
|
/** https://discord.com/developers/docs/reference#message-formatting-formats */
|
5
6
|
function userMention(userID) {
|
6
7
|
return `<@${userID}>`;
|
@@ -38,7 +39,9 @@ function unixTimestamp(time, style) {
|
|
38
39
|
}
|
39
40
|
exports.unixTimestamp = unixTimestamp;
|
40
41
|
/** https://discord.com/developers/docs/reference#message-formatting-formats */
|
41
|
-
function guildNavigation(guildID, type) {
|
42
|
-
return
|
42
|
+
function guildNavigation(guildID, type, roleID) {
|
43
|
+
return roleID && type === constants_1.GuildNavigationTypes.LinkedRoles
|
44
|
+
? `<${guildID}:${type}:${roleID}>`
|
45
|
+
: `<${guildID}:${type}>`;
|
43
46
|
}
|
44
47
|
exports.guildNavigation = guildNavigation;
|
package/dist/package.json
CHANGED