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 toolkit5mo 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 docs5mo ago
method GuildMemberManager#fetchMe() Fetches the client user as a GuildMember of the guild.
zeyad_155
zeyad_1555mo ago
or
d.js docs
d.js docs5mo ago
property GuildMemberManager#me The client user as a GuildMember of this guild
zeyad_155
zeyad_1555mo ago
but this may not return anything so you might as well jsut use this
kriskotooBG
kriskotooBG5mo ago
Aha, and how can I access this GuildMemberManager?
zeyad_155
zeyad_1555mo ago
<Guild>.members
kriskotooBG
kriskotooBG5mo ago
Ah, so the .members is an Instace of that. Cool. So I can use message.guild.members.fetchMe() Thanks a bunch!
zeyad_155
zeyad_1555mo ago
yes keep in mind that it's a promise
kriskotooBG
kriskotooBG5mo ago
Yup, I saw works great