Validation error when importing builders from `discord.js` rather than `@discordjs/builders`
I ended up opening a djs-in-dev-versionBuilders Validation Error on the d.js server because I thought it was related to it but turns out seems to only happen when used with Sapphire
import { Command } from '@sapphire/framework';import { SlashCommandSubcommandBuilder } from 'discord.js';// If import it from @discordjs/builders as such:// import { SlashCommandSubcommandBuilder } from '@discordjs/builders';// it works fineexport class BuilderBugCommand extends Command { public constructor(context: Command.LoaderContext, options: Command.Options) { super(context, { ...options }); } public override registerApplicationCommands(registry: Command.Registry) { registry.registerChatInputCommand((builder) => builder .setName('builder_bug') // .addSubcommand( new SlashCommandSubcommandBuilder() // .setName('something') ) ); } public override async chatInputRun(interaction: Command.ChatInputCommandInteraction) { // TODO }}
import { Command } from '@sapphire/framework';import { SlashCommandSubcommandBuilder } from 'discord.js';// If import it from @discordjs/builders as such:// import { SlashCommandSubcommandBuilder } from '@discordjs/builders';// it works fineexport class BuilderBugCommand extends Command { public constructor(context: Command.LoaderContext, options: Command.Options) { super(context, { ...options }); } public override registerApplicationCommands(registry: Command.Registry) { registry.registerChatInputCommand((builder) => builder .setName('builder_bug') // .addSubcommand( new SlashCommandSubcommandBuilder() // .setName('something') ) ); } public override async chatInputRun(interaction: Command.ChatInputCommandInteraction) { // TODO }}
Recent Announcements
Continue the conversation
Join the Discord to ask follow-up questions and connect with the community
S-IaF
Sapphire - Imagine a Framework
Sapphire is a next-gen object-oriented Discord.js bot framework.