-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Role management #294
base: main
Are you sure you want to change the base?
Role management #294
Conversation
This adds a `role-management` to Valkyrie which allows you to call the function on another script to add/remove roles based on the following criteria: - guildID (Discord server ID) - memberID (Discord user ID) - roleID (Discord role ID) - action (add or remove)
Marking this one as ready to review, so we can merge and built out additional features discussed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dropped a couple of thoughts but my first reaction is this helper doesn't make sense (yet?) and we might want to skip this PR and pull a helper back in when there's something concrete being repeated that we're trying to reuse/abstract.
@@ -0,0 +1,34 @@ | |||
import { Client } from "discord.js" | |||
|
|||
export default async function manageRole( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would add this as an unexported helper to the renamed role-management
script from #293 . If we do move to a directory for role management due to complexity, this can end up in a helpers
file or similar.
guildId: string, | ||
memberId: string, | ||
roleId: string, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not convinced we'll find ourselves wanting to do this without having handles to at least the guild and maybe member objects already... For example, the first use we're pondering, which would be in reaction to the guildMemberAdd
event, would receive a GuildMember
already—allowing us to bypass most of the steps here.
Notes
This adds a
role-management.ts
to Valkyrie which allows you to call the function on another script to add/remove roles based on the following criteria:Additional features
Whether we would like to include additional functionality into this PR such as invite management, role triggers, etc.