diff --git a/memed.py b/memed.py index 18d3256..bcf026d 100644 --- a/memed.py +++ b/memed.py @@ -166,7 +166,7 @@ class MemeClient: NO COMMANDS WILL BE EXECUTED SERVER-SIDE FROM THIS OP. """ if not bot: - return await self.send_msg(1, 'no bot') + return await self.send_msg(1, 'no bot started') rsudo = bot.get_cog('Rsudo') if not rsudo: @@ -205,11 +205,16 @@ async def handle_client(reader, writer): def main(): + # YES GLOBALS ARE BAD I KNOW + global bot + global db + loop = asyncio.get_event_loop() coro = asyncio.start_unix_server(handle_client, sys.argv[1], loop=loop) pool = loop.create_task(asyncpg.create_pool(**config.db)) + db = pool server = loop.run_until_complete(coro) if config.bot_token: