Update main.py

This commit is contained in:
Soulter 2025-02-05 22:57:33 +08:00 committed by GitHub
parent 6a3787ff2b
commit eff7880848
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -9,5 +9,6 @@ class MyPlugin(Star):
# 注册指令的装饰器。指令名为 helloworld。注册成功后发送 `/helloworld` 就会触发这个指令,并回复 `你好, {user_name}!` # 注册指令的装饰器。指令名为 helloworld。注册成功后发送 `/helloworld` 就会触发这个指令,并回复 `你好, {user_name}!`
@filter.command("helloworld") @filter.command("helloworld")
async def helloworld(self, event: AstrMessageEvent): async def helloworld(self, event: AstrMessageEvent):
'''这是一个 hello world 指令''' # 这是 handler 的描述,将会被解析方便用户了解插件内容。建议填写。
user_name = event.get_sender_name() user_name = event.get_sender_name()
yield event.plain_result(f"Hello, {user_name}!") # 发送一条纯文本消息 yield event.plain_result(f"Hello, {user_name}!") # 发送一条纯文本消息