From ae37f3417ee2d9e6da341892e368c5b6224c7a10 Mon Sep 17 00:00:00 2001 From: Nick80835 Date: Fri, 12 Jun 2020 23:26:54 -0400 Subject: [PATCH] fix ID sudoing and blacklisting --- ubot/modules/sudo.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/ubot/modules/sudo.py b/ubot/modules/sudo.py index 8da1f77..850c462 100644 --- a/ubot/modules/sudo.py +++ b/ubot/modules/sudo.py @@ -60,6 +60,11 @@ async def shutdown(event): @ldr.add("blacklist", sudo=True) async def add_blacklist(event): if event.args: + try: + event.args = int(event.args) + except: + pass + try: user_entity = await event.client.get_entity(event.args) except (ValueError, TypeError): @@ -92,6 +97,11 @@ async def add_blacklist(event): @ldr.add("unblacklist", sudo=True) async def rem_blacklist(event): if event.args: + try: + event.args = int(event.args) + except: + pass + try: user_entity = await event.client.get_entity(event.args) except (ValueError, TypeError): @@ -134,6 +144,11 @@ async def show_blacklist(event): @ldr.add("sudo", owner=True) async def add_sudo(event): if event.args: + try: + event.args = int(event.args) + except: + pass + try: user_entity = await event.client.get_entity(event.args) except (ValueError, TypeError): @@ -166,6 +181,11 @@ async def add_sudo(event): @ldr.add("unsudo", owner=True) async def rem_sudo(event): if event.args: + try: + event.args = int(event.args) + except: + pass + try: user_entity = await event.client.get_entity(event.args) except (ValueError, TypeError):