Giter VIP home page Giter VIP logo

slack-gamebot's Introduction

Slack-Gamebot

Build Status

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> GAMEBOT_SECRET=secret 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 register

Registers a user.

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.

gamebot challenge , ... [with , ...]

Creates a new challenge between you and an opponent.

gamebot challenge @WangHoe

Victor Barna challenged Wang Hoe 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 accept

Accept a challenge.

gamebot accept

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

gamebot lost [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.

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.

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.

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 leaderboard [number|infinity]

Get the leaderboard.

gamebot leaderboard

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

The leaderboard contains 3 topmost players ranked by Elo, use leaderboard 10 or leaderboard infinity to see 10 players or more, respectively.

gamebot matches

Displays 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

gamebot challenges

Displays all outstanding (proposed and accepted) challenges.

gamebot rank [, ...]

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 reset [secret]

Direct-message gamebot to reset all users and pending challenges.

gamebot reset <secret>

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

API

Slack-gamebot implements a Hypermedia API. Navigate to the application root to browse through available objects and methods. Artsy's Gamebot is here, you can see dblock's current elo.

We recommend HyperClient to query the API programmatically in Ruby.

Contributing

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

Copyright and License

Copyright (c) 2015, Daniel Doubrovkine, Artsy and Contributors.

This project is licensed under the MIT License.

slack-gamebot's People

Contributors

dblock avatar mziwisky avatar wrgoldstein avatar

Stargazers

Chris Wang avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.