2024-08-16 08:23:35 +00:00
|
|
|
import os
|
|
|
|
|
2024-08-16 08:19:39 +00:00
|
|
|
from aiogram import Bot, Dispatcher
|
|
|
|
import asyncio
|
|
|
|
import bot
|
2024-08-16 08:23:35 +00:00
|
|
|
from dotenv import load_dotenv
|
|
|
|
|
|
|
|
load_dotenv()
|
2024-08-16 08:19:39 +00:00
|
|
|
|
2024-08-16 08:23:35 +00:00
|
|
|
API_TOKEN = os.getenv("API_TOKEN")
|
2024-08-16 08:19:39 +00:00
|
|
|
|
|
|
|
|
|
|
|
# Создаем объект бота и диспетчера
|
|
|
|
bot_chat = Bot(token=API_TOKEN)
|
|
|
|
dp = Dispatcher()
|
|
|
|
|
|
|
|
|
|
|
|
async def main() -> None:
|
|
|
|
""" Запуск бота """
|
|
|
|
dp.include_router(bot.router)
|
|
|
|
await dp.start_polling(bot_chat)
|
|
|
|
while True:
|
|
|
|
await asyncio.sleep(1)
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
asyncio.run(main())
|