This project consists of a Discord bot that interacts with the League of Legends API to provide information about players' win streaks and game stats. It includes two main components:
-
Bot Functionality (
main.py
): A Discord bot written in Python using thediscord.py
library. The bot connects to your Discord server, listens to events, and responds to user commands with information from the League of Legends API. -
Win Streak Tracker (
detectStreak.py
): A backend script responsible for monitoring players' win streaks. It interfaces with theriotApi.py
module to fetch player data, calculates win streaks, and updates a SQLite database (my_database.db
) located in themodules
directory with the streak information.
interTrackerConda/
│
├── modules/
│ ├── init.py
│ ├── databaseFunctions.py
│ ├── riotApi.py
│ └── my_database.db
│
├── main.py
├── config.py
├── detectStreak.py
├── environment.yml
└── .gitignore<br>
- The
modules
directory contains modules for interfacing with the League of Legends API (riotApi.py
) and managing the database (databaseFunctions.py
). The SQLite database (my_database.db
) for win streak information is also located in this directory. - The root directory holds files related to the Discord bot, including the main bot script (
main.py
), configuration settings (config.py
), a script to track win streaks (detectStreak.py
), the environment file (environment.yml
), and the.gitignore
file.
-
Clone this repository to your local machine.
-
Set up a Python virtual environment and activate it.
-
Install project dependencies from the
environment.yml
file:conda env create -f environment.yml conda activate your_environment_name
-
Set up your Discord bot on the Discord Developer Portal.
-
Copy config.example.py to config.py and fill in your Discord bot token.
-
Run the Discord bot and the win streak tracker in separate terminal sessions from the root directory:
python main.py python detectStreak.py
- The Discord bot responds to user commands with information about win streaks and game stats. Use !help to see available commands.
- The win streak tracker (detectStreak.py) automatically updates the database with win streak information for tracked players.
Contributions are welcome! Feel free to open issues, submit pull requests, or suggest improvements.
This project is licensed under the MIT License.