Skip to content

slash_call

Run a slash command, such as /nick or a bot’s /weather, in a channel or thread. Send this when a user picks a command from the list returned by slash_list.

{
"cmd": "slash_call",
"channel": "general",
"command": "weather",
"args": {
"city": "Lisbon"
},
"author_id": "<alice's user ID>",
"key_id": "rotur_sk_7d3e9b",
"signature": "Jm9Xk2l1bG9yZW0gaXBzdW0gZG9sb3Igc2l0IGFtZXQgY29uc2VjdGV0dXIgYWRpcGlzY2luZyBlbGl0IHNlZA",
"timestamp": 1758700000,
"nonce": "b3f1c2d4-5e6f-4a7b-8c9d-0e1f2a3b4c5d"
}
Field Type Required Description
channel string Unless thread_id is set Text or voice channel to run the command in.
thread_id string No Thread to run the command in. channel then defaults to the thread’s parent; if you send it, it must match.
command string Yes Command name, without the /.
args object No Option name to value. Defaults to {}. Each value must match its option’s type, as described on slash_register.
username string No Picks a command by its registeredBy value when several share the name. Use originChats for a built-in and plugin:<name> for a plugin.
author_id string For Rotur accounts Your user ID. Part of the signature.
key_id string For Rotur accounts Your signing key ID. Starts with rotur_sk_.
signature string For Rotur accounts Signature over the call, 80 to 100 characters.
timestamp number For Rotur accounts When you signed, greater than zero.
nonce string For Rotur accounts A fresh random value, 16 to 128 characters.

Rotur accounts must sign every call; see signing slash calls. Local accounts don’t sign, and any signing fields they send are ignored.

What you get back depends on who runs the command.

The server runs the command at once and replies with a message_new frame carrying the result:

{
"cmd": "message_new",
"channel": "general",
"message": {
"id": "c0a8e7f2-1b3d-4c5e-9f6a-7b8c9d0e1f2a",
"user": "originChats",
"author_id": "originChats",
"timestamp": 1758700000.412,
"content": "Slow mode set to 10 seconds in #general.",
"interaction": {
"username": "alice",
"command": "slow"
}
}
}
  • For a public command, the message is saved and everyone who can see the channel receives it.
  • For an ephemeral command, only your connection receives it. It isn’t saved, and message.ephemeral is true.

user is who replied: originChats for a built-in, plugin:<name> for a plugin. interaction names the command and the username of the person who ran it. For a signed call it also carries args and the signing fields, so other clients can verify who asked. For a thread, the frame and message include thread_id.

For a command registered with slash_register, you get an acknowledgement with a call ID:

{
"cmd": "slash_call",
"id": "5e2d7c1a-9b4f-4a3e-8d6c-2f1e0b9a7c3d",
"val": true
}

The bot’s connection receives the call:

{
"cmd": "slash_call",
"id": "5e2d7c1a-9b4f-4a3e-8d6c-2f1e0b9a7c3d",
"val": {
"command": "weather",
"args": { "city": "Lisbon" },
"commander": "weatherbot",
"ephemeral": false
},
"invoker": "<alice's user ID>",
"invokerUsername": "alice",
"channel": "general",
"ephemeral": false
}

The forwarded call also has thread_id when run in a thread, and the caller’s author_id, key_id, signature, timestamp, and nonce when the call was signed. The bot answers with slash_response within five minutes. The reply then arrives as a message_new frame like the one above.

The pending call is dropped, with no message to anyone, if the bot doesn’t answer in time or either connection closes.

You need to be able to view the channel or thread. The command’s own restrictions apply too: its permission, whitelistRoles, and blacklistRoles. Built-in commands list their permission on slash_list.

It is blocked while you are timed out.

val When
You do not have permission to use slash commands in this channel The channel or thread doesn’t exist, you can’t view it, it’s a forum channel without a thread, or it doesn’t support chat.
Unknown slash command: /<command> No command has that name.
No slash command registered by '<username>'. Registered by: <list> username doesn’t match any registrant of that command.
Multiple users have registered this command. Specify a username to disambiguate. Registered by: <list> Several registrants share the name and you didn’t send username.
You do not have permission to <permission> You lack the command’s permission. Underscores become spaces, as in You do not have permission to manage users.
Access denied: forbidden roles You have one of the command’s blacklistRoles.
Access denied: required role missing You have none of the command’s whitelistRoles.
Missing required argument: <option> A required option isn’t in args.
Unknown argument: <option> args has a key the command doesn’t define.
Invalid type for argument '<option>': expected <type> A value has the wrong type, such as a fraction for int.
Invalid value for argument '<option>' An enum value isn’t one of the choices.
Slash commands must be signed A Rotur account sent no signing fields.
Signed slash command author does not match the authenticated user author_id isn’t your user ID.
Slash command signature is invalid key_id doesn’t start with rotur_sk_, or signature isn’t 80 to 100 characters.
Slash command freshness proof is invalid timestamp is missing or not positive, or nonce isn’t 16 to 128 characters.
Slash response must be a non-empty string A built-in or plugin command returned no text.
Command error A built-in or plugin command failed and returned its own message, for example User 'bob' not found.
Validation message A field has the wrong type or length, for example nonce: Expected length at least 16.