A Discord bot for sending sports notifications, made in Python. A message is sent notifying users in a channel when an almost-completed sports game has a close score between the teams. 98% umpball-free. The last 2% is the hardest to get. That's why they leave it in the milk.
- Install git and docker-compose.
- Clone the repo.
git clone https://github.com/wazam/discord-sports-notification.git
- Change to the current working directory.
cd ./discord-sports-notification
- Add your Discord bot's
secret_token
and Server'schannel_ID
to the environment section of thedocker-compose.yml
file. - If you want to change these default values, then modify them by adding additional environment variables to the
docker-compose.yml
file. - Run the
docker-compose.yml
file to build and run the app.
docker-compose up -d
---
version: "3"
services:
app:
image: ghcr.io/wazam/discord-sports-notification:main
container_name: discord-sports-notification
environment:
- DISCORD_SECRET_TOKEN={{YOUR_VALUE}}
- DISCORD_CHANNEL_ID={{YOUR_VALUE}}
- Enable the Discord bot's privileged intents in dev portal settings.
- Add the bot to your server with the proper permissions.
help
list of all commandsgames
ortoday
amount of sports games todaybaseball
ormlb
list of mlb games todaybasketball
ornba
list of nba games todayweather
{{your zip/post code or city/area name}}
current weather conditions
- DISCORD_SECRET_TOKEN={{YOUR_VALUE}}
- Discord Bot's Client Secret Token (from Developer Portal).
- DISCORD_CHANNEL_ID={{YOUR_VALUE}}
- Discord Text Channel ID (right-click, "Copy ID").
- BOT_REFRESH=300
- Set the interval in seconds to scrape game information for notification conditions.
- BOT_PREFIX=!
- Set the command prefix to be used for the bot, in between the quotation marks.
- Slash commands are available by default now for the bot.
- NBA_ENABLED=True
- Enable/Disable support for NBA notifications.
- NBA_PERIOD=4
- Set the earliest period that a notification can activate for.
- Notification is not sent if period in game is less than this number.
- NBA_PT_DIFFERENTIAL=5
- Set the highest point differential between the teams that a notification can activate for.
- Notification is not sent if point differential between teams is higher than this number.
- NBA_MINS_LEFT=4
- Set the last minutes that a notification can activate for.
- Notification is not sent if remaining minutes in period is more than this number.
- MLB_ENABLED=True
- Enable/Disable support for MLB notifications.
- MLB_INNING=9
- Set the earliest inning that a notification can activate for.
- Notification is not sent if inning is less than this number.
- MLB_RUN_DIFFERENTIAL=1
- Set the highest run differential between the teams that a notification can activate for.
- Notification is not sent if run differential is higher than this number.
- MLB_BASERUNNERS='RISP'
- Set the minimum amount of baserunners that a notification can activate for.
- Notification is not sent until this situation occurs on the bases.
- Options: 'RISP' for 2nd/3rd, 'Men_On' for 1st, 'Empty' for no requirement.
- OPENWEATHERMAP_API_KEY={{YOUR_VALUE}}
- Free weather API by OpenWeather with account registration. Required for the weather command.
- TZ=America/New_York
- Sets localtime for bot based on prefered tz name.
League | Available | Planned |
---|---|---|
NBA (National Basketball Association) | ✅ | |
MLB (Major League Baseball) | ✅ | |
NFL (National Football League) | ❌ | ✅ |
NHL (National Hockey League) | ❌ | ✅ |
NCAA Men's Baseball | ❌ | ❌ |
NCAA Men's Basketball | ❌ | ❌ |
NCAA Football | ❌ | ❌ |
MLS (Major League Soccer) | ❌ | ❌ |
EPL (English Premier League) | ❌ | ❌ |