From a1d188cc79921faf527350bd31a32489c0f4397a Mon Sep 17 00:00:00 2001 From: Dragory <2606411+Dragory@users.noreply.github.com> Date: Mon, 24 May 2021 20:55:03 +0300 Subject: [PATCH] logs: fix excluded_roles for messages (vol 2) --- backend/src/plugins/Logs/util/log.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/backend/src/plugins/Logs/util/log.ts b/backend/src/plugins/Logs/util/log.ts index 7499c0c4..14d3da42 100644 --- a/backend/src/plugins/Logs/util/log.ts +++ b/backend/src/plugins/Logs/util/log.ts @@ -43,11 +43,13 @@ export async function log(pluginData: GuildPluginData, 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; + } } } }