2022-08-09 23:48:33 +05:00
|
|
|
const { SlashCommandBuilder } = require("discord.js");
|
|
|
|
const BaseCommand = require("../../base/BaseCommand");
|
|
|
|
|
|
|
|
class Setbio extends BaseCommand {
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @param {import("../base/JaBa")} client
|
|
|
|
*/
|
|
|
|
constructor(client) {
|
|
|
|
super({
|
|
|
|
command: new SlashCommandBuilder()
|
|
|
|
.setName("setbio")
|
|
|
|
.setDescription(client.translate("economy/setbio:DESCRIPTION"))
|
2023-06-15 19:46:27 +05:00
|
|
|
.setDescriptionLocalizations({
|
2023-07-05 00:58:06 +05:00
|
|
|
uk: client.translate("economy/setbio:DESCRIPTION", null, "uk-UA"),
|
|
|
|
ru: client.translate("economy/setbio:DESCRIPTION", null, "ru-RU"),
|
2023-06-15 19:46:27 +05:00
|
|
|
})
|
2022-10-13 00:05:36 +05:00
|
|
|
.setDMPermission(true)
|
2023-07-05 00:58:06 +05:00
|
|
|
.addStringOption(option =>
|
|
|
|
option
|
|
|
|
.setName("text")
|
|
|
|
.setDescription(client.translate("economy/profile:BIO"))
|
|
|
|
.setDescriptionLocalizations({
|
|
|
|
uk: client.translate("economy/profile:BIO", null, "uk-UA"),
|
|
|
|
ru: client.translate("economy/profile:BIO", null, "ru-RU"),
|
|
|
|
})
|
|
|
|
.setRequired(true),
|
|
|
|
),
|
2022-08-09 23:48:33 +05:00
|
|
|
aliases: [],
|
|
|
|
dirname: __dirname,
|
2022-12-15 21:02:38 +05:00
|
|
|
ownerOnly: false,
|
2022-08-09 23:48:33 +05:00
|
|
|
});
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @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 newBio = interaction.options.getString("text");
|
|
|
|
if (newBio.length > 150) return interaction.error("economy/setbio:MAX_CHARACTERS");
|
|
|
|
|
|
|
|
data.userData.bio = newBio;
|
2023-09-25 21:42:43 +05:00
|
|
|
|
2022-08-09 23:48:33 +05:00
|
|
|
await data.userData.save();
|
2023-07-03 19:30:47 +05:00
|
|
|
|
2022-08-09 23:48:33 +05:00
|
|
|
interaction.success("economy/setbio:SUCCESS");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-07-05 00:58:06 +05:00
|
|
|
module.exports = Setbio;
|