dronefly-garden / dronefly

Red Discord Bot V3 cogs for naturalists.
Other
16 stars 3 forks source link

user: Allow lookup of user registered to the bot by their login id #110

Closed synrg closed 3 years ago

synrg commented 4 years ago

As per description: anywhere that user is accepted as input, an iNat user id registered to the bot should work as well, except in cases where user indicates an unregistered user (e.g. ,user add). This includes adding users by name to the observation/species/leaf taxa counts tables on taxon & obs embeds.

Do this instead of #90 , since there often isn't room in the Discord nickname to also & it's unlikely many would want to do that anyway.

synrg commented 4 years ago

In this series of commits, the cache of users is now enhanced to ensure a lookup by login id will retrieve any user primed into the cache either by the initial load of all users for the user projects, or by lookup via ,user discord_id: bdbaab2a4567f504819f4885643a59e97b94dd7b a82c821bf5d06bb6109d24fc2ef4f8b045ed2d25 eeadadd8aa1da9c18026596d42a6ebe8dc41f894 (initial commit, & two additional commits fixing regressions discovered after Dronefly had been updated already - oops).

Previously a lookup by login id would have needlessly done a redundant lookup of the user via the API.

To test this feature, as well as providing a way to place unregistered users into the cache, ,iuser <login> was added to lookup iNat users by login regardless of whether they are registered to the bot or not.

Having laid this groundwork, next:

synrg commented 4 years ago

In keeping with our commitment to start adding test coverage to new features, this issue has been selected to be included in that milestone. As the recent regressions in the commit series mentioned above amply demonstrates, continuing to build out more functionality here without tests is risky business.

synrg commented 3 years ago

This is a usability issue for our first public release, so adding it to the project board.

synrg commented 3 years ago

Implemented in 5262985d9c44b8c1ad34b7ae2dfdaa7d8cfa7b1d