diff options
| author | 2021-09-28 17:12:56 +0200 | |
|---|---|---|
| committer | 2021-09-28 17:12:56 +0200 | |
| commit | 62aceb824e6eb6fd017cb7c2b1587c3854f42e5c (patch) | |
| tree | 7d6edd21f2ae0efa8ce68115fc1ea2a062b0d121 | |
| parent | Merge pull request #1825 from Numerlor/scheduling-create_task-init (diff) | |
| parent | Add LT and GT to supported otn chars (diff) | |
Merge pull request #1848 from python-discord/add-more-supported-symbols-to-otn
Add LT and GT to supported otn chars
| -rw-r--r-- | bot/converters.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/bot/converters.py b/bot/converters.py index 18bb6e4e5..8b0890830 100644 --- a/bot/converters.py +++ b/bot/converters.py @@ -392,7 +392,8 @@ class Duration(DurationDelta): class OffTopicName(Converter): """A converter that ensures an added off-topic name is valid.""" - ALLOWED_CHARACTERS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ!?'`-" + ALLOWED_CHARACTERS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ!?'`-<>" + TRANSLATED_CHARACTERS = "๐ ๐ก๐ข๐ฃ๐ค๐ฅ๐ฆ๐ง๐จ๐ฉ๐ช๐ซ๐ฌ๐ญ๐ฎ๐ฏ๐ฐ๐ฑ๐ฒ๐ณ๐ด๐ต๐ถ๐ท๐ธ๐นว๏ผโโ-๏ผ๏ผ" @classmethod def translate_name(cls, name: str, *, from_unicode: bool = True) -> str: @@ -402,9 +403,9 @@ class OffTopicName(Converter): If `from_unicode` is True, the name is translated from a discord-safe format, back to normalized text. """ if from_unicode: - table = str.maketrans(cls.ALLOWED_CHARACTERS, '๐ ๐ก๐ข๐ฃ๐ค๐ฅ๐ฆ๐ง๐จ๐ฉ๐ช๐ซ๐ฌ๐ญ๐ฎ๐ฏ๐ฐ๐ฑ๐ฒ๐ณ๐ด๐ต๐ถ๐ท๐ธ๐นว๏ผโโ-') + table = str.maketrans(cls.ALLOWED_CHARACTERS, cls.TRANSLATED_CHARACTERS) else: - table = str.maketrans('๐ ๐ก๐ข๐ฃ๐ค๐ฅ๐ฆ๐ง๐จ๐ฉ๐ช๐ซ๐ฌ๐ญ๐ฎ๐ฏ๐ฐ๐ฑ๐ฒ๐ณ๐ด๐ต๐ถ๐ท๐ธ๐นว๏ผโโ-', cls.ALLOWED_CHARACTERS) + table = str.maketrans(cls.TRANSLATED_CHARACTERS, cls.ALLOWED_CHARACTERS) return name.translate(table) |