As telegram bots reads groups updates, is there any way to read channel updates also?
-
you can add your bot to channel and check yourself – Slavik Sep 15 '16 at 12:31
-
1@Slavik I did it but bot couldn't read channel updates. – mohammad falahat Sep 16 '16 at 07:10
-
there is telegram-cli https://github.com/vysheng/tg client, you may try to watch updates through it – Slavik Sep 16 '16 at 07:37
4 Answers
At the moment, Telegram Bots API doesn't allow bots to receive messages in channels, so it is not possible to read them (unless you use a Telegram API one.
Update
Since November update, the api now supports channel post and edition updates.

- 2,293
- 14
- 22
-
4How can I join my bot into channels to get thier updates (channels which I am not thier admin) ? – SoheilYou Mar 15 '17 at 06:35
-
for not your channel:
if the channel is public, you can scrape from html code with address : https://t.me/s/ChannelName/messageId
if the channel is private, nothing to do
for your channel:
you can create a dummy group, then request 'forwardMessage
' to forward from channel to dummy group

- 6,656
- 4
- 18
- 22

- 41
- 1
Yes, you only have to add the bot to your channel.
This is a JSON RESPONSE
{"update_id":164442191, "channel_post":{"message_id":1405,"chat":{"id":-1001066700541,"title":"Underworld'S Creatures","username":"IlSottobosco","type":"channel"},"date":1499299471,"reply_to_message":{"message_id":1403,"chat":{"id":-100106670231,"title":"Underworld'S Creatures","username":"IlSottobosco","type":"channel"},"date":1499298047,"text":"Test"}}

- 160
- 3
- 14
-
Is there a way to get updates from a channel (not mine but where I am a subscriber) for every messages added? There are a lot of commercial bot that works but don't understand how they work – Giuseppe Lodi Rizzini Feb 24 '20 at 11:38
Yes. Just like groups and users update, but the difference is, you have to change ["message"]["text"] with ["channel_post"]["text"].
Take a look at this code:
$update = json_decode(file_get_contents("php://input"), TRUE);
$message = $update["message"]["text"]; // this will get users and groups messages.
$channel_post = $update["channel_post"]["text"]; // this will get messages send to the channel that bot is admin.

- 1
- 1