README generated by GPT.
A Discord bot for managing Formula 1 race predictions, leaderboards, and race history in your server. Users can submit their top 5 driver predictions for each race, view their own and others' predictions, and see a points-based leaderboard. Admins can manage prediction rounds and the driver roster.
- Prediction Rounds: Admins start and end prediction rounds for each race.
- User Predictions: Users submit their top 5 driver predictions using slash commands.
- Leaderboard: Points are awarded based on prediction accuracy, and a leaderboard is maintained.
- Race History: View completed races and detailed results.
- Driver Management: Admins can add or remove drivers from the roster.
- Persistent Storage: All data is saved in JSON files.
-
/predict pos1 pos2 pos3 pos4 pos5
Submit your top 5 driver predictions (by driver number). -
/my_prediction
View your current prediction for the active race. -
/status
Check if there's an active prediction and who has submitted. -
/leaderboard
View the overall points leaderboard. -
/race_history
List all completed races. -
/race_history_details race_name
View details for a specific completed race. -
/list_drivers
List all available drivers and their numbers. -
/help
Show help and usage instructions.
-
/start_prediction race_name
Start a new prediction round. -
/end_prediction pos1 pos2 pos3 pos4 pos5
End the prediction round and submit actual results (by driver number). -
/add_driver number name
Add a driver to the roster. -
/remove_driver number
Remove a driver from the roster. -
/clear_prediction
Force clear the active prediction.
git clone https://github.com/yourusername/f1-prediction-BOT-Discord.git
cd f1-prediction-BOT-Discord
pip install -r requirements.txt
Create a .env
file in the project root with your Discord bot token:
DiscordAPIToken=YOUR_DISCORD_BOT_TOKEN
Never commit your .env
file or bot token to version control!
python main.py
f1_predictions.json
— Stores predictions, leaderboard, and race history.drivers.json
— Stores the list of available drivers..env
— Stores your Discord bot token (not tracked by git).
See drivers.json
for the current roster. Add or remove drivers using the admin commands.
Points are awarded for each predicted driver based on how close their predicted position is to the actual result:
- Exact position: 10 points
- 1 position off: 7 points
- 2 positions off: 5 points
- 3 positions off: 3 points
- 4 positions off: 1 point
Created by Angelo Alexander.
Inspired by the excitement of Formula 1!