Slash command registered, but not displaying.

I've got a test slash command that is getting registered, but not displaying in Discord.
import {Command, container} from "@sapphire/framework";

class Test extends Command {
constructor(context, options) {
super(context, {
...options,
name: 'test',
description: 'A test command'
});
}

async chatInputRun(interaction, context) {
const repo = container.EventRepository;
const guild_id = interaction.guildId.toString();
let event = await repo.findOneByGuild(guild_id);

const team = event.snakes_and_ladders.getTeam(interaction.options.getString('team', true));

return interaction.reply({
content: `You ran a test command with team ${team.name}`
});
}

registerApplicationCommands(registry) {
registry.registerChatInputCommand(builder =>
builder
.setName(this.name)
.setDescription(this.description)
.addStringOption(option =>
option
.setName('team')
.setDescription('A team name')
.setRequired(true)
.setAutocomplete(true)
)
);
}
}

export {Test}
import {Command, container} from "@sapphire/framework";

class Test extends Command {
constructor(context, options) {
super(context, {
...options,
name: 'test',
description: 'A test command'
});
}

async chatInputRun(interaction, context) {
const repo = container.EventRepository;
const guild_id = interaction.guildId.toString();
let event = await repo.findOneByGuild(guild_id);

const team = event.snakes_and_ladders.getTeam(interaction.options.getString('team', true));

return interaction.reply({
content: `You ran a test command with team ${team.name}`
});
}

registerApplicationCommands(registry) {
registry.registerChatInputCommand(builder =>
builder
.setName(this.name)
.setDescription(this.description)
.addStringOption(option =>
option
.setName('team')
.setDescription('A team name')
.setRequired(true)
.setAutocomplete(true)
)
);
}
}

export {Test}
Solution:
Sapphire Framework
Configuring the global behavior when commands are not identical | S...
Configuring the global behavior is easy! You just need to import the
Jump to solution
8 Replies
Ashachor
AshachorOP5mo ago
No description
Ashachor
AshachorOP5mo ago
I have another slash command (which is a bunch of subcommands) that is registered just fine and showing up.
Favna
Favna5mo ago
Are both commands named "test"?
Ashachor
AshachorOP5mo ago
No, the other is named 'sal'.
Solution
Favna
Favna5mo ago
Sapphire Framework
Configuring the global behavior when commands are not identical | S...
Configuring the global behavior is easy! You just need to import the
Favna
Favna5mo ago
On a general note, I wouldn't recommend naming a command anything other than your final name if you're not also bulk overwrite or keeping track of idHints because then you're going to have to manually remove the old names when you're done.
Ashachor
AshachorOP5mo ago
I set it to BulkOverwrite. I still don't see the command in Discord. That's fair. I only created the test command because my AutocompleteHandler isn't working and I wanted to make sure it had nothing to do with the Subcommands.
No description
Ashachor
AshachorOP5mo ago
Could it be the name? I changed the name from 'test' to 'new-dummy-command' and that one showed up. When I tried to set it back to 'test' the 'new-dummy-command' still shows up for some reason, even after a few minutes. Nevermind, I guess it takes longer than a few minutes for discord to update the commands? I've driven to work and now the /test command shows up.
Want results from more Discord servers?
Add your server