Just a simple and helpful Discord bot that productively wants to make you happy.
- Modular cog-based architecture
- Hybrid commands — every command works as both
!cmdand/cmd - Customizable presence and status (via
.envor/setpresence) - Logging to file and console, cleared on every restart
- Global error handling
- Python 3.10+
- A Discord application and bot token
git clone https://github.com/mowtiie/Harriet.git
cd Harriet
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt
cp .env.example .env
Edit .env and add your bot token.
python bot.py
- Go to https://discord.com/developers/applications and click New Application.
- Open the Bot tab. Click Reset Token and copy the value into
.envasDISCORD_TOKEN. - Under Privileged Gateway Intents, enable:
- Message Content Intent
- Server Members Intent
- Go to OAuth2 → URL Generator. Select scopes
botandapplications.commands, then choose the permissions you need (at minimum: Send Messages, Read Message History; add Manage Messages forclear). - Open the generated URL in a browser and invite the bot to your server.
All settings live in .env:
| Variable | Description | Default |
|---|---|---|
DISCORD_TOKEN |
Bot token (required) | — |
COMMAND_PREFIX |
Prefix for text commands | do |
LOG_LEVEL |
DEBUG, INFO, WARNING, ERROR |
INFO |
BOT_STATUS |
online, idle, dnd, invisible |
online |
BOT_ACTIVITY_TYPE |
playing, listening, watching, competing |
playing |
BOT_ACTIVITY_NAME |
Text shown after the activity type | with discord.py |
The bot owner can also change presence at runtime with /setpresence.
| Command | Description | Permission |
|---|---|---|
/ping, do ping |
Latency check | Anyone |
/hello, do hello |
Greeting | Anyone |
/clear <n>, do clear <n> |
Delete last n messages | Manage Messages |
/setpresence, do setpresence |
Change bot presence | Bot owner |
discord-bot/
├── bot.py Entry point
├── config.py Settings loaded from .env
├── logger.py Logging configuration
├── requirements.txt
├── cogs/ Feature modules (auto-loaded)
│ ├── general.py
│ ├── moderation.py
│ └── presence.py
└── logs/ Generated at runtime
Create a new file in cogs/ following the pattern in cogs/general.py. Any .py file in that folder is loaded automatically on startup.
This bot:
- Does not collect, store, or transmit user data to any external service
- Does not use analytics or telemetry
- Writes logs only to
logs/bot.logon the host machine - Truncates the log file on every startup (no long-term log accumulation)
Logged events include: bot lifecycle (login, presence changes), cog loads, errors with tracebacks, and moderation actions (who ran clear, where, how many messages). Logs stay on the host running the bot and are never sent anywhere.
The bot reads message content (for prefix commands) and member info (for permission checks) per the intents below, but does not store either.
Privileged Intents (enabled in the Developer Portal):
- Message Content Intent — required for prefix commands (
!ping, etc.) to read what users typed - Server Members Intent — required to look up members and check their permissions
Bot Permissions (set when inviting):
- Send Messages — to respond to commands
- Read Message History — required by
clearto find messages to delete - Manage Messages — required by
clearto delete them - Use Slash Commands — for slash command invocations
See SECURITY.md for vulnerability disclosure.