def register_listener(self, trigger: str, func: callable, **kwargs) -> None:
        """
        Register a listener for the given trigger. Raises an TypeError when the trigger is not a valid one.
        To get a list with all valid triggers, use LISTEN_ON_OPTIONS.
        :param trigger: the trigger on which the given callback should be used. 
        Currently supported: 'universe availability change', 'universe'
        :param func: the callback. The parameters depend on the trigger. See README for more information
        """
        if trigger in LISTEN_ON_OPTIONS:
            if trigger == LISTEN_ON_OPTIONS[1]:  # if the trigger is universe, use the universe from args as key
                try:
                    self._callbacks[kwargs[LISTEN_ON_OPTIONS[1]]].append(func)
                except:
                    self._callbacks[kwargs[LISTEN_ON_OPTIONS[1]]] = [func]
            try:
                self._callbacks[trigger].append(func)
            except:
                self._callbacks[trigger] = [func]
        else:
            raise TypeError(f'The given trigger "{trigger}" is not a valid one!')
def register_listener ( self , trigger : str , func : callable , ** kwargs ) -> None : if trigger in LISTEN_ON_OPTIONS : if trigger == LISTEN_ON_OPTIONS [ 1 ] : try : self . _callbacks [ kwargs [ LISTEN_ON_OPTIONS [ 1 ] ] ] . append ( func ) except : self . _callbacks [ kwargs [ LISTEN_ON_OPTIONS [ 1 ] ] ] = [ func ] try : self . _callbacks [ trigger ] . append ( func ) except : self . _callbacks [ trigger ] = [ func ] else : raise TypeError ( f'The given trigger "{trigger}" is not a valid one!' )
Register a listener for the given trigger. Raises an TypeError when the trigger is not a valid one.
        To get a list with all valid triggers, use LISTEN_ON_OPTIONS.
        :param trigger: the trigger on which the given callback should be used. 
        Currently supported: 'universe availability change', 'universe'
        :param func: the callback. The parameters depend on the trigger. See README for more information