Skip to content

slash_response

Answer a slash command call that the server forwarded to your connection. Bots send this after they receive a slash_call for a command they registered with slash_register.

{
"cmd": "slash_response",
"id": "5e2d7c1a-9b4f-4a3e-8d6c-2f1e0b9a7c3d",
"response": "Lisbon: 24°C and sunny."
}
Field Type Required Description
id string Yes The id from the forwarded slash_call.
response string Yes Reply text. Must contain something besides whitespace. It is saved as sent, untrimmed.
author_id string No Sign the reply as your bot. Your user ID.
key_id string With author_id Your signing key ID. Starts with rotur_sk_.
signature string With author_id Signature over the reply, 80 to 100 characters.
timestamp number With author_id When you signed, in Unix seconds. Must be within five minutes of the server’s clock.

Signing is optional. Send all four signing fields or none; see signing. Local accounts can’t sign, and their signing fields are ignored.

Each call can be answered once, only by the connection it was forwarded to, and only within five minutes. The call is used up as soon as the server finds it, so if a later check fails you can’t retry.

The reply becomes a message. Where it goes depends on whether the command is ephemeral.

The message is saved to the channel or thread. You receive it as message_new, and so does everyone else who can see the channel.

{
"cmd": "message_new",
"channel": "general",
"message": {
"id": "9d4e1f7a-3c2b-4a8e-b6d5-0f1e2a3b4c5d",
"user": "weatherbot",
"author_id": "<weatherbot's user ID>",
"timestamp": 1758700002.118,
"content": "Lisbon: 24°C and sunny.",
"interaction": {
"username": "alice",
"command": "weather"
}
}
}

interaction shows who ran which command. If the original call was signed, it also carries the caller’s args and signing fields. If you signed the reply, the message carries your key_id, signature, and signed_at. For a thread, the frame and message include thread_id.

The message isn’t saved. Every connection of the account that ran the command receives it, with message.ephemeral set to true. You receive nothing, not even an acknowledgement.

Your reply passes through automod like any other message. The rules, bypass roles, and any timeout apply to your bot’s account, not to the person who ran the command.

Only the connection the call was forwarded to can answer it. It is blocked while you are timed out.

val When
Unknown slash call The ID is unknown, already answered, older than five minutes, dropped because a connection closed, or was forwarded to another connection.
Invoker cannot view this channel The person who ran the command can no longer see the channel or thread.
Signed message author does not match the authenticated user author_id isn’t your user ID.
Message signature is invalid key_id doesn’t start with rotur_sk_, or signature isn’t 80 to 100 characters.
Message signed timestamp is outside the allowed window timestamp is missing or more than five minutes from the server’s clock.
Message blocked by automod Automod matched the reply.
Message blocked by automod; failed to save timeout Automod matched and tried to time out your account, but couldn’t save the timeout.
Validation message id or response is missing or blank, for example response: Expected length at least 1.