All I want to do is say:
number_of_members = xyz(some_entity)
and get an integer back.
There's a method in the Telegram Bot API GetChatMembers(), but I don't think it's in the client API. The closest I see in the Telethon documentation is here:
But that wants to get a list of the members. I just need a count. Is there something easy?
Thanks, Lee
Get the full channel.
`
from telethon import client
from telethon.sync import TelegramClient
from telethon.tl.functions.channels import GetFullChannelRequest
client = TelegramClient('session_name', api_id, api_hash)
client.connect()
channel_connect = self.client.get_entity(channel_name)
channel_full_info = client(GetFullChannelRequest(channel=channel_connect))
print(channel_full_info.full_chat.participants_count)`
Most helpful comment
`
from telethon import client
from telethon.sync import TelegramClient
from telethon.tl.functions.channels import GetFullChannelRequest
client = TelegramClient('session_name', api_id, api_hash)
client.connect()
channel_connect = self.client.get_entity(channel_name)
channel_full_info = client(GetFullChannelRequest(channel=channel_connect))
print(channel_full_info.full_chat.participants_count)`