A collaborative daily drawing game for Discord.
CircleSketch is a robust Discord bot that hosts a daily drawing game. Players join a persistent circle to receive daily prompts, submit their art directly to the bot, and see a gallery of everyone's work at the end of the day. The bot is designed for 24/7 hosting, featuring streak tracking, admin controls, and a clean, modular codebase.
Works out of the box with SQLite for local/dev use, or with MySQL for production/hosted deployments.
- Features
- Setup and Installation
- Bot Commands
- Customization
- Database Backend Selection
- Contributing
- License
- 🎨 Daily Drawing Game: Automatically posts new prompts and reveals galleries at a configurable time.
- 🕹️ Manual Game Mode: Admins can start and end games on-demand with simple slash commands.
- 🔄 Persistent Player Circle: Users can easily join or leave the game circle at any time.
- 🖼️ Dynamic Gallery Generation: The bot collects submissions and generates themed gallery images for each player's art.
- 📈 Streak Tracking: Motivates players by tracking both group participation streaks and individual user stats.
- 🛡️ Admin Controls: Provides necessary tools for moderation, including resetting the player circle and checking game status.
- ⚙️ Production Ready: Includes robust logging, graceful shutdown handling, and a modular, extensible codebase built with
discord.py
cogs.
- Python 3.10+
- Git
git clone https://github.com/your-username/CircleSketch.git
cd CircleSketch
pip install -r requirements.txt
The bot uses a simple Python list for its drawing prompts. To keep your list private, it is not tracked by Git.
-
Copy the example file:
cp circle_sketch/prompts.example.py circle_sketch/prompts.py
-
Edit
circle_sketch/prompts.py
and add your own list of prompts.Example
prompts.py
:# This list contains the drawing prompts for the bot. PROMPT_LIST = [ "A happy cat wearing a top hat", "A robot chef making pancakes", "A majestic dragon flying over a futuristic city", ]
Create a .env
file in the root directory of the project to store your bot's credentials and configuration.
# .env
DISCORD_TOKEN=your-super-secret-bot-token
GAME_CHANNEL_ID=your-game-channel-id
# Optional: Override default settings
# LOG_FILE=logs/bot.log
# SCHEDULED_GAME_TIME=17:00
python run_bot.py
Command | Description | Permissions |
---|---|---|
/join_circle |
Join the player circle to participate in games. | All Users |
/leave_circle |
Leave the player circle. | All Users |
/list_circle |
Lists all current members of the player circle. | All Users |
/show_streaks |
Displays the current group streak and individual stats. | All Users |
/game_status |
Shows the status of the current game, including the theme. | All Users |
/start_manual_game |
Manually starts a new game that runs until ended. | All Users |
/end_manual_game |
Ends the current manual game and posts the gallery. | Game Starter or Admin |
/reset_circle |
[Admin] Resets the player circle, removing all members. | Admin Only |
- Prompts: Keep your prompt list unique and private by editing only your local
prompts.py
. - Assets: Place custom fonts in
assets/fonts/
to change the look of the generated gallery images. - Configuration: Most core settings (like game time) can be adjusted in your
.env
file or directly incircle_sketch/config.py
.
CircleSketch supports both SQLite (default, for local/dev use) and MySQL (for production, e.g., PebbleHost) as storage backends. The backend is selected at runtime using an environment variable.
No setup required. SQLite is used by default. Just run:
python run_bot.py
- Install MySQL and create a database/user, or use your host's MySQL credentials.
- Install the required Python package:
pip install mysql-connector-python
- Set the following environment variables:
CIRCLE_SKETCH_DB_BACKEND=mysql
CIRCLE_SKETCH_MYSQL_URL=mysql://user:pass@host/db
- Run the bot as usual:
python run_bot.py
- The bot will automatically use SQLite unless you set
CIRCLE_SKETCH_DB_BACKEND
tomysql
. - All code uses the same
Storage
interface, so you do not need to change any code to switch backends. - This makes it easy for open source contributors to run the bot locally, and for production users to use a robust, scalable database.
You can add more backends (e.g., PostgreSQL) by implementing the same storage API and updating storage/storage.py
.
Tip: If you want to force SQLite for demo/testing, set:
CIRCLE_SKETCH_DB_BACKEND=sqlite python run_bot.py
For more details, see the storage/
directory and code comments.
Contributions are welcome! Please feel free to fork the repository, create a new branch, and submit a pull request. When contributing, please do not commit your personal prompts.py
file.
This project is licensed under the MIT License. See the LICENSE file for details.