should actually fix !count

This commit is contained in:
jjj333_p 2023-10-29 14:20:13 -04:00
parent 56e32226e3
commit 472206143b

View file

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