Trying to make minfo member an optional argument

pull/8/head
sgoudham 4 years ago
parent 1000548765
commit b00352ed72

@ -243,25 +243,25 @@ class Relationship(commands.Cog):
@command(name="minfo", aliases=["Minfo", "mInfo"]) @command(name="minfo", aliases=["Minfo", "mInfo"])
@cooldown(1, 1, BucketType.user) @cooldown(1, 1, BucketType.user)
async def m_info(self, ctx, target: Member = None): async def m_info(self, ctx, member: Member = None):
"""Marriage Information!""" """Marriage Information!"""
# If a target has been specified, set them as the user # If a target has been specified, set them as the user
if target: if member:
target = target member = member
# If no target has been specified, choose the author # If no target has been specified, choose the author
else: else:
target = ctx.author member = ctx.author
# Getting the guild of the user # Getting the guild of the user
guild = target.guild guild = member.guild
# Use database connection # Use database connection
with db.connection() as conn: with db.connection() as conn:
# 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 = member.id, guild.id,
with closing(conn.cursor()) as cursor: with closing(conn.cursor()) as cursor:
# Execute the SQL Query # Execute the SQL Query
@ -285,7 +285,7 @@ class Relationship(commands.Cog):
currentDate = ctx.message.created_at.strftime("%a, %b %d, %Y") currentDate = ctx.message.created_at.strftime("%a, %b %d, %Y")
# Get the marriage info embed and then send it to the display # Get the marriage info embed and then send it to the display
embed = marriageInfo(target, marriedUser, marriedDate, currentDate, married) embed = marriageInfo(member, marriedUser, marriedDate, currentDate, married)
await ctx.send(embed=embed) await ctx.send(embed=embed)

Loading…
Cancel
Save