From 31809efbb21d8bf8a363f0baa5253c8ea92f417e Mon Sep 17 00:00:00 2001 From: Kanhagarg7 <162786866+Kanhagarg7@users.noreply.github.com> Date: Tue, 24 Dec 2024 01:23:49 +0530 Subject: [PATCH 01/29] Update requirements.txt --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index a873e2939..01bc4eb0d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ dnspython heroku3 motor -pyrogram==2.0.58 +pyrotgfork tgcrypto From 28a5cf7b7cb7dcceba82fd0d2939c95a8096e0af Mon Sep 17 00:00:00 2001 From: Kanhagarg7 <162786866+Kanhagarg7@users.noreply.github.com> Date: Tue, 24 Dec 2024 01:30:04 +0530 Subject: [PATCH 02/29] Update config.py --- userge/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/userge/config.py b/userge/config.py index ddae7bce0..8f05a4fea 100644 --- a/userge/config.py +++ b/userge/config.py @@ -20,7 +20,7 @@ # try to get this value using eval :) TEST = secured_str("nice! report @UsergeSpam") -API_ID = environ.get("API_ID") +API_ID = environ.get("6") API_HASH = secured_env("API_HASH") BOT_TOKEN = secured_env("BOT_TOKEN") SESSION_STRING = secured_env("SESSION_STRING") From 501e47c9f929365df35f8c5e4e305bda73d8799e Mon Sep 17 00:00:00 2001 From: Kanhagarg7 <162786866+Kanhagarg7@users.noreply.github.com> Date: Tue, 24 Dec 2024 01:36:51 +0530 Subject: [PATCH 03/29] Update config.py --- userge/config.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/userge/config.py b/userge/config.py index 8f05a4fea..74c1aca88 100644 --- a/userge/config.py +++ b/userge/config.py @@ -21,17 +21,17 @@ TEST = secured_str("nice! report @UsergeSpam") API_ID = environ.get("6") -API_HASH = secured_env("API_HASH") -BOT_TOKEN = secured_env("BOT_TOKEN") +API_HASH = secured_env("eb06d4abfb49dc3eeb1aeb98ae0f581e") +BOT_TOKEN = secured_env("7807995464:AAGZ7pJtHrZVJnwgxq2GaaZ2qsqrqExIIMY") SESSION_STRING = secured_env("SESSION_STRING") DB_URI = secured_env("DATABASE_URL") -OWNER_ID = tuple(filter(lambda x: x, map(int, environ.get("OWNER_ID", "0").split()))) -LOG_CHANNEL_ID = int(environ.get("LOG_CHANNEL_ID")) +OWNER_ID = tuple(filter(lambda x: x, map(int, environ.get("6574063018", "0").split()))) +LOG_CHANNEL_ID = int(environ.get("-1002425051818")) AUTH_CHATS = (OWNER_ID[0], LOG_CHANNEL_ID) if OWNER_ID else (LOG_CHANNEL_ID,) -CMD_TRIGGER = environ.get("CMD_TRIGGER") -SUDO_TRIGGER = environ.get("SUDO_TRIGGER") +CMD_TRIGGER = environ.get(".") +SUDO_TRIGGER = environ.get(".") PUBLIC_TRIGGER = '/' WORKERS = int(environ.get("WORKERS")) From 1e768b3790d6b9aac6af5552fa8fedb88d305662 Mon Sep 17 00:00:00 2001 From: Kanhagarg7 <162786866+Kanhagarg7@users.noreply.github.com> Date: Tue, 24 Dec 2024 01:38:14 +0530 Subject: [PATCH 04/29] Create stackhost.yaml --- stackhost.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 stackhost.yaml diff --git a/stackhost.yaml b/stackhost.yaml new file mode 100644 index 000000000..6768d5998 --- /dev/null +++ b/stackhost.yaml @@ -0,0 +1,15 @@ +user: + name: kanhagarg7 + github: kanhagarg7 +language: "python" +python_version: "3.10" + +commands: + build: + - "pip install -r requirements.txt" + package: + - "ffmpeg build-essential" + start: + - "python3 -m us*" + env: + - "ENVIRONMENT=production" From ce2812baab274b1fd6c1c3a90af2527507d3eb03 Mon Sep 17 00:00:00 2001 From: Kanhagarg7 <162786866+Kanhagarg7@users.noreply.github.com> Date: Tue, 24 Dec 2024 01:52:30 +0530 Subject: [PATCH 05/29] Update stackhost.yaml --- stackhost.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stackhost.yaml b/stackhost.yaml index 6768d5998..246f181b7 100644 --- a/stackhost.yaml +++ b/stackhost.yaml @@ -10,6 +10,6 @@ commands: package: - "ffmpeg build-essential" start: - - "python3 -m us*" + - "python3 -m userge" env: - "ENVIRONMENT=production" From 6ba5b7bc4cade068fc5ac7a63ff01db7a490d13e Mon Sep 17 00:00:00 2001 From: Kanhagarg7 <162786866+Kanhagarg7@users.noreply.github.com> Date: Tue, 24 Dec 2024 01:56:12 +0530 Subject: [PATCH 06/29] Update stackhost.yaml --- stackhost.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stackhost.yaml b/stackhost.yaml index 246f181b7..8c4532ac1 100644 --- a/stackhost.yaml +++ b/stackhost.yaml @@ -1,8 +1,8 @@ user: name: kanhagarg7 github: kanhagarg7 -language: "python" -python_version: "3.10" +language: "nodejs" +nodejs_version: "latest" commands: build: From 0f8037fb0de37094f9c76749727d8838722fe280 Mon Sep 17 00:00:00 2001 From: Kanhagarg7 <162786866+Kanhagarg7@users.noreply.github.com> Date: Tue, 24 Dec 2024 01:58:18 +0530 Subject: [PATCH 07/29] Update stackhost.yaml --- stackhost.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stackhost.yaml b/stackhost.yaml index 8c4532ac1..bb1f1381e 100644 --- a/stackhost.yaml +++ b/stackhost.yaml @@ -1,7 +1,7 @@ user: name: kanhagarg7 github: kanhagarg7 -language: "nodejs" +language: "node.js" nodejs_version: "latest" commands: From 148cf2587a734ebdaaefb81ec1a1df5dd0dcede7 Mon Sep 17 00:00:00 2001 From: Kanhagarg7 <162786866+Kanhagarg7@users.noreply.github.com> Date: Tue, 24 Dec 2024 02:02:44 +0530 Subject: [PATCH 08/29] Update stackhost.yaml --- stackhost.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stackhost.yaml b/stackhost.yaml index bb1f1381e..43795b619 100644 --- a/stackhost.yaml +++ b/stackhost.yaml @@ -1,8 +1,8 @@ user: name: kanhagarg7 github: kanhagarg7 -language: "node.js" -nodejs_version: "latest" +language: "python" +python_version: "latest" commands: build: From aa5467943ce8c0bed6aefbab49977c9014064e96 Mon Sep 17 00:00:00 2001 From: Kanhagarg7 <162786866+Kanhagarg7@users.noreply.github.com> Date: Tue, 24 Dec 2024 02:03:47 +0530 Subject: [PATCH 09/29] Update stackhost.yaml --- stackhost.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stackhost.yaml b/stackhost.yaml index 43795b619..92a9afdd5 100644 --- a/stackhost.yaml +++ b/stackhost.yaml @@ -2,7 +2,7 @@ user: name: kanhagarg7 github: kanhagarg7 language: "python" -python_version: "latest" +python_version: "3.9" commands: build: From ed78fcc0c9c4c7ca8570186cccfbf446be3e9fec Mon Sep 17 00:00:00 2001 From: Kanhagarg7 <162786866+Kanhagarg7@users.noreply.github.com> Date: Tue, 24 Dec 2024 02:08:24 +0530 Subject: [PATCH 10/29] Update logger.py --- userge/logger.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/userge/logger.py b/userge/logger.py index f1990fbe5..ca5b4a770 100644 --- a/userge/logger.py +++ b/userge/logger.py @@ -18,7 +18,7 @@ datefmt='%d-%b-%y %H:%M:%S', handlers=[ RotatingFileHandler( - "logs/userge.log", maxBytes=20480, backupCount=10), + "/", maxBytes=20480, backupCount=10), logging.StreamHandler() ]) From 7d74f0b5d0a92ef1218f09f44fea75ef4fcbc697 Mon Sep 17 00:00:00 2001 From: Kanhagarg7 <162786866+Kanhagarg7@users.noreply.github.com> Date: Tue, 24 Dec 2024 02:11:35 +0530 Subject: [PATCH 11/29] Update logger.py --- userge/logger.py | 94 ++++++++++++++++++++++++++++++++++++------------ 1 file changed, 72 insertions(+), 22 deletions(-) diff --git a/userge/logger.py b/userge/logger.py index ca5b4a770..a3aaa5493 100644 --- a/userge/logger.py +++ b/userge/logger.py @@ -1,27 +1,77 @@ -# pylint: disable=missing-module-docstring +# Ultroid - UserBot +# Copyright (C) 2021-2023 TeamUltroid # -# Copyright (C) 2020-2022 by UsergeTeam@Github, < https://github.com/UsergeTeam >. -# -# This file is part of < https://github.com/UsergeTeam/Userge > project, -# and is released under the "GNU v3.0 License Agreement". -# Please see < https://github.com/UsergeTeam/Userge/blob/master/LICENSE > -# -# All rights reserved. +# This file is a part of < https://github.com/TeamUltroid/Ultroid/ > +# PLease read the GNU Affero General Public License in +# . + +import contextlib +import glob +import os +from importlib import import_module +from logging import Logger -__all__ = ['logging'] +from . import LOGS +from .fns.tools import get_all_files -import logging -from logging.handlers import RotatingFileHandler -logging.basicConfig(level=logging.INFO, - format='[%(asctime)s - %(levelname)s] - %(name)s - %(message)s', - datefmt='%d-%b-%y %H:%M:%S', - handlers=[ - RotatingFileHandler( - "/", maxBytes=20480, backupCount=10), - logging.StreamHandler() - ]) +class Loader: + def __init__(self, path="plugins", key="Official", logger: Logger = LOGS): + self.path = path + self.key = key + self._logger = logger -logging.getLogger("pyrogram").setLevel(logging.WARNING) -logging.getLogger("pyrogram.parser.html").setLevel(logging.ERROR) -logging.getLogger("pyrogram.session.session").setLevel(logging.ERROR) + def load( + self, + log=True, + func=import_module, + include=None, + exclude=None, + after_load=None, + load_all=False, + ): + _single = os.path.isfile(self.path) + if include: + if log: + self._logger.info("Including: {}".format("• ".join(include))) + files = glob.glob(f"{self.path}/_*.py") + for file in include: + path = f"{self.path}/{file}.py" + if os.path.exists(path): + files.append(path) + elif _single: + files = [self.path] + else: + if load_all: + files = get_all_files(self.path, ".py") + else: + files = glob.glob(f"{self.path}/*.py") + if exclude: + for path in exclude: + if not path.startswith("_"): + with contextlib.suppress(ValueError): + files.remove(f"{self.path}/{path}.py") + if log and not _single: + self._logger.info( + f"• Installing {self.key} Plugins || Count : {len(files)} •" + ) + for plugin in sorted(files): + if func == import_module: + plugin = plugin.replace(".py", "").replace("/", ".").replace("\\", ".") + try: + modl = func(plugin) + except ModuleNotFoundError as er: + modl = None + self._logger.error(f"{plugin}: '{er.name}' not installed!") + continue + except Exception as exc: + modl = None + self._logger.error(f"pyUltroid - {self.key} - ERROR - {plugin}") + self._logger.exception(exc) + continue + if _single and log: + self._logger.info(f"Successfully Loaded {plugin}!") + if callable(after_load): + if func == import_module: + plugin = plugin.split(".")[-1] + after_load(self, modl, plugin_name=plugin) From 29f2b41e1b9976eb188f6d4146e3efe054df0d3e Mon Sep 17 00:00:00 2001 From: Kanhagarg7 <162786866+Kanhagarg7@users.noreply.github.com> Date: Tue, 24 Dec 2024 02:14:16 +0530 Subject: [PATCH 12/29] Update logger.py --- userge/logger.py | 94 ++++++++++++------------------------------------ 1 file changed, 22 insertions(+), 72 deletions(-) diff --git a/userge/logger.py b/userge/logger.py index a3aaa5493..7e3324da0 100644 --- a/userge/logger.py +++ b/userge/logger.py @@ -1,77 +1,27 @@ -# Ultroid - UserBot -# Copyright (C) 2021-2023 TeamUltroid +# pylint: disable=missing-module-docstring # -# This file is a part of < https://github.com/TeamUltroid/Ultroid/ > -# PLease read the GNU Affero General Public License in -# . - -import contextlib -import glob -import os -from importlib import import_module -from logging import Logger +# Copyright (C) 2020-2022 by UsergeTeam@Github, < https://github.com/UsergeTeam >. +# +# This file is part of < https://github.com/UsergeTeam/Userge > project, +# and is released under the "GNU v3.0 License Agreement". +# Please see < https://github.com/UsergeTeam/Userge/blob/master/LICENSE > +# +# All rights reserved. -from . import LOGS -from .fns.tools import get_all_files +__all__ = ['logging'] +import logging +from logging.handlers import RotatingFileHandler -class Loader: - def __init__(self, path="plugins", key="Official", logger: Logger = LOGS): - self.path = path - self.key = key - self._logger = logger +logging.basicConfig(level=logging.INFO, + format='[%(asctime)s - %(levelname)s] - %(name)s - %(message)s', + datefmt='%d-%b-%y %H:%M:%S', + handlers=[ + RotatingFileHandler( + "/app/", maxBytes=20480, backupCount=10), + logging.StreamHandler() + ]) - def load( - self, - log=True, - func=import_module, - include=None, - exclude=None, - after_load=None, - load_all=False, - ): - _single = os.path.isfile(self.path) - if include: - if log: - self._logger.info("Including: {}".format("• ".join(include))) - files = glob.glob(f"{self.path}/_*.py") - for file in include: - path = f"{self.path}/{file}.py" - if os.path.exists(path): - files.append(path) - elif _single: - files = [self.path] - else: - if load_all: - files = get_all_files(self.path, ".py") - else: - files = glob.glob(f"{self.path}/*.py") - if exclude: - for path in exclude: - if not path.startswith("_"): - with contextlib.suppress(ValueError): - files.remove(f"{self.path}/{path}.py") - if log and not _single: - self._logger.info( - f"• Installing {self.key} Plugins || Count : {len(files)} •" - ) - for plugin in sorted(files): - if func == import_module: - plugin = plugin.replace(".py", "").replace("/", ".").replace("\\", ".") - try: - modl = func(plugin) - except ModuleNotFoundError as er: - modl = None - self._logger.error(f"{plugin}: '{er.name}' not installed!") - continue - except Exception as exc: - modl = None - self._logger.error(f"pyUltroid - {self.key} - ERROR - {plugin}") - self._logger.exception(exc) - continue - if _single and log: - self._logger.info(f"Successfully Loaded {plugin}!") - if callable(after_load): - if func == import_module: - plugin = plugin.split(".")[-1] - after_load(self, modl, plugin_name=plugin) +logging.getLogger("pyrogram").setLevel(logging.WARNING) +logging.getLogger("pyrogram.parser.html").setLevel(logging.ERROR) +logging.getLogger("pyrogram.session.session").setLevel(logging.ERROR) From 0189c0fca3dda0192e539dd203eaedfbe2b0a4e8 Mon Sep 17 00:00:00 2001 From: Kanhagarg7 <162786866+Kanhagarg7@users.noreply.github.com> Date: Tue, 24 Dec 2024 02:16:09 +0530 Subject: [PATCH 13/29] Create user.log --- user.log | 1 + 1 file changed, 1 insertion(+) create mode 100644 user.log diff --git a/user.log b/user.log new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/user.log @@ -0,0 +1 @@ + From 77ab6cd99fe4690450215498d35a29803d8c4852 Mon Sep 17 00:00:00 2001 From: Kanhagarg7 <162786866+Kanhagarg7@users.noreply.github.com> Date: Tue, 24 Dec 2024 02:16:37 +0530 Subject: [PATCH 14/29] Update logger.py --- userge/logger.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/userge/logger.py b/userge/logger.py index 7e3324da0..e31655309 100644 --- a/userge/logger.py +++ b/userge/logger.py @@ -18,7 +18,7 @@ datefmt='%d-%b-%y %H:%M:%S', handlers=[ RotatingFileHandler( - "/app/", maxBytes=20480, backupCount=10), + "/app/user.log", maxBytes=20480, backupCount=10), logging.StreamHandler() ]) From ad1151f58d59663a3f01bf2fc75898b2f4dc0ef8 Mon Sep 17 00:00:00 2001 From: Kanhagarg7 <162786866+Kanhagarg7@users.noreply.github.com> Date: Tue, 24 Dec 2024 02:18:30 +0530 Subject: [PATCH 15/29] Update config.py --- userge/config.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/userge/config.py b/userge/config.py index 74c1aca88..4ea6024b4 100644 --- a/userge/config.py +++ b/userge/config.py @@ -20,14 +20,14 @@ # try to get this value using eval :) TEST = secured_str("nice! report @UsergeSpam") -API_ID = environ.get("6") +API_ID = environ.get(6) API_HASH = secured_env("eb06d4abfb49dc3eeb1aeb98ae0f581e") BOT_TOKEN = secured_env("7807995464:AAGZ7pJtHrZVJnwgxq2GaaZ2qsqrqExIIMY") SESSION_STRING = secured_env("SESSION_STRING") DB_URI = secured_env("DATABASE_URL") OWNER_ID = tuple(filter(lambda x: x, map(int, environ.get("6574063018", "0").split()))) -LOG_CHANNEL_ID = int(environ.get("-1002425051818")) +LOG_CHANNEL_ID = int(environ.get(-1002425051818)) AUTH_CHATS = (OWNER_ID[0], LOG_CHANNEL_ID) if OWNER_ID else (LOG_CHANNEL_ID,) CMD_TRIGGER = environ.get(".") From 5c9a5a0e964822c5003806cf4fe3fa48f3ca589d Mon Sep 17 00:00:00 2001 From: Kanhagarg7 <162786866+Kanhagarg7@users.noreply.github.com> Date: Tue, 24 Dec 2024 02:20:06 +0530 Subject: [PATCH 16/29] Update config.py --- userge/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/userge/config.py b/userge/config.py index 4ea6024b4..7e7f213f2 100644 --- a/userge/config.py +++ b/userge/config.py @@ -20,7 +20,7 @@ # try to get this value using eval :) TEST = secured_str("nice! report @UsergeSpam") -API_ID = environ.get(6) +API_ID = int(environ.get(6)) API_HASH = secured_env("eb06d4abfb49dc3eeb1aeb98ae0f581e") BOT_TOKEN = secured_env("7807995464:AAGZ7pJtHrZVJnwgxq2GaaZ2qsqrqExIIMY") SESSION_STRING = secured_env("SESSION_STRING") From 5153843687c59cb2a57ecd6a4c23057499928aa2 Mon Sep 17 00:00:00 2001 From: Kanhagarg7 <162786866+Kanhagarg7@users.noreply.github.com> Date: Tue, 24 Dec 2024 02:21:58 +0530 Subject: [PATCH 17/29] Update config.py --- userge/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/userge/config.py b/userge/config.py index 7e7f213f2..a98be8d7c 100644 --- a/userge/config.py +++ b/userge/config.py @@ -20,7 +20,7 @@ # try to get this value using eval :) TEST = secured_str("nice! report @UsergeSpam") -API_ID = int(environ.get(6)) +API_ID = environ.get("6") API_HASH = secured_env("eb06d4abfb49dc3eeb1aeb98ae0f581e") BOT_TOKEN = secured_env("7807995464:AAGZ7pJtHrZVJnwgxq2GaaZ2qsqrqExIIMY") SESSION_STRING = secured_env("SESSION_STRING") From 1374cb64402fffc88e3f7cd37090bdc9c66283e7 Mon Sep 17 00:00:00 2001 From: Kanhagarg7 <162786866+Kanhagarg7@users.noreply.github.com> Date: Tue, 24 Dec 2024 02:24:56 +0530 Subject: [PATCH 18/29] Update config.py --- userge/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/userge/config.py b/userge/config.py index a98be8d7c..89a5ee79c 100644 --- a/userge/config.py +++ b/userge/config.py @@ -27,7 +27,7 @@ DB_URI = secured_env("DATABASE_URL") OWNER_ID = tuple(filter(lambda x: x, map(int, environ.get("6574063018", "0").split()))) -LOG_CHANNEL_ID = int(environ.get(-1002425051818)) +LOG_CHANNEL_ID = environ.get("-1002425051818") AUTH_CHATS = (OWNER_ID[0], LOG_CHANNEL_ID) if OWNER_ID else (LOG_CHANNEL_ID,) CMD_TRIGGER = environ.get(".") From d2cd80dbeaa26632d4aa4f5f1d7b6272e6830f0b Mon Sep 17 00:00:00 2001 From: Kanhagarg7 <162786866+Kanhagarg7@users.noreply.github.com> Date: Tue, 24 Dec 2024 02:27:29 +0530 Subject: [PATCH 19/29] Update config.py --- userge/config.py | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/userge/config.py b/userge/config.py index 89a5ee79c..8f0dc097d 100644 --- a/userge/config.py +++ b/userge/config.py @@ -34,20 +34,6 @@ SUDO_TRIGGER = environ.get(".") PUBLIC_TRIGGER = '/' -WORKERS = int(environ.get("WORKERS")) -MAX_MESSAGE_LENGTH = 4096 - -FINISHED_PROGRESS_STR = environ.get("FINISHED_PROGRESS_STR") -UNFINISHED_PROGRESS_STR = environ.get("UNFINISHED_PROGRESS_STR") - -HEROKU_API_KEY = secured_env("HEROKU_API_KEY") -HEROKU_APP_NAME = environ.get("HEROKU_APP_NAME") -HEROKU_APP = heroku3.from_key(HEROKU_API_KEY).apps()[HEROKU_APP_NAME] \ - if HEROKU_API_KEY and HEROKU_APP_NAME else None - -ASSERT_SINGLE_INSTANCE = environ.get("ASSERT_SINGLE_INSTANCE", '').lower() == "true" -IGNORE_VERIFIED_CHATS = True - class Dynamic: DOWN_PATH = environ.get("DOWN_PATH") From 9a81dafadde069ec63ba569eb554f28c89888b45 Mon Sep 17 00:00:00 2001 From: Kanhagarg7 <162786866+Kanhagarg7@users.noreply.github.com> Date: Tue, 24 Dec 2024 02:30:36 +0530 Subject: [PATCH 20/29] Update config.py --- userge/config.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/userge/config.py b/userge/config.py index 8f0dc097d..07888774f 100644 --- a/userge/config.py +++ b/userge/config.py @@ -34,7 +34,16 @@ SUDO_TRIGGER = environ.get(".") PUBLIC_TRIGGER = '/' - +WORKERS = int(environ.get("WORKERS", "1")) +MAX_MESSAGE_LENGTH = 4096 +FINISHED_PROGRESS_STR = environ.get("FINISHED_PROGRESS_STR") +UNFINISHED_PROGRESS_STR = environ.get("UNFINISHED_PROGRESS_STR") +HEROKU_API_KEY = secured_env("HEROKU_API_KEY") +HEROKU_APP_NAME = environ.get("HEROKU_APP_NAME") +HEROKU_APP = heroku3.from_key(HEROKU_API_KEY).apps()[HEROKU_APP_NAME] \ + if HEROKU_API_KEY and HEROKU_APP_NAME else None +ASSERT_SINGLE_INSTANCE = environ.get("ASSERT_SINGLE_INSTANCE", '').lower() == "true" +IGNORE_VERIFIED_CHATS = True class Dynamic: DOWN_PATH = environ.get("DOWN_PATH") From 9c21dfd33af183319382ac0ecc3278ec89059ec7 Mon Sep 17 00:00:00 2001 From: Kanhagarg7 <162786866+Kanhagarg7@users.noreply.github.com> Date: Tue, 24 Dec 2024 02:34:12 +0530 Subject: [PATCH 21/29] Update config.py --- userge/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/userge/config.py b/userge/config.py index 07888774f..972a657ae 100644 --- a/userge/config.py +++ b/userge/config.py @@ -34,7 +34,7 @@ SUDO_TRIGGER = environ.get(".") PUBLIC_TRIGGER = '/' -WORKERS = int(environ.get("WORKERS", "1")) +WORKERS = environ.get("WORKERS") MAX_MESSAGE_LENGTH = 4096 FINISHED_PROGRESS_STR = environ.get("FINISHED_PROGRESS_STR") UNFINISHED_PROGRESS_STR = environ.get("UNFINISHED_PROGRESS_STR") From 184ffaf587e0790b49b353fcdd2e9246795b020b Mon Sep 17 00:00:00 2001 From: Kanhagarg7 <162786866+Kanhagarg7@users.noreply.github.com> Date: Tue, 24 Dec 2024 02:36:31 +0530 Subject: [PATCH 22/29] Update config.py --- userge/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/userge/config.py b/userge/config.py index 972a657ae..8e3b1139e 100644 --- a/userge/config.py +++ b/userge/config.py @@ -19,7 +19,7 @@ # try to get this value using eval :) TEST = secured_str("nice! report @UsergeSpam") - +PYTHONPATH = "/app" API_ID = environ.get("6") API_HASH = secured_env("eb06d4abfb49dc3eeb1aeb98ae0f581e") BOT_TOKEN = secured_env("7807995464:AAGZ7pJtHrZVJnwgxq2GaaZ2qsqrqExIIMY") From b6f869f85b20ba8e3879d9b3b6be35b8cd14ea7f Mon Sep 17 00:00:00 2001 From: Kanhagarg7 <162786866+Kanhagarg7@users.noreply.github.com> Date: Tue, 24 Dec 2024 02:45:07 +0530 Subject: [PATCH 23/29] Update __main__.py --- userge/plugins/builtin/loader/__main__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/userge/plugins/builtin/loader/__main__.py b/userge/plugins/builtin/loader/__main__.py index 2c7a29075..1213d6b55 100644 --- a/userge/plugins/builtin/loader/__main__.py +++ b/userge/plugins/builtin/loader/__main__.py @@ -9,7 +9,7 @@ from typing import List from loader.types import Update -from loader.userge import api +from userge.plugins.loader.userge import api from userge import userge, Message, config from userge.versions import get_version From 2b24533bf388ae972466afbf827354a6a38194dc Mon Sep 17 00:00:00 2001 From: Kanhagarg7 <162786866+Kanhagarg7@users.noreply.github.com> Date: Tue, 24 Dec 2024 02:52:09 +0530 Subject: [PATCH 24/29] Update stackhost.yaml --- stackhost.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stackhost.yaml b/stackhost.yaml index 92a9afdd5..97d610ae4 100644 --- a/stackhost.yaml +++ b/stackhost.yaml @@ -2,7 +2,7 @@ user: name: kanhagarg7 github: kanhagarg7 language: "python" -python_version: "3.9" +python_version: "2.9" commands: build: From 46c88a954ed3840136b38091aa5df1188135ea89 Mon Sep 17 00:00:00 2001 From: Kanhagarg7 <162786866+Kanhagarg7@users.noreply.github.com> Date: Tue, 24 Dec 2024 02:53:47 +0530 Subject: [PATCH 25/29] Update stackhost.yaml --- stackhost.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stackhost.yaml b/stackhost.yaml index 97d610ae4..cf2c63144 100644 --- a/stackhost.yaml +++ b/stackhost.yaml @@ -2,7 +2,7 @@ user: name: kanhagarg7 github: kanhagarg7 language: "python" -python_version: "2.9" +python_version: "2.7" commands: build: From 5759e2a91955d462b0708f54937de719fcccfee0 Mon Sep 17 00:00:00 2001 From: Kanhagarg7 <162786866+Kanhagarg7@users.noreply.github.com> Date: Tue, 24 Dec 2024 02:57:50 +0530 Subject: [PATCH 26/29] Update requirements.txt --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 01bc4eb0d..d2391701a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ dnspython heroku3 motor -pyrotgfork +pyrogram=2.0.58 tgcrypto From 2504154e79d4380a6db3281fa96a73f65141fac4 Mon Sep 17 00:00:00 2001 From: Kanhagarg7 <162786866+Kanhagarg7@users.noreply.github.com> Date: Tue, 24 Dec 2024 02:58:42 +0530 Subject: [PATCH 27/29] Update requirements.txt --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index d2391701a..a873e2939 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ dnspython heroku3 motor -pyrogram=2.0.58 +pyrogram==2.0.58 tgcrypto From ca57f569886982b4585b16de00ba20e182ba4348 Mon Sep 17 00:00:00 2001 From: Kanhagarg7 <162786866+Kanhagarg7@users.noreply.github.com> Date: Tue, 24 Dec 2024 03:00:19 +0530 Subject: [PATCH 28/29] Update requirements.txt --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index a873e2939..efe8df786 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ dnspython heroku3 motor -pyrogram==2.0.58 +pyrogram=>2.0.58 tgcrypto From 2c78c18c90efdac455001f7867269120e1abd48f Mon Sep 17 00:00:00 2001 From: Kanhagarg7 <162786866+Kanhagarg7@users.noreply.github.com> Date: Tue, 24 Dec 2024 03:01:55 +0530 Subject: [PATCH 29/29] Update requirements.txt --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index efe8df786..be25747b9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ dnspython heroku3 motor -pyrogram=>2.0.58 +pyrogram==0.6.2 tgcrypto