Getting user from interaction options

What do I have to do to chage the return type to either 6 or 9 aka a user?
.addStringOption(option =>
option
.setName('user')
.setDescription('The user.')
.setRequired(false)
),
async execute(interaction) {
await interaction.deferReply();
console.log(interaction.options.getUser('user'));
.addStringOption(option =>
option
.setName('user')
.setDescription('The user.')
.setRequired(false)
),
async execute(interaction) {
await interaction.deferReply();
console.log(interaction.options.getUser('user'));
3 Replies
d.js toolkit
d.js toolkit8mo 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
chewie
chewie8mo ago
- .addStringOption(option =>
+ .addUserOption(option =>
- .addStringOption(option =>
+ .addUserOption(option =>
toaster_12301
toaster_12301OP8mo ago
lol thanks i completely overlooked it 😅
Want results from more Discord servers?
Add your server