disgroove 2.2.2-dev.23938d8 → 2.2.2-dev.90b732e
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -2
- package/dist/lib/Client.d.ts +62 -56
- package/dist/lib/Client.js +186 -185
- package/dist/lib/constants.d.ts +83 -72
- package/dist/lib/constants.js +86 -73
- package/dist/lib/gateway/Shard.d.ts +1 -1
- package/dist/lib/gateway/Shard.js +198 -175
- package/dist/lib/index.d.ts +1 -1
- package/dist/lib/index.js +1 -1
- package/dist/lib/rest/Endpoints.d.ts +1 -1
- package/dist/lib/rest/Endpoints.js +3 -3
- package/dist/lib/rest/RequestManager.d.ts +1 -1
- package/dist/lib/rest/RequestManager.js +1 -1
- package/dist/lib/rest/index.d.ts +0 -1
- package/dist/lib/rest/index.js +1 -2
- package/dist/lib/transformers/Applications.d.ts +8 -0
- package/dist/lib/transformers/Applications.js +211 -0
- package/dist/lib/transformers/AuditLogs.d.ts +7 -0
- package/dist/lib/transformers/AuditLogs.js +97 -0
- package/dist/lib/transformers/AutoModeration.d.ts +5 -0
- package/dist/lib/transformers/AutoModeration.js +64 -0
- package/dist/lib/transformers/Channels.d.ts +16 -0
- package/dist/lib/transformers/Channels.js +676 -0
- package/dist/lib/transformers/Emojis.d.ts +5 -0
- package/dist/lib/transformers/Emojis.js +31 -0
- package/dist/lib/transformers/Entitlements.d.ts +7 -0
- package/dist/lib/transformers/Entitlements.js +58 -0
- package/dist/lib/transformers/GuildScheduledEvents.d.ts +5 -0
- package/dist/lib/transformers/GuildScheduledEvents.js +51 -0
- package/dist/lib/transformers/GuildTemplates.d.ts +5 -0
- package/dist/lib/transformers/GuildTemplates.js +38 -0
- package/dist/lib/transformers/Guilds.d.ts +12 -0
- package/dist/lib/transformers/Guilds.js +248 -0
- package/dist/lib/transformers/Interactions.d.ts +10 -0
- package/dist/lib/transformers/Interactions.js +273 -0
- package/dist/lib/transformers/Invites.d.ts +5 -0
- package/dist/lib/transformers/Invites.js +79 -0
- package/dist/lib/transformers/Polls.d.ts +5 -0
- package/dist/lib/transformers/Polls.js +50 -0
- package/dist/lib/transformers/Presences.d.ts +8 -0
- package/dist/lib/transformers/Presences.js +108 -0
- package/dist/lib/transformers/Roles.d.ts +5 -0
- package/dist/lib/transformers/Roles.js +56 -0
- package/dist/lib/transformers/SKUs.d.ts +5 -0
- package/dist/lib/transformers/SKUs.js +26 -0
- package/dist/lib/transformers/StageInstances.d.ts +5 -0
- package/dist/lib/transformers/StageInstances.js +28 -0
- package/dist/lib/transformers/Stickers.d.ts +5 -0
- package/dist/lib/transformers/Stickers.js +41 -0
- package/dist/lib/transformers/Teams.d.ts +5 -0
- package/dist/lib/transformers/Teams.js +35 -0
- package/dist/lib/transformers/Users.d.ts +5 -0
- package/dist/lib/transformers/Users.js +48 -0
- package/dist/lib/transformers/Voice.d.ts +5 -0
- package/dist/lib/transformers/Voice.js +45 -0
- package/dist/lib/transformers/Webhooks.d.ts +5 -0
- package/dist/lib/transformers/Webhooks.js +51 -0
- package/dist/lib/transformers/index.d.ts +21 -0
- package/dist/lib/transformers/index.js +37 -0
- package/dist/lib/types/entitlements.d.ts +0 -6
- package/dist/lib/types/gateway-events.d.ts +21 -8
- package/dist/lib/types/interaction.d.ts +1 -1
- package/dist/lib/types/sku.d.ts +0 -12
- package/dist/lib/utils/Util.d.ts +1 -91
- package/dist/lib/utils/Util.js +2 -2167
- package/dist/lib/utils/errors.d.ts +3 -3
- package/dist/lib/utils/errors.js +6 -8
- package/dist/lib/utils/formatters.d.ts +9 -0
- package/dist/lib/utils/formatters.js +38 -0
- package/dist/lib/utils/index.d.ts +2 -0
- package/dist/lib/utils/index.js +15 -0
- package/dist/package.json +1 -1
- package/package.json +1 -1
- package/dist/lib/types/voice-connections.d.ts +0 -64
- package/dist/lib/types/voice-connections.js +0 -2
- package/dist/lib/voice/VoiceConnection.d.ts +0 -57
- package/dist/lib/voice/VoiceConnection.js +0 -150
- package/dist/lib/voice/VoiceConnectionManager.d.ts +0 -19
- package/dist/lib/voice/VoiceConnectionManager.js +0 -66
- package/dist/lib/voice/index.d.ts +0 -2
- package/dist/lib/voice/index.js +0 -18
- /package/dist/lib/{rest → utils}/CDN.d.ts +0 -0
- /package/dist/lib/{rest → utils}/CDN.js +0 -0
package/README.md
CHANGED
@@ -26,11 +26,13 @@ const {
|
|
26
26
|
MessageFlags,
|
27
27
|
} = require("disgroove");
|
28
28
|
const client = new Client("B0t.T0k3N", {
|
29
|
-
|
29
|
+
gateway: {
|
30
|
+
intents: GatewayIntents.All,
|
31
|
+
},
|
30
32
|
});
|
31
33
|
|
32
34
|
client.once("ready", () => {
|
33
|
-
console.log(
|
35
|
+
console.log("Logged in as", client.user.username);
|
34
36
|
|
35
37
|
client.createGlobalApplicationCommand(client.application.id, {
|
36
38
|
name: "ping",
|
package/dist/lib/Client.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/// <reference types="node" />
|
2
|
-
import { GatewayIntents, type OAuth2Scopes, type ActionTypes, type ImageWidgetStyleOptions,
|
2
|
+
import { GatewayIntents, type OAuth2Scopes, type ActionTypes, type ImageWidgetStyleOptions, type MFALevel, type ReactionTypes, type ApplicationCommandTypes, type EventTypes, type TriggerTypes, type ChannelTypes, type VideoQualityModes, type SortOrderTypes, type ForumLayoutTypes, type InviteTargetTypes, type VerificationLevel, type DefaultMessageNotificationLevel, type ExplicitContentFilterLevel, type SystemChannelFlags, type ApplicationFlags, type ApplicationIntegrationTypes, type ChannelFlags, type GuildFeatures, type GuildScheduledEventEntityTypes, type GuildScheduledEventPrivacyLevel, type GuildScheduledEventStatus, type MessageFlags, type OnboardingMode, type PrivacyLevel, type GuildMemberFlags, type InteractionContextTypes } from "./constants";
|
3
3
|
import { Util } from "./utils";
|
4
4
|
import { RequestManager, type File } from "./rest";
|
5
5
|
import EventEmitter from "node:events";
|
@@ -17,7 +17,7 @@ import type { AutoModerationActionExecutionEventFields, ChannelPinsUpdateEventFi
|
|
17
17
|
import type { Guild, GuildMember, WelcomeScreen, GuildWidgetSettings, Ban, Integration, GuildOnboarding, GuildPreview, GuildWidget, UnavailableGuild, OnboardingPrompt, WelcomeScreenChannel } from "./types/guild";
|
18
18
|
import type { GuildScheduledEvent, GuildScheduledEventUser, GuildScheduledEventEntityMetadata } from "./types/guild-scheduled-event";
|
19
19
|
import type { GuildTemplate } from "./types/guild-template";
|
20
|
-
import type { Interaction,
|
20
|
+
import type { Interaction, InteractionResponse } from "./types/interaction";
|
21
21
|
import type { Invite } from "./types/invite";
|
22
22
|
import type { ActionRow } from "./types/message-components";
|
23
23
|
import type { PollCreateParams } from "./types/poll";
|
@@ -28,14 +28,23 @@ import type { Sticker, StickerPack } from "./types/sticker";
|
|
28
28
|
import type { User, ApplicationRoleConnection, Connection } from "./types/user";
|
29
29
|
import type { VoiceRegion, VoiceState } from "./types/voice";
|
30
30
|
import type { Webhook } from "./types/webhook";
|
31
|
-
import {
|
31
|
+
import type { ClientOptions as WebSocketOptions } from "ws";
|
32
32
|
export interface ClientOptions {
|
33
|
-
intents?: number | Array<number>;
|
34
33
|
shardsCount?: number | "auto";
|
35
34
|
auth?: "Bot" | "Bearer";
|
35
|
+
gateway?: {
|
36
|
+
intents?: number | Array<number>;
|
37
|
+
compress?: boolean;
|
38
|
+
largeThreshold?: number;
|
39
|
+
presence?: Partial<Pick<GatewayPresenceUpdate, "activities" | "status" | "afk">>;
|
40
|
+
};
|
41
|
+
ws?: WebSocketOptions;
|
36
42
|
}
|
37
43
|
export declare class Client extends EventEmitter {
|
38
44
|
token: string;
|
45
|
+
compress?: boolean;
|
46
|
+
largeThreshold?: number;
|
47
|
+
presence?: Partial<Pick<GatewayPresenceUpdate, "activities" | "status" | "afk">>;
|
39
48
|
intents: GatewayIntents | number;
|
40
49
|
shardsCount: number | "auto";
|
41
50
|
auth: "Bot" | "Bearer";
|
@@ -43,10 +52,10 @@ export declare class Client extends EventEmitter {
|
|
43
52
|
rest: RequestManager;
|
44
53
|
util: Util;
|
45
54
|
guildShardMap: Record<string, number>;
|
46
|
-
user: User;
|
55
|
+
user: User | null;
|
47
56
|
guilds: Map<string, Guild>;
|
48
|
-
application: Pick<Application, "id" | "flags"
|
49
|
-
|
57
|
+
application: Pick<Application, "id" | "flags"> | null;
|
58
|
+
ws?: WebSocketOptions;
|
50
59
|
constructor(token: string, options?: ClientOptions);
|
51
60
|
/** https://discord.com/developers/docs/resources/channel#group-dm-add-recipient */
|
52
61
|
addGroupRecipient(channelID: snowflake, userID: snowflake, options: {
|
@@ -70,7 +79,6 @@ export declare class Client extends EventEmitter {
|
|
70
79
|
days: number;
|
71
80
|
computePruneCount: boolean;
|
72
81
|
includeRoles: Array<snowflake>;
|
73
|
-
reason?: string;
|
74
82
|
}, reason?: string): Promise<{
|
75
83
|
pruned: number;
|
76
84
|
}>;
|
@@ -91,12 +99,13 @@ export declare class Client extends EventEmitter {
|
|
91
99
|
id?: snowflake;
|
92
100
|
name: string;
|
93
101
|
nameLocalizations?: LocaleMap | null;
|
94
|
-
description
|
102
|
+
description: string;
|
95
103
|
descriptionLocalizations?: LocaleMap | null;
|
96
104
|
options?: Array<ApplicationCommandOption>;
|
97
105
|
defaultMemberPermissions?: string | null;
|
98
|
-
dmPermission?: boolean;
|
99
106
|
defaultPermission?: boolean | null;
|
107
|
+
integrationTypes: Array<ApplicationIntegrationTypes>;
|
108
|
+
contexts: Array<InteractionContextTypes>;
|
100
109
|
type?: ApplicationCommandTypes;
|
101
110
|
nsfw?: boolean;
|
102
111
|
}>): Promise<Array<ApplicationCommand>>;
|
@@ -105,13 +114,12 @@ export declare class Client extends EventEmitter {
|
|
105
114
|
id?: snowflake;
|
106
115
|
name: string;
|
107
116
|
nameLocalizations?: LocaleMap | null;
|
108
|
-
description
|
117
|
+
description: string;
|
109
118
|
descriptionLocalizations?: LocaleMap | null;
|
110
119
|
options?: Array<ApplicationCommandOption>;
|
111
120
|
defaultMemberPermissions?: string | null;
|
112
|
-
dmPermission?: boolean;
|
113
121
|
defaultPermission?: boolean | null;
|
114
|
-
type
|
122
|
+
type?: ApplicationCommandTypes;
|
115
123
|
nsfw?: boolean;
|
116
124
|
}>): Promise<Array<ApplicationCommand>>;
|
117
125
|
/** https://discord.com/developers/docs/topics/gateway#connections */
|
@@ -131,24 +139,24 @@ export declare class Client extends EventEmitter {
|
|
131
139
|
}, reason?: string): Promise<AutoModerationRule>;
|
132
140
|
/** https://discord.com/developers/docs/resources/guild#create-guild-channel */
|
133
141
|
createChannel(guildID: snowflake, options: {
|
134
|
-
name: string
|
135
|
-
type?: ChannelTypes;
|
142
|
+
name: string;
|
143
|
+
type?: ChannelTypes | null;
|
136
144
|
topic?: string | null;
|
137
|
-
bitrate?: number;
|
138
|
-
userLimit?: number;
|
139
|
-
rateLimitPerUser?: number;
|
140
|
-
position?: number;
|
145
|
+
bitrate?: number | null;
|
146
|
+
userLimit?: number | null;
|
147
|
+
rateLimitPerUser?: number | null;
|
148
|
+
position?: number | null;
|
141
149
|
permissionOverwrites?: Array<Overwrite>;
|
142
150
|
parentID?: snowflake | null;
|
143
|
-
nsfw?: boolean;
|
151
|
+
nsfw?: boolean | null;
|
144
152
|
rtcRegion?: string | null;
|
145
|
-
videoQualityMode?: VideoQualityModes;
|
146
|
-
defaultAutoArchiveDuration?: number;
|
153
|
+
videoQualityMode?: VideoQualityModes | null;
|
154
|
+
defaultAutoArchiveDuration?: number | null;
|
147
155
|
defaultReactionEmoji?: DefaultReaction | null;
|
148
|
-
availableTags?: Array<ForumTag
|
156
|
+
availableTags?: Array<ForumTag> | null;
|
149
157
|
defaultSortOrder?: SortOrderTypes | null;
|
150
|
-
defaultForumLayout?: ForumLayoutTypes;
|
151
|
-
defaultThreadRateLimitPerUser?: number;
|
158
|
+
defaultForumLayout?: ForumLayoutTypes | null;
|
159
|
+
defaultThreadRateLimitPerUser?: number | null;
|
152
160
|
}, reason?: string): Promise<Channel>;
|
153
161
|
/** https://discord.com/developers/docs/resources/channel#create-channel-invite */
|
154
162
|
createChannelInvite(channelID: snowflake, options: {
|
@@ -177,8 +185,9 @@ export declare class Client extends EventEmitter {
|
|
177
185
|
descriptionLocalizations?: LocaleMap | null;
|
178
186
|
options?: Array<ApplicationCommandOption>;
|
179
187
|
defaultMemberPermissions?: string | null;
|
180
|
-
dmPermission?: boolean;
|
181
188
|
defaultPermission?: boolean | null;
|
189
|
+
integrationTypes?: Array<ApplicationIntegrationTypes>;
|
190
|
+
contexts?: Array<InteractionContextTypes>;
|
182
191
|
type?: ApplicationCommandTypes;
|
183
192
|
nsfw?: boolean;
|
184
193
|
}): Promise<ApplicationCommand>;
|
@@ -190,7 +199,6 @@ export declare class Client extends EventEmitter {
|
|
190
199
|
/** https://discord.com/developers/docs/resources/guild#create-guild */
|
191
200
|
createGuild(options: {
|
192
201
|
name: string;
|
193
|
-
region?: string | null;
|
194
202
|
icon?: string;
|
195
203
|
verificationLevel?: VerificationLevel;
|
196
204
|
defaultMessageNotifications?: DefaultMessageNotificationLevel;
|
@@ -255,13 +263,13 @@ export declare class Client extends EventEmitter {
|
|
255
263
|
}, reason?: string): Promise<Role>;
|
256
264
|
/** https://discord.com/developers/docs/resources/guild-scheduled-event#create-guild-scheduled-event */
|
257
265
|
createGuildScheduledEvent(guildID: snowflake, options: {
|
258
|
-
channelID?: snowflake
|
259
|
-
entityMetadata?: GuildScheduledEventEntityMetadata
|
266
|
+
channelID?: snowflake;
|
267
|
+
entityMetadata?: GuildScheduledEventEntityMetadata;
|
260
268
|
name: string;
|
261
269
|
privacyLevel: GuildScheduledEventPrivacyLevel;
|
262
270
|
scheduledStartTime: string;
|
263
|
-
scheduledEndTime?: string
|
264
|
-
description?: string
|
271
|
+
scheduledEndTime?: string;
|
272
|
+
description?: string;
|
265
273
|
entityType: GuildScheduledEventEntityTypes;
|
266
274
|
image?: string;
|
267
275
|
}, reason?: string): Promise<GuildScheduledEvent>;
|
@@ -279,23 +287,20 @@ export declare class Client extends EventEmitter {
|
|
279
287
|
}): Promise<GuildTemplate>;
|
280
288
|
/** https://discord.com/developers/docs/interactions/receiving-and-responding#create-followup-message */
|
281
289
|
createInteractionFollowupMessage(applicationID: snowflake, interactionToken: string, options: {
|
282
|
-
content?: string
|
290
|
+
content?: string;
|
283
291
|
tts?: boolean;
|
284
|
-
embeds?: Array<Embed
|
285
|
-
allowedMentions?: AllowedMentions
|
286
|
-
components?: Array<ActionRow
|
292
|
+
embeds?: Array<Embed>;
|
293
|
+
allowedMentions?: AllowedMentions;
|
294
|
+
components?: Array<ActionRow>;
|
287
295
|
files?: Array<File> | null;
|
288
|
-
attachments?: Array<Attachment
|
289
|
-
flags?: MessageFlags
|
296
|
+
attachments?: Array<Pick<Attachment, "filename" | "description">>;
|
297
|
+
flags?: MessageFlags;
|
290
298
|
threadName?: string;
|
291
299
|
appliedTags?: Array<string>;
|
292
300
|
poll?: PollCreateParams;
|
293
301
|
}): Promise<Message>;
|
294
302
|
/** https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response */
|
295
|
-
createInteractionResponse(interactionID: snowflake, interactionToken: string, options:
|
296
|
-
type: InteractionCallbackType;
|
297
|
-
data?: InteractionCallbackData;
|
298
|
-
}): void;
|
303
|
+
createInteractionResponse(interactionID: snowflake, interactionToken: string, options: InteractionResponse): void;
|
299
304
|
/** https://discord.com/developers/docs/resources/channel#create-message */
|
300
305
|
createMessage(channelID: snowflake, options: {
|
301
306
|
content?: string;
|
@@ -307,7 +312,7 @@ export declare class Client extends EventEmitter {
|
|
307
312
|
components?: Array<ActionRow>;
|
308
313
|
stickersIDs?: Array<snowflake>;
|
309
314
|
files?: Array<File>;
|
310
|
-
attachments?: Array<Attachment
|
315
|
+
attachments?: Array<Pick<Attachment, "filename" | "description">>;
|
311
316
|
flags?: MessageFlags;
|
312
317
|
enforceNonce?: boolean;
|
313
318
|
poll?: PollCreateParams;
|
@@ -489,8 +494,8 @@ export declare class Client extends EventEmitter {
|
|
489
494
|
installParams?: InstallParams;
|
490
495
|
integrationTypesConfig?: Record<ApplicationIntegrationTypes, ApplicationIntegrationTypeConfiguration>;
|
491
496
|
flags?: ApplicationFlags;
|
492
|
-
icon?: string;
|
493
|
-
coverImage?: string;
|
497
|
+
icon?: string | null;
|
498
|
+
coverImage?: string | null;
|
494
499
|
interactionsEndpointURL?: string;
|
495
500
|
tags?: Array<string>;
|
496
501
|
}): Promise<Application>;
|
@@ -503,7 +508,8 @@ export declare class Client extends EventEmitter {
|
|
503
508
|
options?: Array<ApplicationCommandOption>;
|
504
509
|
defaultMemberPermissions?: string | null;
|
505
510
|
defaultPermission?: boolean | null;
|
506
|
-
|
511
|
+
integrationTypes?: Array<ApplicationIntegrationTypes>;
|
512
|
+
contexts?: Array<InteractionContextTypes>;
|
507
513
|
nsfw?: boolean;
|
508
514
|
}): Promise<ApplicationCommand>;
|
509
515
|
/** https://discord.com/developers/docs/resources/guild#modify-guild */
|
@@ -686,21 +692,21 @@ export declare class Client extends EventEmitter {
|
|
686
692
|
endPoll(channelID: snowflake, messageID: snowflake): Promise<Message>;
|
687
693
|
/** https://discord.com/developers/docs/resources/webhook#execute-webhook */
|
688
694
|
executeWebhook(webhookID: snowflake, webhookToken: string, options: {
|
689
|
-
content?: string
|
695
|
+
content?: string;
|
690
696
|
username?: string;
|
691
697
|
avatarURL?: string;
|
692
698
|
tts?: boolean;
|
693
|
-
embeds?: Array<Embed
|
694
|
-
allowedMentions?: AllowedMentions
|
695
|
-
components?: Array<ActionRow
|
696
|
-
files?: Array<File
|
697
|
-
attachments?: Array<Attachment
|
698
|
-
flags?: MessageFlags
|
699
|
+
embeds?: Array<Embed>;
|
700
|
+
allowedMentions?: AllowedMentions;
|
701
|
+
components?: Array<ActionRow>;
|
702
|
+
files?: Array<File>;
|
703
|
+
attachments?: Array<Pick<Attachment, "filename" | "description">>;
|
704
|
+
flags?: MessageFlags;
|
699
705
|
threadName?: string;
|
700
|
-
appliedTags?: Array<
|
706
|
+
appliedTags?: Array<snowflake>;
|
701
707
|
poll?: PollCreateParams;
|
702
|
-
wait
|
703
|
-
threadID
|
708
|
+
wait?: boolean;
|
709
|
+
threadID?: snowflake;
|
704
710
|
}): Promise<Message | null>;
|
705
711
|
/**
|
706
712
|
* https://discord.com/developers/docs/resources/webhook#execute-githubcompatible-webhook
|
@@ -1003,7 +1009,7 @@ export declare class Client extends EventEmitter {
|
|
1003
1009
|
/** https://discord.com/developers/docs/resources/application-role-connection-metadata#update-application-role-connection-metadata-records */
|
1004
1010
|
updateApplicationRoleConnectionMetadataRecords(applicationID: snowflake): Promise<Array<ApplicationRoleConnectionMetadata>>;
|
1005
1011
|
/** https://discord.com/developers/docs/resources/user#update-current-user-application-role-connection */
|
1006
|
-
updateCurrentApplicationRoleConnection(options: {
|
1012
|
+
updateCurrentApplicationRoleConnection(applicationID: snowflake, options: {
|
1007
1013
|
platformName?: string;
|
1008
1014
|
platformUsername?: string;
|
1009
1015
|
metadata?: ApplicationRoleConnectionMetadata;
|