#Help

30 messages · Page 1 of 1 (latest)

fading herald
#

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'));

},
};

wanton tendonBOT
#

• 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.

fading herald
#

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'));

},
};

teal tangle
#

you have to use the ApplicationCommandOptionType to specify types

fading herald
#

Let me try tomorrow

fading herald
#

So what I need to change?

jaunty briar
fading herald
#

Ok thanks

#

I'll try tomorrow

jaunty briar
#

👌

fading herald
#

type: ApplicationCommandOptionType.User,
^

ReferenceError: ApplicationCommandOptionType is not defined

scenic spoke
fading herald
#

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'));

},
};

teal tangle
#

Import it, basic js

fading herald
#

const { ApplicationCommandOptionType } = require('discord.js');

#

i cant see ether the option

teal tangle
#

did you redeploy your command

fading herald
#

yes

#

nothing

teal tangle
#

are you sure you deployed it? Did you run the deploy script

fading herald
#

yes

teal tangle
#

try changing the description and see if that changes

fading herald
#

nothing

teal tangle
#

then your command isnt being deployed

fading herald
#

should i send you my bot?