[V3 Core] Add timeout exceptions to [p]servers (#1305)

This commit is contained in:
aikaterna 2018-02-14 17:21:51 -08:00 committed by palmtree5
parent 9f8a008442
commit 78615b5dc8

View File

@ -185,7 +185,11 @@ class Core:
return m.author == owner
while msg is not None:
try:
msg = await self.bot.wait_for("message", check=msg_check, timeout=15)
except asyncio.TimeoutError:
await ctx.send("I guess not.")
break
try:
msg = int(msg.content)
await self.leave_confirmation(guilds[msg], owner, ctx)
@ -199,16 +203,16 @@ class Core:
def conf_check(m):
return m.author == owner
try:
msg = await self.bot.wait_for("message", check=conf_check, timeout=15)
if msg is None:
await ctx.send("I guess not.")
elif msg.content.lower().strip() in ("yes", "y"):
if msg.content.lower().strip() in ("yes", "y"):
await server.leave()
if server != ctx.guild:
await ctx.send("Done.")
else:
await ctx.send("Alright then.")
except asyncio.TimeoutError:
await ctx.send("I guess not.")
@commands.command()
@checks.is_owner()