add send pause reject finish template

This commit is contained in:
yanyongyu
2021-09-17 23:28:08 +08:00
parent 55a402203e
commit a273d75b07
4 changed files with 63 additions and 26 deletions

View 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)