Utils
- bTagScript.utils.escape_content(string: str) str [source]
Escapes given input to avoid tampering with engine/block behavior.
- async bTagScript.utils.maybe_await(func: Union[Callable[[...], Any], Awaitable[Any]], *args, **kwargs) Any [source]
Await the given function if it is awaitable or call it synchronously.
- Parameters
func (Union[Callable[..., Any], Awaitable[Any]]) – The function callable to call.
*args (Any) – The arguments to pass to the function.
**kwargs (Any) – The keyword arguments to pass to the function.
- Returns
The result of the awaitable function.
- Return type
Any