mirror of https://github.com/coddrago/Heroku
fixed a bug with inaccurate requests in fheta
parent
e7331e2840
commit
dc735166b4
|
@ -101,7 +101,7 @@ class FHeta(loader.Module):
|
||||||
closest_matches = difflib.get_close_matches(args, module_names, n=1, cutoff=0.5)
|
closest_matches = difflib.get_close_matches(args, module_names, n=1, cutoff=0.5)
|
||||||
|
|
||||||
if closest_matches:
|
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:
|
if closest_module:
|
||||||
formatted_module = await self.format_module(closest_module, args)
|
formatted_module = await self.format_module(closest_module, args)
|
||||||
banner_url = closest_module.get("banner", None)
|
banner_url = closest_module.get("banner", None)
|
||||||
|
@ -276,6 +276,10 @@ class FHeta(loader.Module):
|
||||||
|
|
||||||
return found_modules
|
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):
|
async def format_module(self, module, query):
|
||||||
repo_url = f"https://github.com/{module['repo']}"
|
repo_url = f"https://github.com/{module['repo']}"
|
||||||
install = module['install']
|
install = module['install']
|
||||||
|
|
Loading…
Reference in New Issue