Client as GuildMember

Hello, this has probably been asked a million times, and I'm sorry for probably re-opening a topic. I tried my best to use Google but didn't find the best way. I want to fetch the client for a given guild (from a message object) as the GuildMember. What is the best way? Is it guild.members.fetchMe?
10 Replies
d.js toolkit
d.js toolkit11mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - Marked as resolved by OP
d.js docs
d.js docs11mo ago
method GuildMemberManager#fetchMe() Fetches the client user as a GuildMember of the guild.
zeyad
zeyad11mo ago
or
d.js docs
d.js docs11mo ago
property GuildMemberManager#me The client user as a GuildMember of this guild
zeyad
zeyad11mo ago
but this may not return anything so you might as well jsut use this
kriskotooBG
kriskotooBGOP11mo ago
Aha, and how can I access this GuildMemberManager?
zeyad
zeyad11mo ago
<Guild>.members
kriskotooBG
kriskotooBGOP11mo ago
Ah, so the .members is an Instace of that. Cool. So I can use message.guild.members.fetchMe() Thanks a bunch!
zeyad
zeyad11mo ago
yes keep in mind that it's a promise
kriskotooBG
kriskotooBGOP11mo ago
Yup, I saw works great
Want results from more Discord servers?
Add your server