Module slack_bolt.listener.listener_completion_handler

Classes

class CustomListenerCompletionHandler (logger: logging.Logger, func: Callable[..., None])
Expand source code
class CustomListenerCompletionHandler(ListenerCompletionHandler):
    def __init__(self, logger: Logger, func: Callable[..., None]):
        self.func = func
        self.logger = logger
        self.arg_names = get_arg_names_of_callable(func)

    def handle(
        self,
        request: BoltRequest,
        response: Optional[BoltResponse],
    ):
        kwargs: Dict[str, Any] = build_required_kwargs(
            required_arg_names=self.arg_names,
            logger=self.logger,
            request=request,
            response=response,
            next_keys_required=False,
        )
        self.func(**kwargs)

Ancestors

Inherited members

class DefaultListenerCompletionHandler (logger: logging.Logger)
Expand source code
class DefaultListenerCompletionHandler(ListenerCompletionHandler):
    def __init__(self, logger: Logger):
        self.logger = logger

    def handle(
        self,
        request: BoltRequest,
        response: Optional[BoltResponse],
    ):
        pass

Ancestors

Inherited members

class ListenerCompletionHandler
Expand source code
class ListenerCompletionHandler(metaclass=ABCMeta):
    @abstractmethod
    def handle(
        self,
        request: BoltRequest,
        response: Optional[BoltResponse],
    ) -> None:
        """Do something extra after the listener execution

        Args:
            request: The request.
            response: The response.
        """
        raise NotImplementedError()

Subclasses

Methods

def handle(self, request: BoltRequest, response: Optional[BoltResponse]) ‑> None

Do something extra after the listener execution

Args

request
The request.
response
The response.