mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-14 10:33:30 +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.
|
* 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));
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user