mirror of https://github.com/coddrago/Heroku
parent
08443aa775
commit
1f6c44e903
|
@ -22,6 +22,8 @@
|
|||
- Fix back button in `.config <lib>`
|
||||
- New `.e` error format
|
||||
- Ignore folder creation error
|
||||
- Fix unload error in module without commands
|
||||
- Rework aiogram media processing on edit
|
||||
|
||||
## 🌑 Hikka 1.2.10
|
||||
|
||||
|
|
|
@ -910,11 +910,7 @@ class Modules:
|
|||
for mod in self.modules:
|
||||
self.send_config_one(mod, skip_hook)
|
||||
|
||||
def send_config_one(
|
||||
self,
|
||||
mod: "Module",
|
||||
skip_hook: bool = False
|
||||
):
|
||||
def send_config_one(self, mod: "Module", skip_hook: bool = False):
|
||||
"""Send config to single instance"""
|
||||
with contextlib.suppress(AttributeError):
|
||||
_hikka_client_id_logging_tag = copy.copy(self.client.tg_id)
|
||||
|
@ -974,12 +970,7 @@ class Modules:
|
|||
self.inline = inline_manager
|
||||
|
||||
try:
|
||||
await asyncio.gather(
|
||||
*[
|
||||
self.send_ready_one(mod)
|
||||
for mod in self.modules
|
||||
]
|
||||
)
|
||||
await asyncio.gather(*[self.send_ready_one(mod) for mod in self.modules])
|
||||
except Exception as e:
|
||||
logger.exception(f"Failed to send mod init complete signal due to {e}")
|
||||
|
||||
|
@ -1139,7 +1130,11 @@ class Modules:
|
|||
getattr(module, method).stop()
|
||||
logger.debug(f"Stopped loop in {module=}, {method=}")
|
||||
|
||||
to_remove += module.commands.values()
|
||||
to_remove += (
|
||||
module.commands
|
||||
if isinstance(getattr(module, "commands", None), dict)
|
||||
else {}
|
||||
).values()
|
||||
if hasattr(module, "watcher"):
|
||||
to_remove += [module.watcher]
|
||||
|
||||
|
|
14
hikka/log.py
14
hikka/log.py
|
@ -55,6 +55,7 @@ class HikkaException:
|
|||
tb: traceback.TracebackException,
|
||||
) -> "HikkaException":
|
||||
def to_hashable(dictionary: dict) -> dict:
|
||||
dictionary = dictionary.copy()
|
||||
for key, value in dictionary.items():
|
||||
if isinstance(value, dict):
|
||||
if (
|
||||
|
@ -92,11 +93,16 @@ class HikkaException:
|
|||
)
|
||||
|
||||
filename, lineno, name = next(
|
||||
re.search(line_regex, line).groups()
|
||||
for line in full_stack.splitlines()
|
||||
if re.search(line_regex, line)
|
||||
(
|
||||
re.search(line_regex, line).groups()
|
||||
for line in full_stack.splitlines()
|
||||
if re.search(line_regex, line)
|
||||
),
|
||||
(None, None, None),
|
||||
)
|
||||
line = next(
|
||||
(line for line in full_stack.splitlines() if line.startswith(" ")), ""
|
||||
)
|
||||
line = next(line for line in full_stack.splitlines() if line.startswith(" "))
|
||||
|
||||
full_stack = "\n".join(
|
||||
[
|
||||
|
|
|
@ -114,7 +114,7 @@ class HikkaBackupMod(loader.Module):
|
|||
await call.delete()
|
||||
return
|
||||
|
||||
self.set("period", value)
|
||||
self.set("period", value * 60 * 60)
|
||||
self.set("last_backup", round(time.time()))
|
||||
|
||||
await call.answer(self.strings("saved"), show_alert=True)
|
||||
|
|
Loading…
Reference in New Issue