nonebot-plugin-help icon indicating copy to clipboard operation
nonebot-plugin-help copied to clipboard

Matcher没有__help_name__ 和__help_info__的时候可以用command信息替换

Open leinlin opened this issue 2 years ago • 3 comments

                if not name:
                    checkers = matcher.rule.checkers
                    temp = []
                    for v in checkers:
                        if hasattr(v.call, "cmds"):
                            cmds = v.call.cmds
                            if len(cmds) > 0:
                                if not name:
                                    name = cmds[0]
                                for x in cmds:
                                    temp.append(x)
                    help_info = ",".join('%s' % x for x in temp)

leinlin avatar Nov 09 '22 14:11 leinlin

效果如下

leinlin avatar Nov 09 '22 14:11 leinlin

image

leinlin avatar Nov 09 '22 14:11 leinlin

Hi @leinlin, thanks for the issue.

I'm keeping help doc of matcher level as "only show as provided" to enable ability of hidden command.

I believe this is useful in some cases and can avoid duplicates as most plugin providers who are using nonebot-plugin-help are putting all their help doc in PluginMetadata now instead of using combined (part in plugin level, detail in matcher level) help menu.

Let's leave the issue here for future consideration.

XZhouQD avatar Nov 09 '22 14:11 XZhouQD