3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-14 21:31:50 +00:00

tags: fix category_id override criterion not working

This commit is contained in:
Dragory 2020-07-29 23:30:46 +03:00
parent c39d69dd5d
commit 5327d5534b
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1

View file

@ -15,7 +15,12 @@ export async function onMessageCreate(pluginData: PluginData<TagsPluginType>, 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<TagsPluginType>, 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