disgroove 2.2.2-dev.db6cb16 → 2.2.3-dev.4f98e3d

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 (91) hide show
  1. package/README.md +5 -9
  2. package/dist/lib/Client.d.ts +116 -126
  3. package/dist/lib/Client.js +360 -267
  4. package/dist/lib/constants.d.ts +85 -74
  5. package/dist/lib/constants.js +88 -75
  6. package/dist/lib/gateway/Shard.d.ts +1 -0
  7. package/dist/lib/gateway/Shard.js +194 -170
  8. package/dist/lib/index.d.ts +1 -0
  9. package/dist/lib/index.js +1 -0
  10. package/dist/lib/rest/Endpoints.d.ts +6 -6
  11. package/dist/lib/rest/Endpoints.js +13 -13
  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/ApplicationCommands.d.ts +7 -0
  17. package/dist/lib/transformers/ApplicationCommands.js +90 -0
  18. package/dist/lib/transformers/ApplicationRoleConnectionMetadatas.d.ts +5 -0
  19. package/dist/lib/transformers/ApplicationRoleConnectionMetadatas.js +26 -0
  20. package/dist/lib/transformers/Applications.d.ts +5 -0
  21. package/dist/lib/transformers/Applications.js +97 -0
  22. package/dist/lib/transformers/AuditLogs.d.ts +7 -0
  23. package/dist/lib/transformers/AuditLogs.js +97 -0
  24. package/dist/lib/transformers/AutoModeration.d.ts +9 -0
  25. package/dist/lib/transformers/AutoModeration.js +76 -0
  26. package/dist/lib/transformers/Channels.d.ts +16 -0
  27. package/dist/lib/transformers/Channels.js +676 -0
  28. package/dist/lib/transformers/Emojis.d.ts +5 -0
  29. package/dist/lib/transformers/Emojis.js +31 -0
  30. package/dist/lib/transformers/Entitlements.d.ts +7 -0
  31. package/dist/lib/transformers/Entitlements.js +58 -0
  32. package/dist/lib/transformers/GuildScheduledEvents.d.ts +5 -0
  33. package/dist/lib/transformers/GuildScheduledEvents.js +51 -0
  34. package/dist/lib/transformers/GuildTemplates.d.ts +5 -0
  35. package/dist/lib/transformers/GuildTemplates.js +38 -0
  36. package/dist/lib/transformers/Guilds.d.ts +12 -0
  37. package/dist/lib/transformers/Guilds.js +264 -0
  38. package/dist/lib/transformers/Interactions.d.ts +10 -0
  39. package/dist/lib/transformers/Interactions.js +273 -0
  40. package/dist/lib/transformers/Invites.d.ts +5 -0
  41. package/dist/lib/transformers/Invites.js +79 -0
  42. package/dist/lib/transformers/Polls.d.ts +5 -0
  43. package/dist/lib/transformers/Polls.js +50 -0
  44. package/dist/lib/transformers/Presences.d.ts +5 -0
  45. package/dist/lib/transformers/Presences.js +116 -0
  46. package/dist/lib/transformers/Roles.d.ts +5 -0
  47. package/dist/lib/transformers/Roles.js +56 -0
  48. package/dist/lib/transformers/SKUs.d.ts +5 -0
  49. package/dist/lib/transformers/SKUs.js +26 -0
  50. package/dist/lib/transformers/StageInstances.d.ts +5 -0
  51. package/dist/lib/transformers/StageInstances.js +28 -0
  52. package/dist/lib/transformers/Stickers.d.ts +5 -0
  53. package/dist/lib/transformers/Stickers.js +41 -0
  54. package/dist/lib/transformers/Teams.d.ts +5 -0
  55. package/dist/lib/transformers/Teams.js +35 -0
  56. package/dist/lib/transformers/Users.d.ts +5 -0
  57. package/dist/lib/transformers/Users.js +62 -0
  58. package/dist/lib/transformers/Voice.d.ts +5 -0
  59. package/dist/lib/transformers/Voice.js +45 -0
  60. package/dist/lib/transformers/Webhooks.d.ts +5 -0
  61. package/dist/lib/transformers/Webhooks.js +51 -0
  62. package/dist/lib/transformers/index.d.ts +23 -0
  63. package/dist/lib/transformers/index.js +39 -0
  64. package/dist/lib/types/entitlements.d.ts +0 -6
  65. package/dist/lib/types/gateway-events.d.ts +21 -8
  66. package/dist/lib/types/guild.d.ts +3 -1
  67. package/dist/lib/types/interaction.d.ts +2 -2
  68. package/dist/lib/types/sku.d.ts +0 -12
  69. package/dist/lib/types/user.d.ts +2 -2
  70. package/dist/lib/utils/CDN.d.ts +24 -0
  71. package/dist/lib/utils/CDN.js +49 -0
  72. package/dist/lib/utils/errors.d.ts +3 -3
  73. package/dist/lib/utils/errors.js +10 -12
  74. package/dist/lib/utils/formatters.d.ts +16 -0
  75. package/dist/lib/utils/formatters.js +44 -0
  76. package/dist/lib/utils/index.d.ts +2 -1
  77. package/dist/lib/utils/index.js +15 -1
  78. package/dist/package.json +3 -3
  79. package/package.json +3 -3
  80. package/dist/lib/rest/CDN.d.ts +0 -22
  81. package/dist/lib/rest/CDN.js +0 -45
  82. package/dist/lib/types/voice-connections.d.ts +0 -64
  83. package/dist/lib/types/voice-connections.js +0 -2
  84. package/dist/lib/utils/Util.d.ts +0 -94
  85. package/dist/lib/utils/Util.js +0 -2228
  86. package/dist/lib/voice/VoiceConnection.d.ts +0 -57
  87. package/dist/lib/voice/VoiceConnection.js +0 -150
  88. package/dist/lib/voice/VoiceConnectionManager.d.ts +0 -19
  89. package/dist/lib/voice/VoiceConnectionManager.js +0 -66
  90. package/dist/lib/voice/index.d.ts +0 -2
  91. package/dist/lib/voice/index.js +0 -18
package/README.md CHANGED
@@ -9,13 +9,13 @@ A module to interface with Discord
9
9
 
10
10
  ## Installation
11
11
 
12
- [**NodeJS v18**](https://nodejs.org) or newer required
12
+ [**Node.js v18**](https://nodejs.org) or newer required
13
13
 
14
14
  ```
15
15
  npm install disgroove
16
16
  ```
17
17
 
18
- #### Example
18
+ ## Example
19
19
 
20
20
  ```js
21
21
  const {
@@ -25,18 +25,14 @@ const {
25
25
  InteractionCallbackType,
26
26
  MessageFlags,
27
27
  } = require("disgroove");
28
- const client = new Client("B0t.T0k3N", {
29
- gateway: {
30
- intents: GatewayIntents.All,
31
- },
32
- });
28
+ const client = new Client("B0t.T0k3N");
33
29
 
34
30
  client.once("ready", () => {
35
- console.log(`${client.user.username} is now online!`);
31
+ console.log("Logged in as", client.user.username);
36
32
 
37
33
  client.createGlobalApplicationCommand(client.application.id, {
38
34
  name: "ping",
39
- description: "Responds with Pong! 🏓",
35
+ description: "Pong!",
40
36
  });
41
37
  });
42
38
 
@@ -1,11 +1,10 @@
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";
3
- import { Util } from "./utils";
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";
4
3
  import { RequestManager, type File } from "./rest";
5
4
  import EventEmitter from "node:events";
6
5
  import { ShardManager } from "./gateway";
7
6
  import type { Application, ApplicationIntegrationTypeConfiguration, InstallParams } from "./types/application";
8
- import type { ApplicationCommand, GuildApplicationCommandPermissions, ApplicationCommandOption } from "./types/application-command";
7
+ import type { ApplicationCommand, GuildApplicationCommandPermissions, ApplicationCommandOption, ApplicationCommandPermission } from "./types/application-command";
9
8
  import type { ApplicationRoleConnectionMetadata } from "./types/application-role-connection-metadata";
10
9
  import type { AuditLog, AuditLogEntry } from "./types/audit-log";
11
10
  import type { AutoModerationRule, TriggerMetadata, AutoModerationAction } from "./types/auto-moderation";
@@ -13,11 +12,11 @@ import type { Channel, Message, FollowedChannel, ThreadMember, Overwrite, Defaul
13
12
  import type { LocaleMap, snowflake, timestamp } from "./types/common";
14
13
  import type { Emoji } from "./types/emoji";
15
14
  import type { Entitlement } from "./types/entitlements";
16
- import type { AutoModerationActionExecutionEventFields, ChannelPinsUpdateEventFields, ThreadListSyncEventFields, ThreadMemberUpdateEventExtraFields, ThreadMembersUpdateEventFields, GuildCreateEventExtraFields, GuildAuditLogEntryCreateExtraFields, GuildBanAddEventFields, GuildBanRemoveEventFields, GuildMemberAddEventExtraFields, GuildMemberRemoveEventFields, GuildMemberUpdateEventFields, GuildMembersChunkEventFields, IntegrationCreateEventExtraFields, IntegrationUpdateEventExtraFields, IntegrationDeleteEventFields, InviteCreateEventFields, InviteDeleteEventFields, MessageCreateEventExtraFields, MessageDeleteEventFields, MessageDeleteBulkEventFields, MessageReactionAddEventFields, MessageReactionRemoveEventFields, MessageReactionRemoveAllEventFields, MessageReactionRemoveEmojiEventFields, PresenceUpdateEventFields, TypingStartEventFields, VoiceServerUpdateEventFields, MessagePollVoteAddFields, MessagePollVoteRemoveFields, GatewayPresenceUpdate, RawPayload } from "./types/gateway-events";
15
+ import type { AutoModerationActionExecutionEventFields, ChannelPinsUpdateEventFields, ThreadListSyncEventFields, ThreadMemberUpdateEventExtraFields, ThreadMembersUpdateEventFields, GuildCreateEventExtraFields, GuildAuditLogEntryCreateExtraFields, GuildBanAddEventFields, GuildBanRemoveEventFields, GuildMemberAddEventExtraFields, GuildMemberRemoveEventFields, GuildMemberUpdateEventFields, GuildMembersChunkEventFields, IntegrationCreateEventExtraFields, IntegrationUpdateEventExtraFields, IntegrationDeleteEventFields, InviteCreateEventFields, InviteDeleteEventFields, MessageCreateEventExtraFields, MessageDeleteEventFields, MessageDeleteBulkEventFields, MessageReactionAddEventFields, MessageReactionRemoveEventFields, MessageReactionRemoveAllEventFields, MessageReactionRemoveEmojiEventFields, PresenceUpdateEventFields, TypingStartEventFields, VoiceServerUpdateEventFields, MessagePollVoteAddFields, MessagePollVoteRemoveFields, GatewayPresenceUpdate, RawPayload, IdentifyConnectionProperties } from "./types/gateway-events";
17
16
  import type { Guild, GuildMember, WelcomeScreen, GuildWidgetSettings, Ban, Integration, GuildOnboarding, GuildPreview, GuildWidget, UnavailableGuild, OnboardingPrompt, WelcomeScreenChannel } from "./types/guild";
18
17
  import type { GuildScheduledEvent, GuildScheduledEventUser, GuildScheduledEventEntityMetadata } from "./types/guild-scheduled-event";
19
18
  import type { GuildTemplate } from "./types/guild-template";
20
- import type { Interaction, InteractionCallbackData } from "./types/interaction";
19
+ import type { Interaction, InteractionResponse } from "./types/interaction";
21
20
  import type { Invite } from "./types/invite";
22
21
  import type { ActionRow } from "./types/message-components";
23
22
  import type { PollCreateParams } from "./types/poll";
@@ -29,19 +28,22 @@ import type { User, ApplicationRoleConnection, Connection } from "./types/user";
29
28
  import type { VoiceRegion, VoiceState } from "./types/voice";
30
29
  import type { Webhook } from "./types/webhook";
31
30
  import type { ClientOptions as WebSocketOptions } from "ws";
31
+ export interface GatewayOptions {
32
+ properties?: IdentifyConnectionProperties;
33
+ compress?: boolean;
34
+ largeThreshold?: number;
35
+ presence?: Partial<Pick<GatewayPresenceUpdate, "activities" | "status" | "afk">>;
36
+ intents?: number | Array<number>;
37
+ }
32
38
  export interface ClientOptions {
33
39
  shardsCount?: number | "auto";
34
40
  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
+ gateway?: GatewayOptions;
41
42
  ws?: WebSocketOptions;
42
43
  }
43
44
  export declare class Client extends EventEmitter {
44
45
  token: string;
46
+ properties?: IdentifyConnectionProperties;
45
47
  compress?: boolean;
46
48
  largeThreshold?: number;
47
49
  presence?: Partial<Pick<GatewayPresenceUpdate, "activities" | "status" | "afk">>;
@@ -50,7 +52,6 @@ export declare class Client extends EventEmitter {
50
52
  auth: "Bot" | "Bearer";
51
53
  shards: ShardManager;
52
54
  rest: RequestManager;
53
- util: Util;
54
55
  guildShardMap: Record<string, number>;
55
56
  user: User | null;
56
57
  guilds: Map<string, Guild>;
@@ -99,12 +100,12 @@ export declare class Client extends EventEmitter {
99
100
  id?: snowflake;
100
101
  name: string;
101
102
  nameLocalizations?: LocaleMap | null;
102
- description?: string;
103
+ description: string;
103
104
  descriptionLocalizations?: LocaleMap | null;
104
105
  options?: Array<ApplicationCommandOption>;
105
106
  defaultMemberPermissions?: string | null;
106
- dmPermission?: boolean;
107
- defaultPermission?: boolean | null;
107
+ integrationTypes: Array<ApplicationIntegrationTypes>;
108
+ contexts: Array<InteractionContextTypes>;
108
109
  type?: ApplicationCommandTypes;
109
110
  nsfw?: boolean;
110
111
  }>): Promise<Array<ApplicationCommand>>;
@@ -113,13 +114,11 @@ export declare class Client extends EventEmitter {
113
114
  id?: snowflake;
114
115
  name: string;
115
116
  nameLocalizations?: LocaleMap | null;
116
- description?: string;
117
+ description: string;
117
118
  descriptionLocalizations?: LocaleMap | null;
118
119
  options?: Array<ApplicationCommandOption>;
119
120
  defaultMemberPermissions?: string | null;
120
- dmPermission?: boolean;
121
- defaultPermission?: boolean | null;
122
- type: ApplicationCommandTypes;
121
+ type?: ApplicationCommandTypes;
123
122
  nsfw?: boolean;
124
123
  }>): Promise<Array<ApplicationCommand>>;
125
124
  /** https://discord.com/developers/docs/topics/gateway#connections */
@@ -134,29 +133,29 @@ export declare class Client extends EventEmitter {
134
133
  triggerMetadata?: TriggerMetadata;
135
134
  actions: Array<AutoModerationAction>;
136
135
  enabled?: boolean;
137
- exemptRoles?: Array<string>;
138
- exemptChannels?: Array<string>;
136
+ exemptRoles?: Array<snowflake>;
137
+ exemptChannels?: Array<snowflake>;
139
138
  }, reason?: string): Promise<AutoModerationRule>;
140
139
  /** https://discord.com/developers/docs/resources/guild#create-guild-channel */
141
140
  createChannel(guildID: snowflake, options: {
142
- name: string | null;
143
- type?: ChannelTypes;
141
+ name: string;
142
+ type?: ChannelTypes | null;
144
143
  topic?: string | null;
145
- bitrate?: number;
146
- userLimit?: number;
147
- rateLimitPerUser?: number;
148
- position?: number;
149
- permissionOverwrites?: Array<Overwrite>;
144
+ bitrate?: number | null;
145
+ userLimit?: number | null;
146
+ rateLimitPerUser?: number | null;
147
+ position?: number | null;
148
+ permissionOverwrites?: Array<Pick<Overwrite, "id" | "type"> & Partial<Overwrite>> | null;
150
149
  parentID?: snowflake | null;
151
- nsfw?: boolean;
150
+ nsfw?: boolean | null;
152
151
  rtcRegion?: string | null;
153
- videoQualityMode?: VideoQualityModes;
154
- defaultAutoArchiveDuration?: number;
152
+ videoQualityMode?: VideoQualityModes | null;
153
+ defaultAutoArchiveDuration?: number | null;
155
154
  defaultReactionEmoji?: DefaultReaction | null;
156
- availableTags?: Array<ForumTag>;
155
+ availableTags?: Array<ForumTag> | null;
157
156
  defaultSortOrder?: SortOrderTypes | null;
158
- defaultForumLayout?: ForumLayoutTypes;
159
- defaultThreadRateLimitPerUser?: number;
157
+ defaultForumLayout?: ForumLayoutTypes | null;
158
+ defaultThreadRateLimitPerUser?: number | null;
160
159
  }, reason?: string): Promise<Channel>;
161
160
  /** https://discord.com/developers/docs/resources/channel#create-channel-invite */
162
161
  createChannelInvite(channelID: snowflake, options: {
@@ -185,20 +184,19 @@ export declare class Client extends EventEmitter {
185
184
  descriptionLocalizations?: LocaleMap | null;
186
185
  options?: Array<ApplicationCommandOption>;
187
186
  defaultMemberPermissions?: string | null;
188
- dmPermission?: boolean;
189
- defaultPermission?: boolean | null;
187
+ integrationTypes?: Array<ApplicationIntegrationTypes>;
188
+ contexts?: Array<InteractionContextTypes>;
190
189
  type?: ApplicationCommandTypes;
191
190
  nsfw?: boolean;
192
191
  }): Promise<ApplicationCommand>;
193
192
  /** https://discord.com/developers/docs/resources/user#create-group-dm */
194
- createGroupDM(options: {
193
+ createGroup(options: {
195
194
  accessTokens: Array<string>;
196
195
  nicks: Array<string>;
197
196
  }): Promise<Channel>;
198
197
  /** https://discord.com/developers/docs/resources/guild#create-guild */
199
198
  createGuild(options: {
200
199
  name: string;
201
- region?: string | null;
202
200
  icon?: string;
203
201
  verificationLevel?: VerificationLevel;
204
202
  defaultMessageNotifications?: DefaultMessageNotificationLevel;
@@ -231,7 +229,6 @@ export declare class Client extends EventEmitter {
231
229
  descriptionLocalizations?: LocaleMap | null;
232
230
  options?: Array<ApplicationCommandOption>;
233
231
  defaultMemberPermissions?: string | null;
234
- defaultPermission?: boolean | null;
235
232
  type?: ApplicationCommandTypes;
236
233
  nsfw?: boolean;
237
234
  }): Promise<ApplicationCommand>;
@@ -263,13 +260,13 @@ export declare class Client extends EventEmitter {
263
260
  }, reason?: string): Promise<Role>;
264
261
  /** https://discord.com/developers/docs/resources/guild-scheduled-event#create-guild-scheduled-event */
265
262
  createGuildScheduledEvent(guildID: snowflake, options: {
266
- channelID?: snowflake | null;
267
- entityMetadata?: GuildScheduledEventEntityMetadata | null;
263
+ channelID?: snowflake;
264
+ entityMetadata?: GuildScheduledEventEntityMetadata;
268
265
  name: string;
269
266
  privacyLevel: GuildScheduledEventPrivacyLevel;
270
267
  scheduledStartTime: string;
271
- scheduledEndTime?: string | null;
272
- description?: string | null;
268
+ scheduledEndTime?: string;
269
+ description?: string;
273
270
  entityType: GuildScheduledEventEntityTypes;
274
271
  image?: string;
275
272
  }, reason?: string): Promise<GuildScheduledEvent>;
@@ -287,23 +284,20 @@ export declare class Client extends EventEmitter {
287
284
  }): Promise<GuildTemplate>;
288
285
  /** https://discord.com/developers/docs/interactions/receiving-and-responding#create-followup-message */
289
286
  createInteractionFollowupMessage(applicationID: snowflake, interactionToken: string, options: {
290
- content?: string | null;
287
+ content?: string;
291
288
  tts?: boolean;
292
- embeds?: Array<Embed> | null;
293
- allowedMentions?: AllowedMentions | null;
294
- components?: Array<ActionRow> | null;
289
+ embeds?: Array<Embed>;
290
+ allowedMentions?: AllowedMentions;
291
+ components?: Array<ActionRow>;
295
292
  files?: Array<File> | null;
296
- attachments?: Array<Attachment> | null;
297
- flags?: MessageFlags | null;
293
+ attachments?: Array<Pick<Attachment, "filename" | "description">>;
294
+ flags?: MessageFlags;
298
295
  threadName?: string;
299
296
  appliedTags?: Array<string>;
300
297
  poll?: PollCreateParams;
301
298
  }): Promise<Message>;
302
299
  /** https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response */
303
- createInteractionResponse(interactionID: snowflake, interactionToken: string, options: {
304
- type: InteractionCallbackType;
305
- data?: InteractionCallbackData;
306
- }): void;
300
+ createInteractionResponse(interactionID: snowflake, interactionToken: string, options: InteractionResponse): void;
307
301
  /** https://discord.com/developers/docs/resources/channel#create-message */
308
302
  createMessage(channelID: snowflake, options: {
309
303
  content?: string;
@@ -315,7 +309,7 @@ export declare class Client extends EventEmitter {
315
309
  components?: Array<ActionRow>;
316
310
  stickersIDs?: Array<snowflake>;
317
311
  files?: Array<File>;
318
- attachments?: Array<Attachment>;
312
+ attachments?: Array<Pick<Attachment, "filename" | "description">>;
319
313
  flags?: MessageFlags;
320
314
  enforceNonce?: boolean;
321
315
  poll?: PollCreateParams;
@@ -342,15 +336,16 @@ export declare class Client extends EventEmitter {
342
336
  autoArchiveDuration?: number;
343
337
  rateLimitPerUser?: number | null;
344
338
  message: {
345
- content?: string | null;
346
- embeds?: Array<Embed> | null;
347
- allowedMentions?: AllowedMentions | null;
348
- components?: Array<ActionRow> | null;
349
- attachments?: Array<Attachment> | null;
350
- flags?: MessageFlags | null;
339
+ content?: string;
340
+ embeds?: Array<Embed>;
341
+ allowedMentions?: AllowedMentions;
342
+ components?: Array<ActionRow>;
343
+ stickerIDs?: Array<snowflake>;
344
+ attachments?: Array<Pick<Attachment, "filename" | "description">>;
345
+ flags?: MessageFlags;
346
+ files?: Array<File>;
351
347
  };
352
- appliedTags?: Array<string>;
353
- files?: Array<File> | null;
348
+ appliedTags?: Array<snowflake>;
354
349
  }, reason?: string): Promise<Channel>;
355
350
  /** https://discord.com/developers/docs/resources/channel#start-thread-from-message */
356
351
  createThreadFromMessage(channelID: snowflake, messageID: snowflake, options: {
@@ -425,12 +420,12 @@ export declare class Client extends EventEmitter {
425
420
  triggerMetadata?: TriggerMetadata;
426
421
  actions?: Array<AutoModerationAction>;
427
422
  enabled?: boolean;
428
- exemptRoles?: Array<string>;
429
- exemptChannels?: Array<string>;
423
+ exemptRoles?: Array<snowflake>;
424
+ exemptChannels?: Array<snowflake>;
430
425
  }, reason?: string): Promise<AutoModerationRule>;
431
426
  /** https://discord.com/developers/docs/interactions/application-commands#edit-application-command-permissions */
432
427
  editApplicationCommandPermissions(applicationID: snowflake, guildID: snowflake, commandID: snowflake, options: {
433
- permissions: Array<GuildApplicationCommandPermissions>;
428
+ permissions: Array<ApplicationCommandPermission>;
434
429
  }): Promise<GuildApplicationCommandPermissions>;
435
430
  /** https://discord.com/developers/docs/resources/channel#modify-channel */
436
431
  editChannel(channelID: snowflake, options: {
@@ -443,7 +438,7 @@ export declare class Client extends EventEmitter {
443
438
  rateLimitPerUser?: number | null;
444
439
  bitrate?: number | null;
445
440
  userLimit?: number | null;
446
- permissionOverwrites?: Array<Overwrite> | null;
441
+ permissionOverwrites?: Array<Pick<Overwrite, "id" | "type"> & Partial<Overwrite>> | null;
447
442
  parentID?: snowflake | null;
448
443
  rtcRegion?: string | null;
449
444
  videoQualityMode?: VideoQualityModes | null;
@@ -458,7 +453,7 @@ export declare class Client extends EventEmitter {
458
453
  autoArchiveDuration?: number;
459
454
  locked?: boolean;
460
455
  invitable?: boolean;
461
- appliedTags?: Array<string>;
456
+ appliedTags?: Array<snowflake>;
462
457
  }, reason?: string): Promise<Channel>;
463
458
  /** https://discord.com/developers/docs/resources/channel#edit-channel-permissions */
464
459
  editChannelPermissions(channelID: snowflake, overwriteID: snowflake, options: {
@@ -481,7 +476,7 @@ export declare class Client extends EventEmitter {
481
476
  }): Promise<User>;
482
477
  /** https://discord.com/developers/docs/resources/guild#modify-current-member */
483
478
  editCurrentGuildMember(guildID: snowflake, options: {
484
- nick?: string;
479
+ nick?: string | null;
485
480
  }, reason?: string): Promise<GuildMember>;
486
481
  /** https://discord.com/developers/docs/resources/guild#modify-current-user-voice-state */
487
482
  editCurrentUserVoiceState(guildID: snowflake, options: {
@@ -497,8 +492,8 @@ export declare class Client extends EventEmitter {
497
492
  installParams?: InstallParams;
498
493
  integrationTypesConfig?: Record<ApplicationIntegrationTypes, ApplicationIntegrationTypeConfiguration>;
499
494
  flags?: ApplicationFlags;
500
- icon?: string;
501
- coverImage?: string;
495
+ icon?: string | null;
496
+ coverImage?: string | null;
502
497
  interactionsEndpointURL?: string;
503
498
  tags?: Array<string>;
504
499
  }): Promise<Application>;
@@ -510,17 +505,16 @@ export declare class Client extends EventEmitter {
510
505
  descriptionLocalizations?: LocaleMap | null;
511
506
  options?: Array<ApplicationCommandOption>;
512
507
  defaultMemberPermissions?: string | null;
513
- defaultPermission?: boolean | null;
514
- dmPermission?: boolean;
508
+ integrationTypes?: Array<ApplicationIntegrationTypes>;
509
+ contexts?: Array<InteractionContextTypes>;
515
510
  nsfw?: boolean;
516
511
  }): Promise<ApplicationCommand>;
517
512
  /** https://discord.com/developers/docs/resources/guild#modify-guild */
518
513
  editGuild(guildID: snowflake, options: {
519
514
  name?: string;
520
- region?: string | null;
521
- verificationLevel?: VerificationLevel;
522
- defaultMessageNotifications?: DefaultMessageNotificationLevel;
523
- explicitContentFilter?: ExplicitContentFilterLevel;
515
+ verificationLevel?: VerificationLevel | null;
516
+ defaultMessageNotifications?: DefaultMessageNotificationLevel | null;
517
+ explicitContentFilter?: ExplicitContentFilterLevel | null;
524
518
  afkChannelID?: snowflake | null;
525
519
  afkTimeout?: number;
526
520
  icon?: string | null;
@@ -532,7 +526,7 @@ export declare class Client extends EventEmitter {
532
526
  systemChannelFlags?: SystemChannelFlags;
533
527
  rulesChannelID?: snowflake | null;
534
528
  publicUpdatesChannelID?: snowflake | null;
535
- preferredLocale?: string;
529
+ preferredLocale?: string | null;
536
530
  features?: Array<GuildFeatures>;
537
531
  description?: string | null;
538
532
  premiumProgressBarEnabled?: boolean;
@@ -546,7 +540,6 @@ export declare class Client extends EventEmitter {
546
540
  descriptionLocalizations?: LocaleMap | null;
547
541
  options?: Array<ApplicationCommandOption>;
548
542
  defaultMemberPermissions?: string | null;
549
- defaultPermission?: boolean | null;
550
543
  nsfw?: boolean;
551
544
  }): Promise<ApplicationCommand>;
552
545
  /** https://discord.com/developers/docs/resources/emoji#modify-guild-emoji */
@@ -561,8 +554,8 @@ export declare class Client extends EventEmitter {
561
554
  mute?: boolean | null;
562
555
  deaf?: boolean | null;
563
556
  channelID?: snowflake | null;
564
- communicationDisabledUntil?: number | null;
565
- flags?: GuildMemberFlags;
557
+ communicationDisabledUntil?: timestamp | null;
558
+ flags?: GuildMemberFlags | null;
566
559
  }, reason?: string): Promise<GuildMember>;
567
560
  /** https://discord.com/developers/docs/resources/guild#modify-guild-mfa-level */
568
561
  editGuildMFALevel(guildID: snowflake, options: {
@@ -589,15 +582,15 @@ export declare class Client extends EventEmitter {
589
582
  editGuildRolePositions(guildID: snowflake, options: Array<{
590
583
  id: snowflake;
591
584
  position?: number | null;
592
- }>): Promise<Array<Role>>;
585
+ }>, reason?: string): Promise<Array<Role>>;
593
586
  /** https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event */
594
587
  editGuildScheduledEvent(guildID: snowflake, guildScheduledEventID: snowflake, options: {
595
588
  channelID?: snowflake | null;
596
589
  entityMetadata?: GuildScheduledEventEntityMetadata | null;
597
590
  name?: string;
598
591
  privacyLevel?: GuildScheduledEventPrivacyLevel;
599
- scheduledStartTime?: string;
600
- scheduledEndTime?: string;
592
+ scheduledStartTime?: timestamp;
593
+ scheduledEndTime?: timestamp;
601
594
  description?: string | null;
602
595
  entityType?: GuildScheduledEventEntityTypes;
603
596
  status?: GuildScheduledEventStatus;
@@ -644,29 +637,26 @@ export declare class Client extends EventEmitter {
644
637
  editInteractionFollowupMessage(applicationID: snowflake, interactionToken: string, messageID: snowflake, options: {
645
638
  content?: string | null;
646
639
  embeds?: Array<Embed> | null;
647
- flags?: MessageFlags | null;
648
640
  allowedMentions?: AllowedMentions | null;
649
641
  components?: Array<ActionRow> | null;
650
642
  files?: Array<File> | null;
651
- attachments?: Array<Attachment> | null;
652
- threadID: snowflake;
643
+ attachments?: Array<Partial<Attachment>> | null;
644
+ threadID?: snowflake;
653
645
  }): Promise<Message>;
654
646
  /** https://discord.com/developers/docs/interactions/receiving-and-responding#edit-original-interaction-response */
655
647
  editInteractionResponse(applicationID: snowflake, interactionToken: string, options: {
656
648
  content?: string | null;
657
649
  embeds?: Array<Embed> | null;
658
- flags?: MessageFlags | null;
659
650
  allowedMentions?: AllowedMentions | null;
660
651
  components?: Array<ActionRow> | null;
661
652
  files?: Array<File> | null;
662
- attachments?: Array<Attachment> | null;
663
- threadID: snowflake;
653
+ attachments?: Array<Partial<Attachment>> | null;
654
+ threadID?: snowflake;
664
655
  }): Promise<Message>;
665
656
  /** https://discord.com/developers/docs/resources/guild#modify-user-voice-state */
666
657
  editUserVoiceState(guildID: snowflake, userID: snowflake, options: {
667
- channelID?: snowflake;
658
+ channelID: snowflake;
668
659
  suppress?: boolean;
669
- requestToSpeakTimestamp?: timestamp | null;
670
660
  }): void;
671
661
  /** https://discord.com/developers/docs/resources/webhook#modify-webhook */
672
662
  editWebhook(webhookID: snowflake, options: {
@@ -678,12 +668,11 @@ export declare class Client extends EventEmitter {
678
668
  editWebhookMessage(webhookID: snowflake, webhookToken: string, messageID: snowflake, options: {
679
669
  content?: string | null;
680
670
  embeds?: Array<Embed> | null;
681
- flags?: MessageFlags | null;
682
671
  allowedMentions?: AllowedMentions | null;
683
672
  components?: Array<ActionRow> | null;
684
673
  files?: Array<File> | null;
685
- attachments?: Array<Attachment> | null;
686
- threadID: snowflake;
674
+ attachments?: Array<Partial<Attachment>> | null;
675
+ threadID?: snowflake;
687
676
  }): Promise<Message>;
688
677
  /** https://discord.com/developers/docs/resources/webhook#modify-webhook-with-token */
689
678
  editWebhookWithToken(webhookID: snowflake, webhookToken: string, options: {
@@ -694,21 +683,21 @@ export declare class Client extends EventEmitter {
694
683
  endPoll(channelID: snowflake, messageID: snowflake): Promise<Message>;
695
684
  /** https://discord.com/developers/docs/resources/webhook#execute-webhook */
696
685
  executeWebhook(webhookID: snowflake, webhookToken: string, options: {
697
- content?: string | null;
686
+ content?: string;
698
687
  username?: string;
699
688
  avatarURL?: string;
700
689
  tts?: boolean;
701
- embeds?: Array<Embed> | null;
702
- allowedMentions?: AllowedMentions | null;
703
- components?: Array<ActionRow> | null;
704
- files?: Array<File> | null;
705
- attachments?: Array<Attachment> | null;
706
- flags?: MessageFlags | null;
690
+ embeds?: Array<Embed>;
691
+ allowedMentions?: AllowedMentions;
692
+ components?: Array<ActionRow>;
693
+ files?: Array<File>;
694
+ attachments?: Array<Pick<Attachment, "filename" | "description">>;
695
+ flags?: MessageFlags;
707
696
  threadName?: string;
708
- appliedTags?: Array<string>;
697
+ appliedTags?: Array<snowflake>;
709
698
  poll?: PollCreateParams;
710
- wait: boolean;
711
- threadID: snowflake;
699
+ wait?: boolean;
700
+ threadID?: snowflake;
712
701
  }): Promise<Message | null>;
713
702
  /**
714
703
  * https://discord.com/developers/docs/resources/webhook#execute-githubcompatible-webhook
@@ -730,7 +719,7 @@ export declare class Client extends EventEmitter {
730
719
  }>;
731
720
  /** https://discord.com/developers/docs/resources/channel#list-public-archived-threads */
732
721
  getArchivedThreads(channelID: snowflake, archivedStatus: "public" | "private", options?: {
733
- before?: string;
722
+ before?: timestamp;
734
723
  limit?: number;
735
724
  }): Promise<{
736
725
  threads: Array<Channel>;
@@ -741,8 +730,8 @@ export declare class Client extends EventEmitter {
741
730
  getAuditLog(guildID: snowflake, options?: {
742
731
  userID?: snowflake;
743
732
  actionType?: ActionTypes;
744
- before?: string;
745
- after?: string;
733
+ before?: snowflake;
734
+ after?: snowflake;
746
735
  limit?: number;
747
736
  }): Promise<AuditLog>;
748
737
  /** https://discord.com/developers/docs/resources/auto-moderation#get-auto-moderation-rule */
@@ -772,9 +761,9 @@ export declare class Client extends EventEmitter {
772
761
  /** https://discord.com/developers/docs/monetization/entitlements#list-entitlements */
773
762
  getEntitlements(applicationID: snowflake, options?: {
774
763
  userID?: snowflake;
775
- skuIDs?: Array<string>;
776
- before?: string;
777
- after?: string;
764
+ skuIDs?: Array<snowflake>;
765
+ before?: snowflake;
766
+ after?: snowflake;
778
767
  limit?: number;
779
768
  guildID?: snowflake;
780
769
  excludeEnded?: boolean;
@@ -806,11 +795,11 @@ export declare class Client extends EventEmitter {
806
795
  }): Promise<Guild>;
807
796
  /** https://discord.com/developers/docs/resources/user#get-current-user-guilds */
808
797
  getGuilds(options?: {
809
- before?: string;
810
- after?: string;
798
+ before?: snowflake;
799
+ after?: snowflake;
811
800
  limit?: number;
812
801
  withCounts?: boolean;
813
- }): Promise<Array<Guild>>;
802
+ }): Promise<Array<Pick<Guild, "id" | "name" | "icon" | "owner" | "permissions" | "features" | "approximateMemberCount" | "approximatePresenceCount">>>;
814
803
  /** https://discord.com/developers/docs/interactions/application-commands#get-guild-application-command */
815
804
  getGuildApplicationCommand(applicationID: snowflake, guildID: snowflake, commandID: snowflake): Promise<ApplicationCommand>;
816
805
  /** https://discord.com/developers/docs/interactions/application-commands#get-guild-application-commands */
@@ -824,8 +813,8 @@ export declare class Client extends EventEmitter {
824
813
  /** https://discord.com/developers/docs/resources/guild#get-guild-bans */
825
814
  getGuildBans(guildID: snowflake, options?: {
826
815
  limit?: number;
827
- before?: string;
828
- after?: string;
816
+ before?: snowflake;
817
+ after?: snowflake;
829
818
  }): Promise<Array<Ban>>;
830
819
  /** https://discord.com/developers/docs/resources/emoji#get-guild-emoji */
831
820
  getGuildEmoji(guildID: snowflake, emojiID: snowflake): Promise<Emoji>;
@@ -846,7 +835,7 @@ export declare class Client extends EventEmitter {
846
835
  /** https://discord.com/developers/docs/resources/guild#get-guild-prune-count */
847
836
  getGuildPruneCount(guildID: snowflake, options: {
848
837
  days: number;
849
- includeRoles: string | Array<string>;
838
+ includeRoles: string | Array<snowflake>;
850
839
  }): Promise<{
851
840
  pruned: number;
852
841
  }>;
@@ -860,8 +849,8 @@ export declare class Client extends EventEmitter {
860
849
  getGuildScheduledEventUsers(guildID: snowflake, guildScheduledEventID: snowflake, options?: {
861
850
  limit?: number;
862
851
  withMember?: boolean;
863
- before?: string;
864
- after?: string;
852
+ before?: snowflake;
853
+ after?: snowflake;
865
854
  }): Promise<Array<GuildScheduledEventUser>>;
866
855
  /** https://discord.com/developers/docs/resources/sticker#get-guild-sticker */
867
856
  getGuildSticker(guildID: snowflake, stickerID: snowflake): Promise<Sticker>;
@@ -904,7 +893,7 @@ export declare class Client extends EventEmitter {
904
893
  }): Promise<Invite>;
905
894
  /** https://discord.com/developers/docs/resources/channel#list-joined-private-archived-threads */
906
895
  getJoinedPrivateArchivedThreads(channelID: snowflake, options?: {
907
- before?: string;
896
+ before?: snowflake;
908
897
  limit?: number;
909
898
  }): Promise<{
910
899
  threads: Array<Channel>;
@@ -916,14 +905,14 @@ export declare class Client extends EventEmitter {
916
905
  /** https://discord.com/developers/docs/resources/channel#get-reactions */
917
906
  getMessageReactions(channelID: snowflake, messageID: snowflake, emoji: string, options?: {
918
907
  type?: ReactionTypes;
919
- after?: string;
908
+ after?: snowflake;
920
909
  limit?: number;
921
910
  }): Promise<Array<User>>;
922
911
  /** https://discord.com/developers/docs/resources/channel#get-channel-messages */
923
912
  getMessages(channelID: snowflake, options: {
924
- around?: string;
925
- before?: string;
926
- after?: string;
913
+ around?: snowflake;
914
+ before?: snowflake;
915
+ after?: snowflake;
927
916
  limit?: number;
928
917
  }): Promise<Array<Message>>;
929
918
  /** https://discord.com/developers/docs/topics/oauth2#get-current-bot-application-information */
@@ -939,7 +928,7 @@ export declare class Client extends EventEmitter {
939
928
  getPinnedMessages(channelID: snowflake): Promise<Array<Message>>;
940
929
  /** https://discord.com/developers/docs/resources/poll#get-answer-voters */
941
930
  getPollAnswerVoters(channelID: snowflake, messageID: snowflake, answerID: snowflake, options?: {
942
- after?: string;
931
+ after?: snowflake;
943
932
  limit?: number;
944
933
  }): Promise<{
945
934
  users: Array<User>;
@@ -959,7 +948,7 @@ export declare class Client extends EventEmitter {
959
948
  /** https://discord.com/developers/docs/resources/channel#list-thread-members */
960
949
  getThreadMembers(channelID: snowflake, options?: {
961
950
  withMember?: boolean;
962
- after?: string;
951
+ after?: snowflake;
963
952
  limit?: number;
964
953
  }): Promise<Array<ThreadMember>>;
965
954
  /** https://discord.com/developers/docs/resources/user#get-user */
@@ -1035,7 +1024,8 @@ export declare interface Client extends EventEmitter {
1035
1024
  }
1036
1025
  export interface ClientEvents {
1037
1026
  dispatch: [packet: RawPayload];
1038
- hello: [];
1027
+ heartbeatACK: [];
1028
+ hello: [interval: number];
1039
1029
  ready: [];
1040
1030
  resumed: [];
1041
1031
  reconnect: [];