What is a slash command?

Slash commands can be used by your users to send a command to your app. For example,

Your app can use a slash command when you want to provide your user a CLI to perform some action. Note that the user can perform the same action using a chat tab button or widget. However power users may prefer using a slash command. A user can always see the entire list of slash commands available from various apps by typing "/" -

What is the format of a slash command?

A slash command comprises of a forward slash followed by the command name. Your slash command may also accept additional text.

/<commandName> <additional text>

How do I create a slash command?

  1. Go through Creating an App to setup your app in the developer dashboard.
  2. In the Advanced Info section, enable the slash command.

    Fill in the info below:

    Name of commandYesThe name of the slash command
    Short descriptionYesA short description of what the slash command does. This will be shown to the user against the slash command.
    Syntax hintNoA hint to the user on how to use the command
    Select action for Slash commandYesSelect an appropriate client action for this slash command.
  3. Save these changes, then follow the steps in app installation and install this app into your own Flock account.
  4. Once the app is installed, whenever a user enters a slash command, the event client.slashCommand will either be sent to the event listener URL or appended to the widget or browser URL, depending on the client action you selected in step 2.
  5. If you want to send a message back to the user upon receiving the event or opening the widget or browser URL, see Sending Messages.