For the complete documentation index, see llms.txt. This page is also available as Markdown.

/setup

Set up some basic counters.

/setup builds a ready-made set of counters: it creates a category, the counter channels inside it, and a template on each channel. It is the only way to create counters without opening the dashboard.

/setup server
/setup twitch username:<channel username>
/setup youtube url:<channel URL>

Who can run it: administrators by default, and only inside a server. See who can run /configure and /setup to give it to other roles.

What the bot needs: Manage Channels and Manage Roles. Both are required, because each channel is created together with its permissions. Both are part of the invite link.

Discord autocomplete for /setup
The three subcommands, and the option each one asks for.

/setup server

No options. It creates the category 📊 Server Stats 📊 and five voice channels, in this order:

Channel
It shows
Counter used

Online members

Online: <number>

Members, filtered to online members

Members

Members: <number>

Nitro boosters

Boosters: <number>

Roles

Roles: <number>

Channels

Channels: <number>

These five work on every bot, including the public bot. On the public bot the member and online numbers come from Discord's approximate counts, so they lag more than the other three. See How counters update.

Online members does not mean the same thing on every bot. On the public bot and on the legacy premium bot it counts everyone who is not offline: online, idle and do-not-disturb. A custom bot or a self-hosted bot, which have the privileged intents, counts only the members whose status is online. You can change the filter afterwards on the Members counter.

The Server Stats category with its five counter channels
The result, seen by a member without administrator permissions.

/setup twitch

username is the name from the channel address, twitch.tv/yourname, not the display name. The command creates the category 📊 <channel name> Twitch Stats 📊 with two voice channels: <number> Followers and Viewers: <number>. While the channel is not live the viewers counter shows the word offline. More on the options in Twitch.

/setup youtube

url is the full address of the channel, not of a video. The command creates the category 📊 <channel name> YouTube Stats 📊 with three voice channels: <number> Subscribers, <number> Videos and <number> Views. More on the options in YouTube.

Twitch and YouTube stats categories
The Twitch set on the left, the YouTube set on the right.

What the reply looks like

The reply updates itself while the work runs, with one line per channel showing whether it is pending, created or failed. The last line points you at /configure.

The /setup server reply while it runs and when it finishes
The same message mid-run and after "Creation completed."

Why the new channels show a lock

Every channel the command creates denies Connect to @everyone, so members can read the counters but cannot join the voice channels and turn them into a call. Administrators bypass that and see no lock. This is also why the invite link asks for Manage Roles.

To let people in, open Edit Channel > Permissions on each counter channel and remove the @everyone Connect deny there, or sync that channel with the category. Clearing it on the category alone changes nothing, because a channel's own overwrite wins. The counters keep updating either way.

If something fails

The category is created first, because the channels go inside it. If the category fails, nothing is created and the command ends in an error. If one channel fails, the others are still created, and you make the missing one yourself on the dashboard.

Message
What to do

"The specified Twitch channel could not be found."

Check username. Use the name from the channel address, not the display name.

"The provided YouTube channel URL is invalid."

Paste the address of the channel itself, not of a video or a playlist. Channel id, @handle and legacy user addresses all work.

"The bot is not a premium version and lacks certain features needed for this counter."

This bot cannot use Twitch or YouTube counters. Use the legacy premium bot, a custom bot or a self-hosted bot.

"Something went wrong, please try again later."

Anything the bot does not recognise, including a missing Manage Channels or Manage Roles permission. Quote the error ID in the support server.

After the command

Each created channel already has its template enabled, so it appears on the dashboard right away and updates on the normal cycle. From there you can rename it, change the wording around the number or delete it. See Edit a counter's template and Create a counter from scratch.

Running /setup again always creates a new category and new channels; it never reuses the ones you have.

Technical details
  • The category names and channel templates are the locale strings under interaction.commands.setup in apps/bot/src/locales/en-US/main.json; that is where you change what /setup creates.

  • The category is created and awaited first; the channels are then created with Promise.all, so they finish in any order even though the table lists them in template order.

  • Every channel, category included, is created with two overwrites: the bot user allowed Connect + View Channel, the @everyone role denied Connect. The channels are not synced to the category, so each one carries its own deny.

  • Templates are stored with isTemplateEnabled: true and a LastTemplateUpdateDate log entry (GuildSettingsService.channels), which is why the channel is already live on the dashboard.

  • The templates are rendered in the language of the person who ran the command, not the server's language.

  • The YouTube option's i18n key is channelUrl, but the name Discord shows and accepts is url.

  • The Twitch and YouTube evaluators assert the premium flag first and otherwise throw BOT_IS_NOT_PREMIUM.

  • Self-hosting: /setup twitch needs TWITCH_CLIENT_ID and TWITCH_CLIENT_SECRET, /setup youtube needs YOUTUBE_API_KEY, and DISCORD_BOT_INSTANCE_IS_PREMIUM must stay true. The three credentials are empty in .env.example, and a missing one throws a plain Error, not a KnownError, so the reply is the generic "Something went wrong, please try again later." with no hint about the cause.

Last updated