Skip to content

Commit

Permalink
fix: err on not being able to send msg to user on manual kick/ban
Browse files Browse the repository at this point in the history
Fixes #143. Fixes RTBYTE-F in Sentry.
  • Loading branch information
rasmusgerdin committed Aug 24, 2020
1 parent d40ead8 commit 59aa852
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/lib/structures/ModEmbed.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,12 @@ class ModEmbed extends MessageEmbed {
if (this.modCase.silent) return null;
if (!this.client.users.cache.has(this.modCase.user.id)) return null;
if (this.modCase.user.id === this.client.user.id) return null;
if (this.modCase.user.bot) return null;
// eslint-disable-next-line max-len
return await this.modCase.user.send(this.modCase.moderator.id === this.client.user.id ?
if (this.modCase.user.bot || this.modCase.user.system) return null;
this.modCase.user.createDM().then((dm) => dm.send(this.modCase.moderator ? this.modCase.moderator.id === this.client.user.id ?
this.modCase.guild.language.get('MODERATION_LOG_BOILERPLATE_AUTO', this.modCase.guild) :
this.modCase.guild.language.get('MODERATION_LOG_BOILERPLATE', this.modCase.guild), { disableEveryone: true, embed: this });
this.modCase.guild.language.get('MODERATION_LOG_BOILERPLATE', this.modCase.guild) : '', { disableEveryone: true, embed: this }).catch((err) => err));

return true;
}

}
Expand Down

0 comments on commit 59aa852

Please sign in to comment.