Skip to content

Instantly share code, notes, and snippets.

@deanshub
Last active January 4, 2019 14:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deanshub/534586721437a3c75722553288f8c127 to your computer and use it in GitHub Desktop.
Save deanshub/534586721437a3c75722553288f8c127 to your computer and use it in GitHub Desktop.
import botCommander from './botCommander';
const commandsConfig = [{
name: 'start',
regex: /\/start$/,
disabled: false,
description: 'let the bot help you around',
},{
name: 'callback',
disabled: false,
}];
commandsConfig
.filter(command=>!command.disabled)
.forEach(command=>{
botCommander.addCommand(command, require(`./commands/${command.name}`)[command.fn||'default'])
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment