Skip to content

Commit

Permalink
Merge pull request #277 from arturdealcantara/patch-1
Browse files Browse the repository at this point in the history
Update modlog.js
  • Loading branch information
Sai Teja Madha authored Jan 31, 2023
2 parents 22df4bd + ec85ab8 commit 93dffa9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/commands/admin/modlog.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,17 @@ module.exports = {
},

async interactionRun(interaction, data) {
const response = await setChannel(interaction.options.getChannel("channel"), data.settings);
const channel = interaction.options.getChannel("channel");
const response = await setChannel(channel, data.settings);
return interaction.followUp(response);
},
};

async function setChannel(targetChannel, settings) {
if (!targetChannel && !settings.modlog_channel) {
return "It is already disabled";
}

if (targetChannel && !targetChannel.canSendEmbeds()) {
return "Ugh! I cannot send logs to that channel? I need the `Write Messages` and `Embed Links` permissions in that channel";
}
Expand Down

0 comments on commit 93dffa9

Please sign in to comment.