Obafunso Ridwan

Bot Command

Create and register bot commands created using tcli –create:command [name].

Create Bot Command

  # create bot command
  $ tcli --create:command orderPizza

  Creating orderPizza command...

  [INFO] Command orderPizza successfully generated.

  DONE

Register Bot Command

To register a new command created using tcli –create:command, open registerCommands.js and register it as below.

  // import the new command
  const { orderPizza } = require('./src/commands/orderPizza')

  /**
  * @description
  *
  * @param {*} bot
  * @returns {void}
  */
  exports.registerCommands = (bot) => {
      // register commands
      start(bot)

      // register the new command here
      orderPizza(bot)
  }

⏮️ Usage | Start Bot ⏭️