ass man 🧍
ass man 🧍
DIAdiscord.js - Imagine an app
Created by ass man 🧍 on 11/27/2024 in #djs-questions
Caching Issues
Hello! I'm fairly new to discord.js and I have some issued with this code I wrote.
if (oldMember.partial) await oldMember.fetch();
if (newMember.partial) await newMember.fetch();

const oldRoles = oldMember.roles.cache.has(checkedRoleId);
const newRoles = newMember.roles.cache.has(checkedRoleId);
if (oldMember.partial) await oldMember.fetch();
if (newMember.partial) await newMember.fetch();

const oldRoles = oldMember.roles.cache.has(checkedRoleId);
const newRoles = newMember.roles.cache.has(checkedRoleId);
I keep getting this error: TypeError: Cannot read properties of undefined (reading 'cache')
56 replies