clash-telegram-bot/load.py
2022-03-18 21:25:50 +02:00

26 lines
618 B
Python

from aiogram import Dispatcher, Bot
from aiogram.bot.api import TelegramAPIServer
from aiogram.contrib.fsm_storage.memory import MemoryStorage
from playhouse.db_url import connect
from config import config
from coc import ClashOfClans
bot = Bot(
token=config["Bot"]["token"],
server=TelegramAPIServer.from_base(config["Bot"]["base_server"]),
parse_mode='HTML'
)
storage = MemoryStorage()
dp = Dispatcher(bot=bot, storage=storage)
db = connect(url=config["DataBase"]["link"])
coc_api = ClashOfClans(
api_token=open(config["API"]["api_file"], "r").read(),
clan_tag=config["API"]["clan_tag"]
)