pytdbot.utils.escape
- pytdbot.utils.escape.escape_html(text, quote=True)[source]
Escape HTML characters in the given text
- Parameters:
text (
str
) – The text to escapequote (
bool
, optional) – Whether to escape double quotes. Default isTrue
- Returns:
The escaped text
- Return type:
str
- pytdbot.utils.escape.escape_markdown(text, version=2)[source]
Escape Markdown characters in the given text
- Parameters:
text (
str
) – The text to escapeversion (
int
, optional) – The Markdown version to escape. Default is2
- Returns:
The escaped text
- Return type:
str
- Raises:
ValueError – If the given markdown version is not supported