diff --git a/addons/snips.py b/addons/snips.py index 36b40df..ce0ea5d 100644 --- a/addons/snips.py +++ b/addons/snips.py @@ -21,14 +21,14 @@ """ import os -from . import upload_file as uf +from telethon import events from telethon.utils import pack_bot_file_id +from pyUltroid import get_string, udB, ultroid_bot from pyUltroid._misc import sudoers -from pyUltroid.fns.tools import create_tl_btn, format_btn, get_msg_button - -from . import events, get_string, mediainfo, udB, ultroid_bot, ultroid_cmd -from ._inline import something +from pyUltroid.fns.decorators import ultroid_cmd +from pyUltroid.fns.helper import mediainfo +from pyUltroid.fns.tools import create_tl_btn, format_btn, get_msg_button, upload_file # Functions moved from snips_db.py def get_all_snips(): @@ -69,19 +69,19 @@ async def an(e): wrd = wrd.replace("$", "") btn = format_btn(wt.buttons) if wt.buttons else None if wt and wt.media: - wut = mediainfo(wt.media) - if wut.startswith(("pic", "gif")): - dl = await wt.download_media() - m = uf(dl) - os.remove(dl) - elif wut == "video": - if wt.media.document.size > 8 * 1000 * 1000: - return await e.eor(get_string("com_4"), time=5) - dl = await wt.download_media() - m = uf(dl) - os.remove(dl) - else: - m = pack_bot_file_id(wt.media) + wut = mediainfo(wt.media) + if wut.startswith(("pic", "gif")): + dl = await wt.download_media() + m = upload_file(dl) + os.remove(dl) + elif wut == "video": + if wt.media.document.size > 8 * 1000 * 1000: + return await e.eor(get_string("com_4"), time=5) + dl = await wt.download_media() + m = upload_file(dl) + os.remove(dl) + else: + m = pack_bot_file_id(wt.media) if wt.text: txt = wt.text if not btn: diff --git a/plugins/bot.py b/plugins/bot.py index 85fd9ca..ea846b9 100644 --- a/plugins/bot.py +++ b/plugins/bot.py @@ -429,10 +429,10 @@ Note: Use `{tr}setrepo ` to update from your own fork.""" is_original = "original" in args repo_url = ( - "https://github.com/ThePrateekBhatia/Ultroid" + "https://github.com/ThePrateekBhatia/Ultroid.git" if is_original else udB.get_key("UPSTREAM_REPO") - or "https://github.com/ThePrateekBhatia/Ultroid" + or "https://github.com/overspend1/Ultroid-fork.git" ) if is_now: diff --git a/update_script.py b/update_script.py index 5d50fce..83577ad 100644 --- a/update_script.py +++ b/update_script.py @@ -36,10 +36,9 @@ def main(): # Check if we're in a git repository if not (script_dir / ".git").exists(): print("❌ Not a git repository. Cannot update.") - return False - - # Get the repository URL from command line args or database - repo_url = sys.argv[1] if len(sys.argv) > 1 else None + return False + # Get the repository URL from command line args or default to user's fork + repo_url = sys.argv[1] if len(sys.argv) > 1 else "https://github.com/overspend1/Ultroid-fork.git" # Fetch and pull updates print("📥 Fetching updates from repository...")