Skip to content

Instantly share code, notes, and snippets.

@deanshub
Last active January 4, 2019 14:43
Show Gist options
  • 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