Slack-Gamebot

May 5, 2026 · View on GitHub

Tests

A leaderboard game bot for Slack. Install here. Works for ping-pong (2, 4 or more players), chess, etc. This is a fork of slack-gamebot that supports leaderboards per channel. Inspired by slack-pongbot, but more robust, generic and easier to improve and contribute to.

Usage

Start talking to your bot!

Commands

gamebot

Shows Gamebot version and links.

gamebot hi

Politely says 'hi' back.

gamebot help

Get help.

gamebot info

Bot credits.

gamebot sucks

You can tell the bot that it sucks. But it will talk back.

gamebot register

Re-registers a user. This is automatic, but a user can unregister and come back with this command.

This command can also update a user's registration, for example after the user has been renamed. The bot notices user renames, but this may be necessary if the bot wasn't running during that operation.

gamebot register

Welcome back Victor Barna! I've updated your registration.

You can also remove yourself from the leaderboard with gamebot unregister me and re-register yourself again with gamebot register. The data is not removed, but the user will no longer appear in the leaderboards and cannot participate in challenges.

gamebot challenge <opponent> ... [with <teammate> ...]

Creates a new challenge between you and an opponent.

gamebot challenge @WangHoe

Victor Barna challenged Wang Hoe to a match!

You can challenge anyone to play.

gamebot challenge @here

Victor Barna challenged anyone to a match!

You can create group challenges, too. Both sides must have the same number of players.

gamebot challenge @WangHoe @ZhangJike with @DengYaping

Victor Barna and Deng Yaping challenged Wang Hoe and Zhang Jike to a match!

gamebot challenge?

Show elo at stake for each opponent.

gamebot challenge? @WangHoe

Victor Barna challenging Wang Hoe to a match is worth 48 and 24 elo.

Show elo at stake between other players using against.

gamebot challenge? @WangHoe against @DengYaping

Wang Hoe challenging Deng Yaping to a match is worth 48 elo.

gamebot predict

Predict the win probability based on current Elo ratings.

gamebot predict @WangHoe

Victor Barna has a 65% chance of beating Wang Hoe.

Predict between other players using against.

gamebot predict @WangHoe against @DengYaping

Wang Hoe has a 55% chance of beating Deng Yaping.

gamebot accept

Accept a challenge.

gamebot accept

Wang Hoe and Zhang Jike accepted Victor Barna and Deng Yaping's challenge.

gamebot lost [to <opponent> [with <teammate>]] [score ...]

Record your loss.

Record your loss with a score, loser first. The result verb depends on how lopsided the score is: narrowly defeated, defeated, crushed, or humiliated (shutout).

gamebot lost 5:21

Match has been recorded! Wang Hoe crushed Victor Barna with the score of 21:5.
gamebot lost 0:21

Match has been recorded! Wang Hoe humiliated Victor Barna with the score of 21:0.

You can record scores for an entire match.

gamebot lost 15:21 21:17 18:21

Match has been recorded! Wang Hoe defeated Victor Barna with the scores of 21:15 17:21 21:18.

You can record scores for a match you have already lost.

gamebot lost

Match has been recorded! Wang Hoe defeated Victor Barna.

gamebot lost 15:21 21:17 18:21

Match scores have been updated! Wang Hoe defeated Victor Barna with the scores of 21:15 17:21 21:18.

You can record a loss without a challenge.

You can also record scores and record lost matches without a challenge including with multiple players.

gamebot lost to @WangHoe @ZhangJike with @DengYaping 5:21

Match has been recorded! Wang Hoe and Zhang Jike defeated Victor Barna and Deng Yaping with the score of 21:5.

gamebot won [against <opponent> [with <teammate>]] [score ...]

Record your win. Scores are entered in winner:loser order.

gamebot won 21:5

Match has been recorded! Wang Hoe crushed Victor Barna with the score of 21:5.

You can record a win without a challenge.

gamebot won against @VictorBarna 21:15

Match has been recorded! Wang Hoe defeated Victor Barna with the score of 21:15.

You can also record wins with multiple players.

gamebot won against @WangHoe @ZhangJike with @DengYaping 21:5

Match has been recorded! Victor Barna and Deng Yaping defeated Wang Hoe and Zhang Jike with the score of 21:5.

Use set won off to disable this command if you're concerned about players claiming wins they didn't actually win.

gamebot draw [score ...]

Draws a challenge, and records a tie. All other players will also have to draw to record a match.

gamebot draw

Match is a draw, waiting to hear from Victor Barna.

gamebot draw 2:2

Match has been recorded. Victor Barna tied with Zhang Jike with a score of 2:2.

You can also record scores and ties without a challenge.

gamebot draw to @VictorBarna

Match is a draw, waiting to hear from Victor Barna.

gamebot draw 2:2

Match is a draw! Wang Hoe tied with Victor Barna with the score of 2:2.

You can also record scores and have multiple players.

gamebot resigned [to <opponent> [with <teammate>]]

Records your resignation, which is a special kind of lost without a score.

gamebot resigned

Match has been recorded! Victor Barna resigned against Wang Hoe.

You can resign without a prior challenge.

gamebot resigned to WangHoe

Match has been recorded! Victor Barna resigned against Wang Hoe.

gamebot undo

Undo the last match recorded in the channel within the last hour. Restores Elo, wins, losses, and challenge state.

gamebot undo

Match Victor Barna defeated Wang Hoe has been undone.

gamebot decline

Decline a challenge.

gamebot decline

Wang Hoe and Zhang Jike declined Victor Barna and Deng Yaping's challenge.

gamebot cancel

Cancel a challenge.

gamebot cancel

Victor Barna and Deng Yaping canceled a challenge against Wang Hoe and Zhang Jike.

gamebot taunt <opponent> [<opponent> ...]

Taunt other players.

gamebot taunt @WangHoe

Victor Barna says Wang Hoe sucks at ping pong!

gamebot leaderboard [number|infinity]

Get the leaderboard.

gamebot leaderboard

1. Victor Barna: 3 wins, 2 losses (elo: 148, avg: 140, lws: 5)
2. Deng Yaping: 1 win, 3 losses (elo: 24, avg: 30)
3. Wang Hoe: 0 wins, 1 loss (elo: -12, avg: -6)

The leaderboard contains players ranked by Elo, use leaderboard 10 or leaderboard infinity to see 10 players or all players, respectively. Use set leaderboard max 3 to limit the default leaderboard size to 3.

The leaderboard also shows the longest winning (lws) and losing (lls) streaks of at least 3, as well as a rolling 10-game elo average (avg) once a player has played at least 2 games.

In case you want to see the leaderboard in reverse order (which would be totally wrong but motivational for people at the bottom of the leaderboard), specify a negative number or -infinity:

gamebot leaderboard -5

1. Wang Hoe: 0 wins, 1 loss (elo: -12, avg: -6)
2. Deng Yaping: 1 win, 3 losses (elo: 24, avg: 30)
3. Victor Barna: 3 wins, 2 losses (elo: 148, avg: 140, lws: 5)

gamebot matches [number|infinity]

Displays top 10 match totals in the current season.

gamebot matches

Victor Barna defeated Wang Hoe 3 times
Deng Yaping defeated Victor Barna once

You can also get match totals for specific players.

gamebot matches @WangHoe

Victor Barna defeated Wang Hoe 5 times
Wang Hoe defeated Deng Yaping twice

Use matches 3 to see top 3 matches or matches inifinity to see all matches in the season.

gamebot games [<player> ...]

Displays total games played and a per-player breakdown of wins, losses, and ties, sorted by most games played.

gamebot games

A total of 5 games have been played.
Victor Barna: 3 wins, 1 loss
Wang Hoe: 2 wins, 2 losses
Deng Yaping: 0 wins, 2 losses

You can also filter by specific players.

gamebot games @WangHoe @DengYaping

A total of 4 games have been played.
Wang Hoe: 2 wins, 2 losses
Deng Yaping: 0 wins, 2 losses

gamebot challenges

Displays all outstanding (proposed and accepted) challenges. Proposed challenges that have not been accepted automatically expire after 8 hours (configurable with set expire). Accepted challenges that have not been recorded will be reminded after 4 hours (configurable with set remind).

gamebot rank [<player> ...]

Show the smallest range of ranks for a list of players. If no user is specified, your rank is shown.

gamebot rank @WangHoe @DengYaping

2. Deng Yaping: 1 win, 3 losses (elo: 24, avg: 30)
3. Wang Hoe: 0 wins, 1 loss (elo: -12, avg: -6)

gamebot promote <player> ...

Promotes other users to captain. Must be a captain to do that.

gamebot promote @WangHoe @DengYaping

Victor Barna promoted Wang Hoe and Deng Yaping to captain.

gamebot demote me

Demotes from captain to a normal user. Must be a captain and the team must have other captains to do this.

gamebot demote me

Victor Barna is no longer captain.

gamebot team

Display current team's info, including captains.

gamebot team

Team T04KB5WQH #pong, captains Deng Yaping and Victor Barna.

gamebot reset <team id|team name>

Reset all users and pending challenges and start a new season. Must be a captain to do this and confirm by specifying the team ID or name.

gamebot reset #pong

Welcome to the new season!

gamebot season

Display the current season's leader and game totals.

gamebot season

Current: Deng Yaping: 1 win, 0 losses (elo: 48), 1 game, 2 players

gamebot seasons

Display the current season's leader, past seasons' winners and game totals.

gamebot seasons

Current: Deng Yaping: 1 win, 0 losses (elo: 48), 1 game, 2 players
2015-07-16: Wang Hoe: 28 wins, 19 losses (elo: 214), 206 games, 25 players

gamebot unregister <player>

Captains can remove users.

gamebot unregister @WangHoe

I've removed @WangHoe from the leaderboard.

Users that have left a Slack team can be removed by omitting the @, e.g. gamebot unregister WangHoe.

gamebot set

Show current default settings in a DM or channel settings in a channel.

gamebot set nickname [name]

Sets a nickname for display purposes in a channel.

gamebot set nickname John Doe

Unset a nickname.

gamebot unset nickname

Captains can set nicknames of users by using a Slack mention.

gamebot set nickname @WangHoe John Doe

Captains can unset nicknames, too.

gamebot unset nickname @WangHoe

gamebot set gifs on|off

Enable/disable GIFs for your team.

gamebot set gifs off

GIFs are now off.

Using unset gifs is equivalent to set gifs off.

gamebot set leaderboard max [number|none]

Set and reset the leaderboard max. The default is none, ie. to show the entire leaderboard.

gamebot set leaderboard max 5

The following are equivalent.

gamebot set leaderboard max 0
gamebot set leaderboard max none
gamebot unset leaderboard max

gamebot set elo [number]

Set and reset the base elo for new seasons. The default is 0.

gamebot set elo 1000
gamebot unset elo

gamebot set elo algorithm <adaptive|standard|glicko|glicko2>

Set the ELO algorithm. Can only be changed at the start of a new season (no matches recorded yet). The default is adaptive.

  • adaptive: The existing tau-decay system. Each player accumulates a tau value with every match played. ELO volatility scales by decay^tau, so new players experience larger swings and veterans stabilize over time. Tunable with set elo decay.
  • standard: The textbook K * (S - E) formula with a fixed K-factor. Tunable with set elo k.
  • glicko: The Glicko-1 system (Glickman, 1995). Each player has a rating deviation (RD) that reflects the uncertainty of their rating. RD shrinks as more games are played and grows during inactivity. Higher RD means larger rating swings.
  • glicko2: The Glicko-2 system (Glickman, 2001). Extends Glicko by adding per-player volatility (σ), which measures consistency of performance. The system constant τ controls how quickly volatility can change. Tunable with set elo glicko2 tau.
gamebot set elo algorithm standard

Elo algorithm for #channel is standard (k=32).
gamebot set elo algorithm glicko2

Elo algorithm for #channel is glicko2 (τ=0.5).

gamebot set elo k <number>

Set the K-factor for the standard algorithm. The default is 32.

gamebot set elo k 16

Elo K for #channel is 16.

gamebot set elo decay <number>

Set the decay factor for the adaptive algorithm. Must be between 0 and 1. The default is 0.94.

gamebot set elo decay 0.9

Elo decay for #channel is 0.9.

gamebot set elo glicko2 tau <number>

Set the system constant τ for the glicko2 algorithm. Controls how much a player's volatility (σ) can change per match. Smaller values restrict volatility changes; larger values allow more dramatic swings. Must be positive. The default is 0.5.

gamebot set elo glicko2 tau 0.3

Glicko2 τ for #channel is 0.3.

gamebot set aliases <alias|none> ...

Set additional aliases for the bot. For example, you could upload a custom emoji for :pong: and set an alias for it.

gamebot set aliases pp :pong:

Bot aliases are set to pp and :pong:.

Remove all aliases with unset aliases.

Aliases only work in public channels.

gamebot set details <elo,leaderboard|none> ...

Use elo to display ELO change details when a match being recorded. Use leaderboard to display a leaderboard in a thread after a match has been recorded.

gamebot set details elo leaderboard

Channel details are now `elo` and `leaderboard`.

Remove all details with unset details.

gamebot set api on|off

Enable/disable team data in the public API for your team and display team API URL.

gamebot set api on

API is now on!
https://gamebot2.playplay.io/api/teams/57224e65bc526eac95bfe316
gamebot unset api

API is now off.

You will need a token to use the API, DM the bot set token xyz, then pass X-Access-Token: xyz in a header to the API.

gamebot set unbalanced on|off

Allow unbalanced challenges with different numbers of opponents.

gamebot set unbalanced on

Unbalanced challenges are now on!

gamebot set won on|off

Enable or disable the won command. New channels have it enabled by default.

gamebot set won off

Won command for #channel is off.

gamebot set expire [hours|never]

Set how long a proposed challenge remains open before being automatically canceled. Default is 8 hours. Use never to disable expiry.

gamebot set expire 24

Challenge expiry for #channel is 24 hours.
gamebot set expire never

Challenge expiry for #channel is never.

Reset to the default with unset expire.

gamebot unset expire

Challenge expiry for #channel is 8 hours.

gamebot set remind [duration|never]

Set how long after a challenge is accepted before players are reminded to record the result. Default is 4 hours. Reminders repeat every 24 hours. Use never to disable reminders. Reminder must be set to less than expire.

gamebot set remind 2h

Reminders will be sent after 2 hours.
gamebot set remind never

Reminders are disabled.

Reset to the default with unset remind.

gamebot unset remind

Reminders are disabled.

gamebot set max challenges [number|none]

Set the maximum number of simultaneously accepted challenges. Useful when you only have one table. No limit by default.

gamebot set max challenges 1

Max challenges limit is 1.

Remove the limit with set max challenges or unset max challenges.

gamebot unset max challenges

Max challenges limit removed.

gamebot set max challenges per day [number|none]

Set the maximum number of challenges that can be proposed in the channel per day. Resets at midnight in the channel's configured timezone. No limit by default.

gamebot set max challenges per day 10

Max challenges per day is 10.

Remove the limit with set max challenges per day or unset max challenges per day.

gamebot unset max challenges per day

Max challenges per day removed.

gamebot set max challenges per user [number|none]

Set the maximum number of challenges a single user can propose per day. Resets at midnight in the channel's configured timezone. No limit by default.

gamebot set max challenges per user 3

Max challenges per user is 3.

Remove the limit with set max challenges per user or unset max challenges per user.

gamebot unset max challenges per user

Max challenges per user removed.

gamebot set max games per user [number|none]

Set the maximum number of games (challenges in accepted or played state) a single user can participate in per day. This applies both when creating a challenge and when accepting one. Resets at midnight in the channel's configured timezone. No limit by default.

gamebot set max games per user 2

Max games per user is 2.

Remove the limit with set max games per user or unset max games per user.

gamebot unset max games per user

Max games per user removed.

gamebot set timezone [name]

Set the timezone used to determine when each day starts for the daily challenge limits. Default is Eastern Time (US & Canada). See valid timezone names.

gamebot set timezone Pacific Time (US & Canada)

Timezone for #channel is Pacific Time (US & Canada).

Reset to the default with unset timezone.

gamebot unset timezone

Timezone for #channel has been reset to Eastern Time (US & Canada).

gamebot subscription

DM to show paid subscription information.

subscription

Your trial subscription expires in 13 days. Subscribe your team for \$49.99 a year at ... .

Captains can see credit card info.

subscription

Customer since August 11, 2018.
Subscribed to Slack PlayPlay (Yearly) (\$49.99), will auto-renew on August 11, 2019.
Invoice for \$49.99 on August 11, 2018, paid.
On file Visa card, user@example.com ending with 4242, expires 2/2022.
Update your credit card info at ... .

gamebot unsubscribe [id]

DM to cancel auto-renew for a paid subscription.

unsubscribe

Subscribed to Slack PlayPlay (Yearly) (\$49.99), will auto-renew on August 11, 2019.
Send `unsubscribe sub_DOvlBd1lETNimB` to unsubscribe.
unsubscribe sub_DOvlBd1lETNimB

Successfully canceled auto-renew for Slack PlayPlay (Yearly) (\$49.99).

API

Slack-gamebot implements a Hypermedia API. Navigate to the application root to browse through available objects and methods. PlayPlay.io's Gamebot is here.

A team captain must opt-in to serve data via the API with set api on. The data served by the API includes the team's Slack IDs, usernames and game stats.

We recommend HyperClient to query the API programmatically in Ruby.

Contributing

This bot is built with slack-ruby-bot-server. See CONTRIBUTING.

Copyright (c) 2015-2025, Daniel Doubrovkine, Vestris LLC, Artsy and Contributors.

This project is licensed under the MIT License.