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
• 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.[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'));
},
};you have to use the ApplicationCommandOptionType to specify types
Ok
Let me try tomorrow
Wait
So what I need to change?
type: 'USER',
to type: ApplicationCommandOptionType.User,
Ok thanks
I'll try tomorrow
👌
type: ApplicationCommandOptionType.User,
^
ReferenceError: ApplicationCommandOptionType is not defined
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
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'));
},
};Import it, basic js
const { ApplicationCommandOptionType } = require('discord.js');
i cant see ether the option
did you redeploy your command
yes
nothing
are you sure you deployed it? Did you run the deploy script
yes
try changing the description and see if that changes
nothing
then your command isnt being deployed
bro
should i send you my bot?
no, you should just run your deplyo script