From e6db2a9b8c1a555508f8c77eebecdea6fb36577c Mon Sep 17 00:00:00 2001 From: levina <82658782+levina-lab@users.noreply.github.com> Date: Tue, 2 Nov 2021 14:59:51 +0700 Subject: [PATCH] fixes again --- program/video.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/program/video.py b/program/video.py index 441ba9e..e22693f 100644 --- a/program/video.py +++ b/program/video.py @@ -323,22 +323,22 @@ async def vstream(_, m: Message): if b.status == "kicked": await m.reply_text(f"@{ASSISTANT_NAME} **is banned in group** {chat_title}\n\n» **unban the userbot first if you want to use this bot.**") return - except UserNotParticipant: - if m.chat.username: + except UserNotParticipant: + if m.chat.username: + try: + await call_py.join_chat(f"{m.chat.username}") + except Exception as e: + await m.reply_text(f"❌ **userbot failed to join**\n\n**reason**:{e}") + return + else: try: - await call_py.join_chat(f"{m.chat.username}") + pope = await _.export_chat_invite_link(m.chat.id) + pepo = await _.revoke_chat_invite_link(m.chat.id, pope) + await call_py.join_chat(pepo.invite_link) + except UserAlreadyParticipant: + pass except Exception as e: - await m.reply_text(f"❌ **userbot failed to join**\n\n**reason**:{e}") - return - else: - try: - pope = await _.export_chat_invite_link(m.chat.id) - pepo = await _.revoke_chat_invite_link(m.chat.id, pope) - await call_py.join_chat(pepo.invite_link) - except UserAlreadyParticipant: - pass - except Exception as e: - return await m.reply_text(f"❌ **userbot failed to join**\n\n**reason**:{e}") + return await m.reply_text(f"❌ **userbot failed to join**\n\n**reason**:{e}") chat_id = m.chat.id if len(m.command) < 2: await m.reply("» give me a live-link/m3u8 url/youtube link to stream.")