# Discord

> Connect a Lobu agent to Discord servers via bot integration.

Lobu's Discord adapter supports direct messages, server channels, and interactive workflows.
Under the hood, Lobu uses the Chat SDK Discord adapter to handle DMs and server messaging.

<PlatformChatExamples platform="discord" client:visible />

## Setup

1. Create a Discord application at the [Discord Developer Portal](https://discord.com/developers/applications).
2. Under **Bot**, create a bot and copy the **bot token**.
3. Copy the **Application ID** and **Public Key** from the General Information page.
4. Under **OAuth2 → URL Generator**, select the `bot` scope with `Send Messages`, `Read Message History`, and `Use Slash Commands` permissions. Use the generated URL to invite the bot to your server.
5. Run `lobu connections add discord` to add the connection (prompts for the bot token), or run `lobu init` to scaffold a new project and pick Discord in the wizard.


## Configuration

<PlatformConfigTable platform="discord" />

## Features

- **Direct messages** and **server channel mentions** trigger the agent.
- **Role-based triggers** — configure specific roles that activate the agent beyond direct mentions.
- **Streaming responses** with throttled message edits (updates every 2s).
- **Markdown formatting** — agent responses render as Discord-flavored markdown.
- **Interactive elements** — buttons and cards for user prompts, permission grants, and configuration.
- **Access control** — restrict which users or groups can interact with the agent.

## Typical Use Cases

- Team assistant in a Discord server (engineering, support, knowledge base).
- Community bot that answers questions using your agent's skills and tools.
- Developer tool that runs commands or queries APIs on behalf of server members.
