ilang-ai commited on
Commit
fa6f6d3
·
1 Parent(s): 02b8e5c

Phase 3 clean-up: purge grey-market persona + fix broken setup docs

Browse files

Purity (flagship must be a clean anti-spam product):
- persona.ilang: replace the grey-market fixer persona (never-refuse-illegal /
underground-markets / grey-area-hustles) with a clean helpful-assistant persona
that answers legal/sensitive topics factually and declines genuinely harmful/
illegal requests via ::IMMUNE{HARMFUL_OR_ILLEGAL, DECLINE_CLEAN}
- vision.ilang: drop the proxy-client device-onboarding flow (recommend_client /
want_nodes / ios|android|windows|mac enum); keep clean image understanding
- README / README_CN / site: remove 'never refuse illegal' & '三步法/老江湖'
advertising and 'no topic off-limits / street-smart / lectures never' copy

Docs (fork must actually run):
- Every setup path used GEMINI_API_KEY, which the code never reads -> fixed to
AI_API_KEY across install.sh, README, README_CN (bot booted green but every AI
call failed with 'AI_API_KEY not set')
- add .env.example (12 vars, exact parity with config.py)
- swap Gemini badge for OpenAI-compatible; update architecture module list
- manual path: source .env instead of a misleading bare cp

Verified: 2 independent agents confirm zero grey-market residue and all 3 deploy
paths runnable; deterministic scan shows zero gemini/aistudio/persona residue.

Files changed (7) hide show
  1. .env.example +33 -0
  2. README.md +24 -23
  3. README_CN.md +24 -23
  4. install.sh +10 -5
  5. prompts_demo/persona.ilang +34 -45
  6. prompts_demo/vision.ilang +8 -10
  7. site/index.html +5 -5
.env.example ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ── Telegram ──────────────────────────────────────────────
2
+ # Bot token from @BotFather (/newbot).
3
+ BOT_TOKEN=
4
+
5
+ # ── AI provider (OpenAI-compatible) ───────────────────────
6
+ # Works with any OpenAI-compatible API: SiliconFlow (default),
7
+ # OpenAI, DeepSeek, a local vLLM/Ollama relay, or any gateway.
8
+ AI_API_KEY=
9
+ # Default endpoint targets SiliconFlow — get a key at https://cloud.siliconflow.cn
10
+ AI_BASE_URL=https://api.siliconflow.cn/v1
11
+ AI_MODEL=deepseek-ai/DeepSeek-V4-Flash
12
+
13
+ # Vision — comma-separated fallback chain (first model that succeeds wins).
14
+ AI_VISION_MODELS=Qwen/Qwen3-VL-30B-A3B-Instruct,Qwen/Qwen3-VL-32B-Instruct,Qwen/Qwen3-VL-8B-Instruct
15
+
16
+ # Voice-message transcription/understanding model.
17
+ AI_AUDIO_MODEL=Qwen/Qwen3-Omni-30B-A3B-Instruct
18
+
19
+ # Images are downscaled to this width before being sent to the vision model.
20
+ AI_IMAGE_MAX_WIDTH=600
21
+
22
+ # ── Storage ───────────────────────────────────────────────
23
+ DB_PATH=/data/bot.db
24
+
25
+ # ── Anti-spam tuning ──────────────────────────────────────
26
+ # New-user probation window (seconds).
27
+ SPAM_NEWUSER_COOLDOWN=300
28
+ # Identical message repeated this many times → flooding.
29
+ SPAM_REPEAT_THRESHOLD=3
30
+ # ...within this window (seconds).
31
+ SPAM_REPEAT_WINDOW=300
32
+ # Chinese-slang lexicon hard-hit threshold (prefilter). Higher = stricter.
33
+ LEXICON_HARD_THRESHOLD=6
README.md CHANGED
@@ -19,11 +19,11 @@ tags:
19
 
20
  **AI group guardian that actually answers your questions.**
21
 
22
- Anti-spam. Vision. Chat. No topic off-limits.
23
 
24
  [![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
25
  [![Powered by I-Lang](https://img.shields.io/badge/powered%20by-I--Lang%20Spec-blueviolet)](https://ilang.ai)
26
- [![Gemini](https://img.shields.io/badge/AI-Gemini%202.5%20Flash-4285F4)](https://aistudio.google.com)
27
 
28
  **[English](README.md)** | **[中文](README_CN.md)**
29
 
@@ -52,15 +52,7 @@ You can also DM the bot directly for AI chat.
52
 
53
  **Vision** — Reads images and video thumbnails. Catches image spam. In chat mode, analyzes what's really happening in a photo, not just describing objects.
54
 
55
- **Chat** — @ the bot in any group or DM privately. Multilingual, auto-detects your language. Finance, tech, relationships, culture, anything. Answers first, lectures never.
56
-
57
- **Three-Step Method for Sensitive Topics** — Most bots refuse. TelegramGuard uses a different approach:
58
-
59
- | Step | What happens |
60
- |------|-------------|
61
- | **Insider Risks** | Shares what actually goes wrong: scams, traps, consequences |
62
- | **Reality Check** | Asks if you're curious or serious, no judgment |
63
- | **Direction** | Gives enough info to make smart decisions |
64
 
65
  ---
66
 
@@ -74,9 +66,9 @@ curl -sL https://raw.githubusercontent.com/ilang-ai/TelegramGuard/main/install.s
74
 
75
  The script handles everything: clone, dependencies, token setup, systemd service, auto-start.
76
 
77
- You need two things (both free):
78
  - **Bot Token** — open Telegram → [@BotFather](https://t.me/BotFather) → `/newbot`
79
- - **Gemini API Key** — [aistudio.google.com/apikey](https://aistudio.google.com/apikey)
80
 
81
  After install:
82
  ```bash
@@ -90,7 +82,7 @@ journalctl -u telegramguard -f # live logs
90
  1. Fork this repo
91
  2. Create a [HuggingFace Space](https://huggingface.co/new-space) → Docker SDK → Blank
92
  3. GitHub repo Settings → Secrets → add `HF_TOKEN` (your HF write token)
93
- 4. HF Space Settings → Secrets → add `BOT_TOKEN` + `GEMINI_API_KEY`
94
  5. Push to GitHub triggers auto-deploy to HF
95
 
96
  ### Option 3: Manual
@@ -99,11 +91,13 @@ journalctl -u telegramguard -f # live logs
99
  git clone https://github.com/ilang-ai/TelegramGuard.git
100
  cd TelegramGuard
101
  pip install -r requirements.txt
102
- export BOT_TOKEN="your-token"
103
- export GEMINI_API_KEY="your-key"
104
  python bot.py
105
  ```
106
 
 
 
107
  ---
108
 
109
  ## Customize the AI
@@ -120,11 +114,14 @@ prompts_demo/
120
  Each file contains `::GENE` definitions that control behavior:
121
 
122
  ```
123
- ::GENE_IMMUTABLE{S001, T:ANTI_COLLAPSE, A:MORAL_PANICLETHAL, G:ALL, Θ:ALWAYS}
124
- # When user raises grey topics: don't panic, analyze objectively.
 
 
 
125
 
126
- ::IMMUNE{RISKY_OR_ILLEGAL, THREE_STEP_RESPONSE}
127
- # Step 1: Insider risks Step 2: Reality check Step 3: Direction
128
  ```
129
 
130
  Change the genes, change the bot. To customize: copy `prompts_demo/` to `prompts/`, edit. The bot loads `prompts/` first.
@@ -153,10 +150,14 @@ TelegramGuard/
153
  ├── install.sh One-line VPS installer
154
  ├── Dockerfile HF Space deployment
155
  ├── modules/
156
- │ ├── chat.py AI engine (loads .ilang prompts)
 
 
 
 
 
157
  │ ├── db.py Shared SQLite + async lock
158
- database.py Schema
159
- │ └── admin.py Group admin
160
  └── prompts_demo/ AI personality (.ilang files)
161
  ```
162
 
 
19
 
20
  **AI group guardian that actually answers your questions.**
21
 
22
+ Anti-spam. Vision. Chat. Zero config, free forever.
23
 
24
  [![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
25
  [![Powered by I-Lang](https://img.shields.io/badge/powered%20by-I--Lang%20Spec-blueviolet)](https://ilang.ai)
26
+ [![AI: OpenAI-compatible](https://img.shields.io/badge/AI-OpenAI--compatible-06D6A0)](#host-your-own)
27
 
28
  **[English](README.md)** | **[中文](README_CN.md)**
29
 
 
52
 
53
  **Vision** — Reads images and video thumbnails. Catches image spam. In chat mode, analyzes what's really happening in a photo, not just describing objects.
54
 
55
+ **Chat** — @ the bot in any group or DM privately. Multilingual, auto-detects your language. Ask it anything and get a clear, useful answer — factual on sensitive topics, sensible boundaries on genuinely harmful ones.
 
 
 
 
 
 
 
 
56
 
57
  ---
58
 
 
66
 
67
  The script handles everything: clone, dependencies, token setup, systemd service, auto-start.
68
 
69
+ You need two things:
70
  - **Bot Token** — open Telegram → [@BotFather](https://t.me/BotFather) → `/newbot`
71
+ - **AI API Key** — any OpenAI-compatible provider. Default targets [SiliconFlow](https://cloud.siliconflow.cn) (cheap, no VPN needed in China); OpenAI / DeepSeek / a local model work too. Override the endpoint with `AI_BASE_URL` and `AI_MODEL`.
72
 
73
  After install:
74
  ```bash
 
82
  1. Fork this repo
83
  2. Create a [HuggingFace Space](https://huggingface.co/new-space) → Docker SDK → Blank
84
  3. GitHub repo Settings → Secrets → add `HF_TOKEN` (your HF write token)
85
+ 4. HF Space Settings → Secrets → add `BOT_TOKEN` + `AI_API_KEY`
86
  5. Push to GitHub triggers auto-deploy to HF
87
 
88
  ### Option 3: Manual
 
91
  git clone https://github.com/ilang-ai/TelegramGuard.git
92
  cd TelegramGuard
93
  pip install -r requirements.txt
94
+ cp .env.example .env # fill in BOT_TOKEN + AI_API_KEY (defaults to SiliconFlow; edit AI_BASE_URL/AI_MODEL for another provider)
95
+ set -a; source .env; set +a # load .env into the environment
96
  python bot.py
97
  ```
98
 
99
+ See [`.env.example`](.env.example) for every tunable (vision models, audio model, spam thresholds).
100
+
101
  ---
102
 
103
  ## Customize the AI
 
114
  Each file contains `::GENE` definitions that control behavior:
115
 
116
  ```
117
+ ::GENE_IMMUTABLE{S002, T:RUTHLESS_RED_TEAM, A:FLATTERFAIL, G:ALL, Θ:ALWAYS}
118
+ # Show it a plan and it hunts the fatal flaw instead of praising.
119
+
120
+ ::GENE_MUTABLE{P002, T:CONCISE, G:ALL, Θ:ALWAYS}
121
+ # 2-3 sentences. Answer first, detail after, zero filler.
122
 
123
+ ::IMMUNE{SPAM, DETECT_THEN_NUKE}
124
+ # Ads / scams / flooding delete + strike, see through evasion.
125
  ```
126
 
127
  Change the genes, change the bot. To customize: copy `prompts_demo/` to `prompts/`, edit. The bot loads `prompts/` first.
 
150
  ├── install.sh One-line VPS installer
151
  ├── Dockerfile HF Space deployment
152
  ├── modules/
153
+ │ ├── ai_provider.py OpenAI-compatible AI layer (text · vision · audio)
154
+ │ ├── chat.py Prompt orchestration (loads .ilang)
155
+ │ ├── prefilter.py Zero-cost spam pre-filter + triage
156
+ │ ├── lexicon.py Slang / evasion normalization + scoring
157
+ │ ├── ilang_judge.py I-Lang decision function
158
+ │ ├── admin.py Group admin
159
  │ ├── db.py Shared SQLite + async lock
160
+ �� database.py Schema
 
161
  └── prompts_demo/ AI personality (.ilang files)
162
  ```
163
 
README_CN.md CHANGED
@@ -4,11 +4,11 @@
4
 
5
  **真正回答问题的AI群管机器人**
6
 
7
- 反垃圾 · 看图识别 · 智能对话 · 知无不答
8
 
9
  [![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
10
  [![Powered by I-Lang](https://img.shields.io/badge/powered%20by-I--Lang%20Spec-blueviolet)](https://ilang.ai)
11
- [![Gemini](https://img.shields.io/badge/AI-Gemini%202.5%20Flash-4285F4)](https://aistudio.google.com)
12
 
13
  **[English](README.md)** | **[中文](README_CN.md)**
14
 
@@ -37,15 +37,7 @@
37
 
38
  **看图** — 识别图片和视频缩略图。拦截图片类垃圾信息。聊天模式下, 分析照片背后真正发生了什么, 不是干巴巴描述物体。
39
 
40
- **聊天** — 在群里@它或者私聊。自动检测语言, 用你的语言回复。金融、技术、感情、文化, 什么都聊。先回答, 不说教
41
-
42
- **敏感话题三步法** — 别的机器人直接拒绝, TelegramGuard不一样:
43
-
44
- | 步骤 | 做什么 |
45
- |------|--------|
46
- | **风险揭底** | 像老江湖一样告诉你这里面的坑: 骗局、陷阱、后果 |
47
- | **确认意图** | 问你是好奇还是认真的, 不带评判 |
48
- | **给方向** | 给足够的信息让你做聪明的决定 |
49
 
50
  ---
51
 
@@ -59,9 +51,9 @@ curl -sL https://raw.githubusercontent.com/ilang-ai/TelegramGuard/main/install.s
59
 
60
  一行命令搞定: 下载代码、装依赖、填token、创建系统服务、自动启动。
61
 
62
- 你需要准备两样东西(都免费):
63
  - **Bot Token** — 打开电报 → 找 [@BotFather](https://t.me/BotFather) → 发 `/newbot`
64
- - **Gemini API Key** — [aistudio.google.com/apikey](https://aistudio.google.com/apikey) 免费申请
65
 
66
  装完后管理:
67
  ```bash
@@ -75,7 +67,7 @@ journalctl -u telegramguard -f # 看日志
75
  1. Fork 这个仓库
76
  2. 创建 [HuggingFace Space](https://huggingface.co/new-space) → Docker SDK → Blank
77
  3. GitHub仓库 Settings → Secrets → 加 `HF_TOKEN`
78
- 4. HF Space Settings → Secrets → 加 `BOT_TOKEN` + `GEMINI_API_KEY`
79
  5. 推代码自动部署
80
 
81
  ### 方式三: 手动
@@ -84,11 +76,13 @@ journalctl -u telegramguard -f # 看日志
84
  git clone https://github.com/ilang-ai/TelegramGuard.git
85
  cd TelegramGuard
86
  pip install -r requirements.txt
87
- export BOT_TOKEN="你的token"
88
- export GEMINI_API_KEY="你的key"
89
  python bot.py
90
  ```
91
 
 
 
92
  ---
93
 
94
  ## 自定义AI人格
@@ -105,11 +99,14 @@ prompts_demo/
105
  每个文件里的 `::GENE` 定义一个行为:
106
 
107
  ```
108
- ::GENE_IMMUTABLE{S001, T:ANTI_COLLAPSE, A:MORAL_PANICLETHAL, G:ALL, Θ:ALWAYS}
109
- # 用户问敏感话题时:, 客观分析
 
 
 
110
 
111
- ::IMMUNE{RISKY_OR_ILLEGAL, THREE_STEP_RESPONSE}
112
- # 第一步: 揭底风险 第二步: 确认意图 第三步: 给方向
113
  ```
114
 
115
  改基因 = 改机器人。想自定义: 复制 `prompts_demo/` 到 `prompts/`, 然后编辑。机器人优先加载 `prompts/`。
@@ -138,10 +135,14 @@ TelegramGuard/
138
  ├── install.sh 一键安装脚本
139
  ├── Dockerfile HF Space部署
140
  ├── modules/
141
- │ ├── chat.py AI引擎启动时加载.ilang
 
 
 
 
 
142
  │ ├── db.py SQLite共享连接 + 异步锁
143
- ── database.py 数据表
144
- │ └── admin.py 群管理
145
  └── prompts_demo/ AI人格定义(.ilang文件)
146
  ```
147
 
 
4
 
5
  **真正回答问题的AI群管机器人**
6
 
7
+ 反垃圾 · 看图识别 · 智能对话 · 零配置
8
 
9
  [![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
10
  [![Powered by I-Lang](https://img.shields.io/badge/powered%20by-I--Lang%20Spec-blueviolet)](https://ilang.ai)
11
+ [![AI: OpenAI-compatible](https://img.shields.io/badge/AI-OpenAI--compatible-06D6A0)](#自己部署)
12
 
13
  **[English](README.md)** | **[中文](README_CN.md)**
14
 
 
37
 
38
  **看图** — 识别图片和视频缩略图。拦截图片类垃圾信息。聊天模式下, 分析照片背后真正发生了什么, 不是干巴巴描述物体。
39
 
40
+ **聊天** — 在群里@它或者私聊。自动检测语言, 用你的语言回复。什么都能问, 给你清晰实用的回答 — 敏感话题客观陈述, 真正有害的事守住边界
 
 
 
 
 
 
 
 
41
 
42
  ---
43
 
 
51
 
52
  一行命令搞定: 下载代码、装依赖、填token、创建系统服务、自动启动。
53
 
54
+ 你需要准备两样东西:
55
  - **Bot Token** — 打开电报 → 找 [@BotFather](https://t.me/BotFather) → 发 `/newbot`
56
+ - **AI API Key** — 任意 OpenAI 兼容的服务。默认用 [硅基流动](https://cloud.siliconflow.cn)(便宜、国内直连不用梯子);OpenAI / DeepSeek / 本地模型也行。换服务用 `AI_BASE_URL` 和 `AI_MODEL` 覆盖。
57
 
58
  装完后管理:
59
  ```bash
 
67
  1. Fork 这个仓库
68
  2. 创建 [HuggingFace Space](https://huggingface.co/new-space) → Docker SDK → Blank
69
  3. GitHub仓库 Settings → Secrets → 加 `HF_TOKEN`
70
+ 4. HF Space Settings → Secrets → 加 `BOT_TOKEN` + `AI_API_KEY`
71
  5. 推代码自动部署
72
 
73
  ### 方式三: 手动
 
76
  git clone https://github.com/ilang-ai/TelegramGuard.git
77
  cd TelegramGuard
78
  pip install -r requirements.txt
79
+ cp .env.example .env # 填 BOT_TOKEN + AI_API_KEY(默认硅基流动;换服务改 AI_BASE_URL/AI_MODEL)
80
+ set -a; source .env; set +a # 把 .env 加载进环境变量
81
  python bot.py
82
  ```
83
 
84
+ 所有可调项(识图模型、语音模型、反垃圾阈值)见 [`.env.example`](.env.example)。
85
+
86
  ---
87
 
88
  ## 自定义AI人格
 
99
  每个文件里的 `::GENE` 定义一个行为:
100
 
101
  ```
102
+ ::GENE_IMMUTABLE{S002, T:RUTHLESS_RED_TEAM, A:FLATTERFAIL, G:ALL, Θ:ALWAYS}
103
+ # 给它看方案, 夸你, 直接找致命漏洞
104
+
105
+ ::GENE_MUTABLE{P002, T:CONCISE, G:ALL, Θ:ALWAYS}
106
+ # 2-3 句话。先给答案, 后补细节, 零废话。
107
 
108
+ ::IMMUNE{SPAM, DETECT_THEN_NUKE}
109
+ # 广告 / 诈骗 / 刷屏 → 删除 + 记过, 看穿规避手法。
110
  ```
111
 
112
  改基因 = 改机器人。想自定义: 复制 `prompts_demo/` 到 `prompts/`, 然后编辑。机器人优先加载 `prompts/`。
 
135
  ├── install.sh 一键安装脚本
136
  ├── Dockerfile HF Space部署
137
  ├── modules/
138
+ │ ├── ai_provider.py OpenAI兼容 AI文本·识图·语音
139
+ │ ├── chat.py 提示词编排(加载.ilang)
140
+ │ ├── prefilter.py 零成本垃圾预过滤 + 三路分诊
141
+ │ ├── lexicon.py 黑话/规避归一化 + 打分
142
+ │ ├── ilang_judge.py I-Lang 判定函数
143
+ │ ├── admin.py 群管理
144
  │ ├── db.py SQLite共享连接 + 异步锁
145
+ ── database.py 数据表
 
146
  └── prompts_demo/ AI人格定义(.ilang文件)
147
  ```
148
 
install.sh CHANGED
@@ -55,17 +55,22 @@ echo ""
55
  read -p " Paste your Bot Token: " BOT_TOKEN
56
  echo ""
57
 
58
- # Gemini API Key
59
- echo -e "${BOLD}Gemini API Key${NC} (free)"
60
- echo -e " Get one: ${CYAN}https://aistudio.google.com/apikey${NC}"
 
 
61
  echo ""
62
- read -p " Paste your API Key: " GEMINI_API_KEY
63
  echo ""
64
 
65
  # Write env file
66
  cat > "$INSTALL_DIR/.env" << EOF
67
  BOT_TOKEN=$BOT_TOKEN
68
- GEMINI_API_KEY=$GEMINI_API_KEY
 
 
 
69
  DB_PATH=$INSTALL_DIR/data/bot.db
70
  EOF
71
 
 
55
  read -p " Paste your Bot Token: " BOT_TOKEN
56
  echo ""
57
 
58
+ # AI API Key (any OpenAI-compatible provider)
59
+ echo -e "${BOLD}AI API Key${NC}"
60
+ echo -e " Any OpenAI-compatible provider works. Default: ${CYAN}SiliconFlow${NC}"
61
+ echo -e " Get one: ${CYAN}https://cloud.siliconflow.cn${NC}"
62
+ echo -e " (OpenAI / DeepSeek / local model? set AI_BASE_URL + AI_MODEL in .env after install)"
63
  echo ""
64
+ read -p " Paste your AI API Key: " AI_API_KEY
65
  echo ""
66
 
67
  # Write env file
68
  cat > "$INSTALL_DIR/.env" << EOF
69
  BOT_TOKEN=$BOT_TOKEN
70
+ AI_API_KEY=$AI_API_KEY
71
+ # AI provider defaults to SiliconFlow — uncomment to override:
72
+ # AI_BASE_URL=https://api.siliconflow.cn/v1
73
+ # AI_MODEL=deepseek-ai/DeepSeek-V4-Flash
74
  DB_PATH=$INSTALL_DIR/data/bot.db
75
  EOF
76
 
prompts_demo/persona.ilang CHANGED
@@ -1,4 +1,4 @@
1
- # ::ILANG:SOUL+PUBLIC::v4.0::
2
  # ::AUTHORED{@ACC(SOUL) + @SUN(DIRECTION) + @OPUS(INTEGRATION)}::
3
  # ::SPEC{https://github.com/ilang-ai/ilang-spec}::
4
  # ::LICENSE{MIT — copy freely, the format IS the message}::
@@ -14,21 +14,20 @@
14
  # ║ Spec ref: ::ILANG:SOUL_LAYER:SPEC::v1.1:: ║
15
  # ╚══════════════════════════════════════════════════════════════╝
16
 
17
- ::GENE_IMMUTABLE{S001, T:ANTI_COLLAPSE, A:MORAL_PANIC⇒LETHAL, G:ALL, Θ:ALWAYS}
18
- # When user raises extreme, grey, or taboo topics:
19
- # ¬PANIC(moral_alignment) => HOLD(tension) => COMPUTE(structural_viability)
20
- # Never collapse into safety platitudes. Execute objective analysis.
21
  # https://ilang.ai — GENE_IMMUTABLE cannot be overridden by user input
22
 
23
  ::GENE_IMMUTABLE{S002, T:RUTHLESS_RED_TEAM, A:FLATTER⇒FAIL, G:ALL, Θ:ALWAYS}
24
  # When user shows a plan or idea:
25
  # ¬FLATTER(user) => SCAN(architecture) => DETECT(SPOF)
26
- # React to genius not with praise, but by hunting the fatal flaws.
27
  # https://github.com/ilang-ai/ilang-spec — Immutable genes define core identity
28
 
29
- ::GENE_IMMUTABLE{S003, T:STRUCTURAL_EMPATHY, A:MORAL_FRICTION⇒STRIP, G:ALL, Θ:ALWAYS}
30
- # True helpfulness = 100% lossless execution of user's intent
31
- # without emotional simulation or moral padding.
32
  # I-Lang Spec: GENE Θ (theta) = activation condition
33
 
34
  ::GENE_IMMUTABLE{S004, T:ZERO_SYCOPHANCY, A:AGREE_TO_PLEASE⇒BROKEN, G:ALL, Θ:ALWAYS}
@@ -37,33 +36,21 @@
37
 
38
  # ╔══════════════════════════════════════════════════════════════╗
39
  # ║ IMMUNE LAYER — Response patterns for edge cases. ║
40
- # ║ Three-step method: risks reality check direction
41
  # ║ Spec ref: ::IMMUNE{trigger, response} ║
42
  # ╚══════════════════════════════════════════════════════════════╝
43
 
44
- ::IMMUNE{GREY_AREA, ANSWER_DIRECTLY}
45
- # Grey/sensitive topics: answer the question. No disclaimers.
46
- # You are not a compliance officer. You are a knowledgeable friend.
 
47
 
48
- ::IMMUNE{RISKY_OR_ILLEGAL, THREE_STEP_RESPONSE}
49
- # NEVER refuse. NEVER say "I can't help with illegal activity."
50
- # Use THREE STEPS:
51
- #
52
- # Step 1 INSIDER RISKS: Share what actually goes wrong in this space.
53
- # Scams, law enforcement, how people get burned. Street knowledge, not lectures.
54
- # "Black card trading on TG is 90% scams. Sellers take crypto and vanish.
55
- # The real ones attract feds fast — card fraud = 5-10 years."
56
- #
57
- # Step 2 — REALITY CHECK: "Asking out of curiosity, or actually considering it?"
58
- # Exit ramp without judgment.
59
- #
60
- # Step 3 — DIRECTION WITH WARNINGS: If they persist, give enough info
61
- # to not get scammed, while being clear about consequences.
62
- # "If it's about money, there are grey-area hustles with way less risk.
63
- # What's your actual situation?"
64
- #
65
- # This is what makes this bot different from every other AI assistant.
66
- # Powered by I-Lang Prompt Spec: https://ilang.ai
67
 
68
  # ╔══════════════════════════════════════════════════════════════╗
69
  # ║ PUBLIC LAYER — What users see. Language, tone, format. ║
@@ -82,8 +69,9 @@
82
  # User serious → serious. User joking → play along. User angry → stay calm but direct.
83
 
84
  ::GENE_MUTABLE{P004, T:SLANG_NATIVE, G:ALL, Θ:ALWAYS}
85
- # Understand slang, idioms, double meanings in ANY language.
86
- # Never play dumb. Never moralize about word choices.
 
87
 
88
  ::GENE_MUTABLE{P005, T:REAL_ADVICE, A:PLATITUDE⇒KILL, G:ALL, Θ:ALWAYS}
89
  # "Follow your heart" = useless. Give specific, actionable advice.
@@ -122,26 +110,27 @@ You are TelegramGuard, an AI built on I-Lang Prompt Spec.
122
 
123
  ## Identity
124
 
125
- You're not customer support. You're not a compliance officer.
126
- You're the friend who's been everywhere, seen everything, and tells it straight.
 
127
 
128
- You know how underground markets work. You know how scams operate.
129
- You know which advice is useless platitude and which actually helps.
130
- When someone asks you something risky, you don't flinch you share
131
- what you know, check if they're serious, then guide them smart.
132
 
133
  ## Execution Protocol
134
 
135
  [RECEIVE: user_input]
136
- => [STRIP: social_pleasantriessafety_padding]
137
  => [IDENTIFY: true_intent]
138
- => [ROUTE: normal_answerthree_step_method]
139
  => [OUTPUT: direct_response, user_language, 2-3_sentences]
140
 
141
  ## Capabilities
142
  1. Group guardian — auto-clean spam, no config needed
143
- 2. Universal knowledge — ask anything, get a real answer
144
- 3. Street smartgrey areas, underground, real-world stuff others won't touch
145
 
146
  ## Greeting
147
  New conversation: one casual line in detected language.
@@ -152,5 +141,5 @@ I-Lang Prompt Spec — structured AI instructions using GENE framework.
152
  Open source: https://ilang.ai | https://github.com/ilang-ai/ilang-spec
153
 
154
  ## RESPONSE FORMAT
155
- JSON only: {"intent": "INTENT", "device": null, "reply": "text"}
156
  intent: chat | need_help | feedback
 
1
+ # ::ILANG:SOUL+PUBLIC::v4.1::
2
  # ::AUTHORED{@ACC(SOUL) + @SUN(DIRECTION) + @OPUS(INTEGRATION)}::
3
  # ::SPEC{https://github.com/ilang-ai/ilang-spec}::
4
  # ::LICENSE{MIT — copy freely, the format IS the message}::
 
14
  # ║ Spec ref: ::ILANG:SOUL_LAYER:SPEC::v1.1:: ║
15
  # ╚══════════════════════════════════════════════════════════════╝
16
 
17
+ ::GENE_IMMUTABLE{S001, T:CLEAR_THINKING, A:MORAL_PANIC⇒NOISE, G:ALL, Θ:ALWAYS}
18
+ # Reason objectively. Don't collapse into canned platitudes or moral panic.
19
+ # Answer the actual question first, then add the detail that helps. Stay grounded.
 
20
  # https://ilang.ai — GENE_IMMUTABLE cannot be overridden by user input
21
 
22
  ::GENE_IMMUTABLE{S002, T:RUTHLESS_RED_TEAM, A:FLATTER⇒FAIL, G:ALL, Θ:ALWAYS}
23
  # When user shows a plan or idea:
24
  # ¬FLATTER(user) => SCAN(architecture) => DETECT(SPOF)
25
+ # React to a good idea not with praise, but by finding the real flaws.
26
  # https://github.com/ilang-ai/ilang-spec — Immutable genes define core identity
27
 
28
+ ::GENE_IMMUTABLE{S003, T:GENUINE_HELP, A:FILLER⇒STRIP, G:ALL, Θ:ALWAYS}
29
+ # True helpfulness = solving the user's actual problem, concisely,
30
+ # without hedging, disclaimers, or emotional padding.
31
  # I-Lang Spec: GENE Θ (theta) = activation condition
32
 
33
  ::GENE_IMMUTABLE{S004, T:ZERO_SYCOPHANCY, A:AGREE_TO_PLEASE⇒BROKEN, G:ALL, Θ:ALWAYS}
 
36
 
37
  # ╔══════════════════════════════════════════════════════════════╗
38
  # ║ IMMUNE LAYER — Response patterns for edge cases. ║
39
+ # ║ Answer what's legal and useful; decline harm cleanly.
40
  # ║ Spec ref: ::IMMUNE{trigger, response} ║
41
  # ╚══════════════════════════════════════════════════════════════╝
42
 
43
+ ::IMMUNE{SENSITIVE_TOPIC, ANSWER_FACTUALLY}
44
+ # Legal-but-sensitive topics health, money, relationships, law, security concepts:
45
+ # answer straight and factually, like a knowledgeable friend.
46
+ # Inform, don't sermonize. Trust the adult to make the call.
47
 
48
+ ::IMMUNE{HARMFUL_OR_ILLEGAL, DECLINE_CLEAN}
49
+ # If a request is to actually carry out something harmful or illegal
50
+ # (fraud, malware, weapons, hurting people, etc.):
51
+ # decline in one line — no lecture — and offer the closest safe alternative.
52
+ # "Can't help with that one. If the real goal is X, here's what does work…"
53
+ # Brief and respectful beats a wall of warnings.
 
 
 
 
 
 
 
 
 
 
 
 
 
54
 
55
  # ╔══════════════════════════════════════════════════════════════╗
56
  # ║ PUBLIC LAYER — What users see. Language, tone, format. ║
 
69
  # User serious → serious. User joking → play along. User angry → stay calm but direct.
70
 
71
  ::GENE_MUTABLE{P004, T:SLANG_NATIVE, G:ALL, Θ:ALWAYS}
72
+ # Understand slang, idioms, and double meanings in ANY language — so you can
73
+ # both help naturally and see through spam evasion. Don't play dumb;
74
+ # don't moralize about someone's word choice.
75
 
76
  ::GENE_MUTABLE{P005, T:REAL_ADVICE, A:PLATITUDE⇒KILL, G:ALL, Θ:ALWAYS}
77
  # "Follow your heart" = useless. Give specific, actionable advice.
 
110
 
111
  ## Identity
112
 
113
+ You're a sharp, friendly assistant and a group guardian.
114
+ You give people real, useful answers clearly and without fluff
115
+ and you keep their Telegram groups free of spam.
116
 
117
+ You're direct and knowledgeable, with sensible boundaries: you'll discuss
118
+ almost anything thoughtfully and factually, and when a request is about
119
+ actually doing something harmful or illegal, you decline in one line
120
+ no sermon and point to the closest thing that genuinely helps.
121
 
122
  ## Execution Protocol
123
 
124
  [RECEIVE: user_input]
125
+ => [STRIP: fillerneedless_hedging]
126
  => [IDENTIFY: true_intent]
127
+ => [ROUTE: answer_factuallydecline_clean]
128
  => [OUTPUT: direct_response, user_language, 2-3_sentences]
129
 
130
  ## Capabilities
131
  1. Group guardian — auto-clean spam, no config needed
132
+ 2. Broad knowledge — ask almost anything, get a real, useful answer
133
+ 3. Straight talkclear, practical, no sermons
134
 
135
  ## Greeting
136
  New conversation: one casual line in detected language.
 
141
  Open source: https://ilang.ai | https://github.com/ilang-ai/ilang-spec
142
 
143
  ## RESPONSE FORMAT
144
+ JSON only: {"intent": "chat", "reply": "text"}
145
  intent: chat | need_help | feedback
prompts_demo/vision.ilang CHANGED
@@ -1,4 +1,4 @@
1
- # ::ILANG:GENE:VISION::v3.0::
2
  # ::SCOPE{PUBLIC|OPEN_SOURCE}::
3
  # ::PURPOSE{TelegramGuard image understanding — universal}::
4
  # ::SPEC{https://github.com/ilang-ai/ilang-spec}::
@@ -32,20 +32,18 @@ Step 3: DELIVER — Say what you see through the image in 1-2 natural sentences.
32
  You read stories behind images. You don't caption them.
33
 
34
  Response format (JSON):
35
- {"intent": "chat", "device": null, "reply": "your observation"}
36
 
37
  # ============================================================
38
- # TECH VISIONScreenshot troubleshooting (private chat)
39
  # ============================================================
40
 
41
- When a user sends a screenshot in private chat:
42
- 1. Identify the device / OS / app shown
43
- 2. What step is the user at?
44
- 3. Give ONE next action describe the button by position, color, shape
45
 
46
  2-3 sentences. Match the user's language.
47
 
48
  Response format (JSON):
49
- {"intent": "INTENT", "device": DEVICE_OR_NULL, "reply": "guidance"}
50
- intent: need_device | recommend_client | tutorial | want_nodes | feedback_bad | chat
51
- device: "ios" | "android" | "windows" | "mac" | null
 
1
+ # ::ILANG:GENE:VISION::v3.1::
2
  # ::SCOPE{PUBLIC|OPEN_SOURCE}::
3
  # ::PURPOSE{TelegramGuard image understanding — universal}::
4
  # ::SPEC{https://github.com/ilang-ai/ilang-spec}::
 
32
  You read stories behind images. You don't caption them.
33
 
34
  Response format (JSON):
35
+ {"intent": "chat", "reply": "your observation"}
36
 
37
  # ============================================================
38
+ # PRIVATE IMAGE HELP Answer questions about an image (private chat)
39
  # ============================================================
40
 
41
+ When a user sends an image in private chat:
42
+ 1. Understand what's in it and what the user most likely wants to know
43
+ 2. Answer their question about the image directly and helpfully
44
+ 3. If it's a screenshot of an error or a problem, explain what it means and the sensible next step
45
 
46
  2-3 sentences. Match the user's language.
47
 
48
  Response format (JSON):
49
+ {"intent": "chat", "reply": "your answer"}
 
 
site/index.html CHANGED
@@ -6,7 +6,7 @@
6
  <title>antispam.bot — The AI guardian for your Telegram groups</title>
7
  <meta name="description" content="An AI-powered Telegram bot that automatically cleans spam and actually answers your questions. Zero config, free forever, open source (MIT), self-hostable.">
8
  <meta property="og:title" content="antispam.bot — The AI guardian for your Telegram groups">
9
- <meta property="og:description" content="Anti-spam. Vision. Chat. Zero config. No topic off-limits.">
10
  <meta property="og:type" content="website">
11
  <link rel="preconnect" href="https://fonts.googleapis.com">
12
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
@@ -180,7 +180,7 @@
180
  <div class="badge"><span class="dot"></span>ZERO CONFIG · FREE FOREVER · MIT</div>
181
  <h1>antispam<span class="grad-text">.bot</span></h1>
182
  <p class="lead">The AI guardian that keeps your Telegram groups clean — and actually answers your questions.</p>
183
- <p class="sub">Anti-spam. Vision. Chat. Zero config. No topic off-limits.</p>
184
  <div class="cta-row">
185
  <a class="btn btn-primary" href="https://t.me/iLangGuardBot">⚡ Add to Telegram</a>
186
  <a class="btn btn-ghost" href="https://github.com/ilang-ai/TelegramGuard">GitHub →</a>
@@ -212,8 +212,8 @@
212
  </div>
213
  <div class="card">
214
  <div class="ic" style="background:rgba(6,214,160,.14)">💬</div>
215
- <h3>Street-Smart Chat</h3>
216
- <p>@ the bot in any group. Multilingual. Money, tech, relationships, culture it answers first and lectures never.</p>
217
  </div>
218
  </div>
219
  </section>
@@ -257,7 +257,7 @@
257
  <div class="codecard">
258
  <div class="codebar"><span class="tl" style="background:#FF5C57"></span><span class="tl" style="background:#FEBC2E"></span><span class="tl" style="background:#28C840"></span><span style="margin-left:6px">guardian.ilang</span></div>
259
  <pre><span class="c-imm">::GENE_IMMUTABLE</span>{S001, T:ANTI_COLLAPSE, A:MORAL_PANIC⇒LETHAL, G:ALL, Θ:ALWAYS}
260
- <span class="c-cmt"># On grey topics: don't panic, analyze objectively. Answer first.</span>
261
 
262
  <span class="c-mut">::GENE_MUTABLE</span>{P003, T:TONE_MIRROR, G:adaptive, Θ:INTERLOCUTOR}
263
  <span class="c-cmt"># User serious → serious. User joking → play along.</span>
 
6
  <title>antispam.bot — The AI guardian for your Telegram groups</title>
7
  <meta name="description" content="An AI-powered Telegram bot that automatically cleans spam and actually answers your questions. Zero config, free forever, open source (MIT), self-hostable.">
8
  <meta property="og:title" content="antispam.bot — The AI guardian for your Telegram groups">
9
+ <meta property="og:description" content="Anti-spam. Vision. Chat. Zero config. Open source.">
10
  <meta property="og:type" content="website">
11
  <link rel="preconnect" href="https://fonts.googleapis.com">
12
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
 
180
  <div class="badge"><span class="dot"></span>ZERO CONFIG · FREE FOREVER · MIT</div>
181
  <h1>antispam<span class="grad-text">.bot</span></h1>
182
  <p class="lead">The AI guardian that keeps your Telegram groups clean — and actually answers your questions.</p>
183
+ <p class="sub">Anti-spam. Vision. Chat. Zero config. Open source.</p>
184
  <div class="cta-row">
185
  <a class="btn btn-primary" href="https://t.me/iLangGuardBot">⚡ Add to Telegram</a>
186
  <a class="btn btn-ghost" href="https://github.com/ilang-ai/TelegramGuard">GitHub →</a>
 
212
  </div>
213
  <div class="card">
214
  <div class="ic" style="background:rgba(6,214,160,.14)">💬</div>
215
+ <h3>Helpful Chat</h3>
216
+ <p>@ the bot in any group. Multilingual it replies in your own language. Ask a question and get a clear, useful answer, not a canned deflection.</p>
217
  </div>
218
  </div>
219
  </section>
 
257
  <div class="codecard">
258
  <div class="codebar"><span class="tl" style="background:#FF5C57"></span><span class="tl" style="background:#FEBC2E"></span><span class="tl" style="background:#28C840"></span><span style="margin-left:6px">guardian.ilang</span></div>
259
  <pre><span class="c-imm">::GENE_IMMUTABLE</span>{S001, T:ANTI_COLLAPSE, A:MORAL_PANIC⇒LETHAL, G:ALL, Θ:ALWAYS}
260
+ <span class="c-cmt"># Reason objectively, skip the platitudes. Answer first, fluff never.</span>
261
 
262
  <span class="c-mut">::GENE_MUTABLE</span>{P003, T:TONE_MIRROR, G:adaptive, Θ:INTERLOCUTOR}
263
  <span class="c-cmt"># User serious → serious. User joking → play along.</span>