Naltox / telegram-node-bot

Node module for creating Telegram bots.
MIT License
721 stars 143 forks source link

the code out of the box doesn't work #86

Closed heidarsaleh closed 8 years ago

heidarsaleh commented 8 years ago

Hello, I tried the attached sample and I got an error: Cant find controller for update, code is below:

const Telegram = require('telegram-node-bot') const TelegramBaseController = Telegram.TelegramBaseController const tg = new Telegram.Telegram('I placed my token here')

class PingController extends TelegramBaseController { /* * @param {Scope} $ / pingHandler($) { $.sendMessage('pong') }

get routes() {
    return {
        'ping': 'pingHandler'
    }
}

}

tg.router .when(['ping'], new PingController())

alxrm commented 8 years ago

It's just a warning, you don't have a handler for this command

I've just tested this, it works fine