From c8c316d2a58329befbffaacabce0127bb9965043 Mon Sep 17 00:00:00 2001 From: levina <82658782+levina-lab@users.noreply.github.com> Date: Sat, 11 Dec 2021 13:44:02 +0700 Subject: [PATCH] fixes --- program/video.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/program/video.py b/program/video.py index 25e9110..faa8938 100644 --- a/program/video.py +++ b/program/video.py @@ -110,12 +110,14 @@ async def vplay(c: Client, m: Message): return else: try: - user_id = (await user.get_me()).id - link = await c.export_chat_invite_link(chat_id) - if "+" in link: - link_hash = (link.replace("+", "")).split("t.me/")[1] - await ubot.join_chat(link_hash) - await c.promote_member(chat_id, user_id) + invitelink = await c.export_chat_invite_link( + m.chat.id + ) + if invitelink.startswith("https://t.me/+"): + invitelink = invitelink.replace( + "https://t.me/+", "https://t.me/joinchat/" + ) + await user.join_chat(invitelink) except UserAlreadyParticipant: pass except Exception as e: