A Discord bot and web dashboard for tracking and analyzing Travian game data. The project consists of two main components:
- A Discord bot for managing defense coordination and player tracking
- A web dashboard for visualizing game data and statistics
-
Defense Coordination
- Create and manage defense calls (CFDs)
- Track defense contributions
- View defense leaderboards
- Organize defense through threaded discussions
-
Player Tracking
- Record and retrieve player reports
- Search player rankings and statistics
- Monitor player village changes
-
Server Management
- Server-specific configurations
- Role-based access control
- Automated alerts for alliance changes
-
Interactive World Map
- Filter alliances
- View player villages and populations
- Track territory control
-
Analytics
- Alliance population trends
- Player growth statistics
- Village distribution analysis
- Python 3.8+
- SQLite3
- Discord Bot Token
- Clone the repository
- Run the setup script with your Discord bot token:
# This will:
# -- Create necessary database directories
# -- Create config.ini with your bot token
# -- Set up the database structure
./setup.sh YOUR_DISCORD_BOT_TOKEN- Initialize the databases:
# This will:
# -- Initialize the analytics database
# -- Set up all required tables
# -- Create necessary views
cd databases
python manage.py init-analytics
python manage.py refresh-views- Create virtual environment and install dependencies:
# This will:
# -- Create a new virtual environment
# -- Install all required dependencies
# -- Clean any existing caches/temporary files
cd bot
make reset- Navigate to the site directory
- Install dashboard dependencies:
pip install -r site/requirements.txt- Start the dashboard:
python site/app.py!def list- List open defense calls!def send <cfd_id> <amount>- Submit defense to a CFD!def leaderboard- View defense contribution rankings!def log- View defense submission history
!tracker add <ign> <link> <coordinates>- Add a player report!tracker get <ign> [count]- Get player reports!tracker list- List all tracked players!tracker delete <ign> <report_id>- Delete a report
!boink init- Initialize server configuration!boink info- View server settings!boink set <setting> <value>- Update server settings
The bot uses a role-based permission system:
- Admin Role: Full access to all commands
- User Role: Access to basic tracking and viewing commands
- Anvil Role: Special access to defense coordination
The project uses two types of databases:
- Bot Servers: Individual databases for each Discord server
- Game Servers: Databases containing Travian game data
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Discord.py for the bot framework
- Dash for the web dashboard
- Plotly for data visualization
All commands must be run from the bot directory.
make testRuns pytest for all tests in the test/ directory.
make devRuns the bot in development mode.
make format # Format code using ruff
make lint # Run linting checksmake reset # Clean and recreate virtual environment