Skip to content

Instantly share code, notes, and snippets.

@AtoraSuunva
Last active June 10, 2023 05:21
Show Gist options
  • Save AtoraSuunva/c55dd6c7e157eeb25c26ef09f47790d8 to your computer and use it in GitHub Desktop.
Save AtoraSuunva/c55dd6c7e157eeb25c26ef09f47790d8 to your computer and use it in GitHub Desktop.
Why Slash Commands?

Recently, all of my bots have been migrated to accept slash commands (or "interactions") only.

Why?

Because:

  • They provide a nice in-client way to see what commands a bot has and what parameters commands have
  • Also provide autocomplete/choice parameters so you don't have to remember what exactly the bot expects
  • I don't have to maintain a parameter parser/validator/shlexer anymore
  • Bots literally have no choice (see below)

I can't see any slash commands from your bots

The bot might not have permission to register slash commands in the server. Try reinviting it again (no need to kick it) and seeing if that works.

The invite modal should show "Create commands in a server"

Screenshot of the Discord oAuth modal

If that still doesn't work, you should check Server Settings > Integrations > [Bot name]

Screenshot showing an application's command permissions

If you still don't see any slash commands, and you're sure you should have enough permissions to see them, contact me (@atorasuunva)

I hate slash commands, can you keep message commands?

I can't. I literally can't.

If you've been out of the loop on Discord Dev news, Message Content is now a privileged intent.

What this means is that verified bots can't access your message content without first being approved for it by Discord. And Discord requires bots to have a specific required need for message content to receive that intent, which most of my bots don't qualify for.

Since my bots can't read your messages, they can't handle any message commands at all.

What about RobotOtter? It has message intent for mod logs

I really really really don't want to maintain a message command handler on top of the slash command handler I have.

Bots can still see message content if they're pinged, why not support that?

See above (I don't want to maintain even more things), and it sounds like a pretty rough user experience.

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