diff options
author | 2022-12-20 17:22:41 +0800 | |
---|---|---|
committer | 2022-12-20 17:22:41 +0800 | |
commit | 48cf627b37e48bdce15312c0981347e6e2b10622 (patch) | |
tree | f394e2ade054f9c2d5b78489e72187d9416fc0ff | |
parent | Rename method get_failed_files_str (diff) |
Add markdown mention escape for file error str
-rw-r--r-- | bot/exts/utils/snekbox/_eval.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/bot/exts/utils/snekbox/_eval.py b/bot/exts/utils/snekbox/_eval.py index afbb4a32d..95039f0bd 100644 --- a/bot/exts/utils/snekbox/_eval.py +++ b/bot/exts/utils/snekbox/_eval.py @@ -5,6 +5,8 @@ from dataclasses import dataclass, field from signal import Signals from typing import TYPE_CHECKING +from discord.utils import escape_markdown, escape_mentions + from bot.exts.utils.snekbox._io import FILE_COUNT_LIMIT, FILE_SIZE_LIMIT, FileAttachment, sizeof_fmt from bot.log import get_logger @@ -110,6 +112,9 @@ class EvalResult: break names.append(file) text = ", ".join(names) + # Since the file names are provided by user + text = escape_markdown(text) + text = escape_mentions(text) return text def get_message(self, job: EvalJob) -> str: |