Feat: changed bot starting

This commit is contained in:
2024-12-26 16:08:32 +03:00
parent 2882688ff4
commit 53bb09f41c
4 changed files with 25 additions and 10 deletions

10
main.py
View File

@@ -3,9 +3,8 @@ import logging
from sys import exit
import uvloop
from aiogram import Bot, Dispatcher
from nwxraybot import Settings
from nwxraybot import NwXrayBot, Settings
from nwxraybot.handlers import HelloHandler
from nwxraybot.models import User
@@ -21,7 +20,6 @@ if __name__ == "__main__":
User.create_table()
# Start bot
bot = Bot(token=config.bot_token.get_secret_value())
dp = Dispatcher()
dp.include_routers(HelloHandler(bot)())
uvloop.run(dp.start_polling(bot, skip_updates=True))
bot = NwXrayBot(config.bot_token.get_secret_value())
bot.include_routers(HelloHandler(bot)())
uvloop.run(bot.start(skip_updates=True))