ImportChatInviteRequest.
Every time I get an error that the login link has expired. I tried all kinds of hashes, both with + and without it, various links (invitations and a link to the chat itself), substituted t.me/joinchat.
But nothing, what to do?
code: https://pastebin.com/7NXvTqAa
it must always be without +
Try to modify code like this chat = chat_link.split('/')[-1][1:] try: await client(ImportChatInviteRequest(f'{chat}')) except telethon.errors.rpcerrorlist.InviteHashExpiredError: await sleep(7) await client(ImportChatInviteRequest(f'{chat}')) except (telethon.errors.rpcerrorlist.FloodWaitError, telethon.errors.rpcerrorlist.UserAlreadyParticipantError) as e: print(e) else: peer = await client.get_peer_id(chat) client_info = await client.get_me() await bot.promote_chat_member(chat_id=peer, user_id=client_info.user_id, is_anonymous=True)
Обсуждают сегодня