kaname-png - Why does this interaction option retu...

Why does this interaction option return null?
No description
No description
No description
6 Replies
Sawako
SawakoOP3y ago
// interaction.options
[@naeko-team/discord-bot start] CommandInteractionOptionResolver {
[@naeko-team/discord-bot start] _group: 'warnings',
[@naeko-team/discord-bot start] _subcommand: 'delete',
[@naeko-team/discord-bot start] _hoistedOptions: [
[@naeko-team/discord-bot start] { name: 'member', type: 'USER', value: '858367536240394259' },
[@naeko-team/discord-bot start] {
[@naeko-team/discord-bot start] name: 'warning',
[@naeko-team/discord-bot start] type: 'STRING',
[@naeko-team/discord-bot start] value: 'asssasd',
[@naeko-team/discord-bot start] focused: true
[@naeko-team/discord-bot start] }
[@naeko-team/discord-bot start] ]
[@naeko-team/discord-bot start] }

// interaction.options.getUser('member')
[@naeko-team/discord-bot start] null
// interaction.options
[@naeko-team/discord-bot start] CommandInteractionOptionResolver {
[@naeko-team/discord-bot start] _group: 'warnings',
[@naeko-team/discord-bot start] _subcommand: 'delete',
[@naeko-team/discord-bot start] _hoistedOptions: [
[@naeko-team/discord-bot start] { name: 'member', type: 'USER', value: '858367536240394259' },
[@naeko-team/discord-bot start] {
[@naeko-team/discord-bot start] name: 'warning',
[@naeko-team/discord-bot start] type: 'STRING',
[@naeko-team/discord-bot start] value: 'asssasd',
[@naeko-team/discord-bot start] focused: true
[@naeko-team/discord-bot start] }
[@naeko-team/discord-bot start] ]
[@naeko-team/discord-bot start] }

// interaction.options.getUser('member')
[@naeko-team/discord-bot start] null
EvolutionX
EvolutionX3y ago
It will always return null in autocomplete because discord does not emit the data as User or Member iirc All you have to do is use .get('name')?.value Here's a reference when I had the same issue long back https://discord.com/channels/737141877803057244/889973175583133717/960879520678834196 @sawa_ko The typings were fixed in v14 .getUser and .getMember no longer exists on autocomplete
Favna
Favna3y ago
Member and user cannot have autocomplete anyway. Only string and integer can.
EvolutionX
EvolutionX3y ago
its not using autocomplete in member favna they have 2 options [ member ] [ string -> with autocomplete ] autocomplete interaction wont emit member/user structure hence the issue just like the github command uses string option to determine repo and gives prs and issues in autocomplete
Favna
Favna3y ago
Hmm Okay ig
Want results from more Discord servers?
Add your server