mirror of
https://github.com/nonebot/nonebot2.git
synced 2024-11-24 00:55:07 +08:00
Update
This commit is contained in:
parent
f02c8ec858
commit
4bc2b3c979
@ -27,9 +27,7 @@ class Command:
|
||||
self.func = func
|
||||
self.permission = permission
|
||||
|
||||
async def run(self, bot, ctx, session,
|
||||
*args, **kwargs) -> Any:
|
||||
# TODO: check permission
|
||||
async def run(self, bot, ctx, session) -> Any:
|
||||
permission = 0
|
||||
if ctx['user_id'] in bot.config.SUPERUSERS:
|
||||
permission |= perm.IS_SUPERUSER
|
||||
@ -69,7 +67,7 @@ def _find_command(name: Tuple[str]) -> Optional[Command]:
|
||||
cmd_tree = _registry
|
||||
for part in name[:-1]:
|
||||
if part not in cmd_tree:
|
||||
return False
|
||||
return None
|
||||
cmd_tree = cmd_tree[part]
|
||||
|
||||
return cmd_tree.get(name[-1])
|
||||
|
Loading…
Reference in New Issue
Block a user