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

Parameters: create_command
NameTypeDescription
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
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"}'
Python
result = client.call("streamelements", "create_command", {"trigger":"!discord","reply":"Join us on Discord: discord.example/lab","level":"Everyone"})
Node.js
const result = await cotlet.call('streamelements', 'create_command', {"trigger":"!discord","reply":"Join us on Discord: discord.example/lab","level":"Everyone"});
CLI
cotlet call streamelements create_command --data '{"trigger":"!discord","reply":"Join us on Discord: discord.example/lab","level":"Everyone"}'

Example response

JSON

{
  "command_id": "c_9e41b7",
  "trigger": "!discord",
  "reply": "Join us on Discord: discord.example/lab",
  "level": "Everyone",
  "response_type": "say",
  "enabled": true
}

Sign in once. Your agent does the rest.

Sign up and add the apps you need. Free 7-day trial with 2,000 credits, no card needed.