Skip to content

Conversation

@GuGuMur
Copy link
Contributor

@GuGuMur GuGuMur commented Nov 16, 2025

问题复现:

from nonebot import require
from nonebot.typing import T_State
from arclet.alconna import Args, Alconna

require("nonebot_plugin_alconna")
from nonebot_plugin_alconna import (
    UniMessage,
    AlconnaMatcher,
    on_alconna,
)


command = on_alconna(
    Alconna("活动公告", Args["cid?", str]["title?", str]),
    use_cmd_start=True,
    # use_cmd_sep=True,
    auto_send_output=True,
)


@command.handle()
async def _(
    matcher: AlconnaMatcher,
    state: T_State,
): ...


@command.got_path(
    "cid", prompt=UniMessage.template("请在下一条消息中回复需要的公告消息ID:")
)
async def _(
    state: T_State,
    cid: str
):
    state["cid"] = cid


@command.got_path(
    "title", prompt=UniMessage.template("请回复页面名称:")
)
async def _(
    state: T_State,
    title: str,
):
    state["title"] = title

报错:

TypeError: nonebot_plugin_alconna.uniseg.template.UniMessageTemplate.format() got multiple values for keyword argument 'cid'

@RF-Tar-Railt RF-Tar-Railt merged commit 38ac13e into nonebot:master Dec 17, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants