Skip to content

Commit

Permalink
fix(detector): return if there is no clean nickname
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperchupuDev committed Nov 5, 2021
1 parent afd29f7 commit 9b358e4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion events/guildMemberUpdate.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module.exports = {
const cleanNickname = newMember.displayName.replace(/[.\-_ /\\()[\]]/giu, '');
const result = [...cleanNickname.matchAll(detector)];

if (result.length / cleanNickname.length < 0.75 || !newMember.manageable || !newMember.guild.me.permissions.has('MANAGE_NICKNAMES')) {
if (result.length / cleanNickname.length < 0.75 || !cleanNickname || !newMember.manageable || !newMember.guild.me.permissions.has('MANAGE_NICKNAMES')) {
return;
}

Expand Down

0 comments on commit 9b358e4

Please sign in to comment.