Expose more raw API params in friendly methods (#3104)

This commit is contained in:
Devesh Pal
2021-08-05 14:24:07 +05:30
committed by GitHub
parent ad55b945c1
commit e5599c178b
4 changed files with 53 additions and 12 deletions

View File

@@ -245,17 +245,29 @@ class Button:
resize=resize, single_use=single_use, selective=selective)
@staticmethod
def clear():
def clear(selective=None):
"""
Clears all keyboard buttons after sending a message with this markup.
When used, no other button should be present or it will be ignored.
``selective`` is as documented in `text`.
"""
return types.ReplyKeyboardHide()
return types.ReplyKeyboardHide(selective=selective)
@staticmethod
def force_reply():
def force_reply(single_use=None, selective=None, placeholder=None):
"""
Forces a reply to the message with this markup. If used,
no other button should be present or it will be ignored.
``single_use`` and ``selective`` are as documented in `text`.
Args:
placeholder (str):
text to show the user at typing place of message.
"""
return types.ReplyKeyboardForceReply()
return types.ReplyKeyboardForceReply(
single_use=single_use,
selective=selective,
placeholder=placeholder)