From b904b1b641ccb919063035c3418204b28458168c Mon Sep 17 00:00:00 2001 From: blank X Date: Sun, 30 May 2021 17:09:08 +0700 Subject: [PATCH] Try to get caption too --- sukuinote/plugins/pyexec.py | 2 +- sukuinote/plugins/shell.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sukuinote/plugins/pyexec.py b/sukuinote/plugins/pyexec.py index 087bfa5..2b8eeab 100644 --- a/sukuinote/plugins/pyexec.py +++ b/sukuinote/plugins/pyexec.py @@ -16,7 +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.markdown) + match = re.match(PYEXEC_REGEX, (message.text or message.caption).markdown) if not match: return code = match.group(1).strip() diff --git a/sukuinote/plugins/shell.py b/sukuinote/plugins/shell.py index 10f96a3..63dca5b 100644 --- a/sukuinote/plugins/shell.py +++ b/sukuinote/plugins/shell.py @@ -10,7 +10,7 @@ SHELL_REGEX = '^(?:' + '|'.join(map(re.escape, config['config']['prefixes'])) + @log_errors @public_log_errors async def shell(client, message): - match = re.match(SHELL_REGEX, message.text.markdown) + match = re.match(SHELL_REGEX, (message.text or message.caption).markdown) if not match: return command = match.group(1)