JaBa/commands/Economy/importmee6.js

51 lines
1.2 KiB
JavaScript
Raw Normal View History

2022-08-09 23:48:33 +05:00
const { SlashCommandBuilder } = require("discord.js"),
2022-08-10 00:37:10 +05:00
Mee6Api = require("../../helpers/mee6-api");
2022-08-09 23:48:33 +05:00
const BaseCommand = require("../../base/BaseCommand");
class ImportMee6 extends BaseCommand {
/**
*
* @param {import("../base/JaBa")} client
*/
constructor(client) {
super({
command: new SlashCommandBuilder()
.setName("importmee6")
.setDescription(client.translate("economy/importmee6:DESCRIPTION"))
.setDMPermission(false),
2022-08-09 23:48:33 +05:00
aliases: [],
dirname: __dirname,
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) {
2022-08-10 00:37:10 +05:00
await interaction.deferReply();
2022-08-10 00:37:10 +05:00
const level = (await Mee6Api.getUserXp(interaction.guildId, interaction.member)).level;
2022-08-09 23:48:33 +05:00
data.memberData.level = level;
await data.memberData.save();
2022-08-10 00:37:10 +05:00
interaction.editReply({
content: interaction.translate("owner/debug:SUCCESS_LEVEL", {
username: interaction.member.toString(),
amount: level
})
2022-08-09 23:48:33 +05:00
});
}
}
module.exports = ImportMee6;