Best telegram bot ever

Best telegram bot ever

TelegramGuardian was created as a bot to support Telegram group administrators efforts while fighting with antisocial behaviour and group being attacked by spammers and simply - idiots. It’s current, fourth version has been rewritten from scratch using Google Go language and various API’s. Bot itself runs on Kubernetes cluster in Google Cloud to ensure its 24/7 availability and uptime.

Table of contents

How to start

Simply invite @littleGuardianBot to your group and give it group admin rights - it will start working straight away with default settings applied.

What does it do?

Project TelegramGuardian ( in the current state of code, as of 12/05/2018 ) can ( and it does it blazingly fast! ):

Available commands

User commands

Administrator commands

Every administrator of the group can issue following commands and change the bot settings.


Enable kicking other bots from the group as soon as they enter.

/set otherbots

Set group link to following. This link will be treated as the only allowed group link in the chat, assuming that /set noinvites is set to on.

/set link

Set limit ‘very_short’ to 5 minutes - this limit is used by bot to determine minor offences.

/set limit_very_short 5


How bot treats rules violation?

When violation of group rules is detected spammer receive a warning and is “limited” in the group for certain amount of time. For example - when spammer uses Farsi language in the group - he will be limited for 1 minute. This approach doesn’t work well with bot spammers, obviously, hence the incremental limits. Bot always checks last “cool down period” for the user and adds additional limit on top of that. While creating the bot I’ve made additional assumption - anyone who enters the group and starts from violation should be banned instantly as in most of the cases he’s just a spammer. That’s why bot calculates the ratio of messages sent by user and compares it to the total warnings obtained by user in that period. Following formula should help you understand when user will be banned automatically:

(( $sent_messages < 3 ) OR 
( $total_limit / $sent_messages > 3.0 )) 
AND $currently_applied_limit > 1 minute ) 

OR $sent_messages > 5 AND 
( $total_limit / $sent_messages ) >= 1.0)

From quick calculations it is visible that user must meet one of following:

Why bot does not kick out spammers instantly?

There is no point. We have seen groups decimated by rogue bot when users wanted to have a little bit of fun or needed to share something ‘very important’. In general - it’s better to warn and limit than kick out instantly.

How does pornfilter work?

Bot checks every picture uploaded to the group with Google algorithms. Think about it as switching ‘Safe Search’ for Google on. If you think that you won’t see that picture in results - it shouldn’t be on the group.

How does antivirus filter work?

Bot uploads files sent to the groups ( pretty often documents or android APK files ) against over 60 different virus detection engines, using VirusTotal. It’s quick, it’s efficient and most imporantly - it works. When virus is detected in the file uploaded to the group - bot displays additional information asking users who could have downloaded it to delete it. When file is “clean” - it displays information that it should be safe to download.

Live statistics


Message bot author on telegram with clear description of your issue.