Dynamically update command choices without using autocomplete

The title says it all, I don't want to have to use autocomplete as I've found it can be pretty buggy.
I'd like to be able to do something like this:
const { gamesArray } = require("./browse.js");

module.exports = {
  data: new SlashCommandBuilder()
    .setName("play")
    .setDescription("Play a game.")
    .addStringOption((option) =>
      option
        .setName("id")
        .setDescription("The ID of the game to play.")
        .setRequired(true)
        .addChoices(...gamesArray)
    ),

but currently it just says "No options available" (gamesArray is formatted correctly)
Was this page helpful?