rmbarron / ironforgedbot Goto Github PK
View Code? Open in Web Editor NEWA bot for managing clan rankings and ingots in the Iron Forged Runescape Clan.
License: MIT License
A bot for managing clan rankings and ingots in the Iron Forged Runescape Clan.
License: MIT License
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.
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.
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.
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.
Members have ranks applied based on:
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:
Member
object needs to have a new attribute "rank".We've made a number of improvements since the initial commits. We should document:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.