Debugging print of messages

This commit is contained in:
Vlad Rud 2021-08-16 20:57:16 +03:00
parent 4e380f7286
commit 192642383a
1 changed files with 2 additions and 1 deletions

View File

@ -592,8 +592,9 @@ async function processKarma(msg, match, settings={}) {
console.log("FOUND SHOT: ") console.log("FOUND SHOT: ")
console.log({carmaShot}) console.log({carmaShot})
if (carmaShot) { if (carmaShot) {
let trigger = 'tooFast' + updateValue > 0 ? "Plus" : "Minus" const trigger = `tooFast${updateValue > 0 ? "Plus" : "Minus"}`
const messages = await Trigger.find({trigger:trigger, show: true}) const messages = await Trigger.find({trigger:trigger, show: true})
console.log({messages})
const message = messages[getRandomInt(0, messages.length)].text const message = messages[getRandomInt(0, messages.length)].text
bot.sendMessage(chat_id, message, {reply_to_message_id: msg.message_id}) bot.sendMessage(chat_id, message, {reply_to_message_id: msg.message_id})
return return