mirror of
https://github.com/nonebot/nonebot2.git
synced 2024-11-27 18:45:05 +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