question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add support for Slash commands

See original GitHub issue

Slash 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:closed
  • Created 2 years ago
  • Reactions:8
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
edazpotatocommented, Jul 1, 2021

Unfortunately, @1Computer1 has decided that slash commands won’t be a part of Akairo. image

I recommend looking at those forks I posted further up if you want slash commands in Akairo.

2reactions
jackmerrillcommented, Apr 3, 2021

+1 would be nice, but should wait until fully implemented by DiscordJS.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found