diff --git a/app/bot.py b/app/bot.py index 9333c1b7..f1f5fc84 100755 --- a/app/bot.py +++ b/app/bot.py @@ -39,6 +39,25 @@ def generate_embed(embed_url=None, embed_title=None, embed_description=None, emb return embed +#### a bunch of silly functions that will listen for messages with specific content +@bot.listen('on_message') +async def fix_cdn_url(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.listen('on_message') +async def react_with_dale(ctx): + if 'dale' in ctx.content: + emoji = discord.utils.get(ctx.guild.emojis, name='dale') + if emoji: + await ctx.add_reaction(emoji) + return + + + + @bot.event async def on_ready(): print(f'{bot.user.name} has connected to Discord!') @@ -47,13 +66,6 @@ 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: