feat(plugin-roles): new plugin for assigning roles
This issue outlines the development of a new /roles plugin for the Robo.js framework in Discord.js. The focus is on creating an intuitive and efficient system for role management within a Discord server, integrating commands like /roles setup and /roles restrict.
Detailed Breakdown:
1. /roles setup Command:
-
Initial Interface:
- Triggering
/roles setupdisplays a list of existing role to emoji/description mappings for the guild, akin to the one published for actual users. - Includes interactive buttons for functionalities: 'Add', 'Edit', 'Delete', and 'Description'.
- Triggering
-
Functionalities:
-
Add Button:
- Opens an emoji selector for choosing an emoji for the new role.
- Follows with an ephemeral confirmation message.
-
Edit Button:
- Initiates an emoji selector to change the emoji for an existing role.
- Leads to an ephemeral message for confirmation.
-
Delete Button:
- Offers a selector to choose which role mapping to remove.
- Concludes with an ephemeral confirmation message.
-
Description Button:
- Triggers a modal for editing the description message associated with role mappings.
-
-
Final Step - 'Print' Button:
- Presents an ephemeral message with a channel selector for the server owner to choose where to send the updated roles message.
- Includes a submission button to finalize the action.
- The roles list auto-updates when changes are made.
- The Robo is to automatically include the emote in the printed message for other users to use.
- If an emote outside of the ones specified is used, it is automatically removed. This will is done both in real time as well as when “ready” event is called to ensure its always valid.
[ PLACEHOLDER - Example role list message image]
2. /roles restrict Command:
-
Purpose:
- Serves as a utility for managing permissions and moderation by restricting certain commands to specific roles.
-
Implementation:
- Introduces a slash command
/roles restrictfor setting command restrictions based on roles.
- Introduces a slash command
Changeset: minor (v0.0.0)
what would be use of list? like people can choose roles from it?
what would be use of list? like people can choose roles from it?
Yes. It'd be one of those common "choose an emote to get the role" kind of thing. I figured it's such a common use case that we might as well support it officially!
Shift to #155
Alright, so I just checked it out and found a few things to note:
-
Buttons for "Add", "Edit", and "Delete" are missing. These should show alongside the "Publish" button already present.
-
The "Edit Embed" is a good replacement for the "Description" outlined. I like it! Let's keep it.
-
There should not be selectors in the primary
/roles setuppresent. Currently there are two selectors present. The "Add" and "Delete" buttons are meant to handle this instead. More on this below. -
We should be able to use even custom server emotes, not just default system emotes. This is very important. Since you brought up the concern about selectors having a 25 choice limit, let's do this instead:
- Clicking on "Add" should have the bot reply with a non-ephemeral message (due to reaction limits). This message should contain a role selector to choose only one role, along with instructions telling the user to react to the message with an emote to use for the role. This can be done either before or after the role selector is used.
- The idea is that admins/mods would use this in a private channel, but let's add safety measures anyway in case it's done publicly. Make sure only the person that clicked on "Add" can react or use the role selector. For reactions, if the user is not the same person that triggered it, the reaction should be removed.
- Once a role is selected and a reaction is added, the bot should apply these to the saved emotes and auto delete the message they just reacted on. If there's no activity for 10 minutes, the message gets removed anyway to prevent spam.
-
The "Delete" button should also create a message similar to "Add". Either selecting a role or reacting with an emote removes that entry and causes the message to self-destruct.
-
If you'd like, you can remove the "Edit" button altogether since the same can be achieved by "Delete" followed by "Add" anyway.
-
"Publish" has a small typo. Currently says "Publush Setup!".
-
When the "Publish" button is pressed, the bot should reply with an ephemeral message containing a channel selector. This allows an admin/moderator to do the entire setup in a private channel while publishing it to a public channel of their choice.
-
Server users should be able to pick a role by adding a reaction, not using a selector. This is an important requirement as it follows an already-established pattern.
Sorry if I wasn't more clear in the GitHub Issue. I look forward to seeing this fully completed. We've been getting more traffic to our blogs lately so I'd love to write an article about this plugin! (& giving you credit, of course)
When the "Publish" button is pressed, the bot should reply with an ephemeral message containing a channel selector. This allows an admin/moderator to do the entire setup in a private channel while publishing it to a public channel of their choice
Noted, would update soon after we solve add debate