You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This works for roles which do not change name over time, but requires manual management for assigning roles that may change by calling /setup again (eg. an @22/23 role).
Proposed Changes
Add an option to have Whodis manage a time-related role. This involves two things:
Whodis will check the existence of, and create roles based on the current date.
Permissions wise, this should already be covered by the Manage roles permission
A role check needs to occur on user verification, as the required role will change after /setup was called.
A method of configuring the role and how it should be updated needs to be provided.
By default this should not be enabled.
There's two ways we could add this:
Option 1
Allow a time format string in role names, in the style of the time command.
This would be easier to implement and flexible, but means that when /setup is called that we need to allow invalid roles as argument(s).
This doesn't have to affect autocomplete, as discord allows bots to provide their own list of completions.
To keep validating roles, it could instead be given a dedicated argument for dynamic roles.
Not all format options need to (or should, eg. seconds level accuracy) be provided.
Option 2
Fix the role as annual, and provide limited options to customise it.
It should check for the current academic year, probably by checking against a config provided cutoff date.
The role itself should be configured through extra arguments in /setup, or with a dedicated command for configuring dynamic roles.
With subcommands, setting up a dynamic role might look something like:
Current behaviour
Currently Whodis takes a few roles and assigns them to a user on verification
whodis/internal/api/verify.go
Lines 124 to 142 in 88bcbc3
This works for roles which do not change name over time, but requires manual management for assigning roles that may change by calling
/setup
again (eg. an@22/23
role).Proposed Changes
Add an option to have Whodis manage a time-related role. This involves two things:
Manage roles
permission/setup
was called.There's two ways we could add this:
Option 1
Allow a time format string in role names, in the style of the time command.
This would be easier to implement and flexible, but means that when
/setup
is called that we need to allow invalid roles as argument(s).Not all format options need to (or should, eg. seconds level accuracy) be provided.
Option 2
Fix the role as annual, and provide limited options to customise it.
It should check for the current academic year, probably by checking against a config provided cutoff date.
The role itself should be configured through extra arguments in
/setup
, or with a dedicated command for configuring dynamic roles.With subcommands, setting up a dynamic role might look something like:
/setup welcome-message [announce-channel] [logging-channel] <given-role-1> <given-role-2>
/setup date-role [date-format] <role-prefix> <role-suffix>
As before, we can provide auto-completions for the date formats, and don't have concerns with overloading existing arguments or commands.
The text was updated successfully, but these errors were encountered: