feat: restore independent plugin workers

This commit is contained in:
united_pooh
2026-03-11 23:10:02 +08:00
parent a04d668cf6
commit 166bf4254c
11 changed files with 1059 additions and 37 deletions
+2 -1
View File
@@ -1,6 +1,7 @@
from astrbot_sdk.api.components.command import CommandComponent
from astrbot_sdk.api.event import AstrMessageEvent, filter
from astrbot_sdk.api.star.context import Context
from loguru import logger
class HelloCommand(CommandComponent):
@@ -10,7 +11,7 @@ class HelloCommand(CommandComponent):
@filter.command("hello")
async def hello(self, event: AstrMessageEvent):
ret = await self.context.conversation_manager.new_conversation("hello")
print(f"New conversation created: {ret}")
logger.info(f"New conversation created: {ret}")
yield event.plain_result(f"Hello, Astrbot! Created conversation ID: {ret}")
yield event.plain_result("Hello, Astrbot!")
yield event.plain_result("Hello again, Astrbot!")
+2
View File
@@ -4,6 +4,8 @@ display_name: HelloWorld 插件
desc: 一个简单的问候插件示例
author: Soulter
version: 0.1.0
runtime:
python: "3.12"
components: # 组件列表,将支持自动生成
- class: commands.hello:HelloCommand
type: command
+1
View File
@@ -0,0 +1 @@