def dispatch_command(self, irc, msg, command, params): def dispatcher_command_thread(callback, interface, params): try: callback(interface, params) except: Logger.log_traceback(callback.im_self) finally: self._decrement_event_threads() params = Arguments(params) callbacks = self.get_command_callbacks(command) Logger.debug1("Found %d receiver(s) for command '%s'" % (len(callbacks), command)) if callbacks: interface = IRCMessageController(irc, msg) for (obj, callback, privileged) in callbacks: try: # This will abort instantly as soon as a command without access is found if privileged: if not self.acl.check_access(msg.source, command.lower()): interface.reply("Access denied") return thread = threading.Thread(target = dispatcher_command_thread, kwargs = {"callback": callback, "interface": interface, "params": params}) self._increment_event_threads() thread.start() except Exception as e: Logger.log_traceback(callback.im_self)