discord.js 15.0.0-dev.1737850362-695f59236 → 15.0.0-dev.1737936752-3db8ce70a

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -29,7 +29,7 @@ discord.js is a powerful [Node.js](https://nodejs.org) module that allows you to
29
29
 
30
30
  ## Installation
31
31
 
32
- **Node.js 20 or newer is required.**
32
+ **Node.js 22.12.0 or newer is required.**
33
33
 
34
34
  ```sh
35
35
  npm install discord.js
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "discord.js",
4
- "version": "15.0.0-dev.1737850362-695f59236",
4
+ "version": "15.0.0-dev.1737936752-3db8ce70a",
5
5
  "description": "A powerful library for interacting with the Discord API",
6
6
  "main": "./src/index.js",
7
7
  "types": "./typings/index.d.ts",
@@ -63,12 +63,12 @@
63
63
  "@discordjs/collection": "^2.1.1",
64
64
  "@discordjs/rest": "^2.4.0",
65
65
  "@discordjs/util": "^1.1.1",
66
- "@discordjs/formatters": "^0.5.0",
67
- "@discordjs/ws": "^2.0.0"
66
+ "@discordjs/ws": "^2.0.0",
67
+ "@discordjs/formatters": "^0.5.0"
68
68
  },
69
69
  "devDependencies": {
70
70
  "@favware/cliff-jumper": "^4.1.0",
71
- "@types/node": "^20.17.10",
71
+ "@types/node": "^22.10.10",
72
72
  "@typescript-eslint/eslint-plugin": "^8.19.0",
73
73
  "@typescript-eslint/parser": "^8.19.0",
74
74
  "cross-env": "^7.0.3",
@@ -81,12 +81,12 @@
81
81
  "tslint": "6.1.3",
82
82
  "turbo": "^2.3.3",
83
83
  "typescript": "~5.5.4",
84
- "@discordjs/api-extractor": "^7.38.1",
85
84
  "@discordjs/docgen": "^0.12.1",
85
+ "@discordjs/api-extractor": "^7.38.1",
86
86
  "@discordjs/scripts": "^0.1.0"
87
87
  },
88
88
  "engines": {
89
- "node": ">=20"
89
+ "node": ">=22.12.0"
90
90
  },
91
91
  "publishConfig": {
92
92
  "provenance": true
@@ -41,15 +41,12 @@ class GuildScheduledEventManager extends CachedManager {
41
41
  * Options for setting a recurrence rule for a guild scheduled event.
42
42
  * @typedef {Object} GuildScheduledEventRecurrenceRuleOptions
43
43
  * @property {DateResolvable} startAt The time the recurrence rule interval starts at
44
- * @property {?DateResolvable} endAt The time the recurrence rule interval ends at
45
44
  * @property {GuildScheduledEventRecurrenceRuleFrequency} frequency How often the event occurs
46
45
  * @property {number} interval The spacing between the events
47
46
  * @property {?GuildScheduledEventRecurrenceRuleWeekday[]} byWeekday The days within a week to recur on
48
47
  * @property {?GuildScheduledEventRecurrenceRuleNWeekday[]} byNWeekday The days within a week to recur on
49
48
  * @property {?GuildScheduledEventRecurrenceRuleMonth[]} byMonth The months to recur on
50
49
  * @property {?number[]} byMonthDay The days within a month to recur on
51
- * @property {?number[]} byYearDay The days within a year to recur on
52
- * @property {?number} count The total amount of times the event is allowed to recur before stopping
53
50
  */
54
51
 
55
52
  /**
@@ -29,11 +29,12 @@ const Targets = {
29
29
  Thread: 'Thread',
30
30
  ApplicationCommand: 'ApplicationCommand',
31
31
  AutoModeration: 'AutoModeration',
32
- GuildOnboarding: 'GuildOnboarding',
33
32
  GuildOnboardingPrompt: 'GuildOnboardingPrompt',
33
+ SoundboardSound: 'SoundboardSound',
34
34
  Unknown: 'Unknown',
35
35
  };
36
36
 
37
+ // TODO: Add soundboard sounds when https://github.com/discordjs/discord.js/pull/10590 is merged
37
38
  /**
38
39
  * The target of a guild audit log entry. It can be one of:
39
40
  * * A guild
@@ -42,8 +43,7 @@ const Targets = {
42
43
  * * A role
43
44
  * * An invite
44
45
  * * A webhook
45
- * * An emoji
46
- * * A message
46
+ * * A guild emoji
47
47
  * * An integration
48
48
  * * A stage instance
49
49
  * * A sticker
@@ -54,7 +54,7 @@ const Targets = {
54
54
  * * A guild onboarding prompt
55
55
  * * An object with an id key if target was deleted or fake entity
56
56
  * * An object where the keys represent either the new value or the old value
57
- * @typedef {?(Object|Guild|BaseChannel|User|Role|Invite|Webhook|GuildEmoji|Message|Integration|StageInstance|Sticker|
57
+ * @typedef {?(Object|Guild|BaseChannel|User|Role|Invite|Webhook|GuildEmoji|Integration|StageInstance|Sticker|
58
58
  * GuildScheduledEvent|ApplicationCommand|AutoModerationRule|GuildOnboardingPrompt)} AuditLogEntryTarget
59
59
  */
60
60
 
@@ -82,9 +82,10 @@ const Targets = {
82
82
  * * Sticker
83
83
  * * Thread
84
84
  * * GuildScheduledEvent
85
- * * ApplicationCommandPermission
86
- * * GuildOnboarding
85
+ * * ApplicationCommand
87
86
  * * GuildOnboardingPrompt
87
+ * * SoundboardSound
88
+ * * AutoModeration
88
89
  * * Unknown
89
90
  * @typedef {string} AuditLogTargetType
90
91
  */
@@ -198,7 +199,6 @@ class GuildAuditLogsEntry {
198
199
 
199
200
  case AuditLogEvent.MemberMove:
200
201
  case AuditLogEvent.MessageDelete:
201
- case AuditLogEvent.MessageBulkDelete:
202
202
  this.extra = {
203
203
  channel: guild.channels.cache.get(data.options.channel_id) ?? { id: data.options.channel_id },
204
204
  count: Number(data.options.count),
@@ -213,6 +213,7 @@ class GuildAuditLogsEntry {
213
213
  };
214
214
  break;
215
215
 
216
+ case AuditLogEvent.MessageBulkDelete:
216
217
  case AuditLogEvent.MemberDisconnect:
217
218
  this.extra = {
218
219
  count: Number(data.options.count),
@@ -364,10 +365,15 @@ class GuildAuditLogsEntry {
364
365
  data.action_type === AuditLogEvent.OnboardingPromptCreate
365
366
  ? new GuildOnboardingPrompt(guild.client, changesReduce(this.changes, { id: data.target_id }), guild.id)
366
367
  : changesReduce(this.changes, { id: data.target_id });
367
- } else if (targetType === Targets.GuildOnboarding) {
368
- this.target = changesReduce(this.changes, { id: data.target_id });
368
+ } else if (targetType === Targets.Role) {
369
+ this.target = guild.roles.cache.get(data.target_id) ?? { id: data.target_id };
370
+ } else if (targetType === Targets.Emoji) {
371
+ this.target = guild.emojis.cache.get(data.target_id) ?? { id: data.target_id };
372
+ // TODO: Uncomment after https://github.com/discordjs/discord.js/pull/10590 is merged
373
+ // } else if (targetType === Targets.SoundboardSound) {
374
+ // this.target = guild.soundboardSounds.cache.get(data.target_id) ?? { id: data.target_id };
369
375
  } else if (data.target_id) {
370
- this.target = guild[`${targetType.toLowerCase()}s`]?.cache.get(data.target_id) ?? { id: data.target_id };
376
+ this.target = { id: data.target_id };
371
377
  }
372
378
  }
373
379
 
@@ -391,9 +397,10 @@ class GuildAuditLogsEntry {
391
397
  if (target < 110) return Targets.GuildScheduledEvent;
392
398
  if (target < 120) return Targets.Thread;
393
399
  if (target < 130) return Targets.ApplicationCommand;
394
- if (target >= 140 && target < 150) return Targets.AutoModeration;
400
+ if (target < 140) return Targets.SoundboardSound;
401
+ if (target < 143) return Targets.AutoModeration;
402
+ if (target < 146) return Targets.User;
395
403
  if (target >= 163 && target <= 165) return Targets.GuildOnboardingPrompt;
396
- if (target >= 160 && target < 170) return Targets.GuildOnboarding;
397
404
  return Targets.Unknown;
398
405
  }
399
406
 
@@ -419,10 +426,9 @@ class GuildAuditLogsEntry {
419
426
  AuditLogEvent.StickerCreate,
420
427
  AuditLogEvent.GuildScheduledEventCreate,
421
428
  AuditLogEvent.ThreadCreate,
429
+ AuditLogEvent.SoundboardSoundCreate,
422
430
  AuditLogEvent.AutoModerationRuleCreate,
423
- AuditLogEvent.AutoModerationBlockMessage,
424
431
  AuditLogEvent.OnboardingPromptCreate,
425
- AuditLogEvent.OnboardingCreate,
426
432
  ].includes(action)
427
433
  ) {
428
434
  return 'Create';
@@ -448,6 +454,7 @@ class GuildAuditLogsEntry {
448
454
  AuditLogEvent.StickerDelete,
449
455
  AuditLogEvent.GuildScheduledEventDelete,
450
456
  AuditLogEvent.ThreadDelete,
457
+ AuditLogEvent.SoundboardSoundDelete,
451
458
  AuditLogEvent.AutoModerationRuleDelete,
452
459
  AuditLogEvent.OnboardingPromptDelete,
453
460
  ].includes(action)
@@ -473,9 +480,12 @@ class GuildAuditLogsEntry {
473
480
  AuditLogEvent.GuildScheduledEventUpdate,
474
481
  AuditLogEvent.ThreadUpdate,
475
482
  AuditLogEvent.ApplicationCommandPermissionUpdate,
483
+ AuditLogEvent.SoundboardSoundUpdate,
476
484
  AuditLogEvent.AutoModerationRuleUpdate,
485
+ AuditLogEvent.AutoModerationBlockMessage,
486
+ AuditLogEvent.AutoModerationFlagToChannel,
487
+ AuditLogEvent.AutoModerationUserCommunicationDisabled,
477
488
  AuditLogEvent.OnboardingPromptUpdate,
478
- AuditLogEvent.OnboardingUpdate,
479
489
  ].includes(action)
480
490
  ) {
481
491
  return 'Update';
@@ -63,16 +63,12 @@ function _transformAPIMessageInteractionMetadata(client, messageInteractionMetad
63
63
  function _transformGuildScheduledEventRecurrenceRule(recurrenceRule) {
64
64
  return {
65
65
  start: new Date(recurrenceRule.startAt).toISOString(),
66
- // eslint-disable-next-line eqeqeq
67
- end: recurrenceRule.endAt != null ? new Date(recurrenceRule.endAt).toISOString() : recurrenceRule.endAt,
68
66
  frequency: recurrenceRule.frequency,
69
67
  interval: recurrenceRule.interval,
70
68
  by_weekday: recurrenceRule.byWeekday,
71
69
  by_n_weekday: recurrenceRule.byNWeekday,
72
70
  by_month: recurrenceRule.byMonth,
73
71
  by_month_day: recurrenceRule.byMonthDay,
74
- by_year_day: recurrenceRule.byYearDay,
75
- count: recurrenceRule.count,
76
72
  };
77
73
  }
78
74
 
@@ -1506,14 +1506,14 @@ export class GuildAuditLogsEntry<
1506
1506
  public get createdAt(): Date;
1507
1507
  public get createdTimestamp(): number;
1508
1508
  public executorId: Snowflake | null;
1509
- public executor: User | null;
1509
+ public executor: User | PartialUser | null;
1510
1510
  public extra: TAction extends keyof GuildAuditLogsEntryExtraField ? GuildAuditLogsEntryExtraField[TAction] : null;
1511
1511
  public id: Snowflake;
1512
1512
  public reason: string | null;
1513
1513
  public targetId: Snowflake | null;
1514
1514
  public target: TTargetType extends keyof GuildAuditLogsEntryTargetField<TAction>
1515
1515
  ? GuildAuditLogsEntryTargetField<TAction>[TTargetType]
1516
- : Role | GuildEmoji | { id: Snowflake } | null;
1516
+ : { id: Snowflake | undefined; [x: string]: unknown } | null;
1517
1517
  public targetType: TTargetType;
1518
1518
  public static actionType(action: AuditLogEvent): GuildAuditLogsActionType;
1519
1519
  public static targetType(target: AuditLogEvent): GuildAuditLogsTargetType;
@@ -5659,17 +5659,19 @@ interface GuildAuditLogsTypes {
5659
5659
  [AuditLogEvent.ThreadUpdate]: ['Thread', 'Update'];
5660
5660
  [AuditLogEvent.ThreadDelete]: ['Thread', 'Delete'];
5661
5661
  [AuditLogEvent.ApplicationCommandPermissionUpdate]: ['ApplicationCommand', 'Update'];
5662
+ [AuditLogEvent.SoundboardSoundCreate]: ['SoundboardSound', 'Create'];
5663
+ [AuditLogEvent.SoundboardSoundUpdate]: ['SoundboardSound', 'Update'];
5664
+ [AuditLogEvent.SoundboardSoundDelete]: ['SoundboardSound', 'Delete'];
5662
5665
  [AuditLogEvent.AutoModerationRuleCreate]: ['AutoModeration', 'Create'];
5663
5666
  [AuditLogEvent.AutoModerationRuleUpdate]: ['AutoModeration', 'Update'];
5664
5667
  [AuditLogEvent.AutoModerationRuleDelete]: ['AutoModeration', 'Delete'];
5665
- [AuditLogEvent.AutoModerationBlockMessage]: ['AutoModeration', 'Create'];
5666
- [AuditLogEvent.AutoModerationFlagToChannel]: ['AutoModeration', 'Create'];
5667
- [AuditLogEvent.AutoModerationUserCommunicationDisabled]: ['AutoModeration', 'Create'];
5668
+ [AuditLogEvent.AutoModerationBlockMessage]: ['User', 'Update'];
5669
+ [AuditLogEvent.AutoModerationFlagToChannel]: ['User', 'Update'];
5670
+ [AuditLogEvent.AutoModerationUserCommunicationDisabled]: ['User', 'Update'];
5668
5671
  [AuditLogEvent.OnboardingPromptCreate]: ['GuildOnboardingPrompt', 'Create'];
5669
5672
  [AuditLogEvent.OnboardingPromptUpdate]: ['GuildOnboardingPrompt', 'Update'];
5670
5673
  [AuditLogEvent.OnboardingPromptDelete]: ['GuildOnboardingPrompt', 'Delete'];
5671
- [AuditLogEvent.OnboardingCreate]: ['GuildOnboarding', 'Create'];
5672
- [AuditLogEvent.OnboardingUpdate]: ['GuildOnboarding', 'Update'];
5674
+ // Never have a target: CreatorMonetizationRequestCreated, CreatorMonetizationTermsAccepted, OnboardingCreate, OnboardingUpdate, HomeSettingsCreate, HomeSettingsUpdate
5673
5675
  }
5674
5676
 
5675
5677
  export type GuildAuditLogsActionType = GuildAuditLogsTypes[keyof GuildAuditLogsTypes][1] | 'All';
@@ -5680,7 +5682,7 @@ export interface GuildAuditLogsEntryExtraField {
5680
5682
  [AuditLogEvent.MemberPrune]: { removed: number; days: number };
5681
5683
  [AuditLogEvent.MemberMove]: { channel: VoiceBasedChannel | { id: Snowflake }; count: number };
5682
5684
  [AuditLogEvent.MessageDelete]: { channel: GuildTextBasedChannel | { id: Snowflake }; count: number };
5683
- [AuditLogEvent.MessageBulkDelete]: { channel: GuildTextBasedChannel | { id: Snowflake }; count: number };
5685
+ [AuditLogEvent.MessageBulkDelete]: { count: number };
5684
5686
  [AuditLogEvent.MessagePin]: { channel: GuildTextBasedChannel | { id: Snowflake }; messageId: Snowflake };
5685
5687
  [AuditLogEvent.MessageUnpin]: { channel: GuildTextBasedChannel | { id: Snowflake }; messageId: Snowflake };
5686
5688
  [AuditLogEvent.MemberDisconnect]: { count: number };
@@ -5721,13 +5723,13 @@ export interface GuildAuditLogsEntryExtraField {
5721
5723
  }
5722
5724
 
5723
5725
  export interface GuildAuditLogsEntryTargetField<TAction extends AuditLogEvent> {
5724
- User: User | null;
5726
+ User: User | PartialUser | null;
5725
5727
  Guild: Guild;
5726
5728
  Webhook: Webhook<WebhookType.ChannelFollower | WebhookType.Incoming>;
5727
5729
  Invite: Invite;
5728
- Emoji: GuildEmoji;
5729
- Role: Role;
5730
- Message: TAction extends AuditLogEvent.MessageBulkDelete ? Guild | { id: Snowflake } : User;
5730
+ Emoji: GuildEmoji | { id: Snowflake };
5731
+ Role: Role | { id: Snowflake };
5732
+ Message: TAction extends AuditLogEvent.MessageBulkDelete ? GuildTextBasedChannel | { id: Snowflake } : User | null;
5731
5733
  Integration: Integration;
5732
5734
  Channel: NonThreadGuildBasedChannel | { id: Snowflake; [x: string]: unknown };
5733
5735
  Thread: AnyThreadChannel | { id: Snowflake; [x: string]: unknown };
@@ -5735,8 +5737,10 @@ export interface GuildAuditLogsEntryTargetField<TAction extends AuditLogEvent> {
5735
5737
  Sticker: Sticker;
5736
5738
  GuildScheduledEvent: GuildScheduledEvent;
5737
5739
  ApplicationCommand: ApplicationCommand | { id: Snowflake };
5738
- AutoModerationRule: AutoModerationRule;
5739
- GuildOnboardingPrompt: GuildOnboardingPrompt;
5740
+ AutoModeration: AutoModerationRule;
5741
+ GuildOnboardingPrompt: GuildOnboardingPrompt | { id: Snowflake; [x: string]: unknown };
5742
+ // TODO: Update when https://github.com/discordjs/discord.js/pull/10590 is merged
5743
+ SoundboardSound: { id: Snowflake };
5740
5744
  }
5741
5745
 
5742
5746
  export interface GuildAuditLogsFetchOptions<Event extends GuildAuditLogsResolvable> {
@@ -5752,7 +5756,7 @@ export type GuildAuditLogsResolvable = AuditLogEvent | null;
5752
5756
  export type GuildAuditLogsTargetType = GuildAuditLogsTypes[keyof GuildAuditLogsTypes][0] | 'Unknown';
5753
5757
 
5754
5758
  export type GuildAuditLogsTargets = {
5755
- [Key in GuildAuditLogsTargetType]: GuildAuditLogsTargetType;
5759
+ [Key in GuildAuditLogsTargetType]: Key;
5756
5760
  };
5757
5761
 
5758
5762
  export type GuildBanResolvable = GuildBan | UserResolvable;
@@ -5979,8 +5983,6 @@ type BaseGuildScheduledEventRecurrenceRuleOptions<
5979
5983
  Extra extends {},
5980
5984
  > = {
5981
5985
  startAt: DateResolvable;
5982
- endAt?: DateResolvable;
5983
- count?: number;
5984
5986
  interval: number;
5985
5987
  frequency: Frequency;
5986
5988
  } & Extra;
@@ -1506,14 +1506,14 @@ export class GuildAuditLogsEntry<
1506
1506
  public get createdAt(): Date;
1507
1507
  public get createdTimestamp(): number;
1508
1508
  public executorId: Snowflake | null;
1509
- public executor: User | null;
1509
+ public executor: User | PartialUser | null;
1510
1510
  public extra: TAction extends keyof GuildAuditLogsEntryExtraField ? GuildAuditLogsEntryExtraField[TAction] : null;
1511
1511
  public id: Snowflake;
1512
1512
  public reason: string | null;
1513
1513
  public targetId: Snowflake | null;
1514
1514
  public target: TTargetType extends keyof GuildAuditLogsEntryTargetField<TAction>
1515
1515
  ? GuildAuditLogsEntryTargetField<TAction>[TTargetType]
1516
- : Role | GuildEmoji | { id: Snowflake } | null;
1516
+ : { id: Snowflake | undefined; [x: string]: unknown } | null;
1517
1517
  public targetType: TTargetType;
1518
1518
  public static actionType(action: AuditLogEvent): GuildAuditLogsActionType;
1519
1519
  public static targetType(target: AuditLogEvent): GuildAuditLogsTargetType;
@@ -5659,17 +5659,19 @@ interface GuildAuditLogsTypes {
5659
5659
  [AuditLogEvent.ThreadUpdate]: ['Thread', 'Update'];
5660
5660
  [AuditLogEvent.ThreadDelete]: ['Thread', 'Delete'];
5661
5661
  [AuditLogEvent.ApplicationCommandPermissionUpdate]: ['ApplicationCommand', 'Update'];
5662
+ [AuditLogEvent.SoundboardSoundCreate]: ['SoundboardSound', 'Create'];
5663
+ [AuditLogEvent.SoundboardSoundUpdate]: ['SoundboardSound', 'Update'];
5664
+ [AuditLogEvent.SoundboardSoundDelete]: ['SoundboardSound', 'Delete'];
5662
5665
  [AuditLogEvent.AutoModerationRuleCreate]: ['AutoModeration', 'Create'];
5663
5666
  [AuditLogEvent.AutoModerationRuleUpdate]: ['AutoModeration', 'Update'];
5664
5667
  [AuditLogEvent.AutoModerationRuleDelete]: ['AutoModeration', 'Delete'];
5665
- [AuditLogEvent.AutoModerationBlockMessage]: ['AutoModeration', 'Create'];
5666
- [AuditLogEvent.AutoModerationFlagToChannel]: ['AutoModeration', 'Create'];
5667
- [AuditLogEvent.AutoModerationUserCommunicationDisabled]: ['AutoModeration', 'Create'];
5668
+ [AuditLogEvent.AutoModerationBlockMessage]: ['User', 'Update'];
5669
+ [AuditLogEvent.AutoModerationFlagToChannel]: ['User', 'Update'];
5670
+ [AuditLogEvent.AutoModerationUserCommunicationDisabled]: ['User', 'Update'];
5668
5671
  [AuditLogEvent.OnboardingPromptCreate]: ['GuildOnboardingPrompt', 'Create'];
5669
5672
  [AuditLogEvent.OnboardingPromptUpdate]: ['GuildOnboardingPrompt', 'Update'];
5670
5673
  [AuditLogEvent.OnboardingPromptDelete]: ['GuildOnboardingPrompt', 'Delete'];
5671
- [AuditLogEvent.OnboardingCreate]: ['GuildOnboarding', 'Create'];
5672
- [AuditLogEvent.OnboardingUpdate]: ['GuildOnboarding', 'Update'];
5674
+ // Never have a target: CreatorMonetizationRequestCreated, CreatorMonetizationTermsAccepted, OnboardingCreate, OnboardingUpdate, HomeSettingsCreate, HomeSettingsUpdate
5673
5675
  }
5674
5676
 
5675
5677
  export type GuildAuditLogsActionType = GuildAuditLogsTypes[keyof GuildAuditLogsTypes][1] | 'All';
@@ -5680,7 +5682,7 @@ export interface GuildAuditLogsEntryExtraField {
5680
5682
  [AuditLogEvent.MemberPrune]: { removed: number; days: number };
5681
5683
  [AuditLogEvent.MemberMove]: { channel: VoiceBasedChannel | { id: Snowflake }; count: number };
5682
5684
  [AuditLogEvent.MessageDelete]: { channel: GuildTextBasedChannel | { id: Snowflake }; count: number };
5683
- [AuditLogEvent.MessageBulkDelete]: { channel: GuildTextBasedChannel | { id: Snowflake }; count: number };
5685
+ [AuditLogEvent.MessageBulkDelete]: { count: number };
5684
5686
  [AuditLogEvent.MessagePin]: { channel: GuildTextBasedChannel | { id: Snowflake }; messageId: Snowflake };
5685
5687
  [AuditLogEvent.MessageUnpin]: { channel: GuildTextBasedChannel | { id: Snowflake }; messageId: Snowflake };
5686
5688
  [AuditLogEvent.MemberDisconnect]: { count: number };
@@ -5721,13 +5723,13 @@ export interface GuildAuditLogsEntryExtraField {
5721
5723
  }
5722
5724
 
5723
5725
  export interface GuildAuditLogsEntryTargetField<TAction extends AuditLogEvent> {
5724
- User: User | null;
5726
+ User: User | PartialUser | null;
5725
5727
  Guild: Guild;
5726
5728
  Webhook: Webhook<WebhookType.ChannelFollower | WebhookType.Incoming>;
5727
5729
  Invite: Invite;
5728
- Emoji: GuildEmoji;
5729
- Role: Role;
5730
- Message: TAction extends AuditLogEvent.MessageBulkDelete ? Guild | { id: Snowflake } : User;
5730
+ Emoji: GuildEmoji | { id: Snowflake };
5731
+ Role: Role | { id: Snowflake };
5732
+ Message: TAction extends AuditLogEvent.MessageBulkDelete ? GuildTextBasedChannel | { id: Snowflake } : User | null;
5731
5733
  Integration: Integration;
5732
5734
  Channel: NonThreadGuildBasedChannel | { id: Snowflake; [x: string]: unknown };
5733
5735
  Thread: AnyThreadChannel | { id: Snowflake; [x: string]: unknown };
@@ -5735,8 +5737,10 @@ export interface GuildAuditLogsEntryTargetField<TAction extends AuditLogEvent> {
5735
5737
  Sticker: Sticker;
5736
5738
  GuildScheduledEvent: GuildScheduledEvent;
5737
5739
  ApplicationCommand: ApplicationCommand | { id: Snowflake };
5738
- AutoModerationRule: AutoModerationRule;
5739
- GuildOnboardingPrompt: GuildOnboardingPrompt;
5740
+ AutoModeration: AutoModerationRule;
5741
+ GuildOnboardingPrompt: GuildOnboardingPrompt | { id: Snowflake; [x: string]: unknown };
5742
+ // TODO: Update when https://github.com/discordjs/discord.js/pull/10590 is merged
5743
+ SoundboardSound: { id: Snowflake };
5740
5744
  }
5741
5745
 
5742
5746
  export interface GuildAuditLogsFetchOptions<Event extends GuildAuditLogsResolvable> {
@@ -5752,7 +5756,7 @@ export type GuildAuditLogsResolvable = AuditLogEvent | null;
5752
5756
  export type GuildAuditLogsTargetType = GuildAuditLogsTypes[keyof GuildAuditLogsTypes][0] | 'Unknown';
5753
5757
 
5754
5758
  export type GuildAuditLogsTargets = {
5755
- [Key in GuildAuditLogsTargetType]: GuildAuditLogsTargetType;
5759
+ [Key in GuildAuditLogsTargetType]: Key;
5756
5760
  };
5757
5761
 
5758
5762
  export type GuildBanResolvable = GuildBan | UserResolvable;
@@ -5979,8 +5983,6 @@ type BaseGuildScheduledEventRecurrenceRuleOptions<
5979
5983
  Extra extends {},
5980
5984
  > = {
5981
5985
  startAt: DateResolvable;
5982
- endAt?: DateResolvable;
5983
- count?: number;
5984
5986
  interval: number;
5985
5987
  frequency: Frequency;
5986
5988
  } & Extra;
@@ -2258,15 +2258,18 @@ expectType<Promise<{ channel: GuildTextBasedChannel | { id: Snowflake }; count:
2258
2258
  guild.fetchAuditLogs({ type: AuditLogEvent.MessageDelete }).then(al => al.entries.first()?.extra),
2259
2259
  );
2260
2260
 
2261
- expectType<Promise<User | null | undefined>>(
2261
+ expectType<Promise<User | PartialUser | null | undefined>>(
2262
2262
  guild.fetchAuditLogs({ type: AuditLogEvent.MemberKick }).then(al => al.entries.first()?.target),
2263
2263
  );
2264
2264
  expectType<Promise<StageInstance | undefined>>(
2265
2265
  guild.fetchAuditLogs({ type: AuditLogEvent.StageInstanceCreate }).then(al => al.entries.first()?.target),
2266
2266
  );
2267
- expectType<Promise<User | undefined>>(
2267
+ expectType<Promise<User | null | undefined>>(
2268
2268
  guild.fetchAuditLogs({ type: AuditLogEvent.MessageDelete }).then(al => al.entries.first()?.target),
2269
2269
  );
2270
+ expectType<Promise<GuildTextBasedChannel | { id: string } | undefined>>(
2271
+ guild.fetchAuditLogs({ type: AuditLogEvent.MessageBulkDelete }).then(al => al.entries.first()?.target),
2272
+ );
2270
2273
 
2271
2274
  declare const AuditLogChange: AuditLogChange;
2272
2275
  // @ts-expect-error