mirror of
https://github.com/nonebot/nonebot2.git
synced 2024-12-04 02:54:49 +08:00
⚗️ add prompt format support
This commit is contained in:
parent
bb869b5263
commit
9b3dffaab9
@ -260,7 +260,8 @@ class Matcher(metaclass=MatcherMeta):
|
||||
state["_current_key"] = key
|
||||
if key not in state:
|
||||
if prompt:
|
||||
await bot.send(event=event, message=prompt)
|
||||
await bot.send(event=event,
|
||||
message=str(prompt).format(**state))
|
||||
raise PausedException
|
||||
else:
|
||||
state["_skip_key"] = True
|
||||
@ -535,7 +536,8 @@ class MatcherGroup:
|
||||
state["_current_key"] = key
|
||||
if key not in state:
|
||||
if prompt:
|
||||
await bot.send(event=event, message=prompt)
|
||||
await bot.send(event=event,
|
||||
message=str(prompt).format(state))
|
||||
raise PausedException
|
||||
else:
|
||||
state["_skip_key"] = True
|
||||
|
Loading…
Reference in New Issue
Block a user