Sam
Sam
SIASapphire - Imagine a framework
Created by Sam on 3/25/2023 in #sapphire-support
Subcommand isn't running
When the subcommand is run in Discord, it times out. I've added a log to the beginning of the method but it isn't triggered. Normal commands work fine.
@ApplyOptions<Subcommand.Options>({
name: 'blacklist',
description: 'Blacklist users or guilds from using the bot.',
preconditions: ['OwnerOnly'],
subcommands: [
{
name: 'user',
chatInputRun: 'chatInputUser'
}
]
})
export class BlacklistCommand extends Subcommand {
public override registerApplicationCommands(
registry: ChatInputCommand.Registry
) {
registry.registerChatInputCommand(
(builder) =>
builder
.setName(this.name)
.setDescription(this.description)
.addSubcommand((command) =>
command
.setName('user')
.setDescription('Blacklist a user from using the bot.')
.addUserOption((option) =>
option
.setName('user')
.setDescription('The user to blacklist.')
.setRequired(true)
)
),
{
guildIds: config.testGuilds
}
);
}

public async chatInputUser(
interaction: Subcommand.ChatInputCommandInteraction
) {
@ApplyOptions<Subcommand.Options>({
name: 'blacklist',
description: 'Blacklist users or guilds from using the bot.',
preconditions: ['OwnerOnly'],
subcommands: [
{
name: 'user',
chatInputRun: 'chatInputUser'
}
]
})
export class BlacklistCommand extends Subcommand {
public override registerApplicationCommands(
registry: ChatInputCommand.Registry
) {
registry.registerChatInputCommand(
(builder) =>
builder
.setName(this.name)
.setDescription(this.description)
.addSubcommand((command) =>
command
.setName('user')
.setDescription('Blacklist a user from using the bot.')
.addUserOption((option) =>
option
.setName('user')
.setDescription('The user to blacklist.')
.setRequired(true)
)
),
{
guildIds: config.testGuilds
}
);
}

public async chatInputUser(
interaction: Subcommand.ChatInputCommandInteraction
) {
4 replies
SIASapphire - Imagine a framework
Created by Sam on 12/23/2022 in #sapphire-support
How do I apply preconditions to a specific subcommand
I’d like to only apply my OwnerOnly precondition to certain sub commands instead of all of them. Is there a way to do this?
14 replies