SlackApp
AsyncApp
.
This class is responsible for initializing and managing the Slack
application by setting up event handlers, running the app server, and
handling events such as messages and mentions from Slack.
Parameters:
- token (Optional[str]): Slack API token for authentication.
- scopes (Optional[str]): Slack app scopes for permissions.
- signing_secret (Optional[str]): Signing secret for verifying Slack requests.
- client_id (Optional[str]): Slack app client ID.
- client_secret (Optional[str]): Slack app client secret.
- redirect_uri_path (str): The URI path for OAuth redirect, defaults to “/slack/oauth_redirect”.
- installation_store (Optional[AsyncInstallationStore]): The installation store for handling OAuth installations.
init
- token (Optional[str]): The Slack API token.
- scopes (Optional[str]): The scopes for Slack app permissions.
- signing_secret (Optional[str]): The signing secret for verifying requests.
- client_id (Optional[str]): The Slack app client ID.
- client_secret (Optional[str]): The Slack app client secret.
- redirect_uri_path (str): The URI path for handling OAuth redirects (default is “/slack/oauth_redirect”).
- installation_store (Optional[AsyncInstallationStore]): An optional installation store for OAuth installations.
setup_handlers
app_mention
and message
.
This method registers the app_mention
and on_message
event handlers
with the Slack Bolt app to respond to Slack events.
run
- port (int): The port on which the server should run (default is 3000).
- path (str): The endpoint path for receiving Slack events (default is “/slack/events”).
- host (Optional[str]): The hostname to bind the server (default is None).
mention_me
- context (AsyncBoltContext): The Slack Bolt context for the event.
- body (SlackEventBody): The body of the Slack event.