Skip to content

Commit

Permalink
fix no warning bots
Browse files Browse the repository at this point in the history
  • Loading branch information
phil-flip committed Jun 1, 2024
1 parent 4124d66 commit b49b88e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion commands/warn/add.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ 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;
const user = interaction.options.getUser('user', true);
const userID = user.id;
// check if user is a bot
if (user.bot) return messageFail(interaction, 'This user is a bot and cannot be warned.');
// checking if user is AB
if (userID === client.user.id) return messageFail(interaction, 'You can\'t warn the bot itself!');
// add warn
Expand Down

0 comments on commit b49b88e

Please sign in to comment.