mirror of https://github.com/kry008/Bot-2.0.git
rewrite help
parent
464ff0106b
commit
aedaec1961
|
@ -1,5 +1,6 @@
|
||||||
//optiona name of the command
|
//optiona name of the command
|
||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
|
const { prefix } = require('../config.json');
|
||||||
function getAllCommands(client) {
|
function getAllCommands(client) {
|
||||||
const commandFiles = fs.readdirSync('./commands').filter(file => file.endsWith('.js'));
|
const commandFiles = fs.readdirSync('./commands').filter(file => file.endsWith('.js'));
|
||||||
const allCommands = [];
|
const allCommands = [];
|
||||||
|
@ -19,7 +20,7 @@ function allCommandsNames(guild = true)
|
||||||
for(const command of commands)
|
for(const command of commands)
|
||||||
{
|
{
|
||||||
if(command.admin === false)
|
if(command.admin === false)
|
||||||
str += command.name + '\n';
|
str += command.name + ', ';
|
||||||
}
|
}
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
@ -31,7 +32,7 @@ function allCommandsNames(guild = true)
|
||||||
{
|
{
|
||||||
if(command.canBeUsedInDm)
|
if(command.canBeUsedInDm)
|
||||||
if(command.admin === false)
|
if(command.admin === false)
|
||||||
str += command.name + '\n';
|
str += command.name + ', ';
|
||||||
}
|
}
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
@ -83,7 +84,7 @@ module.exports = {
|
||||||
if(args.length === 0)
|
if(args.length === 0)
|
||||||
{
|
{
|
||||||
const commands = allCommandsNames();
|
const commands = allCommandsNames();
|
||||||
message.channel.send(commands);
|
message.channel.send(`Hi, my prefix is \`${prefix}\`\nIf you want to get help with a command, type \`${prefix}help <command>\` or \`/help <command>\` \n` + commands);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const command = getCommand(args[0]);
|
const command = getCommand(args[0]);
|
||||||
|
@ -91,6 +92,8 @@ module.exports = {
|
||||||
{
|
{
|
||||||
//send all commands
|
//send all commands
|
||||||
const commands = allCommandsNames();
|
const commands = allCommandsNames();
|
||||||
|
message.channel.send(`Hi, my prefix is \`${prefix}\`\nIf you want to get help with a command, type \`${prefix}help <command>\` or \`/help <command>\` \n` + commands);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
message.channel.send('Name: ' + command.name + '\nDescription: ' + command.description + '\nHelp: ' + command.help);
|
message.channel.send('Name: ' + command.name + '\nDescription: ' + command.description + '\nHelp: ' + command.help);
|
||||||
|
@ -101,7 +104,7 @@ module.exports = {
|
||||||
{
|
{
|
||||||
//send all commands
|
//send all commands
|
||||||
const commands = allCommandsNames();
|
const commands = allCommandsNames();
|
||||||
interaction.reply(commands);
|
interaction.reply(`Hi, my prefix is \`${prefix}\`\nIf you want to get help with a command, type \`${prefix}help <command>\` or \`/help <command>\` \n` + commands);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
interaction.reply('Name: ' + command.name + '\nDescription: ' + command.description + '\nHelp: ' + command.help);
|
interaction.reply('Name: ' + command.name + '\nDescription: ' + command.description + '\nHelp: ' + command.help);
|
||||||
|
|
|
@ -6,6 +6,6 @@ module.exports = {
|
||||||
once: true,
|
once: true,
|
||||||
execute(client) {
|
execute(client) {
|
||||||
console.log(`Ready! Logged in as ${client.user.tag}`);
|
console.log(`Ready! Logged in as ${client.user.tag}`);
|
||||||
client.user.setActivity('kry008.xyz/bot/i', { type: ActivityType.PLAYING });
|
client.user.setActivity('kry008.xyz/bot/i | To see how to support type /supportbot', { type: ActivityType.PLAYING });
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue