mirror of https://github.com/coddrago/Heroku
fixed a bug with inaccurate requests in fheta
parent
e7331e2840
commit
dc735166b4
|
@ -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
|
||||
)
|
||||
)
|
Loading…
Reference in New Issue