Scratch for Discord
Web-ApplicationDiscord Server
  • 🏠Home
  • 👋Introduction
    • About Scratch for Discord
  • 🎓Tutorial
    • Block Usage
    • Bot Setup
    • Hosting
    • Slash Commands
  • 🧰Toolbox
    • 💼Base
    • ⚽Basic
      • Text
      • Math
      • Colors
    • 🔩Functions
      • Logic
        • If logic
        • State Machines
      • Loops
      • Lists
      • Variables
        • Var
        • Let and Const
      • Functions
      • Collections
      • Buffers
      • Objects
      • 💾Database
      • 📂Files
        • 🖼️Images
          • 📬Member Cards
      • 🔑Securing
    • 🖥️Discord
      • 🎨Embeds
      • 📻Interactions
        • ⚒️Slash
          • 📤Actions
            • 🧱Stacks
            • 🔎Reporters
          • 📥Events
        • Button
        • Menu
        • Context menu
        • Forms
      • 🥁Music
        • 📜Music Lyrics
      • 🗄️Servers
        • 😀Emojis & Stickers
          • 📤Actions
          • 📤Events
        • 🔰Roles
          • 📤Actions
            • 🧱Stacks
            • ❔Booleans
          • 📤Events
        • 🗓️Schedule events
          • 📤Actions
          • 📤Events
        • 📺Channels
          • 📤Actions
          • 📥Events
        • 💬Messages
          • 📤Actions
            • 📝Messages
            • 📢Threads
            • 🔗Webhooks
            • 🥳Reactions
          • 📥Events
          • 🔎Reporters
            • 📌Message Context
        • 👥Members
          • 📤Actions
          • 📥Events
            • 📭Leave
    • 🚀Applications
      • 📊Charts
    • 🌐Websites
      • Dashboard
  • 🖥️Interface
    • ⚙️Settings
    • ⌨️Hotkeys
    • ▶️Download & Run
    • 🖇️Git
  • 🪄Advanced
    • Custom Code
  • 🔗Links
    • 📦Packages
    • ❔FAQ
    • Web-Application
    • Discord Server
    • Source Code
Powered by GitBook
On this page
  • Creating Slash Commands
  • Receiving Slash Commands
  • FAQ
  • What is a sub-command?
  • What are slash options?
  • How to delete slash commands?
  • What are ephemeral interaction replies?

Was this helpful?

  1. Tutorial

Slash Commands

Learn how to handle your bot's slash commands!

PreviousHostingNextBase

Last updated 1 year ago

Was this helpful?

More info: Slash

Creating Slash Commands

This code creates a new slash command named 'say' which includes a string option called 'text'.

Receiving Slash Commands

Upon receiving the slash command, the bot will reply to the interaction with the provided option 'text', repeating the specified text string.


FAQ

What is a sub-command?

Subcommands organize your commands by specifying actions within a slash command. ex: /role add/edit/delete

What are slash options?

Slash options are used to allow the user to specify additional information for the command. Some options are String, Integer, True/False, Attachments User or Role, Channel

How to delete slash commands?

See the block 'Create slash commands' as a "Overwrite global commands". Removing a slash command, the module will ensure that unused commands are deleted and new ones will be created

What are ephemeral interaction replies?

Input to Ephemeral field TRUE - visible only to the author, FALSE - Visible to anyone.

Congrats! You learned how to create and receive slash commands.

🎓
🎉
Example of an interaction reply visible only to the author