This commit is contained in:
JonnyBro 2022-01-06 15:37:52 +05:00
parent 175ac0d039
commit 9db7447c88

View file

@ -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();
message.success("general/setafk:SUCCESS", {
return message.success("general/setafk:SUCCESS", {
reason,
prefix: data.guild.prefix
});
data.userData.afk = reason;
data.userData.save();
};
}
};