mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-13 10:03:31 +01:00
refactor(GuildAuditLogs): remove build (#7704)
This commit is contained in:
@@ -733,7 +733,7 @@ class Guild extends AnonymousGuild {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const data = await this.client.rest.get(Routes.guildAuditLog(this.id), { query });
|
const data = await this.client.rest.get(Routes.guildAuditLog(this.id), { query });
|
||||||
return GuildAuditLogs.build(this, data);
|
return new GuildAuditLogs(this, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -66,16 +66,6 @@ class GuildAuditLogs {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Handles possible promises for entry targets.
|
|
||||||
* @returns {Promise<GuildAuditLogs>}
|
|
||||||
*/
|
|
||||||
static async build(...args) {
|
|
||||||
const logs = new GuildAuditLogs(...args);
|
|
||||||
await Promise.all(logs.entries.map(e => e.target));
|
|
||||||
return logs;
|
|
||||||
}
|
|
||||||
|
|
||||||
toJSON() {
|
toJSON() {
|
||||||
return Util.flatten(this);
|
return Util.flatten(this);
|
||||||
}
|
}
|
||||||
|
|||||||
1
packages/discord.js/typings/index.d.ts
vendored
1
packages/discord.js/typings/index.d.ts
vendored
@@ -1131,7 +1131,6 @@ export class GuildAuditLogs<T extends GuildAuditLogsResolvable = null> {
|
|||||||
private integrations: Collection<Snowflake | string, Integration>;
|
private integrations: Collection<Snowflake | string, Integration>;
|
||||||
public entries: Collection<Snowflake, GuildAuditLogsEntry<T>>;
|
public entries: Collection<Snowflake, GuildAuditLogsEntry<T>>;
|
||||||
public static Entry: typeof GuildAuditLogsEntry;
|
public static Entry: typeof GuildAuditLogsEntry;
|
||||||
public static build(...args: unknown[]): Promise<GuildAuditLogs>;
|
|
||||||
public toJSON(): unknown;
|
public toJSON(): unknown;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user