Files
PrimoWorldsBot/main.py
2025-04-13 06:50:23 +07:00

40 lines
1.2 KiB
Python
Raw Permalink 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.
# main.py
# Основной код проекта, который и соединяет в себе все его возможности
from BotLibrary import *
from ProjectsFiles import Permissions
from BotCode import router as main_routers
# Запуск основного кода
async def main() -> None:
# Запуск логеров
Logs.setup()
# Получение информации о боте
await BotInfo.info()
# Вывод сообщение о запуске
Logs.start(text=f"Начало запуска бота @{BotInfo.username}...")
# Создание пустых директорий
await Directory.setup()
# Нужно ли удалить веб-хук
if Permissions.delete_webhook:
await bot.delete_webhook()
# Установка необходимых прав
await BotRights.all(bot)
Logs.console()
# Подключение главного маршрутизатора
dp.include_router(main_routers)
# Включение опроса бота
await dp.start_polling(bot)
# Вечная загрузка бота
if __name__ == "__main__":
from asyncio import run
run(main())