From aa86c763d4f05ad84a45ace5429d415d7108adb4 Mon Sep 17 00:00:00 2001 From: levina <82658782+levina-lab@users.noreply.github.com> Date: Sat, 26 Feb 2022 11:03:50 +0700 Subject: [PATCH 1/2] [check] some fixes try to fix export invite chat link floodwait --- program/music_stream.py | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/program/music_stream.py b/program/music_stream.py index 094622c..a34b27e 100644 --- a/program/music_stream.py +++ b/program/music_stream.py @@ -197,20 +197,21 @@ async def play(c: Client, m: Message): ubot = me_user.id b = await c.get_chat_member(chat_id, ubot) if b.status == "banned": - await m.reply_text("❌ The userbot is banned in this chat, unban the userbot first to be able to play music !") - return - invitelink = (await c.get_chat(chat_id)).invite_link - if not invitelink: - await c.export_chat_invite_link(chat_id) + try: + await m.reply_text("❌ The userbot is banned in this chat, unban the userbot first to be able to play music !") + await remove_active_chat(chat_id) + except BaseException: + pass invitelink = (await c.get_chat(chat_id)).invite_link - if invitelink.startswith("https://t.me/+"): - invitelink = invitelink.replace( - "https://t.me/+", "https://t.me/joinchat/" - ) + if not invitelink: + await c.export_chat_invite_link(chat_id) + invitelink = (await c.get_chat(chat_id)).invite_link + if invitelink.startswith("https://t.me/+"): + invitelink = invitelink.replace( + "https://t.me/+", "https://t.me/joinchat/" + ) await user.join_chat(invitelink) await remove_active_chat(chat_id) - except UserAlreadyParticipant: - pass except UserNotParticipant: try: invitelink = (await c.get_chat(chat_id)).invite_link From 260afdbbff0c8c84e3f3b7bf7d6799eba55a3773 Mon Sep 17 00:00:00 2001 From: levina <82658782+levina-lab@users.noreply.github.com> Date: Sat, 26 Feb 2022 11:08:04 +0700 Subject: [PATCH 2/2] [check] some fixes try to fix export chat invite link floodwait --- program/video_stream.py | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/program/video_stream.py b/program/video_stream.py index 450240a..df9d0d9 100644 --- a/program/video_stream.py +++ b/program/video_stream.py @@ -216,22 +216,23 @@ async def vplay(c: Client, m: Message): ) try: ubot = me_user.id - b = await c.get_chat_member(chat_id, ubot) + b = await c.get_chat_member(chat_id, ubot) if b.status == "banned": - await m.reply_text("❌ The userbot is banned in this chat, unban the userbot first to be able to play music !") - return - invitelink = (await c.get_chat(chat_id)).invite_link - if not invitelink: - await c.export_chat_invite_link(chat_id) + try: + await m.reply_text("❌ The userbot is banned in this chat, unban the userbot first to be able to play music !") + await remove_active_chat(chat_id) + except BaseException: + pass invitelink = (await c.get_chat(chat_id)).invite_link - if invitelink.startswith("https://t.me/+"): - invitelink = invitelink.replace( - "https://t.me/+", "https://t.me/joinchat/" - ) + if not invitelink: + await c.export_chat_invite_link(chat_id) + invitelink = (await c.get_chat(chat_id)).invite_link + if invitelink.startswith("https://t.me/+"): + invitelink = invitelink.replace( + "https://t.me/+", "https://t.me/joinchat/" + ) await user.join_chat(invitelink) await remove_active_chat(chat_id) - except UserAlreadyParticipant: - pass except UserNotParticipant: try: invitelink = (await c.get_chat(chat_id)).invite_link