Skip to content

Commit

Permalink
refactor(GuildAuditLogs): remove build
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiralite committed Mar 24, 2022
1 parent b520c3d commit db9e6b3
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 @@ -728,7 +728,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 @@ -98,16 +98,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;
}

/**
* The target of an entry. It can be one of:
* * A guild
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 @@ -1123,7 +1123,6 @@ export class GuildAuditLogs<T extends GuildAuditLogsResolvable = null> {
public static Targets: GuildAuditLogsTargets;
public static Entry: typeof GuildAuditLogsEntry;
public static actionType(action: number): GuildAuditLogsActionType;
public static build(...args: unknown[]): Promise<GuildAuditLogs>;
public static targetType(target: number): GuildAuditLogsTarget;
public toJSON(): unknown;
}
Expand Down

0 comments on commit db9e6b3

Please sign in to comment.