Skip to main content

Community Chess Bot

A moderator bot for Community Chess, a collaborative chess game on Reddit.

Contributing

  1. Create a virtual environment to work in
pyenv exec python -m venv .venv
  1. Activate the virtual environment each time you open the project
source .venv/bin/activate
  1. Install dependencies
pyenv exec pip install -r requirements/dev.txt`
  1. Set up Reddit API authentication

  2. To perform type checking, use

pyenv exec mypy src/__init__.py
  1. To run the tests, use
pyenv exec python -m unittest discover -s src
  1. Run the bot
  • --help shows options
  • --timeout sets how frequently the bot should look for moves to play
  • --log sets the log level
# Enable verbose logging and 
# check for moves on the current post every five seconds
pyenv exec python src/main.py --log INFO --timeout 5

Authentication

This bot uses Praw's Code Flow for authentication.

  1. Create an application in your Reddit application preferences. Note your client_secret, shown when your press edit, and your client_id, listed below personal use script.

  2. Set up your praw.ini in the project root as follows:

[DEFAULT]
redirect_uri=http://localhost:8080
client_id=MY_CLIENT_ID
client_secret=MY_CLIENT_SECRET
user_agent=script:com.MY_NAME.communitychess:v0.1.0 (by /u/MY_USERNAME)
  1. Use python src/get_refresh_token.py to generate a refresh token.

  2. Add this line to your praw.ini:

refresh_token=MY_REFRESH_TOKEN

Metadata

Release files for chessbot 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for chessbot 0.1.0
File Size Uploaded
chessbot-0.1.0.tar.gz 10.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for chessbot 0.1.0
File Interpreter ABI Platform
chessbot-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 20.5 kB

Release files / chessbot-0.1.0.tar.gz

Download URL chessbot-0.1.0.tar.gz
Size 10.3 kB
Tags Source
SHA-256 checksum
How to use checksums
3e54a4ecb68169333368b3f230b265ec65523c55792b9a39ad28872b16c5441f
BLAKE2b-256 checksum
How to use checksums
ddcf90a5de72fffe6746962c1c35292b4f4b403b9fd400f89e0fa6884aee7a0e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.12.1

Release files / chessbot-0.1.0-py3-none-any.whl

Download URL chessbot-0.1.0-py3-none-any.whl
Size 10.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b6cbbc0d6c5b92dfab9b81bca2a534b72f6e30eb5ea484bd788255b75957a57e
BLAKE2b-256 checksum
How to use checksums
8e6d1e75bae5db024c0242793855c2a12bab1e77fce7111d45fe8f09d555ae68
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.12.1

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page