Files
balance_bot/bot/utils/hidden_username.py
2026-01-23 04:45:55 +07:00

22 lines
630 B
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
from aiogram.types import Message
from aiogram.utils.markdown import hide_link
from bot import bot
__all__ = ("hidden_admins_message",)
async def hidden_admins_message(message: Message,
text: str = "") -> str:
"""
Формирует текст с упоминанием всех админов через скрытые ссылки.
"""
admins = await bot.get_chat_administrators(message.chat.id)
hidden_links: str = "".join(
hide_link(f"tg://user?id={admin.user.id}")
for admin in admins if not admin.user.is_bot
)
return f"{hidden_links}{text}"