+ if len(pieces) > 1:
+ chanword = pieces[1]
+ if chanword.startswith('#'):
+ chanparam = self.parent.channel(chanword)
+
+ if target != self.nick: # message was sent to a channel
+ chan = self.parent.channel(target)
+ if not triggerused:
+ if self.parent.haschanhook(target.lower()):
+ for callback in self.parent.getchanhook(target.lower()):
+ try:
+ cbret = callback(self, user, chan, *pieces)
+ except NotImplementedError:
+ self.msg(user, "Command not implemented.")
+ except:
+ self.msg(user, "Command failed. Code: CBEXC%09.3f" % (time.time() % 100000))
+ self.__debug_cbexception("chanhook", user=user, target=target, msg=msg)
+ return # not to bot, don't process!
+