|
|
@ -11,9 +11,6 @@ import db
|
|
|
|
from db import connection2
|
|
|
|
from db import connection2
|
|
|
|
from settings import colour_list
|
|
|
|
from settings import colour_list
|
|
|
|
|
|
|
|
|
|
|
|
loop = asyncio.get_event_loop()
|
|
|
|
|
|
|
|
loop.run_until_complete(connection2(loop))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Sets up the embed for the marriage info
|
|
|
|
# Sets up the embed for the marriage info
|
|
|
|
def marriageInfo(target, marriedUser, marriedDate, currentDate, married):
|
|
|
|
def marriageInfo(target, marriedUser, marriedDate, currentDate, married):
|
|
|
@ -66,7 +63,7 @@ class Relationship(commands.Cog):
|
|
|
|
|
|
|
|
|
|
|
|
# Getting the guild of the user
|
|
|
|
# Getting the guild of the user
|
|
|
|
guild = ctx.author.guild
|
|
|
|
guild = ctx.author.guild
|
|
|
|
pool = await connection2(loop)
|
|
|
|
pool = await connection2(db.loop)
|
|
|
|
|
|
|
|
|
|
|
|
async with pool.acquire() as conn:
|
|
|
|
async with pool.acquire() as conn:
|
|
|
|
async with conn.cursor() as author_cursor:
|
|
|
|
async with conn.cursor() as author_cursor:
|
|
|
@ -78,7 +75,7 @@ class Relationship(commands.Cog):
|
|
|
|
# Execute the Author SQL Query
|
|
|
|
# Execute the Author SQL Query
|
|
|
|
await author_cursor.execute(select_query, author_val)
|
|
|
|
await author_cursor.execute(select_query, author_val)
|
|
|
|
author_result = await author_cursor.fetchone()
|
|
|
|
author_result = await author_cursor.fetchone()
|
|
|
|
married_user = author_result[2]
|
|
|
|
married_user = author_result[1]
|
|
|
|
|
|
|
|
|
|
|
|
# Make sure that the user cannot marry themselves
|
|
|
|
# Make sure that the user cannot marry themselves
|
|
|
|
if member.id == ctx.author.id:
|
|
|
|
if member.id == ctx.author.id:
|
|
|
@ -95,7 +92,7 @@ class Relationship(commands.Cog):
|
|
|
|
# Execute the Member SQL Query
|
|
|
|
# Execute the Member SQL Query
|
|
|
|
await member_cursor.execute(select_query, member_val)
|
|
|
|
await member_cursor.execute(select_query, member_val)
|
|
|
|
member_result = await member_cursor.fetchone()
|
|
|
|
member_result = await member_cursor.fetchone()
|
|
|
|
target_user = member_result[2]
|
|
|
|
target_user = member_result[1]
|
|
|
|
|
|
|
|
|
|
|
|
if target_user is not None:
|
|
|
|
if target_user is not None:
|
|
|
|
member = guild.get_member(int(target_user))
|
|
|
|
member = guild.get_member(int(target_user))
|
|
|
@ -175,7 +172,7 @@ class Relationship(commands.Cog):
|
|
|
|
# Execute the SQL Query
|
|
|
|
# Execute the SQL Query
|
|
|
|
cursor.execute(select_query, val)
|
|
|
|
cursor.execute(select_query, val)
|
|
|
|
result = cursor.fetchone()
|
|
|
|
result = cursor.fetchone()
|
|
|
|
married_user = result[2]
|
|
|
|
married_user = result[1]
|
|
|
|
|
|
|
|
|
|
|
|
# Make sure that the user cannot divorce themselves
|
|
|
|
# Make sure that the user cannot divorce themselves
|
|
|
|
if member.id == ctx.author.id:
|
|
|
|
if member.id == ctx.author.id:
|
|
|
@ -274,8 +271,8 @@ class Relationship(commands.Cog):
|
|
|
|
# Execute the SQL Query
|
|
|
|
# Execute the SQL Query
|
|
|
|
cursor.execute(select_query, val)
|
|
|
|
cursor.execute(select_query, val)
|
|
|
|
result = cursor.fetchone()
|
|
|
|
result = cursor.fetchone()
|
|
|
|
user = result[2]
|
|
|
|
user = result[1]
|
|
|
|
marriage_date = result[3]
|
|
|
|
marriage_date = result[2]
|
|
|
|
|
|
|
|
|
|
|
|
# Set empty values for non-married users
|
|
|
|
# Set empty values for non-married users
|
|
|
|
if user is None:
|
|
|
|
if user is None:
|
|
|
|