Module slack_bolt.listener_matcher.custom_listener_matcher

Classes

class CustomListenerMatcher (*,
app_name: str,
func: Callable[..., bool],
base_logger: logging.Logger | None = None)
Expand source code
class CustomListenerMatcher(ListenerMatcher):
    app_name: str
    func: Callable[..., bool]
    arg_names: MutableSequence[str]
    logger: Logger

    def __init__(self, *, app_name: str, func: Callable[..., bool], base_logger: Optional[Logger] = None):
        self.app_name = app_name
        self.func = func
        self.arg_names = get_arg_names_of_callable(func)
        self.logger = get_bolt_app_logger(self.app_name, self.func, base_logger)

    def matches(self, req: BoltRequest, resp: BoltResponse) -> bool:
        return self.func(
            **build_required_kwargs(
                logger=self.logger,
                required_arg_names=self.arg_names,
                request=req,
                response=resp,
                this_func=self.func,
            )
        )

Ancestors

Class variables

var app_name : str

The type of the None singleton.

var arg_names : MutableSequence[str]

The type of the None singleton.

var func : Callable[..., bool]

The type of the None singleton.

var logger : logging.Logger

The type of the None singleton.

Inherited members