An anti-bot Discord bot with a beer-based economy system, inspired by the character from 12oz Mouse. Fitz provides a comprehensive set of features for Discord servers including account management, banking, games, polls, and moreβwhen it chooses to. It's really just for my personal discord guilds but I suppose if you really wanted to run it yourself, I recommend forking the repo and changing some of the hardcoded guild IDs.
Fitz is a multi-purpose Discord bot built with .NET 8.0 and DSharpPlus. Unlike typical bots that obediently follow commands, Fitz is an anti-bot that performs commands if it chooses to do so. The bot centers around a beer-based economy where users can earn, spend, and interact with various features. Feeding Fitz beer helps encourage cooperation, making the beer economy central to the bot's functionality and personality.
Fitz is inspired by the character Fitz from the animated series 12oz Mouse. Just like the character, this bot embodies an anti-authoritarian personalityβit's not a typical obedient bot, but rather one that operates on its own terms. The beer-based economy reflects the character's relationship with alcohol in the show, where beer serves as both currency and motivation. The architecture follows a feature-based system that allows for easy enablement and disablement of functionality, giving Fitz the flexibility to "choose" which features to engage with.
- Bank: Complete banking system with beer as the primary currency
- Accounts: User account management with balance tracking
- Transactions: Full transaction history and logging
- Happy Hour: Double beer rewards during specific hours (7PM-11PM EST)
- Favorability: Dynamic favorability system based on beer balance ratios
- Lottery: Regular lottery drawings with ticket purchasing system
- Blackjack: Interactive blackjack games with betting
- Beer Hunt: Random beer reactions on messages for surprise rewards
- Polls: Create and manage polls with approval workflow
- User-submitted polls require approval from moderators
- Poll creators earn beer when users vote
- Support for multiple poll types and voting options
- Rename: Users can spend beer to rename other users in the guild
- Configurable base cost and duration
- Automatic expiration and nickname restoration
- Music: Play music in voice channels using Lavalink
- Queue management
- Playback controls
- Settings: Comprehensive settings management per guild
- Configurable lottery pool, ticket costs, and durations
- Account creation bonuses
- Happy hour base amounts
- Rename costs and limits
- Feature Toggle: Enable/disable features per guild
- Admin Commands: Specialized commands for administrators
Fitz is built as a modular system with three main components:
- Core Discord bot implementation
- Feature-based architecture
- CQRS pattern for commands and queries
- Hangfire for background job processing
- OpenTelemetry metrics with Prometheus export
- RESTful API for bot data access
- Discord OAuth2 authentication
- OpenAPI/Swagger documentation
- Entity Framework Core with MySQL
- CORS support for web frontend
- Next.js 14+ frontend application
- Mobile-first design
- TypeScript with auto-generated API client
- Discord OAuth integration
- .NET 8.0 - Core framework
- DSharpPlus 5.0 - Discord API wrapper
- Entity Framework Core - ORM
- MySQL - Database (via Pomelo.EntityFrameworkCore.MySql)
- Hangfire - Background job processing
- Lavalink4NET - Music playback
- Serilog - Logging
- OpenTelemetry - Observability and metrics
- Next.js 14+ - React framework with App Router
- TypeScript - Type safety
- Tailwind CSS - Styling
- shadcn/ui - UI components
- Vitest - Testing framework
- Docker - Containerization
- Docker Compose - Multi-container orchestration
- GitHub Actions - CI/CD
Fitz/
βββ Fitz/ # Main bot application
β βββ Core/ # Core bot functionality
β βββ Features/ # Feature modules
β βββ Events/ # Discord event handlers
β βββ Variables/ # Configuration constants
βββ Fitz.Api/ # REST API
β βββ Controllers/ # API endpoints
β βββ Models/ # Request/Response models
β βββ Services/ # Business logic
βββ Fitz.Database/ # Database layer
β βββ Entities/ # Entity models
β βββ Migrations/ # EF Core migrations
βββ Fitz.Web/ # Web frontend
β βββ src/
β βββ app/ # Next.js pages
β βββ components/ # React components
β βββ lib/ # Utilities
βββ docker-compose.yml # Container orchestration
- .NET 8.0 SDK
- Node.js (managed via mise)
- MySQL database
- Discord Bot Token
- Discord OAuth2 credentials (for API/Web)
- Clone the repository
- Copy
.env.exampleto.envand configure:- Database connection strings
- Discord bot token
- Discord OAuth credentials
- Other required environment variables
The easiest way to run Fitz is using Docker Compose:
docker-compose up -dThis will start:
- Bot: The Discord bot service
- API: REST API on ports 5000 (HTTP) and 5001 (HTTPS)
- Web: Web frontend on port 3000
cd Fitz
dotnet restore
dotnet runcd Fitz.Api
dotnet restore
dotnet runcd Fitz.Web
mise install
npm install
npm run generate-api # Requires API to be running
npm run devUsers can create accounts to participate in the economy. Accounts track:
- Beer balance
- Username
- Account status (active/deactivated)
- Lottery subscription preferences
The bank handles all beer transactions:
- Deposits and withdrawals
- Transfers between users
- Transaction logging
- Top balance leaderboards
Regular lottery drawings where users can:
- Purchase tickets with beer
- Subscribe to automatic ticket purchases
- Win from a growing pool
- View current lottery status and tickets
Interactive blackjack games:
- Multiple game types
- Betting system
- Multi-player support
- Dealer logic
Community-driven polling system:
- User-submitted polls
- Moderation workflow (approval/denial)
- Reaction-based voting
- Beer rewards for poll creators
Users can spend beer to rename others:
- Configurable costs
- Temporary renames with expiration
- Automatic restoration
Scheduled bonus periods:
- Double beer rewards during Happy Hour
- Configurable time windows
- Automatic activation/deactivation
Contributions are welcome! Please ensure:
- Code follows existing patterns and structure
- All tests pass
- Features follow the CQRS pattern
- Controllers have associated test classes
- Endpoints are documented