mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-07-27 16:21:28 +00:00
Improve code docs
This commit is contained in:
@ -6,6 +6,14 @@ from aiocqhttp import message
|
||||
|
||||
def render(expr: Union[str, Sequence[str], Callable], *, escape_args=True,
|
||||
**kwargs) -> str:
|
||||
"""
|
||||
Render an expression to message string.
|
||||
|
||||
:param expr: expression to render
|
||||
:param escape_args: should escape arguments or not
|
||||
:param kwargs: keyword arguments used in str.format()
|
||||
:return: the rendered message
|
||||
"""
|
||||
if isinstance(expr, Callable):
|
||||
expr = expr()
|
||||
elif isinstance(expr, Sequence):
|
||||
|
Reference in New Issue
Block a user