mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-07-30 01:39:47 +03:00
Add Button.Buy and Button.game
This commit is contained in:
parent
0a4b827d8e
commit
89c062f0cf
|
@ -49,6 +49,7 @@ class Button:
|
||||||
Returns `True` if the button belongs to an inline keyboard.
|
Returns `True` if the button belongs to an inline keyboard.
|
||||||
"""
|
"""
|
||||||
return isinstance(button, (
|
return isinstance(button, (
|
||||||
|
types.KeyboardButtonBuy,
|
||||||
types.KeyboardButtonCallback,
|
types.KeyboardButtonCallback,
|
||||||
types.KeyboardButtonSwitchInline,
|
types.KeyboardButtonSwitchInline,
|
||||||
types.KeyboardButtonUrl,
|
types.KeyboardButtonUrl,
|
||||||
|
@ -266,8 +267,36 @@ class Button:
|
||||||
Args:
|
Args:
|
||||||
placeholder (str):
|
placeholder (str):
|
||||||
text to show the user at typing place of message.
|
text to show the user at typing place of message.
|
||||||
|
Telegram crops the placeholder and shows only only
|
||||||
|
64 Characters and adds ellipsis (…) character as 65th.
|
||||||
"""
|
"""
|
||||||
return types.ReplyKeyboardForceReply(
|
return types.ReplyKeyboardForceReply(
|
||||||
single_use=single_use,
|
single_use=single_use,
|
||||||
selective=selective,
|
selective=selective,
|
||||||
placeholder=placeholder)
|
placeholder=placeholder)
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def buy(text):
|
||||||
|
"""
|
||||||
|
Creates an Inline button to Buy a Product.
|
||||||
|
It can be only used with Invoice.
|
||||||
|
It should be the first button of the Invoice.
|
||||||
|
On Not Specifying Button, Telegram will Automatically add button to That Invoice.
|
||||||
|
Read More - https://core.telegram.org/api/payments
|
||||||
|
|
||||||
|
Args:
|
||||||
|
text (str):
|
||||||
|
text to show on the Buy Button.
|
||||||
|
"""
|
||||||
|
return types.KeyboardButtonBuy(text)
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def game(text):
|
||||||
|
"""
|
||||||
|
Creates an Inline Button to send with Game.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
text (str):
|
||||||
|
text to show on Game Button.
|
||||||
|
"""
|
||||||
|
return types.KeyboardButtonGame(text)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user