GithubHelp home page GithubHelp logo

gymbot's Introduction

gymbot's People

Contributors

suneradich avatar

Watchers

James Cloos avatar  avatar

gymbot's Issues

Refactor to use Cyanide API instead of GoblinSpy

If and when we get access to fetch data directly from Cyanide, we can update the fetch logic. Hopefully this can be done with a REST api, so we no longer have to use a webscraper.

If we can do this switch, we can remove the nodejs-web-scraper dependency.

Refactor add logic for new matches

Currently the logic finds in the database first, and then goes along to add, that logic can be simplified using a logic similar to this

await Promise.all(
    a.map(async (standing) => {
      logger.info(standing.idstanding, 'standig');
      // The selection criteria to find the record
      const filter = {
        idstanding: standing.idstanding,
      };

      // Fields to select when querying the database
      const projection = 'idstanding';

      // Find the document
      StandingsModel.findOne(filter, projection, (error, result) => {
        if (!error) {
          // If the document doesn't exist
          if (!result) {
            logger.info(
              `Creating new standing model for ${standing.idstanding}`
            );
            // Create it
            result = new StandingsModel(standing);
          }
          // Save the document
          result.save((error) => {
            if (!error) {
              logger.info('no error');
              // Do something with the document
            } else {
              logger.error(error, 'some error');
              throw error;
            }
          });
        } else {
          logger.error(error);
        }
      });
    })
  );

Add help command

To show the available commands, and how to use the bot

Since the commands show up pr. default when you do / in the chat, this is maybe not as important?

As a coach I want to see dice statistics

The stats could be for each match, or it could be for each competition.

The reason is to see if someone really is cursed by back luck, or if it is in fact evened out.

Prepare for BB3

Will BB3 use same data api as the current? Will GoblinSpy keep working?

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.