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
UndiedGFX6mo ago
can i see how you register options in your application command it seems like you dont have a user option
Jonny
JonnyOP6mo ago
i sent the code
UndiedGFX
UndiedGFX6mo 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
Favna6mo 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
UndiedGFX6mo ago
ah yes
Favna
Favna6mo 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
UndiedGFX6mo ago
that isnt the issue either, they included their whole logic in the "parameter"
Favna
Favna6mo ago
It's a problem though
Solution
Jonny
Jonny6mo 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