From 9154d7d97f7c1b6f9f2a399a57fcc544e27e26f7 Mon Sep 17 00:00:00 2001 From: levina <82658782+levina-lab@users.noreply.github.com> Date: Sun, 20 Feb 2022 18:16:46 +0700 Subject: [PATCH 1/5] none --- program/video.py | 1 + 1 file changed, 1 insertion(+) diff --git a/program/video.py b/program/video.py index 17e49bb..54174f3 100644 --- a/program/video.py +++ b/program/video.py @@ -113,6 +113,7 @@ async def play_tg_file(c: Client, m: Message, replied: Message = None, link: str duration = convert_seconds(replied.video.duration) elif replied.document: songname = replied.document.file_name[:80] + duration = convert_seconds(replied.document.duration) except BaseException: songname = "Video" From 6618051986a8880f50ba0c0df70173484bdfdab5 Mon Sep 17 00:00:00 2001 From: levina <82658782+levina-lab@users.noreply.github.com> Date: Sun, 20 Feb 2022 18:20:32 +0700 Subject: [PATCH 2/5] exception name --- program/speedtest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/program/speedtest.py b/program/speedtest.py index 9259ac4..2574331 100644 --- a/program/speedtest.py +++ b/program/speedtest.py @@ -36,7 +36,7 @@ async def run_speedtest(_, message: Message): img = Image.open(path) c = img.crop((17, 11, 727, 389)) c.save(path) - except: + except BaseException: pass output = f"""💡 **SpeedTest Results** From d5d4a1ad1b566d4ec518082477918b97b7b9f062 Mon Sep 17 00:00:00 2001 From: levina <82658782+levina-lab@users.noreply.github.com> Date: Sun, 20 Feb 2022 20:37:25 +0700 Subject: [PATCH 3/5] none --- program/video.py | 1 - 1 file changed, 1 deletion(-) diff --git a/program/video.py b/program/video.py index 54174f3..17e49bb 100644 --- a/program/video.py +++ b/program/video.py @@ -113,7 +113,6 @@ async def play_tg_file(c: Client, m: Message, replied: Message = None, link: str duration = convert_seconds(replied.video.duration) elif replied.document: songname = replied.document.file_name[:80] - duration = convert_seconds(replied.document.duration) except BaseException: songname = "Video" From 1481a8e6303e21db7fea72562a752c2e6ea6c845 Mon Sep 17 00:00:00 2001 From: levina <82658782+levina-lab@users.noreply.github.com> Date: Sun, 20 Feb 2022 20:44:48 +0700 Subject: [PATCH 4/5] some fixes --- program/punishment.py | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/program/punishment.py b/program/punishment.py index 1d04678..8494a09 100644 --- a/program/punishment.py +++ b/program/punishment.py @@ -12,7 +12,7 @@ from driver.decorators import bot_creator from driver.database.dbchat import get_served_chats from driver.database.dbpunish import add_gban_user, is_gbanned_user, remove_gban_user -from config import SUDO_USERS, BOT_USERNAME as bn +from config import OWNER_ID, SUDO_USERS, BOT_USERNAME as bn @Client.on_message(command(["gban", f"gban@{bn}"]) & other_filters) @@ -30,13 +30,13 @@ async def global_banned(c: Client, message: Message): from_user = message.from_user BOT_ID = me_bot.id if user.id == from_user.id: - return await message.reply_text( - "You can't gban yourself !" - ) + await message.reply_text("You can't gban yourself !") elif user.id == BOT_ID: await message.reply_text("I can't gban myself !") elif user.id in SUDO_USERS: await message.reply_text("You can't gban sudo user !") + elif user.id in OWNER_ID: + await message.reply_text("You can't gban my creator !") else: await add_gban_user(user.id) served_chats = [] @@ -84,6 +84,8 @@ async def global_banned(c: Client, message: Message): await message.reply_text("I can't gban myself !") elif user_id in SUDO_USERS: await message.reply_text("You can't gban sudo user !") + elif user_id in OWNER_ID: + await message.reply_text("You can't gban my creator !") else: is_gbanned = await is_gbanned_user(user_id) if is_gbanned: @@ -148,10 +150,12 @@ async def ungban_global(c: Client, message: Message): await message.reply_text("I can't ungban myself because i can't be gbanned !") elif user.id in SUDO_USERS: await message.reply_text("Sudo users can't be gbanned/ungbanned !") + elif user.id in OWNER_ID: + await message.reply_text("Bot creator can't be gbanned/ungbanned !") else: is_gbanned = await is_gbanned_user(user.id) if not is_gbanned: - await message.reply_text("This user not ungbanned !") + await message.reply_text("This user is not gbanned !") else: await c.unban_chat_member(chat_id, user.id) await remove_gban_user(user.id) @@ -164,15 +168,15 @@ async def ungban_global(c: Client, message: Message): if user_id == from_user_id: await message.reply_text("You can't ungban yourself because you can't be gbanned !") elif user_id == BOT_ID: - await message.reply_text( - "I can't ungban myself because i can't be gbanned !" - ) + await message.reply_text("I can't ungban myself because i can't be gbanned !") elif user_id in SUDO_USERS: await message.reply_text("Sudo users can't be gbanned/ungbanned !") + elif user_id in OWNER_ID: + await message.reply_text("Bot creator can't be gbanned/ungbanned !") else: is_gbanned = await is_gbanned_user(user_id) if not is_gbanned: - await message.reply_text("This user not gbanned !") + await message.reply_text("This user is not gbanned !") else: await c.unban_chat_member(chat_id, user_id) await remove_gban_user(user_id) From b028754cf85d9972340c27c4ebf362356b5cc71c Mon Sep 17 00:00:00 2001 From: levina <82658782+levina-lab@users.noreply.github.com> Date: Sun, 20 Feb 2022 20:52:47 +0700 Subject: [PATCH 5/5] nothing --- program/playlist.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/program/playlist.py b/program/playlist.py index a35f3b0..227440b 100644 --- a/program/playlist.py +++ b/program/playlist.py @@ -14,6 +14,7 @@ from driver.decorators import check_blacklist from driver.queues import QUEUE, get_queue from driver.filters import command, other_filters + keyboard = InlineKeyboardMarkup( [[InlineKeyboardButton("🗑 Close", callback_data="set_close")]] ) @@ -28,11 +29,11 @@ async def playlist(client, m: Message): if len(chat_queue) == 1: await m.reply( f"💡 **Currently Streaming**`:`\n\n" - f"*️⃣ [{chat_queue[0][0]}]({chat_queue[0][2]}) | `{chat_queue[0][3]}`", + f"➣ [{chat_queue[0][0]}]({chat_queue[0][2]}) | `{chat_queue[0][3]}`", reply_markup=keyboard, disable_web_page_preview=True) else: QUE = f"💡 **Currently Streaming**`:`\n\n" \ - f"*️⃣ [{chat_queue[0][0]}]({chat_queue[0][2]}) | `{chat_queue[0][3]}` \n\n" \ + f"➣ [{chat_queue[0][0]}]({chat_queue[0][2]}) | `{chat_queue[0][3]}` \n\n" \ f"**📖 Queue song list**`:`\n" l = len(chat_queue) for x in range(1, l):