3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-16 22:21:51 +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 a72750b8d8
commit a1d188cc79
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1

View file

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