diff options
| author | 2019-03-31 10:17:23 +0530 | |
|---|---|---|
| committer | 2019-03-31 10:17:23 +0530 | |
| commit | 1005cee4cbd3910f035c31479a74e98a8194c94c (patch) | |
| tree | 9aa58ef4e31b4a1c995598c039c4c7630f124e2a | |
| parent | Hanukkah Embed file (diff) | |
added .py extension, add doc strings,other changes will be coming in the next commit
| -rw-r--r-- | bot/seasons/christmas/hanukkah_embed.py (renamed from bot/seasons/christmas/hanukkah_embed) | 20 | 
1 files changed, 15 insertions, 5 deletions
| diff --git a/bot/seasons/christmas/hanukkah_embed b/bot/seasons/christmas/hanukkah_embed.py index de69c63a..a2e6c8c5 100644 --- a/bot/seasons/christmas/hanukkah_embed +++ b/bot/seasons/christmas/hanukkah_embed.py @@ -1,9 +1,10 @@ -from discord.ext import commands -from discord import Embed -import requests  import datetime  import logging +import requests +from discord import Embed +from discord.ext import commands +  log = logging.getLogger(__name__) @@ -13,7 +14,9 @@ HANUKKAH_YEARS = []  class HanukkahEmbed(commands.Cog): - +    """ +    A cog that returns information about Hanukkah festival. +    """      def __init__(self, bot):          self.bot = bot          self.url = """https://www.hebcal.com/hebcal/?v=1&cfg=json&maj=on&min=on&mod=on&nx=on&year=now&month=x&ss=on& @@ -21,6 +24,9 @@ class HanukkahEmbed(commands.Cog):          self.hanukkah_dates = self.get_hanukkah_dates()      def get_hanukkah_dates(self): +        """ +        Gets the dates for hanukkah festival. +        """          hanukkah_dates = []          r = requests.get(self.url)          json_data = r.json() @@ -34,7 +40,8 @@ class HanukkahEmbed(commands.Cog):      @commands.command(name='hanukkah', aliases=['chanukah'])      async def hanukkah_festival(self, ctx):          """ -        Hanukkah embed +        Tells you about the Hanukkah Festival +        (time of festival, festival day, etc)          """          self.hanukkah_dates_split() @@ -99,6 +106,9 @@ class HanukkahEmbed(commands.Cog):              await ctx.send(embed=embed)      def hanukkah_dates_split(self): +        """ +        We are splitting the dates for hanukkah into days, months and years. +        """          for date in self.hanukkah_dates:              HANUKKAH_DAYS.append(date[8:10])              HANUKKAH_MONTHS.append(date[5:7]) | 
