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.
Files changed (83) hide show
  1. package/README.md +4 -2
  2. package/dist/lib/Client.d.ts +62 -56
  3. package/dist/lib/Client.js +186 -185
  4. package/dist/lib/constants.d.ts +83 -72
  5. package/dist/lib/constants.js +86 -73
  6. package/dist/lib/gateway/Shard.d.ts +1 -1
  7. package/dist/lib/gateway/Shard.js +198 -175
  8. package/dist/lib/index.d.ts +1 -1
  9. package/dist/lib/index.js +1 -1
  10. package/dist/lib/rest/Endpoints.d.ts +1 -1
  11. package/dist/lib/rest/Endpoints.js +3 -3
  12. package/dist/lib/rest/RequestManager.d.ts +1 -1
  13. package/dist/lib/rest/RequestManager.js +1 -1
  14. package/dist/lib/rest/index.d.ts +0 -1
  15. package/dist/lib/rest/index.js +1 -2
  16. package/dist/lib/transformers/Applications.d.ts +8 -0
  17. package/dist/lib/transformers/Applications.js +211 -0
  18. package/dist/lib/transformers/AuditLogs.d.ts +7 -0
  19. package/dist/lib/transformers/AuditLogs.js +97 -0
  20. package/dist/lib/transformers/AutoModeration.d.ts +5 -0
  21. package/dist/lib/transformers/AutoModeration.js +64 -0
  22. package/dist/lib/transformers/Channels.d.ts +16 -0
  23. package/dist/lib/transformers/Channels.js +676 -0
  24. package/dist/lib/transformers/Emojis.d.ts +5 -0
  25. package/dist/lib/transformers/Emojis.js +31 -0
  26. package/dist/lib/transformers/Entitlements.d.ts +7 -0
  27. package/dist/lib/transformers/Entitlements.js +58 -0
  28. package/dist/lib/transformers/GuildScheduledEvents.d.ts +5 -0
  29. package/dist/lib/transformers/GuildScheduledEvents.js +51 -0
  30. package/dist/lib/transformers/GuildTemplates.d.ts +5 -0
  31. package/dist/lib/transformers/GuildTemplates.js +38 -0
  32. package/dist/lib/transformers/Guilds.d.ts +12 -0
  33. package/dist/lib/transformers/Guilds.js +248 -0
  34. package/dist/lib/transformers/Interactions.d.ts +10 -0
  35. package/dist/lib/transformers/Interactions.js +273 -0
  36. package/dist/lib/transformers/Invites.d.ts +5 -0
  37. package/dist/lib/transformers/Invites.js +79 -0
  38. package/dist/lib/transformers/Polls.d.ts +5 -0
  39. package/dist/lib/transformers/Polls.js +50 -0
  40. package/dist/lib/transformers/Presences.d.ts +8 -0
  41. package/dist/lib/transformers/Presences.js +108 -0
  42. package/dist/lib/transformers/Roles.d.ts +5 -0
  43. package/dist/lib/transformers/Roles.js +56 -0
  44. package/dist/lib/transformers/SKUs.d.ts +5 -0
  45. package/dist/lib/transformers/SKUs.js +26 -0
  46. package/dist/lib/transformers/StageInstances.d.ts +5 -0
  47. package/dist/lib/transformers/StageInstances.js +28 -0
  48. package/dist/lib/transformers/Stickers.d.ts +5 -0
  49. package/dist/lib/transformers/Stickers.js +41 -0
  50. package/dist/lib/transformers/Teams.d.ts +5 -0
  51. package/dist/lib/transformers/Teams.js +35 -0
  52. package/dist/lib/transformers/Users.d.ts +5 -0
  53. package/dist/lib/transformers/Users.js +48 -0
  54. package/dist/lib/transformers/Voice.d.ts +5 -0
  55. package/dist/lib/transformers/Voice.js +45 -0
  56. package/dist/lib/transformers/Webhooks.d.ts +5 -0
  57. package/dist/lib/transformers/Webhooks.js +51 -0
  58. package/dist/lib/transformers/index.d.ts +21 -0
  59. package/dist/lib/transformers/index.js +37 -0
  60. package/dist/lib/types/entitlements.d.ts +0 -6
  61. package/dist/lib/types/gateway-events.d.ts +21 -8
  62. package/dist/lib/types/interaction.d.ts +1 -1
  63. package/dist/lib/types/sku.d.ts +0 -12
  64. package/dist/lib/utils/Util.d.ts +1 -91
  65. package/dist/lib/utils/Util.js +2 -2167
  66. package/dist/lib/utils/errors.d.ts +3 -3
  67. package/dist/lib/utils/errors.js +6 -8
  68. package/dist/lib/utils/formatters.d.ts +9 -0
  69. package/dist/lib/utils/formatters.js +38 -0
  70. package/dist/lib/utils/index.d.ts +2 -0
  71. package/dist/lib/utils/index.js +15 -0
  72. package/dist/package.json +1 -1
  73. package/package.json +1 -1
  74. package/dist/lib/types/voice-connections.d.ts +0 -64
  75. package/dist/lib/types/voice-connections.js +0 -2
  76. package/dist/lib/voice/VoiceConnection.d.ts +0 -57
  77. package/dist/lib/voice/VoiceConnection.js +0 -150
  78. package/dist/lib/voice/VoiceConnectionManager.d.ts +0 -19
  79. package/dist/lib/voice/VoiceConnectionManager.js +0 -66
  80. package/dist/lib/voice/index.d.ts +0 -2
  81. package/dist/lib/voice/index.js +0 -18
  82. /package/dist/lib/{rest → utils}/CDN.d.ts +0 -0
  83. /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
- intents: GatewayIntents.All,
29
+ gateway: {
30
+ intents: GatewayIntents.All,
31
+ },
30
32
  });
31
33
 
32
34
  client.once("ready", () => {
33
- console.log(`${client.user.username} is now online!`);
35
+ console.log("Logged in as", client.user.username);
34
36
 
35
37
  client.createGlobalApplicationCommand(client.application.id, {
36
38
  name: "ping",
@@ -1,5 +1,5 @@
1
1
  /// <reference types="node" />
2
- import { GatewayIntents, type OAuth2Scopes, type ActionTypes, type ImageWidgetStyleOptions, InteractionCallbackType, 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 } from "./constants";
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, InteractionCallbackData } from "./types/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 { VoiceConnectionManager } from "./voice";
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
- voiceConnections: VoiceConnectionManager;
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?: string;
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?: string;
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: ApplicationCommandTypes;
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 | null;
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 | null;
259
- entityMetadata?: GuildScheduledEventEntityMetadata | null;
266
+ channelID?: snowflake;
267
+ entityMetadata?: GuildScheduledEventEntityMetadata;
260
268
  name: string;
261
269
  privacyLevel: GuildScheduledEventPrivacyLevel;
262
270
  scheduledStartTime: string;
263
- scheduledEndTime?: string | null;
264
- description?: string | null;
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 | null;
290
+ content?: string;
283
291
  tts?: boolean;
284
- embeds?: Array<Embed> | null;
285
- allowedMentions?: AllowedMentions | null;
286
- components?: Array<ActionRow> | null;
292
+ embeds?: Array<Embed>;
293
+ allowedMentions?: AllowedMentions;
294
+ components?: Array<ActionRow>;
287
295
  files?: Array<File> | null;
288
- attachments?: Array<Attachment> | null;
289
- flags?: MessageFlags | null;
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
- dmPermission?: boolean;
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 | null;
695
+ content?: string;
690
696
  username?: string;
691
697
  avatarURL?: string;
692
698
  tts?: boolean;
693
- embeds?: Array<Embed> | null;
694
- allowedMentions?: AllowedMentions | null;
695
- components?: Array<ActionRow> | null;
696
- files?: Array<File> | null;
697
- attachments?: Array<Attachment> | null;
698
- flags?: MessageFlags | null;
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<string>;
706
+ appliedTags?: Array<snowflake>;
701
707
  poll?: PollCreateParams;
702
- wait: boolean;
703
- threadID: snowflake;
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;