Telethon icon indicating copy to clipboard operation
Telethon copied to clipboard

Can't find entities with invite links

Open amirpdl opened this issue 3 years ago • 8 comments

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 ?

amirpdl avatar Feb 01 '22 12:02 amirpdl

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')

yesilOguz avatar Feb 05 '22 16:02 yesilOguz

same problem ++

keyiflerolsun avatar Feb 12 '22 08:02 keyiflerolsun

@yesilOguz it didn't work on a group with about 1200 members !

amirpdl avatar Feb 12 '22 09:02 amirpdl

@yesilOguz it didn't work on a group with about 1200 members !

what is error?

yesilOguz avatar Feb 16 '22 15:02 yesilOguz

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

DeerInBlack avatar Mar 09 '22 20:03 DeerInBlack

#3238 but that fix wasn't added to latest package version (1.24.0) as far as I can see

DeerInBlack avatar Mar 09 '22 22:03 DeerInBlack

Invite Link is : https://t.me/+XXXXXXXXXXXX

from telethon.tl.functions.messages import ImportChatInviteRequest

await client(ImportChatInviteRequest("XXXXXXXXXXX"))

it is work..

keyiflerolsun avatar Mar 10 '22 00:03 keyiflerolsun

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?

isengard1k avatar May 26 '22 19:05 isengard1k

Closing since new invite link hashes should work in the v1.25 available from PyPi.

Lonami avatar Sep 20 '22 16:09 Lonami