diff --git a/examples/asynchronous_telebot/formatting_example.py b/examples/asynchronous_telebot/formatting_example.py index 95c3d35..687daea 100644 --- a/examples/asynchronous_telebot/formatting_example.py +++ b/examples/asynchronous_telebot/formatting_example.py @@ -36,6 +36,8 @@ async def start_message(message): formatting.hunderline(message.from_user.first_name), formatting.hstrikethrough(message.from_user.first_name), formatting.hcode(message.from_user.first_name), + # hide_link is only for html + formatting.hide_link('https://telegra.ph/file/c158e3a6e2a26a160b253.jpg'), separator=" " ), parse_mode='HTML' diff --git a/examples/formatting_example.py b/examples/formatting_example.py index 1068acc..ae92252 100644 --- a/examples/formatting_example.py +++ b/examples/formatting_example.py @@ -36,6 +36,8 @@ def start_message(message): formatting.hunderline(message.from_user.first_name), formatting.hstrikethrough(message.from_user.first_name), formatting.hcode(message.from_user.first_name), + # hide_link is only for html + formatting.hide_link('https://telegra.ph/file/c158e3a6e2a26a160b253.jpg'), separator=" " ), parse_mode='HTML' diff --git a/telebot/formatting.py b/telebot/formatting.py index d13ba88..abec962 100644 --- a/telebot/formatting.py +++ b/telebot/formatting.py @@ -198,4 +198,14 @@ def hpre(content: str, escape: bool=True, language: str="") -> str: :param content: The string to preformatted. :param escape: True if you need to escape special characters. """ - return '
{}
'.format(language, escape_html(content) if escape else content)
\ No newline at end of file
+ return '{}
'.format(language, escape_html(content) if escape else content)
+
+
+def hide_link(url: str) -> str:
+ """
+ Hide url of an image.
+
+ :param url:
+ :return: str
+ """
+ return f''
\ No newline at end of file