Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
Changelog
=========

- :release:`11.5.0 <17th October 2024>`
- :feature:`282` Update :obj:`pydis_core.utils.regex.DISCORD_INVITE` to cover more edge cases.


- :release:`11.4.0 <11th September 2024>`
- :feature:`269` Update :obj:`pydis_core.utils.regex.DISCORD_INVITE` to also match backslash before the invite code.

Expand Down
13 changes: 5 additions & 8 deletions pydis_core/utils/regex.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,11 @@

DISCORD_INVITE = re.compile(
r"(https?://)?(www\.)?" # Optional http(s) and www.
r"(discord([.,]|dot)gg|" # Could be discord.gg/
r"discord([.,]|dot)com(/|slash)invite|" # or discord.com/invite/
r"discordapp([.,]|dot)com(/|slash)invite|" # or discordapp.com/invite/
r"discord([.,]|dot)me|" # or discord.me
r"discord([.,]|dot)li|" # or discord.li
r"discord([.,]|dot)io|" # or discord.io.
r"((?<!\w)([.,]|dot))gg" # or .gg/
r")(/|slash|\\)" # / or \ or 'slash'
r"(discord(app)?)?" # Optional discord(app)
r"([.,]|dot)" # Various characters to cover dots
r"(gg|com|me|li|io)" # A few TLDs that embed within discord
r"((/|slash|\\)(invite))?" # / or \ or 'slash' invite
r"(/|slash|\\)" # / or \ or 'slash'
r"(?P<invite>\S+)", # the invite code itself
flags=re.IGNORECASE
)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "pydis_core"
version = "11.4.0"
version = "11.5.0"
description = "PyDis core provides core functionality and utility to the bots of the Python Discord community."
authors = ["Python Discord <[email protected]>"]
license = "MIT"
Expand Down
Loading