Fix np and add joke commands

This commit is contained in:
Robert Miles 2018-12-01 00:42:56 -05:00
parent 2ef450da5d
commit 7c40195543
1 changed files with 6 additions and 1 deletions

7
bot.py
View File

@ -27,6 +27,7 @@ class RadioBot(teambot.Handler):
basestate["handler"].task_state = state
return state
def on_pubmsg(self,channel,nick,text):
print(self.event.source.userhost)
if text.startswith(self._bot.bot_nick+": "):
cmd = text[len(self._bot.bot_nick+": "):].strip()
if self.event.source.userhost=="khuxkm@oper.tilde.chat" and cmd=="down":
@ -37,8 +38,12 @@ class RadioBot(teambot.Handler):
self.say(channel,nick+": {} is the current dj!".format(self.task_state["dj"]))
else:
self.say(channel,nick+": nobody is live right now.")
elif cmd=="nowplaying":
elif cmd=="np":
self.say(channel,nick+": now playing: {} ({!s} listeners{})".format(self.task_state["song"],self.task_state["listeners"],(", played by "+self.task_state["dj"] if self.task_state["dj_live"] else "")))
elif cmd=="radio": # joke command
self.say(channel,"eat the poop or die!!1")
elif cmd=="paymybills": # joke command
self.say(channel,"whaddya mean?! i'm broker than you!")
elif text.strip()=="!botlist":
self.say(channel,"Maintainer: khuxkm@tilde.team | your friendly neighborhood radio bot | https://tildegit.org/khuxkm/radiobot")