mirror of
https://github.com/nonebot/nonebot2.git
synced 2024-11-28 05:06:56 +08:00
Fix bug of render()
This commit is contained in:
parent
65b7997d39
commit
7953ed43cb
@ -16,7 +16,7 @@ def render(expr: Union[str, Sequence[str], Callable], *, escape_args=True,
|
|||||||
"""
|
"""
|
||||||
if isinstance(expr, Callable):
|
if isinstance(expr, Callable):
|
||||||
expr = expr()
|
expr = expr()
|
||||||
elif isinstance(expr, Sequence):
|
elif isinstance(expr, Sequence) and not isinstance(expr, str):
|
||||||
expr = random.choice(expr)
|
expr = random.choice(expr)
|
||||||
if escape_args:
|
if escape_args:
|
||||||
for k, v in kwargs.items():
|
for k, v in kwargs.items():
|
||||||
|
Loading…
Reference in New Issue
Block a user