Checking roles of user in server from their dm message

i want to check if a user dms and also has a role in the server
if ((message.channel.type == 1) && member.roles.cache.has('1093515437792305222'))
    console.log("dm'd with role")

i tried this first but then realised if its in a dm you have no roles, is there a way around this?
this bot will only be used in one server
Was this page helpful?
Checking roles of user in server from their dm message - discord.js - Imagine ❄