Question regarding slash commands / aliases

Hi, is there a way for me to register command aliases as slash commands as well? For example: Command named one has aliases: ['two', 'three'] Is it possible for the command to be run via all of these: /one. /two and /three? They can have the same description and options.
Solution:
You cannot have aliases on slash commands
Solution
K
kyra420d ago
You cannot have aliases on slash commands
T
thad420d ago
Yeah, but is there a way to register all aliases as the same command, but with a different name? I was contemplating making different command files for the "aliases" and linking them back to the one same run function, but I thought that was too complicated. Any better way to do it?
F
Favna420d ago
import { Command } from '@sapphire/framework';

export class PingCommand extends Command {
public constructor(context: Command.Context, options: Command.Options) {
super(context, { ...options });
}

public override registerApplicationCommands(registry: ChatInputCommand.Registry) {
registry.registerChatInputCommand((builder) =>
builder.setName('ping').setDescription('Ping bot to see if it is alive')
);

registry.registerChatInputCommand((builder) =>
builder.setName('pong').setDescription('Ping bot to see if it is alive')
);

registry.registerChatInputCommand((builder) =>
builder.setName('pang').setDescription('Ping bot to see if it is alive')
);

registry.registerChatInputCommand((builder) =>
builder.setName('pung').setDescription('Ping bot to see if it is alive')
);

}
}
import { Command } from '@sapphire/framework';

export class PingCommand extends Command {
public constructor(context: Command.Context, options: Command.Options) {
super(context, { ...options });
}

public override registerApplicationCommands(registry: ChatInputCommand.Registry) {
registry.registerChatInputCommand((builder) =>
builder.setName('ping').setDescription('Ping bot to see if it is alive')
);

registry.registerChatInputCommand((builder) =>
builder.setName('pong').setDescription('Ping bot to see if it is alive')
);

registry.registerChatInputCommand((builder) =>
builder.setName('pang').setDescription('Ping bot to see if it is alive')
);

registry.registerChatInputCommand((builder) =>
builder.setName('pung').setDescription('Ping bot to see if it is alive')
);

}
}
But you really really really shouldn't do that because it'll register the command multiple times on the discord API and each and every one will show up when typing / By definition slash commands do not have aliases
T
thad417d ago
thanks!
Want results from more Discord servers?
Add your server
More Posts
disable commands by dashboard.I want to disable commands through dashboard so, is there any way to dynamically disable commands ?What is the difference between response.status and response.statusCode ?When using the API Plugin of Sapphire.Hey what is DEVELOPMENT MODE and how do I disable itI tried setting the Node_Env to something else but it did not change it in the consoleBotList Autopost of stats is not workingI am using the bot list plugin https://github.com/devtomio/sapphire-plugin-botlist I set everything Miss matching objects on permission setting.Typescript says that permissionOverwrites does not exits in GuildBasedChannel, even tho it exists, irequiredClientPermissions check always rejectingWhile `requiredUserPermissions: ['ManageRoles']` works great. The client check `requiredClientPermisUnable to get member data from users that have left / kickedHi, I am trying to get data from members who have left the discord server or have been kicked. But ICatch all chat input command errors listenerHello ! I tried using the `Events.ChatInputCommandError` listener to catch any errors thrown by the Multiple Clients on one file/instanceI was wondering if its possible to run multiple clients on one file (i.e. .forEach()-ing `new ClientHow to present Slashcommands?How can I present the Slashcommands of my bot in his About Me like for example carl.gg does?Interaction HandlersAm I required to specify to sapphire where my interaction handlers directory is? A `interaction-handbot won't get on and connect to discord.hi, my bot won't turn on. i've coded a lot of bots before with sapphire and they worked just fine, dHow Do I Make a Project in my current Directory?I want to make the proj in `workspaces/DashMate` not like `workspaces/DashMate/${ProjName}`Bot wont go onlinewhen I try to run the script `yarn dev` I get this problemGuildDelete Event somehow gets triggered when I restart my BotI have no idea whats happening but if my bot (docker container) restarts, this notification gets senTypeError: Class extends value undefined is not a constructor or nullHey, newbie here in both TypeScript and Sapphire, and I'm trying to build a command but I'm getting THREAD_CREATE event Listener run method argumentsWhat I want to do: I want to inspect the id of the parent channel where the thread was created. TheCommand info command issueI have a command info command, but when I try to get information on a command called "flags" it retuawait args.pick("member");how to enable this? https://discord.com/channels/737141877803057244/737142071319855105/107804884825Command info command issueI have a command info command, but when I try to get information on a command called "flags" it retu