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

# Counter channels

> Voice channels whose names display live server statistics or social media follower counts.

A counter is a voice channel nobody joins — its **name** is the point. It renders a template with live data and updates itself on a schedule.

```
📊 1,247 members
🟢 312 online
💬 8.4k messages this week
🎵 @someone · 240k followers
```

Requires **Manage Channels**.

## Creating one

<CodeGroup>
  ```javascript New channel theme={null}
  !counter add
  ```

  ```javascript With a template theme={null}
  !counter add {members} members
  ```

  ```javascript Turn an existing channel into one theme={null}
  !counter add #stats {online} online
  ```
</CodeGroup>

With no channel, one is created for you. With no template, the default is `{members} members +{joins_today} td`.

<CodeGroup>
  ```javascript Test a template first theme={null}
  !counter preview {members} members · {joins_week} this week
  ```

  ```javascript Update one theme={null}
  !counter add #stats {humans} humans
  ```

  ```javascript See the template theme={null}
  !counter view #stats
  ```

  ```javascript Force an update theme={null}
  !counter refresh #stats
  ```

  ```javascript List them theme={null}
  !counter list
  ```

  ```javascript Remove theme={null}
  !counter remove #stats
  ```
</CodeGroup>

`!counter preview` resolves the template without creating anything — use it to check your syntax. Aliases: `test`, `demo`.

## Variables

Counter templates use a **flat** variable set — no `guild.` or `user.` prefix, unlike [scripting variables](/scripting/variables) elsewhere.

Run `!counter variables` to see them in Discord.

### Live server state

| Variable                                                                | Value                                |
| ----------------------------------------------------------------------- | ------------------------------------ |
| `{members}`                                                             | Total members                        |
| `{humans}`                                                              | Non-bot members                      |
| `{bots}`                                                                | Bots                                 |
| `{pending}`                                                             | Members who haven't passed screening |
| `{boosters}`                                                            | Members boosting                     |
| `{boosts}`                                                              | Boost count                          |
| `{level}`                                                               | Boost tier                           |
| `{online}` `{offline}` `{afk}` `{dnd}`                                  | By status                            |
| `{channels}`                                                            | All channels                         |
| `{text_channels}` `{voice_channels}` `{thread_channels}` `{categories}` | By type                              |
| `{roles}` `{emojis}` `{stickers}`                                       | Server assets                        |

### Historical data

These take an optional period suffix — `_today`, `_week`, `_month`, `_year`, `_total`:

| Variable                 | Value                                       |
| ------------------------ | ------------------------------------------- |
| `{joins_today}`          | Joins today                                 |
| `{leaves_week}`          | Leaves this week                            |
| `{net_month}`            | Joins minus leaves this month               |
| `{messages_year}`        | Messages this year                          |
| `{voice_week}`           | Voice time this week, formatted as `2h 34m` |
| `{voice_sessions_today}` | Voice sessions today                        |
| `{past_boosters}`        | Everyone who has ever boosted               |

Without a suffix they default to a sensible period.

### Aliases

Plenty of natural spellings work: `{msgs_today}`, `{msg_7d}`, `{weekly_joins}`, `{yearly_messages}`, `{growth_30d}`, `{vc_week}`, `{left_alltime}`, `{member_count}`, `{people}`. If a variable reads correctly, it probably resolves.

### Formatting

Counter templates support [pipes and operators](/scripting/operators):

<CodeGroup>
  ```javascript Thousands separators theme={null}
  {members|comma} members
  ```

  ```javascript Compact theme={null}
  {messages_total|human} messages
  ```

  ```javascript Correct pluralisation theme={null}
  {boosts} {boosts|plural: boost, boosts}
  ```

  ```javascript Conditional theme={null}
  {if: {boosts}>0 && 💜 {boosts} boosts && no boosts yet}
  ```
</CodeGroup>

## Social counters

Counters that track an account on another platform instead of your server:

<CodeGroup>
  ```javascript TikTok theme={null}
  !counter tiktok #stats someone
  ```

  ```javascript Twitch theme={null}
  !counter twitch #stats someone
  ```

  ```javascript With a custom template theme={null}
  !counter youtube #stats channelname {subscribers|human} subs
  ```
</CodeGroup>

| Command                   | Aliases          | Variables                                                                                      |
| ------------------------- | ---------------- | ---------------------------------------------------------------------------------------------- |
| `counter tiktok`          | `tt`             | `{followers}` `{following}` `{likes}` `{hearts}` `{videos}` `{username}` `{nickname}` `{live}` |
| `counter soundcloud`      | `sc`             | `{followers}` `{following}` `{tracks}` `{username}`                                            |
| `counter soundcloudtrack` | `sctrack`, `sct` | `{plays}` `{title}` `{artist}`                                                                 |
| `counter twitch`          | `tv`             | `{views}` `{username}` `{live}` `{viewers}` `{game}` `{title}`                                 |
| `counter twitter`         | `x`, `tw`        | `{followers}` `{following}` `{tweets}` `{media}` `{username}`                                  |
| `counter instagram`       | `ig`, `insta`    | `{followers}` `{following}` `{posts}` `{username}` `{full_name}`                               |
| `counter youtube`         | `yt`             | `{subscribers}` `{username}` `{handle}`                                                        |
| `counter spotify`         | `sp`, `so`       | `{name}` `{followers}` `{monthly}`                                                             |

`!counter socialvars` (aliases `svars`) lists them in Discord, optionally for one platform.

### Live status

The Twitch counter is the interesting one, because `{live}` lets the channel change shape entirely:

```javascript theme={null}
!counter twitch #stream someone {if: {live} && 🔴 {viewers} watching && ⚫ twitch.tv/{username}}
```

Offline it advertises the channel; live it shows the viewer count. Twitch refreshes every 5 minutes for exactly this reason; the other platforms refresh every 15–60.

## Update frequency

<Warning>
  Discord rate-limits channel renames to **twice per 10 minutes**, per channel. Counters update roughly every 10 minutes as a result — a live view is not possible, and that's Discord's limit rather than the bot's.

  Practical consequences:

  * Don't make a counter that needs to be accurate to the second
  * `!counter refresh` forces an immediate update, but spend it wisely
  * Six counters cost six rename budgets — three or four is usually plenty
</Warning>

## Some good ones

```javascript theme={null}
!counter add {members|comma} members
!counter add 🟢 {online} online
!counter add 📈 +{joins_week} this week
!counter add 💬 {messages_week|human} msgs/wk
!counter add 🎙 {voice_week} in vc
!counter add 💜 {boosts} {boosts|plural: boost, boosts}
```

<Tip>
  Put counters in their own category at the top of the channel list, denied `Connect` for `@everyone` so nobody can join them. `!counter add` does this automatically for channels it creates.
</Tip>

## Command reference

| Command                            | Aliases               | Description                |
| ---------------------------------- | --------------------- | -------------------------- |
| `counter add [channel] [template]` | `create`, `set`       | Create or update a counter |
| `counter preview <template>`       | `test`, `demo`        | Resolve without creating   |
| `counter view <channel>`           | `script`, `template`  | View a channel's template  |
| `counter refresh <channel>`        | `update`, `force`     | Force an update now        |
| `counter list`                     | `ls`                  | All counter channels       |
| `counter remove <channel>`         | `delete`, `del`, `rm` | Stop updating a channel    |
| `counter clear`                    | `reset`, `purge`      | Remove every counter       |
| `counter variables`                | `vars`                | List template variables    |
| `counter socialvars [platform]`    | `svars`               | List social variables      |

Every command requires **Manage Channels**. Group aliases: `cntr`, `counters`.
