more accurately detect if not a number

This commit is contained in:
jjj333_p 2023-10-29 14:44:13 -04:00
parent 4aa04ceda2
commit 512e8b96b9

View file

@ -37,7 +37,7 @@ const countCommand = async (roomId, message) => {
let count = data.count[message["sender"]]
//prevent undefined/NaN
if (!count) count = "0"
if (isNaN(count)) count = "0"
//send response
client.replyNotice(roomId, message, `You said linux ${count} times!`)