collab-chess

command module
v0.0.0-...-a725dda Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 20, 2021 License: Unlicense Imports: 10 Imported by: 0

README

@chess-bot

♟️Hey, I live in #playchess at the Hack Club Slack. I am a chess bot that is aiming to provide a Humans vs. AI experience. Each turn, users in the channel can vote on a move and after forty seconds the top voted move gets played. Let's try to beat Stockfish as a collaborative effort!

Built on top of CJSaylor's amazing @chessbot

If there is no active game for 3 minutes, then it is removed from memory.

COMMANDS
!start (white/black - optional) - starts a new game
!move [notation] - Votes on the specified move. For example, !move e4 or !move Nc6. Each turn top voted move gets played.
!board - Shows the current state of the chess board
SETUP
  • Create a new Slack App and add the following bot token scopes from "OAuth & Permissions": app_mentions:read, channels:history, chat:write
  • Go to "Event Subscriptions", enable events and subscribe to the message.channels and app_mention events
  • Install the app to your Workspace from the "OAuth & Permissions" page, grab your "Bot User OAuth Access Token" and set it as the SLACK_BOT_TOKEN in your environment
  • Under "Basic Information", grab the Signing Secret and set it as SLACK_SIGNING_SECRET in your environment
  • Set the CHANNEL_ID (the channel you want the bot to be active) and APP_HOSTNAME (the public url where you will be listening for slack events) variables in your environment
  • For local development you need to place the relevant stockfish binary for your OS in a folder in your PATH
  • If you are developing locally, use ngrok to create a public url and put "{your_ngrok_url}/slack/events" to the "Request URL" under "Event Subscriptions"
  • !!! If you are deploying using the Dockerfile or you are on a Linux system you have to install the MS fonts to see the ranks and files on the board image using
apt-get install ttf-mscorefonts-installer fontconfig && fc-cache -f

You can confirm if the fonts are installed correctly by using "fc-match Arial"

ISSUES
  • Sometimes the ranks and files are not rendered properly on the board.
IDEAS
  • Instead of Stockfish create a Chess engine from scratch?
  • Persist games in a database so that we can see who played how many games and detailed statistics?
  • Let users know when it is the last 10-15 seconds to make a move?
  • !votes command to show which moves have been voted so far?

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package rendering is responsible for rendering game boards by ID in their current state
Package rendering is responsible for rendering game boards by ID in their current state

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL