How can I get a list of all messages in Telegram group via the Bot API?
Asked Answered
M

2

6

I have a bot in Telegram, which query can I get a list of all messages in a group or channel?

As I understand, requests like:

 https://api.telegram.org/bot_token/getUpdates?chat_id=@chat

Let me get only updates, but how can I get a full list of posts using only the Bot API?

Mastrianni answered 18/4, 2017 at 16:38 Comment(0)
D
10

There's NO method to get previous messages like user at this time.

If I were you, I would use forwardMessage method, forward it to useless channel/group like trash can, and read returned Message object.w

Dawn answered 18/4, 2017 at 22:59 Comment(0)
S
4

You can't. This feature doesn't implemented in current Bot API version. However you can try Telegram API for your task - method messages.getHistory exactly matches your demand.

Swob answered 19/4, 2017 at 6:37 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.