I have a variable called staffRole and when a user has sent a message using the messageCreate event.
I use const staffrole = message.member.role.cache.some(role => STAFF_ROLES.includes(role.id)); which works perfectly for server messages, but when I message the bot or the bot messages me, then my bot would crash since users don't have any roles in a DM.
Is there a way to prevent this code from running via DMs?