From b015bec7f66526ec5e959ae99865845f4db4b181 Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Fri, 23 Jul 2021 22:02:44 -0400 Subject: feat: some shit - fix breaking changes - refactored active punishments into one table - made listeners args have stricter types --- src/listeners/message/level.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/listeners/message') 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 = 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, -- cgit