mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-06-11 22:57:53 +00: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
|
:return: the rendered message
|
||||||
"""
|
"""
|
||||||
if isinstance(expr, Callable):
|
if isinstance(expr, Callable):
|
||||||
expr = expr()
|
expr = expr(**kwargs)
|
||||||
elif isinstance(expr, Sequence) and not isinstance(expr, str):
|
elif isinstance(expr, Sequence) and not isinstance(expr, str):
|
||||||
expr = random.choice(expr)
|
expr = random.choice(expr)
|
||||||
if escape_args:
|
if escape_args:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user