I am trying to grant users a role once they submit a form but I am getting this in nodejs
TypeError: Cannot read property 'roles' of undefined
I have the code set up like this:
const guild = discordClient.guilds.cache.get('1234567890');
const member = await guild.members.cache.get('22222222')
const role = await guild.roles.cache.find(role => role.id === '111111');
member.roles.add(role);
what am I doing wrong?