diff --git a/CHANGELOG.md b/CHANGELOG.md index 9fef36d..8ff33fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,8 @@ - Add new code input design - Add new 2fa password input design - Add ability to set custom emojis in `.info` using command `.setinfo`. In order to use it, remove buttons using config +- Add full trace locals length limit +- Rework full trace locals to hashable converter - Patch internal help module with bugfixes - Clean type-hint mess, document utils and other methods, which were undocumented - Remove redundant non-working code from configurator diff --git a/hikka/log.py b/hikka/log.py index 7aa4a53..33528bf 100755 --- a/hikka/log.py +++ b/hikka/log.py @@ -60,23 +60,21 @@ class HikkaException: dictionary = dictionary.copy() for key, value in dictionary.items(): if isinstance(value, dict): + dictionary[key] = to_hashable(value) + else: if ( getattr(getattr(value, "__class__", None), "__name__", None) == "Database" ): dictionary[key] = "" - - if isinstance( + elif isinstance( value, (telethon.TelegramClient, CustomTelegramClient), ): dictionary[key] = f"<{value.__class__.__name__}>" - - dictionary[key] = to_hashable(value) - else: - try: - json.dumps([value]) - except Exception: + elif len(str(value)) > 512: + dictionary[key] = f"{str(value)[:512]}..." + else: dictionary[key] = str(value) return dictionary diff --git a/hikka/modules/python.py b/hikka/modules/python.py index bb348bd..b25461b 100755 --- a/hikka/modules/python.py +++ b/hikka/modules/python.py @@ -84,12 +84,6 @@ class PythonMod(loader.Module): ) exc = exc.replace(str(self._client.hikka_me.phone), "📵") - if os.environ.get("DATABASE_URL"): - exc = exc.replace( - os.environ.get("DATABASE_URL"), - "postgre://**************************", - ) - if os.environ.get("hikka_session"): exc = exc.replace( os.environ.get("hikka_session"), @@ -119,11 +113,6 @@ class PythonMod(loader.Module): ret = ret.replace(str(self._client.hikka_me.phone), "📵") - if postgre := os.environ.get("DATABASE_URL") or main.get_config_key( - "postgre_uri" - ): - ret = ret.replace(postgre, "postgre://**************************") - if redis := os.environ.get("REDIS_URL") or main.get_config_key("redis_uri"): ret = ret.replace(redis, "redis://**************************") diff --git a/web-resources/static/root.js b/web-resources/static/root.js index 499f99a..0e897cc 100644 --- a/web-resources/static/root.js +++ b/web-resources/static/root.js @@ -117,7 +117,7 @@ function tg_code() { if (response.status == 401) { $(".auth-code-form").hide().fadeIn(300, () => { $("#monkey-close").html(); - bodymovin.loadAnimation({ + anim = bodymovin.loadAnimation({ container: document.getElementById("monkey-close"), renderer: "canvas", loop: false, @@ -127,6 +127,11 @@ function tg_code() { clearCanvas: true, } }); + anim.addEventListener("complete", function () { + setTimeout(function () { + anim.goToAndPlay(0); + }, 2000); + }) }); $(".code-input").removeAttr("disabled"); $(".code-caption").html("Enter your Telegram 2FA password, then press Enter"); @@ -267,7 +272,7 @@ function process_next() { } else { $(".auth-code-form").hide().fadeIn(300, () => { $("#monkey").html(); - anim = bodymovin.loadAnimation({ + anim2 = bodymovin.loadAnimation({ container: document.getElementById("monkey"), renderer: "canvas", loop: false, @@ -277,9 +282,9 @@ function process_next() { clearCanvas: true, } }); - anim.addEventListener("complete", function () { + anim2.addEventListener("complete", function () { setTimeout(function () { - anim.goToAndPlay(0); + anim2.goToAndPlay(0); }, 2000); }) });