slash command type issue

./lib/types/command.ts:
export type Command = {
  category: Category
  data: SlashCommandBuilder | SlashCommandSubcommandsOnlyBuilder | ContextMenuCommandBuilder
  execute?: (i: ChatInputCommandInteraction, client: Client) => void
}

userinfo.ts:
const data = new SlashCommandBuilder()
  .setName("userinfo")
  .setDescription("Get the info of a user")
  .setDMPermission(true)
  .setNSFW(false)
  .addUserOption(option =>
    option
      .setName("user")
      .setDescription("The user to get the info of")
  )

const userinfo: Command = {
  category: "utility",
  data,
  async execute(i, client) {...}
}
Error (ts 2322)

Type

Omit<SlashCommandBuilder, "addSubcommand" | "addSubcommandGroup">
is not assignable to type

SlashCommandBuilder | SlashCommandSubcommandsOnlyBuilder | ContextMenuCommandBuilder

how do I fix this issue? like if I add Omit<SlashCommandBuilder, "addSubcommand" | "addSubcommandGroup"> it gets fixed but then there can I'll have to add more like "addBooleanOption" | "addUserOption" | ....., I just want it to be a slashcommand builder, it can have subcommands or not, or just options, etc.
Was this page helpful?