mirror of
https://github.com/JonnyBro/JaBa.git
synced 2024-11-22 05:04:58 +05:00
new debug command
This commit is contained in:
parent
931403316b
commit
1f1289485b
3 changed files with 74 additions and 2 deletions
57
commands/Owner/debug.js
Normal file
57
commands/Owner/debug.js
Normal file
|
@ -0,0 +1,57 @@
|
|||
const Command = require("../../base/Command.js");
|
||||
|
||||
class Debug extends Command {
|
||||
constructor (client) {
|
||||
super(client, {
|
||||
name: "debug",
|
||||
dirname: __dirname,
|
||||
enabled: true,
|
||||
guildOnly: true,
|
||||
aliases: [],
|
||||
memberPermissions: [],
|
||||
botPermissions: [ "SEND_MESSAGES" ],
|
||||
nsfw: false,
|
||||
ownerOnly: true,
|
||||
cooldown: 3000
|
||||
});
|
||||
}
|
||||
|
||||
async run (message, args, data) {
|
||||
const action = args[0];
|
||||
if (!action || !["set", "add"].includes(status)) return message.error("owner/debug:NO_ACTION");
|
||||
|
||||
const status = args[1];
|
||||
if (!status || !["level", "xp", "credits", "bank", "rep"].includes(status)) return message.error("owner/debug:NO_STATUS");
|
||||
|
||||
const member = await this.client.resolveMember(args[2], message.guild);
|
||||
if (!member) return message.error("owner/debug:INVALID_MEMBER");
|
||||
if (member.user.bot) return message.error("owner/debug:BOT_USER");
|
||||
|
||||
const number = args[3];
|
||||
if (!number || isNaN(number)) return message.error("owner/debug:INVALID_AMOUNT");
|
||||
const amount = Math.ceil(parseInt(number, 10));
|
||||
|
||||
const memberData = await this.client.findOrCreateMember({ id: member.id, guildID: message.guild.id });
|
||||
|
||||
if (status === "level") {
|
||||
memberData.level = parseInt(amount, 10);
|
||||
memberData.save();
|
||||
} else if (status === "xp") {
|
||||
memberData.exp = parseInt(amount, 10);
|
||||
memberData.save();
|
||||
} else if (status === "rep") {
|
||||
memberData.rep = parseInt(amount, 10);
|
||||
memberData.save();
|
||||
} else if (status === "credits") {
|
||||
memberData.money = parseInt(amount, 10);
|
||||
memberData.save();
|
||||
} else if (status === "bank") {
|
||||
memberData.bankSold = parseInt(amount, 10);
|
||||
memberData.save();
|
||||
}
|
||||
|
||||
message.success("owner/debug:SUCCESS_" + status.toUpperCase() , { username: member.user.tag, amount });
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = Debug;
|
|
@ -3,7 +3,7 @@
|
|||
"USAGE": "{{prefix}}set [level/xp/credits/bank] [@пользователь] [значение]",
|
||||
"EXAMPLES": "{{prefix}}set level @Jonny_Bro#4226 10",
|
||||
"INVALID_MEMBER": "Вы должны упомянуть пользователя!",
|
||||
"NO_STATUS": "Выберите действие: `level`, `xp`, `credits` или `bank`",
|
||||
"NO_STATUS": "Выберите параметр: `level`, `xp`, `credits` или `bank`",
|
||||
"BOT_USER": "У ботов нет профиля!",
|
||||
"INVALID_AMOUNT": "Укажите новое значение!",
|
||||
"SUCCESS_LEVEL": "Уровень пользователя **{{username}}** изменён на **{{amount}}**!",
|
||||
|
|
15
languages/ru-RU/owner/debug.json
Normal file
15
languages/ru-RU/owner/debug.json
Normal file
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
"DESCRIPTION": "Позволяет изменять многие данные пользователя!",
|
||||
"USAGE": "{{prefix}}debug [set/add] [level/xp/credits/bank/rep] [@пользователь] [значение]",
|
||||
"EXAMPLES": "{{prefix}}debug set level @Jonny_Bro#4226 10000",
|
||||
"INVALID_MEMBER": "Вы должны упомянуть пользователя!",
|
||||
"NO_ACTION": "Выберите действие: `set` или `add`!",
|
||||
"NO_STATUS": "Выберите параметр: `level`, `xp`, `credits`, `rep` или `bank`!",
|
||||
"BOT_USER": "У ботов нет профиля!",
|
||||
"INVALID_AMOUNT": "Укажите новое значение!",
|
||||
"SUCCESS_LEVEL": "Уровень пользователя **{{username}}** изменён на **{{amount}}**!",
|
||||
"SUCCESS_XP": "XP пользователя **{{username}}** изменён на **{{amount}}**!",
|
||||
"SUCCESS_CREDITS": "Кредиты пользователя **{{username}}** изменены на **{{amount}}**!",
|
||||
"SUCCESS_BANK": "Банк пользователя **{{username}}** изменён на **{{amount}}**!",
|
||||
"SUCCESS_REP": "Очки репутации пользователя **{{username}}** изменены на **{{amount}}**!"
|
||||
}
|
Loading…
Reference in a new issue