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

Why does this interaction option return null?
No description
No description
No description
Sawako
Sawako558d 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
EvolutionX558d 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
Favna557d ago
Member and user cannot have autocomplete anyway. Only string and integer can.
EvolutionX
EvolutionX557d 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
Favna557d ago
Hmm Okay ig
Want results from more Discord servers?
Add your server
More Posts
dragonizedpizza - can I give a list of possible el...can I give a list of possible elements in shapeshift's s.string.arrayeslint oomhey besties, your eslint config somehow OOMs eslint <3 what the fuck ctx: Running it with `next lintSomehow registry not registering@vladdy Bug Report: Code: https://v.gd/Ftwkcz Problem: Help command not being registered Expected ouyesAre you trying to add a role to the member or..?Notion document feedback, issues, questions and answersHello @everyone! Now, before you bring out the pitchforks and the <:Ping:504396173935771668>, <:cockPoll Discussion & Answers1️⃣ → *Interaction Handler* 2️⃣ → *In the command with the same name / id* 3️⃣ → *Other (please explApplication Command Registry Interface v1@here Your feedback is required again! We're inching closer and closer to having application commandHow should you, the end user, define commands?⚠️ **How should you define what application commands are for what command classes, and how should thPreconditions with missing handlers! What do?**Preconditions**: What should happen with preconditions (global or not) that need to run on a messaContext Menus vs Application Commands - separate or not?**Question time** ❓ Context menus.. they exist. They're like used once a blue century. How should Interaction Handlers after usageWant to give interaction handlers a shot **now**? Well, you can! Just run the command below and givInteraction Handlers!!Hello peeps! I know, I know, allllll of you (myself included) are just basically begging me for appInitial Commit ThoughtsI've pushed the initial commit for interaction handlers: heavily wip, totally untested and raw (justThe statefulness or statelessness of Interactions1. Most likely, but it would be a nice addition if I was able to have non-state "callbacks" as mentiInteraction handlers in the command instead of globallyHonestly. I would much rather add interactions from my command and from there tell to continue in (fReply sess 2**1.** Yes. This also follows the design pattern that we more-or-less employ already for Sapphire. Wdont feel like creating a review on GitHub...PR is up: https://github.com/sapphiredev/utilities/pull/152 CC @kyra 🩵🩷🤍🩷🩵 @vladdy