Require exact plugin name

This commit is contained in:
thororen1234 2025-07-09 14:16:15 -04:00
parent 117501caf7
commit 84d13f574a
No known key found for this signature in database

View file

@ -299,7 +299,8 @@ export default definePlugin({
&& ((props.channel.id === SUPPORT_CHANNEL_ID && equicordSupport))
&& props.message.content?.includes("update");
const matchedPlugins = Object.keys(Vencord.Plugins.plugins).filter(name => (props.message.content?.toLowerCase() ?? "").includes(name.toLowerCase()));
const contentWords = (props.message.content?.toLowerCase().match(/\b\w+\b/g) ?? []);
const matchedPlugins = Object.keys(Vencord.Plugins.plugins).filter(name => contentWords.includes(name.toLowerCase()));
const matchedPlugin = matchedPlugins.sort((a, b) => b.length - a.length)[0];
const pluginData = matchedPlugin && Vencord.Plugins.plugins[matchedPlugin];
const equicordGuild = ChannelStore.getChannel(props.channel.id)?.guild_id === GUILD_ID;