Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from telethon.sync import TelegramClient
- from telethon import functions, types
- from telethon.tl.functions.messages import SendReactionRequest
- from telethon import functions, types
- from telethon.tl.functions.chatlists import JoinChatlistInviteRequest
- with TelegramClient(...) as client:
- hash = "esdbZr0CHrVhN2Iy"
- result = client(functions.chatlists.CheckChatlistInviteRequest(slug=hash))
- if isinstance(result, types.chatlists.ChatlistInviteAlready):
- print("chatlist already joined")
- else:
- print(f"ChatList: {hash} has {len(result.peers)} chats")
- result = client(
- functions.chatlists.JoinChatlistInviteRequest(slug=hash, peers=result.peers)
- )
- print("Joined")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement