How can I access to a Telegram channel messages with a bot registered as channel admin?
I am trying to get all the messages from Telegram channel and display them in an ASP.NET webpage (c#)
I am able to get updates when new message sent directly to the bot:
var json = wc.DownloadString(" https://api.telegram.org/bot<token>/getUpdates");
but its not working for the channel.
3
Answers
unfortunately it’s not possible yet.(they may come up with something in future) as admin you can just send messages to channel.
The only way until now is as follows:
privacy
todisabled
.Step 1 helps your bot to join the channel so it see the messages.
Step 2 makes your bot listening to all messages of the channel.
You can receive channel posts and channel post editing.
But you won’t receive it in
OnMessage
event, you can receive it fromOnUpdate
asMessage
object like code below:Note: The bot must be an administrator in the channel.