GetBroadcastStatsRequest

Only users can use this request. See code examples.

---functions---
stats.getBroadcastStats#ab42441a flags:# dark:flags.0?true channel:InputChannel = stats.BroadcastStats

Returns

stats.BroadcastStats

This type can only be an instance of:

BroadcastStats

Parameters

channelInputChannelAnything entity-like will work if the library can find its Input version (e.g., usernames, Peer, User or Channel objects, etc.).
darkflagThis argument defaults to None and can be omitted.

Known RPC errors

This request can cause 4 known errors:

BroadcastRequiredErrorThe request can only be used with a broadcast channel.
ChatAdminRequiredErrorChat admin privileges are required to do that in the specified chat (for example, to send a message in a channel which is not yours), or invalid permissions used for the channel or group.
ChpCallFailErrorThe statistics cannot be retrieved at this time.
StatsMigrateErrorThe channel statistics must be fetched from DC {dc}.

You can import these from telethon.errors.

Example

from telethon.sync import TelegramClient
from telethon import functions, types

with TelegramClient(name, api_id, api_hash) as client:
    result = client(functions.stats.GetBroadcastStatsRequest(
        channel='username',
        dark=True
    ))
    print(result.stringify())