mirror of
https://github.com/nonebot/nonebot2.git
synced 2024-11-24 00:55:07 +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):
|
||||
expr = expr()
|
||||
elif isinstance(expr, Sequence):
|
||||
elif isinstance(expr, Sequence) and not isinstance(expr, str):
|
||||
expr = random.choice(expr)
|
||||
if escape_args:
|
||||
for k, v in kwargs.items():
|
||||
|
Loading…
Reference in New Issue
Block a user