diff options
author | 2024-10-17 22:35:13 +0100 | |
---|---|---|
committer | 2024-10-17 22:46:52 +0100 | |
commit | 4df8e90cc4b21896de4f37042ed3186547aa708b (patch) | |
tree | 876e9018fb871173afb5266b2e7795f92bf9eebf | |
parent | Add optional 'app' capture to invite regex OR group (diff) |
Move discord(app) capture to its own optional group in invite regex
-rw-r--r-- | pydis_core/utils/regex.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/pydis_core/utils/regex.py b/pydis_core/utils/regex.py index f51b6159..f78229ff 100644 --- a/pydis_core/utils/regex.py +++ b/pydis_core/utils/regex.py @@ -4,13 +4,13 @@ import re DISCORD_INVITE = re.compile( r"(https?://)?(www\.)?" # Optional http(s) and www. + r"(discord(app)?)?" # Optional discord(app) r"(" - r"discord(app)?([.,]|dot)gg|" # Could be discord(app).gg - r"discord(app)?([.,]|dot)com|" # or discord(app).com/invite - r"discord(app)?([.,]|dot)me|" # or discord(app).me - r"discord(app)?([.,]|dot)li|" # or discord(app).li - r"discord(app)?([.,]|dot)io|" # or discord(app).io - r"((?<!\w)([.,]|dot))gg" # or .gg + r"([.,]|dot)gg|" # Could be .gg + r"([.,]|dot)com|" # or .com + r"([.,]|dot)me|" # or .me + r"([.,]|dot)li|" # or .li + r"([.,]|dot)io" # or .io r")" r"((/|slash|\\)(invite))?" # / or \ or 'slash' invite r"(/|slash|\\)" # / or \ or 'slash' |