Replacing marriage info with cache

pull/8/head
sgoudham 4 years ago
parent a5cef11a2b
commit d74d4bc3d4

@ -282,18 +282,9 @@ class Relationship(Cog):
# Getting the guild of the user
guild = member.guild
# Setup pool
pool = self.bot.db
# TODO: Replace this entire section with retrieving from cache
# Setup pool connection and cursor
async with pool.acquire() as conn:
# Get the author's row from the Members Table
select_query = """SELECT * FROM members WHERE member_id = $1 and guild_id = $2"""
# Get the author from the cache
result = await self.bot.check_cache(member.id, ctx.guild.id)
# Execute the SQL Query
result = await conn.fetchrow(select_query, member.id, guild.id)
user = result["married"]
marriage_date = result["married_date"]

Loading…
Cancel
Save