Switch sectionYour AI and integrations

Slash commands: your own commands in the message box

How to add a command like /deploy that sends a request to your address and posts the reply in the channel.

A slash command is a word with a “/” in front that you type in the message box of a channel: /deploy, /report. You can add text after it. Syncra sends the command to your service and posts the reply in the channel as the bot. That way a command can start a release, show a status or look up an order without leaving the chat.

Workspace owners and admins add commands. A command belongs to a bot.

How to add a command

  1. Open the workspace settings, the Bots tab, and the bot page.
  2. In the Slash commands section, enter the name in Command. Allowed: lowercase Latin letters, digits, “-” and “_”, up to 32 characters. The “/” is already printed before the field, so type the name without it.
  3. If you like, fill in Description (optional) to explain what the command does.
  4. In Request URL (optional), paste the address of your service.
  5. Press Add command.

The command appears for everyone in the workspace, in the list of commands that opens when you type “/” in the message box. To pause a command, turn off the switch on its row. Delete removes the command for everyone and cannot be undone.

The names /shrug, /me, /tableflip, /unflip and /help belong to built-in commands. Two commands in one workspace cannot share a name.

What your service receives

Syncra sends a POST request with JSON: the command, the text after it, the channel, the workspace, the name and id of the person who ran it, and the bot. The request carries the same three headers as an event subscription request, and X-Syncra-Event holds slash.command. Your service checks the signature the same way as in Event subscriptions. Each command has its own secret: to see it, press Reveal next to Signing secret on the command’s row.

What to reply

Your service returns JSON like {"text":"Release started"}. Syncra posts that text in the channel as the bot, cut to 4000 characters. Your service must reply within 5 seconds. Syncra does not retry.

If you leave the address empty

If the address is empty and the bot has AI responses turned on, the bot’s built-in AI answers the command. If there is no address and the bot’s AI is off, the command does not work.

What does not exist

  • Delayed replies: you must answer right away.
  • Replies that only the person who ran the command sees.
  • Buttons and other interactive elements in the reply.
  • Retries. If your address does not answer within 5 seconds or answers with an error, the command ends with an error and Syncra does not try again.

Updated:

More in “Your AI and integrations”

Back to the category

Didn't find an answer?

Message us on Telegram. A person from the Syncra team replies.

Message us on Telegram