mirror of
https://github.com/Mak5er/Downloader-Bot
synced 2026-11-26 17:18:04 +08:00
- 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
19 lines
740 B
Python
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())
|