File size: 2,962 Bytes
fa6f6d3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
99f0a25
 
 
 
 
 
 
 
 
76a45e0
 
 
 
 
 
 
fa6f6d3
 
 
 
 
 
 
 
 
 
 
 
da5659b
 
 
 
e4cf54e
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# ── Telegram ──────────────────────────────────────────────
# Bot token from @BotFather (/newbot).
BOT_TOKEN=

# ── AI provider (OpenAI-compatible) ───────────────────────
# Works with any OpenAI-compatible API: SiliconFlow (default),
# OpenAI, DeepSeek, a local vLLM/Ollama relay, or any gateway.
AI_API_KEY=
# Default endpoint targets SiliconFlow β€” get a key at https://cloud.siliconflow.cn
AI_BASE_URL=https://api.siliconflow.cn/v1
AI_MODEL=deepseek-ai/DeepSeek-V4-Flash

# Vision β€” comma-separated fallback chain (first model that succeeds wins).
AI_VISION_MODELS=Qwen/Qwen3-VL-30B-A3B-Instruct,Qwen/Qwen3-VL-32B-Instruct,Qwen/Qwen3-VL-8B-Instruct

# Voice-message transcription/understanding model.
AI_AUDIO_MODEL=Qwen/Qwen3-Omni-30B-A3B-Instruct

# Images are downscaled to this width before being sent to the vision model.
AI_IMAGE_MAX_WIDTH=600

# Optional second provider, tried only after every primary model failed.
# Leave the key empty to disable (default). Useful because a primary outage
# otherwise drops spam judging down to the keyword lexicon on its own.
AI_FALLBACK_API_KEY=
AI_FALLBACK_BASE_URL=
AI_FALLBACK_MODEL=
# Optional; the fallback text model is reused for images when this is empty.
AI_FALLBACK_VISION_MODEL=

# ── Ownership ─────────────────────────────────────────────
# Your Telegram numeric user ID. Unlocks /groups (view and clear the blocklist
# of groups the bot left over missing rights). Leave empty and nobody has it β€”
# there is deliberately no "first person to /start becomes the admin" fallback.
# Get yours from @userinfobot.
ADMIN_USER_ID=

# ── Storage ───────────────────────────────────────────────
DB_PATH=/data/bot.db

# ── Anti-spam tuning ──────────────────────────────────────
# New-user probation window (seconds).
SPAM_NEWUSER_COOLDOWN=300
# Identical message repeated this many times β†’ flooding.
SPAM_REPEAT_THRESHOLD=3
# ...within this window (seconds).
SPAM_REPEAT_WINDOW=300
# Chinese-slang lexicon hard-hit threshold (prefilter). Higher = stricter.
LEXICON_HARD_THRESHOLD=6
# Probe ("check-in") filler: silently delete after this many flags. Never bans.
PROBE_FLAG_DELETE=2
# Rolling window for those flags (hours); older flags reset the count.
PROBE_WINDOW_HOURS=24
# How much of a long message the judge sees (clipped head + tail, not head only).
JUDGE_TEXT_LIMIT=1800
JUDGE_CAPTION_LIMIT=900
# Cooldown (seconds) on public group commands for non-admins, so the bot cannot
# be used as a megaphone to bump someone's message. Admins are never limited.
GROUP_CMD_COOLDOWN=60