diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-08-04 19:32:39 -0400 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-08-04 19:32:39 -0400 |
commit | b5793611d57a734d75b6a0845c441f33d144a5c0 (patch) | |
tree | 1deb4dc4cd0e1e575b1bc32ed0ae50085c7a3ecf /src/listeners/message | |
parent | 41c532de2c7786b2bb8ba5d78f092fed3cc6b63a (diff) | |
download | tanzanite-b5793611d57a734d75b6a0845c441f33d144a5c0.tar.gz tanzanite-b5793611d57a734d75b6a0845c441f33d144a5c0.tar.bz2 tanzanite-b5793611d57a734d75b6a0845c441f33d144a5c0.zip |
misc
Diffstat (limited to 'src/listeners/message')
-rw-r--r-- | src/listeners/message/blacklistedFile.ts | 8 | ||||
-rw-r--r-- | src/listeners/message/level.ts | 12 |
2 files changed, 10 insertions, 10 deletions
diff --git a/src/listeners/message/blacklistedFile.ts b/src/listeners/message/blacklistedFile.ts index 741b508..36bf2e9 100644 --- a/src/listeners/message/blacklistedFile.ts +++ b/src/listeners/message/blacklistedFile.ts @@ -4,7 +4,7 @@ import { BushListener } from '../../lib'; import { BushClientEvents } from '../../lib/extensions/discord.js/BushClientEvents'; export default class BlacklistedFileListener extends BushListener { - private blacklistedFiles: { hash: string[]; name: string; description: string }[] = [ + #blacklistedFiles: { hash: string[]; name: string; description: string }[] = [ { hash: ['a0f5e30426234bc9d09306ffc9474422'], name: 'Play twice audio', @@ -86,7 +86,7 @@ export default class BlacklistedFileListener extends BushListener { const rawHash = crypto.createHash('md5'); rawHash.update(req.rawBody.toString('binary')); const hash = rawHash.digest('hex'); - const blacklistData = this.blacklistedFiles.find((h) => h.hash.some((h) => h === hash)); + const blacklistData = this.#blacklistedFiles.find((h) => h.hash.some((h) => h === hash)); if (blacklistData !== undefined) { foundFiles.push(blacklistData); } @@ -100,7 +100,7 @@ export default class BlacklistedFileListener extends BushListener { const rawHash = crypto.createHash('md5'); rawHash.update(req.rawBody.toString('binary')); const hash = rawHash.digest('hex'); - const blacklistData = this.blacklistedFiles.find((h) => h.hash.some((h) => h === hash)); + const blacklistData = this.#blacklistedFiles.find((h) => h.hash.some((h) => h === hash)); if (blacklistData !== undefined) { foundFiles.push(blacklistData); } @@ -116,7 +116,7 @@ export default class BlacklistedFileListener extends BushListener { const rawHash = crypto.createHash('md5'); rawHash.update(req.rawBody.toString('binary')); const hash = rawHash.digest('hex'); - const blacklistData = this.blacklistedFiles.find((h) => h.hash.some((h) => h === hash)); + const blacklistData = this.#blacklistedFiles.find((h) => h.hash.some((h) => h === hash)); if (blacklistData !== undefined) { foundFiles.push(blacklistData); } diff --git a/src/listeners/message/level.ts b/src/listeners/message/level.ts index db4be4b..f5fb932 100644 --- a/src/listeners/message/level.ts +++ b/src/listeners/message/level.ts @@ -2,8 +2,8 @@ import { BushCommandHandlerEvents, BushListener, Level } from '@lib'; import { MessageType } from 'discord.js'; export default class LevelListener extends BushListener { - private levelCooldowns: Set<string> = new Set(); - private blacklistedChannels = ['702456294874808330']; + #levelCooldowns: Set<string> = new Set(); + #blacklistedChannels = ['702456294874808330']; public constructor() { super('level', { emitter: 'commandHandler', @@ -16,8 +16,8 @@ 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.blacklistedChannels.includes(message.channel.id)) return; + if (this.#levelCooldowns.has(`${message.guild.id}-${message.author.id}`)) return; + if (this.#blacklistedChannels.includes(message.channel.id)) return; 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({ @@ -41,7 +41,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.guild.id}-${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); } } |