> ## 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.discord.discord app

<a id="camel.bots.discord.discord_app" />

<a id="camel.bots.discord.discord_app.DiscordApp" />

## DiscordApp

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

A class representing a Discord app that uses the `discord.py` library
to interact with Discord servers.

This bot can respond to messages in specific channels and only reacts to
messages that mention the bot.

**Parameters:**

* **channel\_ids** (Optional\[List\[int]]): A list of allowed channel IDs. If provided, the bot will only respond to messages in these channels.
* **token** (Optional\[str]): The Discord bot token used for authentication.

<a id="camel.bots.discord.discord_app.DiscordApp.__init__" />

### **init**

```python theme={"system"}
def __init__(
    self,
    channel_ids: Optional[List[int]] = None,
    token: Optional[str] = None,
    client_id: Optional[str] = None,
    client_secret: Optional[str] = None,
    redirect_uri: Optional[str] = None,
    installation_store: Optional[DiscordBaseInstallationStore] = None,
    intents: Optional[discord.Intents] = None
):
```

Initialize the DiscordApp instance by setting up the Discord client
and event handlers.

**Parameters:**

* **channel\_ids** (Optional\[List\[int]]): A list of allowed channel IDs. The bot will only respond to messages in these channels if provided. (default: :obj:`None`)
* **token** (Optional\[str]): The Discord bot token for authentication. If not provided, the token will be retrieved from the environment variable `DISCORD_TOKEN`. (default: :obj:`None`)
* **client\_id** (str, optional): The client ID for Discord OAuth. (default: :obj:`None`)
* **client\_secret** (Optional\[str]): The client secret for Discord OAuth. (default: :obj:`None`)
* **redirect\_uri** (str): The redirect URI for OAuth callbacks. (default: :obj:`None`)
* **installation\_store** (DiscordAsyncInstallationStore): The database stores all information of all installations. (default: :obj:`None`)
* **intents** (discord.Intents): The Discord intents of this app. (default: :obj:`None`)

<a id="camel.bots.discord.discord_app.DiscordApp.run" />

### run

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

Start the Discord bot using its token.

This method starts the bot and logs into Discord synchronously using
the provided token. It blocks execution and keeps the bot running.

<a id="camel.bots.discord.discord_app.DiscordApp.client" />

### client

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