Fix condition in task
This commit is contained in:
parent
df35d00b5d
commit
2ef450da5d
2
bot.py
2
bot.py
|
@ -21,7 +21,7 @@ class RadioBot(teambot.Handler):
|
||||||
if resp["dj"] is None and state.get("dj_live",True):
|
if resp["dj"] is None and state.get("dj_live",True):
|
||||||
state["dj_live"]=False
|
state["dj_live"]=False
|
||||||
if resp["song"]!=state.get("song") or resp["listeners"]!=state.get("listeners"):
|
if resp["song"]!=state.get("song") or resp["listeners"]!=state.get("listeners"):
|
||||||
bot.say(bot.channels[0],"now playing: {} ({!s} listeners{})".format(resp["song"],resp["listeners"],(", played by "+resp["dj"] if resp["dj"] is not None else "")))
|
bot.say(bot.channels[0],"now playing: {} ({!s} listeners{})".format(resp["song"],resp["listeners"],(", played by "+resp["dj"] if resp["dj_live"] else "")))
|
||||||
state["song"]=resp["song"]
|
state["song"]=resp["song"]
|
||||||
state["listeners"]=resp["listeners"]
|
state["listeners"]=resp["listeners"]
|
||||||
basestate["handler"].task_state = state
|
basestate["handler"].task_state = state
|
||||||
|
|
Loading…
Reference in New Issue