Search
Star
Feedback
Setup for Free
ยฉ 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
Question about slash command user fields - Sapphire - Imagine a Framework
S-IaF
Sapphire - Imagine a Framework
โข
2y ago
โข
5 replies
PossiblySebo
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
.
Imgur
Imgur
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
.
Jump to solution
Sapphire - Imagine a Framework
Join
Sapphire is a next-gen object-oriented Discord.js bot framework.
2,261
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Recent Announcements
Similar Threads
Was this page helpful?
Yes
No
Similar Threads
Slash Command User Arg Always Failing
S-IaF
Sapphire - Imagine a Framework / sapphire-support
3y ago
Slash Command Decorator
S-IaF
Sapphire - Imagine a Framework / sapphire-support
2y ago
Slash Command Permissions
S-IaF
Sapphire - Imagine a Framework / sapphire-support
2y ago
Slash Command not showing
S-IaF
Sapphire - Imagine a Framework / sapphire-support
2y ago