mirror of
https://github.com/nonebot/nonebot2.git
synced 2024-11-30 17:15:08 +08:00
Fix expression render
This commit is contained in:
parent
545f9e840b
commit
086ac57c21
@ -15,7 +15,7 @@ def render(expr: Union[str, Sequence[str], Callable], *, escape_args=True,
|
||||
:return: the rendered message
|
||||
"""
|
||||
if isinstance(expr, Callable):
|
||||
expr = expr()
|
||||
expr = expr(**kwargs)
|
||||
elif isinstance(expr, Sequence) and not isinstance(expr, str):
|
||||
expr = random.choice(expr)
|
||||
if escape_args:
|
||||
|
Loading…
Reference in New Issue
Block a user