mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-09-06 20:16:47 +00:00
✨ add send pause reject finish template
This commit is contained in:
@ -13,7 +13,7 @@ COMMAND_SEP=["/", "."]
|
||||
CUSTOM_CONFIG1=config in env
|
||||
CUSTOM_CONFIG3=
|
||||
|
||||
CQHTTP_WS_URLS={"123123123": "ws://127.0.0.1:6700/"}
|
||||
# CQHTTP_WS_URLS={"123123123": "ws://127.0.0.1:6700/"}
|
||||
|
||||
MIRAI_AUTH_KEY=12345678
|
||||
MIRAI_HOST=127.0.0.1
|
||||
|
14
tests/test_plugins/test_template.py
Normal file
14
tests/test_plugins/test_template.py
Normal file
@ -0,0 +1,14 @@
|
||||
from nonebot import on_command
|
||||
from nonebot.typing import T_State
|
||||
from nonebot.adapters.cqhttp import Bot, MessageSegment, GroupMessageEvent
|
||||
|
||||
template = on_command("template")
|
||||
|
||||
|
||||
@template.handle()
|
||||
async def _(bot: Bot, event: GroupMessageEvent, state: T_State):
|
||||
state["at"] = MessageSegment.at(event.get_user_id())
|
||||
state["test"] = "test"
|
||||
# message: /template {at} hello {test}!
|
||||
ft = event.message.template(event.get_plaintext())
|
||||
await template.send(ft)
|
Reference in New Issue
Block a user