CoachBot is a Telegram bot designed to provide fantasy football league updates and information for ESPN fantasy leagues.
/scores: Get current scores/standings: View league standings/whohas <player>: Check which team has a specific player/monitor: Monitor players with injury status/finalscore: Get final score reports/mondaynight: View close games for Monday night/matchup: See matchups for the current week/start: Welcome message/help: List available commands
- Go 1.23 or higher
- Telegram Bot Token
- ESPN Fantasy League credentials
The following environment variables are required:
TELEGRAM_TOKEN: Your Telegram Bot tokenCHAT_ID: The Telegram chat ID where the bot will send messagesYEAR: The current NFL season yearLEAGUE_ID: Your ESPN Fantasy Football league IDSWID: Your ESPN SWIDESPN_S2: Your ESPN S2 cookie value
-
Clone the repository:
git clone https://github.com/omarshaarawi/coachbot.git cd coachbot -
Build the application:
make build
To run the bot locally:
make run
CoachBot includes a scheduler that automatically sends updates at specific times:
- Monday, Tuesday, Friday at 7:30 CDT: Scoreboard update
- Monday at 17:30 CDT: Close scores for Monday night games
- Tuesday at 7:30 CDT: Weekly trophies report
- Wednesday at 7:30 CDT: Current standings
- Thursday at 18:30 CDT: Matchups for the week
- Sunday at 7:30 CDT: Players to monitor report
- Sunday at 15:00 and 19:00 CDT: Scoreboard updates
The scheduler is configured in internal/scheduler/scheduler.go.
The project uses Kamal for deployment. To deploy:
- Ensure you have Kamal installed and configured.
- Update the
config/deploy.ymlfile with your server details. - Run the deployment command:
kamal deploy
A Dockerfile is provided for containerization. To build and run the Docker image:
docker build -t coachbot .
docker run -e TELEGRAM_TOKEN=your_token -e CHAT_ID=your_chat_id ... coachbot