No description
- Python 92.2%
- Nix 7.8%
|
|
||
|---|---|---|
| .forgejo/workflows | ||
| cogs | ||
| tests | ||
| .env.example | ||
| .envrc | ||
| .gitignore | ||
| backfill.py | ||
| bot.py | ||
| charts.py | ||
| config.py | ||
| database.py | ||
| flake.lock | ||
| flake.nix | ||
| module.nix | ||
| parser.py | ||
| pytest.ini | ||
| queries.py | ||
| README.md | ||
| requirements.txt | ||
| streaks.py | ||
Wordle Bot
Discord bot that tracks daily Wordle scores from the Wordle app summary messages.
Setup
1. Create the Discord bot
- Go to https://discord.com/developers/applications
- Click New Application, name it "Wordle Bot"
- Go to Bot → click Add Bot
- Under Privileged Gateway Intents, enable:
- Server Members Intent
- Message Content Intent
- Copy the token — you'll need it in step 3
- Go to OAuth2 → URL Generator:
- Scopes:
bot,applications.commands - Bot Permissions:
Read Messages/View Channels,Read Message History,Send Messages,Embed Links,Attach Files
- Scopes:
- Open the generated URL to invite the bot to your server
2. Enter the dev shell
nix develop
3. Configure environment
cp .env.example .env
# Edit .env and set DISCORD_TOKEN=your_token_here
4. Run the bot
python bot.py
On first run the bot will backfill all historical messages from both channels. This may take a few minutes.
Slash Commands
| Command | Description |
|---|---|
/leaderboard [period] |
Score leaderboard (7d / 30d / all time) |
/shame [period] |
Most X/6 failures |
/stats [@user] |
Personal stats with streaks |
/history [@user] |
Last 15 results |
/today |
Most recent day's results |
/versus @user1 @user2 |
Head-to-head comparison |
/chart distribution [@user] |
Score distribution bar chart |
/chart timeline @user |
Score over time |
/chart weekly |
Weekly average comparison |
A weekly summary chart is automatically posted to #wordle every Monday at 9:00 AM UTC.
Deployment (VPS)
Run as a systemd service. Create /etc/systemd/system/wordle-bot.service:
[Unit]
Description=Wordle Discord Bot
After=network.target
[Service]
Type=simple
User=youruser
WorkingDirectory=/path/to/wordle-bot
EnvironmentFile=/path/to/wordle-bot/.env
ExecStart=nix develop --command python bot.py
Restart=on-failure
RestartSec=10
[Install]
WantedBy=multi-user.target
Then:
sudo systemctl enable wordle-bot
sudo systemctl start wordle-bot
sudo journalctl -u wordle-bot -f