mirror of
https://github.com/yasirarism/MissKatyPyro.git
synced 2025-12-29 09:44:50 +00:00
I hope fixed
This commit is contained in:
parent
119321393e
commit
d5870ffd6e
4 changed files with 16 additions and 3 deletions
|
|
@ -34,6 +34,7 @@ basicConfig(
|
|||
getLogger("pyrogram").setLevel(ERROR)
|
||||
getLogger("openai").setLevel(ERROR)
|
||||
getLogger("httpx").setLevel(ERROR)
|
||||
getLogger("iytdl").setLevel(ERROR)
|
||||
|
||||
MOD_LOAD = []
|
||||
MOD_NOLOAD = ["subscene_dl"]
|
||||
|
|
@ -55,6 +56,7 @@ app = Client(
|
|||
user = Client(
|
||||
"YasirUBot",
|
||||
session_string=USER_SESSION,
|
||||
mongodb=dict(connection=AsyncClient(DATABASE_URI), remove_peers=False),
|
||||
)
|
||||
|
||||
jobstores = {
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ from PIL import Image, ImageDraw, ImageFont
|
|||
from psutil import Process, boot_time, cpu_count, cpu_percent
|
||||
from psutil import disk_usage as disk_usage_percent
|
||||
from psutil import net_io_counters, virtual_memory
|
||||
from apscheduler.schedulers.asyncio import AsyncIOScheduler
|
||||
from pyrogram import Client
|
||||
from pyrogram import __version__ as pyrover
|
||||
from pyrogram import enums, filters
|
||||
|
|
@ -41,7 +42,7 @@ from misskaty.helper.functions import extract_user, extract_user_and_reason
|
|||
from misskaty.helper.http import http
|
||||
from misskaty.helper.human_read import get_readable_file_size, get_readable_time
|
||||
from misskaty.helper.localization import use_chat_lang
|
||||
from misskaty.vars import COMMAND_HANDLER, LOG_CHANNEL, SUDO
|
||||
from misskaty.vars import COMMAND_HANDLER, LOG_CHANNEL, SUDO, AUTO_RESTART
|
||||
|
||||
__MODULE__ = "DevCommand"
|
||||
__HELP__ = """
|
||||
|
|
@ -541,3 +542,12 @@ async def shell_exec(code, treat=True):
|
|||
if treat:
|
||||
stdout = stdout.decode().strip()
|
||||
return stdout, process
|
||||
|
||||
async def auto_restart():
|
||||
await shell_exec("python3 update.py")
|
||||
os.execvp(sys.executable, [sys.executable, "-m", "misskaty"])
|
||||
|
||||
if AUTO_RESTART:
|
||||
scheduler = AsyncIOScheduler(timezone="Asia/Jakarta")
|
||||
scheduler.add_job(auto_restart, trigger="interval", days=3)
|
||||
scheduler.start()
|
||||
|
|
@ -254,7 +254,7 @@ def isArgInt(txt) -> list:
|
|||
@ratelimiter
|
||||
async def msg_quotly_cmd(self: Client, ctx: Message):
|
||||
is_reply = False
|
||||
if ctx.command[0][1] == "r":
|
||||
if ctx.command[0].endswith("r"):
|
||||
is_reply = True
|
||||
if len(ctx.text.split()) > 1:
|
||||
check_arg = isArgInt(ctx.command[1])
|
||||
|
|
@ -279,7 +279,7 @@ async def msg_quotly_cmd(self: Client, ctx: Message):
|
|||
try:
|
||||
make_quotly = await pyrogram_to_quotly(messages, is_reply=is_reply)
|
||||
bio_sticker = BytesIO(make_quotly)
|
||||
bio_sticker.name = "biosticker.webp"
|
||||
bio_sticker.name = "misskatyquote_sticker.webp"
|
||||
return await ctx.reply_sticker(bio_sticker)
|
||||
except Exception:
|
||||
return await ctx.reply_msg("🤷🏻♂️")
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ SUDO = list(
|
|||
}
|
||||
)
|
||||
SUPPORT_CHAT = environ.get("SUPPORT_CHAT", "YasirPediaChannel")
|
||||
AUTO_RESTART = environ.get("AUTO_RESTART", False)
|
||||
OPENAI_API = getConfig("OPENAI_API")
|
||||
|
||||
## Config For AUtoForwarder
|
||||
|
|
|
|||
Loading…
Reference in a new issue