diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-07-19 16:48:17 -0400 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-07-19 16:48:17 -0400 |
commit | d29be9345dedefa08e7ae4073cd07c5ac9a661d4 (patch) | |
tree | 52b1b3cffbf28b87f1880a74c74bc02696277f22 /src/listeners/message | |
parent | c486d655de34c0827ef2614733af289be5139bc3 (diff) | |
download | tanzanite-d29be9345dedefa08e7ae4073cd07c5ac9a661d4.tar.gz tanzanite-d29be9345dedefa08e7ae4073cd07c5ac9a661d4.tar.bz2 tanzanite-d29be9345dedefa08e7ae4073cd07c5ac9a661d4.zip |
fix leveling
Diffstat (limited to 'src/listeners/message')
-rw-r--r-- | src/listeners/message/level.ts | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/listeners/message/level.ts b/src/listeners/message/level.ts index a50f580..1f57930 100644 --- a/src/listeners/message/level.ts +++ b/src/listeners/message/level.ts @@ -15,7 +15,7 @@ export default class LevelListener extends BushListener { if (!message.author) return; if (!message.guild) return; if (message.util?.parsed?.command) return; - if (this.levelCooldowns.has(message.guild.id + message.author.id)) return; + if (this.levelCooldowns.has(`${message.guild.id}-${message.author.id}`)) return; if (this.blacklistedChannels.includes(message.channel.id)) return; if (!['DEFAULT', 'REPLY'].includes(message.type)) return; //checks for join messages, slash commands, booster messages etc const [user] = await Level.findOrBuild({ @@ -25,7 +25,8 @@ export default class LevelListener extends BushListener { }, defaults: { user: message.author.id, - guild: message.guild.id + guild: message.guild.id, + xp: 0 } }); const xpToGive = Level.genRandomizedXp(); @@ -42,7 +43,7 @@ export default class LevelListener extends BushListener { `LevelMessageListener`, `Gave <<${xpToGive}>> XP to <<${message.author.tag}>> in <<${message.guild}>>.` ); - this.levelCooldowns.add(message.guild.id + message.author.id); - setTimeout(() => this.levelCooldowns.delete(message.author.id), 60_000); + this.levelCooldowns.add(`${message.guild.id}-${message.author.id}`); + setTimeout(() => this.levelCooldowns.delete(`${message.guild.id}-${message.author.id}`), 60_000); } } |