# Автоматическая модерация
# Общие настройки для фильтров
Бот будет удалять свои сообщения в чате, что выделено ограничение через 5 минут.

Если участник чата нарушает правила постоянно, то бот не будет слать предупреждения подряд, чтобы не засорять чат.

Если пользователь захочет отредактировать медиафайл, бот удалит это сообщение. Это сделано специально для тех пользователей, которые хотят подставить чат.
Например: отправил фото совы, данное фото ушло вверх в ленте, потом он редактирует свое сообщение и вместо совы вставляет фото запрещенного контента, жалуется и таким образом Telegram может заблокировать чат.

В дальнейшем будет реализована автокоррекция орфографических и грамматических ошибок. Пока эта функция исправляет неправильную раскладку.
Например, Вы написали в чат слово «Ghbdtn», в ответ на Ваше сообщение бот отправить «Привет».

При отправке нескольких фотографий вместе, Telegram группирует их в альбомы (максимум – 10 фотографий). Вы можете ограничить количество фотографий в альбомах.

Пользователи не смогут добавлять ботов в чат. Включенный тумблер «Банить пользователей, добавляющих ботов» банит пользователей навсегда.

Удаление команд, адресованных боту. Рекомендуем не включать, если вы пишете команды с комментариями «/mute 1h @username вот тебе за определенные действия».

Интервал времени в минутах – если не прошло N минут с прошлого предупреждения от бота, новое предупреждение показано не будет. Здесь задаётся время для ограничений «Удалить из чата на время» и «Тихий режим» для всех фильтров.

# 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)
# Фильтры
Фильтры нужны, чтобы запретить или ограничить определённые типы сообщений, например, ссылки или стикеры. Если кратко сказать, что они могут: отдельно для каждого фильтра можно установить количество разрешённого контента с периодом обновления, настроить предупреждения перед баном, выбрать тип бана, написать произвольный текст предупреждения и бана, выбрать действия при первом сообщении пользователя, попадающем под эти критерии, выставить время работы фильтра, отключить любой из вышеуказанных пунктов
Итак, всего доступно 28 фильтров. 26 доступны в бесплатной версии, два открываются в тарифе Advanced. 16 фильтров работают с текстом сообщений, 9 с медиа-файлами и ещё три относятся к разделу «Остальные фильтры».
Для фильтров доступна «быстрая настройка» - при перетягивании ползунка вправо-влево заработает определённый режим работы фильтра. По возможности, советуем всё-таки открывать настройки оранжевой кнопкой ниже, чтобы чётко понимать структуру фильтра, видеть все его возможности, настроить более гибко, для себя.
# 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.

Во всех фильтрах можно выставить время. Если ничего не указано – фильтр будет работать всегда. Почти везде в боте неуказанное значение или цифра «0» означает выполнение действия всегда. Время в боте в формате UTC, это МСК+3. Если Вы живёте по московскому времени, и хотите сделать выполнение фильтра «с 23:00 до 7:00», вам нужно написать «с 02:00 до 10:00».

Тип бана за запрещённый контент. Есть 4 типа банов:
- Не наказывать – бот не будет банить пользователей
- Удалить из чата на время – аналогично команде
/kick– бот исключит человека из группы, однако он в любой момент сможет в нее вернуться - Тихий режим – «mute» пользователя – пользователь не сможет писать в чате, но сможет находиться в нём и просматривать все сообщения.
- Удалить из чата навсегда – бот добавит пользователя в чёрный список, заново зайти в чат пользователь не сможет

All of the above restrictions can be canceled manually using the commands: /unban,/unmute.
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 respond to them by issuing restrictions. The case for the stop words you have written is not taken into account in messages.
< br /> 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, when the mode is not strict, the bot will react to the word tickets.
The stop-word filter works very effectively due to the fact that it removes even the most hidden mats. Activate the toggle switch "Check for word changes"
Link Filter - filters any links, IP addresses. It does not filter Telegram links, there is a separate filter for this (the following). In the advanced settings, you can enable filtering of the most popular sites and services of the Runet and the world. In the black and white list, you must specify
** Filter of Telegram links.** Filters all types of Telegram links, filtering by type can be disabled in the advanced settings.
White list of filters-in this list, specify the channels, mentions, reposts and links of messages that will be allowed in your group. The filter will work only with a complete match, that is, for example, if you specify a list of valid channels "@name", the bot will allow a repost from the channel and links to messages from the channel "@name", but will not allow from the channel "@name2". Each channel should have a separate link, even if they are similar in name. Be sure to specify the channel name with"@"
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.
Warning
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?
General
- 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 …»

Example:

** 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
- Зайдите в раздел «Общие правила фильтра»

- Включите тумблер «Удалять отредактированные сообщения»


