Skip to content

Commit 62bccfb

Browse files
authored
Update Discord invite regex again (#313)
Allows for the period to instead be "。", a HALFWIDTH IDEOGRAPHIC FULL STOP which Discord apparently normalizes into a period for the purpose of making the invite clickable.
1 parent abbb0f8 commit 62bccfb

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎pydis_core/utils/regex.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44

55
DISCORD_INVITE = re.compile(
66
r"(https?:\/\/)?(discord:\/*)?" # Optional protocols
7-
r"(www\.)?" # Optional www
7+
r"(www[.,。])?" # Optional www
88
r"[@#]*" # Optional @ or # symbols
99
r"(\B|discord(app)?)" # Optional discord(app)
10-
r"([.,]|dot)" # Various characters to cover dots
10+
r"([.,。]|dot)" # Various characters to cover dots
1111
r"("
1212
r"(gg|me)" # TLDs that embed within discord
1313
r"|com(\/|slash|\\)invite" # Only match com/invite

0 commit comments

Comments
 (0)