From aedaec1961af4edcc56987713d3ce35f4aa59e3b Mon Sep 17 00:00:00 2001 From: kry008 Date: Sat, 8 Jun 2024 10:33:57 +0200 Subject: [PATCH] rewrite help --- commands/help.js | 11 +++++++---- events/ready.js | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/commands/help.js b/commands/help.js index 4109174..c1e8695 100644 --- a/commands/help.js +++ b/commands/help.js @@ -1,5 +1,6 @@ //optiona name of the command var fs = require('fs'); +const { prefix } = require('../config.json'); function getAllCommands(client) { const commandFiles = fs.readdirSync('./commands').filter(file => file.endsWith('.js')); const allCommands = []; @@ -19,7 +20,7 @@ function allCommandsNames(guild = true) for(const command of commands) { if(command.admin === false) - str += command.name + '\n'; + str += command.name + ', '; } return str; } @@ -31,7 +32,7 @@ function allCommandsNames(guild = true) { if(command.canBeUsedInDm) if(command.admin === false) - str += command.name + '\n'; + str += command.name + ', '; } return str; } @@ -83,7 +84,7 @@ module.exports = { if(args.length === 0) { 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 \` or \`/help \` \n` + commands); return; } const command = getCommand(args[0]); @@ -91,6 +92,8 @@ module.exports = { { //send all commands const commands = allCommandsNames(); + message.channel.send(`Hi, my prefix is \`${prefix}\`\nIf you want to get help with a command, type \`${prefix}help \` or \`/help \` \n` + commands); + return; } message.channel.send('Name: ' + command.name + '\nDescription: ' + command.description + '\nHelp: ' + command.help); @@ -101,7 +104,7 @@ module.exports = { { //send all commands 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 \` or \`/help \` \n` + commands); return; } interaction.reply('Name: ' + command.name + '\nDescription: ' + command.description + '\nHelp: ' + command.help); diff --git a/events/ready.js b/events/ready.js index 0f12c26..c90b91e 100644 --- a/events/ready.js +++ b/events/ready.js @@ -6,6 +6,6 @@ module.exports = { once: true, execute(client) { 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 }); }, };