+ self.numhooks[num] = func
+ if self.parent is not None:
+ self.parent.hooknum(num, func)
+ return func
+ return realhook
+
+ def hookchan(self, chan, glevel=ANYONE, clevel=PUBLIC):
+ def realhook(func):
+ self.chanhooks[chan] = func
+ if self.parent is not None:
+ self.parent.hookchan(chan, func)
+ return func
+ return realhook
+
+ def hook(self, cmd, needchan=True, glevel=ANYONE, clevel=PUBLIC):
+ def realhook(func):
+ func.needchan = needchan
+ func.reqglevel = glevel
+ func.reqclevel = clevel
+