From d96e4dabe59406ec6c4003134d1304d91055e569 Mon Sep 17 00:00:00 2001 From: Shrimadhav U K Date: Fri, 18 Feb 2022 15:09:37 +0530 Subject: [PATCH] also, add inline_mention function --- telethon/types/_custom/button.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/telethon/types/_custom/button.py b/telethon/types/_custom/button.py index becfaa1b..b81dcb66 100644 --- a/telethon/types/_custom/button.py +++ b/telethon/types/_custom/button.py @@ -170,7 +170,11 @@ class Button: ) @staticmethod - def mention(is_inline: bool, text, input_entity=None): + def inline_mention(text, input_entity=None): + return mention(text, input_entity, True) + + @staticmethod + def mention(text, input_entity=None, is_inline: bool=False): """ Creates a new inline button linked to the profile of user. @@ -179,9 +183,6 @@ class Button: Older clients will display unsupported message. Args: - is_inline: - whether to create inline / keyboard buttons - text: Label text on the button @@ -195,6 +196,9 @@ class Button: For now, you cannot use ID or username for this argument. If you want to use different user, you must manually use `client.get_input_entity() `. + + is_inline: + whether to create inline / keyboard buttons """ if is_inline: return _tl.InputKeyboardButtonUserProfile( @@ -433,3 +437,4 @@ def build_reply_markup( # elif is_normal: return _tl.ReplyKeyboardMarkup( rows, resize=resize, single_use=single_use, selective=selective) +