mirror of
https://github.com/yasirarism/MissKatyPyro.git
synced 2025-12-29 17:44:50 +00:00
update
This commit is contained in:
parent
204527e5f1
commit
6fba574298
2 changed files with 9 additions and 8 deletions
|
|
@ -5,7 +5,6 @@ from logging import ERROR, INFO, FileHandler, StreamHandler, basicConfig, getLog
|
|||
|
||||
import pyromod.listen
|
||||
from apscheduler.jobstores.mongodb import MongoDBJobStore
|
||||
from apscheduler.schedulers.asyncio import AsyncIOScheduler
|
||||
from pymongo import MongoClient
|
||||
from pyrogram import Client
|
||||
|
||||
|
|
@ -47,13 +46,6 @@ jobstores = {
|
|||
database="MissKatyDB",
|
||||
collection='nightmode')}
|
||||
|
||||
scheduler = AsyncIOScheduler(
|
||||
jobstores=jobstores,
|
||||
timezone=TZ)
|
||||
|
||||
logging.info(scheduler.get_jobs())
|
||||
if bool(scheduler.get_jobs()):
|
||||
scheduler.start()
|
||||
app.start()
|
||||
user.start()
|
||||
bot = app.get_me()
|
||||
|
|
|
|||
|
|
@ -18,12 +18,15 @@ from pyrogram.raw.all import layer
|
|||
from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup
|
||||
|
||||
from database.users_chats_db import db
|
||||
from apscheduler.schedulers.asyncio import AsyncIOScheduler
|
||||
from misskaty import (
|
||||
BOT_NAME,
|
||||
BOT_USERNAME,
|
||||
HELPABLE,
|
||||
UBOT_NAME,
|
||||
TZ,
|
||||
app,
|
||||
jobstores
|
||||
)
|
||||
from misskaty.core.message_utils import *
|
||||
from misskaty.core.decorator.ratelimiter import ratelimiter
|
||||
|
|
@ -70,6 +73,12 @@ async def start_bot():
|
|||
)
|
||||
except Exception as e:
|
||||
LOGGER.error(str(e))
|
||||
scheduler = AsyncIOScheduler(
|
||||
jobstores=jobstores,
|
||||
timezone=TZ)
|
||||
LOGGER.info(scheduler.get_jobs())
|
||||
if bool(scheduler.get_jobs()):
|
||||
scheduler.start()
|
||||
if os.path.exists("restart.pickle"):
|
||||
with open('restart.pickle', 'rb') as status:
|
||||
chat_id, message_id = pickle.load(status)
|
||||
|
|
|
|||
Loading…
Reference in a new issue