A Discord bot for managing your reading life, personal library, and group reads. BuddyRead helps reading communities track progress and read books together — all within Discord.
- Search books via the Google Books API (title or ISBN)
- Save books to your Want to Read list with
/search - Update reading status: In Progress, Finished, or Abandoned
- Log page progress with a visual percentage bar
- Rate and write reviews when you finish a book
- View your full library or another member's
- Profile card with reading counters (yours or others')
- Annual reading challenge (
/challenge) - Unlockable achievement (badge) system
- Server leaderboard
- Create joint reading events
- Other members can join with a button
- Compare each participant's progress on the same book
| Command | Description |
|---|---|
/help |
List all available commands |
/search |
Search for a book and add it to your library |
/progress |
Log pages read or update reading status |
/profile |
View profile, stats, and achievements |
/challenge |
Set your yearly book goal |
/library |
View full library (yours or another member's) |
/tbr |
View your "Want to Read" list |
/remove_book |
Remove a book from your library |
/leaderboard |
View the server's reader rankings |
/buddyread create |
Create a group reading event |
/buddyread status |
View member progress in a group |
- Python 3
- discord.py — Discord API with slash commands and interactive components
- Motor — async MongoDB driver
- aiohttp — async HTTP requests to the Google Books API
- MongoDB Atlas — database for profiles and reading groups
- Google Books API — book search and metadata
- Python 3.10+
- A Discord Developer Portal application with a bot created
- A MongoDB Atlas database (or local instance)
- A Google Books API key
# Clone or download the repository
cd book-bot
# Create a virtual environment (recommended)
python -m venv venv
venv\Scripts\activate # Windows
# source venv/bin/activate # macOS / Linux
# Install dependencies
pip install -r requirements.txt- Copy the example environment file and fill in your credentials:
cp .env.example .env # macOS / Linux
copy .env.example .env # Windows- Edit
.envwith your values:
| Variable | Description |
|---|---|
DISCORD_TOKEN |
Bot token from the Discord Developer Portal |
MONGO_URI |
MongoDB connection string |
GOOGLE_BOOKS_KEY |
Google Books API key |
GUILD_ID |
(Optional) Discord server ID for instant command sync |
- In the Discord Developer Portal, enable the following Privileged Gateway Intents for your bot:
- Message Content Intent
- Invite the bot to your server with permissions to send messages, use slash commands, and send embeds.
Security note: Never commit your
.envfile. It is listed in.gitignore.
python bot.pyOnce the bot is online, slash commands sync automatically. Use /help to see all commands.
On Render's free plan, use a Web Service (Background Workers are paid). The bot starts a small health endpoint on the PORT that Render provides — use it with UptimeRobot to prevent the service from sleeping.
- New + → Web Service (or Blueprint with
render.yaml) - Connect the
BuddyReadGitHub repository - Configure:
- Build Command:
pip install -r requirements.txt - Start Command:
python bot.py
- Build Command:
- Add environment variables:
DISCORD_TOKEN,MONGO_URI,GOOGLE_BOOKS_KEY, and optionallyGUILD_ID - Deploy and copy your service URL (e.g.
https://buddyread.onrender.com)
- Create a free account at uptimerobot.com
- Add Monitor → type HTTP(s)
- URL:
https://your-app.onrender.com/health - Interval: 5 minutes
- Save
UptimeRobot pings /health every 5 minutes so Render does not spin down the service.
- Stop any local instance of the bot (only one process can use the same Discord token)
- In MongoDB Atlas → Network Access, allow
0.0.0.0/0 - Enable Message Content Intent in the Discord Developer Portal
Locally, the health server only starts when
PORTis set — your.envdoes not need it.
- New Project → Deploy from GitHub → select
BuddyRead - Set Start Command to
python bot.py(or use the includedProcfile) - Add
DISCORD_TOKEN,MONGO_URI, andGOOGLE_BOOKS_KEYunder Variables - Deploy as a Worker service (not a web service)
The bot uses the book_bot_db database with two collections:
| Collection | Contents |
|---|---|
users |
Profiles, bookshelf, history, yearly goal, and preferences |
buddy_reads |
Group reading sessions |
- First Step — Finish your first book
- Bookworm — Finish 5 books
- Leviathan Slayer — Read a book with 400+ pages
- Dragon Reader — Fantasy
- Space Cadet — Science Fiction
- Hopeless Romantic — Romance
- Brave Soul — Horror
- Detective — Mystery / Thriller
- Life Explorer — Biography
- Time Traveler — History
- Genre Hopper — Finish books from 3 different genres
- Renaissance Reader — Finish books from 5 different genres
- Dark Heart — Finish your first Dark Romance
- Twisted Soul — Finish 5 Dark Romance books
- Fantasy Fanatic / Fantasy Overlord — 3 / 5 Fantasy books
- Romance Addict / Romance Devotee — 3 / 5 Romance books
- Mystery Buff / Case Closed — 3 / 5 Mystery/Thriller books
- Short & Sweet — Finish a book under 150 pages
- Brick Layer — Finish 3 books with 400+ pages
- Buddy Reader — Finish a book from a
/buddyreadgroup
Genres come from the Google Books API and are saved per book when you add it via
/search. Older books without genre data need to be re-added to unlock genre achievements.
Personal project. Use and adapt freely.