diff --git a/commands/General/setafk.js b/commands/General/setafk.js index aae18653..99d46bb2 100644 --- a/commands/General/setafk.js +++ b/commands/General/setafk.js @@ -19,23 +19,25 @@ class Setafk extends Command { async run(message, args, data) { const reason = args.join(" "); if (!reason || reason.length > 250) return message.error("general/setafk:MISSING_REASON"); + if (reason === "delete") { if (data.userData.afk) { data.userData.afk = null; - await data.userData.save(); + data.userData.save(); + return message.sendT("general/setafk:DELETED", { username: message.author.username }); }; + } else { + data.userData.afk = reason; + data.userData.save(); + + return message.success("general/setafk:SUCCESS", { + reason, + prefix: data.guild.prefix + }); }; - - message.success("general/setafk:SUCCESS", { - reason, - prefix: data.guild.prefix - }); - - data.userData.afk = reason; - data.userData.save(); } };