TelegramGuard / README.md
ilang-ai
fix: add sdk:docker to HF Space config
957d007
|
raw
history blame
2.6 kB
metadata
title: TelegramGuard
emoji: 🛡️
colorFrom: blue
colorTo: cyan
sdk: docker
pinned: false
license: mit
tags:
  - telegram
  - anti-spam
  - ilang
  - chatbot

I-Lang Guard

AI-powered Telegram group guardian. Anti-spam, vision, chat — all driven by I-Lang Prompt Spec.

What It Does

  • Anti-spam: AI detects ads, scams, political content, porn, and repeat flooding. Deletes messages and bans spammers automatically.
  • Vision: Understands images and video thumbnails. Catches image-based spam too.
  • Chat: @ the bot in any group for AI conversation.
  • Zero config: Add to group → grant admin permissions → done.

Deploy Your Own (3 Steps)

Option A: HuggingFace Space (Free, Zero Server)

  1. Fork this repo
  2. Create a HuggingFace Space (Docker SDK)
  3. Add secrets in Space Settings:
Secret How to get it
BOT_TOKEN Talk to @BotFather on Telegram
GEMINI_API_KEY Free at aistudio.google.com

Option B: VPS

git clone https://github.com/ilang-ai/TelegramGuard.git
cd TelegramGuard
pip install -r requirements.txt
export BOT_TOKEN="your-token"
export GEMINI_API_KEY="your-key"
python bot.py

Customize Your Bot

All prompts live in prompts_demo/ as .ilang files:

File Controls
persona.ilang Bot personality, tone, rules
antispam.ilang What counts as spam
vision.ilang How to read images

To customize: copy prompts_demo/ to prompts/, edit the .ilang files. The bot loads prompts/ first, falls back to prompts_demo/.

Prompts use I-Lang Prompt Spec — a structured format for AI instructions using GENE framework, IMMUNE rules, and layered architecture. Learn more at ilang.ai.

Architecture

bot.py              Main handler
modules/
  chat.py           AI calls (loads .ilang prompts)
  db.py             Single shared SQLite connection
  database.py       Schema
  admin.py          Group admin helpers
prompts_demo/       Open-source demo prompts (.ilang)
prompts/            Your custom prompts (.gitignore'd)

BotFather Setup

After creating your bot, send these to @BotFather:

/setjoingroups → Enable
/setprivacy → Disable (so bot can see all group messages)

License

MIT


Powered by I-Lang Prompt Spec | Eastsoft Inc.