0

I am working on the roleUpdate event on my Discord bot, I have old role permissions, and new role permissions in the form of an array which prints:

[ 'VIEW_AUDIT_LOG', 'MANAGE_ROLES' ] // Old Roles
[ 'MANAGE_GUILD', 'VIEW_AUDIT_LOG', 'MANAGE_ROLES' ] // New Roles

Following this example, the output I need would be MANAGE_GUILD as that is the only changed object. How would I go about doing something like this?

1

1 Answer 1

1

Use this code

newroles.filter((role) => !oldroles.includes(role));
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.