Telethon
Telethon copied to clipboard
Can't find entities with invite links
Hi Telegram has released a new update and you can create as many invite link as you want for single group , links are like https://t.me/+LQzjVXu8q34wMDc0
Now I can not find entities using this links , I use this method for public groups that has username
receiver = client.get_entity(GP_LINK)
And for groups that only has join link I use :
client(ImportChatInviteRequest(HASH))
but for this new kind of links these methods does not solve the problem !
any help ?
this problem is related to '+' sign. and the get_entity method doesn't seem to work in small groups for some reason. you can take entity from big groups like this:
client.get_entity('LQzjVXu8q34wMDc0')
same problem ++
@yesilOguz it didn't work on a group with about 1200 members !
@yesilOguz it didn't work on a group with about 1200 members !
what is error?
The problem is with regex patterns used in telethon.utils.parse_username function (the one that is called in telethon.utils.resolve_invite_link and other methods). Just it! Can fix it, test and make pull request
#3238 but that fix wasn't added to latest package version (1.24.0) as far as I can see
Invite Link is : https://t.me/+XXXXXXXXXXXX
from telethon.tl.functions.messages import ImportChatInviteRequest
await client(ImportChatInviteRequest("XXXXXXXXXXX"))
it is work..
Invite Link is : https://t.me/+XXXXXXXXXXXX
from telethon.tl.functions.messages import ImportChatInviteRequest await client(ImportChatInviteRequest("XXXXXXXXXXX"))it is work..
I can't get entity from most of such links in such way. Have somebody found solution?
Closing since new invite link hashes should work in the v1.25 available from PyPi.