!time: Fix negative value at nighttime
This commit is contained in:
parent
558795ba51
commit
1bcab60c27
@ -2919,10 +2919,10 @@ def timeleft(cli, nick, chan, rest):
|
|||||||
+ int((var.NIGHT_START_TIME-datetime.now()).total_seconds()))
|
+ int((var.NIGHT_START_TIME-datetime.now()).total_seconds()))
|
||||||
if nick == chan:
|
if nick == chan:
|
||||||
pm(cli, nick, "There is {0:0>2}:{1:0>2} remaining until {2}.".format(
|
pm(cli, nick, "There is {0:0>2}:{1:0>2} remaining until {2}.".format(
|
||||||
remaining//60, remaining%60, "sunrise" if var.PHASE=="night" else "sunset"))
|
abs(remaining//60), remaining%60, "sunrise" if var.PHASE=="night" else "sunset"))
|
||||||
else:
|
else:
|
||||||
cli.msg(chan, "There is {0:0>2}:{1:0>2} remaining until {2}.".format(
|
cli.msg(chan, "There is {0:0>2}:{1:0>2} remaining until {2}.".format(
|
||||||
remaining//60, remaining%60, "sunrise" if var.PHASE=="night" else "sunset"))
|
abs(remaining//60), remaining%60, "sunrise" if var.PHASE=="night" else "sunset"))
|
||||||
|
|
||||||
@pmcmd("time")
|
@pmcmd("time")
|
||||||
def timeleft_pm(cli, nick, rest):
|
def timeleft_pm(cli, nick, rest):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user