replace-bot/load.py

19 lines
437 B
Python
Raw Normal View History

2022-02-16 18:13:44 +03:00
from aiogram import Dispatcher, Bot
from aiogram.bot.api import TelegramAPIServer
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()
db = connect(config.db_link)
2022-02-16 18:13:44 +03:00
bot = Bot(
token=config.token,
2022-02-16 18:13:44 +03:00
server=TelegramAPIServer.from_base(config.telegram_bot_api_server)
)
storage = MemoryStorage()
dp = Dispatcher(bot, storage=storage)