wuvt: add listener count support

master
mutantmonkey 2015-04-05 19:11:52 -07:00
parent df08d3e401
commit bfccb2854f
1 changed files with 13 additions and 4 deletions

View File

@ -17,9 +17,18 @@ def wuvt(phenny, input):
except: except:
raise GrumbleError("Failed to fetch current track from WUVT") raise GrumbleError("Failed to fetch current track from WUVT")
if 'listeners' in trackinfo:
phenny.say(
"{dj} is currently playing {title} by {artist} with {listeners:d} "
"online listeners".format(
dj=trackinfo['dj'],
title=trackinfo['title'],
artist=trackinfo['artist'],
listeners=trackinfo['listeners']))
else:
phenny.say("{dj} is currently playing {title} by {artist}".format( phenny.say("{dj} is currently playing {title} by {artist}".format(
dj=trackinfo['dj'].strip(), dj=trackinfo['dj'],
title=trackinfo['title'].strip(), title=trackinfo['title'],
artist=trackinfo['artist'].strip())) artist=trackinfo['artist']))
wuvt.commands = ['wuvt'] wuvt.commands = ['wuvt']
wuvt.example = '.wuvt' wuvt.example = '.wuvt'