From ec6a4437be3721306177bee67c290d59775d3ac3 Mon Sep 17 00:00:00 2001 From: levina <82658782+levina-lab@users.noreply.github.com> Date: Tue, 2 Nov 2021 23:50:55 +0700 Subject: [PATCH] nope --- program/video.py | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/program/video.py b/program/video.py index 784c423..a37475d 100644 --- a/program/video.py +++ b/program/video.py @@ -76,10 +76,8 @@ async def vplay(_, m: Message): popo = await bot.get_me() papa = popo pepe = papa.id - except Exception as e: - return await m.reply_text(f"error:\n\n{e}") chat_title = m.chat.title - a = await _.get_chat_member(m.chat.id, pepe) + a = await bot.get_chat_member(m.chat.id, pepe) if a.status != "administrator": await m.reply_text(f"💡 To use me, I need to be an **Administrator** with the following **permissions**:\n\n» ❌ __Delete messages__\n» ❌ __Ban users__\n» ❌ __Add users__\n» ❌ __Manage voice chat__\n\nData is **updated** automatically after you **promote me**") return @@ -107,7 +105,7 @@ async def vplay(_, m: Message): uber = await user.get_me() grab = uber good = grab.id - b = await _.get_chat_member(m.chat.id, good) + b = await bot.get_chat_member(m.chat.id, good) 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 @@ -120,8 +118,8 @@ async def vplay(_, m: Message): return else: try: - pope = await _.export_chat_invite_link(m.chat.id) - pepo = await _.revoke_chat_invite_link(m.chat.id, pope) + pope = await bot.export_chat_invite_link(m.chat.id) + pepo = await bot.revoke_chat_invite_link(m.chat.id, pope) await user.join_chat(pepo.invite_link) except UserAlreadyParticipant: pass @@ -311,10 +309,8 @@ async def vstream(_, m: Message): popo = await bot.get_me() papa = popo pepe = papa.id - except Exception as e: - return await m.reply_text(f"error:\n\n{e}") chat_title = m.chat.title - a = await _.get_chat_member(m.chat.id, pepe) + a = await bot.get_chat_member(m.chat.id, pepe) if a.status != "administrator": await m.reply_text(f"💡 To use me, I need to be an **Administrator** with the following **permissions**:\n\n» ❌ __Delete messages__\n» ❌ __Ban users__\n» ❌ __Add users__\n» ❌ __Manage voice chat__\n\nData is **updated** automatically after you **promote me**") return @@ -342,7 +338,7 @@ async def vstream(_, m: Message): uber = await user.get_me() grab = uber good = grab.id - b = await _.get_chat_member(m.chat.id, good) + b = await bot.get_chat_member(m.chat.id, good) 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 @@ -355,8 +351,8 @@ async def vstream(_, m: Message): return else: try: - pope = await _.export_chat_invite_link(m.chat.id) - pepo = await _.revoke_chat_invite_link(m.chat.id, pope) + pope = await bot.export_chat_invite_link(m.chat.id) + pepo = await bot.revoke_chat_invite_link(m.chat.id, pope) await user.join_chat(pepo.invite_link) except UserAlreadyParticipant: pass