Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions telegram/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ def escape_markdown(text: str, version: int = 1, entity_type: str = None) -> str

def mention_html(user_id: Union[int, str], name: str) -> str:
"""
Helper function to create a user mention as HTML tag.

Args:
user_id (:obj:`int`): The user's id which you want to mention.
name (:obj:`str`): The name the mention is showing.
Expand All @@ -84,6 +86,8 @@ def mention_html(user_id: Union[int, str], name: str) -> str:

def mention_markdown(user_id: Union[int, str], name: str, version: int = 1) -> str:
"""
Helper function to create a user mention in Markdown syntax.

Args:
user_id (:obj:`int`): The user's id which you want to mention.
name (:obj:`str`): The name the mention is showing.
Expand Down Expand Up @@ -149,14 +153,14 @@ def create_deep_linked_url(bot_username: str, payload: str = None, group: bool =
.. seealso:: :any:`Deeplinking Example <examples.deeplinking>`

Args:
bot_username (:obj:`str`): The username to link to
payload (:obj:`str`, optional): Parameters to encode in the created URL
bot_username (:obj:`str`): The username to link to.
payload (:obj:`str`, optional): Parameters to encode in the created URL.
group (:obj:`bool`, optional): If :obj:`True` the user is prompted to select a group to
add the bot to. If :obj:`False`, opens a one-on-one conversation with the bot.
Defaults to :obj:`False`.

Returns:
:obj:`str`: An URL to start the bot with specific parameters
:obj:`str`: An URL to start the bot with specific parameters.
"""
if bot_username is None or len(bot_username) <= 3:
raise ValueError("You must provide a valid bot_username.")
Expand Down