- callback = self.parent.gethook(cmd)
- if chan is None and callback.needchan:
- self.msg(user, "You need to specify a channel for that command.")
- return
- if user.glevel >= callback.reqglevel: #TODO TODO TODO check reqclevel
- callback(self, user, chan, *pieces[1:])
- return
-
- self.msg(user, "No such command, or you don't have access.")
+ for callback in self.parent.gethook(cmd):
+ if chan is None and callback.needchan:
+ self.msg(user, "You need to specify a channel for that command.")
+ elif user.glevel >= callback.reqglevel and (not callback.needchan or chan.levelof(user.auth) >= callback.reqclevel):
+ cbret = callback(self, user, chan, target, *pieces[1:])
+ if cbret is NotImplemented:
+ self.msg(user, "Command not implemented.")