handle rcon.Errors.InvalidAuthError in /rcon command
@@ -459,7 +459,11 @@ class Minecraft(commands.Cog):
self.d.rcon_connection_cache[key] = (rcon.Client(s, auth_msg.content, 2.5, loop=self.bot.loop), arrow.utcnow())
await self.d.rcon_connection_cache[key][0].setup()
except rcon.Errors.ConnectionFailedError:
- await self.bot.send(ctx, 'Connection to the server failed')
+ await self.bot.send(ctx, 'Connection to the server failed, is RCON enabled?')
+ await self.close_rcon_con(key, ctx.guild.id)
+ return
+ except rcon.Errors.InvalidAuthError:
+ await self.bot.send(ctx.author, 'The provided RCON password/authentication is invalid')
await self.close_rcon_con(key, ctx.guild.id)
return
