In Discord use !commands to return a list of all of your bot's commands!
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
//Lists all of the commands
let commands = await lib.discord.commands['@0.1.0'].list();
//Credit to MEIRBA for this part :)
let start = `- Red colored text is the command\n+ Green colored text is the command's description\n`
let list = start.concat(commands.map(c => `\n- /${c.name}\n+ ${c.description}\n`).join(''))
//Creates the message that includes all of your commands
await lib.discord.channels['@0.3.0'].messages.create({
channel_id: context.params.event.channel_id,
content: ``,
message_reference: {message_id: context.params.event.id},
embeds: [
{
title: `Commands`,
description:
`Here is a list of all my commands!\n\`\`\`diff\n` +
list +
`\`\`\``,
},
],
});