This is a discord bot to scrape games from hockey league websites in the PNW.
Clone the repo
I hope you can figure this out
python -m venv .venv
pip install -r requirements.txt
It's good practice to avoid uploading credentials to github, so I've included them in a file called credentials.py and added it to .gitignore. If you would like to get this running on your machine, create a file that looks like this with the token from step 3 above:
prod_token = 'prod_token_here'
test_token = 'prod_token_here'
open_ai_key = 'open_ai_key_here'
mongo_password = 'mongo_password_here'
admin = ["discord_name1", "discord_name2"]
source .venv/bin/activate
python main.py
On startup, your bot should come online on your discord server and you should see some prints similar to:
2024-06-13 10:27:03 INFO discord.client logging in using static token
2024-06-13 10:27:04 INFO discord.gateway Shard ID None has connected to Gateway (Session ID: d7687f87s6d876876df87).
!help
Currently, this bot makes quite a few requests to websites with a big list of teams, so sometimes it gets rate limited.
In order to make testing smoother, there is a TEST_MODE which doesn't make any requests to websites and instead reads
from a sample KHL HTML txt in samples/. To use this, set TEST_MODE=True
in globals.py and test with
!schedule jarrett
(or your favorite command).
If you have any questions, feel free to message jschultz38