Skip to content

Commit

Permalink
Merge pull request #48 from Sevenyine/main
Browse files Browse the repository at this point in the history
指令后不加参数时等待用户下一条消息
  • Loading branch information
LambdaYH committed Aug 31, 2023
2 parents f3e2ef1 + ee24669 commit fe44c6b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
13 changes: 9 additions & 4 deletions nonebot_plugin_bottle/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,17 +175,22 @@ async def _(

@throw.handle()
async def _(
bot: Bot,
matcher: Matcher,
event: GroupMessageEvent,
args: Message = CommandArg(),
session: AsyncSession = Depends(get_session),
):
await verify(matcher=matcher, event=event)
if args:
matcher.set_arg("content", args)

if not args:
await throw.finish("想说些什么话呢?在指令后边写上吧!")

@throw.got("content", prompt="想说些什么话呢?")
async def _(
bot: Bot,
event: GroupMessageEvent,
args: Message = Arg("content"),
session: AsyncSession = Depends(get_session),
):
message_text = args.extract_plain_text().strip()

audit = await text_audit(text=message_text)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "nonebot_plugin_bottle"
version = "1.0.1.3"
version = "1.0.1.4"
description = "Bottle post plugin in Nonebot"
authors = ["Todysheep <[email protected]>"]
license = "GNU GPLv3"
Expand Down

0 comments on commit fe44c6b

Please sign in to comment.