Improve code docs

This commit is contained in:
Richard Chien
2018-07-01 20:01:05 +08:00
parent 6ec3ac66f7
commit 026d83e507
9 changed files with 100 additions and 39 deletions

View File

@ -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):