aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Mark <[email protected]>2019-03-26 09:45:56 +0000
committerGravatar GitHub <[email protected]>2019-03-26 09:45:56 +0000
commit870fe69a85b7478b0425927e61d2db1bf3abcc35 (patch)
treeb7621279b1962d486fb481f136dbfbf64c8844e8
parentTime Left - Changed `datetime.now()` to `datetime.utcnow()` (diff)
Apply suggestions from code review
Co-Authored-By: Suhail6inkling <[email protected]>
-rw-r--r--bot/seasons/halloween/timeleft.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/bot/seasons/halloween/timeleft.py b/bot/seasons/halloween/timeleft.py
index 9488f660..af205573 100644
--- a/bot/seasons/halloween/timeleft.py
+++ b/bot/seasons/halloween/timeleft.py
@@ -17,15 +17,17 @@ class TimeLeft:
@staticmethod
def in_october():
"""
- checks that the current month is October
+ Return True if the current month is October.
"""
+
return datetime.utcnow().month == 10
@staticmethod
def load_date():
"""
- Grabs the current time in additon to the first and last day of the following October
+ Return of a tuple of the current time and the end and start times of the following October.
"""
+
now = datetime.utcnow()
year = now.year
if now.month > 10:
@@ -37,7 +39,7 @@ class TimeLeft:
@commands.command()
async def timeleft(self, ctx):
"""
- Calculates the time left until the end of Hacktober
+ Calculates the time left until the end of Hacktober.
Whilst in October, displays the days, hours and minutes left.
Only displays the days left until the beginning and end whilst in a different month