mirror of
https://github.com/danbulant/discord.js
synced 2026-06-05 07:42:09 +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
294f5ea5c8
commit
bb0ee59718
1 changed files with 3 additions and 5 deletions
|
|
@ -62,13 +62,11 @@ class GuildAuditLogs {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles possible promises for entry targets.
|
* Handles possible promises for entry targets.
|
||||||
* @returns {GuildAuditLogs}
|
* @returns {Promise<GuildAuditLogs>}
|
||||||
*/
|
*/
|
||||||
static build(...args) {
|
static build(...args) {
|
||||||
return new Promise(resolve => {
|
const logs = new GuildAuditLogs(...args);
|
||||||
const logs = new GuildAuditLogs(...args);
|
return Promise.all(logs.entries.map(e => e.target)).then(() => logs);
|
||||||
Promise.all(logs.entries.map(e => e.target)).then(() => resolve(logs));
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue