Property 'getUser' does not exist

Am I doing something wrong here? https://pastebin.com/qV3dD31T
Pastebin
import { Command } from "@sapphire/framework";import { ApplicationC...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
No description
Solution:
I ended up restaing VSC and the error just went away. Don't know how that makes any sense.
Jump to solution
9 Replies
UndiedGFX
UndiedGFX7mo ago
can i see how you register options in your application command it seems like you dont have a user option
Jonny
JonnyOP7mo ago
i sent the code
UndiedGFX
UndiedGFX7mo ago
can you restart the tsserver or sum? you should not get that error @Jonny i see an error there
registry.registerChatInputCommand((builder => {
builder.setName('musicstats')
.setDescription('Shows your music stats.')
.setDMPermission(false)
.addUserOption((option) =>
option.setName('user')
.setDescription('The user to show music stats for.')
.setRequired(false)
)
}), { idHints: ['1247393585645486213'] });
registry.registerChatInputCommand((builder => {
builder.setName('musicstats')
.setDescription('Shows your music stats.')
.setDMPermission(false)
.addUserOption((option) =>
option.setName('user')
.setDescription('The user to show music stats for.')
.setRequired(false)
)
}), { idHints: ['1247393585645486213'] });
you're doing this
registry.registerChatInputCommand((builder) => {
builder.setName('musicstats')
.setDescription('Shows your music stats.')
.setDMPermission(false)
.addUserOption((option) =>
option.setName('user')
.setDescription('The user to show music stats for.')
.setRequired(false)
}), { idHints: ['1247393585645486213'] });
registry.registerChatInputCommand((builder) => {
builder.setName('musicstats')
.setDescription('Shows your music stats.')
.setDMPermission(false)
.addUserOption((option) =>
option.setName('user')
.setDescription('The user to show music stats for.')
.setRequired(false)
}), { idHints: ['1247393585645486213'] });
which should be this
Favna
Favna7mo ago
registry.registerChatInputCommand((builder) => {
return builder.setName('musicstats')
.setDescription('Shows your music stats.')
.setDMPermission(false)
.addUserOption((option) =>
option.setName('user')
.setDescription('The user to show music stats for.')
.setRequired(false)
}), { idHints: ['1247393585645486213'] });
registry.registerChatInputCommand((builder) => {
return builder.setName('musicstats')
.setDescription('Shows your music stats.')
.setDMPermission(false)
.addUserOption((option) =>
option.setName('user')
.setDescription('The user to show music stats for.')
.setRequired(false)
}), { idHints: ['1247393585645486213'] });
FTFY @UndiedGFX
UndiedGFX
UndiedGFX7mo ago
ah yes
Favna
Favna7mo ago
Please review how JavaScript arrow functions work: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions Currently your registerChatInputCommand method isn't returning anything
MDN Web Docs
Arrow function expressions - JavaScript | MDN
An arrow function expression is a compact alternative to a traditional function expression, with some semantic differences and deliberate limitations in usage:
UndiedGFX
UndiedGFX7mo ago
that isnt the issue either, they included their whole logic in the "parameter"
Favna
Favna7mo ago
It's a problem though
Solution
Jonny
Jonny7mo ago
I ended up restaing VSC and the error just went away. Don't know how that makes any sense.
Want results from more Discord servers?
Add your server