tdlib / td

Cross-platform library for building Telegram clients
https://core.telegram.org/tdlib
Boost Software License 1.0
7.11k stars 1.44k forks source link

Is there an implementation for retrieving media and attachments count in channels/supergroups? #2697

Closed seanvelasco closed 11 months ago

seanvelasco commented 11 months ago

I couldn't find any documentation for retrieving the count or number of media files and attachments in a channel.

There is member_count for getSupergroup, but there exists no member for media count, links count, or files count.

However, previewing a channel on https://t.me/s/channel, the site seems to able to display the above missing counts:

image

Perhaps this is unspecced?

levlam commented 11 months ago

You need to use the method getChatMessageCount for this.

seanvelasco commented 11 months ago

that was it - thank you very much!

example usage for getting links count:

{
    "@type": "getChatMessageCount",
    chat_id: -1001123464890,
    filter: {
        "@type": "searchMessagesFilterUrl"
    }
}