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
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
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
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 think it should work fine if you don't run
bot.start(),bot.startessentially starts polling and nothing else.