From d0943ff1dda487c34c3a11c5396166460ab13da4 Mon Sep 17 00:00:00 2001 From: phxntxm Date: Tue, 29 Jan 2019 17:37:21 -0600 Subject: [PATCH] Logic fix --- cogs/birthday.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cogs/birthday.py b/cogs/birthday.py index 0c2e51a..67a4780 100644 --- a/cogs/birthday.py +++ b/cogs/birthday.py @@ -158,11 +158,11 @@ WHERE RESULT: A printout of the birthdays from everyone on this server""" if member: date = await self.bot.db.fetchrow("SELECT birthday FROM users WHERE id=$1", member.id) - date = date['birthday'] - if date: - await ctx.send(f"{member.display_name}'s birthday is {calendar.month_name[date.month]} {date.day}") - else: + if date is None or date["birthday"] is None: await ctx.send(f"I do not have {member.display_name}'s birthday saved!") + else: + date = date['birthday'] + await ctx.send(f"{member.display_name}'s birthday is {calendar.month_name[date.month]} {date.day}") else: # Get this server's birthdays bds = await self.get_birthdays_for_server(ctx.guild)