WatchDog Robot

watchdog_robot telegram bot

Watchdog Robot deletes messages of blacklisted types: link, sticker, gif, voice attachment, file attachment and other. Also it can ban other bots.

Install

Follow these steps:

  • Add @watchdog_clone_robot as admin into your chatroom
  • Give bot a permission to delete messages and to ban users. No other permissions are required
  • Configure content to be removed with command /watchdog block <filter-name>. See Filters section for available filters. Note that by default all filters are disabled i.e. watchdog does nothing. You can specify multiple filters at once, just delimit them with comma.

(!!!) Do not write to chat exactly the /watchdog block <filter-name>. Instead of <filter-name> use one of names listed in Filters section. Example of command: /watchdog block sticker. Example of multiple filters at once: /watchdog block photo,video.

Filters

List of filters which Watchdog Robot can work with. First word (colored) in each line is name of filter. Use this name in /watchdog block and /watchdog allow commands.

  • Links:
    • link - message that contains a link
    • channel_mention - message that contains @username of channel
    • group_mention - message that contains @username of group (chat)
    • user_mention - message that contains @username of user
    • bot_mention - message that contains @username of bot
    • mention - message that contains @username of any kind
    • split_mention - messages that contains @ username where there is a space after "@" character
    • email - email address
    • text_mention - special user mentions which might look like a normal text https://telegram.org/blog/edit#new-mentions
  • Media:
    • sticker - sticker
    • gif - animated GIF image
    • voice - voice recording
    • attachment - file attachment
    • audio - audio clip
    • video - message with a video movie
    • photo - photo file
    • media_group - message that contains multiple media objects (photos usually)
    • video_message - video clip
    • not_sticker - message that IS NOT sticker
  • Text:
    • command - bot command (it'll be processed by corresponding bot anyway, just the text of command will be removed)
    • char1 - message that has length of one or zero chars, spaces are not counted as chars
    • emoji - message that contains ONLY emoji symbols (any number). Filter does not match message that contains both emoji and text symbols.
    • emoji_spam - any message that contains text AND 4 or more emoji symbols
    • custom_emoji - any message that contains premium emojis
    • bold - matches the message if most of its content is formatted with bold font
    • italic - matches the message if most of its content is formatted with italic font
    • char250 - message that contains more than 250 character symbols
    • char500 - message that contains more than 500 character symbols
    • char1000 - message that contains more than 1000 character symbols
    • hashtag - message that contains a hashtag
    • not_hashtag - message that DOES not contains a hashtag
    • text - any text message (emoji is text too)
    • cryptohash - address of crypto wallet
    • uppercase - matches message which lenght is more than 30 symbols and most of symbols are in upper case
    • number - matches message which contains a number (yeah, just any number like "234234" or "1")
    • number9 - matches message which contains a number which is 9 digits or more
    • number11 - matches message which contains a number which is 11 digits or more
    • bank_card_number - matches bank card number
    • mixed_abc - matches if any word contains chars of mixed alphabets (at the moment only Russian and English alphabets are supported)
    • not_enru - matches if text contains any symbol but punctuation, space, emoji, Russian alphabet, English alphabet.
  • Users:
    • bot - if any bot invited into chat it will be kicked
    • bot_inviter - user who invited any bot into chatroom will be kicked
    • new_user - if new user joines to chat it will be kicked (not banned)
    • nousername - new users with no @username will be kicked from the chat
    • sender_chat - message written on behalf of a channel. This filter restricts only "outsider" channels, this filter does not matches with messages from a channel which officially connected to the chat.
    • user_premium - users with premium account will not be able to join a group
  • Other:
    • msg - any visible message from user. DOES NOT implies bot and bot_inviter rules. Using this filter you just mute the chat. Check out also !BOT_LINK:hushrobot!, it is designed specially for muting chat.
    • forwarded - message forwarded from any other place
    • button - message that contains button of any kind. Usually it is message that posted via inline bot.
    • poll - a poll
    • contact - message with telegram contact card
    • game - message that contains a telegram game
    • inline - matches messages sent with inline bot (like @gif bot)
    • dice - single emoji that renders as Dice Throw kinda animation. These are dice, dart, football ball, etc emojis.
    • location - a location (map) message
    • msg_premium - message from a user who has premium account

For example, you want to block stickers and WWW links. Use two commands /watchdog block sticker and /watchdog block link. Also you can specify multiple filters in one command like /watchdog block sticker,link.

Commands

  • /watchdog block FILTER - tell Watchdog Robot to remove messages match this filter. You can specify multiple filters delimited by comma.
  • /watchdog allow FILTER - allow messages match this filter.
  • /watchdog config - see Watchdog Robot configuration for the current chat
  • /watchdog set notify_actions=yes - ask bot to display message about some message was removed
  • /watchdog set notify_actions=no - tell bot to remove messages silently
  • /watchdog check - check if bot is installed correctly.
  • /watchdog reload_admins - ask bot to reload admin IDs for current chat. Admins list is collected once and cached. Use this command to update cached data.
  • /watchdog analyze - write this command in reply to existing message to see what filters you can use to block this kind of message.
  • /watchdog add domain-whitelist FOO - add domain FOO to list of allowed domains
  • /watchdog remove domain-whitelist FOO - remove domain FOO from list of allowed domains
  • /watchdog add user-whitelist ID - add a user to whitelist i.e. allow any message from this user. Here, ID is a numeric Telegram ID of a user.
  • /watchdog wluser - add a user to whitelist i.e. allow any message from this user. Use this command in a reply to message of user which you want to whitelist.
  • /watchdog remove user-whitelist ID - remove ID from list of whitelisted users
  • /watchdog delwluser - remove a user from whitelist. Use this command in a reply to a message of user which you want to remove from whitelist.

All these commands have to be entered in chatroom where watchdog is installed. Do not send these commands in private messages to watchdog.

FAQ

How to check if bot installed correctly?

First, complete installation instructions. Then type into chat this command: /watchdog check. Fix any issues bot talkes about.

Why watchdog does not kick other bots?

First, check you have told watchdog to do it with command /watchdog block bot. Second, check that you have given watchdog permission to ban other users.

How to make bot to not delete some links?

You can disable all links with "link" filter and then add specific domain names into "domain-whitelist" list to make bot to not delete links which points to this domain. For example, to allow twitter links use this command /watchdog add domain-whitelist twitter.com.