Command Handler working

This commit is contained in:
ahoZiorce
2018-07-01 22:15:42 +02:00
parent c6c9dbf1c5
commit fa000a6c37
5 changed files with 25 additions and 13 deletions

View File

@@ -1,4 +1,11 @@
exports.loadModule = function loadModule (commandH) {
console.log('In debug.js');
console.log(commandH);
const commandH = require('../commandHandler');
const bot = require('../botClient').bot;
exports.loadModule = function loadModule () {
commandH.endpoint('^ping test$', (match, message) => {
bot.createMessage(message.channel.id, 'hey ho');
});
commandH.endpoint('^ping test (.*)$', (match, message) => {
bot.createMessage(message.channel.id, 'hey ho ' + match[1]);
});
}