2
0
mirror of https://github.com/Nick80835/microbot synced 2025-08-30 14:08:31 +00:00

fix ID sudoing and blacklisting

This commit is contained in:
Nick80835
2020-06-12 23:26:54 -04:00
parent 5451b06185
commit ae37f3417e

View File

@@ -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):