diff --git a/app/dragon-bot.py b/app/dragon-bot.py index 17567ef9..8a359160 100644 --- a/app/dragon-bot.py +++ b/app/dragon-bot.py @@ -103,6 +103,18 @@ async def on_message(message): ) ) + # Read messages and look for mentions of subreddits + for word in message.content.split(): + if message.author != client.user: + if '/r/' in word or 'r/' in word: + try: + subreddit = word.split('/')[-1] + # Try and request the page to check that it actually exists + get_from_reddit.get_image(boards=subreddit) + await client.send_message(message.channel, "https://reddit.com/r/{}".format(subreddit)) + except: + pass + if message.content.startswith('!8ball'): await client.send_message( message.channel, @@ -142,6 +154,7 @@ async def on_message(message): return m.author == client.user await client.purge_from(message.channel, limit=10, check=is_bot) + if message.content.startswith('!decide'): await client.send_message( message.channel,