[![GitHub release](https://img.shields.io/github/v/release/dtcarls/fantasy_football_chat_bot)](https://github.com/dtcarls/fantasy_football_chat_bot/releases/latest/)
![Test workflow](https://github.com/dtcarls/fantasy_football_chat_bot/actions/workflows/ci.yaml/badge.svg)
![Publish workflow](https://github.com/dtcarls/fantasy_football_chat_bot/actions/workflows/publish_image.yaml/badge.svg)
For troubleshooting and release notifications, join the discord!
[![Discord Banner 2](https://discordapp.com/api/guilds/878995504225218620/widget.png?style=banner2)](https://discord.gg/VFXSkcgjxh)
Like the bot? Star the repository and consider making a donation to buy me a coffee
------
* PayPal:
[![paypal](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=ZDLFECJVGG6RG¤cy_code=USD&source=url)
* BTC: bc1q3wxm269mdmwdqjqkxgt7s5zp8ah05dexdua0zv
* ETH: 0x8c096710e3621fe5f8E384efBd17D8E3E798Dc0c (Cryptik.eth)
* DOGE: D6n2g2KGdqEwR4MhhT7uAdvZFaTwqwd6rS
* Venmo: @dtcarls
# ESPN Fantasy Football GroupMe Slack and Discord Chat Bot
This repository runs a GroupMe, Discord, or Slack chat bot to send ESPN Fantasy Football information to a GroupMe, Discord or Slack chat room.
**What does this do?**
Schedule Link: https://www.gamedaybot.com/message-schedule/
- Sends out the following messages on this schedule:
- Close Scores - Mon - 18:30 east coast time (Games that are within 16 points of eachother to keep an eye on during the Monday night game)
- Scoreboard - Mon,Tue,Fri - 7:30 local time (Current ESPN fantasy scoreboard)
- Trophies - Tue - 7:30 local time (High score, low score, biggest win, closest win)
- Power rankings - Tue - 18:30 local time
- Current standings - Wed - 7:30 local time
- Waiver report - Wed - 7:30 local time
- Matchups - Thu - 19:30 east coast time (Upcoming matchups)
- Players to Monitor report - Sun - 7:30 local time (Players in starting lineup that are Questionable, Doubtful, or Out)
- Scoreboard - Sun - 16:00, 20:00 east coast time (Current ESPN fantasy scoreboard)
Table of Contents
=================
* [Setting up GroupMe, Discord, or Slack, and deploying app in Heroku](#setting-up-groupme-discord-or-slack-and-deploying-app-in-heroku)
* [GroupMe Setup](#groupme-setup)
* [Slack setup](#slack-setup)
* [Discord setup](#discord-setup)
* [Heroku setup](#heroku-setup)
* [Private Leagues](#private-leagues)
* [Troubleshooting / FAQ](#troubleshooting--faq)
* [Getting Started for development and testing](#getting-started-for-development-and-testing)
* [Installing for development](#installing-for-development)
* [Environment Variables](#environment-variables)
* [Running with Docker](#running-with-docker)
* [Running without Docker](#running-without-docker)
* [Running the tests](#running-the-tests)
:cold_sweat::cold_sweat::cold_sweat:
**All of this look too complicated and confusing? Don't know what a "Heroku" is? Consider checking out https://www.GameDayBot.com/ where I offer a hosting service and do my best to minimize complexity.**
:cold_sweat::cold_sweat::cold_sweat:
## Setting up GroupMe, Discord, or Slack, and deploying app in Heroku
**Do not deploy 2 of the same bot in the same chat. In general, you should let your commissioner do the setup**
### GroupMe Setup
<details>
<summary>Click to expand!</summary>
Go to www.groupme.com and sign up or login
If you don't have one for your league already, create a new "Group Chat"
![](https://i.imgur.com/32ioDoZ.png)
Next we will setup the bot for GroupMe
Go to https://dev.groupme.com/session/new and login
Click "Create Bot"
![](https://i.imgur.com/TI1bpwE.png)
Create your bot. GroupMe does a good job explaining what each thing is.
![](https://i.imgur.com/DQUcuuI.png)
After you have created your bot you will see something similar to this. Click "Edit"
![](https://i.imgur.com/Z9vwKKt.png)
This page is important as you will need the "Bot ID" on this page.You can also send a test message with the text box to be sure it is connected to your chat room.
Side note: If you use the bot id depicted in the page you will spam an empty chat room so not worth the effort
![](https://i.imgur.com/k65EZFJ.png)
</details>
### Slack setup
<details>
<summary>Click to expand!</summary>
Go to https://slack.com/signin and sign in to the workspace the bot will be in
If you don't have one for your league already, create a new League Channel
Next we will setup the bot for Slack
Go to https://api.slack.com/apps/new
Name the app, and choose the intended workspace from the dropdown.
Select the Incoming Webhooks section on the side.
![](https://i.imgur.com/ziRQCVP.png)
Change the toggle from Off to On.
Select Add New Webhook to Workspace
![](https://i.imgur.com/tJRRrfz.png)
In the Post to dropdown, select the channel you want to send messages to, then
select Authorize.
This page is important as you will need the "Webhook URL" on this page.
![](https://i.imgur.com/mmzhDS0.png)
</details>
### Discord setup
<details>
<summary>Click to expand!</summary>
Log into or create a discord account
Go to or create a discord server to receive messages in
Open the server settings
![](https://i.imgur.com/bDk2ttJ.png)
Go to Webhooks
![](https://i.imgur.com/mfFHGbT.png)
Create a webhook, give it a name and pick which channel to receive messages in
![](https://i.imgur.com/NAJLv6D.png)
Save the "Webhook URL" on this page
![](https://i.imgur.com/U4MKZSY.png)
</details>
### Heroku setup
**"November 28, 2022, Heroku stopped offering free product plans"**
I offer a hosting service far lower than the new costs of Heroku at https://www.GameDayBot.com/
<details>
<summary>Click to expand!</summary>
Heroku is what you can use to host the chat bot.
Go to https://id.heroku.com/login and sign up or login
:warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning:
:rotating_light:**Click this purple button to automatically deploy the code:**:rotating_light:
[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy)
:warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning:
Go to your dashboard (https://dashboard.heroku.com/apps)
Now you will need to setup your environment variables so that it works for your league. Click Settings at your dashboard. Then click "Reveal Config Vars" button and you will see something like this.
![](https://i.imgur.com/7a1V6v8.png)
Now we will need to edit these variables (click the pencil to the right of the variable to modify)
Note: App will restart when you change any variable so your chat room may be semi-spammed with the init message of "Hi" you can change the INIT_MSG variable to be blank to have no init message. It should also be noted that Heroku seems to restart the app about once a day
See [Environment Variables Section](#environment-variables) for documentation
After you have setup your variables you will need to turn it on. Navigate to the "Resources" tab of your Heroku app Dashboard.
You should see something like below. Click the pencil on the right and toggle the buton so it is blue like depicted and click "Confirm."
![](https://i.imgur.com/J6bpV2I.png)
You're done! You now have a fully featured GroupMe/Slack/Discord chat bot for ESPN leagues! If you have an INIT_MSG you will see it exclaimed in your GroupMe, Discord, or Slack chat room.
Unfortunately to do auto deploys of the latest version you need admin access to the repository on git. You can check for updates on the github page (https://github.com/dtca