Create command
Add a chat command with a reply, who may use it, cooldowns and response type.
POST https://cotlet.dev/api/v1/streamelements/commands
write Confirm
Creates a custom command in your channel. Variables such as $(user) work in the reply, as in the dashboard. The command answers in your chat as soon as it is on, so viewers see it. By default you confirm each call; you can switch that off for this tool.
Parameters
| Name | Type | Description |
|---|---|---|
| trigger string required | string | Command name with the prefix, e.g. '!discord'. |
| reply string required | string | Text the bot answers with. Variables like $(user) work. |
| level enum | enum | Everyone, Subscriber, Regular, VIP, Moderator or Super Moderator. Default: Everyone. |
| response_type enum | enum | say, mention, reply or whisper. Default: say. |
| cooldown_global integer | integer | Seconds between any two uses. |
| cooldown_user integer | integer | Seconds the same viewer must wait. |
| cost integer | integer | Loyalty points charged per use. Needs the Loyalty System. |
Request
curl -X POST https://cotlet.dev/api/v1/streamelements/commands \
-H "Authorization: Bearer $COTLET_API_KEY" \
-H "Content-Type: application/json" \
-d '{"trigger":"!discord","reply":"Join us on Discord: discord.example/lab","level":"Everyone"}' result = client.call("streamelements", "create_command", {"trigger":"!discord","reply":"Join us on Discord: discord.example/lab","level":"Everyone"}) const result = await cotlet.call('streamelements', 'create_command', {"trigger":"!discord","reply":"Join us on Discord: discord.example/lab","level":"Everyone"}); cotlet call streamelements create_command --data '{"trigger":"!discord","reply":"Join us on Discord: discord.example/lab","level":"Everyone"}' Example response
{
"command_id": "c_9e41b7",
"trigger": "!discord",
"reply": "Join us on Discord: discord.example/lab",
"level": "Everyone",
"response_type": "say",
"enabled": true
}