> For the complete documentation index, see [llms.txt](https://docs.membercounter.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.membercounter.app/getting-started/quick-setup.md).

# Quick setup

Create a whole set of working counter channels with one command, then refine them in the dashboard.

One `/setup` command and the bot builds a category full of counter channels that already work. It is the first thing to do after [adding the bot to your server](/getting-started/adding-bot-to-the-server.md).

You need the **Administrator** permission, and you have to run it inside a server: `/setup` is not available in DMs.

## Run the command

Type `/setup` in any channel and Discord offers three subcommands:

| Command                         | What it does                     |
| ------------------------------- | -------------------------------- |
| `/setup server`                 | Set up server-related counters.  |
| `/setup twitch username:<name>` | Set up Twitch-related counters.  |
| `/setup youtube url:<link>`     | Set up YouTube-related counters. |

<figure><img src="https://1582170640-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lu2S5r7lKtu4IK5ucu9%2Fuploads%2Fgit-blob-ce98d4c6f4247d811e824860944b61e8acc215bc%2Fcommand-setup-picker.png?alt=media" alt="Discord&#x27;s command picker showing the three setup subcommands"><figcaption><p>Discord offers the three subcommands as you type</p></figcaption></figure>

The reply is ephemeral: only you can see it. It edits itself as the bot works, one line per channel, until every channel has been created or has failed.

<figure><img src="https://1582170640-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lu2S5r7lKtu4IK5ucu9%2Fuploads%2Fgit-blob-a155e32d3bad8385ba3cd5dd08e64968507b5193%2Fcommand-setup-server-reply.png?alt=media" alt="The ephemeral reply of /setup server after it finished"><figcaption><p>The reply mid-run, and after Creation completed.</p></figcaption></figure>

## What each subcommand creates

`/setup server` creates a category named `📊 Server Stats 📊` with five voice channels, in this order:

| Channel         | Counter behind it                                                     |
| --------------- | --------------------------------------------------------------------- |
| `Online: <n>`   | [Members](/counters-reference/members.md), filtered to online members |
| `Members: <n>`  | [Members](/counters-reference/members.md)                             |
| `Boosters: <n>` | [Nitro Boosters](/counters-reference/nitro-boosters.md)               |
| `Roles: <n>`    | [Roles](/counters-reference/roles.md)                                 |
| `Channels: <n>` | [Channels](/counters-reference/channels.md)                           |

On the public bot and on the legacy premium bot, `Online:` counts online, idle and do-not-disturb members together, because neither has the presence intent. On a [custom bot](/custom-bot/custom-bot.md) and a [self-hosted bot](/self-hosting/self-hosting.md) it is strictly online.

`/setup twitch` creates `📊 <twitch channel name> Twitch Stats 📊` with `<n> Followers` and `Viewers: <n>`. When the channel is not live the viewers counter shows the word `offline` instead of a number.

`/setup youtube` creates `📊 <youtube channel name> YouTube Stats 📊` with `<n> Subscribers`, `<n> Videos` and `<n> Views`.

{% hint style="warning" %}
Both of them fail on the free public bot, which cannot run the [Twitch](/counters-reference/twitch.md) and [YouTube](/counters-reference/youtube.md) counters. Nothing is created and the bot replies with an error. They work on the legacy premium bot, on a custom bot and on a self-hosted bot with the Twitch and YouTube credentials configured.
{% endhint %}

## Why the new channels have a lock

`/setup` locks the channels it creates, so members read them like a label but cannot join them and sit inside a counter. Administrators can still join. This is also why the invite link asks for [**Manage Roles**](/getting-started/adding-bot-to-the-server.md#permissions-the-bot-requests).

<figure><img src="https://1582170640-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lu2S5r7lKtu4IK5ucu9%2Fuploads%2Fgit-blob-c2377716fa652b867ee8aa6b91f1bf6f6315defb%2Fdiscord-setup-server-result.png?alt=media" alt="The Server Stats category created by /setup server"><figcaption><p>The result in the channel list</p></figcaption></figure>

## The numbers are not moving yet

The channels keep the value they had when they were created and pick up the next one on the normal cycle, see [How counters update](/using-the-dashboard/how-counters-update.md).

## Continue in the dashboard

`/setup` writes ordinary templates, so everything it created is yours to edit. Open the [dashboard](https://membercounter.app/dashboard), pick your server and click one of the new channels. The **Template** box already holds the template `/setup` wrote.

More in the [Template editor](/using-the-dashboard/template-editor.md), [Creating your first counter](/getting-started/create-from-scratch.md) and the [`/setup` command reference](/commands/setup.md).

<details>

<summary>Technical details</summary>

* Discord itself hides the command from members without Administrator and from DMs, so those calls never reach the bot. What each subcommand creates is defined in `apps/bot/src/interactions/commands/setup.ts`.
* The reply is deferred as ephemeral before the handler runs, and `/setup` edits that same reply after each channel instead of sending a new message.
* The category name is itself a template and is created first; the channels are then created in parallel. If the category fails, every channel line is marked as failed and the error is rethrown, which replaces the reply with the error embed and a **Join support server** button.
* On the public bot the Twitch and YouTube categories fail with "The bot is not a premium version and lacks certain features needed for this counter.", which is why no channel is created either.
* Each channel is created as a voice channel inside the category with two permission overwrites: the bot member allowed Connect and View Channel, the `@everyone` role denied Connect. The template is then stored with `isTemplateEnabled: true` and a `LastTemplateUpdateDate` log entry.
* Channel names are evaluated once at creation, with the same call the update job makes, so a name that is already too long is truncated at 99 characters there and then.
* Commands are deployed globally by default, or to a single server when `DISCORD_BOT_INSTANCE_DEPLOY_COMMANDS` holds a guild id. Names, descriptions and option names are localized at deploy time, so `/setup` and its options appear translated for users on another Discord language.
* Self-hosting: `/setup twitch` needs `TWITCH_CLIENT_ID` and `TWITCH_CLIENT_SECRET`, `/setup youtube` needs `YOUTUBE_API_KEY`, and the instance must run with `DISCORD_BOT_INSTANCE_IS_PREMIUM=true`.

</details>
