• Stars
    star
    129
  • Rank 279,262 (Top 6 %)
  • Language
    Ruby
  • License
    MIT License
  • Created over 9 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Ping pong, chess, pool and other games bot for Slack.

Slack-Gamebot

Add to Slack

Or roll your own ...

Tests Code Climate

A generic game bot for slack. Works for ping-pong (2, 4 or more players), chess, etc. Inspired by slack-pongbot, but more robust, generic and easier to improve and contribute to.

Installation

Create a new Bot Integration under services/new/bot. Note the API token. You will be able to invoke gamebot by the name you give it in the UI above.

Run SLACK_API_TOKEN=<your API token> foreman start

Production Deployment

See DEPLOYMENT

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 youself 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.

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.

You cannot record a win.

Record your loss with a score, loser first.

gamebot lost 5:21

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

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 draw [score ...]

Draws a challenge, 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 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, lws: 5)
2. Deng Yaping: 1 win, 3 losses (elo: 24)
3. Wang Hoe: 0 wins, 1 loss (elo: -12)

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.

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

gamebot leaderboard -5

1. Wang Hoe: 0 wins, 1 loss (elo: -12)
2. Deng Yaping: 1 win, 3 losses (elo: 24)
3. Victor Barna: 3 wins, 2 losses (elo: 148, 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 o matches inifinity to see all matches in the season.

gamebot challenges

Displays all outstanding (proposed and accepted) challenges.

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)
3. Wang Hoe: 0 wins, 1 loss (elo: -12)

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 _China_, 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 china

Welcome to the new season!

gamebot season

Display 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 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 @, eg. gamebot unregister WangHoe.

gamebot set nickname [name]

Sets a nickname for display purposes.

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 for team China are off.

Using unset gifs is equivalent to set gifs off.

gamebot set leaderboard max [number|infinity]

Set and resets the leaderboard max. Default is inifinity, ie. to show the entire leaderboard.

gamebot set leaderboard max 5

The following are equivalent.

gamebot set leaderboard max 0
gamebot set leaderboard max infinity
gamebot unset leaderboard max

gamebot set elo [number]

Set and resets the base elo for new seasons. Default is 0.

gamebot set elo 1000
gamebot unset elo

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:

Team China aliases are set to pp and :pong:.

Remove all aliases with unset aliases.

gamebot set api on|off

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

gamebot set api on

API for team China is on!
http://www.playplay.io/api/teams/57224e65bc526eac95bfe316
gamebot unset api

API for team China is off.

gamebot set unbalanced on|off

Allow unbalanced challenges with different number of opponents.

gamebot set unbalanced on

Unbalanced challenges for team China are on!

gamebot subscription

DM to show paid subscription information.

subscription

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

Captains are able to see credit card info.

subscription

Customer since August 11, 2018.
Subscribed to Slack PlayPlay (Yearly) ($29.99), will auto-renew on August 11, 2019.
Invoice for $29.99 on August 11, 2018, paid.
On file Visa card, [email protected] 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) ($29.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) ($29.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, you can see dblock's current ping-pong elo here.

A team captain must opt-in serving data via the API with set api on. The data served by the API includes 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 and License

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

This project is licensed under the MIT License.

More Repositories

1

fui

Find unused Objective-C imports.
Ruby
2,041
star
2

ARTiledImageView

Display, pan and deep zoom with tiled images on iOS.
Objective-C
229
star
3

ruby-enum

A handy way to define enums in Ruby.
Ruby
176
star
4

iex-ruby-client

IEX Finance API Ruby Client
Ruby
119
star
5

heroku-forward

Beat Heroku's 60s boot timeout with a proxy.
Ruby
109
star
6

rspec-rerun

Re-run (retry) failed RSpec examples.
Ruby
94
star
7

ios-snapshot-test-case-expecta

Expecta matchers for ios-snapshot-test-case.
Objective-C
93
star
8

msiext

AppSecInc. Community MSI Extensions
C++
85
star
9

strava-ruby-client

A complete Ruby client for the Strava API v3.
Ruby
80
star
10

gem-licenses

Collect gem licenses.
Ruby
67
star
11

vmwaretasks

C# VixCOM Wrapper Library & Tools
XSLT
58
star
12

TSMiniWebBrowser

In-app web browser control for iOS apps, maintained version of tonisalae/TSMiniWebBrowser.
Objective-C
56
star
13

dzt

Slice deep-zoom images.
Ruby
54
star
14

ARASCIISwizzle

Swizzle your iOS project into ASCII art.
Objective-C
51
star
15

guard-rack

Restart Rack when files change.
Ruby
42
star
16

obcd

Deal with obsessive compulsive issues of programmers in Objective-C.
Ruby
41
star
17

slack-strava

(Re)Post Strava activities to Slack
Ruby
37
star
18

open-weather-ruby-client

OpenWeather Ruby Client
Ruby
34
star
19

ocmock-expecta

Expecta matchers for OCMock
Objective-C
33
star
20

slack-market

Market quotes in Slack.
Ruby
32
star
21

danger-changelog

A plugin that is OCD about your CHANGELOG format.
Ruby
29
star
22

alexa-parrot

A walkthrough for building a basic Alexa skill.
JavaScript
27
star
23

log4jna

Log4jna is a library of native appenders for log4j.
Java
26
star
24

pixmatch

Idee PixMatch API client
Ruby
24
star
25

canonical-emails

Combine email validation and transformations to produce canonical email addresses.
Ruby
23
star
26

fue

Find an e-mail addresses of Github users.
Ruby
20
star
27

slack-sup

Slack bot that generates fresh triads of team members to meet every week in an informal standup, or S'Up.
Ruby
18
star
28

actionmailer-text

Automatically insert a text/plain part into your HTML multipart e-mails.
Ruby
17
star
29

objc-ngram

Rudimentary ngram search in ObjectiveC.
Objective-C
15
star
30

remoteinstall

Pragmatic VMWare-based tool for automating software testing, starting with software installation.
C#
13
star
31

grape-on-rack-v1-inside-v2

Demonstrate versioning fallback in Grape.
Ruby
13
star
32

dotfiles

My dotfiles.
Shell
10
star
33

google-finance-ruby-client

Google Finance web API ruby client with support for retrieving stock quotes and historical prices.
Ruby
10
star
34

ruby-overload

Overload Ruby methods at runtime.
Ruby
8
star
35

heroku-commander

Master the Heroku CLI from Ruby.
Ruby
7
star
36

grape-with-mongoid

Grape API implementing a basic CRUD model with Mongoid.
Ruby
7
star
37

faf

Find active Github forks.
Ruby
7
star
38

slack-amber-alert

Missing kids notifications from missingkids.org in Slack.
Ruby
7
star
39

run.dblock.org

Personal running website.
JavaScript
6
star
40

svn2svn

Copy, sync, replay or reflect changes across SVN repositories.
C#
6
star
41

grape-with-roar-walkthrough

Live coding of a rudimentary Grape+Roar HAL API.
Ruby
6
star
42

email-example-spec

Integration testing with e-mail examples.
Ruby
6
star
43

baseclasses

a collection of C++ classes from the 90s, used in alkaline search engine
C++
6
star
44

graphql-invoices

GraphQL demo on Ruby on Rails.
Ruby
5
star
45

strava-ruby-cli

Strava command-line client.
Ruby
5
star
46

slack-moji

You don't have enough emoji on Slack.
Ruby
5
star
47

grape_warden

Ruby
4
star
48

3licenses

Collect your 3rd party licenses.
Java
4
star
49

danger-toc

A danger.systems plugin for your markdown TOC.
Ruby
4
star
50

codeproject

source code and experiments for various CodeProject articles
C#
4
star
51

alexa-app-server-hello-world

JavaScript
4
star
52

amerika

Make America great again!
JavaScript
4
star
53

with-version

Syntax sugar for version checks.
Ruby
4
star
54

strava-motor

Automate me some Strava.
Ruby
3
star
55

artsy-download-script

A command-line tool for downloading full-size images from artsy.com
Python
3
star
56

sncore

social networking foundation that runs foodcandy.com
C#
3
star
57

slack-arena

Are.na integration into Slack.
Ruby
3
star
58

ARImageViewInsideScrollView

Demo for Tiling and Zooming ASCII Art @ iOSOHO, NYC, June 9th, 2014.
Objective-C
2
star
59

discord-strava

Connect Strava to Discord.
Ruby
2
star
60

dance-the-art-genome

Dance the Art Genome!
JavaScript
2
star
61

autoconf

an attempt to save the source code of autoconf, my famous multi-boot program for DOS
Fortran
2
star
62

alexa-mom

Shhh... a hackathon project.
JavaScript
2
star
63

ssoexample-waffle

single sign on example using WAFFLE
Java
2
star
64

excalc

vestris inc. expression calculator, circa 96'
Pascal
1
star
65

amzn-stock-price-data

Amazon stock price data and 4 year grant averages.
Ruby
1
star
66

alkaline

the alkaline search engine, circa 2000
C++
1
star
67

scala-parse-json

Parse JSON in Scala with Jackson.
Scala
1
star
68

1aat-ruby

A dummy web server that takes a long time to process a request and closes its listening socket every time.
Ruby
1
star
69

artsy-feathers

A set of examples that tweet artworks and shows retrieved from the Artsy API.
Ruby
1
star
70

delayed_job_rspec

Patches Delayed::Job to run jobs immediately under RSpec.
Ruby
1
star
71

agnes

aGNeS BBS, circa 96
C++
1
star
72

ruby-link-checker

Fast ruby link checker.
Ruby
1
star
73

p5art

A dip into digital art.
HTML
1
star
74

opensearch-dotnet-client-demo

OpenSearch DotNet (.NET) Client Demo
C#
1
star
75

enumerable-detect-value

Unlike Enumerable#detect, #detect_value returns the result of the block being evaluated.
Ruby
1
star