Add support for Slash commands
See original GitHub issueSlash commands!
Akairo should support Discord’s new(ish) slash commands system.
Possible usage
Because the number of global slash commands that a bot is allowed to have is limited, I think that making a command be available as a global slash command should be opt-in. E.g.
class SlashCommand extends Command {
constructor() {
super("slash", {
slash: true,
category: "core",
aliases: ["slash", "sloosh"],
clientPermissions: ["SEND_MESSAGES"]
});
}
exec (message, args, slash) {
if (slash) {
return message.reply("You used a slash command!");
}
return message.reply("You used a normal command.");
}
}
As for per-guild slash commands, I’m not yet sure how you would set which guilds they’re available for as these would probably need to be dynamic (for things like tags).
Resources
- An example implementation of slash commands in a bot using Akairo is Fire.
- A couple of Akairo forks that have implemented slash commands (as well as some other QoL features): fork 1 fork 2.
This feature could possibly be added in #179.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:8
- Comments:9 (2 by maintainers)
Top Results From Across the Web
Creating slash commands - discord.js Guide
Discord allows developers to register slash commands · Create a new folder named commands , which is where you'll store all of your...
Read more >Enabling interactivity with Slash Commands - Slack API
By enabling Slash Commands, your app can be summoned by users from any conversation in Slack. ... Naming it after your service is...
Read more >Slash Commands - disnake
Slash commands can significantly simplify the user's experience with your bot. Once “/” is pressed on the keyboard, the list of slash commands...
Read more >Slash Commands FAQ - Discord Support
Slash Commands are the new, exciting way to build and interact with bots on Discord. With Slash Commands, all you have to do...
Read more >Introduction to slash commands | Discord.Net Documentation
Slash commands are made up of a name, description, and a block of options, which you can think of like arguments to a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Unfortunately, @1Computer1 has decided that slash commands won’t be a part of Akairo.
I recommend looking at those forks I posted further up if you want slash commands in Akairo.
+1 would be nice, but should wait until fully implemented by DiscordJS.