From c16530330609912cb7eafd09259657efa181d416 Mon Sep 17 00:00:00 2001 From: yasir Date: Thu, 2 Mar 2023 09:46:46 +0700 Subject: [PATCH] FIx --- misskaty/plugins/filter_request.py | 5 +++++ update.py | 18 +++++++++--------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/misskaty/plugins/filter_request.py b/misskaty/plugins/filter_request.py index aca36014..54bccd76 100644 --- a/misskaty/plugins/filter_request.py +++ b/misskaty/plugins/filter_request.py @@ -1,5 +1,6 @@ import random import re +import os from apscheduler.schedulers.asyncio import AsyncIOScheduler from pyrogram import enums, filters @@ -113,6 +114,10 @@ async def clear_reqdict(): data_kuso.clear() REQUEST_DB.clear() PYPI_DICT.clear() + try: + os.rmdir("downloads") + except: + pass # @app.on_message(filters.regex(r"makasi|thank|terimakasih|terima kasih|mksh", re.I) & filters.chat(chat)) diff --git a/update.py b/update.py index d43e81df..bf2b6d35 100644 --- a/update.py +++ b/update.py @@ -3,15 +3,15 @@ import logging, os LOGGER = logging.getLogger(__name__) -UPSTREAM_REPO = os.environ.get("UPSTREAM_REPO", "") -if len(UPSTREAM_REPO) == 0: - UPSTREAM_REPO = None +UPSTREAM_REPO_URL = os.environ.get("UPSTREAM_REPO_URL", "") +if len(UPSTREAM_REPO_URL) == 0: + UPSTREAM_REPO_URL = None -UPSTREAM_BRANCH = os.environ.get("UPSTREAM_BRANCH", "") -if len(UPSTREAM_BRANCH) == 0: - UPSTREAM_BRANCH = "master" +UPSTREAM_REPO_BRANCH = os.environ.get("UPSTREAM_REPO_BRANCH", "") +if len(UPSTREAM_REPO_BRANCH) == 0: + UPSTREAM_REPO_BRANCH = "master" -if UPSTREAM_REPO is not None: +if UPSTREAM_REPO_URL is not None: if os.path.exists('.git'): srun(["rm", "-rf", ".git"]) @@ -20,9 +20,9 @@ if UPSTREAM_REPO is not None: && git config --global user.name yasirarism \ && git add . \ && git commit -sm update -q \ - && git remote add origin {UPSTREAM_REPO} \ + && git remote add origin {UPSTREAM_REPO_URL} \ && git fetch origin -q \ - && git reset --hard origin/{UPSTREAM_BRANCH} -q"], shell=True) + && git reset --hard origin/{UPSTREAM_REPO_BRANCH} -q"], shell=True) if update.returncode == 0: LOGGER.error('Successfully updated with latest commit from UPSTREAM_REPO')