generated from array-in-a-matrix/matrix-bot-template
should actually fix !count
This commit is contained in:
parent
56e32226e3
commit
472206143b
1 changed files with 9 additions and 1 deletions
10
index.js
10
index.js
|
@ -33,7 +33,15 @@ const lbCommand = async (roomId, message) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const countCommand = 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) => {
|
const addCount = async (roomId, message) => {
|
||||||
|
|
Loading…
Add table
Reference in a new issue