Skip to content

Commit

Permalink
update fix failsafe to not allow warns on the bot
Browse files Browse the repository at this point in the history
  • Loading branch information
phil-flip committed Jan 19, 2024
1 parent 403985e commit 32c0dca
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions commands/warn/add.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ async function addWarn(Warn, serverID, userID, reason) {
module.exports.run = async (interaction, warnMessage, Warn, checkforInfectedGuilds) => {
// get information
const userID = interaction.options.getUser('user', true).id;
// checking if user is AB
if (userID === client.user.id) return messageFail(interaction, 'You can\'t warn the bot itself!');
// add warn
await addWarn(Warn, interaction.guild.id, userID, warnMessage);
messageSuccess(interaction, `The user with the ID \`${userID}\` got a new warning added.\n Warning other servers.`);
Expand Down

0 comments on commit 32c0dca

Please sign in to comment.