forked from Galactic/galactic-bot
catch promises
This commit is contained in:
parent
12da2b390d
commit
7043e8f259
@ -126,7 +126,7 @@ class UtilityHook extends Observer {
|
|||||||
// Sometimes the member isn't available on the API for some reason,
|
// 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
|
// 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 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;
|
const setting = settings.welcomer;
|
||||||
if (!setting.enabled || !setting.message) return;
|
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);
|
const message = this._replaceTags(setting.message, member);
|
||||||
await channel.send(message).catch();
|
await channel.send(message).catch(() => null);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user