master
🐸 Dank Bot
A Discord bot built with discord.py, featuring a plugin-based architecture for extensible functionality.
Features
- Plugin System: Easily add new features by dropping a plugin into the
plugins/directory - BotChat Plugin: AI-powered chat responses with configurable prompts
- Pepe Plugin: Classic Pepe meme reactions
- Logging: Full command and message logging via Python's
loggingmodule
Current Plugins
| Plugin | Description |
|---|---|
botchat |
AI chat plugin with prompt templates and censorship support |
pepe |
Pepe meme reaction plugin |
Prerequisites
- Python 3.12+
- A Discord Bot Token
- A Discord application with the
MESSAGE CONTENT INTENTenabled
Quick Start (Docker)
1. Create a token file
Create a .token file with your Discord bot token:
echo "YOUR_DISCORD_BOT_TOKEN_HERE" > .token
2. Build and run
# Build the Docker image
docker build -t dank-bot .
# Run the bot
docker run -d \
--name dank-bot \
--env DISCORD_TOKEN=$(cat .token) \
dank-bot
Note: The bot reads its token from a
.tokenfile at runtime. Mount it as a volume:docker run -d \ --name dank-bot \ -v $(pwd)/.token:/app/.token:ro \ dank-bot
Prerequisites (Local)
Local Setup
1. Create a token file
Create a .token file with your Discord bot token:
echo "YOUR_DISCORD_BOT_TOKEN_HERE" > .token
2. Install dependencies
pip install -r requirements.txt
3. Run the bot
python main.py
Project Structure
dank-bot-py/
├── main.py # Bot entry point
├── requirements.txt # Python dependencies
├── start.sh # Quick start script
├── .token # Discord bot token (DO NOT COMMIT)
├── .gitignore
├── .dockerignore
├── Dockerfile
├── README.md
└── plugins/
├── botchat/ # AI chat plugin
│ ├── plugin.py
│ ├── settings.yaml
│ └── prompts/ # Prompt templates
│ ├── default.txt
│ ├── default-censored.txt
│ ├── summarize.txt
│ └── summarize-search.txt
└── pepe/ # Pepe meme plugin
├── plugin.py
└── pepes.txt
Adding a New Plugin
- Create a new directory under
plugins/ - Add a
plugin.pyfile with your bot extension code - The bot will auto-discover and load it on startup
Commands
| Command | Description |
|---|---|
!help |
List available commands |
!chat <message> |
Send a message to the AI chat (via botchat plugin) |
!pepe |
Trigger a Pepe meme reaction |
Configuration
- BotChat: Edit
plugins/botchat/settings.yamlfor plugin settings - Prompts: Modify files in
plugins/botchat/prompts/to customize AI behavior - Token: Store in
.token(never commit this file)
Docker
Build
docker build -t dank-bot .
Run
docker run -d \
--name dank-bot \
--restart unless-stopped \
-v $(pwd)/.token:/app/.token:ro \
dank-bot
Logs
docker logs -f dank-bot
Stop
docker stop dank-bot
Environment Variables
| Variable | Description | Default |
|---|---|---|
LOG_LEVEL |
Logging verbosity | INFO |
Security
- Never commit your
.tokenfile — it's included in.gitignorefor this reason - The Docker image runs as a non-root user (
botuser) for added security - Use Docker volume mounts for sensitive files instead of baking them into the image
Languages
Python
96.1%
Dockerfile
3.8%