⚗️ add prompt format support

This commit is contained in:
yanyongyu 2020-11-09 16:34:14 +08:00
parent bb869b5263
commit 9b3dffaab9

View File

@ -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