yuansheng
yuansheng
SIASapphire - Imagine a Framework
Created by yuansheng on 4/5/2025 in #sapphire-support
Could not pass a new instance of slash command builder to registry.registerApplicationCommands
subcommands and sub groups are being omitted
7 replies
SIASapphire - Imagine a Framework
Created by yuansheng on 4/5/2025 in #sapphire-support
Could not pass a new instance of slash command builder to registry.registerApplicationCommands
No description
7 replies
SIASapphire - Imagine a Framework
Created by yuansheng on 4/5/2025 in #sapphire-support
Could not pass a new instance of slash command builder to registry.registerApplicationCommands
doing builder.toJSON():
{
options: [
{
type: 2,
name: 'g',
name_localizations: undefined,
description: 'group',
description_localizations: undefined,
options: [Array]
}
],
name: 'fail-group',
name_localizations: undefined,
description: 'A command that will fail to register',
description_localizations: undefined,
contexts: [ 0 ],
default_permission: undefined,
default_member_permissions: undefined,
dm_permission: undefined,
integration_types: [ 0 ],
nsfw: undefined,
type: 1
}
{
options: [
{
type: 2,
name: 'g',
name_localizations: undefined,
description: 'group',
description_localizations: undefined,
options: [Array]
}
],
name: 'fail-group',
name_localizations: undefined,
description: 'A command that will fail to register',
description_localizations: undefined,
contexts: [ 0 ],
default_permission: undefined,
default_member_permissions: undefined,
dm_permission: undefined,
integration_types: [ 0 ],
nsfw: undefined,
type: 1
}
7 replies
SIASapphire - Imagine a Framework
Created by yuansheng on 4/5/2025 in #sapphire-support
Could not pass a new instance of slash command builder to registry.registerApplicationCommands
import { ApplyOptions } from '@sapphire/decorators';
import { Command, type ApplicationCommandRegistry } from '@sapphire/framework';
import { ApplicationIntegrationType, InteractionContextType, SlashCommandBuilder } from 'discord.js';

@ApplyOptions<Command.Options>({
description: 'A command that will fail to register'
})
export class UserCommand extends Command {
public override chatInputRun() {}

public override registerApplicationCommands(registry: ApplicationCommandRegistry) {
const builder = new SlashCommandBuilder()
.setName(this.name)
.setDescription(this.description)
.setContexts(InteractionContextType.Guild)
.setIntegrationTypes(ApplicationIntegrationType.GuildInstall)
.addSubcommandGroup((builder) =>
builder
.setName('g')
.setDescription('group')
.addSubcommand((builder) => builder.setName('sub').setDescription('sub'))
);

registry.registerChatInputCommand(builder);
}
}
import { ApplyOptions } from '@sapphire/decorators';
import { Command, type ApplicationCommandRegistry } from '@sapphire/framework';
import { ApplicationIntegrationType, InteractionContextType, SlashCommandBuilder } from 'discord.js';

@ApplyOptions<Command.Options>({
description: 'A command that will fail to register'
})
export class UserCommand extends Command {
public override chatInputRun() {}

public override registerApplicationCommands(registry: ApplicationCommandRegistry) {
const builder = new SlashCommandBuilder()
.setName(this.name)
.setDescription(this.description)
.setContexts(InteractionContextType.Guild)
.setIntegrationTypes(ApplicationIntegrationType.GuildInstall)
.addSubcommandGroup((builder) =>
builder
.setName('g')
.setDescription('group')
.addSubcommand((builder) => builder.setName('sub').setDescription('sub'))
);

registry.registerChatInputCommand(builder);
}
}
7 replies
SIASapphire - Imagine a Framework
Created by yuansheng on 4/5/2025 in #sapphire-support
Could not pass a new instance of slash command builder to registry.registerApplicationCommands
No description
7 replies
SIASapphire - Imagine a Framework
Created by ⸸⛧Stealth⛧⸸ on 4/5/2025 in #sapphire-support
Command comparison
No description
5 replies
SIASapphire - Imagine a Framework
Created by log(n) on 3/30/2024 in #sapphire-support
no error event on subcommand precondition
SubcommandPluginEvents.ChatInputSubcommandError does not emit denied precondition, SubcommandPluginEvents.ChatInputSubcommandDenied is what you are looking for
30 replies
SIASapphire - Imagine a Framework
Created by yuansheng on 12/30/2023 in #sapphire-support
Unable to get piece's name with CommandStore#get when piece's enabled is false
ah i see. thanks
6 replies