|
|
@ -19,7 +19,7 @@ import datetime
|
|
|
|
|
|
|
|
|
|
|
|
import asyncpg
|
|
|
|
import asyncpg
|
|
|
|
from discord import Member, Embed
|
|
|
|
from discord import Member, Embed
|
|
|
|
from discord.ext.commands import BucketType, command, cooldown, bot_has_permissions, Cog
|
|
|
|
from discord.ext.commands import command, bot_has_permissions, Cog
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Sets up the embed for the marriage info
|
|
|
|
# Sets up the embed for the marriage info
|
|
|
@ -67,7 +67,6 @@ class Relationship(Cog):
|
|
|
|
print(f"{self.__class__.__name__} Cog has been loaded\n-----")
|
|
|
|
print(f"{self.__class__.__name__} Cog has been loaded\n-----")
|
|
|
|
|
|
|
|
|
|
|
|
@command(name="marry")
|
|
|
|
@command(name="marry")
|
|
|
|
@cooldown(1, 1, BucketType.user)
|
|
|
|
|
|
|
|
async def marry(self, ctx, member: Member):
|
|
|
|
async def marry(self, ctx, member: Member):
|
|
|
|
"""Wed your Lover!"""
|
|
|
|
"""Wed your Lover!"""
|
|
|
|
|
|
|
|
|
|
|
@ -79,8 +78,6 @@ class Relationship(Cog):
|
|
|
|
await self.bot.generate_embed(ctx, desc="**Senpaii! ˭̡̞(◞⁎˃ᆺ˂)◞*✰ You can't possibly marry yourself!**")
|
|
|
|
await self.bot.generate_embed(ctx, desc="**Senpaii! ˭̡̞(◞⁎˃ᆺ˂)◞*✰ You can't possibly marry yourself!**")
|
|
|
|
return
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
|
|
# TODO: Probably will need to get rid of this in favour of getting from cache
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Get the author from the cache
|
|
|
|
# Get the author from the cache
|
|
|
|
db_author = await self.bot.check_cache(ctx.author.id, ctx.guild.id)
|
|
|
|
db_author = await self.bot.check_cache(ctx.author.id, ctx.guild.id)
|
|
|
|
married_user = db_author["married"]
|
|
|
|
married_user = db_author["married"]
|
|
|
@ -136,7 +133,6 @@ class Relationship(Cog):
|
|
|
|
|
|
|
|
|
|
|
|
# Update cache new details
|
|
|
|
# Update cache new details
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
# TODO: Update the cache that the users have been married
|
|
|
|
|
|
|
|
db_author["married"] = member.id
|
|
|
|
db_author["married"] = member.id
|
|
|
|
db_author["married_date"] = message_time
|
|
|
|
db_author["married_date"] = message_time
|
|
|
|
|
|
|
|
|
|
|
@ -168,7 +164,6 @@ class Relationship(Cog):
|
|
|
|
await self.bot.generate_embed(ctx, desc=f"**(。T ω T。) {member.mention} waited too long**")
|
|
|
|
await self.bot.generate_embed(ctx, desc=f"**(。T ω T。) {member.mention} waited too long**")
|
|
|
|
|
|
|
|
|
|
|
|
@command(name="divorce")
|
|
|
|
@command(name="divorce")
|
|
|
|
@cooldown(1, 1, BucketType.user)
|
|
|
|
|
|
|
|
async def divorce(self, ctx, member: Member):
|
|
|
|
async def divorce(self, ctx, member: Member):
|
|
|
|
"""Divorce your Partner!"""
|
|
|
|
"""Divorce your Partner!"""
|
|
|
|
|
|
|
|
|
|
|
@ -180,9 +175,6 @@ class Relationship(Cog):
|
|
|
|
await self.bot.generate_embed(ctx, desc="**Senpaii! ˭̡̞(◞⁎˃ᆺ˂)◞*✰ You can't possibly divorce yourself!**")
|
|
|
|
await self.bot.generate_embed(ctx, desc="**Senpaii! ˭̡̞(◞⁎˃ᆺ˂)◞*✰ You can't possibly divorce yourself!**")
|
|
|
|
return
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
|
|
# TODO: Probably will need to get rid of this in favour of getting from cache
|
|
|
|
|
|
|
|
# TODO: Not gonna bother refactoring this db statement
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Get the author from the cache
|
|
|
|
# Get the author from the cache
|
|
|
|
db_author = await self.bot.check_cache(ctx.author.id, ctx.guild.id)
|
|
|
|
db_author = await self.bot.check_cache(ctx.author.id, ctx.guild.id)
|
|
|
|
married_user = db_author["married"]
|
|
|
|
married_user = db_author["married"]
|
|
|
@ -236,7 +228,6 @@ class Relationship(Cog):
|
|
|
|
|
|
|
|
|
|
|
|
# Update cache with new details
|
|
|
|
# Update cache with new details
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
# TODO: Update the cache that the users have been divorced
|
|
|
|
|
|
|
|
db_author["married"] = None
|
|
|
|
db_author["married"] = None
|
|
|
|
db_author["married_date"] = None
|
|
|
|
db_author["married_date"] = None
|
|
|
|
|
|
|
|
|
|
|
@ -271,7 +262,6 @@ class Relationship(Cog):
|
|
|
|
await self.bot.generate_embed(ctx, desc=f"**(。T ω T。) {member.mention} waited too long**")
|
|
|
|
await self.bot.generate_embed(ctx, desc=f"**(。T ω T。) {member.mention} waited too long**")
|
|
|
|
|
|
|
|
|
|
|
|
@command(name="marriageinfo", aliases=["minfo"])
|
|
|
|
@command(name="marriageinfo", aliases=["minfo"])
|
|
|
|
@cooldown(1, 1, BucketType.user)
|
|
|
|
|
|
|
|
@bot_has_permissions(embed_links=True)
|
|
|
|
@bot_has_permissions(embed_links=True)
|
|
|
|
async def m_info(self, ctx, member: Member = None):
|
|
|
|
async def m_info(self, ctx, member: Member = None):
|
|
|
|
"""Marriage Information!"""
|
|
|
|
"""Marriage Information!"""
|
|
|
|