AutomationWorking with LLMs

Build an automation with GPT

Give an LLM the Compact v3 specification and JSON Schema, describe your task and import a disabled rule. Download the instructions and six examples.

In this article

Suppose people in your course chat keep asking where to find the class recordings. You want Combot to answer automatically. Or you need a custom command that lets a moderator give someone a one-hour break from posting.

Describe the rule in ordinary language, ask GPT to prepare the JSON, and import it into Automation. You don't need to memorize field names: the attached schema is there to help.

What to give the model

Attach these two files to your request:

If you already have a similar rule, attach its export too. This is particularly helpful for complex media filters, nested conditions, and OR alternatives. Before sharing an export with a model, check for private invitation links, member IDs, and other information you don't want to share.

A ready-to-use GPT prompt

Copy this text and replace the last paragraph with your scenario:

Create a Combot Automation rule using the attached Compact v3 reference and JSON Schema. Do not invent fields or capabilities that aren't described there. If an exact solution needs information you don't have, ask brief questions first. Do not invent IDs, links, rank names, or my chat settings.

Create the rule disabled: en: false. First explain in two sentences when it will run and what it will do. Then provide one complete JSON block for import, with no comments inside it. After the block, list anything I need to check or select manually. If Automation cannot fully express my scenario, say so directly instead of substituting a similar one.

My scenario: people in the course chat ask “where is the recording” or “class recording.” The bot should reply: “Recordings are in the chat's pinned message. Look for the Class materials section.” Matching should be case-insensitive. Do not delete anything or restrict anyone.

A precise request needs fewer follow-up questions. Include the event, people, exclusions, action, and reply destination. If time matters, give the time zone. For a moderator command, say whether it should be sent as a reply to a member's message.

For example: “Only Telegram administrators and the owner can call /team_pause as a reply to a member's message. Restrict that message's author for one hour. Exclude Telegram administrators, Combot administrators, and the owner. Send a notification to the chat. Do not delete the command.”

Bring the rule into Combot

  1. Open Automation for the intended chat and choose Import.
  2. Paste the JSON the model created, from the first { to the final }. Do not paste the JSON Schema itself or the triple-backtick lines around the block.
  3. Open the added rule. Check the event, conditions, exclusions, action mode, recipients, and reply text.
  4. If the rule uses particular chat topics, select them again. Import resets the source topic to the whole source chat and send destinations to the current topic. Even correct IDs in the JSON do not remove this step.
  5. Try the rule in a suitable test chat before enabling it in your real group. For mutes, bans, deletion, and join approvals, be especially careful about the target and the bot's permissions.

Import adds new rules; it does not update existing ones. Importing the same JSON again creates another copy. Disabled rules also use the slots available on your plan.

If the editor rejects the result, give the model the exact error and generated JSON. Don't ask it to “remove whatever prevents import”: that can remove an important exclusion or limit.

Start with a ready-made example

Each file below contains one disabled rule. Copy the contents of the file you need into the import dialog:

The final example expects a reaction from a personal profile, not a channel identity or anonymous administrator. It has no “once only” limit: another matching reaction change can send another message. Use it to learn the settings, not to prevent reward abuse.

For a fuller explanation of the features, see the main Automation guide.

Updated September 9, 2026. Check the result in your own chat before enabling it. The language reference ends with a separate record of which examples were tried in Telegram and which were checked only during import.