How can you play chess on any device?
Slack!
This project gives you a turn key solution for tranforming slack into a chess client. With slackchess you can:
- challenge another slack user
- play against @slackbot powered by Stockfish
- offer draws and resign
- export your game as a PGN
To start the Slack Integration Guide you will need the IP or URL of your server. If you don't already have a place to host slackchess, you can follow the Digital Ocean Setup Guide first. After the Slack Integration is setup, you should follow the Server Setup Guide. The Server Setup Guide will guide you through pulling down the docker image and running it as a container.
- Signup for Digital Ocean if you don't have an account (https://m.do.co/c/f4609bed935c referal link to get $10 free)
- Click Create Droplet
- Select One-click Apps > Docker
- Choose smallest size
- Make sure to add your SSH keys (if you need help click "New SSH Key > How to use SSH keys")
- Select 1 droplet
- Click Create
- Login to Slack and go to https://slack.com/apps
- Go to Configure > Custom Integrations > Slash Commands > Add Configuration
- For "Choose a Command" type "/chess" and press "Add Slash Command Integration"
- Set "URL" to http://45.55.141.331/command where "45.55.141.331" is your IP
- Make sure "Method" is POST
- Copy and paste the generated "Token" somewhere, you will need it later
- For "Customize Name" you can enter anything (ex. "ChessBot")
- For "Customize Icon" I used this image: https://upload.wikimedia.org/wikipedia/commons/thumb/f/f0/Chess_kdt45.svg/45px-Chess_kdt45.svg.png
- Click "Save Integration"
If you added your SSH keys to your local machine (you should have in the Digital Ocean Setup Guide), you can SSH into your machine. Replace "45.55.141.331" with your IP.
ssh root@45.55.141.331
Pull down the docker image from Docker Hub.
docker pull loganjspears/slackchess
Create and run a docker container with your information. Replace "R546Sk2RoZiAXZltssJ4WfEO" with your Slack token. Replace "45.55.141.331" with your IP.
docker run -d -p 80:5000 -e TOKEN=R546Sk2RoZiAXZltssJ4WfEO -e URL=http://45.55.141.331 loganjspears/slackchess
If everything worked the ps command should show the container running.
docker ps
Thats it!
Play against user:
/chess play @user
Play against bot:
/chess play @slackbot
You can view all commands by using the help command.
/chess help