A high-performance Discord bot for economy, social interactions, and server management.
To set up the bot on a fresh Ubuntu instance, follow these steps:
-
Clone the Repository:
git clone https://github.com/og2701/HMS-Victory.git cd HMS-Victory -
Run the Setup Script: This script installs system dependencies (Python, Chrome, SQLite), creates a virtual environment, and installs a systemd service.
./setup_instance.sh
-
Configure Environment Variables: Edit the generated
.envfile with your tokens:nano .env
Fill in
DISCORD_TOKENandOPENAI_TOKEN. -
Start the Bot:
sudo systemctl enable hms-victory sudo systemctl start hms-victory
To pull the latest code from GitHub and restart the bot safely:
./update_bot.shNote: This script safely stops the service, pulls the latest code, and restarts it.
To see the bot's live output:
journalctl -f -u hms-victory.service- Remote Backups: Every 5 minutes, the bot bundles the SQLite database (
.db,-wal,-shm) into a ZIP file and sends it to the#data-backupchannel. - Data Persistence: JSON data (predictions, streaks, etc.) is stored in
data/json/and backed up alongside the database.
If you move to a new instance or lose your local database:
- Ensure your
DISCORD_TOKENis set in.env. - Start the bot normally (
sudo systemctl start hms-victory). - The bot will detect the missing
database.db, automatically fetch the latest ZIP from the Discord backup channel, and extract it back into place.
lib/: Core bot logic and features.commands/: Discord slash commands.data/json/: Persistent JSON data (ignored by Git).scripts/: Maintenance and migration scripts.deployment/: Systemd service templates and legacy start scripts.update_bot.sh: The primary tool for server maintenance.