ShopBot/load.py

30 lines
589 B
Python
Raw Normal View History

2022-06-04 22:02:51 +03:00
import json
from aiogram import Dispatcher, Bot
from aiogram.bot.api import TelegramAPIServer
from aiogram.contrib.fsm_storage.memory import MemoryStorage
from peewee import SqliteDatabase
from playhouse.db_url import connect
import config
from utils import messages # used, do not delete!
# Bot init
bot = Bot(
token=config.token,
server=TelegramAPIServer.from_base(config.telegram_api_server)
)
storage = MemoryStorage()
dp = Dispatcher(
bot=bot,
storage=storage
)
db:SqliteDatabase = connect(config.db_url)
permissions = json.load(open(config.permission_file))