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

# Leaderboards

> Show off your server's most active members.

## Overview

Leaderboards show the **top 10** most active members in your server, either by messages sent or by time spent in voice channels. This can be useful for rewarding your most active members. The leaderboard will automatically update every **10 minutes**.

![](https://mintcdn.com/bleed/g4ScyPnPvFwcY_cJ/images/miscellaneous/leaderboards/example.png?fit=max\&auto=format\&n=g4ScyPnPvFwcY_cJ\&q=85\&s=153c1cf5fb9e0f8d83bce219dddd5100)

> [!NOTE]
>
> Leaderboards can be `daily`, `weekly` or `monthly`. Every leaderboard resets at **midnight UTC**,
> weekly leaderboards reset every **Friday** and monthly leaderboards reset on the **1st** of each month.

## Setting up a leaderboard

You can set up a leaderboard using the `/automation leaderboard channel` command.

> [!NOTE]
>
> You must have the `Manage Server` permission to use this command. bleed needs the **View Channel**,
> **Send Messages** and **Embed Links** permissions in the channel.

```javascript Syntax theme={null}
/automation leaderboard channel type:<message|voice> timeframe:<daily|weekly|monthly> channel:<channel>
```

```javascript Example theme={null}
/automation leaderboard channel type:message timeframe:weekly channel:#leaderboard
```

![](https://mintcdn.com/bleed/g4ScyPnPvFwcY_cJ/images/miscellaneous/leaderboards/channel.png?fit=max\&auto=format\&n=g4ScyPnPvFwcY_cJ\&q=85\&s=9fd17cab57b380f33cf375ed1da1385c)

## Customizing the message

You can customize the leaderboard message using the `/automation leaderboard message` command.

> [!TIP]
>
> This command will open a Discord modal where you can enter your message. The `message` can be raw text, [components](https://docs.bleed.bot/resources/scripting/components.md) or [embeds](https://docs.bleed.bot/resources/scripting/embeds.md) with dynamic [variables](#variables). If you no longer want a custom message, you can re-run the command and leave the modal empty.

```javascript Syntax theme={null}
/automation leaderboard message type:<message|voice> timeframe:<daily|weekly|monthly>
```

```javascript Example theme={null}
/automation leaderboard message type:message timeframe:weekly
## {leaderboard.timeframe} {leaderboard.type} Leaderboard
{user.first.emote} {user.first.mention} - **{proper(user.first.message_count)}** messages
{user.second.emote} {user.second.mention} - **{proper(user.second.message_count)}** messages
{user.third.emote} {user.third.mention} - **{proper(user.third.message_count)}** messages
-# Reset <t:{next_reset}:R>
```

### Variables

> [!NOTE]
>
> Replace `first` with any rank up to `tenth`, like `{user.third.mention}`. The ranks are `first`, `second`,
> `third`, `fourth`, `fifth`, `sixth`, `seventh`, `eighth`, `ninth` and `tenth`.

> [!WARNING]
>
> Variables must be written exactly as shown. `{user.three.name}` and `{user.first.messages_count}` are not
> variables and will appear as raw text in the message.

> [accordion] Every leaderboard
>
> | Variable | Output |
> | - | - |
> | `{user.first.name}` | The user's username |
> | `{user.first.display_name}` | The user's display name |
> | `{user.first.id}` | The user's ID |
> | `{user.first.mention}` | The user's mention |
> | `{user.first.avatar}` | The user's avatar URL |
> | `{user.first.emote}` | The rank's emote |
> | `{last_reset}` | The last reset in UNIX |
> | `{next_reset}` | The next reset in UNIX |
> | `{leaderboard.type}` | The leaderboard's type (`Message` or `Voice`) |
> | `{leaderboard.timeframe}` | The leaderboard's timeframe (`Daily`, `Weekly` or `Monthly`) |

> [accordion] Message leaderboards
>
> | Variable | Output |
> | - | - |
> | `{user.first.message_count}` | The user's message count |
> | `{proper(user.first.message_count)}` | The user's message count with commas |

> [accordion] Voice leaderboards
>
> | Variable | Output |
> | - | - |
> | `{user.first.hour_count}` | The user's hours in voice (e.g. `12.5`) |
> | `{proper(user.first.hour_count)}` | The user's hours in voice with commas |

> [!TIP]
>
> If a rank has not been reached yet, its line will not be shown. For example, a leaderboard with **4** active members will only show **4** lines.

> [!TIP]
>
> `{last_reset}` and `{next_reset}` can be used with Discord timestamps. For example, `<t:{next_reset}:R>`
> will display as **in 3 days**.

Every `{guild.*}` [variable](https://docs.bleed.bot/resources/scripting/variables.md) can be used as well, such as `{guild.name}`.

## Changing the rank emotes

You can change the emote displayed next to a rank using the `/automation leaderboard emote` command.

> [!NOTE]
>
> Emotes are shared between the daily, weekly and monthly leaderboards of the same type. If you no longer want a custom emote, you can re-run the command without an emote.

```javascript Syntax theme={null}
/automation leaderboard emote type:<message|voice> rank:<1-10> emote:<emote>
```

```javascript Example theme={null}
/automation leaderboard emote type:message rank:1 emote:🥇
```

![](https://mintcdn.com/bleed/g4ScyPnPvFwcY_cJ/images/miscellaneous/leaderboards/emote.png?fit=max\&auto=format\&n=g4ScyPnPvFwcY_cJ\&q=85\&s=3a55bcb1f062b168cb491e1f796f8e5f)

## Viewing the configuration

You can use the `/automation leaderboard config` command to view all of your server's leaderboards. The buttons on this message allow you to change the channel, message and emotes of each leaderboard.

![](https://mintcdn.com/bleed/g4ScyPnPvFwcY_cJ/images/miscellaneous/leaderboards/config.png?fit=max\&auto=format\&n=g4ScyPnPvFwcY_cJ\&q=85\&s=3aadcd01fa595cbb263625ae87796d7d)

## Related commands

> [accordion] Changing every rank emote
>
> You can use the `/automation leaderboard emotes` command to change all **10** emotes at once. This command will open a Discord modal where you can enter one emote per line.
>
> ```javascript Syntax theme={null}
> /automation leaderboard emotes type:<message|voice>
> ```
>
> ```javascript Example theme={null}
> /automation leaderboard emotes type:voice
> ```

> [accordion] Previewing a leaderboard
>
> You can use the `/automation leaderboard view` command to privately preview a leaderboard.
>
> ```javascript Syntax theme={null}
> /automation leaderboard view type:<message|voice> timeframe:<daily|weekly|monthly>
> ```
>
> ```javascript Example theme={null}
> /automation leaderboard view type:voice timeframe:daily
> ```

> [accordion] Resending a leaderboard
>
> If the leaderboard message was deleted, you can use the `/automation leaderboard resend` command to post it again.
>
> ```javascript Syntax theme={null}
> /automation leaderboard resend type:<message|voice> timeframe:<daily|weekly|monthly>
> ```
>
> ```javascript Example theme={null}
> /automation leaderboard resend type:message timeframe:weekly
> ```

> [accordion] Removing a leaderboard
>
> You can use the `/automation leaderboard remove` command to remove a leaderboard.
> \[!WARNING] This will also remove the leaderboard's custom message.
>
> ```javascript Syntax theme={null}
> /automation leaderboard remove type:<message|voice> timeframe:<daily|weekly|monthly> delete_message:<True|False>
> ```
>
> ```javascript Example theme={null}
> /automation leaderboard remove type:message timeframe:weekly delete_message:True
> ```

> [accordion] Viewing the variables
>
> You can use the `/automation leaderboard variables` command to view every [variable](#variables) inside of Discord.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.