diff --git a/hikka/modules/help.py b/hikka/modules/help.py
index 232ffab..1da3eea 100644
--- a/hikka/modules/help.py
+++ b/hikka/modules/help.py
@@ -4,6 +4,12 @@
# You can redistribute it and/or modify it under the terms of the GNU AGPLv3
# π https://www.gnu.org/licenses/agpl-3.0.html
+# Β©οΈ Codrago, 2024-2025
+# This file is a part of Heroku Userbot
+# π https://github.com/coddrago/Heroku
+# You can redistribute it and/or modify it under the terms of the GNU AGPLv3
+# π https://www.gnu.org/licenses/agpl-3.0.html
+
import re
import difflib
import inspect
@@ -159,34 +165,21 @@ class Help(loader.Module):
if await self.allmodules.check_security(message, func)
}
- # ΠΡΠΏΡΠ°Π²Π»Π΅Π½ΠΈΠ΅: Π£Π½ΠΈΠΊΠ°Π»ΡΠ½ΡΠ΅ ΠΈΠ½Π»Π°ΠΉΠ½-Ρ
Π΅Π½Π΄Π»Π΅ΡΡ
if hasattr(module, "inline_handlers"):
- seen_inline = set()
for name, fun in module.inline_handlers.items():
- if name not in seen_inline:
- reply += (
- "\nπ€"
- " {}
{}".format(
- f"@{self.inline.bot_username} {name}",
- (
- utils.escape_html(inspect.getdoc(fun))
- if fun.__doc__
- else self.strings("undoc")
- ),
- )
+ reply += (
+ "\nπ€"
+ " {}
{}".format(
+ f"@{self.inline.bot_username} {name}",
+ (
+ utils.escape_html(inspect.getdoc(fun))
+ if fun.__doc__
+ else self.strings("undoc")
+ ),
)
- seen_inline.add(name)
+ )
- # ΠΡΠΏΡΠ°Π²Π»Π΅Π½ΠΈΠ΅: Π£Π½ΠΈΠΊΠ°Π»ΡΠ½ΡΠ΅ ΠΊΠΎΠΌΠ°Π½Π΄Ρ Ρ Π°Π»ΠΈΠ°ΡΠ°ΠΌΠΈ
- seen_commands = set()
for name, fun in commands.items():
- if name in seen_commands:
- continue
-
- seen_commands.add(name)
- aliases = self.find_aliases(name)
- seen_commands.update(aliases)
-
reply += (
f'\n{self.config["command_emoji"]}'
" {}{}
{} {}".format(
@@ -199,10 +192,10 @@ class Help(loader.Module):
utils.escape_html(self.get_prefix()),
alias,
)
- for alias in aliases
+ for alias in self.find_aliases(name)
)
)
- if aliases
+ if self.find_aliases(name)
else ""
),
(
@@ -256,13 +249,7 @@ class Help(loader.Module):
core_ = []
no_commands_ = []
- # ΠΡΠΏΡΠ°Π²Π»Π΅Π½ΠΈΠ΅: Π£Π½ΠΈΠΊΠ°Π»ΡΠ½ΡΠ΅ ΠΌΠΎΠ΄ΡΠ»ΠΈ
- processed_modules = set()
for mod in self.allmodules.modules:
- if mod.__class__.__name__ in processed_modules:
- continue
- processed_modules.add(mod.__class__.__name__)
-
if not hasattr(mod, "commands"):
logger.debug("Module %s is not inited yet", mod.__class__.__name__)
continue
@@ -293,15 +280,20 @@ class Help(loader.Module):
)
first = True
- # ΠΡΠΏΡΠ°Π²Π»Π΅Π½ΠΈΠ΅: Π£Π½ΠΈΠΊΠ°Π»ΡΠ½ΡΠ΅ ΠΊΠΎΠΌΠ°Π½Π΄Ρ
- commands = list({
+ commands = [
name
for name, func in mod.commands.items()
if await self.allmodules.check_security(message, func) or force
- })
+ ]
- # ΠΡΠΏΡΠ°Π²Π»Π΅Π½ΠΈΠ΅: Π£Π½ΠΈΠΊΠ°Π»ΡΠ½ΡΠ΅ ΠΈΠ½Π»Π°ΠΉΠ½ ΠΊΠΎΠΌΠ°Π½Π΄Ρ
- icommands = list({
+ for cmd in commands:
+ if first:
+ tmp += f": ( {cmd}"
+ first = False
+ else:
+ tmp += f" | {cmd}"
+
+ icommands = [
name
for name, func in mod.inline_handlers.items()
if await self.inline.check_inline_security(
@@ -309,16 +301,14 @@ class Help(loader.Module):
user=message.sender_id,
)
or force
- })
+ ]
- for cmd in commands + icommands:
+ for cmd in icommands:
if first:
- prefix = "π€ " if cmd in icommands else ""
- tmp += f": ( {prefix}{cmd}"
+ tmp += f": ( π€ {cmd}"
first = False
else:
- prefix = "π€ " if cmd in icommands else ""
- tmp += f" | {prefix}{cmd}"
+ tmp += f" | π€ {cmd}"
if commands or icommands:
tmp += " )"
@@ -367,4 +357,4 @@ class Help(loader.Module):
else "πͺ"
)
),
- )
\ No newline at end of file
+ )