summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
author简律纯 <i@jyunko.cn>2023-12-18 05:44:35 +0800
committer简律纯 <i@jyunko.cn>2023-12-18 05:44:35 +0800
commit477c9ccfe4451920838705ab4aba81b2b41d0c50 (patch)
tree2ec905a48016480d2d95d269327cee1cb0c9dfbc /src
parented6a2c4001309096f191953d8986b54c006c518d (diff)
downloadinfini-477c9ccfe4451920838705ab4aba81b2b41d0c50.tar.gz
infini-477c9ccfe4451920838705ab4aba81b2b41d0c50.zip
fix(template|tests): update command: new template
Diffstat (limited to 'src')
-rw-r--r--src/infini/const/templates.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/infini/const/templates.py b/src/infini/const/templates.py
index d780c248..9a450846 100644
--- a/src/infini/const/templates.py
+++ b/src/infini/const/templates.py
@@ -1,15 +1,15 @@
HANDLER = """from infini import Handler, MessageEvent
from infini.matcher import MatcherEvent
+from infini.event import InfiniEvent
from .event import MyEvent
class MyHandler(Handler):
\"\"\"自设业务函数\"\"\"
- name = "example_handler" # 业务函数事件名
priority: int = 0 # 业务函数权重
- def process(self, event: MatcherEvent) -> MessageEvent:
+ def process(self, event: MatcherEvent) -> InfiniEvent:
\"\"\"声明规则包检定方式\"\"\"
plain_text = event.get_plain_text()
return MyEvent("rule.example_event", plain_text=plain_text)