rockcord 4.0.0-dev.4 → 4.0.0

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 (69) hide show
  1. package/README.md +5 -3
  2. package/package.json +17 -14
  3. package/src/client/Client.js +3 -3
  4. package/src/client/WebhookClient.js +1 -1
  5. package/src/client/actions/VoiceStateUpdate.js +2 -2
  6. package/src/client/voice/VoiceConnection.js +98 -24
  7. package/src/client/voice/dispatcher/AudioDispatcher.js +1 -1
  8. package/src/client/voice/dispatcher/BaseDispatcher.js +49 -61
  9. package/src/client/voice/dispatcher/VideoDispatcher.js +86 -2
  10. package/src/client/voice/networking/CongestionControl.js +84 -0
  11. package/src/client/voice/networking/DAVE.js +26 -1
  12. package/src/client/voice/networking/MediaRecovery.js +300 -0
  13. package/src/client/voice/networking/VoiceUDPClient.js +10 -1
  14. package/src/client/voice/networking/VoiceWebSocket.js +4 -1
  15. package/src/client/voice/player/MediaPlayer.js +45 -11
  16. package/src/client/voice/player/processing/AnnexBNalSplitter.js +0 -1
  17. package/src/client/voice/receiver/AudioJitter.js +101 -0
  18. package/src/client/voice/receiver/PacketHandler.js +66 -9
  19. package/src/client/voice/receiver/Receiver.js +9 -4
  20. package/src/client/voice/receiver/Recorder.js +186 -57
  21. package/src/client/voice/util/PlayInterface.js +2 -0
  22. package/src/client/voice/util/Secretbox.js +1 -1
  23. package/src/client/voice/util/TransportCrypto.js +54 -0
  24. package/src/client/voice/util/VideoFrames.js +4 -1
  25. package/src/client/websocket/WebSocketShard.js +0 -1
  26. package/src/managers/ApplicationCommandManager.js +0 -2
  27. package/src/managers/ApplicationCommandPermissionsManager.js +0 -1
  28. package/src/managers/GuildChannelManager.js +2 -3
  29. package/src/managers/GuildMemberManager.js +0 -1
  30. package/src/managers/GuildTextThreadManager.js +1 -1
  31. package/src/managers/MessageManager.js +5 -5
  32. package/src/managers/RoleManager.js +1 -1
  33. package/src/rest/APIRequest.js +0 -1
  34. package/src/rest/APIRouter.js +2 -2
  35. package/src/rest/DiscordAPIError.js +1 -1
  36. package/src/rest/RequestHandler.js +3 -3
  37. package/src/sharding/ShardingManager.js +2 -2
  38. package/src/structures/ApplicationCommand.js +2 -7
  39. package/src/structures/BaseCommandInteraction.js +1 -2
  40. package/src/structures/BaseGuildTextChannel.js +1 -1
  41. package/src/structures/BaseGuildVoiceChannel.js +1 -1
  42. package/src/structures/ClientPresence.js +0 -1
  43. package/src/structures/ClientUser.js +13 -5
  44. package/src/structures/ContainerComponent.js +1 -1
  45. package/src/structures/DMChannel.js +1 -1
  46. package/src/structures/GroupDMChannel.js +4 -4
  47. package/src/structures/Guild.js +0 -2
  48. package/src/structures/GuildAuditLogs.js +4 -4
  49. package/src/structures/GuildScheduledEvent.js +0 -2
  50. package/src/structures/Interaction.js +1 -1
  51. package/src/structures/InteractionCollector.js +2 -2
  52. package/src/structures/InteractionWebhook.js +0 -1
  53. package/src/structures/Message.js +16 -17
  54. package/src/structures/MessageComponentInteraction.js +1 -1
  55. package/src/structures/MessageEmbed.js +0 -2
  56. package/src/structures/MessagePayload.js +2 -2
  57. package/src/structures/ModalSubmitInteraction.js +2 -2
  58. package/src/structures/ThreadChannel.js +3 -3
  59. package/src/structures/ThreadOnlyChannel.js +1 -1
  60. package/src/structures/WebEmbed.js +0 -1
  61. package/src/structures/interfaces/Application.js +2 -2
  62. package/src/structures/interfaces/Collector.js +1 -4
  63. package/src/structures/interfaces/TextBasedChannel.js +6 -6
  64. package/src/util/AttachmentFlags.js +0 -1
  65. package/src/util/Constants.js +0 -2
  66. package/src/util/Options.js +3 -3
  67. package/src/util/Util.js +1 -2
  68. package/typings/index.d.ts +109 -115
  69. package/typings/rawDataTypes.d.ts +5 -15
@@ -72,7 +72,7 @@ import { AgentOptions } from 'node:https';
72
72
  import { Response, ProxyAgent } from 'undici';
73
73
  import { Readable, Writable, Stream } from 'node:stream';
74
74
  import { MessagePort, Worker } from 'node:worker_threads';
75
- import { authenticator } from 'otplib';
75
+ import { authenticator } from '@otplib/v12-adapter';
76
76
  import { CookieJar } from 'tough-cookie';
77
77
  import { RtpPacket } from 'werift-rtp';
78
78
  import * as WebSocket from 'ws';
@@ -1013,7 +1013,7 @@ export interface JoinChannelConfig {
1013
1013
  videoCodec?: VideoCodec;
1014
1014
  }
1015
1015
 
1016
- export type VideoCodec = 'VP8' | 'H264';
1016
+ export type VideoCodec = 'VP8' | 'H264' | 'H265';
1017
1017
 
1018
1018
  export class VolumeInterface extends EventEmitter {
1019
1019
  constructor(options?: { volume?: number });
@@ -1050,6 +1050,8 @@ export interface VideoOptions {
1050
1050
  inputFFmpegArgs?: string[];
1051
1051
  outputFFmpegArgs?: string[];
1052
1052
  bitrate?: number | 'auto';
1053
+ /** Loss-based video pacing, enabled by default. Bitrates are in kbps. */
1054
+ congestionControl?: boolean | { bitrate?: number; minBitrate?: number };
1053
1055
  }
1054
1056
 
1055
1057
  export class BaseDispatcher extends Writable {
@@ -1117,10 +1119,13 @@ export class AudioDispatcher extends BaseDispatcher {
1117
1119
  }
1118
1120
 
1119
1121
  export class VideoDispatcher extends BaseDispatcher {
1120
- constructor(player: object, options?: StreamOptions, streams?: object, fps?: number);
1122
+ constructor(player: object, highWaterMark?: number, streams?: object, fps?: number, payloadType?: number);
1121
1123
 
1122
1124
  public mtu: number;
1123
1125
  public fps: number;
1126
+ public readonly congestionControl?: {
1127
+ readonly state: { targetBitrate: number; loss: number; packetsSent: number; reason: string };
1128
+ };
1124
1129
 
1125
1130
  public getTypeDispatcher(): 'video';
1126
1131
 
@@ -1243,11 +1248,22 @@ export class StreamConnectionReadonly extends VoiceConnection {
1243
1248
  export class Recorder<Ready extends boolean = boolean, T = any> extends EventEmitter {
1244
1249
  constructor(
1245
1250
  receiver: T,
1246
- options?: { userId?: Snowflake; portUdpH264?: number; portUdpOpus?: number; output?: Writable | string },
1251
+ options?: {
1252
+ userId?: Snowflake;
1253
+ codec?: VideoCodec;
1254
+ portUdpVideo?: number;
1255
+ portUdpH264?: number;
1256
+ portUdpOpus?: number;
1257
+ output?: Writable | string;
1258
+ },
1247
1259
  );
1248
1260
  private promise: Promise<void>;
1249
1261
  public readonly receiver: T;
1250
- public portUdpH264: number;
1262
+ public readonly codec: VideoCodec;
1263
+ public portUdpVideo: number;
1264
+ public portUdpH264: number | null;
1265
+ public portUdpH265: number | null;
1266
+ public portUdpVP8: number | null;
1251
1267
  public portUdpOpus: number;
1252
1268
  public ready: Ready;
1253
1269
  public stream: If<Ready, ChildProcessWithoutNullStreams>;
@@ -1255,6 +1271,7 @@ export class Recorder<Ready extends boolean = boolean, T = any> extends EventEmi
1255
1271
  public output: Writable | string;
1256
1272
  public userId: Snowflake;
1257
1273
  public feed(payload: RtpPacket | BufferResolvable): void;
1274
+ public stop(): Promise<void>;
1258
1275
  public on(event: 'ready' | 'closed', listener: (recorder: Recorder<true, T>) => void): this;
1259
1276
  public once(event: 'ready' | 'closed', listener: (recorder: Recorder<true, T>) => void): this;
1260
1277
  public destroy(): void;
@@ -1266,7 +1283,11 @@ export class VoiceReceiver extends EventEmitter {
1266
1283
  user: UserResolvable,
1267
1284
  options?: { mode?: 'opus' | 'pcm'; end?: 'silence' | 'manual'; paddingSilence?: boolean },
1268
1285
  ): Readable;
1269
- public createVideoStream(user: UserResolvable, output: Writable | string): Recorder<false, any>;
1286
+ public createVideoStream(
1287
+ user: UserResolvable,
1288
+ output: Writable | string,
1289
+ options?: { codec?: VideoCodec },
1290
+ ): Recorder<false, any>;
1270
1291
 
1271
1292
  public on(event: 'debug', listener: (error: Error | string) => void): this;
1272
1293
  public on(
@@ -1352,8 +1373,9 @@ export abstract class Collector<K, V, F extends unknown[] = []> extends EventEmi
1352
1373
  ): this;
1353
1374
  }
1354
1375
 
1355
- export interface ApplicationCommandInteractionOptionResolver<Cached extends CacheType = CacheType>
1356
- extends CommandInteractionOptionResolver<Cached> {
1376
+ export interface ApplicationCommandInteractionOptionResolver<
1377
+ Cached extends CacheType = CacheType,
1378
+ > extends CommandInteractionOptionResolver<Cached> {
1357
1379
  getSubcommand(required?: true): string;
1358
1380
  getSubcommand(required: boolean): string | null;
1359
1381
  getSubcommandGroup(required?: true): string;
@@ -1540,8 +1562,10 @@ export class DMChannel extends Channel {
1540
1562
  public readonly shard: WebSocketShard;
1541
1563
  public readonly voiceUsers: Collection<Snowflake, User>;
1542
1564
  }
1543
- export interface DMChannel
1544
- extends Omit<TextBasedChannelFields, 'fetchWebhooks' | 'createWebhook' | 'setRateLimitPerUser' | 'setNSFW'> {}
1565
+ export interface DMChannel extends Omit<
1566
+ TextBasedChannelFields,
1567
+ 'fetchWebhooks' | 'createWebhook' | 'setRateLimitPerUser' | 'setNSFW'
1568
+ > {}
1545
1569
 
1546
1570
  export class Emoji extends Base {
1547
1571
  protected constructor(client: Client, emoji: RawEmojiData);
@@ -1708,8 +1732,8 @@ export class GuildAuditLogsEntry<
1708
1732
  TAction = TActionRaw extends keyof GuildAuditLogsIds
1709
1733
  ? GuildAuditLogsIds[TActionRaw]
1710
1734
  : TActionRaw extends null
1711
- ? 'ALL'
1712
- : TActionRaw,
1735
+ ? 'ALL'
1736
+ : TActionRaw,
1713
1737
  TActionType extends GuildAuditLogsActionType = TAction extends keyof GuildAuditLogsTypes
1714
1738
  ? GuildAuditLogsTypes[TAction][1]
1715
1739
  : 'ALL',
@@ -2060,10 +2084,10 @@ export type CacheTypeReducer<
2060
2084
  > = [State] extends ['cached']
2061
2085
  ? CachedType
2062
2086
  : [State] extends ['raw']
2063
- ? RawType
2064
- : [State] extends ['raw' | 'cached']
2065
- ? PresentType
2066
- : Fallback;
2087
+ ? RawType
2088
+ : [State] extends ['raw' | 'cached']
2089
+ ? PresentType
2090
+ : Fallback;
2067
2091
 
2068
2092
  export class Interaction<Cached extends CacheType = CacheType> extends Base {
2069
2093
  // This a technique used to brand different cached types. Or else we'll get `never` errors on typeguard checks.
@@ -2886,8 +2910,9 @@ export class ModalSubmitFieldsResolver {
2886
2910
  public getTextInputValue(customId: string): string;
2887
2911
  }
2888
2912
 
2889
- export interface ModalMessageModalSubmitInteraction<Cached extends CacheType = CacheType>
2890
- extends ModalSubmitInteraction<Cached> {
2913
+ export interface ModalMessageModalSubmitInteraction<
2914
+ Cached extends CacheType = CacheType,
2915
+ > extends ModalSubmitInteraction<Cached> {
2891
2916
  message: GuildCacheMessage<Cached>;
2892
2917
  channelId: Snowflake;
2893
2918
  update(options: InteractionUpdateOptions & { fetchReply: true }): Promise<GuildCacheMessage<Cached>>;
@@ -2966,8 +2991,10 @@ export class GroupDMChannel extends Channel {
2966
2991
  public readonly shard: WebSocketShard;
2967
2992
  public readonly voiceUsers: Collection<Snowflake, User>;
2968
2993
  }
2969
- export interface GroupDMChannel
2970
- extends Omit<TextBasedChannelFields, 'fetchWebhooks' | 'createWebhook' | 'setRateLimitPerUser' | 'setNSFW'> {}
2994
+ export interface GroupDMChannel extends Omit<
2995
+ TextBasedChannelFields,
2996
+ 'fetchWebhooks' | 'createWebhook' | 'setRateLimitPerUser' | 'setNSFW'
2997
+ > {}
2971
2998
 
2972
2999
  export class PermissionOverwrites extends Base {
2973
3000
  private constructor(client: Client, data: RawPermissionOverwriteData, channel: NonThreadGuildBasedChannel);
@@ -3510,11 +3537,10 @@ export abstract class ThreadOnlyChannel extends GuildChannel {
3510
3537
  public setTopic(topic: string | null, reason?: string): Promise<this>;
3511
3538
  public setDefaultSortOrder(defaultSortOrder: SortOrderTypes | null, reason?: string): Promise<this>;
3512
3539
  }
3513
- export interface ThreadOnlyChannel
3514
- extends Omit<
3515
- TextBasedChannelFields,
3516
- 'send' | 'lastMessage' | 'lastPinAt' | 'sendTyping' | 'createMessageCollector' | 'awaitMessages' | 'messages'
3517
- > {}
3540
+ export interface ThreadOnlyChannel extends Omit<
3541
+ TextBasedChannelFields,
3542
+ 'send' | 'lastMessage' | 'lastPinAt' | 'sendTyping' | 'createMessageCollector' | 'awaitMessages' | 'messages'
3543
+ > {}
3518
3544
 
3519
3545
  export class ForumChannel extends ThreadOnlyChannel {
3520
3546
  public type: 'GUILD_FORUM';
@@ -4255,10 +4281,7 @@ export abstract class CachedManager<K, Holds, R> extends DataManager<K, Holds, R
4255
4281
  }
4256
4282
 
4257
4283
  export type ApplicationCommandDataResolvable =
4258
- | ApplicationCommandData
4259
- | RESTPostAPIApplicationCommandsJSONBody
4260
- | SlashCommandBuilder
4261
- | ContextMenuCommandBuilder;
4284
+ ApplicationCommandData | RESTPostAPIApplicationCommandsJSONBody | SlashCommandBuilder | ContextMenuCommandBuilder;
4262
4285
 
4263
4286
  export class ApplicationCommandManager<
4264
4287
  ApplicationCommandScope = ApplicationCommand<{ guild: GuildResolvable }>,
@@ -5022,13 +5045,7 @@ export type AllowedImageFormat = 'webp' | 'png' | 'jpg' | 'jpeg';
5022
5045
  export type AllowedImageSize = 16 | 32 | 56 | 64 | 96 | 128 | 256 | 300 | 512 | 600 | 1024 | 2048 | 4096;
5023
5046
 
5024
5047
  export type AllowedPartial =
5025
- | User
5026
- | Channel
5027
- | GuildMember
5028
- | Message
5029
- | MessageReaction
5030
- | GuildScheduledEvent
5031
- | ThreadMember;
5048
+ User | Channel | GuildMember | Message | MessageReaction | GuildScheduledEvent | ThreadMember;
5032
5049
 
5033
5050
  export type AllowedThreadTypeForNewsChannel = 'GUILD_NEWS_THREAD' | 10;
5034
5051
 
@@ -5222,15 +5239,10 @@ export type CommandOptionDataTypeResolvable = ApplicationCommandOptionType | App
5222
5239
  export type CommandOptionChannelResolvableType = ApplicationCommandOptionTypes.CHANNEL | 'CHANNEL';
5223
5240
 
5224
5241
  export type CommandOptionChoiceResolvableType =
5225
- | ApplicationCommandOptionTypes.STRING
5226
- | 'STRING'
5227
- | CommandOptionNumericResolvableType;
5242
+ ApplicationCommandOptionTypes.STRING | 'STRING' | CommandOptionNumericResolvableType;
5228
5243
 
5229
5244
  export type CommandOptionNumericResolvableType =
5230
- | ApplicationCommandOptionTypes.NUMBER
5231
- | 'NUMBER'
5232
- | ApplicationCommandOptionTypes.INTEGER
5233
- | 'INTEGER';
5245
+ ApplicationCommandOptionTypes.NUMBER | 'NUMBER' | ApplicationCommandOptionTypes.INTEGER | 'INTEGER';
5234
5246
 
5235
5247
  export type CommandOptionSubOptionResolvableType =
5236
5248
  | ApplicationCommandOptionTypes.SUB_COMMAND
@@ -5268,9 +5280,7 @@ export interface ChatInputApplicationCommandData extends BaseApplicationCommandD
5268
5280
  }
5269
5281
 
5270
5282
  export type ApplicationCommandData =
5271
- | UserApplicationCommandData
5272
- | MessageApplicationCommandData
5273
- | ChatInputApplicationCommandData;
5283
+ UserApplicationCommandData | MessageApplicationCommandData | ChatInputApplicationCommandData;
5274
5284
 
5275
5285
  export interface ApplicationCommandChannelOptionData extends BaseApplicationCommandOptionsData {
5276
5286
  type: CommandOptionChannelResolvableType;
@@ -6355,10 +6365,7 @@ export interface EmbedFooterData {
6355
6365
  }
6356
6366
 
6357
6367
  export type EmojiIdentifierResolvable =
6358
- | EmojiResolvable
6359
- | `${'' | 'a:'}${string}:${Snowflake}`
6360
- | `<${'' | 'a'}:${string}:${Snowflake}>`
6361
- | string;
6368
+ EmojiResolvable | `${'' | 'a:'}${string}:${Snowflake}` | `<${'' | 'a'}:${string}:${Snowflake}>` | string;
6362
6369
 
6363
6370
  export type EmojiResolvable = Snowflake | GuildEmoji | ReactionEmoji;
6364
6371
 
@@ -6501,8 +6508,7 @@ export interface FetchThreadMembersWithoutGuildMemberDataOptions {
6501
6508
  }
6502
6509
 
6503
6510
  export type FetchThreadMembersOptions =
6504
- | FetchThreadMembersWithGuildMemberDataOptions
6505
- | FetchThreadMembersWithoutGuildMemberDataOptions;
6511
+ FetchThreadMembersWithGuildMemberDataOptions | FetchThreadMembersWithoutGuildMemberDataOptions;
6506
6512
 
6507
6513
  export interface FetchThreadsOptions {
6508
6514
  archived?: FetchArchivedThreadOptions;
@@ -6857,10 +6863,7 @@ export interface GuildMemberEditData {
6857
6863
  }
6858
6864
 
6859
6865
  export type GuildMemberFlagsString =
6860
- | 'DID_REJOIN'
6861
- | 'COMPLETED_ONBOARDING'
6862
- | 'BYPASSES_VERIFICATION'
6863
- | 'STARTED_ONBOARDING';
6866
+ 'DID_REJOIN' | 'COMPLETED_ONBOARDING' | 'BYPASSES_VERIFICATION' | 'STARTED_ONBOARDING';
6864
6867
 
6865
6868
  export type GuildMemberFlagsResolvable = BitFieldResolvable<GuildMemberFlagsString, number>;
6866
6869
 
@@ -6969,8 +6972,8 @@ export type GuildScheduledEventResolvable = Snowflake | GuildScheduledEvent;
6969
6972
  export type GuildScheduledEventSetStatusArg<T extends GuildScheduledEventStatus> = T extends 'SCHEDULED'
6970
6973
  ? 'ACTIVE' | 'CANCELED'
6971
6974
  : T extends 'ACTIVE'
6972
- ? 'COMPLETED'
6973
- : never;
6975
+ ? 'COMPLETED'
6976
+ : never;
6974
6977
 
6975
6978
  export type GuildScheduledEventStatus = keyof typeof GuildScheduledEventStatuses;
6976
6979
 
@@ -7028,8 +7031,10 @@ export interface ImageURLOptions extends Omit<StaticImageURLOptions, 'format'> {
7028
7031
 
7029
7032
  export type IntegrationType = 'twitch' | 'youtube' | 'discord' | 'guild_subscription';
7030
7033
 
7031
- export interface InteractionCollectorOptions<T extends Interaction, Cached extends CacheType = CacheType>
7032
- extends CollectorOptions<[T]> {
7034
+ export interface InteractionCollectorOptions<
7035
+ T extends Interaction,
7036
+ Cached extends CacheType = CacheType,
7037
+ > extends CollectorOptions<[T]> {
7033
7038
  channel?: TextBasedChannelResolvable;
7034
7039
  componentType?: MessageComponentType | MessageComponentTypes;
7035
7040
  guild?: GuildResolvable;
@@ -7083,12 +7088,7 @@ export type IntentsString =
7083
7088
  | 'AUTO_MODERATION_EXECUTION';
7084
7089
 
7085
7090
  export type GuildInvitableChannelResolvable =
7086
- | TextChannel
7087
- | VoiceChannel
7088
- | NewsChannel
7089
- | StoreChannel
7090
- | StageChannel
7091
- | Snowflake;
7091
+ TextChannel | VoiceChannel | NewsChannel | StoreChannel | StageChannel | Snowflake;
7092
7092
 
7093
7093
  export interface CreateInviteOptions {
7094
7094
  temporary?: boolean;
@@ -7143,23 +7143,18 @@ export type MessageActionRowComponentOptions =
7143
7143
  | (Required<BaseMessageComponentOptions> & MessageSelectMenuOptions);
7144
7144
 
7145
7145
  export type MessageActionRowComponentResolvable =
7146
- | MessageActionRowComponent
7147
- | MessageActionRowComponentOptions
7148
- | APIMessageActionRowComponent;
7146
+ MessageActionRowComponent | MessageActionRowComponentOptions | APIMessageActionRowComponent;
7149
7147
 
7150
7148
  export type ModalActionRowComponent = TextInputComponent;
7151
7149
 
7152
7150
  export type ModalActionRowComponentOptions = TextInputComponentOptions;
7153
7151
 
7154
7152
  export type ModalActionRowComponentResolvable =
7155
- | ModalActionRowComponent
7156
- | ModalActionRowComponentOptions
7157
- | APIModalActionRowComponent;
7153
+ ModalActionRowComponent | ModalActionRowComponentOptions | APIModalActionRowComponent;
7158
7154
 
7159
7155
  export interface MessageActionRowOptions<
7160
- T extends
7161
- | MessageActionRowComponentResolvable
7162
- | ModalActionRowComponentResolvable = MessageActionRowComponentResolvable,
7156
+ T extends MessageActionRowComponentResolvable | ModalActionRowComponentResolvable =
7157
+ MessageActionRowComponentResolvable,
7163
7158
  > extends BaseMessageComponentOptions {
7164
7159
  components: T[];
7165
7160
  }
@@ -7208,10 +7203,7 @@ export type MessageChannelComponentCollectorOptions<T extends MessageComponentIn
7208
7203
  Omit<InteractionCollectorOptions<T>, 'channel' | 'guild' | 'interactionType'>;
7209
7204
 
7210
7205
  export type MessageComponentOptions =
7211
- | BaseMessageComponentOptions
7212
- | MessageActionRowOptions
7213
- | MessageButtonOptions
7214
- | MessageSelectMenuOptions;
7206
+ BaseMessageComponentOptions | MessageActionRowOptions | MessageButtonOptions | MessageSelectMenuOptions;
7215
7207
 
7216
7208
  export type MessageComponentType = keyof typeof MessageComponentTypes;
7217
7209
 
@@ -7342,25 +7334,24 @@ export interface MessageMentionOptions {
7342
7334
 
7343
7335
  export type MessageMentionTypes = 'roles' | 'users' | 'everyone';
7344
7336
 
7345
- export interface MessageSnapshot
7346
- extends Partialize<
7347
- Message,
7348
- null,
7349
- Exclude<
7350
- keyof Message,
7351
- | 'attachments'
7352
- | 'client'
7353
- | 'components'
7354
- | 'content'
7355
- | 'createdTimestamp'
7356
- | 'editedTimestamp'
7357
- | 'embeds'
7358
- | 'flags'
7359
- | 'mentions'
7360
- | 'stickers'
7361
- | 'type'
7362
- >
7363
- > {}
7337
+ export interface MessageSnapshot extends Partialize<
7338
+ Message,
7339
+ null,
7340
+ Exclude<
7341
+ keyof Message,
7342
+ | 'attachments'
7343
+ | 'client'
7344
+ | 'components'
7345
+ | 'content'
7346
+ | 'createdTimestamp'
7347
+ | 'editedTimestamp'
7348
+ | 'embeds'
7349
+ | 'flags'
7350
+ | 'mentions'
7351
+ | 'stickers'
7352
+ | 'type'
7353
+ >
7354
+ > {}
7364
7355
 
7365
7356
  export interface MessageOptions {
7366
7357
  activity?: MessageActivity;
@@ -7414,9 +7405,7 @@ export interface OtherMessageSelectMenuOptions extends BaseMessageSelectMenuOpti
7414
7405
  }
7415
7406
 
7416
7407
  export type MessageSelectMenuOptions =
7417
- | StringMessageSelectMenuOptions
7418
- | ChannelMessageSelectMenuOptions
7419
- | OtherMessageSelectMenuOptions;
7408
+ StringMessageSelectMenuOptions | ChannelMessageSelectMenuOptions | OtherMessageSelectMenuOptions;
7420
7409
 
7421
7410
  export interface MessageSelectOption {
7422
7411
  default: boolean;
@@ -7451,8 +7440,7 @@ export type MFALevel = keyof typeof MFALevels;
7451
7440
 
7452
7441
  export interface ModalOptions {
7453
7442
  components:
7454
- | MessageActionRow<ModalActionRowComponent>[]
7455
- | MessageActionRowOptions<ModalActionRowComponentResolvable>[];
7443
+ MessageActionRow<ModalActionRowComponent>[] | MessageActionRowOptions<ModalActionRowComponentResolvable>[];
7456
7444
  customId: string;
7457
7445
  title: string;
7458
7446
  }
@@ -7629,13 +7617,19 @@ export interface PartialDMChannel extends Partialize<DMChannel, null, null, 'las
7629
7617
 
7630
7618
  export interface PartialGuildMember extends Partialize<GuildMember, 'joinedAt' | 'joinedTimestamp'> {}
7631
7619
 
7632
- export interface PartialMessage
7633
- extends Partialize<Message, 'type' | 'system' | 'pinned' | 'tts', 'content' | 'cleanContent' | 'author'> {}
7620
+ export interface PartialMessage extends Partialize<
7621
+ Message,
7622
+ 'type' | 'system' | 'pinned' | 'tts',
7623
+ 'content' | 'cleanContent' | 'author'
7624
+ > {}
7634
7625
 
7635
7626
  export interface PartialMessageReaction extends Partialize<MessageReaction, 'count'> {}
7636
7627
 
7637
- export interface PartialGuildScheduledEvent
7638
- extends Partialize<GuildScheduledEvent, 'userCount', 'status' | 'privacyLevel' | 'name' | 'entityType'> {}
7628
+ export interface PartialGuildScheduledEvent extends Partialize<
7629
+ GuildScheduledEvent,
7630
+ 'userCount',
7631
+ 'status' | 'privacyLevel' | 'name' | 'entityType'
7632
+ > {}
7639
7633
 
7640
7634
  export interface PartialOverwriteData {
7641
7635
  id: Snowflake | number;
@@ -8157,14 +8151,14 @@ export type WSEventType =
8157
8151
  export type Serialized<T> = T extends symbol | bigint | (() => any)
8158
8152
  ? never
8159
8153
  : T extends number | string | boolean | undefined
8160
- ? T
8161
- : T extends { toJSON(): infer R }
8162
- ? R
8163
- : T extends ReadonlyArray<infer V>
8164
- ? Serialized<V>[]
8165
- : T extends ReadonlyMap<unknown, unknown> | ReadonlySet<unknown>
8166
- ? {}
8167
- : { [K in keyof T]: Serialized<T[K]> };
8154
+ ? T
8155
+ : T extends { toJSON(): infer R }
8156
+ ? R
8157
+ : T extends ReadonlyArray<infer V>
8158
+ ? Serialized<V>[]
8159
+ : T extends ReadonlyMap<unknown, unknown> | ReadonlySet<unknown>
8160
+ ? {}
8161
+ : { [K in keyof T]: Serialized<T[K]> };
8168
8162
 
8169
8163
  //#endregion
8170
8164
 
@@ -110,20 +110,14 @@ export type RawIntegrationApplicationData = APIGuildIntegrationApplication | Par
110
110
  export type RawApplicationCommandData = APIApplicationCommand;
111
111
 
112
112
  export type RawChannelData =
113
- | RawGuildChannelData
114
- | RawThreadChannelData
115
- | RawDMChannelData
116
- | RawPartialGroupDMChannelData;
113
+ RawGuildChannelData | RawThreadChannelData | RawDMChannelData | RawPartialGroupDMChannelData;
117
114
  export type RawDMChannelData = APIChannel | APIInteractionDataResolvedChannel;
118
115
  export type RawGuildChannelData = APIChannel | APIInteractionDataResolvedChannel | Required<APIPartialChannel>;
119
116
  export type RawPartialGroupDMChannelData = APIChannel | Required<APIPartialChannel>;
120
117
  export type RawThreadChannelData = APIChannel | APIInteractionDataResolvedChannel;
121
118
 
122
119
  export type RawEmojiData =
123
- | RawGuildEmojiData
124
- | RawReactionEmojiData
125
- | GatewayActivityEmoji
126
- | Omit<Partial<APIPartialEmoji>, 'animated'>;
120
+ RawGuildEmojiData | RawReactionEmojiData | GatewayActivityEmoji | Omit<Partial<APIPartialEmoji>, 'animated'>;
127
121
  export type RawGuildEmojiData = APIEmoji;
128
122
  export type RawReactionEmojiData = APIEmoji | APIPartialEmoji;
129
123
 
@@ -213,8 +207,7 @@ export type RawRoleData = APIRole;
213
207
  export type RawRichPresenceAssets = GatewayActivityAssets;
214
208
 
215
209
  export type RawStageInstanceData =
216
- | APIStageInstance
217
- | (Partial<APIStageInstance> & Pick<APIStageInstance, 'id' | 'channel_id' | 'guild_id'>);
210
+ APIStageInstance | (Partial<APIStageInstance> & Pick<APIStageInstance, 'id' | 'channel_id' | 'guild_id'>);
218
211
 
219
212
  export type RawStickerData = APISticker | APIStickerItem;
220
213
 
@@ -227,17 +220,14 @@ export type RawTeamMemberData = APITeamMember;
227
220
  export type RawTypingData = GatewayTypingStartDispatchData;
228
221
 
229
222
  export type RawUserData =
230
- | (APIUser & { member?: Omit<APIGuildMember, 'user'> })
231
- | (GatewayPresenceUpdate['user'] & Pick<APIUser, 'username'>);
223
+ (APIUser & { member?: Omit<APIGuildMember, 'user'> }) | (GatewayPresenceUpdate['user'] & Pick<APIUser, 'username'>);
232
224
 
233
225
  export type RawVoiceRegionData = APIVoiceRegion;
234
226
 
235
227
  export type RawVoiceStateData = GatewayVoiceState | Omit<GatewayVoiceState, 'guild_id'>;
236
228
 
237
229
  export type RawWebhookData =
238
- | APIWebhook
239
- | RESTGetAPIWebhookWithTokenResult
240
- | (Partial<APIWebhook> & Required<Pick<APIWebhook, 'id' | 'guild_id'>>);
230
+ APIWebhook | RESTGetAPIWebhookWithTokenResult | (Partial<APIWebhook> & Required<Pick<APIWebhook, 'id' | 'guild_id'>>);
241
231
 
242
232
  export type RawWelcomeChannelData = APIGuildWelcomeScreenChannel;
243
233