Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Node-red #7
Node-red #7
Comments
|
I am using a Python API to telegram and occasionally receive the same error, 409. |
|
This happens when to program with same token polls the telegram bots api. you can run only one bot with same token at the same time. |
|
@davidebene This was done by this merge #117 |
Hi. Has anyone tested the use of the module within node-red?
I declared globally the module within the settings.js of node-red, and I put the following sample code in a function node:
var TelegramBot = context.global.telegram;
var token = 'my-bot-token';
var bot = new TelegramBot(token, {polling: true});
bot.on('message', function (msg) {
var chatId = msg.chat.id;
var testMsg = "test message";
bot.sendMessage(chatId, testMsg, {caption: "I'm a bot!"});
});
But the debugger gives me the following error:
Unhandled rejection Error: 409 {"ok":false,"error_code":409,"description":"Error: Conflict: terminated by other long poll or webhook"}
at /usr/local/lib/node_modules/node-red/node_modules/node-telegram-bot-api/src/telegram.js:131:15
at tryCatcher (/usr/local/lib/node_modules/node-red/node_modules/node-telegram-bot-api/node_modules/bluebird/js/main/util.js:24:31)
at Promise._settlePromiseFromHandler (/usr/local/lib/node_modules/node-red/node_modules/node-telegram-bot-api/node_modules/bluebird/js/main/promise.js:489:31)
at Promise._settlePromiseAt (/usr/local/lib/node_modules/node-red/node_modules/node-telegram-bot-api/node_modules/bluebird/js/main/promise.js:565:18)
at Promise._settlePromises (/usr/local/lib/node_modules/node-red/node_modules/node-telegram-bot-api/node_modules/bluebird/js/main/promise.js:681:14)
at Async._drainQueue (/usr/local/lib/node_modules/node-red/node_modules/node-telegram-bot-api/node_modules/bluebird/js/main/async.js:123:16)
at Async._drainQueues (/usr/local/lib/node_modules/node-red/node_modules/node-telegram-bot-api/node_modules/bluebird/js/main/async.js:133:10)
at Async.drainQueues (/usr/local/lib/node_modules/node-red/node_modules/node-telegram-bot-api/node_modules/bluebird/js/main/async.js:15:14)
at process._tickCallback (node.js:442:13)
Thanks!