From 38234798921bfc4628bc7ff727ea335e2ded061c Mon Sep 17 00:00:00 2001 From: Austin M Date: Mon, 20 Apr 2020 13:33:26 -0700 Subject: [PATCH 1/2] :bug: Spam in DM causes errors Spam in DM's causes errors and could crash bot --- src/processes/antiraidListener.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/processes/antiraidListener.ts b/src/processes/antiraidListener.ts index 9165cf4..d352b35 100644 --- a/src/processes/antiraidListener.ts +++ b/src/processes/antiraidListener.ts @@ -30,7 +30,10 @@ export const antiraidListener: ProcessInterface = { // console.log(staffRole, seniorRole) client.on('message', async (message: Message) => { - if (message.author.bot) return + if (message.author.bot || message.channel.type === 'dm') return + console.log(message.channel.type) + console.log('HERE') + const lastKnownTimestamp = mentions.get(message.author.id) ?? null const userRoleIds = message.member.roles.cache.map(r => r.id) From ebce47c08e88bfa503dfa79c3aab288344cb19a2 Mon Sep 17 00:00:00 2001 From: Austin M Date: Mon, 20 Apr 2020 13:35:16 -0700 Subject: [PATCH 2/2] :recycle: Forgot debug statement Forgot to takeout debug statement --- src/processes/antiraidListener.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/processes/antiraidListener.ts b/src/processes/antiraidListener.ts index d352b35..f919620 100644 --- a/src/processes/antiraidListener.ts +++ b/src/processes/antiraidListener.ts @@ -31,8 +31,6 @@ export const antiraidListener: ProcessInterface = { client.on('message', async (message: Message) => { if (message.author.bot || message.channel.type === 'dm') return - console.log(message.channel.type) - console.log('HERE') const lastKnownTimestamp = mentions.get(message.author.id) ?? null