diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0b9df132..4003cb32 100755 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,4 +3,4 @@ repos: rev: 23.10.1 hooks: - id: black - language_version: python3.11.7 + language_version: python3.12.2 diff --git a/app/bot.py b/app/bot.py index 2b494ddc..c5cb5049 100755 --- a/app/bot.py +++ b/app/bot.py @@ -3,7 +3,6 @@ from discord.ext import commands import core_utils import discord import os -import re intents = discord.Intents.default() intents.message_content = True @@ -140,15 +139,13 @@ async def fix_social_media_links(ctx): if ctx.author.id == bot.user.id: return for k in correct_domains.keys(): - if re.search(f"^{k}.*", ctx.content) or re.search( - f"^www.{k}.com.*", ctx.content - ): + if ctx.content.startswith(k) or ctx.content.startswith("www.{k}.com"): await ctx.channel.send( "%s said:\n%s" % ( ctx.author.mention, ctx.content.replace(k, "https://%s.com" % correct_domains[k]).split( - "?s" + "?" )[0], ) ) diff --git a/app/cogs/cheeky_functions.py b/app/cogs/cheeky_functions.py old mode 100644 new mode 100755