sock=connect_NK()
try:
# Basile a un compte special user
- commande='login [%s,%s,"%s"]'%(json.dumps(username),json.dumps(password),typ)
+ commande='login [%s,%s,"%s",["note"]]'%(json.dumps(username),json.dumps(password),typ)
sock.write(commande)
out=sock.read()
except Exception as exc:
u"bien plein(|e|s|es)":u"bien pleine",
u"innocent(|e|s|es)":u"innocente"}
adj_reg=u"(?P<adjectif>"+u"|".join(adjectifs.keys())+u")"
- reg=u".*(^| )"+debuts+u" "+adj_reg+u"($|,|;|\.| ).*"
+ reg=u".*(^| |')"+debuts+u" "+adj_reg+u"($|,|;|\.| ).*"
matched=re.match(reg,message)
if matched:
# il faut repasser l'adjectif au féminin singulier
"""renvoie (False,lemessage) ou (True, le message amputé de "pseudo: ")"""
pseudo=serv.get_nickname()
size=len(pseudo)
- if message[:size]==pseudo and message[size]==":":
+ if message[:size]==pseudo and len(message)>size and message[size]==":":
return (True,message[size+1:].lstrip(" "))
else:
return (False,message)
try:
test=bot_unicode(message)
except UnicodeBotError:
- serv.privmsg(canal,
- "%s: Euh, tu fais de la merde avec ton encodage là, j'ai failli crasher…"%(auteur))
- return
+ if not canal in self.quiet_channels:
+ serv.privmsg(canal,
+ "%s: Euh, tu fais de la merde avec ton encodage là, j'ai failli crasher…"%(auteur))
+ return
pour_moi,message=self.pourmoi(serv,message)
if pour_moi and message.split()!=[]:
cmd=message.split()[0].lower()