diff options
author | 2022-04-21 22:54:14 -0400 | |
---|---|---|
committer | 2022-04-21 22:54:14 -0400 | |
commit | c2d1538c4357eaf8849aad506a2fc67c658d51a6 (patch) | |
tree | e6b5eab8f06091b6014703fdd63ae5292294bcb2 | |
parent | Merge pull request #2133 from python-discord/slowmode/add-better-thread-support (diff) |
Add support for BIG SOLIDUS unicode characters in off topic names (#2146)
Make `ALLOWED_CHARACTERS` a raw string to account for slashes
-rw-r--r-- | bot/converters.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bot/converters.py b/bot/converters.py index 7393a1ddc..910ed9e39 100644 --- a/bot/converters.py +++ b/bot/converters.py @@ -382,8 +382,8 @@ class Age(DurationDelta): class OffTopicName(Converter): """A converter that ensures an added off-topic name is valid.""" - ALLOWED_CHARACTERS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ!?'`-<>" - TRANSLATED_CHARACTERS = "๐ ๐ก๐ข๐ฃ๐ค๐ฅ๐ฆ๐ง๐จ๐ฉ๐ช๐ซ๐ฌ๐ญ๐ฎ๐ฏ๐ฐ๐ฑ๐ฒ๐ณ๐ด๐ต๐ถ๐ท๐ธ๐นว๏ผโโ-๏ผ๏ผ" + ALLOWED_CHARACTERS = r"ABCDEFGHIJKLMNOPQRSTUVWXYZ!?'`-<>\/" + TRANSLATED_CHARACTERS = "๐ ๐ก๐ข๐ฃ๐ค๐ฅ๐ฆ๐ง๐จ๐ฉ๐ช๐ซ๐ฌ๐ญ๐ฎ๐ฏ๐ฐ๐ฑ๐ฒ๐ณ๐ด๐ต๐ถ๐ท๐ธ๐นว๏ผโโ-๏ผ๏ผโงนโงธ" @classmethod def translate_name(cls, name: str, *, from_unicode: bool = True) -> str: |