From 81b2c25db7e479667daf6f416e0de9a90b808713 Mon Sep 17 00:00:00 2001 From: Luke Robles Date: Mon, 17 Jun 2024 08:59:47 -0700 Subject: [PATCH] Change vxtwitter to fixupx --- app/bot.py | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/app/bot.py b/app/bot.py index bfd98d6b..1a0bad12 100755 --- a/app/bot.py +++ b/app/bot.py @@ -85,31 +85,31 @@ async def convert_heic_to_jpg(ctx): return -# @bot.listen("on_message") -# async def fix_social_media_links(ctx): -# correct_domains = { -# "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 -# for k in correct_domains.keys(): -# 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( -# "?" -# )[0], -# ) -# ) -# await ctx.delete() -# return +@bot.listen("on_message") +async def fix_social_media_links(ctx): + correct_domains = { + "https://x.com": "fixupx", + "https://www.x.com": "fixupx", + "https://twitter.com": "fixupx", + "https://www.twitter.com": "fixupx", + "https://tiktok.com": "vxtiktok", + "https://www.tiktok.com": "vxtiktok", + } + if ctx.author.id == bot.user.id: + return + for k in correct_domains.keys(): + 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( + "?" + )[0], + ) + ) + await ctx.delete() + return @bot.event