More fixes, waitForInteraction (replacement for waitForReaction)

This commit is contained in:
Dark 2021-06-02 23:41:05 +02:00
parent edcfd2333f
commit d0c6e6f411
No known key found for this signature in database
GPG key ID: 384C4B4F5B1E25A8
13 changed files with 135 additions and 50 deletions

View file

@ -20,7 +20,10 @@ export async function isBanned(
}
try {
const potentialBan = await Promise.race([pluginData.guild.bans.fetch({ user: userId }), sleep(timeout)]);
const potentialBan = await Promise.race([
pluginData.guild.bans.fetch({ user: userId }).catch(() => null),
sleep(timeout),
]);
return potentialBan != null;
} catch (e) {
if (isDiscordRESTError(e) && e.code === 10026) {