Files
Downloader-Bot/services/inline/service_icons.py
Mak5er d4595a7e13 feat(guest-mode): add Telegram Bot API 9.0 guest mode support and media download flow
- Add guest_message router and handler for guest mentions in chats where bot is not a member
- Support link detection from direct messages, replies, quotes, and text_link entities
- Integrate with inline media senders for supported platforms and deep-linking for audio/albums
- Add guest rate-limiting and ban enforcement in antiflood and ban middlewares
- Update chat tracker to track guest users without saving non-member group data
- Bypass private chat guard for guest messages
- Add /start settings, /start stats, and /start dl_<token> deep-link handlers
- Add comprehensive test suite in tests/test_guest_mode.py
2026-09-14 14:35:09 +03:00

19 lines
740 B
Python

def _favicon_url(domain: str) -> str:
return f"https://www.google.com/s2/favicons?sz=256&domain_url={domain}"
INLINE_SERVICE_ICONS: dict[str, str] = {
"instagram": _favicon_url("https://www.instagram.com"),
"threads": _favicon_url("https://www.threads.com"),
"pinterest": _favicon_url("https://www.pinterest.com"),
"soundcloud": _favicon_url("https://soundcloud.com"),
"spotify": _favicon_url("https://open.spotify.com"),
"tiktok": _favicon_url("https://www.tiktok.com"),
"twitter": _favicon_url("https://twitter.com"),
"youtube": _favicon_url("https://www.youtube.com"),
}
def get_inline_service_icon(service: str) -> str | None:
return INLINE_SERVICE_ICONS.get((service or "").strip().lower())