For the life of me, I can't figure out this one out. I have created a new Telegram Bot and created a new channel, in which I added my bot as an Admin.
After reading 100 times the docs, I tried to have the entity "seen" somehow but :
- get_dialogs() is not allowed for bots
- client.get_entity('') is not allowed for bots
Not sure what else to do…
I do have published some messages in the channel.
My code looks something like :
from telethon import TelegramClient
telethon_client = TelegramClient(
api_id=int(config['TELETHON_API_ID']),
api_hash=config['TELETHON_API_HASH'],
session=config['TELETHON_SESSION']
).start(bot_token=config['TELEGRAM_BOT_TOKEN'])
with telethon_client:
telethon_client.loop.run_until_complete(__async_get_users(chat_id))
async def __async_get_users(chat_id):
channel = await telethon_client.get_entity(chat_id) # -100xxxxx
tg_users = await telethon_client.get_participants(channel)
Any help, lead, or idea appreciated !