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

# Discord

> Connect Thena to your Discord server for seamless support and community management.

<img src="https://mintcdn.com/thena-840ce5ec/qw0IBJ-u1Oc1t24_/images/docs/Discord.webp?fit=max&auto=format&n=qw0IBJ-u1Oc1t24_&q=85&s=b86b8ba8581d20bc99f8d490870b0aa3" alt="Discord integration with Thena platform" className="rounded-lg" width="2560" height="1600" data-path="images/docs/Discord.webp" />

## Overview

Transform your Discord server into a powerful support hub with Thena's native Discord integration. Built for modern teams and communities, this integration turns Discord conversations into structured tickets, enables intelligent automation, and provides comprehensive customer support capabilities—all within your Discord environment.

Whether you're managing a gaming community, providing technical support, or handling customer inquiries, Thena brings enterprise-grade ticketing and workflow automation directly to Discord.

<Warning>
  **Setup Requirements**: The Discord integration currently requires setup through the Thena API and Discord bot commands. There is no user interface available for configuration at this time. All setup must be completed using API calls and admin commands within your Discord server.
</Warning>

## Key features

<CardGroup cols={2}>
  <Card title="Automated ticket creation" icon="ticket">
    Convert Discord channel messages into organized tickets on Thena with flexible creation modes.
  </Card>

  <Card title="Channel support & sync" icon="messages">
    Support for regular and forum channels with bidirectional syncing of comments, reactions, and attachments between Discord and Thena.
  </Card>

  <Card title="Reaction synchronization" icon="thumbs-up">
    Bidirectional emoji reactions sync between Discord messages and Thena comments for seamless interaction.
  </Card>

  <Card title="File attachment support" icon="paperclip">
    Automatic handling of file uploads, downloads, and synchronization between Discord and Thena platform.
  </Card>
</CardGroup>

## Setup guide

### Step 1: Add Thena bot to your Discord server

Click the following link to add the Thena bot to your Discord server:

[**Add Thena bot to Discord**](https://discord.com/oauth2/authorize?client_id=1404455972025405470\&scope=bot+applications.commands\&permissions=8)

<Note>
  This will redirect you to Discord where you can select your server and add the Thena bot.
</Note>

### Step 2: Installing the Discord app for your organization

After adding the bot to your Discord server, you need to create the installation in your Thena organization to connect your teams.

<Steps>
  <Step title="Prepare the installation request">
    Create a POST request to install the Discord app with the following:

    ```bash theme={null}
    curl --location 'https://apps-studio.thena.ai/apps/install' \
    --header 'Content-Type: application/json' \
    --header 'x-api-key: YOUR_API_KEY' \
    --data '{
      "teamIds": [
        "team-1-id",
        "team-2-id",
        "team-3-id"
      ],
      "appId": "RHT98D2K10NW3M086YJ5CKVBYPGBS",
      "appConfiguration": {
        "required_settings": [],
        "optional_settings": []
      }
    }'
    ```

    Include your API key in the request headers:

    ```
    x-api-key: YOUR_API_KEY
    ```

    <Tip>
      **Adding all teams**: To give all your Thena teams access to Discord integration, include all relevant team IDs in the `teamIds` array.
    </Tip>

    <Note>
      **Finding Team IDs**: You can find your team ID from the URL when you're in the team dashboard in Thena. For example, if the URL is `https://dashboard.thena.ai/dashboard/T123NHFDRF`, then the team ID is `T123NHFDRF`.
    </Note>

    <Note>
      The `appId` must be exactly `RHT98D2K10NW3M086YJ5CKVBYPGBS` for Discord integration.
    </Note>
  </Step>

  <Step title="Make the API call">
    Use the [Install an App API](/api-reference/apps-platform/app-installation/install-an-app) to create the installation with the prepared request body.

    <Note>
      The API endpoint will handle connecting your Discord server to the specified Thena teams.
    </Note>
  </Step>

  <Step title="Save installation response">
    Once the installation is successful, you will receive an API response containing:

    * `botToken`: This token should be used as the `apiKey` parameter in the authentication command in discord (you'll need this in Step 3)
    * `installedByOrgId`: This is your Organization ID (something like `EYGF098765`) that you'll need for authentication in Step 3

    Save these values as you'll need them for the next step.
  </Step>
</Steps>

### Step 3: Configure Discord server with admin commands

After successful installation, use Discord admin commands to configure your server.

<Steps>
  <Step title="View available commands">
    In your Discord server, type the following command to see all available admin commands:

    ```
    !admin list
    ```

    This will show you all available admin commands:

    ```
    Available Admin Commands:

    Authentication:
    !admin auth <apiKey> <orgId> - Authenticate this server with organization

    Team Mapping:
    !admin map-team <teamId> <channelId> [Regular|Forum] - Map a team to a channel
    !admin view-teams - View all team-channel mappings for this server

    Ticket Creation Settings:
    !admin set-ticket-mode <channelId> all|emoji|none - Set ticket creation mode for a channel
    !admin view-config - View configuration for server

    Utility Commands:
    !admin view-channels - List all channels in the server with their types

    Help:
    !admin list - Show this help message
    ```
  </Step>

  <Step title="Authenticate your Discord server">
    Use the API key from the installation response and your organization ID from the Thena dashboard to authenticate your server:

    ```
    !admin auth YOUR_API_KEY YOUR_ORG_ID
    ```

    **Example:**

    ```
    !admin auth pk_live_Q6Ed... ELLG711ICF
    ```

    <Note>
      Replace `YOUR_API_KEY` with the value from the installation API response and `YOUR_ORG_ID` with your organization ID from the API response.
    </Note>
  </Step>

  <Step title="View available teams and channels">
    First, check which teams are available from your installation:

    ```
    !admin view-teams
    ```

    This will show all teams that were configured during installation.

    Next, view all channels in your Discord server:

    ```
    !admin view-channels
    ```

    This will list all channels with their IDs and types (Regular or Forum).
  </Step>

  <Step title="Map teams to channels">
    Connect your Thena teams to specific Discord channels using the IDs from the previous step:

    ```
    !admin map-team <teamId> <channelId> [Regular|Forum]
    ```

    **Example:**

    ```
    !admin map-team TTTZ733Q77 123456789012345678 Forum
    ```

    <Note>
      Use the team IDs shown in `!admin view-teams` and channel IDs from `!admin view-channels`. Make sure to specify the correct channel type (Regular or Forum).
    </Note>
  </Step>

  <Step title="Configure ticket creation modes (Regular channels only)">
    For **Regular channels**, you can configure when tickets should be created:

    ```
    !admin set-ticket-mode <channelId> all|emoji|none
    ```

    **Options:**

    * `all`: Every message creates a ticket
    * `emoji`: Only messages with specific emoji reactions create tickets (🎫 ticket emoji)
    * `none`: No automatic ticket creation

    **Example:**

    ```
    !admin set-ticket-mode 123456789012345678 emoji
    ```

    <Note>
      **Default mode**: Regular channels are set to `emoji` mode by default. Users need to start a message with the 🎫 ticket emoji to create a ticket from a message.
    </Note>

    <Info>
      **Forum channels**: All posts in Forum channels automatically create tickets by default. You don't need to configure ticket creation modes for Forum channels.
    </Info>
  </Step>

  <Step title="View your configuration">
    Check your server configuration along with all team-channel mappings:

    ```
    !admin view-config
    ```
  </Step>
</Steps>

## What's next?

After completing the initial setup, you can configure advanced features:

<CardGroup cols={2}>
  <Card title="Configure channels" icon="list-tree">
    Set up which Discord channels should create tickets and how they should be routed to your teams.
  </Card>

  <Card title="Set up automation" icon="robot">
    Configure automated responses, ticket routing rules, and AI-powered insights for your Discord integration.
  </Card>

  <Card title="Customize workflows" icon="arrow-progress">
    Create custom workflows for different types of Discord interactions and support scenarios.
  </Card>

  <Card title="Monitor performance" icon="chart-line">
    Track support metrics, response times, and customer satisfaction across your Discord community.
  </Card>
</CardGroup>

## Important considerations

<Info>
  **Team access**: Make sure to add all relevant teams to the `teamIds` array during installation. Teams not included in this array won't have access to Discord integration features.
</Info>

<Tip>
  **Testing**: After setup, test the integration by sending a message in a configured channel to ensure tickets are being created properly in Thena.
</Tip>
