chat_moderator_bot/main.py

37 lines
653 B
Python
Raw Normal View History

2024-07-17 20:35:45 +00:00
import asyncio
import logging
import sys
from aiogram import Dispatcher
from core import bot
from handlers import routers
from utils.db import Postgres
# from utils.middleware import DeleteMessage
dp = Dispatcher()
dp.include_routers(*routers)
# dp.update.middleware.register(
# middleware=DeleteMessage()
# )
async def start():
"""
Запускает бота
:return:
"""
p = Postgres()
await p.create_tables()
await bot.delete_webhook()
await dp.start_polling(bot)
if __name__ == "__main__":
logging.basicConfig(
level=logging.INFO,
stream=sys.stdout
)
asyncio.run(start())