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:
雅诺狐
2025-08-28 18:35:59 +08:00
parent f42b4adaab
commit 8d77d1cc3f
5 changed files with 140 additions and 120 deletions

View File

@@ -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:
"""获取第一个参数