Response sender is not needed anymore, private channels are now better handled

This commit is contained in:
nemunaire 2014-09-18 07:57:06 +02:00
commit 772d68a34d
32 changed files with 161 additions and 182 deletions

View file

@ -69,9 +69,9 @@ def cmd_sms(msg):
fails.append( "%s: %s" % (u, test) )
if len(fails) > 0:
return Response(msg.sender, "quelque chose ne s'est pas bien passé durant l'envoi du SMS : " + ", ".join(fails), msg.channel, msg.nick)
return Response("quelque chose ne s'est pas bien passé durant l'envoi du SMS : " + ", ".join(fails), msg.channel, msg.nick)
else:
return Response(msg.sender, "le SMS a bien été envoyé", msg.channel, msg.nick)
return Response("le SMS a bien été envoyé", msg.channel, msg.nick)
apiuser_ask = re.compile(r"(utilisateur|user|numéro|numero|compte|abonne|abone|abonné|account)\s+(est|is)\s+(?P<user>[0-9]{7,})", re.IGNORECASE)
apikey_ask = re.compile(r"(clef|key|password|mot de passe?)\s+(?:est|is)?\s+(?P<key>[a-zA-Z0-9]{10,})", re.IGNORECASE)
@ -90,7 +90,7 @@ def parseask(msg):
test = send_sms("nemubot", apiuser, apikey,
"Vous avez enregistré vos codes d'authentification dans nemubot, félicitation !")
if test is not None:
return Response(msg.sender, "je n'ai pas pu enregistrer tes identifiants : %s" % test, msg.channel, msg.nick)
return Response("je n'ai pas pu enregistrer tes identifiants : %s" % test, msg.channel, msg.nick)
if msg.nick in DATAS.index:
DATAS.index[msg.nick]["user"] = apiuser
@ -103,5 +103,5 @@ def parseask(msg):
ms.setAttribute("lastuse", 0)
DATAS.addChild(ms)
save()
return Response(msg.sender, "ok, c'est noté. Je t'ai envoyé un SMS pour tester ;)",
return Response("ok, c'est noté. Je t'ai envoyé un SMS pour tester ;)",
msg.channel, msg.nick)