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

Adding a command to add reactionroles. #81

Open
WaldperlachFabi opened this issue Jan 18, 2022 · 1 comment
Open

Adding a command to add reactionroles. #81

WaldperlachFabi opened this issue Jan 18, 2022 · 1 comment

Comments

@WaldperlachFabi
Copy link

Can you add a command like !radd to add a reactionrole?

@danirod
Copy link
Member

danirod commented Jan 18, 2022

This would be an interesting concept, but because the current API of the library expects an array of reaction-roles to be given as a parameter, the !radd command needs to do something to remember the updated list of roles to use them the next time the bot starts. This is something that discordjs-reaction-role does not handle at the moment because the current API is stateless and doesn't require a persistence engine, so I don't understand how would it work out.

It should be possible to build an interaction command with something like

{
  "name": "radd",
  "description": "Add a command",
  "options": [
    {
      "type": 8,
      "name": "role",
      "description": "Role to grant or remove"
    },
    {
      "type": 3,
      "name": "emoji",
      "description": "The reaction to use as trigger"
    },
    {
      "type": 3,
      "name": "message",
      "description": "The message ID to use as trigger"
    }
  ]
}

And definitely it should be possible to rebuild the reaction-role list, persist it somewhere, and then restart the reaction role system with

let rr = new ReactionRole(client, roles);
rr.teardown();
rr = new ReactionRole(client, roles);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants