Skip to content
Permalink
Browse files

Echo

  • Loading branch information...
julioolvr committed Jun 15, 2016
1 parent 91f4413 commit 1686a61f026fbd28ee9a1a6244ad80ef8684acb9
Showing with 13 additions and 3 deletions.
  1. +1 −0 .env.example
  2. +1 −1 index.js
  3. +2 −1 package.json
  4. +9 −1 src/bot.js
@@ -0,0 +1 @@
BOT_TOKEN=123456789:abcdefghijklmnoprqstuvwxyz
@@ -7,5 +7,5 @@ var path = require('path')
require('babel-register')

var Bot = require('./src/bot').default
var bot = new Bot()
var bot = new Bot(process.env.BOT_TOKEN)
bot.start()
@@ -13,7 +13,8 @@
"babel": "^6.5.2",
"babel-preset-es2015": "^6.9.0",
"babel-register": "^6.9.0",
"dotenv": "^2.0.0"
"dotenv": "^2.0.0",
"node-telegram-bot-api": "^0.23.3"
},
"devDependencies": {
"babel-eslint": "^6.0.4",
@@ -1,5 +1,13 @@
import TelegramBotClient from 'node-telegram-bot-api'

export default class Bot {
constructor(token) {
this.client = new TelegramBotClient(token, { polling: true })
}

start() {
console.log('build me!')
this.client.on('message', message => {
this.client.sendMessage(message.chat.id, message.text)
})
}
}

0 comments on commit 1686a61

Please sign in to comment.
You can’t perform that action at this time.