diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-07-23 22:02:44 -0400 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-07-23 22:02:44 -0400 |
commit | b015bec7f66526ec5e959ae99865845f4db4b181 (patch) | |
tree | 67538c9549b7e0f7cd6a97e9c82db8d8462a19c7 /src/listeners/message | |
parent | 5c242f597595b8db71875d92c0afe0a5947442a6 (diff) | |
download | tanzanite-b015bec7f66526ec5e959ae99865845f4db4b181.tar.gz tanzanite-b015bec7f66526ec5e959ae99865845f4db4b181.tar.bz2 tanzanite-b015bec7f66526ec5e959ae99865845f4db4b181.zip |
feat: some shit
- fix breaking changes
- refactored active punishments into one table
- made listeners args have stricter types
Diffstat (limited to 'src/listeners/message')
-rw-r--r-- | src/listeners/message/level.ts | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/listeners/message/level.ts b/src/listeners/message/level.ts index 1f57930..b06fdd2 100644 --- a/src/listeners/message/level.ts +++ b/src/listeners/message/level.ts @@ -1,5 +1,5 @@ import { BushListener, Level } from '@lib'; -import { Message } from 'discord.js'; +import { Message, MessageType } from 'discord.js'; export default class LevelListener extends BushListener { private levelCooldowns: Set<string> = new Set(); @@ -17,7 +17,8 @@ export default class LevelListener extends BushListener { if (message.util?.parsed?.command) 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 allowedMessageTypes: MessageType[] = ['DEFAULT', 'REPLY']; // this is so ts will yell at me when discord.js makes some unnecessary breaking change + if (!allowedMessageTypes.includes(message.type)) return; //checks for join messages, slash commands, booster messages etc const [user] = await Level.findOrBuild({ where: { user: message.author.id, |