From 62e95e51883724fc2b0b45cb4d24dd9cd7e05440 Mon Sep 17 00:00:00 2001 From: Myned Date: Fri, 13 Oct 2017 01:24:57 -0400 Subject: [PATCH] Changed all whiles to use bot connection status instead; WIP event loop --- src/main/cogs/booru.py | 4 ++-- src/main/cogs/owner.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/cogs/booru.py b/src/main/cogs/booru.py index 9c7a37b..36e2cd3 100644 --- a/src/main/cogs/booru.py +++ b/src/main/cogs/booru.py @@ -154,7 +154,7 @@ class MsG: await paginator.add_reaction('➡') await asyncio.sleep(1) - while True: + while not self.bot.is_closed(): try: await self.bot.wait_for('reaction_add', check=on_react, timeout=10 * 60) @@ -328,7 +328,7 @@ class MsG: await paginator.add_reaction('➡') await asyncio.sleep(1) - while True: + while not self.bot.is_closed(): try: await self.bot.wait_for('reaction_add', check=on_react, timeout=10 * 60) diff --git a/src/main/cogs/owner.py b/src/main/cogs/owner.py index 11fcd24..fddeb8b 100644 --- a/src/main/cogs/owner.py +++ b/src/main/cogs/owner.py @@ -106,7 +106,7 @@ class Tools: try: console = await self.generate(ctx) exception = await self.generate_err(ctx) - while True: + while not self.bot.is_closed(): exe = await self.bot.wait_for('message', check=execute) await exe.delete() sys.stdout = io.StringIO()