Skip to content

Commit

Permalink
fix(logs): don't return when there is not a log channel
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperchupuDev committed Oct 12, 2021
1 parent f2e44b8 commit d3078db
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions detector/logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,20 @@ module.exports = async ({ client, message, member, reaction, type }) => {
break;
}

if (!channel?.permissionsFor(client.user).has('SEND_MESSAGES') || !channel.viewable) {
return;
if (channel?.permissionsFor(client.user).has('SEND_MESSAGES') && channel.viewable) {
channel.send({
embeds: [{
title: 'G Removal',
url: 'https://h-projects.github.io/app/fuck-g/',
color: client.config.color,
fields,
thumbnail: {
url: member.displayAvatarURL({ dynamic: true })
}
}]
});
}

channel?.send({
embeds: [{
title: 'G Removal',
url: 'https://h-projects.github.io/app/fuck-g/',
color: client.config.color,
fields,
thumbnail: {
url: member.displayAvatarURL({ dynamic: true })
}
}]
});

if (logs === client.config.globalLogs) {
return;
}
Expand Down

0 comments on commit d3078db

Please sign in to comment.