Skip to content

Commit

Permalink
Command interface - small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Krivov authored and Alex Krivov committed Mar 2, 2017
1 parent f00151e commit 48c40b1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
Binary file added .DS_Store
Binary file not shown.
4 changes: 4 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const TelegramBot = require('node-telegram-bot-api');
const botMessagesLogger = require('./lib/bot-messages-logger');
const commandInterface = require('./lib/command_interface');

//NOTE: You should create CONFIG file
const config = require('./CONFIG.json');
Expand All @@ -14,4 +15,7 @@ bot.getMe()
.then(me => {
console.log('Bot has been successfully authorized. Name is', me.first_name);
botMessagesLogger(bot);
})
.then(checkMessage => {
bot.on('text', msg => commandInterface.reactOnMessage(bot, msg));
});
1 change: 1 addition & 0 deletions lib/command_interface.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ module.exports = {
reactOnMessage: function reactOnMessage(bot, msg) {

//TODO - change bot name
//TODO - create anonymus command
const command = msg.text.replace(/@SkrivTest2bot$/, '');
let t = msg.text;

Expand Down

0 comments on commit 48c40b1

Please sign in to comment.