Merge Pull Request #686 into master

This commit is contained in:
lanvent
2023-04-05 04:18:06 +08:00
parent eca369532d
commit cc881adda6
20 changed files with 659 additions and 61 deletions
+7 -3
View File
@@ -56,7 +56,7 @@ class SDWebUI(Plugin):
if "help" in keywords or "帮助" in keywords:
reply.type = ReplyType.INFO
reply.content = self.get_help_text()
reply.content = self.get_help_text(verbose = True)
else:
rule_params = {}
rule_options = {}
@@ -97,12 +97,16 @@ class SDWebUI(Plugin):
finally:
e_context['reply'] = reply
def get_help_text(self, **kwargs):
def get_help_text(self, verbose = False, **kwargs):
if not conf().get('image_create_prefix'):
return "画图功能未启用"
else:
trigger = conf()['image_create_prefix'][0]
help_text = f"请使用<{trigger}[关键词1] [关键词2]...:提示语>的格式作画,如\"{trigger}横版 高清:cat\"\n"
help_text = "利用stable-diffusion来画图。\n"
if not verbose:
return help_text
help_text += f"使用方法:\n使用\"{trigger}[关键词1] [关键词2]...:提示语\"的格式作画,如\"{trigger}横版 高清:cat\"\n"
help_text += "目前可用关键词:\n"
for rule in self.rules:
keywords = [f"[{keyword}]" for keyword in rule['keywords']]