Fixed karmaCooldown

This commit is contained in:
Vlad Rud 2021-08-16 20:52:51 +03:00
parent be9867821e
commit 4e380f7286
1 changed files with 1 additions and 1 deletions

View File

@ -588,7 +588,7 @@ async function processKarma(msg, match, settings={}) {
// Дальше страшная строка для поиска недавних карма-выстрелов одного юзера другому
console.log("OLD CARMA SHOTS: ")
console.log({CarmaShots})
const carmaShot = CarmaShots.find((val, id) => val.from === from.id && val.to === to.id && (Date.now() - val.date) < chat.options.karmaCooldown)
const carmaShot = CarmaShots.find((val, id) => val.from === from.id && val.to === to.id && (Date.now() - val.date) < chat.options.karmaCooldown * 1000)
console.log("FOUND SHOT: ")
console.log({carmaShot})
if (carmaShot) {