Skip to main content

Metrics Leaderboards: Top Players in Discord

Set up leaderboards for your server (top players by playtime, kills, distance and more), post them to a Discord channel on a schedule, let players ask with /leaderboard, and decide who is never named.

What a leaderboard is

A leaderboard lists the top players of your server for one figure: playtime, kills, deaths, the longest life, distance travelled, places discovered, coins earned, wealth or event wins. Each board shows the top 10 (you can choose 1 to 25) for a period: today, this week, this month, this season or all seasons. Weeks start on Monday and periods follow the time zone you choose.

Your server is only offered the boards its game can report. A board for a figure the game does not report is never shown, rather than shown as a row of zeros. Economy boards appear where the GameGrid economy is on, and count only players who linked their Discord to it.

Boards name players by their in-game name only. Players with equal figures share a rank. There are no points: every board ranks a real figure.

Everything starts switched off

Nothing is posted or public until you switch it on, in two places:

1. Metrics, Settings, Player access: Posted leaderboards (boards may be posted to Discord), /leaderboard command (anyone in your Discord may ask for a board you made public) and Public leaderboard API reads (your own website may read the boards you made public). The distance and places boards use location data, so they also need Places switched on.

2. Metrics, Players, Leaderboards: each board has its own Enabled, Public command and Public API switches.

Setting up a board

Open Metrics, then Players, then Leaderboards. Add a board, tick Enabled, and choose a schedule: off, hourly, daily or weekly at a time of day. Preview shows exactly what would be posted. Post now posts it within a minute.

The Discord channel is chosen in Discord: run /leaderboard setup with the board, the channel and, if you like, the schedule. Each board is posted as one message, and the next post edits that same message instead of adding a new one. If someone deletes the message, the next post is a new one.

A Milestones board posts a short message when a player reaches 100, 500, 1,000 or 5,000 kills, hours played or kilometres travelled, and when your server sets a new record for players online. It starts counting from the moment you switch it on.

What players see

With /leaderboard command on, anyone in your Discord can type /leaderboard playtime (or kills, deaths, distance and the rest) for a board you made public. Players whose Discord is linked to your economy also see their own rank. By default only the person who asked sees the reply; you can choose to show it in the channel, and how often each member may ask (30 seconds by default).

Keeping a player off the boards

Open the player's profile from Metrics, choose the Admin tab and switch on Hide from public leaderboards. They are never named on a posted board, in /leaderboard or in public reads, and get no milestone posts; your own Metrics still shows them. For a player identified by an account id this applies on all your servers. A player you forget with Forget this player is hidden automatically.

A player is only ever mentioned (pinged) on a posted board if they chose to be.

Daily summaries and chart images

/config summary-channel in Discord posts a daily or weekly summary of your server (players online, sessions, uptime) with chart images, at the time you choose in your /config timezone. /metrics summary, /metrics uptime and /metrics peak also attach a chart image when one can be drawn.

In the API

GET /api/public/v1/servers/{id}/leaderboards/{board} reads a public board with metrics:read, only when Public leaderboard API reads and the board's Public API switch are on. Setting boards up and the bot's posting use the leaderboards:write scope, which is in the Discord bot key preset. GET /api/public/v1/servers/{id}/metrics/charts/players.png returns a chart image. The metrics.daily_summary webhook sends yesterday's summary once a day, without player names.