AshikNesin / nesinio-comments

1 stars 0 forks source link

blog/telegram-bot-send-message #7

Open utterances-bot opened 1 year ago

utterances-bot commented 1 year ago

Telegram Bot: How to Send Messages to Both Private and Group Chats

https://nesin.io/blog/telegram-bot-send-message

bharathvaj-ganesan commented 1 year ago

Hi Ashik, Thanks for the article, this easily helps in creating one, Just one correction, in the example code we can avoid awaiting while sending notification as this will block the current execution in responding back to the client.

AshikNesin commented 1 year ago

Thanks for the suggestions @bharathvaj-ganesan,

I mostly prefer blocking it since I mostly use it for critical cases but like you've mentioned notification may or may not be critical.

I'll make it explicit in the above snippet so that is is configurable :)

Edit: Just noticed, that I'm not performing any action so we can just return the promise and when we're calling it we can await it or not depending on our use case. Thanks again for flagging it.