3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-15 05:41: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 (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;
}
}
}
}