2021-12-10 21:39:54 +05:00
|
|
|
const Command = require("../../base/Command.js");
|
|
|
|
|
|
|
|
class Setafk extends Command {
|
|
|
|
constructor (client) {
|
|
|
|
super(client, {
|
|
|
|
name: "setafk",
|
|
|
|
dirname: __dirname,
|
|
|
|
enabled: true,
|
|
|
|
guildOnly: false,
|
|
|
|
aliases: [ "afk" ],
|
|
|
|
memberPermissions: [],
|
|
|
|
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ],
|
|
|
|
nsfw: false,
|
2021-12-22 17:32:50 +05:00
|
|
|
ownerOnly: false,
|
|
|
|
cooldown: 3000
|
2021-12-10 21:39:54 +05:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
async run (message, args, data) {
|
|
|
|
const reason = args.join(" ");
|
2021-12-11 01:11:50 +05:00
|
|
|
if (!reason) return message.error("general/setafk:MISSING_REASON");
|
2021-12-10 21:39:54 +05:00
|
|
|
|
|
|
|
// Send success message
|
2021-12-11 01:11:50 +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;
|