From 00e4861e1507aedc87494ff91e1a81c6919e4efc Mon Sep 17 00:00:00 2001 From: hikariatama Date: Sun, 19 Mar 2023 14:10:51 +0000 Subject: [PATCH] Fix help for single mod --- hikka/modules/help.py | 47 +++++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/hikka/modules/help.py b/hikka/modules/help.py index 479b232..7628a2c 100755 --- a/hikka/modules/help.py +++ b/hikka/modules/help.py @@ -428,33 +428,32 @@ class HelpMod(loader.Module): async def modhelp(self, message: Message, args: str): exact = True - if not (module := self.lookup(args, include_dragon=True)) and ( - method := self.allmodules.dispatch(args.lower().strip(self.get_prefix()))[1] - ): - module = method.__self__ - else: - module = self.lookup( - next( - ( - reversed( - sorted( - [ - module.strings["name"] - for module in self.allmodules.modules - ], - key=lambda x: difflib.SequenceMatcher( - None, - args.lower(), - x, - ).ratio(), + if not (module := self.lookup(args, include_dragon=True)): + if method := self.allmodules.dispatch(args.lower().strip(self.get_prefix()))[1]: + module = method.__self__ + else: + module = self.lookup( + next( + ( + reversed( + sorted( + [ + module.strings["name"] + for module in self.allmodules.modules + ], + key=lambda x: difflib.SequenceMatcher( + None, + args.lower(), + x, + ).ratio(), + ) ) - ) - ), - None, + ), + None, + ) ) - ) - exact = False + exact = False is_dragon = isinstance(module, DragonModule)