From 3d96fe5f896af73d75fea5c55c446a463896fae1 Mon Sep 17 00:00:00 2001 From: blank X Date: Tue, 8 Feb 2022 18:02:06 +0700 Subject: [PATCH] Remove unnecessary double match --- sukuinote/plugins/pyexec.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) 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)