-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Emoji convenience methods #1378
Conversation
src/structures/Emoji.js
Outdated
* @param {Role} role The role to add | ||
* @returns {Promise<Emoji>} | ||
*/ | ||
addRestrictedRole(role) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should probably just call this.addRestrictedRoles([role])
for consistancy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok
what about removing restricted roles |
I'll see |
src/structures/Emoji.js
Outdated
for (const role of roles) { | ||
if (newRoles.has(role.id)) newRoles.delete(role.id); | ||
} | ||
return newRoles; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return this.edit perhaps
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am wordless
260b09e
to
5b2ca32
Compare
Requested by Crawl
* make branch * stuff * Consistency & remove role(s) * kill me * Doc changes Requested by Crawl * forgot 1
* make branch * stuff * Consistency & remove role(s) * kill me * Doc changes Requested by Crawl * forgot 1
* make branch * stuff * Consistency & remove role(s) * kill me * Doc changes Requested by Crawl * forgot 1
Adds convenience methods (similar to those of RichEmbed) to Emoji, for easier use:
setName
addRestrictedRole
addRestrictedRoles
removeRestrictedRole
removeRestrictedRoles
Still a bit indecisive over either stay using array argument or use rest parameters for the
addRestrictedRoles
method. Let me know if I should use rest parameters.Edit: I can also use both 🤔
Edit 2: If I used both I could also merge the restricted role methods into one method 🤔