2022-07-12 20:10:35 +03:00
|
|
|
const { modHelp } = require('../admin/moderation.js');
|
|
|
|
|
|
2022-05-24 08:55:57 +03:00
|
|
|
module.exports ={
|
|
|
|
|
name: "help",
|
|
|
|
|
description: "Gets help for all of Selmer Bot's commands",
|
|
|
|
|
execute(message, args, Discord, Client, bot) {
|
|
|
|
|
|
2022-07-12 20:10:35 +03:00
|
|
|
const groups = new Map([['SBspec', ['arrow', 'extracredit', 'profile', 'quotes']], ['adminCommands', [ 'setup', 'lock', 'unlock', 'serverLock' ]]]);
|
|
|
|
|
|
2022-05-24 08:55:57 +03:00
|
|
|
if (args[0] == 'econ') {
|
|
|
|
|
let temp = "***Selmer Bot Commands (Econ):***\n";
|
|
|
|
|
temp += bot.commands.get('econ').econHelp();
|
2022-07-01 15:13:07 +03:00
|
|
|
temp += `\n\n(remember to use _'${bot.prefix}'_ before the command!)`;
|
2022-05-24 08:55:57 +03:00
|
|
|
return message.channel.send(temp);
|
2022-07-12 20:10:35 +03:00
|
|
|
|
2022-05-25 22:33:42 +03:00
|
|
|
}
|
|
|
|
|
else if (args[0] == 'game') {
|
2022-05-24 08:55:57 +03:00
|
|
|
let temp = "***Selmer Bot Commands (Games):***\n";
|
2022-05-25 22:33:42 +03:00
|
|
|
temp += bot.commands.get('game').allGames.join(", ");
|
2022-07-01 15:13:07 +03:00
|
|
|
temp += `\n\n(remember to use _'${bot.prefix}game'_ before the command!)`;
|
2022-05-25 22:33:42 +03:00
|
|
|
return message.channel.send(temp);
|
2022-07-12 20:10:35 +03:00
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else if (args[0] == 'admin') {
|
|
|
|
|
let temp = `__**Selmer Bot Admin Commands**__\n`
|
|
|
|
|
Array.from(groups.get('adminCommands')).forEach(commName => {
|
|
|
|
|
let comm = bot.commands.get(commName);
|
|
|
|
|
temp += `${comm.name.toLowerCase()} - _${comm.description}_\n`;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
temp += `__**Selmer Bot Moderation Commands**__\n`
|
|
|
|
|
temp += modHelp();
|
|
|
|
|
|
|
|
|
|
//Uses a different format, only the server owner can use it
|
|
|
|
|
temp += '\n_setup_ - ***SERVER OWNER ONLY*** - use _!setup help_\n';
|
|
|
|
|
temp += `\n\n(remember to use _'${bot.prefix}'_ before the command!)`;
|
|
|
|
|
|
|
|
|
|
return message.channel.send(temp);
|
2022-05-25 22:33:42 +03:00
|
|
|
}
|
2022-05-24 08:55:57 +03:00
|
|
|
|
|
|
|
|
let temp = "***Selmer Bot Commands:***\n";
|
|
|
|
|
|
2022-06-12 16:47:06 +03:00
|
|
|
bot.commands.sort((a, b) => {if (a.name && b.name) { return a.name[0] < b.name[0]} else {return false;} });
|
2022-05-24 08:55:57 +03:00
|
|
|
|
2022-07-12 20:10:35 +03:00
|
|
|
const noPostList = Array.from(groups.values()).flat();
|
|
|
|
|
const sList = groups.get('SBspec');
|
|
|
|
|
|
|
|
|
|
bot.commands.forEach((comm) => {
|
2022-05-24 08:55:57 +03:00
|
|
|
if (comm.name != 'verify') {
|
|
|
|
|
if (comm.name == 'econ') {
|
2022-07-12 20:10:35 +03:00
|
|
|
temp += `**econ** - use _!help econ_\n`;
|
2022-05-25 22:33:42 +03:00
|
|
|
}
|
|
|
|
|
else if (comm.name == 'game') {
|
2022-07-12 20:10:35 +03:00
|
|
|
temp += `**games** - use _!help game_\n`;
|
|
|
|
|
}
|
2022-05-25 22:33:42 +03:00
|
|
|
else {
|
2022-07-12 20:10:35 +03:00
|
|
|
if (comm.name && comm.description && !noPostList.includes(comm.name)) {
|
2022-06-12 16:47:06 +03:00
|
|
|
temp += `${comm.name.toLowerCase()} - _${comm.description}_\n`;
|
|
|
|
|
}
|
2022-05-24 08:55:57 +03:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
2022-07-12 20:10:35 +03:00
|
|
|
temp += '**admin/moderation commands** - use !help admin\n';
|
2022-07-09 20:30:31 +03:00
|
|
|
|
2022-07-12 20:10:35 +03:00
|
|
|
//Selmer Specific
|
|
|
|
|
temp += '\n__**Selmer\'s \\*Special\\* Commands**__\n'
|
|
|
|
|
sList.forEach((commName) => {
|
|
|
|
|
const comm = bot.commands.get(commName);
|
|
|
|
|
temp += `${comm.name.toLowerCase()} - _${comm.description}_\n`;
|
|
|
|
|
})
|
|
|
|
|
|
2022-05-24 08:55:57 +03:00
|
|
|
temp += `\n_(remember to use '${bot.prefix}' before the command!)_`;
|
2022-07-12 20:10:35 +03:00
|
|
|
|
2022-05-24 08:55:57 +03:00
|
|
|
message.channel.send(temp);
|
|
|
|
|
}
|
|
|
|
|
}
|