Skip to content

About

A Telegram bot that checks messages for scams using VirusTotal and Groq API

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

204 Commits

Folders and files

Repository files navigation

CyberPravoBot

Python   Aiogram   License

An asynchronous Telegram bot that checks links and messages to protect users from scam messages.

preview

Try the Live 24/7 Telegram Bot Here


Quick start

  1. Go to Chat with bot in telegram
  2. Press start (type /start if there is no button)
  3. Select analysis mode (or skip it for standard mode)
  4. Forward some suspicious message to it
  5. Enjoy the risk score as a percentage!

Features

  • Phishing Detection: The bot detects links in messages and checks them via VirusTotal.
  • Scam Recognition: Uses AI to read chat messages and catch scam context.
  • Admin Panel: You can switch between 3 different AI models on the fly without turning off the bot.
  • Fast and Async: Built to handle high load without lags by using async functions.

Localization

Because this bot was originally made for a Belarusian competition, the default UI is in Russian. However, you can easily localize everything to your own language right inside the config.py file.


How it works

I chose aiogram and aiosqlite to make the bot completely asynchronous. This is important because API requests delay shouldn't freeze the main bot loop when checking links.

For security checks, the bot takes a URL, converts it to base64, and sends it to VirusTotal. After getting the answer, the bot appends this data directly into the Groq LLM prompt. This helps the AI make a very precise decision about whether the link is a scam or not.

For 24/7 availability, the bot is containerized with Docker and deployed on a Hack Club Nest Debian server.

Tech Stack:

  • Python 3.10+
  • Aiogram 3.x (Bot framework)
  • Groq SDK & aiohttp (For AI and VirusTotal API)
  • aiosqlite (Database)

How to Run Locally

Requirements

  • Python 3.10 or higher
  • VirusTotal API Key and Groq API Key
  • All from requirements.txt ¯\(ツ)/¯

Setup Steps

  1. Clone the project:

    git clone https://github.com/egraich/CyberPravoBot
    cd CyberPravoBot
  2. Install dependencies:

    pip install -r requirements.txt
  3. Create Environment Variables: Create a .env file in the root folder and add your keys:

    BOT_TOKEN=your_telegram_bot_token_here
    ADMIN_ID=your_numerical_telegram_user_id
    GROQ_API_KEY=your_groq_api_key_credentials
    VT_API_KEY=your_virustotal_v3_api_key
  4. Run the bot:

    python main.py

The Backstory

I originally built this bot for a big cyber-security competition in Belarus called #КиберПраво(#CyberLaw). But because of a bureaucratic mistake at my school, my official papers were lost, and my bot never reached the judges. I didn't want to delete a fully working project, so I polished the code and released it here for everyone.


License

This project is open-source under the MIT License.

Made by egraich

About

A Telegram bot that checks messages for scams using VirusTotal and Groq API

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages