Skip to content

Commit

Permalink
fix oida command
Browse files Browse the repository at this point in the history
  • Loading branch information
akargl committed Feb 22, 2021
1 parent f0abf14 commit 4e4619b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions commands/oida.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ module.exports = {
}
const sourceid = message.author.id;

let oidacooldown = 1800;
let oidacooldown = 1800 * 1000;
if (client.settings.oidaCooldown) {
oidacooldown = client.settings.oidaCooldown;
}
Expand All @@ -36,9 +36,9 @@ module.exports = {
this.oidaCount[sourceid] = { oidaCount: 0, lasttarget: "", lastsource: "", lasttime: 0 };
}

if(this.oidaCount.hasOwnProperty(targetid)) {
if ((this.oidaCount[targetid].lasttarget == sourceid)
&& (this.oidaCount[targetid].lasttime > (Date.now() - oidacooldown))) {
if (this.oidaCount.hasOwnProperty(targetid)) {
if ((this.oidaCount[targetid].lasttarget === sourceid)
&& (this.oidaCount[sourceid].lasttime > (Date.now() - oidacooldown))) {
return message.reply("Zruckoidan spüts ned, sry");
}
if (this.oidaCount[targetid].lasttime > (Date.now() - oidacooldown)) {
Expand Down

0 comments on commit 4e4619b

Please sign in to comment.