Telegram Bot - Rules - Personal Messages / Group Messages
Personal Messages / Group Messages
Telegram Bot Rules
Overview | Email Repeater | Personal Messages and Group Messages | SMS Repeater | SMS Alert | WordPress Repeater
What This Rule Does
Sends a Telegram message to the groups while mentioning a user. The user is not notified directly, but within the group conversation only (this is due to Telegram API limitations, which does not offer such method). You can configure a series of filters, explained below.
Sends a Telegram message to the groups without mentioning specific users. You can configure a series of filters, explained below.
Setting Up a Rule
The interface for editing both rules (personal and group) is the same.
- Restrict to group ID - Include one or multiple groups. Must follow the format "-xxxxxxxx" (the character "-" followed by nine numerals). You can acquire the ID by sending the text /getGroupId in the group chat or by checking the plugin log. Note: Leaving this field empty will apply the rule to ALL groups.
- Personal telegram message / Telegram group message - The message to be sent to the group.
- Detect phrases - The rule will only run if it DOES include AT LEAST ONE of these words.
- Status - Set rule as active or paused.
- Must not include - The rule will only run if it DOES NOT include ANY of these words.
- Must include - The rule will only run if it DOES include ALL of these words.
- Snooze for - Set a number in hours. After the rule is activated, it will "snooze" for x hours before being ready to activate again. Useful to avoid spamming.
- Execute every - Execute the rule after every x times the trigger is activated. For example if detection is set to 3 the rule will be set on the following 1,4,7.
- Reset Count - Click the button to set the count of "Execute every" to 0. Example: the rule is executed every 10 messages and 9 have been sent, so it will be executed again in the next message. Click on Reset Count and the rule will require 10 messages to be sent again.
- Fire Shortcodes - You can place here one or multiple shortcodes which should be executed on the site running the bot once the message has been fired. The output of this shortcode will be printed to the telegram group associated with this message. Have a note that not all shortcodes can be executed in order to print the output in Telegram group. Learn more about how it works below. Note: this option was introduced in version 1.0.5.
Keyword Conditions Summary
Within this rule, you can set three conditions involving keywords. They all work in tandem.
For example, if you have these:
- Detect phrase(s) - "Hi", "Hey", "Hello"
- Must not include - "admin", "administration"
- Must include - "help", "urgent"
The following will happen with each message:
- "Hi, I need urgent help!" - Will trigger the rule
- "Hello guys this is urgent!" - Will trigger the rule
- "Hey, this is the admin. Does anyone need help?" - Will not trigger the rule, because it has "admin"
- "Hey!" - Will not trigger the rule, because it doesn't have "help" or "urgent"
- "Admin help!" - Will not trigger the rule, because it includes "admin". Additionally, it doesn't have "Hi", "Hey" and "Hello"
Since the plugin allows to execute shortcodes when some rule triggers, let's consider an example of how it works.
As an example, we will use a shortcode of a third-party plugin CM Map Locations - [cmloc-api]. This shortcode allows to enable or disable the API on the site, and as a result it prints the status of the API, if it's disabled or enabled.
So let's create two rules for group messages.
The first rule will fire on words "enable" and "api", and execute the shortcode for enabling API - [cmloc-api status="on"].
The second rule will fire on words "disable" and "api", and execute the shortcode for disabling API - [cmloc-api status="off"].
As a result, we can enable or disable the API on the site directly from Telegram:
Get more information about the Telegram Bot WordPress Plugin
Other WordPress products can be found at CreativeMinds WordPress Store
Let us know how we can Improve this Product Documentation Page
To open a Support Ticket visit our support center