|
@@ -96,8 +96,15 @@ async def on_message(event):
|
|
|
|
|
|
return
|
|
|
|
|
|
+ action = None
|
|
|
+
|
|
|
+ try:
|
|
|
+ action = await find_action(command.name)
|
|
|
+ except SyntaxError:
|
|
|
+ pass
|
|
|
+
|
|
|
if not await is_allowed(peer_id):
|
|
|
- if not handler or not handler.is_restricted:
|
|
|
+ if not action and (not handler or not handler.is_restricted):
|
|
|
return
|
|
|
|
|
|
if handler:
|
|
@@ -108,11 +115,6 @@ async def on_message(event):
|
|
|
|
|
|
return
|
|
|
|
|
|
- try:
|
|
|
- action = await find_action(command.name)
|
|
|
- except SyntaxError:
|
|
|
- return
|
|
|
-
|
|
|
if not action:
|
|
|
return
|
|
|
|