mrbbot / slshx

⚔️ Strongly-typed Discord commands on Cloudflare Workers
MIT License
210 stars 9 forks source link

Options do not automatically resolve using Autocomplete. #1

Closed helloimalastair closed 2 years ago

helloimalastair commented 2 years ago

When using Autocomplete with an option:

const user = useUser("user", "user to add note to", { required: true });
const name = useString("name", "name of note", { required: true,
    async autocomplete(interaction, env: Env) {
      console.log(interaction.data.options[0].options[0].value, user);
      return [];
    } 
  });

the option user does not resolve, but it is still present on interaction.data.options[0].options[0].value. However, name can and does resolve. Working example is available in Rhiannon. User doesn't resolve Name does resolve

mrbbot commented 2 years ago

Hey, 👋 just fixed this! Will aim to get a new release out soon. I'd like to add support for modals and nicer errors too.

helloimalastair commented 2 years ago

Thanks @mrbbot!

mrbbot commented 2 years ago

Hey! 👋 Just released slshx 0.3.0 including this fix. Apologies it took a while to get this released. 🙂

helloimalastair commented 2 years ago

No worries, thanks for pushing it!