mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-21 16:55:03 +00:00
made length check more readable
This commit is contained in:
parent
a616f0f254
commit
37024ff1e4
1 changed files with 6 additions and 4 deletions
|
@ -25,10 +25,12 @@ export const NicknameCmd = utilityCmd({
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const nicknameLength = args.nickname && [...args.nickname].length;
|
if (args.nickname) {
|
||||||
if (typeof nicknameLength === "number" && (nicknameLength < 2 || nicknameLength > 32)) {
|
const nicknameLength = [...args.nickname].length;
|
||||||
msg.channel.send(errorMessage("Nickname must be between 2 and 32 characters long"));
|
if (nicknameLength < 2 || nicknameLength > 32) {
|
||||||
return;
|
msg.channel.send(errorMessage("Nickname must be between 2 and 32 characters long"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const oldNickname = args.member.nickname || "<none>";
|
const oldNickname = args.member.nickname || "<none>";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue