From 944ae7932a74031663aaffac6862cd4b98137191 Mon Sep 17 00:00:00 2001 From: RedGuy12 <61329810+RedGuy12@users.noreply.github.com> Date: Sun, 27 Nov 2022 21:52:10 +0000 Subject: [PATCH] oh --- common/automod.js | 5 ++++- common/xp.js | 2 +- events/thread/update.ts | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/common/automod.js b/common/automod.js index 75905c4bd..4457efcd5 100644 --- a/common/automod.js +++ b/common/automod.js @@ -209,9 +209,12 @@ async function checkString(toCensor, message) { } } +const baseChannel=getBaseChannel(message.channel) +const parentChannel = baseChannel&&baseChannel.isDMBased()?baseChannel:baseChannel?.parent + if ( !badWordsAllowed(message.channel) && - CONSTANTS.channels.info?.id !== getBaseChannel(message.channel)?.parent.id && + (CONSTANTS.channels.info?.id !== parentChannel?.id) && !message.author?.bot ) { const botLinks = toCensor.match(/discord(?:app)?\.com\/(api\/)?oauth2\/authorize/gi); diff --git a/common/xp.js b/common/xp.js index 22b6fec29..d3c865f29 100644 --- a/common/xp.js +++ b/common/xp.js @@ -182,7 +182,7 @@ export default async function giveXp(to, amount = NORMAL_XP_PER_MESSAGE) { `\n\n*This week, ${ weekly.length } people chatted, and ${activeCount} people were active. Alltogether, people gained ${weekly.reduce( - (a, b) => a + b, + (a, b) => a + b.xp, 0, )} XP this week.*`, }); diff --git a/events/thread/update.ts b/events/thread/update.ts index b70961be9..832432899 100644 --- a/events/thread/update.ts +++ b/events/thread/update.ts @@ -15,7 +15,7 @@ import type Event from "../../common/types/event"; const event: Event<"threadUpdate"> = async function event(oldThread, newThread) { if (newThread.guild.id !== CONSTANTS.guild.id) return; - if (!shouldLog(newMessage.channel)) return; + if (!shouldLog(newThread)) return; if (newThread.parent?.id === CONSTANTS.channels.suggestions?.id) { suggestionsDatabase.data = suggestionsDatabase.data.map((suggestion) =>