> ## Documentation Index
> Fetch the complete documentation index at: https://docs.camel-ai.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Camel.bots.slack.slack app

<a id="camel.bots.slack.slack_app" />

<a id="camel.bots.slack.slack_app.SlackApp" />

## SlackApp

```python theme={"system"}
class SlackApp:
```

Represents a Slack app that is powered by a Slack Bolt `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.

<a id="camel.bots.slack.slack_app.SlackApp.__init__" />

### **init**

```python theme={"system"}
def __init__(
    self,
    token: Optional[str] = None,
    scopes: Optional[str] = None,
    signing_secret: Optional[str] = None,
    client_id: Optional[str] = None,
    client_secret: Optional[str] = None,
    redirect_uri_path: str = '/slack/oauth_redirect',
    installation_store: Optional[AsyncInstallationStore] = None
):
```

Initializes the SlackApp instance by setting up the Slack Bolt app
and configuring event handlers and OAuth settings.

**Parameters:**

* **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.

<a id="camel.bots.slack.slack_app.SlackApp.setup_handlers" />

### setup\_handlers

```python theme={"system"}
def setup_handlers(self):
```

Sets up the event handlers for Slack events, such as `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.

<a id="camel.bots.slack.slack_app.SlackApp.run" />

### run

```python theme={"system"}
def run(
    self,
    port: int = 3000,
    path: str = '/slack/events',
    host: Optional[str] = None
):
```

Starts the Slack Bolt app server to listen for incoming Slack
events.

**Parameters:**

* **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).

<a id="camel.bots.slack.slack_app.SlackApp.mention_me" />

### mention\_me

```python theme={"system"}
def mention_me(self, context: 'AsyncBoltContext', body: SlackEventBody):
```

Check if the bot is mentioned in the message.

**Parameters:**

* **context** (AsyncBoltContext): The Slack Bolt context for the event.
* **body** (SlackEventBody): The body of the Slack event.

**Returns:**

bool: True if the bot is mentioned in the message, False otherwise.
