Skip to content

Instantly share code, notes, and snippets.

@MiataBoy
Last active October 25, 2021 19:34
Show Gist options
  • Save MiataBoy/6c51640c8784f17727a940b30dd78004 to your computer and use it in GitHub Desktop.
Save MiataBoy/6c51640c8784f17727a940b30dd78004 to your computer and use it in GitHub Desktop.
An explanation composed of reasons why Slash commands are not good.

Slash commands

Slash commands, as we know are one of discord's new features released for bots to integrate into discord servers better. However, these same slash commands are not very appreciated by many members of the developer community. Several reasons will be explained here.

Danny - former discord.py maintainer

First, we start off by including arguments from Danny - the former discord.py maintainer who stepped down, and archived discord.py. (Looking for a fork? Try https://github.com/iDevision/enhanced-discord.py).

The link to the full gist created by Danny in whereabouts to his leave from d.py can be found here.

Around July and August 2020, the Discord employees started talking to the people in the Discord Infrastructure server about the possibility of Slash Commands finally coming to Discord. This feature was one that had been in the talks since the very beginning of Discord's history, so some people were hyped it was finally coming. Unfortunately, at around the same time, Discord employees were hinting that message content would be removed or restricted.

image

After my mole shared these images with me, I decided to share them with the remaining library developers in our private server. We began to see the introduction of Slash Commands as a way to destroy our old work. At this point, Slash Commands were not actually released. They were mainly in the development phase. However, we figured that when Slash Commands would be introduced to the public, that they would remove message content along with it.

Shortly after, the people in the Discord Infrastructure server got an early access beta for the implementation of Slash Commands. My mole also gave me the gist (not publicly available) explaining how the system was going to work. The Discord employees did not share this gist or information with us until later. When they finally shared the gist with us, they planned to have a meeting with us about how they wanted the system to work. I did not participate due to it taking place while I was at work. The library developers who participated said they shared a lot of feedback for how they wanted Slash Commands to work. Most of this feedback ended up being discarded.

When the Slash Commands beta reached the public phase, a lot of the general public ended up repeating the same criticisms and feedback that the library developers and the big bot developers had shared with the Bot & API team. After some amount of pressure from the community, they did finally implement some changes, though permissions remained a massive pain point. Fundamentally, Slash Commands had a fatal flaw: they weren't tied to a user. This meant that traditional permissions did not function with Slash Commands. For traditional bots, the administrator of a server could block specific bots on a per-channel basis by blocking the Read Messages permission. For a Slash Command bot, this would no longer possible since Slash Commands bypassed all forms of permissions.

We were told that the permissions system would improve over time, though this never ended up materialising. The ability for a Slash Command (aka an Interaction) to bypass the @everyone permission wasn't fixed until May 2021, 6 months after it had already been reported.

Message intent forcing switch to slash commands

It's very well known fact among all bot developers now that the message intent becomes a privileged intent in April 2022. However, this privileged intent leaves most of the developer community in a hard ultimatum: Either rewrite the bot into slash commands, or take it offline. If you can't get the message intent, you are basically left on your own with these two choices. Unfortunately, many people have already had to choose to take their bots offline, and many people will continue to do so.

As such, we turn back to Danny's gist:

Around early June 2021, the top 8 most popular library developers were contacted regarding a special meeting about a topic that was important to all of us in the ecosystem. Knowing what we knew about the message intent, we figured that this would be the last chance we would get in order to defend the ecosystem from breakage and hopefully get them to change their minds on the entire thing. The meeting was bound by an NDA, which made us reluctant to sign it, but since we believed and were told that this would be our final chance to get a seat at the table for this change, we all agreed with the sole purpose of convincing the developers that this direction was a bad idea.

Unfortunately, due to being legally bound by this NDA, I cannot share too many details. However, I will mention that the morale from all the library developers fell quite fast.

All of us library developers were against the change for message content to become a privileged intent. It falls under the same bureaucratic issues that regular privileged intents suffer from, except with more devastating consequences. A lot of current bots in the ecosystem are faced with a choice of either getting rewritten to comply with changes I believe to be unnecessary, or to die. Discord seems to believe that this change is for the better – but no alternative path was explored or brought up. Instead, they opted to deploy the nuclear option and are hoping to fix the problem that way. Discord also believes that most bots will fully migrate over within the timeline given. I do not believe that this will be the case.

Discord has shown on many occasions that the developer community is not one they are willing to give in to. And this is clearly another sign. Thus, lets explore all the faults and issues with the befamed slash commands that some people seem so happy with.

Syncing

One of the main issues with slash commands is how long they take to sync. Up to an hour for a single command to sync and appear in the list of commands in a even larger list of a variety of bot's commands. Message commands never really had that issue as they were nearly instant, aside from the bot having to boot up or restart. With slash commands, the time it takes to sync also gets greater the more guilds your bot is in.

Rolling back

Some bots have rather extensive and long slash commands taking up a bigger portion of time then usual. If you mess up somewhere in the command or the bot does, you have to rewrite the whole thing. You can't CTRL + Z your progress back, you can't undo sending it or the likes. This just makes it more time consuming and a bigger hassle especially when you need it done quick.

Command limit

Discord imposed a 100 command limit on slash commands. This is a large barrier for many bots ESPECIALLY for multipurpose bots. It screwed them over as this either forces them to [1] use a lot of subcommands (which arent fluent either) or to [2] simply die. While for some smaller and more one-purpose dedicated bots this works out fine, it can be a huge pain to those who need a higher cap.

"group" commands

There are a variety of bots that use group commands (main (base) command and subcommands). However, many also allow invoking the base command for extra information on the subcommands, or for other purposes. Slash commands do not allow this, they only allow executing the base command WITH the subcommand.

Permissions

Additionally, slash commands are not tied to users, causing permission systems to simply break on slash commands. You can't deny slash commands from being created in any channels. They are global across the whole guild and that can't be changed or restricted. This puts a block on any chance of also easing the job for moderators in relation to channel topics.

Switching to slash commands

While in some libraries it's objectively easy to switch to slash commands now, there are still a bunch of libraries that have not even released slash command compatibility yet, or seem to be trying their best to make it hard for developers (looking at you, discord.js). Discord does not put this into account, and simply neglects this and forces bot developers to either use something that does offer slash commands, or offer them in a way they can understand, OR forces bots to simply die in April. Additionally, errors in slash commands are very vague for user and developer. Making it even harder to understand the problem with one and making it harder to fix the issue.

Back to the message intent

But you know. I don't think any of us would have been half as pissed as we are about slash commands if discord hadn't decided to force us to either switch or kill our bots through the message intent under the norm of privacy without considering any other options or plans that also benefit the developer community. Their neglect towards the library developers, bot developers and pretty much most of it's users through the decisions they have made, will definitely not be forgotten by any of us anytime soon.

Discord: Fix your shit.

Thank you for reading this, and thank you to those who have helped me in the writing of this gist.

@JDJGInc
Copy link

JDJGInc commented Oct 23, 2021

slash commands also happen to use the everyone role permissions, and it should really use what the bot has, and slash commands, should be tied to read message content or have some way to restrict their commands per channel or globaly, so it will work in less channels.
two: they need to bring down the time of syncing slash commands as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment