Skip to content
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

feat(plugin-roles): new plugin for assigning roles #134

Open
Pkmmte opened this issue Nov 13, 2023 — with Volta.net · 5 comments · May be fixed by #155
Open

feat(plugin-roles): new plugin for assigning roles #134

Pkmmte opened this issue Nov 13, 2023 — with Volta.net · 5 comments · May be fixed by #155
Labels

Comments

Copy link
Member

Pkmmte commented Nov 13, 2023

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 setup displays 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'.
  • 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 restrict for setting command restrictions based on roles.

Changeset: minor (v0.0.0)

@Pkmmte Pkmmte added the plugin label Nov 13, 2023 — with Volta.net
@ArnavK-09
Copy link
Contributor

what would be use of list? like people can choose roles from it?

@Pkmmte
Copy link
Member Author

Pkmmte commented Nov 25, 2023

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!

@ArnavK-09
Copy link
Contributor

ArnavK-09 commented Dec 6, 2023

Shift to #155

@ArnavK-09 ArnavK-09 linked a pull request Dec 8, 2023 that will close this issue
27 tasks
@Pkmmte
Copy link
Member Author

Pkmmte commented Dec 12, 2023

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.
Screenshot 2023-12-11 at 10 16 49 PM
  • The "Edit Embed" is a good replacement for the "Description" outlined. I like it! Let's keep it.
Screenshot 2023-12-11 at 10 18 11 PM
  • There should not be selectors in the primary /roles setup present. Currently there are two selectors present. The "Add" and "Delete" buttons are meant to handle this instead. More on this below.
Screenshot 2023-12-11 at 10 18 45 PM
  • 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)

@ArnavK-09

This comment has been minimized.

@ArnavK-09 ArnavK-09 removed their assignment Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants