Compare commits
3 Commits
Author | SHA1 | Date |
---|---|---|
dokuja | 9029a9124c | |
dokuja | 0878ec146c | |
dokuja | 03d68d9fe6 |
|
@ -221,6 +221,28 @@ class Module(ModuleManager.BaseModule):
|
|||
)
|
||||
)
|
||||
|
||||
@utils.hook("received.command.unn", alias_of="upnextnext")
|
||||
@utils.hook("received.command.upnextnext")
|
||||
@utils.kwarg("help", "show who's up after the next to stream")
|
||||
def upnextnext(self, event):
|
||||
js = utils.http.request(
|
||||
AZURACAST_API_BASE + "/station/1/schedule?rows=2"
|
||||
).json()
|
||||
if len(js) < 1:
|
||||
event["stdout"].write("nothing scheduled")
|
||||
else:
|
||||
data = js[1]
|
||||
start = utils.datetime.parse.iso8601(data["start"])
|
||||
now = utils.datetime.utcnow()
|
||||
total_secs = (start - now).total_seconds()
|
||||
event["stdout"].write(
|
||||
"{} is up next next at {} UTC in {}!".format(
|
||||
data["name"],
|
||||
utils.datetime.format.datetime_human(start),
|
||||
utils.datetime.format.to_pretty_time(total_secs),
|
||||
)
|
||||
)
|
||||
|
||||
@utils.hook("received.command.subscribe")
|
||||
@utils.kwarg("help", "sign up to get a direct message when a new dj goes online")
|
||||
def subscribe(self, event):
|
||||
|
|
Loading…
Reference in New Issue