bug fix
This commit is contained in:
parent
41ba54bc1d
commit
e7533aa189
@ -77,21 +77,21 @@ class GuildLogger extends Observer {
|
||||
const { messageLog } = message.guild._settings;
|
||||
if(!messageLog.channel) return undefined;
|
||||
|
||||
const { ignoredRoles, ignoredChannels } = messageLog;
|
||||
const { bypass, ignore } = messageLog;
|
||||
const logChannel = await message.guild.resolveChannel(messageLog.channel);
|
||||
if(!logChannel) return undefined;
|
||||
|
||||
const perms = logChannel.permissionsFor(message.guild.me);
|
||||
if (!perms.has('SEND_MESSAGES') || !perms.has('VIEW_CHANNEL') || !perms.has('EMBED_LINKS')) return undefined;
|
||||
|
||||
if(ignoredRoles.length && message.member.roles.cache.size) {
|
||||
if(bypass.length && message.member.roles.cache.size) {
|
||||
const roles = message.member.roles.cache.map((r) => r.id);
|
||||
for (const role of ignoredRoles) {
|
||||
for (const role of bypass) {
|
||||
if (roles.includes(role)) return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
if (ignoredChannels && ignoredChannels.includes(message.channel.id)) return undefined;
|
||||
if (ignore && ignore.includes(message.channel.id)) return undefined;
|
||||
|
||||
const hook = await message.guild.getWebhook('messageLog');
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user