Skip to content

A Telegram bot that provides the latest news about the NFL

License

Notifications You must be signed in to change notification settings

jpmoura/telegram-nfl-fantasy-bot

Repository files navigation

NFL & Fantasy News Bot for Telegram 🏈🤖

Quality Gate Status Bugs Code Smells Coverage

This is a Telegram bot that provides the latest news about the NFL powered by RotoWire and Twitter accounts and about one NFL Fantasy league at your choice. The bot will fetch info about the NFL and the fantasy league every minute and then it will send to all clients that allowed the bot to do so.

My motto to create this bot came from my frustration to find a reliable service that notifies me about things related to the league. I wanted to know about any player of all teams as soon as possible because I'm a fantasy aficionado and information can be translated into fantasy points in this case.

Requirements

The only requirement it is at least a Node version that bundles the promisify utility (i.e. Node 12)

Using the bot

In order to use this bot you need to create a .ENV file with two specific keys:

  • BOT_TOKEN: refers to the bot API token, which one you can get from @BotFather;
  • TWITTER_CONSUMER_KEY: refers to the key of your Twitter client;
  • TWITTER_CONSUMER_SECRET: refers to the secret token of your Twitter client;
  • TWITTER_ACCOUNTS: refers to the accounts from Twitter you wanna get tweets from;
  • FANTASY_LEAGUE_ID: refers to the ID of your fantasy league.

You will need to apply for a key in Twitter. After set this .ENV file with these five keys, just run the command yarn && yarn tsc && yarn start.

This bot was built on top of NodeJS v14.

Disclaimer

If you plan to serve this bot to different users and not just for yourself you gonna probably will need a Privacy Police

TODO

  • Automatized tests that covers at least 80%;
  • Persist the chat ids;
  • More elegant message about Fantasy League transactions;
  • Allow to add more than one fantasy league to update about it.
  • Aggregate posts from NFL @ Instagram;
  • Add Web User Interface to set the tokens and leagues ids;
  • Dockerfile aiming a simple way to deploy the bot.
  • Aggregate tweets from @NFLResearch for real time statistics about the games
  • Build a more elegant message, possibly using MarkDown instead using images with caption.