Open beanc16 opened 1 day ago
I added the new necessary endpoint to the google-sheets-microservice and added a function to it to the microservice abstraction. Our data contract will end up looking something like this when calling getPageTitles
on the abstraction in order to exclude all data except for the pokemon on a given spreadsheet:
{
"spreadsheetId": "someSpreadsheetId",
"filters": [
{
"type": "case_insensitive_excludes",
"values": [
"Trainer",
"Features",
"Edges",
"Extras",
"Inventory",
"Combat",
" Data",
" Template",
" Skills",
"Pokédex",
"Pokedex",
"Calculations",
"Poke Edges",
"Poké Edges"
]
}
]
}
Though, we'll need to get this data for multiple spreadsheets at a time, so I'll likely go back and make a bulk version of this endpoint as well.
Currently,
pokemon_page_name
in/ptu train
makes you type the name of a pokemon's sheet in order to train the pokemon. However, it assumes you always type it correctly, and some people's sheet names are long, making them inconvenient to type. This could be dramatically improved by making it autocomplete and providing options for users to choose from as they type.The expected workflow would be:
Optionally, consider pre-fetching this on bot startup for early caching. Though, this isn't required since this workflow isn't used as frequently as other between sessions like
/ptu lookup
. However, if it proves too long (3 seconds) to initialize the data on first use of this command without this pre-caching, then this becomes a requirement rather than optional.This will require adding a new endpoint to the google-sheets-microservice for retrieving all page names of a given spreadsheet, and then filtering those down in this service or with payload/query parameters on the new endpoint before then using valid pokemon sheets that meet the autocomplete requirements as potential responses.