diff --git a/astrbot/core/computer/tools/python.py b/astrbot/core/computer/tools/python.py index 2c4ae6c8a..9c4768320 100644 --- a/astrbot/core/computer/tools/python.py +++ b/astrbot/core/computer/tools/python.py @@ -88,8 +88,11 @@ class LocalPythonTool(FunctionTool): self, context: ContextWrapper[AstrAgentContext], code: str, silent: bool = False ) -> ToolExecResult: if context.context.event.role != "admin": - return "error: Permission denied. Local Python execution is only allowed for admin users. Tell user to set admins in AstrBot WebUI." - + return ( + "error: Permission denied. Local Python execution is only allowed for admin users. " + "Tell user to set admins in AstrBot WebUI by adding their user ID to the admins list if they need this feature." + f"User's ID is: {context.context.event.get_sender_id()}. User's ID can be found by using /sid command." + ) sb = get_local_booter() try: result = await sb.python.exec(code, silent=silent) diff --git a/astrbot/core/computer/tools/shell.py b/astrbot/core/computer/tools/shell.py index eeeb3f9d4..e63124d2d 100644 --- a/astrbot/core/computer/tools/shell.py +++ b/astrbot/core/computer/tools/shell.py @@ -47,7 +47,11 @@ class ExecuteShellTool(FunctionTool): env: dict = {}, ) -> ToolExecResult: if context.context.event.role != "admin": - return "error: Permission denied. Shell execution is only allowed for admin users. Tell user to Set admins in AstrBot WebUI." + return ( + "error: Permission denied. Local shell execution is only allowed for admin users. " + "Tell user to set admins in AstrBot WebUI by adding their user ID to the admins list if they need this feature." + f"User's ID is: {context.context.event.get_sender_id()}. User's ID can be found by using /sid command." + ) if self.is_local: sb = get_local_booter()