diff options
| author | 2019-10-02 09:39:10 +0530 | |
|---|---|---|
| committer | 2019-10-02 09:39:10 +0530 | |
| commit | cd5842811f92bd5c82a164d33ad71a9c7c172e57 (patch) | |
| tree | 4a15827a3d94cbc78fa8a9a5b47cdd57283f304e /bot/seasons/halloween/timeleft.py | |
| parent | Worked on the requested changes and also made a few other changes: (diff) | |
| parent | Merge branch 'master' into trivia_quiz (diff) | |
Merge branch 'trivia_quiz' of https://github.com/RohanJnr/seasonalbot into trivia_quiz
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") |