> For the complete documentation index, see [llms.txt](https://acoservice.gitbook.io/acoservice-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://acoservice.gitbook.io/acoservice-documentation/setting-up-your-tenant/discord-application.md).

# Your Discord application

Register a Discord application so members can sign in to your site.

Your tenant needs its own **Discord application**. One application provides everything: the credentials members sign in with, *and* the bot that runs your slash commands and checkout feed. It takes about five minutes.

## Step 1 — Create the application

1. Go to [discord.com/developers/applications](https://discord.com/developers/applications).
2. Click **New Application** in the top right.
3. Name it something obvious like `MyAco Site Login`. The name is internal; members never see it.
4. Accept the terms and click **Create**.

## Step 2 — Grab your Client ID and Client Secret

1. In your new app's left sidebar, click **OAuth2**.
2. Copy the **Client ID** at the top — looks like a 19-digit number.
3. Click **Reset Secret** (or **Copy** if you've never reset it). Confirm. Copy the **Client Secret** that appears. You'll only see it **once**, so save it somewhere safe immediately.

{% hint style="warning" %}
**Treat the Client Secret like a password.** Anyone with it can impersonate your app. If it ever leaks, click **Reset Secret** to invalidate the old one and update it in your tenant settings.
{% endhint %}

## Step 3 — Add the redirect URIs

Discord needs to know which URLs your site will use after sign-in. You'll add **one** redirect now, and possibly a second if you'll use a custom domain.

1. Still on the **OAuth2** page, scroll to **Redirects**.
2. Click **Add Redirect**.
3. Paste your platform-subdomain redirect:

   ```
   https://<your-slug>.acoservice.app/api/auth/callback/discord
   ```

   Replace `<your-slug>` with the slug you'll use (decide it now — common patterns are your group name lowercased and hyphenated, e.g. `myaco` or `acme-cards`).
4. If you'll **also** use a custom domain, click **Add Another** and add:

   ```
   https://yourdomain.com/api/auth/callback/discord
   ```
5. Click **Save Changes** at the bottom of the page.

{% hint style="danger" %}
**Forgetting any redirect URL means sign-in fails on that domain.** Add every URL members might land on. You can come back and add more later.
{% endhint %}

## Step 4 — Add the bot user and copy its token

{% hint style="danger" %}
**This step used to be missing from these docs, and its absence is the single most common onboarding failure.** An earlier version of this page said you did not need a bot because tenants shared one. That is wrong: **every tenant runs its own bot, from this same application.** Skipping this step gives you a site where sign-in works perfectly and your Discord server has no working bot at all.
{% endhint %}

1. In your app's left sidebar, click **Bot**.
2. If there is no bot yet, click **Add Bot** and confirm.
3. Set the bot's **username** and **avatar** — unlike the app name, *members do see these*, so use your brand.
4. Click **Reset Token**, confirm, and copy the token. Like the Client Secret, it is shown **once**.

{% hint style="warning" %}
**The Bot Token is not the Client Secret.** They live on different tabs and are not interchangeable. If you paste a Client Secret where a Bot Token is expected, the bot will simply fail to log in.
{% endhint %}

### Privileged Gateway Intents

Still on the **Bot** tab, scroll to **Privileged Gateway Intents** and enable:

* **Server Members Intent** — required to see who is in your server and match members to profiles.
* **Message Content Intent** — required to read checkout messages for the feed.

Click **Save Changes**. Without these the bot connects but sees almost nothing.

## What you walk away with

**Three** pieces of info, all from the same application:

|                   | Where       | Used for                                        |
| ----------------- | ----------- | ----------------------------------------------- |
| **Client ID**     | OAuth2 tab  | Identifies your app (and is your bot's user ID) |
| **Client Secret** | OAuth2 tab  | Member **sign-in**                              |
| **Bot Token**     | **Bot** tab | Your **bot logging into Discord**               |

Save all three — you'll hand them to the platform admin during onboarding. Sending only the first two is the mistake to avoid.

{% hint style="success" %}
**Next:** [Set up Stripe](/acoservice-documentation/setting-up-your-tenant/stripe.md) — or skip ahead to [What to give the platform admin](/acoservice-documentation/running-your-aco/onboarding-info.md) if you're launching Zelle-only.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://acoservice.gitbook.io/acoservice-documentation/setting-up-your-tenant/discord-application.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
