Discord has made the disappointing decision to rush out this feature to the API. Due to this decision, it is very unpolished and is missing a lot of the feedback that was provided by the early testers.
Since I'm very busy with my own projects for work and university, I have made the decision to not rush out a JDA implementation and instead actually polish it and finish it properly first. Unlike Discord, I care to provide a quality API.
I've compiled a small list of major issues that have not been addressed before releasing slash commands. Some of these things would now require breaking changes to the API so I have no hope for them to be addressed even in later patches.
I'm pretty happy with how much work they've been putting into improving the API for this stuff. But its still a bit unfinished. I'll elaborate further in the linked Pull Request.
What is still missing?
User/Role/Channel objects for option values (you do get user objects with a MESSAGE_CREATE for mentions, why not here?)
GUI to create commands
Hiding commands based on user whitelist or permissions
Cannot specify the channel type for options, this means a join command can take in a text channel
Repeatable options (see massban commands)
DMs still don't work
There is no intent for interaction create events
Bots can only send multiple embeds with slash command responses, not normal message creates
Bots can only send ephemeral messages with slash commmand responses, not normal message creates
There is no indicator that the command was acknowledged or received by the bot unless the bot uses a specific ack type
icon on the left in the chat does not show the actual avatar (default instead)
You cannot use embeds/attachments in ephemeral messages
The feedback that made it in
Commands are now sent to the appropriate shards (was just shard 0 before but apparently a 5 lines change)
Command names are now unique (was just unique by id before)
You can now copy/paste commands in the client (not sure how that works when you have multiple commands with same name)
Subcommands now work differently in the UI (i didn't really play around with this so can't comment)
What it will probably look like
public void onSlashCommand(SlashCommandEvent event) {
if (event.getCommandName().equals("async")) {
event.acknowledge(false) // log the original message, respond later (because you only have 3 seconds to respond)
.delay(10, TimeUnit.MINUTES)
.flatMap(commandThread -> command.sendMessage("asynchronous response")) // this can be done up to 15 minutes later
.queue();
} else if (event.getCommandName().equals("ping")) {
event.reply("Pong!").setEphemeral(true).queue();
}
}
Discord has made the disappointing decision to rush out this feature to the API. Due to this decision, it is very unpolished and is missing a lot of the feedback that was provided by the early testers.
Since I'm very busy with my own projects for work and university, I have made the decision to not rush out a JDA implementation and instead actually polish it and finish it properly first. Unlike Discord, I care to provide a quality API.I've compiled a small list of major issues that have not been addressed before releasing slash commands. Some of these things would now require breaking changes to the API so I have no hope for them to be addressed even in later patches.I'm pretty happy with how much work they've been putting into improving the API for this stuff. But its still a bit unfinished. I'll elaborate further in the linked Pull Request.
What is still missing?
User/Role/Channel objects for option values (you do get user objects with a MESSAGE_CREATE for mentions, why not here?)DMs still don't workThere is no indicator that the command was acknowledged or received by the bot unless the bot uses a specific ack typeicon on the left in the chat does not show the actual avatar (default instead)The feedback that made it in
What it will probably look like