Refactor permission checks and decorators usage
Refactored permission checks in built-in plugins to use the new @require_permission decorator, improving code clarity and consistency. Enhanced permission_decorators to better extract ChatStream and support PlusCommand. Updated PermissionCommand to use permission decorators for all subcommands, improved user mention parsing, and improved feedback messages. Registered a new permission node for sending feeds in MaiZone plugin and updated command registration to use PlusCommand info.
This commit is contained in:
@@ -50,7 +50,8 @@ class CommandArgs:
|
||||
self._parsed_args = self._raw_args.split()
|
||||
|
||||
return self._parsed_args
|
||||
|
||||
|
||||
@property
|
||||
def is_empty(self) -> bool:
|
||||
"""检查参数是否为空
|
||||
|
||||
@@ -73,7 +74,8 @@ class CommandArgs:
|
||||
if 0 <= index < len(args):
|
||||
return args[index]
|
||||
return default
|
||||
|
||||
|
||||
@property
|
||||
def get_first(self, default: str = "") -> str:
|
||||
"""获取第一个参数
|
||||
|
||||
|
||||
Reference in New Issue
Block a user