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

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.

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.

Discord's command picker showing the three setup subcommands
Discord offers the three subcommands as you type

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.

The ephemeral reply of /setup server after it finished
The reply mid-run, and after Creation completed.

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, filtered to online members

Members: <n>

Boosters: <n>

Roles: <n>

Channels: <n>

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 and a self-hosted bot 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.

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.

The Server Stats category created by /setup server
The result in the channel list

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.

Continue in the dashboard

/setup writes ordinary templates, so everything it created is yours to edit. Open the 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, Creating your first counter and the /setup command reference.

Technical details
  • 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.

Last updated