Skip to content

Repository files navigation

Flurazide

Build Status License Python Version Release Platform Color

Flurazide is a feature-rich, multi-purpose Discord bot designed to enhance community engagement through a robust economy system, advanced image manipulation, and comprehensive moderation tools. Built with discord.py, it offers a seamless experience for both administrators and users.


πŸ“‹ Table of Contents


πŸ“– About / Overview

Flurazide exists to provide a "one-stop shop" for Discord server utility and entertainment. Its core philosophy is to blend complex database-driven functions (like a persistent economy and automated backups) with lighthearted, high-quality fun commands. Whether you're looking to moderate your server, simulate a virtual economy, or create memes on the fly, Flurazide is built to handle it with style and efficiency.


✨ Features

πŸ–ΌοΈ Image Manipulation

  • Forced GIFs: Convert static images or links into GIF format for easy sharing.
  • Dynamic Captions: Add impact-font captions to the top or bottom of images and GIFs.
  • Artifacting: Apply recursive JPEG artifacting for that "fried" look.
  • Profile Tools: Easily grab high-resolution avatars and banners from users.

πŸ’° Economy & Gambling

  • Persistent Currency: Earn, spend, and trade virtual currency across commands.
  • Virtual Shop: Purchase the set of items available in the store.
  • Casino Games: Test your luck with virtual betting (no real money involved).

πŸ› οΈ Moderation & Utility

  • Automated Sanctions: Efficiently manage bans, kicks, and message clearing.
  • Case System: Full moderation case management with search, edit, and pagination.
  • Backup System: Automated database backups to Google Drive via service account integration.
  • Server Metrics: Detailed /serverinfo and /info commands for deep insights.

🎲 Miscellaneous & Fun

  • Interactive Games: 8-ball, dice rolling with advanced expression support (/roll 1d20+5), and simulated "hacks".
  • External APIs: Integration with PokΓ©API, XKCD, random cat/dog image providers and so much more.
  • Utilities: Currency exchange, height conversion, Urban Dictionary lookup, and Base64 encoding.

πŸ–ΌοΈ Screenshots / Demo

Command Overview

Command List

Image Manipulation Example

Caption Demo

Economy Interaction

Economy Interaction


πŸš€ Installation

Prerequisites

  • Python 3.10 or higher
  • A Discord Bot Token (via Discord Developer Portal)
  • (Optional) Google Cloud Service Account for backups

Quick Install

  1. Clone the repository:

    git clone https://github.com/ThatOneFBIAgent/Flurazida.git
    cd Flurazida
  2. Install dependencies:

    pip install -r requirements.txt
  3. Run the initialization helper:

    python startbot.py

    Follow the interactive prompts to set up your environment.

  4. Start the bot:

    python src/main.py

🚒 Deployment

🐳 Local Docker Build

The Dockerfile uses a multi-stage build to keep the final image slim and reduce memory consumption:

  1. Build the image:
    docker build -t flurazide-bot .
  2. Run the container: (Ensure your .env file is in the current directory)
    docker run --env-file .env flurazide-bot

RAM Note: The optimized Dockerfile separates build-time dependencies (compilers, dev headers) from runtime, resulting in a significantly smaller image with lower memory footprint.

⚑ Railway Deployment

Deploying to Railway is streamlined via the included Dockerfile and Procfile:

  1. Connect Repository: Link your GitHub repo to a new Railway project.
  2. Detection: Railway will automatically detect the Dockerfile.
  3. Environment: Add your BOT_TOKEN and other .env variables in the Railway dashboard.
  4. Service Process: If prompted, ensure the service is set to use the worker process defined in the Procfile.

πŸ•ΉοΈ Usage

Basic Commands

  • /ping: Check bot latency and Cloudflare RTT.
  • /help: Opens a paginated menu of all available commands.
  • /roll dice: 2d20+5: Advanced dice roller with expansion support.

Image Manipulation

  • /image caption caption: "When the bot works" image: [Upload]: Captions an image.
  • /image jpegify recursions: 5: Crushes an image with artifacts.

Moderation

  • /moderator ban target: @User reason: "Violation of rules": Bans a user.

βš™οΈ Configuration

Environment Variables

Create a .env file (or use the .env/ directory) with the following:

Variable Description
BOT_TOKEN Your Discord Bot Token (Required)
DRIVE_TOKEN_B64 Base64 encoded Google Drive token (Optional for backups)

Internal Configuration

Modify extraconfig.py for advanced settings:

  • BOT_OWNER: Your Discord User ID.
  • BACKUP_FOLDER_ID: Google Drive folder ID for automated database backups.
  • FORBIDDEN_GUILDS/FORBIDDEN_USERS: Blacklist management.

πŸ“‚ Project Structure

Flurazide/
β”œβ”€β”€ bot.py                  # Minimal entry point (signals & startup)
β”œβ”€β”€ main.py                 # Bot class & setup hook
β”œβ”€β”€ commands/               # Bot command cogs
β”‚   β”œβ”€β”€ economy.py          # Currency & Shop
β”‚   β”œβ”€β”€ fun.py              # Games & APIs
β”‚   β”œβ”€β”€ gambling.py         # Casino games
β”‚   β”œβ”€β”€ image.py            # PIL processing
β”‚   β”œβ”€β”€ moderator.py        # Admin tools
β”‚   └── shop.py             # Shop system
β”œβ”€β”€ data/                   # SQLite databases (auto-created)
β”œβ”€β”€ utils/                  # Helper functions
β”œβ”€β”€ database/               # Database management module
β”‚   β”œβ”€β”€ manager.py          # All DB operations and backups
β”‚   └── items.py            # Shop items definition and effects list
β”œβ”€β”€ logging_modules/        # Custom logging system
β”‚   └── custom_logger.py    # Environment-aware logging
β”œβ”€β”€ services/               # External service integrations
β”‚   └── cloudflare_ping.py  # Cloudflare latency checker
β”œβ”€β”€ tests/                  # Pytest suite
β”œβ”€β”€ config.py               # Core configuration & cooldowns
β”œβ”€β”€ extraconfig.py          # Advanced settings & secrets
β”œβ”€β”€ resources/              # Assets (Fonts, etc.)
β”œβ”€β”€ requirements.txt        # Dependencies
β”œβ”€β”€ dockerfile              # Multi-stage Docker build
β”œβ”€β”€ Procfile                # Railway process definition
β”œβ”€β”€ pyproject.toml          # Pytest configuration
└── LICENSE                 # AGPLv3 License

πŸ—ΊοΈ Roadmap

  • Phase 0: Clean up codebase, modular architecture, add tests.
  • Phase 1: Higher efficiency image manipulation.
  • Phase 2: Migration from SQLite to MySQL for better scalability.
  • Phase 3: Website dashboard for configurations.
  • Phase 4: Localization support.

🀝 Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature/AmazingFeature).
  3. Commit your changes (git commit -m 'Add AmazingFeature').
  4. Push to the branch (git push origin feature/AmazingFeature).
  5. Open a Pull Request.

Standards: Refer to PEP 8 for coding style expectations.


πŸ§ͺ Testing

Flurazide includes a Pytest suite. Run all tests locally with:

python -m pytest tests/ -v

Or run a focused test file or a single test, e.g.:

python -m pytest tests/test_database.py -q
python -m pytest tests/test_prefix_commands.py::TestPrefixSystem::test_convert_user_username -q

Tests exercise the core systems:

  • Economy operations: balance updates, debt floor clamping, account creation
  • Shop system: buying, bulk buy/use, inventory management
  • Item effects: use_item behaviour, decrementing/removal, robbery/defense modifiers
  • Defenses: gun/taser/pocket-sand/parking-cone handling and cooldowns
  • Prefix compatibility: fake f! prefix mapping to application commands (slash compatibility)

Notes:

  • Commands are usable via both slash commands and the f! prefix; the prefix handler constructs a fake interaction and routes to the same command callbacks.
  • Heist behavior was hardened: crew capped at 6, Hackatron boosts stack (consumed per holder) and the success chance is hard-capped at 80%, and the victim is pinged with a plain message when a slash heist is started.
  • If you make changes that affect async I/O or Discord message objects, run the relevant tests under tests/ to verify behavior.

Configuration is in pyproject.toml with asyncio_mode = "auto".


❓ FAQ

Q: Can I use this for real-money gambling? A: No. All economy features are purely virtual and for entertainment purposes only.

Q: Why do image commands take a few seconds? A: Large images or GIFs are processed locally using PIL and may be temporarily uploaded to catbox for it's high size. High-recursion JPEG artifacting is CPU-intensive.


πŸ“„ License

This project is licensed under the GNU Affero General Public License v3.0. See the LICENSE file for details.


πŸ’– Acknowledgements


About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages