Fetch user that isn't in current server
How do I fetch a user that's not in the same server as my bot? This is for a command that will display an embed with the user's name (as well as some other stuff), but I'm not sure how to do it.
I was able to do that in some of my other commands because it took a User object as a slash command option, but since this particular command that I'm writing now doesn't do that, I'm not sure how to fetch it.
Using discord.js 14.7.1 with node.js 19.6.0
9 Replies
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
if I get it correctly, you’re using / commands right?
yes
so you just need the user option
no need to fetch anything
wouldn't that just take the user that used the command?
?
if you pass a valid user to your user option it resolves to a User object
But I'm not taking a User option in this particular command that I'm writing
only did that for the other commands that I wrote, and I'll need to fetch multiple different users
client.users.fetch(id)
got it, thanks!