feat: hello plugin support system prompt

This commit is contained in:
zhayujie
2023-11-29 17:41:14 +08:00
parent 6e0d2f9437
commit 865e4b5349
4 changed files with 8 additions and 9 deletions

View File

@@ -22,6 +22,7 @@ class Hello(Plugin):
super().__init__()
self.handlers[Event.ON_HANDLE_CONTEXT] = self.on_handle_context
logger.info("[Hello] inited")
self.config = super().load_config()
def on_handle_context(self, e_context: EventContext):
if e_context["context"].type not in [
@@ -30,7 +31,8 @@ class Hello(Plugin):
ContextType.PATPAT,
]:
return
if not self.config or not self.config.get("use_character_desc"):
e_context["context"]["generate_breaked_by"] = EventAction.BREAK
if e_context["context"].type == ContextType.JOIN_GROUP:
if "group_welcome_msg" in conf():
reply = Reply()

View File

@@ -88,6 +88,8 @@ class MJBot:
context = e_context['context']
if context.type == ContextType.TEXT:
cmd_list = context.content.split(maxsplit=1)
if not cmd_list:
return None
if cmd_list[0].lower() == f"{trigger_prefix}mj":
return TaskType.GENERATE
elif cmd_list[0].lower() == f"{trigger_prefix}mju":