Help

Im trying this slash comand but i cant see the option 'user' module.exports = { data: { name: 'userinfo', description: 'Fornisce informazioni sull'utente specificato', options: [ { name: 'user', description: 'L'utente di cui visualizzare le informazioni (opzionale)', type: 'USER', required: false, }, ], }, async execute(interaction) { const user = interaction.options.getUser('user') || interaction.user; const userInfo = [ Nome utente: ${user.username}, ID: ${user.id}, Account creato il: ${user.createdAt}, ]; interaction.reply(userInfo.join('\n')); }, };
22 Replies
d.js toolkit
d.js toolkit2y ago
• What's your exact discord.js npm list discord.js and node node -v version? • Post the full error stack trace, not just the top part! • Show your code! • Explain what exactly your issue is. • Not a discord.js issue? Check out #useful-servers.
pam
pamOP2y ago
[email protected] module.exports = { data: { name: 'userinfo', description: 'Fornisce informazioni sull'utente specificato', options: [ { name: 'user', description: 'L'utente di cui visualizzare le informazioni (opzionale)', type: 'USER', required: false, }, ], }, async execute(interaction) { const user = interaction.options.getUser('user') || interaction.user; const userInfo = [ Nome utente: ${user.username}, ID: ${user.id}, Account creato il: ${user.createdAt}, ]; interaction.reply(userInfo.join('\n')); }, };
treble/luna
treble/luna2y ago
you have to use the ApplicationCommandOptionType to specify types
pam
pamOP2y ago
Ok Let me try tomorrow Wait So what I need to change?
Булочка | pasha_boez
type: 'USER', to type: ApplicationCommandOptionType.User,
pam
pamOP2y ago
Ok thanks I'll try tomorrow
pam
pamOP2y ago
type: ApplicationCommandOptionType.User, ^ ReferenceError: ApplicationCommandOptionType is not defined
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
pam
pamOP2y ago
module.exports = { data: { name: 'userinfo', description: 'Fornisce informazioni sull'utente specificato', options: [ { name: 'user', description: 'L'utente di cui visualizzare le informazioni (opzionale)', type: ApplicationCommandOptionType.User, required: false, }, ], }, async execute(interaction) { const user = interaction.options.getUser('user') || interaction.user; const userInfo = [ Nome utente: ${user.username}, ID: ${user.id}, Account creato il: ${user.createdAt}, ]; interaction.reply(userInfo.join('\n')); }, };
treble/luna
treble/luna2y ago
Import it, basic js
pam
pamOP2y ago
const { ApplicationCommandOptionType } = require('discord.js'); i cant see ether the option
pam
pamOP2y ago
treble/luna
treble/luna2y ago
did you redeploy your command
pam
pamOP2y ago
yes nothing
treble/luna
treble/luna2y ago
are you sure you deployed it? Did you run the deploy script
pam
pamOP2y ago
yes
treble/luna
treble/luna2y ago
try changing the description and see if that changes
pam
pamOP2y ago
nothing
treble/luna
treble/luna2y ago
then your command isnt being deployed
pam
pamOP2y ago
bro should i send you my bot?
treble/luna
treble/luna2y ago
no, you should just run your deplyo script
Want results from more Discord servers?
Add your server