diff --git a/plugins/python_runner/python_runner.py b/plugins/python_runner/python_runner.py index 677e8cfe2d64a0911d36f67c6560c78de87cef08..452cb7ea5922f1427bba02ed58dafeb1bad021b9 100644 --- a/plugins/python_runner/python_runner.py +++ b/plugins/python_runner/python_runner.py @@ -32,7 +32,11 @@ def exec_python_code(bot: CQHttp, context=None, args=None): for item in pattern.findall(code): code = code.replace("&#{};".format( item), bytes([int(item)]).decode("utf-8")) - code = f"""CALLER_UID={context['user_id']}\nCALLER_NICKNAME='{context['sender']['nickname']}'\nCALLER_CARD='{context['sender']['card']}'\n"""+code + code = f""" + CALLER_UID={context['user_id']}\n + CALLER_NICKNAME={str(context['sender']['nickname']).encode()}.decode()\n + CALLER_CARD={str(context['sender']['card']).encode()}.decode()\n + """+code run_python_in_docker(callback, code)