1.3 Новые определения типов

This commit is contained in:
Verum
2025-02-26 11:19:22 +07:00
parent a92806d6d3
commit 50345a5c57
2 changed files with 19 additions and 1 deletions

View File

@@ -0,0 +1,19 @@
# BotLibrary/analytics/type_chat.py
# Определение типа чата
from aiogram import types
# Настройка экспорта в модули
__all__ = ("type_chat",)
# Проверка на тип чата
async def type_chat(message: types.Message):
chat_type = message.chat.type
if chat_type == "private":
return "Личный"
elif chat_type == "group" or chat_type == "supergroup":
return "Группа"
elif chat_type == "channel":
return "Канал"
else:
return "Неизвестный тип чата."

View File

@@ -3,7 +3,6 @@ from aiogram.types import ContentType, Message
# Настройка экспорта из модуля # Настройка экспорта из модуля
__all__ = ("types_message",) __all__ = ("types_message",)
# Функция определения типа сообщения # Функция определения типа сообщения
def types_message(message: Message) -> str: def types_message(message: Message) -> str:
""" """