mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
Handing promise rejections from GuildAuditLogs#build to the user (#1474)
* handing guildauditlog's promise rejections to the user * Returning a new Promise to resolve a Promise.all is unnecessary. Also for the docs, it returns a Promise<GuildauditLogs>, not GuildAuditLogs directly. * totally did not removed that line
This commit is contained in:
@@ -62,13 +62,11 @@ class GuildAuditLogs {
|
||||
|
||||
/**
|
||||
* Handles possible promises for entry targets.
|
||||
* @returns {GuildAuditLogs}
|
||||
* @returns {Promise<GuildAuditLogs>}
|
||||
*/
|
||||
static build(...args) {
|
||||
return new Promise(resolve => {
|
||||
const logs = new GuildAuditLogs(...args);
|
||||
Promise.all(logs.entries.map(e => e.target)).then(() => resolve(logs));
|
||||
});
|
||||
const logs = new GuildAuditLogs(...args);
|
||||
return Promise.all(logs.entries.map(e => e.target)).then(() => logs);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user