Handle multiple Autocomplete Events on the same Interaction

Okay so i am trying to handle more than one autocomplete interactions on one command>
The command looks like this:
    {
      name: 'players',
      description: 'Gets the scoreboard of a specific player.',
      type: ApplicationCommandOptionType.Subcommand,
      options: [
        {
          name: 'playername',
          description: 'The player you want the scores for.',
          type: ApplicationCommandOptionType.String,
          required: true,
          autocomplete: true,
        },
        {
          name: 'action',
          description: 'The action to show the scoreboard for.',
          type: ApplicationCommandOptionType.String,
          required: true,
          choices: [...choices],
        },
        {
          name: 'item',
          description: 'The item to show the scoreboard for.',
          type: ApplicationCommandOptionType.String,
          required: true,
          autocomplete: true,
        },
      ],
    },


If someone could help me on how to differentiate between those, that would be great!
Was this page helpful?