Try to get caption too

This commit is contained in:
blank X 2021-05-30 17:09:08 +07:00
parent 6e1731f1df
commit b904b1b641
Signed by: blankie
GPG Key ID: CC15FC822C7F61F5
2 changed files with 2 additions and 2 deletions

View File

@ -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()

View File

@ -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)