diff options
| author | 2020-09-22 17:52:19 +0530 | |
|---|---|---|
| committer | 2020-09-22 17:52:19 +0530 | |
| commit | 873512a135e614409af8114c7856fcd13ccb3c79 (patch) | |
| tree | d7fa397084c8e9700cab7eb91cac691dfed76fe7 | |
| parent | added subcommand zodiac (diff) | |
added subcommand date and removed a from doc string of date
| -rw-r--r-- | bot/exts/valentines/valentine_zodiac.py | 109 |
1 files changed, 109 insertions, 0 deletions
diff --git a/bot/exts/valentines/valentine_zodiac.py b/bot/exts/valentines/valentine_zodiac.py index f4e4ac34..66762134 100644 --- a/bot/exts/valentines/valentine_zodiac.py +++ b/bot/exts/valentines/valentine_zodiac.py @@ -57,6 +57,100 @@ class ValentineZodiac(commands.Cog): return embed log.info("Zodiac embed ready") + def zodiac_date_verifer(self, month: str, date: int) -> str: + """Returns zodiac sign by checking month and date.""" + month = month.capitalize() + log.info("started searching zodaic sign based on month and date") + if month == "January" or month == "Jan": + if date >= 1 and date <= 19: + zodiac = "Capricorn" + elif date >= 20 and date <= 31: + zodiac = "Aquarius" + else: + zodiac = None + elif month == "Feburary" or month == "Feb": + if date >= 1 and date <= 18: + zodiac = "Aquarius" + elif date >= 19 and date <= 29: + zodiac = "Pisces" + else: + zodiac = None + elif month == "March" or month == "Mar": + if date >= 1 and date <= 20: + zodiac = "Pisces" + elif date >= 21 and date <= 31: + zodiac = "Aries" + else: + zodiac = None + elif month == "April" or month == "Apr": + if date >= 1 and date <= 19: + zodiac = "Aries" + elif date >= 20 and date <= 30: + zodiac = "Taurus" + else: + zodiac = None + elif month == "May": + if date >= 1 and date <= 20: + zodiac = "Taurus" + elif date >= 21 and date <= 31: + zodiac = "Gemini" + else: + zodiac = None + elif month == "June" or month == "Jun": + if date >= 1 and date <= 20: + zodiac = "Gemini" + elif date >= 21 and date <= 30: + zodiac = "Cancer" + else: + zodiac = None + elif month == "July" or month == "Jul": + if date >= 1 and date <= 22: + zodiac = "Cancer" + elif date >= 23 and date <= 31: + zodiac = "Leo" + else: + zodiac = None + elif month == "August" or month == "Aug": + if date >= 1 and date <= 22: + zodiac = "Leo" + elif date >= 23 and date <= 31: + zodiac = "Virgo" + else: + zodiac = None + elif month == "September" or month == "Sept": + if date >= 1 and date <= 22: + zodiac = "Virgo" + elif date >= 23 and date <= 30: + zodiac = "Libra" + else: + zodiac = None + elif month == "October" or month == "Oct": + if date >= 1 and date <= 22: + zodiac = "Libra" + elif date >= 23 and date <= 31: + zodiac = "Scorpio" + else: + zodiac = None + elif month == "November" or month == "Nov": + if date >= 1 and date <= 21: + zodiac = "Scorpio" + elif date >= 22 and date <= 30: + zodiac = "Sagittarius" + else: + zodiac = None + elif month == "December" or month == "Dec": + if date >= 1 and date <= 21: + zodiac = "Sagittarius" + elif date >= 22 and date <= 31: + zodiac = "Capricorn" + else: + zodiac = None + else: + zodiac = None + log.info("Wrong Zodiac date or month provided") + return zodiac + log.info("Zodiac name sent") + @commands.group(name="partnerzodiac", invoke_without_command=True) async def partner_zodiac(self, ctx: commands.Context, zodiac_sign: str) -> None: """Provides a counter compatible zodiac sign to the given user's zodiac sign.""" @@ -86,6 +180,21 @@ class ValentineZodiac(commands.Cog): log.info("Embed successfully sent") await ctx.send(embed=final_embed) + @partner_zodiac.command(name="date") + async def date_and_month(self, ctx: commands.Context, month: str, date: int) -> None: + """Provides information about zodiac sign by taking month and date as input.""" + zodiac_sign_based_on_month_and_date = self.zodiac_date_verifer(month, date) + log.info("zodiac sign based on month and date received") + if zodiac_sign_based_on_month_and_date is None: + log.info("zodiac sign based on month and date returned None") + final_embed = discord.Embed() + final_embed.color = Colours.pink + final_embed.description = "You provided wrong date or month so i aren't able to find any zodiac sign" + else: + final_embed = self.zodiac_sign_verify(zodiac_sign_based_on_month_and_date) + log.info("zodiac sign embed based on month and date is now sent") + await ctx.send(embed=final_embed) + def setup(bot: commands.Bot) -> None: """Valentine zodiac Cog load.""" |