Исправление не соответствий в ядре бота
This commit is contained in:
@@ -65,7 +65,7 @@ class BotInfo:
|
|||||||
last_name: str = None
|
last_name: str = None
|
||||||
username: str = None
|
username: str = None
|
||||||
description: str = None
|
description: str = None
|
||||||
short_description: str = None
|
widget: str = None
|
||||||
is_premium: bool = False
|
is_premium: bool = False
|
||||||
|
|
||||||
# Возможности бота
|
# Возможности бота
|
||||||
@@ -159,11 +159,15 @@ class BotInfo:
|
|||||||
logger.info("Получение информации о боте", log_type='BOT')
|
logger.info("Получение информации о боте", log_type='BOT')
|
||||||
|
|
||||||
bot_info: User = await bots.get_me()
|
bot_info: User = await bots.get_me()
|
||||||
|
description_obj: BotDescription = await bots.get_my_description()
|
||||||
|
short_obj: BotShortDescription = await bots.get_my_short_description()
|
||||||
|
|
||||||
cls.id = bot_info.id
|
cls.id = bot_info.id
|
||||||
cls.url = f'tg://user?id={cls.id}'
|
cls.url = f'tg://user?id={cls.id}'
|
||||||
cls.first_name = bot_info.first_name
|
cls.first_name = bot_info.first_name
|
||||||
cls.last_name = bot_info.last_name
|
cls.last_name = bot_info.last_name
|
||||||
|
cls.description = description_obj.description if description_obj else None
|
||||||
|
cls.widget = short_obj.short_description if short_obj else None
|
||||||
cls.username = bot_info.username
|
cls.username = bot_info.username
|
||||||
cls.can_join_groups = getattr(bot_info, 'can_join_groups', False)
|
cls.can_join_groups = getattr(bot_info, 'can_join_groups', False)
|
||||||
cls.can_read_all_group_messages = getattr(bot_info, 'can_read_all_group_messages', False)
|
cls.can_read_all_group_messages = getattr(bot_info, 'can_read_all_group_messages', False)
|
||||||
@@ -183,6 +187,8 @@ class BotInfo:
|
|||||||
'username': cls.username,
|
'username': cls.username,
|
||||||
'prefix': cls.prefix,
|
'prefix': cls.prefix,
|
||||||
'is_premium': cls.is_premium,
|
'is_premium': cls.is_premium,
|
||||||
|
'description': cls.description,
|
||||||
|
'short_description': cls.widget,
|
||||||
'can_join_groups': cls.can_join_groups,
|
'can_join_groups': cls.can_join_groups,
|
||||||
'can_read_all_group_messages': cls.can_read_all_group_messages,
|
'can_read_all_group_messages': cls.can_read_all_group_messages,
|
||||||
'supports_inline_queries': cls.supports_inline_queries,
|
'supports_inline_queries': cls.supports_inline_queries,
|
||||||
@@ -310,6 +316,8 @@ class BotInfo:
|
|||||||
f"║ • Имя: {cls.first_name} {cls.last_name or ''}".ljust(60) + "║",
|
f"║ • Имя: {cls.first_name} {cls.last_name or ''}".ljust(60) + "║",
|
||||||
f"║ • Username: @{cls.username}".ljust(60) + "║",
|
f"║ • Username: @{cls.username}".ljust(60) + "║",
|
||||||
f"║ • ID: {cls.id}".ljust(60) + "║",
|
f"║ • ID: {cls.id}".ljust(60) + "║",
|
||||||
|
f"║ • Description: {cls.description}".ljust(60) + "║",
|
||||||
|
f"║ • Widget: {cls.widget}".ljust(60) + "║",
|
||||||
f"║",
|
f"║",
|
||||||
f"║ ⚙️ ВОЗМОЖНОСТИ БОТА:",
|
f"║ ⚙️ ВОЗМОЖНОСТИ БОТА:",
|
||||||
f"║ • Вступать в группы: {'✅' if cls.can_join_groups else '❌'}".ljust(60) + "║",
|
f"║ • Вступать в группы: {'✅' if cls.can_join_groups else '❌'}".ljust(60) + "║",
|
||||||
@@ -371,6 +379,7 @@ class BotInfo:
|
|||||||
setup_webhook: Устанавливать ли webhook (по умолчанию True)
|
setup_webhook: Устанавливать ли webhook (по умолчанию True)
|
||||||
"""
|
"""
|
||||||
perm = perm if perm is not None else settings.BOT_EDIT
|
perm = perm if perm is not None else settings.BOT_EDIT
|
||||||
|
await BotInfo.info()
|
||||||
|
|
||||||
logger.info("🚀 Процесс запуска бота!", log_type='START')
|
logger.info("🚀 Процесс запуска бота!", log_type='START')
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user