mirror of
https://github.com/danbulant/discord.js
synced 2026-05-24 20:42:27 +00: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:
parent
6566c0d3c5
commit
f95f18b586
1 changed files with 3 additions and 5 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue