HDCon 2022 update

Met een kleine refactor om het volgend jaar makkelijker te maken
This commit is contained in:
2022-07-02 11:48:42 +02:00
parent 7f6991b480
commit b5b935bc4b
+11 -12
View File
@@ -33,26 +33,25 @@ class Shitpost(commands.Cog):
@commands.command(pass_context=True, hidden=False) @commands.command(pass_context=True, hidden=False)
@asyncio.coroutine @asyncio.coroutine
def ishetalhdcon(self, ctx): def ishetalhdcon(self, ctx):
"""Hoe lang nog tot Hoestende Dranken Con 2020? """Hoe lang nog tot Hoestende Dranken Con 2022?
Gebruik: !ishetalhdcon Gebruik: !ishetalhdcon
""" """
#year, month, day, hour=0, minute=0, second=0, microsecond=0, tzinfo=None, *, fold=0)
Now = datetime.now() Now = datetime.now()
HdConDate = datetime(2021, 9, 3, 4, 0, 1) #om 4 uur lig je toch wel al op bed? HdConDate = datetime(2022, 10, 14, 4, 0, 1) #om 4 uur lig je toch wel al op bed?
Distance = HdConDate - Now Distance = HdConDate - Now
Message = Message = "HD Con 2021 is al voorbij. HD Con 2022 zal in 2022 plaatsvinden." #init Message = Message = "HD Con 2022 is al voorbij. HD Con 2023 zal in 2023 plaatsvinden."
if Distance.days == -1:
Message = "HD Con 2022 begint vandaag! HYPE!"
elif Distance.days < 0 and Distance.days > -4:
Message = "HD Con 2022 is nu bezig!!"
elif Distance.days == -4:
Message = "HD Con 2022 is vandaag alweer afgelopen... F"
if Distance.days < 0: if Distance.days < 0:
if Now.month == 9:
if Now.day == 3:
Message = "HD Con 2021 begint vandaag! HYPE!"
elif Now.day == 4 or Now.day == 5:
Message = "HD Con 2021 is nu bezig!!"
elif Now.day == 6:
Message = "HD Con 2021 is vandaag alweer afgelopen... F"
yield from ctx.channel.send(ctx.author.mention + ' ' + str(Message)) yield from ctx.channel.send(ctx.author.mention + ' ' + str(Message))
return return
else:
NachtjesSlapen = Distance.days + 1 NachtjesSlapen = Distance.days + 1
if NachtjesSlapen == 1: if NachtjesSlapen == 1:
Message = "Nog " + str(NachtjesSlapen) + " nachtje slapen..." Message = "Nog " + str(NachtjesSlapen) + " nachtje slapen..."