AutomationFine-tune conditions

Choose the right messages and people

Limit replies to the right topics and times. Choose participants, exclusions, invitations and phrases to look for.

In this article

Time, chat topics and invitations

The same question may need different replies. During the day, support can help right away; at night, it can say when the team will return. A webinar guest may need different information from a course student. Time, location and invitation conditions let you make these distinctions.

When to reply

Any time suits information people always need. A link to the rules, for example, is useful day and night.

Schedule lets you choose weekdays and time windows. Suppose tutors work Monday to Friday, from 10:00 to 18:00 Moscow time. Select weekdays and the corresponding window. You can add several windows, such as before and after a break, or quickly choose every day, weekdays or weekends.

Enter UTC times in the schedule fields; the editor shows local time underneath as a hint. To reply from 10:00 and switch to the night-time message at exactly 18:00 Moscow time, enter 07:00–14:59 UTC. The last specified minute is included in the window.

Weekdays are also selected in UTC: your late evening may fall on a different UTC day. If your time zone uses daylight saving time, review the schedule after the clocks change.

Run outside this time is useful for a “We'll be back in the morning” reply. Set working hours and enable this option. Matching questions outside those hours receive the out-of-hours message.

Date range is useful for a temporary task. For example, answer questions about the autumn course only while registration is open. Set the beginning and end of that period.

If the chat already has closing hours

Choose Closing hours to use the period from the chat's own settings. If an administrator changes it, you will not have to update the same times in Automation too.

For example, the settings specify 22:00–06:00 UTC. The condition starts matching at 22:00, continues overnight and stops matching at 06:00. Enabling Run outside this time checks the opposite period.

If closing hours are missing, invalid or have identical start and end times, the condition does not match — even with the outside-time option enabled. 00:00–00:00 does not mean “all day”.

The key point about time: the bot waits for an event. It can answer a question at ten in the morning, but it will not post information just because the clock reaches 10:00. For timed posts, use the Combot Announcement Scheduler. The closing-hours condition also does not allow members to write while the chat is closed to messages.

Which chat topic to check

A course chat might have Study, Support and Off-topic. Under Where, choose:

  • Source chat if the rule should cover every topic. For example, general information on a particular command.
  • Selected topic for a particular area, such as payment replies only in Support. You can select several topics from the list or enter their numeric IDs.
  • General topic for the chat's general area rather than a separate topic.

This is where the bot looks for a matching event. Where it sends the reply is a separate setting. A person might ask a question in Support while a notification goes to the team's log channel.

Which invitation someone used

Suppose a school has two links: one for guests at an open lesson and another for course students. You can show different welcomes depending on the link used.

The editor offers these options:

  • Any source. Welcome everyone in the same way, regardless of the invitation.
  • Combot invite links. The link is recorded in this chat's invitation catalog. Select the open lesson's specific link, enter its code or paste the full URL. You can also exclude selected links.
  • External invite link. Telegram provided a link that is not in this chat's Combot catalog. You might notify moderators about such arrivals, for example. This alone does not make the person a rule-breaker.
  • Admin-created links / User-created links. Quickly select already loaded links from the relevant creator group, such as invitations belonging to the organizing team.
  • No invite link. Matches when the join data confirms that no link was used. For example, provide separate information for this way of joining.
  • Chat folder invite link. For joining through a shared Telegram folder, if Telegram reports it. For example, briefly explain what this particular chat is for within the collection.

Two important distinctions. A link you did not select is not necessarily external: Combot may know it. And missing invitation information does not prove someone joined without a link. The bot must not guess the source when the data is unavailable.

The list loads up to 100 links at a time. When selecting links with the Admin-created links button, load the pages you need first: it selects only the links already shown. Future invitations are not added to that selection automatically. Combot still distinguishes known and external links using the entire catalog, not just the visible page. Entering a URL manually does not add it to the catalog.

For automatic admission to an event, start with a specific link. An “all known links” condition covers far more invitations. Remember that a link can be forwarded: it does not prove identity or payment.

Choose who the rule applies to

A chat includes newcomers, regular participants and moderators. They do not always need the same response. A newcomer might need directions to the materials, while a warning command should be available only to the moderation team.

First, identify the person you mean

If Anna adds Ilya to the chat, the welcome is for Ilya, not Anna. If Anna replies to Ilya's message with a command, you need to decide who the action affects.

That is why field labels change with the event:

  • Who — the author of an ordinary message.
  • Applicant — the person requesting to join.
  • New member and Who added — Ilya and Anna, who invited him.
  • Member and Who initiated — the person who left and whoever removed them, if they were removed.
  • Triggered by and Applied to — the command's author and the person selected through the reply.
  • Replied-to user — the author of the message selected using Reply.

Before choosing a role or activity condition, check which person you are configuring it for.

All messages or only replies

In a learning chat, you might handle a new question differently from a reply to someone else's question:

  • All messages — replying or not replying does not matter. For example, look for “where is the recording” throughout the conversation.
  • Only replies / Any reply — messages sent using Reply match. For example, show feedback-format guidance only in replies to students' work.
  • Never trigger on replies / Not a reply — standalone messages match. For example, remind someone posting a new job in Jobs about the required format.

Replied-to user narrows the rule further: a reply to a member, an administrator, a bot, Combot, yourself or a linked channel post. The available options depend on the event. For example, you can handle replies to a tutor's message separately.

User first message uses “Messages in group equals 1”. It can help introduce information to a new participant. However, statistics updates and incoming messages are not processed in perfect lockstep, so this condition cannot promise a single reward for the very first message.

Ready-made user groups

The editor calls these Auto-groups. They let you select people without listing each person manually.

New members. For example, send question-format tips to people Combot still considers newcomers. The chat's settings determine this using time since joining, message counts and applicable exemptions. It is not the age of the Telegram account.

Regular members. People recorded as being in the chat. For example, limit a help command to group members. “Regular” does not mean “has been here a long time”: a newcomer can belong to this group too.

Ex-members. People known to have left and not currently in the chat. For example, distinguish a returning member's join request from a request with no such known history.

Whitelisted users. The allowlist in moderation settings, where people are listed by ID or username. For example, exclude trusted helpers from a particular reminder about posting links. Add the exclusion explicitly: having an allowlist does not automatically cancel every rule you create.

Telegram admins. For example, let them use /team_warn.

Combot admins. People separately granted access to the Combot dashboard. For example, allow a prepared command for community helpers who work through the dashboard. This access does not make them Telegram administrators.

Owner. The person Telegram identifies as the chat owner. For example, reserve a particular custom command for them.

If you select Telegram admins and Combot admins, Any allows someone from either group. All requires membership in both. This grouping rule works for both the event's author and the other selected person.

If a separate Admin mode setting appears, check that too: it can include everyone, only Telegram administrators or everyone except them. Selecting “only admins” here while excluding them elsewhere, for example, creates a contradiction.

Time in the chat, messages, experience and reputation

These conditions describe an audience more precisely. For example: “Joined no more than two hours ago and has sent no more than ten messages.”

  • XP: accumulated experience. For example, separate information for people with at least 500 XP.
  • Reputation: its current value. For example, allow a custom information command for members with a reputation of at least 10.
  • Messages in group: the number of messages Combot knows about in this chat. For example, tips for people with no more than 10 messages.
  • Warns: the number of active warnings. For example, give different reminders to someone with no warnings and someone who already has one.
  • Time since join: time elapsed since a known join. For example, help for people who joined in the last two hours.
  • Rank: a level on your chat's scale. For example, select people who have reached a rank without calculating its XP threshold yourself.

Numbers support Equals, At least and At most. The difference matters: “exactly one message” does not match someone with a hundred messages, while “at least one” does.

For time, you can choose seconds, minutes, hours, days, weeks and months. A month here is 30 days, a week is 7 days and a day is 24 hours. If Ilya joins at 23:50, he has been in the chat for twenty minutes at 00:10, not a day.

Combine time and activity using All or Any and add exclusions. For example, require both a short time in the chat and a small message count for newcomer tips. An excluded person does not re-enter the same set just because another condition matches.

Missing information is not zero. An unknown join time does not make someone new, and an unknown message count does not make them silent. Negating a condition does not fill in missing information either.

Older rules. A rule may count only complete days: both 25 and 47 hours become one day. Explicitly choose a time unit for a precise comparison; simply opening and saving the rule does not change this behavior. Also check the operator: “equals one day” and “at least one day” select different people.

Time since joining is not time since the first message. Ilya may have joined on Monday but first written on Friday. Time since the first message or another first activity is not available here. Remove or replace such a condition in an old disabled rule before enabling it.

Information from a member's profile

These checks concern available account information, not a person's contribution to the chat:

  • Username: whether one exists and what it is. For example, exclude a known team account from a particular reminder. Enter the username without @.
  • Name / Last name: for example, ask a student with no last name to introduce themselves according to the course's rules. A display name is not proof of identity.
  • User ID: the account's numeric identifier. For example, allow a command for two specific tutors even if their usernames change.
  • Is Telegram Premium: for example, a separate information command for Premium users. The condition depends on Telegram providing this flag.
  • Is bot account: for example, distinguish replies to bots from replies to people in the replied-to user conditions. This option is unavailable for join requests.
  • Language: for example, choose an English reply if Telegram provides the code en. This does not check the message's language, citizenship or country; the code may be missing.
  • Bio: text from a join request. For example, highlight requests whose description mentions a course name. This does not let the bot read the profile description of everyone sending ordinary messages.

Text conditions can use an exact match, a partial match or a search pattern. “Has a username” and “username contains support”, for example, are different checks. When combining several options, make sure none is accidentally empty: it could make the condition broader than intended.

Find the messages you need

A jobs chat needs to recognize listings, support needs to spot payment questions, and a course group needs to notice assignments. Combot finds them using the details you specify: words, links, length and message type.

Start with what the person sent

What selects the message type, while Options adds requirements for it.

You can choose text, a media caption, photo, video, animation, audio, document, sticker, voice message, video note, contact, location, poll, dice, game or paid media. Some choices are under More.

For example, “Homework” sent as a standalone message is text. The same words underneath a photo of a notebook are a caption. Looking only for ordinary text will not cover the second case.

Some properties go together: a photo and a caption are common. But one file should not have to be both a document and a voice message. For different alternatives like those, choose Any, not All.

Set requirements for each alternative, such as ordinary text containing a phrase or a photo with the same phrase in its caption. Review Options after changing the message type: documents and polls have different settings.

Phrases: what the person wrote

Take a support chat. There are several ways to recognize a request:

  • Exact text: the entire text is “rules”. Useful for an agreed short request; “Where are the rules?” is different.
  • Contains phrase: “how to pay” matches inside “Please tell me how to pay for a subscription”.
  • Text starts with: “Report” helps identify messages following a “Report for this week…” template.
  • Text ends with: #done identifies messages people have agreed to end with that marker.

The bot searches for the specified text; it does not understand every way to phrase a question. If people write “where to send the money” instead of “how to pay”, add that phrase separately or create an OR alternative.

Words: whole words or parts of words

In a pet chat, the Whole word “cat” should not match “catalog”. Searching Contains in word is useful when you care about the sequence of letters itself.

You can also search for a word's Word starts with or Word ends with. For example, the beginning “vacanc” can cover “vacancy” and “vacancies”, while the ending ing can help with an English exercise. Try several ordinary messages: a very short fragment can produce unwanted matches.

Enter a phrase containing spaces as a phrase. List fields turn values into individual items, so do not accidentally split “home assignment” into two independent words.

Capital letters, length and writing systems

Case-sensitive distinguishes “Rules” from “rules”. Everyday questions usually work better without depending on capitalization. A fixed, case-sensitive label may benefit from the distinction.

Message length / Caption length is measured in characters. For example, ask authors of job listings longer than 2500 characters to put extra details behind a link. Set a minimum, maximum or both; leaving one side empty means no limit on that side.

Character sets can detect Cyrillic, right-to-left writing such as Arabic or Hebrew, and Chinese, Japanese and Korean characters. The editor may use the abbreviations RTL and CJK. For example, a language club might offer exercise-format guidance when Cyrillic appears.

This does not identify the language of the whole message. A Russian phrase inside English text still contains Cyrillic. Do not treat that property as proof of the language someone speaks.

More complex searches: regular expressions

A regular expression is a pattern describing several possibilities at once. For example, webinar|livestream looks for either word. Two simple phrases can also use ordinary conditions: you do not need to know regular expressions to use Automation.

If you need them, the engine is Python regex, not JavaScript. Enter the pattern itself, without surrounding slashes or flags. The pattern-testing link can help during setup, but still try several messages in a test chat afterward.

Links, mentions and other elements

Sometimes the important part is not a word but an element included in the message.

Command. For example, find /course_info inside a message. This checks content; create a custom command that makes the bot reply using Type, as explained in Custom commands.

URL — a visible link. For example, identify homework messages linking to a particular learning site. Set a specific address or a domain — the site's name.

Text link. A message says “My portfolio” with the address hidden behind those words. This is a separate link type. To recognize links regardless of presentation, include both visible URLs and text links.

Mention. For example, notice messages addressed to the support account. Set a username or, for a supported mention type, a numeric user ID.

Hashtag / Cashtag. A message with #vacancy can receive posting guidance. $TON can identify mentions of that symbol in a themed discussion. This is a text property, not a check of financial information.

Email. For example, remind job advertisers that applications should go to the address in their post. Search for a specific address or email domain.

Phone. If a listing contains a number, remind its author that contact details are public. Set a number or prefix, such as +7. The bot checks what was written, not the account's hidden phone number.

Emoji. For example, respond to an agreed ✅ marker in a report. Enter an ordinary emoji as a symbol or a custom emoji by ID; the editor explains how to get the ID. An emoji in text and a reaction under a message are different things.

Text formatting. For example, remind a film club about spoiler rules or identify student submissions with code blocks. Available options include bold, italic, underline, strikethrough, inline code, code blocks, spoilers, ordinary quotes and expandable quotes.

For supported elements, select any value, only listed values or exclusions. “The message has a link” and “the message links to our school's site” are different conditions.

Filtering is not a security check. An allowed domain or a .pdf extension does not guarantee that a link or file is safe. These filters help organize a chat; they do not inspect the contents for you.