# Docs Agent Discord bot

import { Aside, Steps } from '@astrojs/starlight/components';

<Aside type="note" title="Request access">
  Docs Agent is available to all plans, but we grant access on request. Contact **support@ekline.io** to request access.
</Aside>

Create documentation without leaving Discord. Mention the EkLine bot in any channel or thread on a connected server, and Docs Agent replies in the same thread with a draft you can review and edit in EkLine.

## Prerequisites

Before you begin, you need:

- An EkLine organization account.
- Discord server administrator access to authorize the app.
- Docs Agent access enabled for your organization.

## Connect your Discord server

<Steps>
1. Go to **Settings > Organization > Integrations** in your EkLine dashboard.

2. Find **Discord** in the integrations list.

3. Click **Connect**.

4. Authorize EkLine to access your Discord server in the authorization popup.

5. Select the server to connect, then complete the authorization flow.

6. Verify the integration shows as **Connected**.
</Steps>

Connecting a server maps it to your EkLine organization, so mentions from that server run under your organization's Docs Agent access. Once connected, anyone in the server can mention the EkLine bot to start a draft.

## Create documentation from Discord

<Steps>
1. In any channel or thread on the connected server, mention the EkLine bot followed by your request.
   ```
   @EkLine create a troubleshooting guide based on this discussion
   ```

2. Read the acknowledgment. The bot confirms it picked up your request, then works on the draft. Docs Agent posts the finished answer once, rather than streaming its progress step by step.

3. Read Docs Agent's reply in the same thread. Long answers arrive as more than one message because Discord limits the length of a single message.
</Steps>

<Aside type="note" title="Mention the bot in servers, not direct messages">
The bot answers mentions inside a connected server. It does not respond to direct messages, because a direct message carries no server to resolve to your organization.
</Aside>

## Review and edit in EkLine

Each Discord mention starts a Docs Agent session. The session appears in your session list in the EkLine app, tagged with the **Discord** source, so you can open it to review the draft, refine it, and open a pull request. To find it, filter the session list by source. See [Find your sessions](/agent/find-sessions).

## Context the bot captures

The bot reads the conversation around your mention to produce accurate documentation:

| Context type | What the bot captures |
|--------------|-----------------------|
| Thread messages | Up to the last 20 messages in the thread, oldest first, so the agent reads the exchange in order. |
| Your request | The text of your mention, with the bot mention removed. |

<Aside type="tip" title="Get better results">
Mention the bot in threads with relevant discussion. The more context in the thread, the more accurate the generated documentation.
</Aside>

## Write effective prompts

The quality of your prompt determines the quality of the output.

| Instead of... | Try... |
|---------------|--------|
| "help with docs" | "Create a troubleshooting guide for the API timeout issue discussed here" |
| "document this" | "Write a how-to guide for the workaround Sarah described" |
| "make docs" | "Update the authentication docs based on the new flow we agreed on" |

**Include specific details:**

- Reference the type of documentation you need: tutorial, how-to guide, reference, troubleshooting.
- Name specific topics or features from the conversation.
- Mention existing documentation to update if applicable.
- Point to URLs or ticket IDs for more context.

## Troubleshooting

| Issue | Solution |
|-------|----------|
| Bot does not respond in a direct message | Mention the bot in a channel or thread on a connected server. The bot does not answer direct messages. |
| "This server isn't connected to EkLine" | Ask a server administrator to connect the server in **Settings > Organization > Integrations**. |
| "This server is connected, but its EkLine organization has no API token" | Someone with EkLine access needs to set up an API token for the organization. Contact **support@ekline.io** if you need help. |
| "I couldn't reach EkLine just now" | The lookup could not reach EkLine. Wait a moment and mention the bot again. |
| Reply arrives as several messages | Discord limits the length of a single message, so Docs Agent splits long answers across messages. Read them in order. |
| Draft does not match expectations | Give more specific instructions in your mention. Include the documentation type and key topics to cover. |

## Next steps

- [Docs Agent Slack bot](/agent/slack-bot): Create documentation drafts from Slack channels and threads.
- [Find your sessions](/agent/find-sessions): Open, filter, and manage every Docs Agent session, including sessions started from Discord.
- [Create documentation](/agent/create): Generate READMEs, API references, and guides from your codebase.
- [Integrations](/agent/integrations): Connect Notion, Linear, Jira, and other tools.