Naltox / telegram-node-bot

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

problem on getting response from the simple demo #143

Open raminbp opened 7 years ago

raminbp commented 7 years ago

i cant get the response from the sample code :

'use strict'

const Telegram = require('telegram-node-bot')
const TelegramBaseController = Telegram.TelegramBaseController
const TextCommand = Telegram.TextCommand
const tg = new Telegram.Telegram('YOUR_TOKEN')

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

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

tg.router
    .when(
        new TextCommand('ping', 'pingCommand'),
        new PingController()
    )

i have added my token, but there is no response back when i put the command 'ping' for the bot

i check the fetch update process , and i saw that the updates are fetched but there is no push back to the bot. my node version is 6.9.1

amateurobot commented 7 years ago

`[log]
Telegram Master started, 4 CPUs found, 4 workers will start

[log]
WebAdmin started at localhost:7777

telegram2:server Listening on port 3000 +0ms [log]
Telegram Worker started at 7072 PID

[log]
Telegram Worker started at 5092 PID

[log]
Telegram Worker started at 6648 PID

[log]
Telegram Worker started at 5400 PID

F:\Apps\telegram2\bin\www:58 throw error; ^

Error: bind EADDRINUSE null:3000 at Object.exports._errnoException (util.js:1007:11) at exports._exceptionWithHostPort (util.js:1030:20) at cb (net.js:1318:16) at shared (cluster.js:619:5) at Worker. (cluster.js:592:9) at process. (cluster.js:765:8) at emitTwo (events.js:111:20) at process.emit (events.js:191:7) at process.nextTick (internal/child_process.js:719:12) at _combinedTickCallback (internal/process/next_tick.js:67:7) [log]
Telegram Worker 7072 died with code: 1, and signal: null, Starting a new worker

F:\Apps\telegram2\bin\www:58 throw error; ^

Error: bind EADDRINUSE null:3000 at Object.exports._errnoException (util.js:1007:11) at exports._exceptionWithHostPort (util.js:1030:20) at cb (net.js:1318:16) at shared (cluster.js:619:5) at Worker. (cluster.js:592:9) at process. (cluster.js:765:8) at emitTwo (events.js:111:20) at process.emit (events.js:191:7) at process.nextTick (internal/child_process.js:719:12) at _combinedTickCallback (internal/process/next_tick.js:67:7) [log]
Telegram Worker 5092 died with code: 1, and signal: null, Starting a new worker `

that's what I get for demo Code! what's the problem??

jesusgn90 commented 7 years ago

Maybe you have another process using port 3000?