Telegram Spam Prevention Bot

Website Cryptocurrency Mining

Telegram Spam Prevention Bot

November 19, 2019 Announcements Code Comment Development News Publishers 0

Telegram (alongside Twitter) is the most widely used social channel for the blockchain community. We use it, like many projects, to communicate with our users and receive feedback on developments. The platform is however plagued with spam and automated messages. We tried a number of different solutions including most recently the @shieldy bot which requires new users to complete a simple maths problem and post a message back.

Some bots were getting around this however and the team here believed we could do a better job using our captcha technology. We went about building the spam prevention bot using nodejs and the telegraf framework. The code is open-sourced at:

We hope this is of use in our own community but also to other groups on Telegram that are having issues with spam.

To use the bot in a group ask the owner to invite the bot @jsetelegrambot and give it admin privileges.

How to setup in the Telegram app

  • Invite – Click on group title, scroll down to add member, type “jsetelegrambot”, tap tick button
  • Admin – Click on group title, click pencil in top right, select administrators, tap add admin

The bot works in two ways it prevents commonly spammed links to URL’s and requires new users to complete a captcha. When a new user joins the group they are given a link to complete a captcha. If after 90 seconds the captcha hasn’t been completed then that user will be removed from the group. Messages posted before the captcha has been completed are automatically deleted.

If anyone has any suggestions for improvements and further ways to prevent spam then we would love to hear from you on our channel:

If you are owner of a Telegram group or are a member of one that has spam problems then please help spread the word. By doing so we can help prevent spam and raise awareness of the project to a targeted community of crypto enthusiasts.

Thank you.