Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(GuildAuditLogs): Remove static build method #7704

Merged
merged 1 commit into from
Mar 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/discord.js/src/structures/Guild.js
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@ class Guild extends AnonymousGuild {
}

const data = await this.client.rest.get(Routes.guildAuditLog(this.id), { query });
return GuildAuditLogs.build(this, data);
return new GuildAuditLogs(this, data);
}

/**
Expand Down
10 changes: 0 additions & 10 deletions packages/discord.js/src/structures/GuildAuditLogs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
return Util.flatten(this);
}
Expand Down
1 change: 0 additions & 1 deletion packages/discord.js/typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1131,7 +1131,6 @@ export class GuildAuditLogs<T extends GuildAuditLogsResolvable = null> {
private integrations: Collection<Snowflake | string, Integration>;
public entries: Collection<Snowflake, GuildAuditLogsEntry<T>>;
public static Entry: typeof GuildAuditLogsEntry;
public static build(...args: unknown[]): Promise<GuildAuditLogs>;
public toJSON(): unknown;
}

Expand Down