Find a player in a client by id

I want to find a player in a client by id and give a role to him. the pic is error and below is the code How can I get a member in a client (AND ADD A ROLE)?
let user = client.users.cache.get(id);
console.log(client.users)
user.roles.add("1072269497299374130");
let user = client.users.cache.get(id);
console.log(client.users)
user.roles.add("1072269497299374130");
3 Replies
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
d.js docs
d.js docs2y ago
Documentation suggestion for @apenrl:method GuildMemberManager#addRole() Adds a role to a member.
계정 버림
계정 버림OP2y ago
THxx
Want results from more Discord servers?
Add your server