Fix possible error in error handling

This commit is contained in:
Dragory 2020-09-13 21:39:56 +03:00
parent 69a1df260e
commit c573ec5d5f
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1

View file

@ -52,7 +52,7 @@ if (process.env.NODE_ENV === "production") {
// Log it in the console as a warning and post a warning to the guild's log.
// tslint:disable:no-console
console.warn(`${err.guild.name}: [${err.code}] ${err.message}`);
console.warn(`${err.guild?.name || "Global"}: [${err.code}] ${err.message}`);
const logs = new GuildLogs(err.guild.id);
logs.log(LogType.BOT_ALERT, { body: `\`[${err.code}]\` ${err.message}` });