How to receive bot's messages in telegram? - node.js

I wrote some bot that sends messages to some channel using nodejs. This bot is an admin in that channel and it can see messages from users using /getupdates api. However it can't see own messages. Is there any way to do that?

Related

facebook webhook not receiving messages via messenger

So I'm tryin to get messages via messenger webhook. It is working well locally but when I try to send a message through messenger the callback(which is Heroku) isn't happening.
I was sending the messages with an account which had no role in the app and which was also a developer account which had Admin role.
I have subscribed to messages, messaging_postbacks, message_deliveries, message_reads, message_echoes, standby events for my webhook and added my page to it. I dont necessarily think im missing anything.
...a little help Captain??
Edit: I am now obtaining messages sent by clicking test button, but not when other developer accounts sent message through messenger

is it possible to send broadcast messages using Twilio whatsapp API

I am trying to integrate Twilio WhatsApp API with my application, is it possible to send broadcast messages using Twilio.
Twilio developer evangelist here.
You can send outbound messages over WhatsApp using Twilio. There are some constraints though.
You need to get your users to explicitly opt in to receive WhatsApp messages
When you send a notification to a user, if it is more than 24 hours since the user sent you a message you can only send approved template messages.
Twilio Notify does not support WhatsApp, so to broadcast messages to a group of users you will need to make one API request per message using the regular Twilio messaging API.
Let me know if that helps at all.

Use a bot as a user on Telegram

I'm using https://github.com/yagop/node-telegram-bot-api and I'm able to send message to user and to my channels. I'd like to improve my bot, I want to manage the private messages that my bot receives.
At the moment when the BOT receive a message, I can save on database from my node application, but if I want to manage all messages, I need to build a backoffice.
Is it possible to read the messages from Telegram and impersonate the BOT and start a normal conversation?
Using Telegram bot, Telegram does not provide any function to retrieve old messages. BOT API does not have such feature.
What you need is to use TDlib - The Telegram client API. It supports both bot and normal Telegram account. And it has many features not available in BOT API.
https://github.com/tdlib/td
There is an example of creating a Userbot on this github page: UserBot
There is also a library for managing a telegram account, which is used to create cross-platform telegram clients: TDLib

Could Telegram Bot has private chat?

I create a Bot and it able to send messages to my groups.
Now I'd like to create an interaction with it, like keyboard and so on.
I saw some bot that before use keyboard, and after the Human starts the chat in the same chat_id.
How Can I read and write like a human using Bot? Have I save the conversation (chat_id, user_id, messages) in a database and start a chat with API?
You can send message via sendMessage method from telegram bot api ( https://api.telegram.org/bot\*BOTTOKEN\*sendmessage)
and to receive you can create api to send a message to your handler, or use getUpdates method from telegram bot api

How to create an azure chat bot which can send chat messages without any user input

I have tried developing azure bots before. Currently I am trying to find out whether there is any way we could set up a bot that can constantly monitor something and send messages to particular users without user initiating a chat.
For instance, a bot monitors a system and find something wrong and sends a chat message to the user ( Bot initiates the chat in this case ). I did some research but couldn't find any way to achieve this yet.
Thanks in advance,
DM
This concept is called Proactive Messaging in the Bot Framework. There are some example in C# here: https://github.com/Microsoft/BotBuilder-Samples/tree/master/CSharp/core-proactiveMessages and node.js here: https://github.com/Microsoft/BotBuilder-Samples/tree/master/Node/core-proactiveMessages
Something to note is that different channels have different restrictions on when a proactive message can be sent to a user. For instance, on Facebook you have a 24 hour window from the time the user messaged the bot. After 24 hours, if the user has not messaged the bot, then proactive messages will not be allowed through.
More information can be found in this doc: https://learn.microsoft.com/en-us/bot-framework/dotnet/bot-builder-dotnet-proactive-messages
Edit:
You can also create a Functions Bot in Azure using the Proactive template and it will create a bot that has BasicProactiveEchoDialog.csx that demonstrates how to en-queue a CloudQueueMessage into a CloudStorageAccount. The template will also create an Azure Function that is triggered by additions to the queue. When the function is triggered, it will send the queued message to the user on the channel.

Resources