become=args
serv.nick(become)
log(canal,auteur,message+"[successful]")
-
if cmd in ["coucou"] and not canal in self.quiet_channels:
serv.privmsg(canal,"%s: coucou"%(auteur))
if cmd in ["ping"] and not canal in self.quiet_channels:
serv.privmsg(canal,("%s: Rappel : %s"%(auteur,self.play_status[canal][1])).encode("utf8") )
else:
serv.privmsg(canal,"%s: pas ici…"%(auteur))
+ if cmd in ["score","!score"]:
+ serv.privmsg(auteur,"Votre score : %s"%(self.get_scores().get(auteur,0)) )
+ if cmd in ["scores","!scores"]:
+ scores=self.get_scores().items()
+ # trie par score
+ scores.sort(lambda x,y:cmp(x[1],y[1]))
+ scores.reverse()
+ serv.privmsg(auteur,"Scores by score : "+" ; ".join(["%s %s"%(i[0],i[1]) for i in scores]))
+ # trie par pseudo
+ scores.sort(lambda x,y:cmp(x[0].lower(),y[0].lower()))
+ serv.privmsg(auteur,"Scores by pseudo : "+" ; ".join(["%s %s"%(i[0],i[1]) for i in scores]))
if cmd=="indice" and canal in self.play_channels:
self.give_indice(serv,canal,None)
if is_tag(message) and not canal in self.quiet_channels: