refactor: remove unused hello command, echo listener, and related tools; add CLI and context enhancements

This commit is contained in:
Soulter
2025-11-11 17:22:03 +08:00
parent e982e7798d
commit 67cc4c5715
17 changed files with 111 additions and 101 deletions

View File

@@ -0,0 +1,12 @@
from astrbot_sdk.api.components.command import CommandComponent
from astrbot_sdk.api.event import AstrMessageEvent, filter
from astrbot_sdk.api.star.context import Context
class HelloCommand(CommandComponent):
def __init__(self, context: Context):
self.context = context
@filter.command("hello")
async def hello(self, event: AstrMessageEvent):
yield event.plain_result("Hello, Astrbot!")

22
test_plugin/plugin.yaml Normal file
View File

@@ -0,0 +1,22 @@
_schema_version: 2
name: astrbot_plugin_helloworld
display_name: HelloWorld 插件
desc: 一个简单的问候插件示例
author: Soulter
version: 0.1.0
components: # 组件列表,将支持自动生成
- class: commands.hello:HelloCommand
type: command
name: hello
description: 发送问候消息
subcommands:
- name: wow
description: 发送 "Hello, Astrbot!" 消息
# - class: handlers.tools.echo:EchoTool
# type: llm_tool
# name: echo_tool
# description: 回显输入的消息
# - class: handlers.listeners.echo:EchoListener
# type: listener
# name: message_logger
# description: 监听并记录所有消息