28 lines
503 B
Python
28 lines
503 B
Python
import os
|
|
|
|
from aiogram import Bot, Dispatcher
|
|
import asyncio
|
|
import bot
|
|
from dotenv import load_dotenv
|
|
|
|
load_dotenv()
|
|
|
|
API_TOKEN = os.getenv("API_TOKEN")
|
|
|
|
|
|
# Создаем объект бота и диспетчера
|
|
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())
|