From f8b990e624ad063452b71d8cb14b850d94a9d065 Mon Sep 17 00:00:00 2001 From: levina <82658782+levina-lab@users.noreply.github.com> Date: Thu, 20 Jan 2022 21:23:52 +0700 Subject: [PATCH] fixed can't join chat --- program/video.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/program/video.py b/program/video.py index ea24085..730c4f6 100644 --- a/program/video.py +++ b/program/video.py @@ -100,16 +100,15 @@ async def vplay(c: Client, m: Message): invitelink = invitelink.replace( "https://t.me/+", "https://t.me/joinchat/" ) - await ubot.join_chat(invitelink) + await user.join_chat(invitelink) except UserNotParticipant: try: - ubot = (await user.get_me()).id invitelink = await c.export_chat_invite_link(chat_id) if invitelink.startswith("https://t.me/+"): invitelink = invitelink.replace( "https://t.me/+", "https://t.me/joinchat/" ) - await ubot.join_chat(invitelink) + await user.join_chat(invitelink) except UserAlreadyParticipant: pass except Exception as e: @@ -346,16 +345,15 @@ async def vstream(c: Client, m: Message): invitelink = invitelink.replace( "https://t.me/+", "https://t.me/joinchat/" ) - await ubot.join_chat(invitelink) + await user.join_chat(invitelink) except UserNotParticipant: try: - ubot = (await user.get_me()).id invitelink = await c.export_chat_invite_link(chat_id) if invitelink.startswith("https://t.me/+"): invitelink = invitelink.replace( "https://t.me/+", "https://t.me/joinchat/" ) - await ubot.join_chat(invitelink) + await user.join_chat(invitelink) except UserAlreadyParticipant: pass except Exception as e: