discord.js 15.0.0-pr-11005.1765454364-f3f6d34e7 → 15.0.0-pr-11005.1765463668-087384722

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.
@@ -5,7 +5,7 @@ import { MessagePort, Worker } from 'node:worker_threads';
5
5
  import { ApplicationCommandOptionAllowedChannelType, MessageActionRowComponentBuilder } from '@discordjs/builders';
6
6
  import { Collection, ReadonlyCollection } from '@discordjs/collection';
7
7
  import { BaseImageURLOptions, ImageURLOptions, RawFile, REST, RESTOptions, EmojiURLOptions } from '@discordjs/rest';
8
- import { Awaitable, JSONEncodable } from '@discordjs/util';
8
+ import { Awaitable, FileBodyEncodable, JSONEncodable } from '@discordjs/util';
9
9
  import { WebSocketManager, WebSocketManagerOptions } from '@discordjs/ws';
10
10
  import { AsyncEventEmitter } from '@vladfrangu/async_event_emitter';
11
11
  import {
@@ -266,8 +266,9 @@ export type ActionRowComponentData = MessageActionRowComponentData;
266
266
 
267
267
  export type ActionRowComponent = MessageActionRowComponent;
268
268
 
269
- export interface ActionRowData<ComponentType extends ActionRowComponentData | JSONEncodable<APIComponentInActionRow>>
270
- extends BaseComponentData {
269
+ export interface ActionRowData<
270
+ ComponentType extends ActionRowComponentData | JSONEncodable<APIComponentInActionRow>,
271
+ > extends BaseComponentData {
271
272
  components: readonly ComponentType[];
272
273
  }
273
274
 
@@ -603,7 +604,8 @@ export class BaseGuildEmoji extends Emoji {
603
604
  }
604
605
 
605
606
  export interface BaseGuildTextChannel
606
- extends TextBasedChannelFields<true>,
607
+ extends
608
+ TextBasedChannelFields<true>,
607
609
  PinnableChannelFields,
608
610
  WebhookChannelFields,
609
611
  BulkDeleteMethod,
@@ -630,7 +632,8 @@ export class BaseGuildTextChannel extends GuildChannel {
630
632
  }
631
633
 
632
634
  export interface BaseGuildVoiceChannel
633
- extends TextBasedChannelFields<true>,
635
+ extends
636
+ TextBasedChannelFields<true>,
634
637
  WebhookChannelFields,
635
638
  BulkDeleteMethod,
636
639
  SetRateLimitPerUserMethod,
@@ -1282,10 +1285,7 @@ export class PrimaryEntryPointCommandInteraction<
1282
1285
  }
1283
1286
 
1284
1287
  export interface DMChannel
1285
- extends TextBasedChannelFields<false, true>,
1286
- PinnableChannelFields,
1287
- MessageChannelFields,
1288
- SendMethod<false> {}
1288
+ extends TextBasedChannelFields<false, true>, PinnableChannelFields, MessageChannelFields, SendMethod<false> {}
1289
1289
  export class DMChannel extends BaseChannel {
1290
1290
  private constructor(client: Client<true>, data?: RawDMChannelData);
1291
1291
  public flags: Readonly<ChannelFlagsBitField>;
@@ -1453,6 +1453,7 @@ export class Guild extends AnonymousGuild {
1453
1453
  public widgetChannelId: Snowflake | null;
1454
1454
  public widgetEnabled: boolean | null;
1455
1455
  public get maximumBitrate(): number;
1456
+ public get maximumStageBitrate(): number;
1456
1457
  public createTemplate(name: string, description?: string): Promise<GuildTemplate>;
1457
1458
  public discoverySplashURL(options?: ImageURLOptions): string | null;
1458
1459
  public edit(options: GuildEditOptions): Promise<Guild>;
@@ -2234,7 +2235,12 @@ export class Message<InGuild extends boolean = boolean> extends Base {
2234
2235
  ): InteractionCollector<MappedInteractionTypes<InGuild>[ComponentType]>;
2235
2236
  public delete(): Promise<OmitPartialGroupDMChannel<Message<InGuild>>>;
2236
2237
  public edit(
2237
- content: MessageEditOptions | MessagePayload | string,
2238
+ content:
2239
+ | FileBodyEncodable<RESTPatchAPIChannelMessageJSONBody>
2240
+ | JSONEncodable<RESTPatchAPIChannelMessageJSONBody>
2241
+ | MessageEditOptions
2242
+ | MessagePayload
2243
+ | string,
2238
2244
  ): Promise<OmitPartialGroupDMChannel<Message<InGuild>>>;
2239
2245
  public equals(message: Message, rawData: unknown): boolean;
2240
2246
  public fetchReference(): Promise<OmitPartialGroupDMChannel<Message<InGuild>>>;
@@ -2259,26 +2265,6 @@ export class Message<InGuild extends boolean = boolean> extends Base {
2259
2265
  public inGuild(): this is Message<true>;
2260
2266
  }
2261
2267
 
2262
- export class AttachmentBuilder {
2263
- public constructor(attachment: BufferResolvable | Stream, data?: AttachmentData);
2264
- public attachment: BufferResolvable | Stream;
2265
- public description: string | null;
2266
- public name: string | null;
2267
- public title: string | null;
2268
- public waveform: string | null;
2269
- public duration: number | null;
2270
- public get spoiler(): boolean;
2271
- public setDescription(description: string): this;
2272
- public setFile(attachment: BufferResolvable | Stream, name?: string): this;
2273
- public setName(name: string): this;
2274
- public setTitle(title: string): this;
2275
- public setWaveform(waveform: string): this;
2276
- public setDuration(duration: number): this;
2277
- public setSpoiler(spoiler?: boolean): this;
2278
- public toJSON(): unknown;
2279
- public static from(other: JSONEncodable<AttachmentPayload>): AttachmentBuilder;
2280
- }
2281
-
2282
2268
  export class Attachment {
2283
2269
  private constructor(data: APIAttachment);
2284
2270
  private readonly attachment: BufferResolvable | Stream;
@@ -2557,14 +2543,13 @@ export interface TextInputModalData extends BaseModalData<ComponentType.TextInpu
2557
2543
  value: string;
2558
2544
  }
2559
2545
 
2560
- export interface SelectMenuModalData<Cached extends CacheType = CacheType>
2561
- extends BaseModalData<
2562
- | ComponentType.ChannelSelect
2563
- | ComponentType.MentionableSelect
2564
- | ComponentType.RoleSelect
2565
- | ComponentType.StringSelect
2566
- | ComponentType.UserSelect
2567
- > {
2546
+ export interface SelectMenuModalData<Cached extends CacheType = CacheType> extends BaseModalData<
2547
+ | ComponentType.ChannelSelect
2548
+ | ComponentType.MentionableSelect
2549
+ | ComponentType.RoleSelect
2550
+ | ComponentType.StringSelect
2551
+ | ComponentType.UserSelect
2552
+ > {
2568
2553
  channels?: ReadonlyCollection<
2569
2554
  Snowflake,
2570
2555
  CacheTypeReducer<Cached, GuildBasedChannel, APIInteractionDataResolvedChannel>
@@ -2659,8 +2644,9 @@ export class ModalComponentResolver<Cached extends CacheType = CacheType> {
2659
2644
  public getUploadedFiles(customId: string, required?: boolean): ReadonlyCollection<Snowflake, Attachment> | null;
2660
2645
  }
2661
2646
 
2662
- export interface ModalMessageModalSubmitInteraction<Cached extends CacheType = CacheType>
2663
- extends ModalSubmitInteraction<Cached> {
2647
+ export interface ModalMessageModalSubmitInteraction<
2648
+ Cached extends CacheType = CacheType,
2649
+ > extends ModalSubmitInteraction<Cached> {
2664
2650
  channelId: Snowflake;
2665
2651
  inCachedGuild(): this is ModalMessageModalSubmitInteraction<'cached'>;
2666
2652
  inGuild(): this is ModalMessageModalSubmitInteraction<'cached' | 'raw'>;
@@ -3513,7 +3499,8 @@ export interface PrivateThreadChannel extends ThreadChannel<false> {
3513
3499
  }
3514
3500
 
3515
3501
  export interface ThreadChannel<ThreadOnly extends boolean = boolean>
3516
- extends TextBasedChannelFields<true>,
3502
+ extends
3503
+ TextBasedChannelFields<true>,
3517
3504
  PinnableChannelFields,
3518
3505
  BulkDeleteMethod,
3519
3506
  SetRateLimitPerUserMethod,
@@ -4051,7 +4038,7 @@ export enum DiscordjsErrorCodes {
4051
4038
 
4052
4039
  EmojiType = 'EmojiType',
4053
4040
  EmojiManaged = 'EmojiManaged',
4054
- MissingManageGuildExpressionsPermission = 'MissingManageGuildExpressionsPermission',
4041
+ MissingGuildExpressionsPermission = 'MissingGuildExpressionsPermission',
4055
4042
 
4056
4043
  NotGuildSoundboardSound = 'NotGuildSoundboardSound',
4057
4044
  NotGuildSticker = 'NotGuildSticker',
@@ -4278,7 +4265,12 @@ export class ChannelManager extends CachedManager<Snowflake, Channel, ChannelRes
4278
4265
  private constructor(client: Client<true>, iterable: Iterable<RawChannelData>);
4279
4266
  public createMessage(
4280
4267
  channel: Exclude<TextBasedChannelResolvable, PartialGroupDMChannel>,
4281
- options: MessageCreateOptions | MessagePayload | string,
4268
+ options:
4269
+ | FileBodyEncodable<RESTPostAPIChannelMessageJSONBody>
4270
+ | JSONEncodable<RESTPostAPIChannelMessageJSONBody>
4271
+ | MessageCreateOptions
4272
+ | MessagePayload
4273
+ | string,
4282
4274
  ): Promise<OmitPartialGroupDMChannel<Message>>;
4283
4275
  public fetch(id: Snowflake, options?: FetchChannelOptions): Promise<Channel | null>;
4284
4276
  }
@@ -4630,7 +4622,12 @@ export abstract class MessageManager<InGuild extends boolean = boolean> extends
4630
4622
  public delete(message: MessageResolvable): Promise<void>;
4631
4623
  public edit(
4632
4624
  message: MessageResolvable,
4633
- options: MessageEditOptions | MessagePayload | string,
4625
+ options:
4626
+ | FileBodyEncodable<RESTPatchAPIChannelMessageJSONBody>
4627
+ | JSONEncodable<RESTPatchAPIChannelMessageJSONBody>
4628
+ | MessageEditOptions
4629
+ | MessagePayload
4630
+ | string,
4634
4631
  ): Promise<Message<InGuild>>;
4635
4632
  public fetch(options: FetchMessageOptions | MessageResolvable): Promise<Message<InGuild>>;
4636
4633
  public fetch(options?: FetchMessagesOptions): Promise<Collection<Snowflake, Message<InGuild>>>;
@@ -4807,7 +4804,14 @@ export class VoiceStateManager extends CachedManager<Snowflake, VoiceState, type
4807
4804
  export type Constructable<Entity> = abstract new (...args: any[]) => Entity;
4808
4805
 
4809
4806
  export interface SendMethod<InGuild extends boolean = boolean> {
4810
- send(options: MessageCreateOptions | MessagePayload | string): Promise<Message<InGuild>>;
4807
+ send(
4808
+ options:
4809
+ | FileBodyEncodable<RESTPostAPIChannelMessageJSONBody>
4810
+ | JSONEncodable<RESTPostAPIChannelMessageJSONBody>
4811
+ | MessageCreateOptions
4812
+ | MessagePayload
4813
+ | string,
4814
+ ): Promise<Message<InGuild>>;
4811
4815
  }
4812
4816
 
4813
4817
  export interface PinnableChannelFields {
@@ -5060,15 +5064,17 @@ export interface ApplicationCommandAutocompleteStringOptionData extends BaseAppl
5060
5064
  type: ApplicationCommandOptionType.String;
5061
5065
  }
5062
5066
 
5063
- export interface ApplicationCommandChoicesData<Type extends number | string = number | string>
5064
- extends BaseApplicationCommandOptionsData {
5067
+ export interface ApplicationCommandChoicesData<
5068
+ Type extends number | string = number | string,
5069
+ > extends BaseApplicationCommandOptionsData {
5065
5070
  autocomplete?: false;
5066
5071
  choices?: readonly ApplicationCommandOptionChoiceData<Type>[];
5067
5072
  type: CommandOptionChoiceResolvableType;
5068
5073
  }
5069
5074
 
5070
- export interface ApplicationCommandChoicesOption<Type extends number | string = number | string>
5071
- extends BaseApplicationCommandOptionsData {
5075
+ export interface ApplicationCommandChoicesOption<
5076
+ Type extends number | string = number | string,
5077
+ > extends BaseApplicationCommandOptionsData {
5072
5078
  autocomplete?: false;
5073
5079
  choices?: readonly ApplicationCommandOptionChoiceData<Type>[];
5074
5080
  type: CommandOptionChoiceResolvableType;
@@ -5251,13 +5257,15 @@ export interface AutoModerationTriggerMetadata {
5251
5257
  regexPatterns: readonly string[];
5252
5258
  }
5253
5259
 
5254
- export interface AwaitMessageComponentOptions<Interaction extends CollectedMessageInteraction>
5255
- extends CollectorOptions<[Interaction, Collection<Snowflake, Interaction>]> {
5260
+ export interface AwaitMessageComponentOptions<Interaction extends CollectedMessageInteraction> extends CollectorOptions<
5261
+ [Interaction, Collection<Snowflake, Interaction>]
5262
+ > {
5256
5263
  componentType?: ComponentType;
5257
5264
  }
5258
5265
 
5259
- export interface AwaitModalSubmitOptions
5260
- extends CollectorOptions<[ModalSubmitInteraction, Collection<Snowflake, ModalSubmitInteraction>]> {
5266
+ export interface AwaitModalSubmitOptions extends CollectorOptions<
5267
+ [ModalSubmitInteraction, Collection<Snowflake, ModalSubmitInteraction>]
5268
+ > {
5261
5269
  time: number;
5262
5270
  }
5263
5271
 
@@ -5630,8 +5638,9 @@ export interface BaseInteractionResolvedData<Cached extends CacheType = CacheTyp
5630
5638
  users?: ReadonlyCollection<Snowflake, User>;
5631
5639
  }
5632
5640
 
5633
- export interface CommandInteractionResolvedData<Cached extends CacheType = CacheType>
5634
- extends BaseInteractionResolvedData<Cached> {
5641
+ export interface CommandInteractionResolvedData<
5642
+ Cached extends CacheType = CacheType,
5643
+ > extends BaseInteractionResolvedData<Cached> {
5635
5644
  messages?: ReadonlyCollection<Snowflake, CacheTypeReducer<Cached, Message, APIMessage>>;
5636
5645
  }
5637
5646
 
@@ -6270,7 +6279,7 @@ export interface GuildEmojiEditOptions {
6270
6279
 
6271
6280
  export interface GuildStickerCreateOptions {
6272
6281
  description?: string | null;
6273
- file: AttachmentPayload | BufferResolvable | JSONEncodable<AttachmentBuilder> | Stream;
6282
+ file: AttachmentPayload | BufferResolvable | Stream;
6274
6283
  name: string;
6275
6284
  reason?: string;
6276
6285
  tags: string;
@@ -6617,8 +6626,9 @@ export type CollectedMessageInteraction<Cached extends CacheType = CacheType> =
6617
6626
  ModalSubmitInteraction
6618
6627
  >;
6619
6628
 
6620
- export interface MessageComponentCollectorOptions<Interaction extends CollectedMessageInteraction>
6621
- extends AwaitMessageComponentOptions<Interaction> {
6629
+ export interface MessageComponentCollectorOptions<
6630
+ Interaction extends CollectedMessageInteraction,
6631
+ > extends AwaitMessageComponentOptions<Interaction> {
6622
6632
  max?: number;
6623
6633
  maxComponents?: number;
6624
6634
  maxUsers?: number;
@@ -6657,25 +6667,24 @@ export interface MessageMentionOptions {
6657
6667
 
6658
6668
  export type MessageMentionTypes = 'everyone' | 'roles' | 'users';
6659
6669
 
6660
- export interface MessageSnapshot
6661
- extends Partialize<
6662
- Message,
6663
- null,
6664
- Exclude<
6665
- keyof Message,
6666
- | 'attachments'
6667
- | 'client'
6668
- | 'components'
6669
- | 'content'
6670
- | 'createdTimestamp'
6671
- | 'editedTimestamp'
6672
- | 'embeds'
6673
- | 'flags'
6674
- | 'mentions'
6675
- | 'stickers'
6676
- | 'type'
6677
- >
6678
- > {}
6670
+ export interface MessageSnapshot extends Partialize<
6671
+ Message,
6672
+ null,
6673
+ Exclude<
6674
+ keyof Message,
6675
+ | 'attachments'
6676
+ | 'client'
6677
+ | 'components'
6678
+ | 'content'
6679
+ | 'createdTimestamp'
6680
+ | 'editedTimestamp'
6681
+ | 'embeds'
6682
+ | 'flags'
6683
+ | 'mentions'
6684
+ | 'stickers'
6685
+ | 'type'
6686
+ >
6687
+ > {}
6679
6688
 
6680
6689
  export interface BaseMessageOptions {
6681
6690
  allowedMentions?: MessageMentionOptions;
@@ -6688,14 +6697,7 @@ export interface BaseMessageOptions {
6688
6697
  )[];
6689
6698
  content?: string;
6690
6699
  embeds?: readonly (APIEmbed | JSONEncodable<APIEmbed>)[];
6691
- files?: readonly (
6692
- | Attachment
6693
- | AttachmentBuilder
6694
- | AttachmentPayload
6695
- | BufferResolvable
6696
- | JSONEncodable<APIAttachment>
6697
- | Stream
6698
- )[];
6700
+ files?: readonly (Attachment | AttachmentPayload | BufferResolvable | FileBodyEncodable<APIAttachment> | Stream)[];
6699
6701
  }
6700
6702
 
6701
6703
  export interface MessageOptionsPoll {
@@ -6723,11 +6725,7 @@ export interface MessageOptionsStickers {
6723
6725
  }
6724
6726
 
6725
6727
  export interface BaseMessageCreateOptions
6726
- extends BaseMessageOptions,
6727
- MessageOptionsPoll,
6728
- MessageOptionsFlags,
6729
- MessageOptionsTTS,
6730
- MessageOptionsStickers {
6728
+ extends BaseMessageOptions, MessageOptionsPoll, MessageOptionsFlags, MessageOptionsTTS, MessageOptionsStickers {
6731
6729
  enforceNonce?: boolean;
6732
6730
  nonce?: number | string;
6733
6731
  }
@@ -6737,16 +6735,10 @@ export interface MessageCreateOptions extends BaseMessageCreateOptions {
6737
6735
  }
6738
6736
 
6739
6737
  export interface GuildForumThreadMessageCreateOptions
6740
- extends BaseMessageOptions,
6741
- MessageOptionsFlags,
6742
- MessageOptionsStickers {}
6743
-
6744
- export interface MessageEditAttachmentData {
6745
- id: Snowflake;
6746
- }
6738
+ extends BaseMessageOptions, MessageOptionsFlags, MessageOptionsStickers {}
6747
6739
 
6748
6740
  export interface MessageEditOptions extends Omit<BaseMessageOptions, 'content'> {
6749
- attachments?: readonly (Attachment | MessageEditAttachmentData)[];
6741
+ attachments?: readonly (Attachment | JSONEncodable<APIAttachment>)[];
6750
6742
  content?: string | null;
6751
6743
  flags?:
6752
6744
  | BitFieldResolvable<
@@ -6942,18 +6934,20 @@ export interface PartialDMChannel extends Partialize<DMChannel, null, null, 'las
6942
6934
 
6943
6935
  export interface PartialGuildMember extends Partialize<GuildMember, 'joinedAt' | 'joinedTimestamp' | 'pending'> {}
6944
6936
 
6945
- export interface PartialMessage<InGuild extends boolean = boolean>
6946
- extends Partialize<Message<InGuild>, 'pinned' | 'system' | 'tts' | 'type', 'author' | 'cleanContent' | 'content'> {}
6937
+ export interface PartialMessage<InGuild extends boolean = boolean> extends Partialize<
6938
+ Message<InGuild>,
6939
+ 'pinned' | 'system' | 'tts' | 'type',
6940
+ 'author' | 'cleanContent' | 'content'
6941
+ > {}
6947
6942
 
6948
6943
  export interface PartialMessageReaction extends Partialize<MessageReaction, 'count'> {}
6949
6944
 
6950
- export interface PartialPoll
6951
- extends Partialize<
6952
- Poll,
6953
- 'allowMultiselect' | 'expiresTimestamp' | 'layoutType',
6954
- null,
6955
- 'answers' | 'message' | 'question'
6956
- > {
6945
+ export interface PartialPoll extends Partialize<
6946
+ Poll,
6947
+ 'allowMultiselect' | 'expiresTimestamp' | 'layoutType',
6948
+ null,
6949
+ 'answers' | 'message' | 'question'
6950
+ > {
6957
6951
  // eslint-disable-next-line no-restricted-syntax
6958
6952
  answers: Collection<number, PartialPollAnswer>;
6959
6953
  message: PartialMessage;
@@ -6964,8 +6958,11 @@ export interface PartialPollAnswer extends Partialize<PollAnswer, 'emoji' | 'tex
6964
6958
  readonly poll: PartialPoll;
6965
6959
  }
6966
6960
 
6967
- export interface PartialGuildScheduledEvent
6968
- extends Partialize<GuildScheduledEvent, 'userCount', 'entityType' | 'name' | 'privacyLevel' | 'status'> {}
6961
+ export interface PartialGuildScheduledEvent extends Partialize<
6962
+ GuildScheduledEvent,
6963
+ 'userCount',
6964
+ 'entityType' | 'name' | 'privacyLevel' | 'status'
6965
+ > {}
6969
6966
 
6970
6967
  export interface PartialThreadMember extends Partialize<ThreadMember, 'flags' | 'joinedAt' | 'joinedTimestamp'> {}
6971
6968
 
@@ -7260,10 +7257,7 @@ export interface WebhookFetchMessageOptions {
7260
7257
  }
7261
7258
 
7262
7259
  export interface WebhookMessageCreateOptions
7263
- extends BaseMessageOptions,
7264
- MessageOptionsPoll,
7265
- MessageOptionsFlags,
7266
- MessageOptionsTTS {
7260
+ extends BaseMessageOptions, MessageOptionsPoll, MessageOptionsFlags, MessageOptionsTTS {
7267
7261
  appliedTags?: readonly Snowflake[];
7268
7262
  avatarURL?: string;
7269
7263
  threadId?: Snowflake;