From 69b0a7ab0fe3c7520ba3c82ca5bf3f9f4a980f74 Mon Sep 17 00:00:00 2001 From: Luke Robles Date: Mon, 6 Sep 2021 09:18:14 -0700 Subject: [PATCH] Adding an on_listen method to correct discord video URLs --- app/bot.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/bot.py b/app/bot.py index 44531e0a..9333c1b7 100755 --- a/app/bot.py +++ b/app/bot.py @@ -47,6 +47,13 @@ async def on_ready(): await bot.get_channel(152921472304676865).send("I have reconnected") +@bot.listen('on_message') +async def on_message(ctx): + if 'media.discordapp.net' in ctx.content: + await ctx.delete() + await ctx.channel.send(ctx.content.replace('media.discordapp.net', 'cdn.discordapp.com')) + return + @bot.command(name='shoo') async def shoo(ctx): if ctx.message.author.id != 144986109804412928: