|
|
@ -122,13 +122,13 @@ class Relationship(commands.Cog):
|
|
|
|
update_query = """UPDATE members SET married = (?), marriedDate = (?) WHERE discordID = (?) AND guildID = (?)"""
|
|
|
|
update_query = """UPDATE members SET married = (?), marriedDate = (?) WHERE discordID = (?) AND guildID = (?)"""
|
|
|
|
proposer = member.id, message_time, ctx.author.id, guild.id,
|
|
|
|
proposer = member.id, message_time, ctx.author.id, guild.id,
|
|
|
|
proposee = ctx.author.id, message_time, member.id, guild.id,
|
|
|
|
proposee = ctx.author.id, message_time, member.id, guild.id,
|
|
|
|
cursor = conn.cursor()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Execute the SQL Query's
|
|
|
|
with closing(conn.cursor()) as cursor:
|
|
|
|
cursor.execute(update_query, proposer)
|
|
|
|
# Execute the SQL Query's
|
|
|
|
cursor.execute(update_query, proposee)
|
|
|
|
cursor.execute(update_query, proposer)
|
|
|
|
conn.commit()
|
|
|
|
cursor.execute(update_query, proposee)
|
|
|
|
print(cursor.rowcount, "2 people have been married!")
|
|
|
|
conn.commit()
|
|
|
|
|
|
|
|
print(cursor.rowcount, "2 people have been married!")
|
|
|
|
|
|
|
|
|
|
|
|
# Congratulate them!
|
|
|
|
# Congratulate them!
|
|
|
|
await ctx.send(
|
|
|
|
await ctx.send(
|
|
|
@ -165,23 +165,24 @@ class Relationship(commands.Cog):
|
|
|
|
# Get the author's row from the Members Table
|
|
|
|
# Get the author's row from the Members Table
|
|
|
|
select_query = """SELECT * FROM members WHERE discordID = (?) and guildID = (?)"""
|
|
|
|
select_query = """SELECT * FROM members WHERE discordID = (?) and guildID = (?)"""
|
|
|
|
val = ctx.author.id, guild.id,
|
|
|
|
val = ctx.author.id, guild.id,
|
|
|
|
cursor = conn.cursor()
|
|
|
|
with closing(conn.cursor()) as cursor:
|
|
|
|
|
|
|
|
|
|
|
|
# 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]
|
|
|
|
|
|
|
|
|
|
|
|
# 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:
|
|
|
|
await ctx.send("**Senpaii! ˭̡̞(◞⁎˃ᆺ˂)◞*✰ You can't possibly divorce yourself!**")
|
|
|
|
await ctx.send("**Senpaii! ˭̡̞(◞⁎˃ᆺ˂)◞*✰ You can't possibly divorce yourself!**")
|
|
|
|
return
|
|
|
|
return
|
|
|
|
# Make sure that the person trying to divorce is actually married to the user
|
|
|
|
# Make sure that the person trying to divorce is actually married to the user
|
|
|
|
elif result[2] is None:
|
|
|
|
elif married_user is None:
|
|
|
|
await ctx.send(f"**((╬◣﹏◢)) You must be married in order to divorce someone! Baka!**")
|
|
|
|
await ctx.send(f"**((╬◣﹏◢)) You must be married in order to divorce someone! Baka!**")
|
|
|
|
return
|
|
|
|
return
|
|
|
|
# Make sure the person is married to the person that they're trying to divorce
|
|
|
|
# Make sure the person is married to the person that they're trying to divorce
|
|
|
|
elif result[2] != str(member.id):
|
|
|
|
elif married_user != str(member.id):
|
|
|
|
member = guild.get_member(int(result[2]))
|
|
|
|
member = guild.get_member(int(married_user))
|
|
|
|
await ctx.send(f"**(ノ ゜口゜)ノ You can only divorce the person that you're married!"
|
|
|
|
await ctx.send(f"**(ノ ゜口゜)ノ You can only divorce the person that you're married!"
|
|
|
|
f"\n That person is {member.mention}**")
|
|
|
|
f"\n That person is {member.mention}**")
|
|
|
|
return
|
|
|
|
return
|
|
|
@ -211,13 +212,12 @@ class Relationship(commands.Cog):
|
|
|
|
update_query = """UPDATE members SET married = null, marriedDate = null WHERE discordID = (?) and guildID = (?)"""
|
|
|
|
update_query = """UPDATE members SET married = null, marriedDate = null WHERE discordID = (?) and guildID = (?)"""
|
|
|
|
divorcer = ctx.author.id, guild.id,
|
|
|
|
divorcer = ctx.author.id, guild.id,
|
|
|
|
divorcee = member.id, guild.id,
|
|
|
|
divorcee = member.id, guild.id,
|
|
|
|
cursor = conn.cursor()
|
|
|
|
with closing(conn.cursor()) as cursor:
|
|
|
|
|
|
|
|
# Execute the SQL Query's
|
|
|
|
# Execute the SQL Query's
|
|
|
|
cursor.execute(update_query, divorcer)
|
|
|
|
cursor.execute(update_query, divorcer)
|
|
|
|
cursor.execute(update_query, divorcee)
|
|
|
|
cursor.execute(update_query, divorcee)
|
|
|
|
conn.commit()
|
|
|
|
conn.commit()
|
|
|
|
print(cursor.rowcount, "2 Members have been divorced :(!")
|
|
|
|
print(cursor.rowcount, "2 Members have been divorced :(!")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Congratulate them!
|
|
|
|
# Congratulate them!
|
|
|
|
await ctx.send(
|
|
|
|
await ctx.send(
|
|
|
@ -263,21 +263,23 @@ class Relationship(commands.Cog):
|
|
|
|
# Get the author's row from the Members Table
|
|
|
|
# Get the author's row from the Members Table
|
|
|
|
select_query = """SELECT * FROM members WHERE discordID = (?) and guildID = (?)"""
|
|
|
|
select_query = """SELECT * FROM members WHERE discordID = (?) and guildID = (?)"""
|
|
|
|
val = target.id, guild.id,
|
|
|
|
val = target.id, guild.id,
|
|
|
|
cursor = conn.cursor()
|
|
|
|
with closing(conn.cursor()) as cursor:
|
|
|
|
|
|
|
|
|
|
|
|
# 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]
|
|
|
|
|
|
|
|
marriage_date = result[3]
|
|
|
|
|
|
|
|
|
|
|
|
# Set empty values for non-married users
|
|
|
|
# Set empty values for non-married users
|
|
|
|
if result[2] is None:
|
|
|
|
if user is None:
|
|
|
|
married = False
|
|
|
|
married = False
|
|
|
|
marriedUser = ""
|
|
|
|
marriedUser = ""
|
|
|
|
marriedDate = ""
|
|
|
|
marriedDate = ""
|
|
|
|
# Set the member, date married and setting married status
|
|
|
|
# Set the member, date married and setting married status
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
marriedUser = guild.get_member(int(result[2]))
|
|
|
|
marriedUser = guild.get_member(int(user))
|
|
|
|
marriedDate = result[3]
|
|
|
|
marriedDate = marriage_date
|
|
|
|
married = True
|
|
|
|
married = True
|
|
|
|
|
|
|
|
|
|
|
|
# Get the current date of the message sent by the user
|
|
|
|
# Get the current date of the message sent by the user
|
|
|
|