# Automatic moderation
# General settings for filters
The bot will delete its messages in the chat, which is allocated a limit after 5 minutes.
If a chat member constantly breaks the rules, the bot will not send warnings in a row so as not to clog the chat.
If the user wants to edit the media file, the bot will delete this message. This is done specifically for those users who want to substitute a chat.
For example: he sent a photo of an owl, this photo went up in the feed, then he edits his message and instead of an owl inserts a photo of prohibited content, complains, and thus Telegram can block the chat.
В дальнейшем будет реализована автокоррекция орфографических и грамматических ошибок. Пока эта функция исправляет неправильную раскладку.
Например, Вы написали в чат слово «Ghbdtn», в ответ на Ваше сообщение бот отправить «Привет».
When sending multiple photos together, Telegram groups them into albums (maximum 10 photos). You can limit the number of photos in albums.
Users will not be able to add bots to chat. The included toggle switch "Ban users adding bots" will ban users forever.
Removing commands addressed to the bot. We recommend not to enable it if you write commands with comments "
/mute 1h @username here for you for certain actions".
Time interval in minutes - if N minutes have not passed since the last warning from the bot, the new warning will not be shown.
Here you can set the time for the restrictions "Delete from chat for a while" and "Quiet mode" for all filters.
# Face - control
Face Control is another weapon against spam. If the filters above work on the content of messages, then Face Control processes nicknames and usernames of users.
The bot will give "mute" (restriction of any actions in the chat) to the participant for the specified time from the moment the participant joins.
Limiting the length of a user's nickname (values are inclusive).
Ability to ban nicknames with Chinese characters/characters with RTL.
List of allowed languages installed in the Telegram app. Specify values by type: ru, en, ua. Due to the peculiarities of Telegram, if the Russian language is set in the application, it triggers the values en and ru, so be careful with this. You can familiarize yourself with the values that can be specified as the client's language [here] (https://telegra.ph/Spisok-yazykov-klienta-Telegram-i-ih-rasshifrovka-08-13)
You can set the number of warnings before the ban and the ban itself. Quiet mode will restrict the user's writing of messages for 5 minutes, as well as write messages sent in case of warnings and ban. You can read about working with a text editor [here] (./text-editor.html).
If, under the specified conditions, Face control is to trigger on the user, the following actions will be performed:
- A greeting will appear in the chat about the new user (if enabled), that is, the bot will let the person into the chat.
- When a person tries to write to the chat, his messages will be deleted, and at the same time:
- if enabled, alerts will be sent.
- if the ban is enabled, after sending warnings the user will be banned ("Quiet mode" gives "mute" for 5 minutes)
Filters are needed to prohibit or restrict certain types of messages, for example, links or stickers. In short, what they can do: separately for each filter, you can set the amount of allowed content with an update period, set up warnings before the ban, select the type of ban, write an arbitrary warning and ban text, select actions for the first user message that falls under these criteria, set filter operation time, disable any of the above items
So, there are 28 filters in total. 26 are available in the free version, two open in the Advanced tariff. 16 filters work with text messages, 9 with media files and three more refer to the "Other filters" section.
For filters, "quick setting" is available - when you drag the slider to the right or left, a certain filter mode will work. If possible, we advise you to open the settings with the orange button below in order to clearly understand the structure of the filter, see all its possibilities, and configure it more flexibly for yourself.
# Similar features of all filters
So, many filters at the very top have a whitelist/blacklist of what you want to block. We will gradually add this feature to all filters, where appropriate.
Time can be set in all filters. If nothing is specified, the filter will always work. Almost everywhere in a bot, an unspecified value or the number "0" means that the action is always performed. The time in the bot is in UTC format.
Type of ban for prohibited content. There are 4 types of bans:
- Do not punish - the bot will not ban users
- Remove from chat for a while - similar to the command
/kick- the bot will exclude a person from the group, but he can return to it at any time
- Quiet mode - "mute" of the user - the user will not be able to write in the chat, but will be able to be in it and view all messages.
- Delete from chat forever - the bot will add the user to the black list, the user will not be able to re-enter the chat
All of the above restrictions can be canceled manually using the commands:
You can set the number of warnings before the ban and arbitrary text that the bot will write when sending a warning.
The toggle switch allows you to send text when a user is banned by a bot.
Allows you to delete posts with this content. When the toggle switch is off, the points below you can configure the ability to restrict newcomers to the group by sending content.
If the toggle switch is turned on, there are such opportunities as: postpone the deletion of the message up to 60 seconds, set the amount of allowed content and the period for its zeroing. How it all works:
For example, you do not want your group to be spammed with stickers. For this:
- Allow 5 stickers per hour for users.
- Turn on the toggle switch "Delete messages", below we set the allowed number of stickers - 5.
- Further in "After how many times to reset the allowed number of stickers" we indicate "Hour".
- Let's put 2 warnings, write the text: "You are sending, there are too many stickers, try again later", in the Other tab we will enable auto-deletion after 15 seconds so as not to clog the chat.
- We will set the type of ban to Quiet mode, "mute" will be issued in accordance with the time in the general filters.
Thus, the user sends 5 stickers, if an hour has not passed, when the sixth sticker is sent, the bot will delete the message and send the warning we wrote, which will be deleted after 15 seconds. Seventh time -> warning, then "mute".
With each new attempt to send a message, the user will receive new bans (the time is set in the general settings). After an hour, the user will be able to send messages again.
The ability to issue a restriction on the first user message that falls under the filter. "Quiet mode" in this field gives "mute" forever.
It would be wrong for a user to send any message and then edit it by inserting prohibited content, such as a link in a previously sent text message.
Therefore, there is such a function in many filters. The counters "Only after (minutes)" and "Only after N new messages" allow you to enable the deletion of edited messages only when some time has passed since the message was sent/a certain number of messages were sent. Simply put, it is possible for the user to edit messages "immediately", but not "later". This is what you expose "right away".
# Filters by text:
Stop words - add any words or expressions here, and the bot will react to them, issuing restrictions. The case for the stop words you write is not taken into account in messages.
Strict stop-word mode: if the word "summer" is specified in the values, when the mode is enabled, the bot will filter only this word, in the non-strict mode, the bot will react to the word of "summertime".
Link Filter - filters any links, IP addresses. Does not filter Telegram links, there is a separate filter for this (next). In the advanced settings, you can enable filtering of the most popular websites and services of the Russian Internet and the world.
Filter Telegram links. Filters all types of Telegram links, filtering by type can be disabled in advanced settings:
Filter Email (postal addresses). Filters email addresses.
Filter messages with RTL. Roughly speaking, RTL is text "backwards". As a rule, these are the symbols of the Arabic language. In advanced settings, you can set the permissible percentage of characters with RTL in the message (where 0 - prohibit the use of Arabic characters completely)
Messages with Arabic text are filtered here. In order to filter nicknames or usernames of users, use Face control.
Filter of Chinese characters. In advanced settings, you can set the allowable percentage of Chinese characters in the message (where 0 - prohibit the use of Arabic characters completely).
Filter Reposts from bots. Filters messages forwarded from bots. The toggle switch enables filtering via messages.
When you click on the music tracks, a message with them will be sent to the chat, and from above it will be drunk via @vkmusic_bot or via @vkmusic_bot.
Via messages - messages sent via bots in this way. Of course, there are many such bots - these are selected as an example.
The filter does not process messages from other bots in the chat - it cannot - bots do not see each other, Telegram policy.
# Filter commands from bots
Filter reposts from channels and reposts from chats. User reposts from channels and chats will be filtered. In the white list above, you can specify: channel or chat ID, its @username (without the @ sign, case is not important), a link to it from t.me/ or https://t.me/.
When binding a channel and a group, the filter does not process submitted posts from the channel!
Filter allowed words. Filter available in Advanced and Ultimate licenses. The bot will punish the user for messages that do not have a list of allowed words.
Strict mode of allowed words: if the word "summer" is specified in the values, when the mode is enabled, the bot will filter only this word; in the non-strict mode, the bot will react to the word of "summertime".
Regular expression filter. The filter is available in Advanced and Ultimate licenses. The bot will process the Java programming language regular expressions you specified. You can read about what it is and how to use it here. When the Remove regular expressions toggle switch is on, it becomes possible to disable this filter for signatures (for files, pictures, videos, etc.)
Filter math. The bot will filter obscene language. In advanced settings, some words are rendered that can be disabled for filtering. When you turn on the filtering of the mat by the dictionary, the bot also processes different forms of words, and this opens the opportunity to add this dictionary with your words.
Filter the length of user messages. Allows you to set limits for the length of words and the entire message in advanced settings.
Filter referral links. These are the links sent to the bot (not @ ChatKeeperBot, but to another) to identify the link (for example, by ID). They look like https://t.me/chei_to_bot?startgroup=test.
# Filters by media files
Filters by media files. These include: stickers, voice messages, images, Gifs, audio recordings, videos, user's video messages, files and contacts. All of them have the same structure, differ only in setting different parameters in the advanced settings section (for example, height/width/pixels for photos, gifs and videos, time for voice and video messages).
Filter files. In advanced settings, it is possible to allow certain types of files by extension. It can be specified like this: exe (without a period). A selection of mime file types is also available. Available values: application, audio, example, image, message, model, multipart, text, video.
# Other filters
Flood filter. Flood in this filter means writing messages too often. You can set deletion when sending N messages for a certain time interval, set the time between two adjacent messages, delete previous messages.
Filter any user messages. Ability to restrict the writing of messages from users for a certain period of time (for example, allow users to send no more than two messages per day).
Filter cubes. Filters dart, basketball and soccer ball, darts. All these emojis, when sent one at a time, are sent as an animation of a random die or a possible ball hitting the ring/goal. Some users like to spam with these animations, so we made a filter.
# How do I understand why the filter doesn't work the way you want it to?
- Make sure that the bot is enabled and running. Send the /test command in the chat, the bot should delete the message and send the chat diagnostics to private messages
- Check if the bot is in the list of administrators in the chat. To do this, go to group management = > list of administrators and, if the bot is not there, add it.
Go to your personal account, section "Moderation" = > "Filters" and open the necessary filter settings
- Check the "Filter immunity", users with the specified rank are exempt from restrictions. (Available from the Advanced plan)
- Go to the "General Filter rules" and make sure that the toggle switch "Delete messages from …»
** Links and Telegram links**
- Make sure that the link is not in the white list.
- Then, check whether the "Allow TOP-100 links" toggle switch is disabled in the "Advanced Settings" section, if not, disable it, most likely your site is in this TOP-100.
For images, videos, stickers, sticker packs, videos, and video messages, it is recommended to set up a ban on editing messages
- Go to the section "General Filter rules"
- Turn on the toggle switch "Delete edited messages"