2022-08-07 04:45:35 -04:00
|
|
|
from aiogram import Bot, Dispatcher
|
|
|
|
from aiogram import types
|
2023-02-10 13:57:15 -05:00
|
|
|
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
|
2023-02-10 13:57:15 -05:00
|
|
|
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()
|
|
|
|
|
2023-02-10 13:57:15 -05:00
|
|
|
session = AiohttpSession(
|
|
|
|
api=TelegramAPIServer.from_base(config.telegram_api_server),
|
|
|
|
)
|
|
|
|
|
2022-08-07 04:45:35 -04:00
|
|
|
bot = Bot(
|
|
|
|
token=config.token,
|
2023-02-10 13:57:15 -05:00
|
|
|
session=session,
|
2023-02-18 08:16:54 -05:00
|
|
|
parse_mode="Markdown"
|
2022-08-07 04:45:35 -04:00
|
|
|
)
|
|
|
|
|
2023-02-10 13:57:15 -05:00
|
|
|
dp = Dispatcher(storage=storage)
|