mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2025-03-14 19:48:57 +01:00
Adding InlineKeyboardButton #232
This commit is contained in:
parent
ed170e1595
commit
23eba8a24e
3 changed files with 85 additions and 20 deletions
|
@ -44,6 +44,7 @@ from .emoji import Emoji
|
|||
from .parsemode import ParseMode
|
||||
from .message import Message
|
||||
from .choseninlineresult import ChosenInlineResult
|
||||
from .inlinekeyboardbutton import InlineKeyboardButton
|
||||
from .inlinequery import InlineQuery
|
||||
from .inlinequeryresult import InlineQueryResult
|
||||
from .inlinequeryresultarticle import InlineQueryResultArticle
|
||||
|
@ -109,22 +110,58 @@ def JobQueue(*args, **kwargs):
|
|||
|
||||
__author__ = 'devs@python-telegram-bot.org'
|
||||
__version__ = '3.4'
|
||||
__all__ = ('Audio', 'Bot', 'Chat', 'Emoji', 'TelegramError', 'InputFile',
|
||||
'Contact', 'ForceReply', 'ReplyKeyboardHide', 'ReplyKeyboardMarkup',
|
||||
'UserProfilePhotos', 'ChatAction', 'Location', 'Video', 'Document',
|
||||
'Sticker', 'File', 'PhotoSize', 'Update', 'ParseMode', 'Message',
|
||||
'User', 'TelegramObject', 'NullHandler', 'Voice', 'InlineQuery',
|
||||
'ReplyMarkup', 'ChosenInlineResult', 'InlineQueryResult',
|
||||
'InlineQueryResult', 'InlineQueryResultArticle',
|
||||
'InlineQueryResultAudio', 'InlineQueryResultCachedAudio',
|
||||
'InlineQueryResultCachedDocument', 'InlineQueryResultCachedGif',
|
||||
'InlineQueryResultCachedMpeg4Gif', 'InlineQueryResultCachedPhoto',
|
||||
'InlineQueryResultCachedSticker', 'InlineQueryResultCachedVideo',
|
||||
'InlineQueryResultCachedVoice', 'InlineQueryResultContact',
|
||||
'InlineQueryResultDocument', 'InlineQueryResultGif',
|
||||
'InlineQueryResultLocation', 'InlineQueryResultMpeg4Gif',
|
||||
'InlineQueryResultPhoto', 'InlineQueryResultVenue',
|
||||
'InlineQueryResultVideo', 'InlineQueryResultVoice',
|
||||
'InputMessageContent', 'InputTextMessageContent',
|
||||
'InputLocationMessageContent', 'InputVenueMessageContent',
|
||||
'InputContactMessageContent')
|
||||
__all__ = ('Audio',
|
||||
'Bot',
|
||||
'Chat',
|
||||
'ChatAction',
|
||||
'ChosenInlineResult',
|
||||
'Contact',
|
||||
'Document',
|
||||
'Emoji',
|
||||
'File',
|
||||
'ForceReply',
|
||||
'InlineKeyboardButton',
|
||||
'InlineQuery',
|
||||
'InlineQueryResult',
|
||||
'InlineQueryResult',
|
||||
'InlineQueryResultArticle',
|
||||
'InlineQueryResultAudio',
|
||||
'InlineQueryResultCachedAudio',
|
||||
'InlineQueryResultCachedDocument',
|
||||
'InlineQueryResultCachedGif',
|
||||
'InlineQueryResultCachedMpeg4Gif',
|
||||
'InlineQueryResultCachedPhoto',
|
||||
'InlineQueryResultCachedSticker',
|
||||
'InlineQueryResultCachedVideo',
|
||||
'InlineQueryResultCachedVoice',
|
||||
'InlineQueryResultContact',
|
||||
'InlineQueryResultDocument',
|
||||
'InlineQueryResultGif',
|
||||
'InlineQueryResultLocation',
|
||||
'InlineQueryResultMpeg4Gif',
|
||||
'InlineQueryResultPhoto',
|
||||
'InlineQueryResultVenue',
|
||||
'InlineQueryResultVideo',
|
||||
'InlineQueryResultVoice',
|
||||
'InputContactMessageContent',
|
||||
'InputFile',
|
||||
'InputLocationMessageContent',
|
||||
'InputMessageContent',
|
||||
'InputTextMessageContent',
|
||||
'InputVenueMessageContent',
|
||||
'Location',
|
||||
'Message',
|
||||
'NullHandler',
|
||||
'ParseMode',
|
||||
'PhotoSize',
|
||||
'ReplyKeyboardHide',
|
||||
'ReplyKeyboardMarkup',
|
||||
'ReplyMarkup',
|
||||
'Sticker',
|
||||
'TelegramError',
|
||||
'TelegramObject',
|
||||
'Update',
|
||||
'User',
|
||||
'UserProfilePhotos',
|
||||
'Video',
|
||||
'Voice',)
|
||||
|
|
|
@ -16,3 +16,32 @@
|
|||
#
|
||||
# You should have received a copy of the GNU Lesser Public License
|
||||
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
||||
|
||||
"""This module contains a object that represents a Telegram
|
||||
InlineKeyboardButton"""
|
||||
|
||||
from telegram import TelegramObject
|
||||
|
||||
|
||||
class InlineKeyboardButton(TelegramObject):
|
||||
"""This object represents a Telegram InlineKeyboardButton."""
|
||||
|
||||
def __init__(self,
|
||||
text,
|
||||
url=None,
|
||||
callback_data=None,
|
||||
switch_inline_query=None):
|
||||
# Required
|
||||
self.text = text
|
||||
|
||||
# Optionals
|
||||
self.url = url
|
||||
self.callback_data = callback_data
|
||||
self.switch_inline_query = switch_inline_query
|
||||
|
||||
@staticmethod
|
||||
def de_json(data):
|
||||
if not data:
|
||||
return None
|
||||
|
||||
return InlineKeyboardButton(**data)
|
||||
|
|
|
@ -39,7 +39,6 @@ class InlineQuery(TelegramObject):
|
|||
from_user (:class:`telegram.User`):
|
||||
query (str):
|
||||
offset (str):
|
||||
|
||||
"""
|
||||
|
||||
def __init__(self,
|
||||
|
|
Loading…
Add table
Reference in a new issue