From 5327d5534b9576a89a38564752dba6fd1a487a31 Mon Sep 17 00:00:00 2001 From: Dragory <2606411+Dragory@users.noreply.github.com> Date: Wed, 29 Jul 2020 23:30:46 +0300 Subject: [PATCH] tags: fix category_id override criterion not working --- backend/src/plugins/Tags/util/onMessageCreate.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/backend/src/plugins/Tags/util/onMessageCreate.ts b/backend/src/plugins/Tags/util/onMessageCreate.ts index b9c16b89..803b6792 100644 --- a/backend/src/plugins/Tags/util/onMessageCreate.ts +++ b/backend/src/plugins/Tags/util/onMessageCreate.ts @@ -15,7 +15,12 @@ export async function onMessageCreate(pluginData: PluginData, ms const member = await resolveMember(pluginData.client, pluginData.guild, msg.user_id); if (!member) return; - const config = pluginData.config.getMatchingConfig({ member, channelId: msg.channel_id }); + const channel = pluginData.guild.channels.get(msg.channel_id) as TextChannel; + const config = pluginData.config.getMatchingConfig({ + member, + channelId: msg.channel_id, + categoryId: channel.parentID, + }); let deleteWithCommand = false; // Find potential matching tag, looping through categories first and checking dynamic tags last @@ -133,7 +138,6 @@ export async function onMessageCreate(pluginData: PluginData, ms return; } - const channel = pluginData.guild.channels.get(msg.channel_id) as TextChannel; const responseMsg = await channel.createMessage(renderedTag); // Save the command-response message pair once the message is in our database