A Discord bot for the Phoenix Legacy community, built with py-cord and MongoDB.
/status— set the bot's online status (online, idle, dnd, invisible)/activity set— set the bot's activity (playing, watching, listening, streaming, competing)/activity clear— clear the bot's activity/avatar— update the bot's avatar- Reacts with 👀 when mentioned
/invite— generate a temporary invite link (auto-expires, tracked in DB)/greetings create— add a welcome message shown to new members/greetings paginate— browse and delete welcome messages- Auto-assigns a role to new members
- Posts a join announcement embed when someone joins
/topic create— create a topic channel with a role and a subscribe message/topic edit— edit an existing topic's name, type, or image/topic delete— remove a topic and its role- Users subscribe/unsubscribe by reacting with ✅
- Topic types (name, color, emoji) are configured in
config/topic.json
- Automatically captures messages matching
"quote" - authorin a configured channel /quote [id]— post a random (or specific) safe quote as a generated image/quotes set-capture-channel— set the channel to listen for new quotes/quotes set-reply-channel— set the channel where/quoteposts its output/check-quotes [id]— moderation UI to mark quotes as safe/unsafe/crawl-missing-quotes— backfill the database from channel history- Quote images use a random background from Picsum with the quote text and author rendered on top
- Python 3.13+
- MongoDB instance (e.g. MongoDB Atlas)
- A Discord bot token (Discord Developer Portal)
- A font file for quote image generation (path configured via
fontPathinconfig/quotes.json, defaults toassets/fonts/PlayfairDisplay-Italic.ttf)
| Variable | Description |
|---|---|
TOKEN |
Discord bot token |
MONGO_URI |
MongoDB connection string |
-
Clone the repository:
git clone https://github.com/cfazilleau/FriendlyFire.git cd FriendlyFire -
Create a
.envfile:TOKEN=your_discord_token MONGO_URI=your_mongo_uri -
Copy and fill in your config files from the provided templates:
cp config/topic.template.json config/topic.json # edit config/topic.json to define your topic types -
Build and start:
docker compose up -d
-
Clone the repository and create a virtual environment:
git clone https://github.com/cfazilleau/FriendlyFire.git cd FriendlyFire python -m venv .venv source .venv/bin/activate # Windows: .venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Set environment variables:
export TOKEN=your_discord_token export MONGO_URI=your_mongo_uri
-
Copy and fill in your config files from the provided templates:
cp config/topic.template.json config/topic.json # edit config/topic.json to define your topic types -
Run the bot:
python -u main.py
Config files live in config/ and are gitignored. Template files (*.template.json) document the expected structure.
| File | Description |
|---|---|
config/topic.json |
Topic types (name, color hex, emoji) — must be hand-edited |
config/invites.json |
Invite settings (max age, role ID, announcement channel) |
config/presence.json |
Cached bot status and activity |
config/quotes.json |
Capture channel, reply channel, and font path for quote images |
All configs support per-guild overrides under a guilds key:
{
"global": { "inviteMaxAge": 1200 },
"guilds": {
"123456789": { "inviteRole": 987654321 }
}
}