Giter Site home page Giter Site logo

ironforgedbot's People

Contributors

bennettsf avatar rmbarron avatar vkorn avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

bennettsf incinn

ironforgedbot's Issues

Error When Hiscore Response is Unexpected Length

The Runescape hiscores API is a product of its time. Instead of returning json or a dictionary, it returns an ordered list of items. This has a side effect that, every time there is an update, we need to update the list of skills / activities to avoid /score & /breakdown responses being inaccurate.

Since, at a particular version, we know exactly how long the response should be, we should error out if the response doesn't match that length. Then we just print a message to the user that the response has changed and the bot needs to be updated.

This will make for a much more consistent experience than wondering if something has broken if your score suddenly doubles.

/addingotsbulk should respond with full text in a file.

The response in interaction.followup.send has a character limit. When getting called with many users, its possible for full output to not fit in the response.

We can get around this by making the full output a text file, and supply the file in the response (similarly to how /breakdown output is returned). We can use a separate new directory, addingotsbulk_tmp/, and use the caller name as the filename to prevent output trampling.

/syncmembers could run daily as a background thread.

In moving from the javascript bot, the biggest behavior change was that storage isn't kept in sync with Discord automatically. Now, /syncmembers needs to be periodically called manually.

We could put this in a background thread that runs every x many hours. This should be turned on or off by a flag.

We'll need to do some refactoring of syncmembers to not have the discord interaction in the signature (because the batch one wouldn't be getting called from discord). We could have the new function simply raise an exception for the various exit cases, which the wrapping function connecting to discord could use to respond with the right message.

_log_change Should Append to Sheet

https://github.com/rmbarron/IronForgedBot/blob/main/ironforgedbot/storage/sheets.py#L210

For compatibility with the existing sheet, we prepend new changes into the changelog. However, this makes adding any new row require rewriting the entire sheet.

Instead, we should append new rows to the end of the changelog, ideally without even doing a read. https://developers.google.com/resources/api-libraries/documentation/sheets/v4/python/latest/sheets_v4.spreadsheets.values.html#append may be an existing method we can call to do this without first doing a read.

Add "rank" to Storage Model

Members have ranks applied based on:

  • Being in an explicit leadership role OR
  • Based on the score from /score output

We should add the rank to the storage model. There are times when event organizers want to view members grouped by rank and ordered by ingots. Notably, this makes organizing for bingo easier.

The rough order of things that need to happen:

  • A new column D "rank" needs to be added in sheets. This is the equivalent of pushing a schema change separate from the feature that uses it.
  • The Member object needs to have a new attribute "rank".
  • syncmembers should diff the entire member object if it doesn't already.
  • The write should be updated to write the rank into storage as part of syncmembers.

Documentation Improvements

We've made a number of improvements since the initial commits. We should document:

  • The storage interface.
  • Expected storage schema.
  • Requirements for users to be read into storage.
  • Expected setup of roles in the discord server.

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.