diff --git a/app/bot.py b/app/bot.py index fe00e89d..6e3958fd 100755 --- a/app/bot.py +++ b/app/bot.py @@ -116,18 +116,19 @@ async def convert_heic_to_jpg(ctx): @bot.listen("on_message") async def fix_social_media_links(ctx): correct_domains = { - "https://x.com": "vxtwitter", - "https://twitter.com": "vxtwitter", - "https://tiktok.com": "vxtiktok", - "https://www.tiktok.com": "vxtiktok", + "x.com": "vxtwitter", + "twitter.com": "vxtwitter", + "tiktok.com": "vxtiktok", } + if ctx.author.id == bot.user.id: + return for k in correct_domains.keys(): - if k in ctx.content: + if k in ctx.content or "www.%s.com" % k in ctx.content: await ctx.channel.send( "%s said:\n%s" % ( ctx.author.mention, - ctx.content.replace(k, "https://%s.com" % correct_domains[k]), + ctx.content.replace(k, "%s.com" % correct_domains[k]), ) ) await ctx.delete()