mirror of
https://github.com/AstrBotDevs/AstrBot.git
synced 2026-10-24 01:39:17 +08:00
feat: restore independent plugin workers
This commit is contained in:
@@ -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!")
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
Reference in New Issue
Block a user