telegram-node-bot icon indicating copy to clipboard operation
telegram-node-bot copied to clipboard

problem on getting response from the simple demo

Open raminbp opened this issue 9 years ago • 2 comments

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

raminbp avatar Nov 02 '16 22:11 raminbp

`[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??

amateurobot avatar Dec 28 '16 09:12 amateurobot

Maybe you have another process using port 3000?

jesusgn90 avatar Feb 22 '17 23:02 jesusgn90