Linking guild to a specific member based on dm with bot
I have a bot that's supposed to verify people. Is it possible for the verification to happen under dms? I figure I can't do it unless I have a way to get the guild reference through the message object in bot.on('createMessage', ...)
14 Replies
• What's your exact discord.js
npm list discord.js
and node node -v
version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.its messageCreate and no, you'd have to store the guild id somewhere
I tried to
But I can't seem to find myself within the guild's cache?
how is guild defined and what version are you on
const guild = discordBotInstance.guilds.cache.get('1124090488308379758');
"discord.js": "^14.11.0",
Its <GuildMember>.roles to get a rolemanager
The member that dms the bot is the only member in the server other than the bot
It seems to work when I do:
thats indeed how its supposed to be used
My problem is that cachedMemberFromGuild is undefined
It's not within the cache for some reason
Even though the author is present in the server
then you'll have to fetch
o
Wasn't aware of that method
Just because the member is in the server doesnt mean they will be cached
I see. That makes sense, I assumed that
Thanks a lot @luna🌈 (:
yw!