From 394d7a13108fd07e335cd9a2f4206ed7ad1b94ee Mon Sep 17 00:00:00 2001 From: Vincent Le Gallic Date: Sun, 23 Nov 2014 05:13:06 +0100 Subject: [PATCH] =?utf8?q?Possibilit=C3=A9=20de=20demander=20un=20whois?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- basile.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/basile.py b/basile.py index c549707..86917a4 100755 --- a/basile.py +++ b/basile.py @@ -211,6 +211,10 @@ class Basile(ircbot.SingleServerIRCBot): self.serv.privmsg(place, message) log(self.serveur, place, auteur, something + "%r" % params + ("[successful]" if success else "[failed]")) + def whois(self, pseudo): + """Demande un whois sur ``pseudo``. La réponse sera handled par une autre fonction.""" + self.serv.whois([pseudo]) + ### Surcharge des events du Bot def on_welcome(self, serv, ev): """À l'arrivée sur le serveur.""" @@ -469,6 +473,11 @@ class Basile(ircbot.SingleServerIRCBot): serv.privmsg(auteur, " ".join(self.overops)) else: notunderstood = True + elif cmd == u"whois": + if auteur in self.ops and len(message) > 1: + self.whois(message[1]) + else: + notunderstood = True else: notunderstood = True if notunderstood: -- 2.39.2