Please tell me how to assign a role in discord.js by the user ID, which is located in the variable id
(let id = interaction.message.embeds[0].fields[5].value;
)
let id = interaction.message.embeds[0].fields[5].value;
await id.roles.add(config.defaultConfig.VERF_ROLE);
doesn’t work
Everything works if id
is taken from the member
variable
const member = interaction.guild.members.cache.get(interaction.user.id);
await member.roles.add(config.defaultConfig.VERF_ROLE);
New contributor
Phanvoy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.