2022-02-16 18:13:44 +03:00
|
|
|
from aiogram import Dispatcher, Bot
|
|
|
|
from aiogram.bot.api import TelegramAPIServer
|
2023-03-28 09:49:46 +03:00
|
|
|
from aiogram.contrib.fsm_storage.memory import MemoryStorage
|
2022-02-16 18:13:44 +03:00
|
|
|
from playhouse.db_url import connect
|
|
|
|
|
|
|
|
from configs import Configure
|
|
|
|
|
|
|
|
|
|
|
|
config = Configure()
|
|
|
|
|
2023-03-28 09:49:46 +03:00
|
|
|
db = connect(config.db_link)
|
2022-02-16 18:13:44 +03:00
|
|
|
|
|
|
|
bot = Bot(
|
2023-03-28 09:49:46 +03:00
|
|
|
token=config.token,
|
2022-02-16 18:13:44 +03:00
|
|
|
server=TelegramAPIServer.from_base(config.telegram_bot_api_server)
|
|
|
|
)
|
2023-03-28 09:49:46 +03:00
|
|
|
storage = MemoryStorage()
|
|
|
|
dp = Dispatcher(bot, storage=storage)
|