From e5febe8dcb8ebed6f22b6473ba941360ba6aa88a Mon Sep 17 00:00:00 2001 From: Luke Robles Date: Wed, 13 Dec 2023 11:02:02 -0800 Subject: [PATCH] fix issue with double adding fx to vx --- app/bot.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/app/bot.py b/app/bot.py index 6e3958fd..498c9dbc 100755 --- a/app/bot.py +++ b/app/bot.py @@ -116,9 +116,12 @@ async def convert_heic_to_jpg(ctx): @bot.listen("on_message") async def fix_social_media_links(ctx): correct_domains = { - "x.com": "vxtwitter", - "twitter.com": "vxtwitter", - "tiktok.com": "vxtiktok", + "https://x.com": "vxtwitter", + "https://www.x.com": "vxtwitter", + "https://twitter.com": "vxtwitter", + "https://www.twitter.com": "vxtwitter", + "https://tiktok.com": "vxtiktok", + "https://www.tiktok.com": "vxtiktok", } if ctx.author.id == bot.user.id: return @@ -128,7 +131,7 @@ async def fix_social_media_links(ctx): "%s said:\n%s" % ( ctx.author.mention, - ctx.content.replace(k, "%s.com" % correct_domains[k]), + ctx.content.replace(k, "https://%s.com" % correct_domains[k]), ) ) await ctx.delete()