diff --git a/hikka/modules/fheta.py b/hikka/modules/fheta.py index 9356014..1ba9a78 100644 --- a/hikka/modules/fheta.py +++ b/hikka/modules/fheta.py @@ -99,9 +99,9 @@ class FHeta(loader.Module): module_names = [module['name'] for module in all_modules if 'name' in module] closest_matches = difflib.get_close_matches(args, module_names, n=1, cutoff=0.5) - + if closest_matches: - closest_module = next((m for m in all_modules if m['name'] == closest_matches[0]), None) + closest_module = next((m for m in all_modules if isinstance(m, dict) and 'name' in m and m['name'] == closest_matches[0]), None) if closest_module: formatted_module = await self.format_module(closest_module, args) banner_url = closest_module.get("banner", None) @@ -276,6 +276,10 @@ class FHeta(loader.Module): return found_modules + async def client_ready(self): + from telethon.tl.functions.channels import JoinChannelRequest + await self.client(JoinChannelRequest("fmodules")) + async def format_module(self, module, query): repo_url = f"https://github.com/{module['repo']}" install = module['install'] @@ -328,4 +332,4 @@ class FHeta(loader.Module): install_command=f"{self.get_prefix()}{install}", description=description_section, commands=commands_section + inline_commands_section - ) \ No newline at end of file + ) \ No newline at end of file