function helpAllCommands(commands) {
  // Get all command names and halfway index
  const commandNames = commands.map((command) => command.data.name).sort();
  const halfway = Math.ceil(commandNames.length / 2);

  return new MessageEmbed()
    .setColor(embedColour)
    .setTitle('Help')
    .setDescription(
      "Here's a list of all my commands. You can send `/help command_name:[command_name]` to get more information on a specific command."
    )
    .addFields([
      { name: '\u200b', inline: true, value: commandNames.slice(0, halfway).join('\n') },
      { name: '\u200b', inline: true, value: commandNames.slice(-halfway).join('\n') },
    ]);
}
/**
 * Create an embed for help on all bot commands.
 * @param {Collection<string, import('../typedefs/discord').SlashCommand>} commands - list of all slash commands for bot
 * @returns {MessageEmbed}
 */
Create an embed for help on all bot commands.
@param {Collection} commands - list of all slash commands for bot
@returns {MessageEmbed}
Create an embed for help on all bot commands . @param { Collection } commands - list of all slash commands for bot @returns { MessageEmbed }
function helpAllCommands(commands) {
  const commandNames = commands.map((command) => command.data.name).sort();
  const halfway = Math.ceil(commandNames.length / 2);
  return new MessageEmbed()
    .setColor(embedColour)
    .setTitle('Help')
    .setDescription(
      "Here's a list of all my commands. You can send `/help command_name:[command_name]` to get more information on a specific command."
    )
    .addFields([
      { name: '\u200b', inline: true, value: commandNames.slice(0, halfway).join('\n') },
      { name: '\u200b', inline: true, value: commandNames.slice(-halfway).join('\n') },
    ]);
}
function helpAllCommands ( commands ) { const commandNames = commands . map ( ( command ) => command . data . name ) . sort ( ) ; const halfway = Math . ceil ( commandNames . length / 2 ) ; return new MessageEmbed ( ) . setColor ( embedColour ) . setTitle ( 'Help' ) . setDescription ( "Here's a list of all my commands. You can send `/help command_name:[command_name]` to get more information on a specific command." ) . addFields ( [ { name : '\u200b' , inline : true , value : commandNames . slice ( 0 , halfway ) . join ( '\n' ) } , { name : '\u200b' , inline : true , value : commandNames . slice ( - halfway ) . join ( '\n' ) } , ] ) ; }
Create an embed for help on all bot commands.
Create an embed for help on all bot commands .
// Get all command names and halfway index