From 150ac846891f8c815841ff96a3051c0f122bc829 Mon Sep 17 00:00:00 2001 From: sgoudham Date: Sun, 2 Aug 2020 00:21:11 +0100 Subject: [PATCH] DB Connection is now created within the same event loop as client Referencing pool connection from client/self.bot --- cogs/interactive.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cogs/interactive.py b/cogs/interactive.py index 60db8a9c..420cf694 100644 --- a/cogs/interactive.py +++ b/cogs/interactive.py @@ -4,7 +4,6 @@ import random from discord import Colour, Embed, Member from discord.ext.commands import cooldown, command, BucketType, bot_has_permissions, Cog -import db from settings import colour_list @@ -40,7 +39,7 @@ class Interactive(Cog): guild = ctx.author.guild # Setup pool - pool = await db.connection(db.loop) + pool = self.bot.db # Setup pool connection and cursor async with pool.acquire() as conn: @@ -109,7 +108,7 @@ class Interactive(Cog): guild = ctx.author.guild # Setup pool - pool = await db.connection(db.loop) + pool = self.bot.db # Setup pool connection and cursor async with pool.acquire() as conn: