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

# Discord

> Capture messages from Discord servers and talk to the Modem Agent

export const Prompt = ({text, variant = 'accent'}) => {
  const [copied, setCopied] = useState(false);
  const handleCopy = async () => {
    try {
      await navigator.clipboard.writeText(text);
      setCopied(true);
      setTimeout(() => setCopied(false), 2000);
    } catch {}
  };
  const clipboardIcon = <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
            <title>Copy</title>
            <rect x="9" y="9" width="13" height="13" rx="2" ry="2" />
            <path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" />
        </svg>;
  const checkIcon = <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
            <title>Copied</title>
            <polyline points="20 6 9 17 4 12" />
        </svg>;
  const promptIcon = <svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style={{
    flexShrink: 0,
    opacity: 0.4
  }}>
            <title>Prompt</title>
            <path d="M20 2H2v20h2V4h16v12H6v2H4v2h2v-2h16V2zM6 7h12v2H6zm8 4H6v2h8z" />
        </svg>;
  return <div className={`prompt prompt-${variant}`} style={{
    marginTop: '12px',
    marginBottom: '12px'
  }}>
            {promptIcon}
            <span className="prompt-text">{text}</span>
            <button className="prompt-copy" onClick={handleCopy} title="Copy to clipboard" type="button">
                {copied ? checkIcon : clipboardIcon}
            </button>
        </div>;
};

The Discord integration captures messages from your Discord servers and feeds them into Modem for analysis. Your team can also mention the Modem Agent in a channel to ask questions about that data and take action on it. It's designed for products and companies that engage their user community on Discord.

<Info>
  Mentioning `@Modem` in a channel is the only way to reach the agent in Discord. Unlike the [Slack integration](/docs/integrations/slack), the
  Modem bot does not accept direct messages, and it only answers people who have linked a Modem account. See [Who Can Talk to
  Modem?](#who-can-talk-to-modem).
</Info>

## Prerequisites

* Permission to add bots to the Discord server you want to connect
* Owner or admin role in your Modem organization

## Setup

<Steps>
  <Step title="Start the connection">
    Go to **Settings** → **Integrations** → **Discord** in your Modem dashboard and click **Connect Discord**.
  </Step>

  <Step title="Authorize the bot">
    You'll be redirected to Discord to authorize the Modem bot. Select the server you want to connect and click **Authorize**.
  </Step>

  <Step title="Subscribe to channels">
    Back in Modem, you'll see a list of channels from your server. Toggle on the channels you want Modem to monitor. See [Choosing
    Channels](#choosing-channels) below.
  </Step>

  <Step title="Wait for sync">
    Modem will backfill up to 30 days of message history from your selected channels, then listen for new messages in real time.
  </Step>

  <Step title="Talk to the agent">
    Mention the Modem bot in any channel it can read to ask questions and take action. See [Talking to the
    Agent](#talking-to-the-modem-agent-in-discord).
  </Step>
</Steps>

## Choosing Channels

Channels are not monitored by default. You subscribe to individual channels from **Settings** → **Integrations** → **Discord**, where each channel has a toggle. When you subscribe to a channel, Modem automatically starts a backfill of recent history.

Supported channel types:

* Text channels
* Forum channels (each post becomes a trackable conversation with its replies)
* Announcement channels

Subscribing to a channel also captures new messages in its threads and forum posts. Thread and forum post history from before you subscribed is not backfilled.

### Recommended Channels

* `#support` or `#help`: Community support requests
* `#feedback` or `#suggestions`: Feature requests and ideas
* `#bugs` or `#bug-reports`: User-reported issues
* Forum channels for structured discussions and Q\&A

### Channels to Avoid

* Team-only or moderator channels (unless relevant)
* Bot command channels
* Off-topic or meme channels (high noise, low signal)

<Tip>Start with a few key channels and expand based on what's useful. You can adjust channel selection anytime.</Tip>

## Talking to the Modem Agent in Discord

The same Modem Agent available on the web is also available in Discord. Mention `@Modem` in a channel to ask questions, get summaries, or take action on your data without leaving Discord.

<Prompt text="@modem What are users complaining about this week?" />

<Prompt text="@modem Summarize the last 7 days of feedback from #support" />

<Prompt text="@modem Create a Linear ticket for the OAuth bug reports and assign it to me" />

Each mention starts its own reply thread, named after your message, so every question stays a separate conversation. To follow up, mention `@Modem` again inside that thread and it continues the same conversation. Thread messages that don't mention the bot are ignored. If the bot can't create a thread, it replies in the channel instead.

<Info>
  Channel subscriptions control what Modem *captures*. The agent is separate: it responds in any channel the bot has permission to read,
  whether or not that channel is toggled on. A plain `@everyone` won't trigger it.
</Info>

### Who Can Talk to Modem?

Only authorized users can interact with the Modem Agent in Discord. Authorization requires two things:

1. **A linked Modem account.** Your Discord identity must be connected to a Modem account. If it isn't, go to **Profile** → **Linked Identities** in your Modem dashboard and connect Discord.
2. **Organization membership.** You must be a member of the Modem organization connected to that Discord server. If your account is linked but you're not a member, you'll need an administrator to invite you.

Anyone who meets both conditions can mention the bot from any channel it can read. Everyone else is ignored.

<Note>
  Because Discord servers are often public, the bot **stays silent** for unauthorized users instead of replying with a prompt to connect
  an account. Server owners and admins are the exception: the bot DMs them how to get access, at most about once a day. If their DMs are
  closed, it replies in the channel instead.
</Note>

## Troubleshooting

<AccordionGroup>
  <Accordion title="Bot doesn't respond when I mention it">
    The bot stays silent rather than explaining why, so work through these in order:

    * Confirm you mentioned `@Modem` directly. `@everyone` and plain messages don't trigger it
    * Confirm you're in a channel, not a DM. The bot doesn't accept direct messages
    * Check that your Discord account is linked at **Profile** → **Linked Identities** in your Modem dashboard
    * Check that you're a member of the Modem organization connected to this server
    * Check that the bot has permission to read and post in the channel, and to create threads
  </Accordion>

  <Accordion title="Bot isn't capturing messages">
    * Verify the bot has been added to your server - Check that the channel is toggled on in **Settings** → **Integrations** →
      **Discord** - For private channels, ensure the bot role has permission to view the channel
  </Accordion>

  <Accordion title="Can't see some channels">
    The bot can only see channels it has permission to access. Check: - Channel-specific permission overrides - Category permissions -
    Role permissions for the Modem bot
  </Accordion>

  <Accordion title="Missing user information">
    Discord doesn't expose user email addresses through its API. Person profiles will include username and display name, but not email.
  </Accordion>

  <Accordion title="Backfill is taking a long time">
    Backfills fetch history in pages with short delays to stay under Discord rate limits, so busy channels can take several minutes.
    Messages appear in Modem as they're fetched. Admins can re-run a channel's backfill with its **Backfill** button, at most once every 30 minutes.
  </Accordion>
</AccordionGroup>

## Disconnecting

To disconnect Discord:

1. Go to **Settings** → **Integrations** → **Discord**
2. Click **Disconnect** on the connection card

This disconnects every Discord server connected to your organization.

To fully remove the bot from your Discord server:

1. Open your Discord server settings
2. Go to **Integrations** → **Bots**
3. Find Modem and click **Remove**

Historical data remains in Modem after disconnecting.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.