Giter Club home page Giter Club logo

pugbot's People

Contributors

itsananth avatar jytesh avatar kevalpithadiya avatar psiaphex avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

psiaphex

pugbot's Issues

Attaching the Pickups structure directly to the CommandoClient

Attaching the Pickups class to the CommandoClient can reduce the complexity regarding updating cache and accessing active games through separate scopes. The Pickups instance, attached as a property, remains consistent throughout (afaik). Also, it makes the instance easy-to-access in commands because the Client itself is attached to the Command Message.

I've used the Client instance to transfer a database instance before with a custom implementation of discord-js. However, I have never used Commando and thus am not sure if this would work flawlessly.

Match IDs are broken again

PickupsManager is not updating count correctly, DB and cache are out of sync and cache is mostly null?

Implement more functionalities through classes - Something to work on before moving to ELO

  1. Add a user property to Pugger class to store a Discord.User instance for the pugger. (Helpful in DMing on game start and stuff)
  2. Instead of just passing the channel ID, use Game.channel and Pickups.channel to store a complete Discord.TextChannel. (Useful for the next step)
  3. Implement the readyHandler and matchMaker as methods of the Game class. (Makes it easier to access handlers without having to import dependencies

I won't be able to work much on the bot myself due to exams and stuff so I'll just try to point out stuff in which things can be made better :P

Edit:
4) Also store Pugger instances instead of IDs in Game.members, Game.notReadyMembers and Game.teams.

Global Elo

Implement elo keyrings and global elo based trueskill matchmaking

Need to work out a more consistent and reliable method to import and pass structures, util functions and handlers

I was trying to work on implementing the User class in the bot but I kept running into circular dependencies. This was even more confusing to figure out because of the mess of require functions in each file. Thus, we need to find a better way to pass and import these things from files.

I was thinking about initializing the structures in app.js by requiring their modules. Then passing them down through the Client. So we can access them directly through discord.js based classes and also import them directly from a single file when needed. However I'm kind of lost on how we should initialize the structures, as many depend on each other.

Or suggest any other method to avoid circular dependencies crashing the bot.

Ranked and ELO

Support match reporting, change elos add rank commands and leaderboard.

Maps

Bot suggests map if maps are configured

Rework command parsing

Commando is too bloated and uses way too much memory for our use case, so its better to make our own command parser.

No way to differentiate and update pickup options which are inherited from a channel

The current system of serializing Pickups data simply inherits channel default options and then overrides them with additional configuration specific to that Pickups and then stores it as a property. However, this provides no way to update inherited properties without reloading the cache from the database.

I could figure out two possible ways to tackle this issue -

First, where we make changes to the Class structures where we use getters to dynamically return a Pickup's configuration. This will require storing the channel default options separately.

Second, we directly update the database when changes are made to channel options and then execute an update from database method on all Pickups instances which inherit from that channel, only updating necessary properties instead of serializing the whole data into Pickups instances.

I need suggestions and opinions about which one to use or if any other more efficient and simpler method can be used.
This also calls for the need to store pickup channel data in a more structured and meaningful manner like having its own class.

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.