- Add full trace locals length limit
- Rework full trace locals to hashable converter
pull/1/head
hikariatama 2022-09-22 11:04:10 +00:00
parent e6d7e203e7
commit 3f2cff2a0f
4 changed files with 17 additions and 23 deletions

View File

@ -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

View File

@ -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] = "<Database>"
if isinstance(
elif isinstance(
value,
(telethon.TelegramClient, CustomTelegramClient),
):
dictionary[key] = f"<{value.__class__.__name__}>"
dictionary[key] = to_hashable(value)
elif len(str(value)) > 512:
dictionary[key] = f"{str(value)[:512]}..."
else:
try:
json.dumps([value])
except Exception:
dictionary[key] = str(value)
return dictionary

View File

@ -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://**************************")

View File

@ -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 <span style='color: #dc137b;'>Enter</span>");
@ -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);
})
});