Skip to content

Commit

Permalink
Added better colouring and added missing quote in handler setup.
Browse files Browse the repository at this point in the history
  • Loading branch information
Wessie committed Jun 5, 2014
1 parent 35d3673 commit 48a41f1
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions bot/hanyuu_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -666,18 +666,22 @@ def tags(server, nick, channel, text, hostmask):
"SELECT tags FROM tracks WHERE id=%s", (id,))
if cur.rowcount == 1:
tags = row['tags']
message = u"Title: {c3}{title}{c} Faves: {faves} Plays: {plays} Tags: {c6}{tags}"\
.format(
title=song.metadata, faves=song.favecount, plays=song.playcount,
tags=tags, **irc_colours)
message = (u"{c3}Title: {c}{title} {c3}Faves: {c}{faves}"
u"{c3}Plays: {c}{plays} {c3}Tags: {c}{tags}")
message = message.format(
title=song.metadata,
faves=song.favecount,
plays=song.playcount,
tags=tags, **irc_colours
)
else:
message = u"Missing ID"
if mode == '@':
server.privmsg(channel, message)
else:
server.notice(nick, message)

tags.handler = ("on_text, r'[.!@]t(ags)?.*',
tags.handler = ("on_text", r'[.!@]t(ags)?.*',
irc.ALL_NICKS, irc.MAIN_CHANNELS)

def request_help(server, nick, channel, text, hostmask):
Expand Down

0 comments on commit 48a41f1

Please sign in to comment.