Merge branch 'dev' into renovate/libbot-1.x

This commit is contained in:
Profitroll 2023-06-30 12:35:21 +03:00
commit a130504824
3 changed files with 6 additions and 15 deletions

View File

@ -11,9 +11,11 @@ from typing import Dict, List, Tuple, Union
import aiofiles import aiofiles
from aiohttp import ClientSession from aiohttp import ClientSession
from apscheduler.schedulers.asyncio import AsyncIOScheduler
from bson import ObjectId from bson import ObjectId
from libbot import json_write from libbot import json_write
from libbot.i18n.sync import _ from libbot.i18n.sync import _
from libbot.pyrogram.classes import PyroClient
from photosapi_client.errors import UnexpectedStatus from photosapi_client.errors import UnexpectedStatus
from pyrogram.errors import bad_request_400 from pyrogram.errors import bad_request_400
from pyrogram.types import Message, User from pyrogram.types import Message, User
@ -44,16 +46,9 @@ from modules.sender import send_content
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
from datetime import datetime
from typing import List, Union
from apscheduler.schedulers.asyncio import AsyncIOScheduler
from libbot.pyrogram.classes import PyroClient
class PyroClient(PyroClient): class PyroClient(PyroClient):
def __init__(self, scheduler: AsyncIOScheduler): def __init__(self, scheduler: AsyncIOScheduler):
super().__init__(scheduler=scheduler) super().__init__(locales_root=Path("locale"), scheduler=scheduler)
self.version: float = 0.2 self.version: float = 0.2

View File

@ -1,7 +1,6 @@
{ {
"locale": "en", "locale": "en",
"locale_log": "en", "locale_log": "en",
"locale_fallback": "en",
"bot": { "bot": {
"owner": 0, "owner": 0,
"admins": [], "admins": [],
@ -37,11 +36,7 @@
"locations": { "locations": {
"tmp": "tmp", "tmp": "tmp",
"data": "data", "data": "data",
"cache": "cache", "cache": "cache"
"sent": "data/sent",
"queue": "data/queue",
"index": "data/index.json",
"locale": "locale"
}, },
"disabled_plugins": [], "disabled_plugins": [],
"posting": { "posting": {

View File

@ -1,3 +1,4 @@
import asyncio
from os import makedirs from os import makedirs
from pathlib import Path from pathlib import Path
from time import time from time import time
@ -44,4 +45,4 @@ async def cmd_kill(app: PyroClient, msg: Message):
Path(f"{app.config['locations']['cache']}/shutdown_time"), Path(f"{app.config['locations']['cache']}/shutdown_time"),
) )
exit() asyncio.get_event_loop().create_task(app.stop())