Merge pull request 'Fix the DJ topic thing' (#7) from khuxkm/bitbot-modules:fixdjtopic into master

Reviewed-on: #7
This commit is contained in:
Ben Harris 2020-11-26 17:47:50 +00:00
commit 64b9597400
1 changed files with 5 additions and 1 deletions

View File

@ -347,13 +347,17 @@ class Module(ModuleManager.BaseModule):
topic = event["spec"][0]
event["user"].set_setting("tilderadio-djtopic", topic)
event["stdout"].write(f"Set {event['user'].nickname}'s DJ topic to \"{topic}\".")
@utils.hook("received.command.djtopic")
@utils.kwarg("help", "get the DJ topic for the active DJ or for any DJ")
@utils.spec("?<dj>user")
def setdjtopic(self, event):
def djtopic(self, event):
dj = event["spec"][0]
if dj is None:
if self.dj is "":
event["stderr"].write(f"Nobody is streaming right now.")
return
if event["server"].has_user_id(self.dj):
dj = event["server"].get_user(self.dj)
else: