From 8d8d373435973a3ef8a49623125a129445345121 Mon Sep 17 00:00:00 2001 From: Luke Robles Date: Fri, 18 Aug 2023 14:34:47 -0700 Subject: [PATCH] Auto correct tiktok links to be vxtiktok so they play within discord --- app/bot.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/app/bot.py b/app/bot.py index 1a5721c1..cbfcefdb 100755 --- a/app/bot.py +++ b/app/bot.py @@ -114,6 +114,20 @@ async def annoy_jason(ctx): return +@bot.listen("on_message") +async def fix_tiktok_links(ctx): + if "https://www.tiktok.com/t/" in ctx.content: + await ctx.channel.send( + "%s said:\n%s" + % ( + ctx.author.mention, + ctx.content.replace("tiktok", "vxtiktok"), + ) + ) + await ctx.delete() + return + + @bot.event async def on_command_completion(ctx): channel = bot.get_channel(826547484632678453)