From 1aa27f0c7053f129f14b5c22f8fe52793235e102 Mon Sep 17 00:00:00 2001 From: levina <82658782+levina-lab@users.noreply.github.com> Date: Tue, 18 Jan 2022 20:04:19 +0700 Subject: [PATCH] some fixes --- program/video.py | 50 +++++++++++++++++------------------------------- 1 file changed, 18 insertions(+), 32 deletions(-) diff --git a/program/video.py b/program/video.py index 65d4bc4..515d4d7 100644 --- a/program/video.py +++ b/program/video.py @@ -83,19 +83,18 @@ async def vplay(c: Client, m: Message): return if not a.can_manage_voice_chats: await m.reply_text( - "missing required permission:" + "\n\n» ❌ __Manage video chat__" - ) + "💡 To use me, Give me the following permission below:" + + "\n\n» ❌ __Manage video chat__\n\nOnce done, try again.") return if not a.can_delete_messages: await m.reply_text( - "missing required permission:" + "\n\n» ❌ __Delete messages__" - ) + "💡 To use me, Give me the following permission below:" + + "\n\n» ❌ __Delete messages__\n\nOnce done, try again.") return if not a.can_invite_users: - await m.reply_text("missing required permission:" + "\n\n» ❌ __Add users__") - return - if not a.can_promote_members: - await m.reply_text("missing required permission:" + "\n\n» ❌ __Add new Admins__") + await m.reply_text( + "💡 To use me, Give me the following permission below:" + + "\n\n» ❌ __Add users__\n\nOnce done, try again.") return try: ubot = (await user.get_me()).id @@ -107,10 +106,7 @@ async def vplay(c: Client, m: Message): invitelink = invitelink.replace( "https://t.me/+", "https://t.me/joinchat/" ) - await user.join_chat(invitelink) - await m.chat.promote_member( - ubot, can_manage_voice_chats=True - ) + await ubot.join_chat(invitelink) except UserNotParticipant: try: ubot = (await user.get_me()).id @@ -119,10 +115,7 @@ async def vplay(c: Client, m: Message): invitelink = invitelink.replace( "https://t.me/+", "https://t.me/joinchat/" ) - await user.join_chat(invitelink) - await m.chat.promote_member( - ubot, can_manage_voice_chats=True - ) + await ubot.join_chat(invitelink) except UserAlreadyParticipant: pass except Exception as e: @@ -339,19 +332,18 @@ async def vstream(c: Client, m: Message): return if not a.can_manage_voice_chats: await m.reply_text( - "missing required permission:" + "\n\n» ❌ __Manage video chat__" - ) + "💡 To use me, Give me the following permission below:" + + "\n\n» ❌ __Manage video chat__\n\nOnce done, try again.") return if not a.can_delete_messages: await m.reply_text( - "missing required permission:" + "\n\n» ❌ __Delete messages__" - ) + "💡 To use me, Give me the following permission below:" + + "\n\n» ❌ __Delete messages__\n\nOnce done, try again.") return if not a.can_invite_users: - await m.reply_text("missing required permission:" + "\n\n» ❌ __Add users__") - return - if not a.can_promote_members: - await m.reply_text("missing required permission:" + "\n\n» ❌ __Add new Admins__") + await m.reply_text( + "💡 To use me, Give me the following permission below:" + + "\n\n» ❌ __Add users__\n\nOnce done, try again.") return try: ubot = (await user.get_me()).id @@ -363,10 +355,7 @@ async def vstream(c: Client, m: Message): invitelink = invitelink.replace( "https://t.me/+", "https://t.me/joinchat/" ) - await user.join_chat(invitelink) - await m.chat.promote_member( - ubot, can_manage_voice_chats=True - ) + await ubot.join_chat(invitelink) except UserNotParticipant: try: ubot = (await user.get_me()).id @@ -375,10 +364,7 @@ async def vstream(c: Client, m: Message): invitelink = invitelink.replace( "https://t.me/+", "https://t.me/joinchat/" ) - await user.join_chat(invitelink) - await m.chat.promote_member( - ubot, can_manage_voice_chats=True - ) + await ubot.join_chat(invitelink) except UserAlreadyParticipant: pass except Exception as e: