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) delta = (data['Time'] - CETUS_EPOCH) % (150*60)
if delta > (100*60): if delta > (100*60):
status = "Night" state = "Night"
eta = ((150*60) - delta, 'Day') next_state = "Day"
eta = (150*60) - delta
else: else:
status = "Day" state = "Day"
eta = ((100*60) - delta, 'Night') next_state = "Night"
msg = f"\x0310Cetus time\x0300: \x0312{status}\x0300 | " eta = (100*60) - delta
msg += f"\x0310Time until \x0312{eta[1]}\x0300: " if eta < 60:
msg += f"\x0308{eta[0]//60}m" 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) self.msg(channel, msg)
return
def joined(self, channel): def joined(self, channel):