Skip to content
Discussion options

You must be logged in to vote

getMember / getRole are convenience functions we define for interactions that let you retrieve the command options the user supplied (that being a member and a role in this example).

the guild member instance (retrieved via getMember or from the cache/rest call with .members.fetch("id")) then has the .roles.add() function on the guild member roles manager, to actually add a role.

if you have the id, you can simply pass the id here and don't need to fetch the role.
if you don't want to, you don't even have to fetch the member and can utilize the manager instead: <Guild>.members.addRole({role: "id", user: user.id})


to clarify, there is no discrepancy here, just a different entry point. yo…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@almostSouji
Comment options

@samheckle
Comment options

Answer selected by samheckle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #11232 on October 31, 2025 21:49.