mirror of
https://github.com/Nick80835/microbot
synced 2025-08-30 22:16:05 +00:00
fix ID sudoing and blacklisting
This commit is contained in:
@@ -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):
|
||||
|
Reference in New Issue
Block a user