Stroop is jouw shit zat.
This commit is contained in:
+39
-1
@@ -9,6 +9,7 @@ import math
|
||||
from datetime import datetime
|
||||
import sys
|
||||
import os
|
||||
import random
|
||||
|
||||
class Shitpost(object):
|
||||
"""Schijtpaal commando's. Alleen bruikbaar in de daarvoor toegewezen schijtpaal kanalen."""
|
||||
@@ -16,6 +17,7 @@ class Shitpost(object):
|
||||
def __init__(self, bot):
|
||||
self.bot = bot
|
||||
self.voice_states = {}
|
||||
self.hdConImpatientEvents = []
|
||||
def __check(self, ctx): #Todo: Is dit het shitpost kanaal?
|
||||
return True
|
||||
|
||||
@@ -27,7 +29,7 @@ class Shitpost(object):
|
||||
"""
|
||||
#year, month, day, hour=0, minute=0, second=0, microsecond=0, tzinfo=None, *, fold=0)
|
||||
Now = datetime.now()
|
||||
HdConDate = datetime(2018, 9, 14, 3, 0, 1) #om 3 uur lig je toch wel al op bed?
|
||||
HdConDate = datetime(2018, 9, 14, 4, 0, 1) #om 4 uur lig je toch wel al op bed?
|
||||
Distance = HdConDate - Now
|
||||
Message = Message = "HD Con 2018 is al voorbij. HD Con 2019 zal in 2019 plaatsvinden." #init
|
||||
if Distance.days < 0:
|
||||
@@ -38,6 +40,8 @@ class Shitpost(object):
|
||||
Message = "HD Con 2018 is nu bezig!!"
|
||||
elif Now.day == 17:
|
||||
Message = "HD Con 2018 is vandaag alweer afgelopen... F"
|
||||
yield from ctx.channel.send(ctx.author.mention + ' ' + str(Message))
|
||||
return
|
||||
else:
|
||||
NachtjesSlapen = Distance.days + 1
|
||||
if NachtjesSlapen == 1:
|
||||
@@ -45,6 +49,40 @@ class Shitpost(object):
|
||||
else:
|
||||
Message = "Nog " + str(NachtjesSlapen) + " nachtjes slapen..."
|
||||
|
||||
#Hou bij hoe vaak dit wordt gevraagd:
|
||||
eventsMinutesAgo = 0;
|
||||
eventsMinutesAgoSameAuthor = 0;
|
||||
eventsLastDays = 0;
|
||||
for evt in self.hdConImpatientEvents:
|
||||
eventDistance = Now - evt[1]
|
||||
if eventDistance.days < 1 and eventDistance.seconds < 600:
|
||||
eventsMinutesAgo += 1
|
||||
if evt[0] == ctx.author.id:
|
||||
eventsMinutesAgoSameAuthor +=1
|
||||
if eventDistance.days < 2:
|
||||
eventsLastDays += 1
|
||||
self.hdConImpatientEvents.append([ctx.author.id, Now])
|
||||
|
||||
#Als dezelfde persoon het blijft vragen pikken we het niet:
|
||||
if eventsMinutesAgoSameAuthor > 3:
|
||||
return #fuck it.
|
||||
if eventsMinutesAgoSameAuthor > 0:
|
||||
if eventsMinutesAgoSameAuthor > 2:
|
||||
yield from ctx.channel.send("...")
|
||||
return
|
||||
yield from ctx.channel.send("Dat vroeg je net ook al, " + ctx.author.mention + "!")
|
||||
return
|
||||
#Hoe vaker er wordt gevraagd, hoe ongeduldiger de antwoorden:
|
||||
impatientFactor = 10 + eventsMinutesAgo*25 + eventsLastDays*10;
|
||||
impatientFactor *= random.random()
|
||||
if impatientFactor > 100:
|
||||
yield from ctx.channel.send("Nee!")
|
||||
return
|
||||
elif impatientFactor > 15 and eventsMinutesAgo > 0:
|
||||
Message = "Dat hebben jullie net gevraagd."
|
||||
elif impatientFactor > 9:
|
||||
Message = "Nee."
|
||||
|
||||
yield from ctx.channel.send(ctx.author.mention + ' ' + str(Message))
|
||||
|
||||
@commands.command(pass_context=True, hidden=False)
|
||||
|
||||
Reference in New Issue
Block a user