khakers / modmail-viewer

An advanced web frontend for the modmail discord bot with built in Discord OAuth2 authentication, and support for browsing and searching current and historical logs. Directly replaces logviewer.
MIT License
10 stars 4 forks source link

Support role ids for Modmail roles/auth #35

Closed svemat01 closed 1 year ago

svemat01 commented 1 year ago

Add support for checking if a user is part of any Discord role ids that are set as Modmail Roles (Supporter, Adminstrator etc...)

khakers commented 1 year ago

Will start implementing this after I've got the current frontend changes in a mostly stable state to build off of. Hopefully will be able to make it into the next release.

For my future reference:

It looks like adding the guilds.members.read scope will allows us to use the /users/@me/guilds/{guild.id} endpoint to retrieve the roles the user has and match them against the allowed roles.

khakers commented 1 year ago

Just pushed an initial implementation of this to the develop branch (if you decide to test this, be aware that develop currently has a substantial number of changes awaiting v0.6.0). There are some quirks to document about the implementation of this feature that users should be aware of:

martinbndr commented 1 year ago

Could you move or add the abillity to check role/user whitelist on the ?oauth command of modmail. It is patreon only but the bot still saves the whitelist in the db so this could be used instead of the modmail perm levels. Or make us choose what whiltelists we would like to use maybe?

khakers commented 1 year ago

Could you move or add the abillity to check role/user whitelist on the ?oauth command of modmail. It is patreon only but the bot still saves the whitelist in the db so this could be used instead of the modmail perm levels. Or make us choose what whiltelists we would like to use maybe?

Hey @martinbndr, this is out of scope for this issue (and it's now closed), could you make a new issue for this?