Skip to content

Commands

LucasCtrl edited this page Oct 16, 2021 · 2 revisions

Commands

Commands list

Mode:

  • PROD: command that's work in DEV and PROD mode
  • DEV: command that's only work in DEV mode
Command Aliase(s) Desciption Mode
emitgc - Emulate guildCreate event DEV
emitgd - Emulate guildDelete event DEV
help - Display the help menu PROD
invite - Get an invitation link to invite the bot on your server PROD
ping - Give bot and API latency PROD
stats - Give some statistics about the bot PROD
support - Get the invitation link to join the support server PROD
vote upvote Vote for the bot PROD

Command file structure

The command file is an object exported as default.

Object structure

Key name Type Desciption Requirement
command String Text that will be fetched for running the command. Required
aliases Array of strings Alternative text that will be fetched for running the command. No quantity limit. Optional
help Object If this block doesn't exist, the command is not displayed in the help panel. Optional
help.name String Command name that will be displayed in the help panel. Required if help object
help.description String Command description that will be displayed in the help panel. Required if help object
run Function Action(s) that the bot need to do when he fetch the command. Required

Code example

export default {
  command: 'hello',
  aliases: ['hw'],
  help: {
    name: 'Hello world!',
    description: 'Send \'Hello world!\' in the channel'
  },

  run: async (client, message) => {
      message.reply('Hello world!') // Reply to the message that contained the command
  }
}
Clone this wiki locally