From 1b8f6d26ad383b41f714189aa73ff270da361058 Mon Sep 17 00:00:00 2001 From: Kowlin Date: Sat, 16 Apr 2016 00:06:49 +0200 Subject: [PATCH] Fix for !join on OAuth bots (#157) Fix for !join on OAuth bots --- red.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/red.py b/red.py index 4ad826d67..19cf623f4 100644 --- a/red.py +++ b/red.py @@ -262,13 +262,16 @@ async def shutdown(): @checks.is_owner() async def join(invite_url : discord.Invite): """Joins new server""" - try: - await bot.accept_invite(invite_url) - await bot.say("Server joined.") - except discord.NotFound: - await bot.say("The invite was invalid or expired.") - except discord.HTTPException: - await bot.say("I wasn't able to accept the invite. Try again.") + if bot.user.bot == True: + bot.say("I cannot join servers with invite link. Please use a OAuth link.") + else: + try: + await bot.accept_invite(invite_url) + await bot.say("Server joined.") + except discord.NotFound: + await bot.say("The invite was invalid or expired.") + except discord.HTTPException: + await bot.say("I wasn't able to accept the invite. Try again.") @bot.command(pass_context=True) @checks.is_owner()