Skip to content

Commit

Permalink
refactor(GuildAuditLogs): remove build (#7704)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiralite committed Mar 24, 2022
1 parent 85e531f commit cedd053
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 12 deletions.
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

0 comments on commit cedd053

Please sign in to comment.