catch promises

This commit is contained in:
Erik 2022-08-19 15:52:30 +03:00
parent 12da2b390d
commit 7043e8f259
Signed by untrusted user: Navy.gif
GPG Key ID: 811EC0CD80E7E5FB

View File

@ -126,7 +126,7 @@ class UtilityHook extends Observer {
// Sometimes the member isn't available on the API for some reason,
// seeing if waiting a bit helps, so we don't try to patch a member that's still being processed on discord's API
await Util.wait(5 * 1000);
await member.roles.add(roles, 'Adding autoroles').catch(this.logger.error.bind(this.logger));
await member.roles.add(roles, 'Adding autoroles').catch(() => null);
}
@ -137,9 +137,11 @@ class UtilityHook extends Observer {
const setting = settings.welcomer;
if (!setting.enabled || !setting.message) return;
const channel = await user.createDM();
const channel = await user.createDM().catch(() => null);
if (!channel) return;
const message = this._replaceTags(setting.message, member);
await channel.send(message).catch();
await channel.send(message).catch(() => null);
}