mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-17 20:13:30 +01:00
fix(GuildAuditLogsEntry): executor can be missing (#5500)
This commit is contained in:
@@ -319,11 +319,13 @@ class GuildAuditLogsEntry {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* The user that executed this entry
|
* The user that executed this entry
|
||||||
* @type {User}
|
* @type {?User}
|
||||||
*/
|
*/
|
||||||
this.executor = guild.client.options.partials.includes(PartialTypes.USER)
|
this.executor = data.user_id
|
||||||
? guild.client.users.add({ id: data.user_id })
|
? guild.client.options.partials.includes(PartialTypes.USER)
|
||||||
: guild.client.users.cache.get(data.user_id);
|
? guild.client.users.add({ id: data.user_id })
|
||||||
|
: guild.client.users.cache.get(data.user_id)
|
||||||
|
: null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An entry in the audit log representing a specific change.
|
* An entry in the audit log representing a specific change.
|
||||||
|
|||||||
2
typings/index.d.ts
vendored
2
typings/index.d.ts
vendored
@@ -744,7 +744,7 @@ declare module 'discord.js' {
|
|||||||
public changes: AuditLogChange[] | null;
|
public changes: AuditLogChange[] | null;
|
||||||
public readonly createdAt: Date;
|
public readonly createdAt: Date;
|
||||||
public readonly createdTimestamp: number;
|
public readonly createdTimestamp: number;
|
||||||
public executor: User;
|
public executor: User | null;
|
||||||
public extra: object | Role | GuildMember | null;
|
public extra: object | Role | GuildMember | null;
|
||||||
public id: Snowflake;
|
public id: Snowflake;
|
||||||
public reason: string | null;
|
public reason: string | null;
|
||||||
|
|||||||
Reference in New Issue
Block a user