Shri Vishnu Engineering College For Women
(Autonomous)
Department Of Computer Science
Engineering
Real-Time
Spam Detection
Presente
Guided By:
on Telegram d By:
22B01A05
73
Mr. P.Naga Raju
22B01A05
86
ABSTRACT
This project aims to develop an automated Spam Detection System for Telegram
groups using Python. With the rising abuse of Telegram by spammers to spread
phishing links, fake job offers, investment scams, and promotional messages, there is
a strong need for tools that can monitor and moderate group chats in real time.
The proposed system uses the python-telegram-bot library to detect spam based
on predefined keywords, suspicious link patterns, and message frequency (flooding).
Once a message is identified as spam, it is immediately deleted, and the user may be
temporarily muted if necessary. The system also intelligently checks user roles to
avoid acting on admins or group owners.
ABSTRACT
All detected spam messages and actions taken are securely logged into a
MySQL database, allowing for future analysis and transparency. This approach
ensures effective content moderation and helps prevent group disruption caused by
malicious users.
By combining real-time detection, automation, and reliable logging, this project
enhances safety in Telegram communities and offers a lightweight yet powerful
solution for group administrators.
TECHNOLOGIES
Programming Language : Python
Database : MySql
Real-life scenarios
Real-life scenarios
Real-life scenarios
Real-life scenarios
Real-life scenarios
For Admins:
Real-life scenarios
For Non-Admin Users:
Database Storage
Advantages
•Real-Time Protection
The bot automatically monitors and moderates group chats, preventing
spam, scam messages, and malicious links in real time.
•Reduces Admin Burden
Group administrators no longer need to manually monitor every
message, as the bot automates spam detection and action.
•Customizable Filters
Spam keywords and patterns can be easily updated or extended to
adapt to new scam techniques.
•Database Logging
Actions (like message deletions, user mutes) are logged in a MySQL
database, which helps in tracking spam trends and reporting.
•Simple Deployment
Runs without a web interface, making it easier to deploy for users who
don’t want to host a web server.
•Lightweight
Doesn’t require large resources or dependencies like Flask or Django, so it
can run on basic systems or cloud instances.
Disadvantages
•No Web Interface
Without Flask or any frontend, administrators must access logs manually via
the database, which is not user-friendly.
•Limited Spam Detection Intelligence
Relies on keyword matching and link patterns. It may not catch advanced or
cleverly disguised spam (e.g., with Unicode obfuscation).
•False Positives/Negatives
Legitimate messages may get flagged or spam might go undetected if not
properly filtered.
Existing Work
Combot Anti-Spam
Uses a BotFather-created bot.
Provides auto-moderation and spam detection in real time.
Has admin tools and statistical dashboards.
Shieldy Bot
Created using BotFather, allows auto-kicking or muting of users who don't
respond to CAPTCHA.
Useful against join-and-spam bots.
Miss Rose Bot
A very popular moderation bot created using BotFather.
Offers anti-spam, anti-flood, word bans, and more.
References
• Alansari, M.M.H., Aljazzaf, Z.M. and Sarfraz, M. (2019). On Cyber Crimes and
Cyber Security. Developments in Information Security and Cybernetic Wars,
pp.1–41. doi:https://doi.org/10.4018/978-1-5225-8304-2.ch001.
• Kashyap, S. (2017). Prevention of Cyber Crimes in India A Comparative
Study. Inflibnet.ac.in. [online] doi:http://hdl.handle.net/10603/379851.
• Anuraj Singh (2007), Volume 05, Issue 06, PP. 11273- 11279
Thank You