Ejemplo n.º 1
0
 def onNotice(self, target, who, message):
     if not self._ns_authed and who.nick == self._ns_name:
         if self._ns_find in message:
             self.say(self._ns_name, "IDENTIFY %s" % self._ns_pass)
     else:  # Intentionally don't allow it to intercept NickServ messages.
         modules.fire_hook("notice", modules.IrcContext(self, target, who),
                           message)
Ejemplo n.º 2
0
 def onCtcp(self, chan, who, cmd, arg):
     if cmd == "VERSION":
         self.notice(who.nick, "\x01VERSION Schongo Bot %s\x01" % version)
     elif cmd == "PING":
         self.notice(who.nick, "\x01PING %s\x01" % arg)
     else:
         modules.fire_hook("ctcp", modules.IrcContext(self, chan, who), cmd,
                           arg)
Ejemplo n.º 3
0
 def onMessage(self, msg):
     # Call the parent so we still function.
     IrcClient.onMessage(self, msg)
     # Fire off an event for modules to eat
     modules.fire_hook("irc_%s" % msg.command,
                       modules.IrcContext(self, None, msg.origin), msg)
Ejemplo n.º 4
0
 def onMode(self, who, chan, mode, args):
     modules.fire_hook("mode", modules.IrcContext(self, chan, who), mode,
                       args)
Ejemplo n.º 5
0
 def onNick(self, old, new):
     modules.fire_hook("nick", modules.IrcContext(self, None, old), new)
Ejemplo n.º 6
0
 def onTopic(self, who, chan, topic):
     modules.fire_hook("topic", modules.IrcContext(self, chan, who), topic)
Ejemplo n.º 7
0
 def onQuit(self, who, message):
     modules.fire_hook("quit", modules.IrcContext(self, None, who))
Ejemplo n.º 8
0
 def onPart(self, who, chan, msg):
     modules.fire_hook("part", modules.IrcContext(self, chan, who))
Ejemplo n.º 9
0
 def onJoin(self, who, chan):
     modules.fire_hook("join", modules.IrcContext(self, chan, who))
Ejemplo n.º 10
0
 def onAction(self, chan, who, what):
     modules.fire_hook("action", modules.IrcContext(self, chan, who), what)
Ejemplo n.º 11
0
 def onMsg(self, chan, who, what):
     modules.fire_hook("message", modules.IrcContext(self, chan, who), what)