added seconds for <1m to day/night shift

This commit is contained in:
iou1name 2019-02-26 09:00:29 -05:00
parent e4053bace1
commit 7dc97123be

View File

@ -224,15 +224,22 @@ class WarBot(irc.IRCClient):
delta = (data['Time'] - CETUS_EPOCH) % (150*60)
if delta > (100*60):
status = "Night"
eta = ((150*60) - delta, 'Day')
state = "Night"
next_state = "Day"
eta = (150*60) - delta
else:
status = "Day"
eta = ((100*60) - delta, 'Night')
msg = f"\x0310Cetus time\x0300: \x0312{status}\x0300 | "
msg += f"\x0310Time until \x0312{eta[1]}\x0300: "
msg += f"\x0308{eta[0]//60}m"
state = "Day"
next_state = "Night"
eta = (100*60) - delta
if eta < 60:
eta = str(eta) + 's'
else:
eta = str(eta//60) + 'm'
msg = f"\x0310Cetus time\x0300: \x0312{state}\x0300 | "
msg += f"\x0310Time until \x0312{next_state}\x0300: "
msg += f"\x0308{eta}"
self.msg(channel, msg)
return
def joined(self, channel):