This repository has been archived on 2024-07-28. You can view files and clone it, but cannot push or open issues or pull requests.
moderator-bot/load.py

31 lines
690 B
Python
Raw Normal View History

2022-08-07 04:45:35 -04:00
from aiogram import Bot, Dispatcher
from aiogram import types
from aiogram.client.telegram import TelegramAPIServer
from aiogram.fsm.storage.memory import MemoryStorage
2023-01-04 15:14:32 -05:00
from apscheduler.schedulers.asyncio import AsyncIOScheduler
from aiogram.client.session.aiohttp import AiohttpSession
2022-08-07 04:45:35 -04:00
import config
import utils
2022-08-16 06:28:08 -04:00
2023-01-04 15:14:32 -05:00
2022-08-07 04:45:35 -04:00
storage = MemoryStorage()
2022-08-13 08:25:52 -04:00
# Create client connection
tgc = utils.TelegramClient(config.api_id, config.api_hash, config.token)
2022-08-07 04:45:35 -04:00
2023-01-04 15:14:32 -05:00
scheduler = AsyncIOScheduler()
session = AiohttpSession(
api=TelegramAPIServer.from_base(config.telegram_api_server),
)
2022-08-07 04:45:35 -04:00
bot = Bot(
token=config.token,
session=session,
2023-02-18 08:16:54 -05:00
parse_mode="Markdown"
2022-08-07 04:45:35 -04:00
)
dp = Dispatcher(storage=storage)