Giter Site home page Giter Site logo

jpmoura / telegram-nfl-fantasy-bot Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 1.0 1.56 MB

A Telegram bot that provides the latest news about the NFL

License: MIT License

TypeScript 98.48% Dockerfile 0.71% JavaScript 0.81%
telegram-bot telegram nfl news nodejs fantasy-league bot newsapi twitter rotowire

telegram-nfl-fantasy-bot's Introduction

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.

telegram-nfl-fantasy-bot's People

Contributors

dependabot[bot] avatar jpmoura avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

jayconverge

telegram-nfl-fantasy-bot's Issues

Error during startup

Error related to using multiple instances of NEDB datastore for the same file.

Project refactoring

The project need a refactoring to improve its maintainability. Configuration blocks can be extracted to another domain, also utility functions.

Each consumer must have its own module and its responsibility needs to be better delimited.

Persist chats IDs

Build a way to store the chats IDs so the bot doesn't loses all the clients already connected

[BUG] Duplicated news

Sometimes when the volume of news reach its peak (e.g. after a round) the bot send the same news multiple times

Dockerfile for easy deploy

Creation of a Dockefile that allows any person interested to have your own bot a easy and fast deploy of it

Create GitHub Actions

Add actions for PRs and commits on master branch to run Sonar (SonarCloud) analysis

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.