dronefly-garden / dronefly

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

user: User display & management commands #48

Closed synrg closed 4 years ago

synrg commented 5 years ago

Provide a command group with subcommands to link a server member's Discord login & iNaturalist login. Initially, provide:

[p]inat useradd [discord-user] [inat-user]
[p]inat userdel [discord-user]
[p]inat usershow [discord-user]

The discord-user parameter uses the discord.User converter so that the username can be pasted without @ so they are not mentioned when the command is executed. That will be useful to us when adding users off-channel. Otherwise, specifying @ when we add them publicly on #inat-profiles is fine as we want them to know they have been added, and Discord client will help make sure the name is correctly specified. When done without @ the argument needs to be enclosed in double-quotes if it contains blanks.

The inat-login parameter should accept either login, #, or link to their profile. It should not accept partial match on a name, as the chance for human error is too great.

synrg commented 5 years ago

Initial work on this is complete. There is now a user config storing the relationship between the Discord id# and the iNat id#.

A mod-only inat userlist command to list all users known to the bot, flagging with emoticons various states (member of server, member of the various projects, etc.) is desirable.

Additional reaction-button-based helpers are desirable on an individual user's record to help either do Discord actions (like adding a role) or emit a link to do iNaturalist actions (like updating project membership). The same command available to users (inat usershow) could provide to mods these reaction buttons.

synrg commented 4 years ago

Idea: follow https://www.inaturalist.org/pages/api+reference#authorization_code_flow to support verified user add (i.e. user authenticates as iNat to add themselves, rather than having a moderator intervene).

synrg commented 4 years ago

The auth code flow should be split to its own issue. This issue will remain open until these problems with the initial code are resolved:

synrg commented 4 years ago

Feature is now complete. Enhancements to follow as separate issues.