2021-12-10 21:39:54 +05:00
|
|
|
const Command = require("../../base/Command.js");
|
|
|
|
|
|
|
|
class Setafk extends Command {
|
2021-12-26 19:29:37 +05:00
|
|
|
constructor(client) {
|
2021-12-10 21:39:54 +05:00
|
|
|
super(client, {
|
|
|
|
name: "setafk",
|
|
|
|
dirname: __dirname,
|
|
|
|
enabled: true,
|
|
|
|
guildOnly: false,
|
2021-12-26 19:29:37 +05:00
|
|
|
aliases: ["afk"],
|
2021-12-10 21:39:54 +05:00
|
|
|
memberPermissions: [],
|
2021-12-26 19:29:37 +05:00
|
|
|
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
2021-12-10 21:39:54 +05:00
|
|
|
nsfw: false,
|
2021-12-22 17:32:50 +05:00
|
|
|
ownerOnly: false,
|
2022-01-01 00:50:09 +05:00
|
|
|
cooldown: 2000
|
2021-12-10 21:39:54 +05:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2021-12-26 19:29:37 +05:00
|
|
|
async run(message, args, data) {
|
2021-12-10 21:39:54 +05:00
|
|
|
const reason = args.join(" ");
|
2021-12-11 01:11:50 +05:00
|
|
|
if (!reason) return message.error("general/setafk:MISSING_REASON");
|
2021-12-29 02:15:26 +05:00
|
|
|
if (reason === "delete") {
|
|
|
|
if (data.userData.afk) {
|
|
|
|
data.userData.afk = null;
|
|
|
|
await data.userData.save();
|
|
|
|
message.sendT("general/setafk:DELETED", {
|
|
|
|
username: message.author.username
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
2021-12-10 21:39:54 +05:00
|
|
|
|
2021-12-26 19:29:37 +05:00
|
|
|
message.success("general/setafk:SUCCESS", {
|
|
|
|
reason
|
|
|
|
});
|
2021-12-10 21:39:54 +05:00
|
|
|
|
|
|
|
data.userData.afk = reason;
|
|
|
|
data.userData.save();
|
|
|
|
}
|
2021-12-11 01:11:50 +05:00
|
|
|
};
|
2021-12-10 21:39:54 +05:00
|
|
|
|
|
|
|
module.exports = Setafk;
|