mirror of
https://github.com/AstrBotDevs/AstrBot
synced 2026-07-16 01:40:15 +08:00
14 lines
592 B
Python
14 lines
592 B
Python
from astrbot_sdk import Context, MessageEvent, Star, on_command
|
|
|
|
|
|
class HelloPlugin(Star):
|
|
@on_command("hello", description="发送最小问候")
|
|
async def hello(self, event: MessageEvent, ctx: Context) -> None:
|
|
await event.reply("Hello, World!")
|
|
|
|
@on_command("about", description="返回当前插件信息")
|
|
async def about(self, event: MessageEvent, ctx: Context) -> None:
|
|
plugin = await ctx.metadata.get_current_plugin()
|
|
display_name = plugin.display_name if plugin is not None else ctx.plugin_id
|
|
await event.reply(f"我是 {display_name}")
|