diff options
| author | 2019-09-14 01:09:53 +0800 | |
|---|---|---|
| committer | 2019-09-14 01:09:53 +0800 | |
| commit | e1dab123fc77986b09dc622457886635eb26d4ab (patch) | |
| tree | bf38f7863925b393326edf4dc04453508e545a2b /bot/seasons/halloween/timeleft.py | |
| parent | Merge pull request #269 from python-discord/hacktoberfest-update (diff) | |
| parent | Fix incorrect merge conflict resolutions, lint remaining items (diff) | |
Merge pull request #270 from python-discord/flake8-annotations
Add Flake8 annotations
Diffstat (limited to 'bot/seasons/halloween/timeleft.py')
| -rw-r--r-- | bot/seasons/halloween/timeleft.py | 11 | 
1 files changed, 6 insertions, 5 deletions
| diff --git a/bot/seasons/halloween/timeleft.py b/bot/seasons/halloween/timeleft.py index a2b16a6c..77767baa 100644 --- a/bot/seasons/halloween/timeleft.py +++ b/bot/seasons/halloween/timeleft.py @@ -1,5 +1,6 @@  import logging  from datetime import datetime +from typing import Tuple  from discord.ext import commands @@ -9,16 +10,16 @@ log = logging.getLogger(__name__)  class TimeLeft(commands.Cog):      """A Cog that tells you how long left until Hacktober is over!""" -    def __init__(self, bot): +    def __init__(self, bot: commands.Bot):          self.bot = bot      @staticmethod -    def in_october(): +    def in_october() -> bool:          """Return True if the current month is October."""          return datetime.utcnow().month == 10      @staticmethod -    def load_date(): +    def load_date() -> Tuple[int, datetime, datetime]:          """Return of a tuple of the current time and the end and start times of the next October."""          now = datetime.utcnow()          year = now.year @@ -29,7 +30,7 @@ class TimeLeft(commands.Cog):          return now, end, start      @commands.command() -    async def timeleft(self, ctx): +    async def timeleft(self, ctx: commands.Context) -> None:          """          Calculates the time left until the end of Hacktober. @@ -53,7 +54,7 @@ class TimeLeft(commands.Cog):              ) -def setup(bot): +def setup(bot: commands.Bot) -> None:      """Cog load."""      bot.add_cog(TimeLeft(bot))      log.info("TimeLeft cog loaded") | 
