Skip to content
This repository has been archived by the owner on Jun 16, 2023. It is now read-only.

ADD: Remove roles when user remove reaction #7

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rkzofficial
Copy link

Remove the role of the user when the reaction is removed.

Remove the role of the user when the reaction is removed.
@rkzofficial rkzofficial reopened this Jun 13, 2021
Copy link
Owner

@peterthehan peterthehan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

appreciate the PR, let me know if you have any questions

* @returns {Promise<void>}
*/
module.exports = async (messageReaction, user) => {
const manager = new ReactionRoleManager(messageReaction, user);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we add a new config setting to enable/disable this behavior, maybe something like removeRolesOnReactionRemove

the line immediately following creating the manager can call something like:

Suggested change
const manager = new ReactionRoleManager(messageReaction, user);
const manager = new ReactionRoleManager(messageReaction, user);
if (!manager.handleRolesOnReactionRemove()) {
return;
}

README will also have to update, instruction text can be something like:

  • removeRolesOnReactionRemove determines whether a user's previously assigned roles are removed when the user removes their reaction (true) or not (false). Note that removeReaction must be false for this to work properly.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copy paste for your convenience

- `removeRolesOnReactionRemove` determines whether a user's previously assigned roles are removed when the user removes their reaction (`true`) or not (`false`). Note that `removeReaction` must be `false` for this to work properly.

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

Successfully merging this pull request may close these issues.

3 participants