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
channel | InputChannel | Anything entity-like will work if the library can find its Input version (e.g., usernames, Peer , User or Channel objects, etc.). |
dark | flag | This argument defaults to None and can be omitted. |
Known RPC errors
This request can cause 4 known errors:
BroadcastRequiredError | The request can only be used with a broadcast channel. |
ChatAdminRequiredError | Chat 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. |
ChpCallFailError | The statistics cannot be retrieved at this time. |
StatsMigrateError | The 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())