Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/bot/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ class Settings(BaseSettings):
duplicate_spam_threshold: int = 2
duplicate_spam_min_length: int = 20
duplicate_spam_similarity: float = 0.95
bio_bait_enabled: bool = True
groups_config_path: str = "groups.json"
logfire_token: str | None = None
logfire_service_name: str = "pythonid-bot"
Expand Down
32 changes: 32 additions & 0 deletions src/bot/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,38 @@ def format_hours_display(hours: int) -> str:
"📌 [Peraturan Grup]({rules_link})"
)

# Bio bait spam notification (e.g. "cek bio aku" / "lihat byoh")
BIO_BAIT_SPAM_NOTIFICATION = (
"🚫 *Spam Bio Bait Terdeteksi*\n\n"
"Pesan dari {user_mention} telah dihapus karena berisi ajakan "
"untuk mengecek bio/profil, pola yang umum dipakai untuk spam/promosi/scam.\n\n"
"Pengguna telah dibatasi.\n\n"
"📌 [Peraturan Grup]({rules_link})"
)

BIO_BAIT_SPAM_NOTIFICATION_NO_RESTRICT = (
"🚫 *Spam Bio Bait Terdeteksi*\n\n"
"Pesan dari {user_mention} telah dihapus karena berisi ajakan "
"untuk mengecek bio/profil, pola yang umum dipakai untuk spam/promosi/scam.\n\n"
"📌 [Peraturan Grup]({rules_link})"
)

# Bio profile link spam (user's profile bio contains promo/scam links)
BIO_LINK_SPAM_NOTIFICATION = (
"🚫 *Spam Bio Profil Terdeteksi*\n\n"
"Pesan dari {user_mention} telah dihapus karena akun ini memiliki "
"bio profil dengan tautan/mention Telegram mencurigakan.\n\n"
"Pengguna telah dibatasi.\n\n"
"📌 [Peraturan Grup]({rules_link})"
)

BIO_LINK_SPAM_NOTIFICATION_NO_RESTRICT = (
"🚫 *Spam Bio Profil Terdeteksi*\n\n"
"Pesan dari {user_mention} telah dihapus karena akun ini memiliki "
"bio profil dengan tautan/mention Telegram mencurigakan.\n\n"
"📌 [Peraturan Grup]({rules_link})"
)

# Whitelisted URL domains for new user probation
# These domains are allowed even during probation period
# Matches exact domain or subdomains (e.g., "github.com" matches "www.github.com")
Expand Down
2 changes: 2 additions & 0 deletions src/bot/group_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class GroupConfig(BaseModel):
duplicate_spam_threshold: int = 2
duplicate_spam_min_length: int = 20
duplicate_spam_similarity: float = 0.95
bio_bait_enabled: bool = True

@field_validator("group_id")
@classmethod
Expand Down Expand Up @@ -193,6 +194,7 @@ def build_group_registry(settings: object) -> GroupRegistry:
duplicate_spam_threshold=settings.duplicate_spam_threshold,
duplicate_spam_min_length=settings.duplicate_spam_min_length,
duplicate_spam_similarity=settings.duplicate_spam_similarity,
bio_bait_enabled=settings.bio_bait_enabled,
)
registry.register(config)

Expand Down
Loading
Loading