Question about slash command user fields
If I were to create a User option for a slash command using the following code:
https://i.imgur.com/KaIRMiJ.png
Would I be able to retrieve this user as a GuildMember instead of a User by using this code?
https://i.imgur.com/eNAGsl8.png
My use case is pure laziness, I don't feel like fetching the User as a GuildMember and want to see if I can simply have the framework fetch them as a GuildMember from the get-go instead of having to fetch their user ID as a GuildMember.
Solution:Jump to solution
This is a DiscordJS matter and answered on their guide: https://discordjs.guide/slash-commands/parsing-options.html#command-options:~:text=If%20the%20target%20user%20is%20still%20in%20the%20guild%20where%20the%20command%20is%20being%20run%2C%20you%20can%20also%20use%20.getMember(%27target%27)%20to%20get%20their%20GuildMember%20object.
discord.js Guide
Imagine a guide... that explores the many possibilities for your discord.js bot.
2 Replies
Solution
This is a DiscordJS matter and answered on their guide: https://discordjs.guide/slash-commands/parsing-options.html#command-options:~:text=If%20the%20target%20user%20is%20still%20in%20the%20guild%20where%20the%20command%20is%20being%20run%2C%20you%20can%20also%20use%20.getMember(%27target%27)%20to%20get%20their%20GuildMember%20object.
discord.js Guide
Imagine a guide... that explores the many possibilities for your discord.js bot.
👍
Apologies