3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-20 16:25:03 +00:00

logs: fix excluded_roles for messages (vol 2)

This commit is contained in:
Dragory 2021-05-24 20:55:03 +03:00
parent 10b25ad7a9
commit bb7db8aa4c

View file

@ -43,11 +43,13 @@ export async function log(pluginData: GuildPluginData<LogsPluginType>, type: Log
}
if (opts.excluded_roles) {
if (data?.message instanceof SavedMessage) {
const member = pluginData.guild.members.get(data.message.user_id);
for (const role of member?.roles || []) {
if (opts.excluded_roles.includes(role)) {
continue logChannelLoop;
for (const value of Object.values(data || {})) {
if (value instanceof SavedMessage) {
const member = pluginData.guild.members.get(data.message.user_id);
for (const role of member?.roles || []) {
if (opts.excluded_roles.includes(role)) {
continue logChannelLoop;
}
}
}
}