Add DJ timer to 'dj' command output #3
|
@ -88,6 +88,7 @@ class Module(ModuleManager.BaseModule):
|
|||
# self.song = data["now_playing"]["song"]["text"]
|
||||
self.is_online = data["live"]["is_live"]
|
||||
self.dj = data["live"]["streamer_name"]
|
||||
self.broadcast_start = data["live"]["broadcast_start"]
|
||||
#self.listeners = data["listeners"]["current"]
|
||||
|
||||
def format_nowplaying(self):
|
||||
|
@ -289,6 +290,10 @@ class Module(ModuleManager.BaseModule):
|
|||
message = "no one is currently on the air"
|
||||
else:
|
||||
message = f"{self.dj} is now streaming!"
|
||||
if self.broadcast_start:
|
||||
now = utils.datetime.utcnow().timestamp()
|
||||
total_seconds = now - self.broadcast_start
|
||||
message += " (for {})".format(util.datetime.to_pretty_time(total_seconds))
|
||||
event["stdout"].write(message)
|
||||
|
||||
@utils.hook("received.command.slogan")
|
||||
|
|
Loading…
Reference in New Issue
Block a user