mirror of
https://github.com/JonnyBro/JaBa.git
synced 2024-11-22 13:14:58 +05:00
47 lines
No EOL
1.1 KiB
JavaScript
47 lines
No EOL
1.1 KiB
JavaScript
const { SlashCommandBuilder } = require("discord.js"),
|
|
{ getUserXp } = require("mee6-levels-api");
|
|
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")),
|
|
aliases: [],
|
|
dirname: __dirname,
|
|
guildOnly: true,
|
|
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 level = (await getUserXp(interaction.guildId, interaction.member.id)).level;
|
|
|
|
data.memberData.level = level;
|
|
await data.memberData.save();
|
|
|
|
interaction.success("owner/debug:SUCCESS_LEVEL", {
|
|
username: interaction.member.toString(),
|
|
amount: level
|
|
});
|
|
}
|
|
}
|
|
|
|
module.exports = ImportMee6; |