Update helloworld.py
This commit is contained in:
parent
14b41c2352
commit
15410416e8
@ -5,8 +5,10 @@ from nakuru import (
|
|||||||
)
|
)
|
||||||
from botpy.message import Message, DirectMessage
|
from botpy.message import Message, DirectMessage
|
||||||
from model.platform.qq import QQ
|
from model.platform.qq import QQ
|
||||||
import time
|
from cores.qqbot.global_object import (
|
||||||
from cores.qqbot.global_object import AstrMessageEvent
|
AstrMessageEvent,
|
||||||
|
CommandResult
|
||||||
|
)
|
||||||
|
|
||||||
'''
|
'''
|
||||||
注意改插件名噢!格式:XXXPlugin 或 Main
|
注意改插件名噢!格式:XXXPlugin 或 Main
|
||||||
@ -27,10 +29,19 @@ class HelloWorldPlugin:
|
|||||||
"""
|
"""
|
||||||
def run(self, ame: AstrMessageEvent):
|
def run(self, ame: AstrMessageEvent):
|
||||||
if ame.message_str == "helloworld":
|
if ame.message_str == "helloworld":
|
||||||
return True, tuple([True, "Hello World!!", "helloworld"])
|
# return True, tuple([True, "Hello World!!", "helloworld"])
|
||||||
|
return CommandResult(
|
||||||
|
hit=True,
|
||||||
|
success=True,
|
||||||
|
message_chain=[Plain("Hello World!!")],
|
||||||
|
command_name="helloworld"
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
return False, None
|
return CommandResult(
|
||||||
|
hit=False,
|
||||||
|
success=False,
|
||||||
|
message_chain=None,
|
||||||
|
)
|
||||||
"""
|
"""
|
||||||
插件元信息。
|
插件元信息。
|
||||||
当用户输入 plugin v 插件名称 时,会调用此函数,返回帮助信息。
|
当用户输入 plugin v 插件名称 时,会调用此函数,返回帮助信息。
|
||||||
|
Loading…
x
Reference in New Issue
Block a user