No polling, just sending messages? #25

Closed
opened 2016-08-21 10:44:29 +00:00 by derN3rd · 1 comment
derN3rd commented 2016-08-21 10:44:29 +00:00 (Migrated from github.com)

Hey there,

I want to use the node-telegram-api for sending notifications from my admin panel (of a nodejs project).
I've read trough all of the docs but I couldn't find out the most efficient way to send messages without polling all time.

Should I use code like

var sendNotification = function(message){
    bot.start();
    var notification = new Message().text(message).to(adminChatID);
    bot.send(notification);
    bot.stop();
}

or is there a way to start the bot at the beginning and just stop polling updates?
Or can I simply send messages without starting?

Thanks in advance

Hey there, I want to use the node-telegram-api for sending notifications from my admin panel (of a nodejs project). I've read trough all of the docs but I couldn't find out the most efficient way to send messages without polling all time. Should I use code like ``` var sendNotification = function(message){ bot.start(); var notification = new Message().text(message).to(adminChatID); bot.send(notification); bot.stop(); } ``` or is there a way to start the bot at the beginning and just stop polling updates? Or can I simply send messages without starting? Thanks in advance
mdibaiee commented 2016-08-24 06:12:27 +00:00 (Migrated from github.com)

Hey there!

I think it should work fine if you don't run bot.start(), bot.start essentially starts polling and nothing else.

Hey there! I think it should work fine if you don't run `bot.start()`, `bot.start` essentially starts polling and nothing else.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: thereadme/node-telegram-api#25
No description provided.