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)
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)
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)
def onMode(self, who, chan, mode, args): modules.fire_hook("mode", modules.IrcContext(self, chan, who), mode, args)
def onNick(self, old, new): modules.fire_hook("nick", modules.IrcContext(self, None, old), new)
def onTopic(self, who, chan, topic): modules.fire_hook("topic", modules.IrcContext(self, chan, who), topic)
def onQuit(self, who, message): modules.fire_hook("quit", modules.IrcContext(self, None, who))
def onPart(self, who, chan, msg): modules.fire_hook("part", modules.IrcContext(self, chan, who))
def onJoin(self, who, chan): modules.fire_hook("join", modules.IrcContext(self, chan, who))
def onAction(self, chan, who, what): modules.fire_hook("action", modules.IrcContext(self, chan, who), what)
def onMsg(self, chan, who, what): modules.fire_hook("message", modules.IrcContext(self, chan, who), what)