mirror of
https://github.com/JonnyBro/JaBa.git
synced 2024-11-28 16:14:59 +05:00
48 lines
No EOL
1.1 KiB
JavaScript
48 lines
No EOL
1.1 KiB
JavaScript
const { SlashCommandBuilder } = require("discord.js");
|
|
const BaseCommand = require("../../base/BaseCommand");
|
|
|
|
class Afk extends BaseCommand {
|
|
/**
|
|
*
|
|
* @param {import("../base/JaBa")} client
|
|
*/
|
|
constructor(client) {
|
|
super({
|
|
command: new SlashCommandBuilder()
|
|
.setName("afk")
|
|
.setDescription(client.translate("general/afk:DESCRIPTION"))
|
|
.addStringOption(option => option.setName("message")
|
|
.setDescription(client.translate("common:MESSAGE"))
|
|
.setRequired(true)),
|
|
aliases: [],
|
|
dirname: __dirname,
|
|
guildOnly: false,
|
|
ownerOnly: false
|
|
});
|
|
}
|
|
/**
|
|
*
|
|
* @param {import("../../base/JaBa")} client
|
|
*/
|
|
async onLoad() {
|
|
//...
|
|
}
|
|
/**
|
|
*
|
|
* @param {import("../../base/JaBa")} client
|
|
* @param {import("discord.js").ChatInputCommandInteraction} interaction
|
|
* @param {Object} data
|
|
*/
|
|
async execute(client, interaction, data) {
|
|
const reason = interaction.options.getString("message");
|
|
|
|
data.userData.afk = reason;
|
|
data.userData.save();
|
|
|
|
interaction.success("general/afk:SUCCESS", {
|
|
reason
|
|
}, { ephemeral: true });
|
|
}
|
|
}
|
|
|
|
module.exports = Afk; |