Skip to content

Commit

Permalink
Merge branch 'url_tracker_cleaner'
Browse files Browse the repository at this point in the history
  • Loading branch information
jackra1n committed Aug 22, 2024
2 parents 23a2a9d + c0dfe91 commit 004971f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
from . import constants as constants
from .bot import Substiify as Substiify

__version__ = "0.97"
__version__ = "0.98"
__author__ = "jackra1n"
6 changes: 3 additions & 3 deletions extensions/url_cleaner.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ def create_rules(self, rules: list[str]):
if len(split_rule) == 1:
self.universal_rules.add(param_rule)
else:
host_pattern = split_rule[1].replace("*.", "(?:.*\.)?")
host_rule = re.compile(f"^(www\.)?{host_pattern}$")
host_pattern = split_rule[1].replace("*.", r"(?:.*\.)?")
host_rule = re.compile(rf"^(www\.)?{host_pattern}$")
host_rule_str = host_rule.pattern

if host_rule_str not in self.host_rules:
Expand Down Expand Up @@ -132,7 +132,7 @@ async def on_message(self, message: discord.Message):

embed = discord.Embed(title="Please avoid sending links containing tracking parameters.")
tracker_list = ", ".join([f"`{tracker}`" for tracker in removed_trackers])
response = f"{tracker_list} {"are" if len(removed_trackers) > 1 else "is"} used for tracking."
response = f"{tracker_list} {'are' if len(removed_trackers) > 1 else 'is'} used for tracking."
response += f"\n Here's the link without trackers:\n{'\n'.join(cleaned_urls)}"
embed.description = response
await message.reply(embed=embed)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "substiify"
version = "0.97"
version = "0.98"
readme = "README.md"
requires-python = ">=3.12"
dependencies = [
Expand Down

0 comments on commit 004971f

Please sign in to comment.