clash-telegram-bot/load.py

26 lines
618 B
Python
Raw Permalink Normal View History

2022-03-18 22:25:50 +03:00
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"]
)