small fix on previous commit
This commit is contained in:
+13
-10
@@ -27,6 +27,7 @@ class Shitpost(object):
|
|||||||
"""Hoe lang nog tot Hoestende Dranken Con 2018?
|
"""Hoe lang nog tot Hoestende Dranken Con 2018?
|
||||||
Gebruik: !ishetalhdcon
|
Gebruik: !ishetalhdcon
|
||||||
"""
|
"""
|
||||||
|
|
||||||
#year, month, day, hour=0, minute=0, second=0, microsecond=0, tzinfo=None, *, fold=0)
|
#year, month, day, hour=0, minute=0, second=0, microsecond=0, tzinfo=None, *, fold=0)
|
||||||
Now = datetime.now()
|
Now = datetime.now()
|
||||||
HdConDate = datetime(2018, 9, 14, 4, 0, 1) #om 4 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?
|
||||||
@@ -61,7 +62,8 @@ class Shitpost(object):
|
|||||||
eventsMinutesAgoSameAuthor +=1
|
eventsMinutesAgoSameAuthor +=1
|
||||||
if eventDistance.days < 2:
|
if eventDistance.days < 2:
|
||||||
eventsLastDays += 1
|
eventsLastDays += 1
|
||||||
self.hdConImpatientEvents.append([ctx.author.id, Now])
|
if not "DMChannel" in type(ctx.channel).__name__: #ignore personal chats
|
||||||
|
self.hdConImpatientEvents.append([ctx.author.id, Now])
|
||||||
|
|
||||||
#Als dezelfde persoon het blijft vragen pikken we het niet:
|
#Als dezelfde persoon het blijft vragen pikken we het niet:
|
||||||
if eventsMinutesAgoSameAuthor > 3:
|
if eventsMinutesAgoSameAuthor > 3:
|
||||||
@@ -73,15 +75,16 @@ class Shitpost(object):
|
|||||||
yield from ctx.channel.send("Dat vroeg je net ook al, " + ctx.author.mention + "!")
|
yield from ctx.channel.send("Dat vroeg je net ook al, " + ctx.author.mention + "!")
|
||||||
return
|
return
|
||||||
#Hoe vaker er wordt gevraagd, hoe ongeduldiger de antwoorden:
|
#Hoe vaker er wordt gevraagd, hoe ongeduldiger de antwoorden:
|
||||||
impatientFactor = 10 + eventsMinutesAgo*25 + eventsLastDays*10;
|
if not "DMChannel" in type(ctx.channel).__name__: #ignore personal chats
|
||||||
impatientFactor *= random.random()
|
impatientFactor = 10 + eventsMinutesAgo*25 + eventsLastDays*10;
|
||||||
if impatientFactor > 100:
|
impatientFactor *= random.random()
|
||||||
yield from ctx.channel.send("Nee!")
|
if impatientFactor > 100:
|
||||||
return
|
yield from ctx.channel.send("Nee!")
|
||||||
elif impatientFactor > 15 and eventsMinutesAgo > 0:
|
return
|
||||||
Message = "Dat hebben jullie net gevraagd."
|
elif impatientFactor > 15 and eventsMinutesAgo > 0:
|
||||||
elif impatientFactor > 9:
|
Message = "Dat hebben jullie net gevraagd."
|
||||||
Message = "Nee."
|
elif impatientFactor > 9:
|
||||||
|
Message = "Nee."
|
||||||
|
|
||||||
yield from ctx.channel.send(ctx.author.mention + ' ' + str(Message))
|
yield from ctx.channel.send(ctx.author.mention + ' ' + str(Message))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user