diff --git a/sukuinote/plugins/pyexec.py b/sukuinote/plugins/pyexec.py index 0625600..c83ca37 100644 --- a/sukuinote/plugins/pyexec.py +++ b/sukuinote/plugins/pyexec.py @@ -16,10 +16,7 @@ PYEXEC_REGEX = '^(?:' + '|'.join(map(re.escape, config['config']['prefixes'])) + @log_errors @public_log_errors async def pyexec(client, message): - match = re.match(PYEXEC_REGEX, (message.text or message.caption).markdown) - if not match: - return - code = match.group(1).strip() + code = message.matches[0].group(1).strip() class UniqueExecReturnIdentifier: pass tree = ast.parse(code)