generated from array-in-a-matrix/matrix-bot-template
should actually fix !count
This commit is contained in:
parent
56e32226e3
commit
472206143b
10
index.js
10
index.js
|
@ -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) => {
|
||||
|
|
Loading…
Reference in a new issue