ping: more useful behaviour when noone can be pinged
This commit is contained in:
parent
e9c8768b31
commit
5789be967e
@ -332,7 +332,6 @@ def pinger(cli, nick, chan, rest):
|
||||
"Please wait a while before using it again."))
|
||||
return
|
||||
|
||||
var.LAST_PING = datetime.now()
|
||||
if var.PINGING:
|
||||
return
|
||||
var.PINGING = True
|
||||
@ -358,13 +357,17 @@ def pinger(cli, nick, chan, rest):
|
||||
|
||||
TO_PING.sort(key=lambda x: x.lower())
|
||||
|
||||
if TO_PING:
|
||||
var.LAST_PING = datetime.now()
|
||||
cli.msg(chan, "PING! "+" ".join(TO_PING))
|
||||
var.PINGING = False
|
||||
|
||||
minimum = datetime.now() + timedelta(seconds=var.PING_MIN_WAIT)
|
||||
if not var.CAN_START_TIME or var.CAN_START_TIME < minimum:
|
||||
var.CAN_START_TIME = minimum
|
||||
else:
|
||||
cli.msg(chan, "There is noone currently available to be pinged.")
|
||||
|
||||
var.PINGING = False
|
||||
decorators.unhook(HOOKS, 800)
|
||||
|
||||
cli.who(chan)
|
||||
|
Loading…
Reference in New Issue
Block a user