Add scraped inline query results

This commit is contained in:
Dan 2018-10-15 11:34:27 +02:00
parent c37dcb07cf
commit dd642f5b9d
21 changed files with 1366 additions and 2 deletions

View File

@ -172,8 +172,9 @@ def start():
with open("{}/source/auth_key.tl".format(HOME), encoding="utf-8") as auth, \
open("{}/source/sys_msgs.tl".format(HOME), encoding="utf-8") as system, \
open("{}/source/main_api.tl".format(HOME), encoding="utf-8") as api:
schema = (auth.read() + system.read() + api.read()).splitlines()
open("{}/source/main_api.tl".format(HOME), encoding="utf-8") as api, \
open("{}/source/bot.tl".format(HOME), encoding="utf-8") as pyro:
schema = (auth.read() + system.read() + api.read() + pyro.read()).splitlines()
with open("{}/template/mtproto.txt".format(HOME), encoding="utf-8") as f:
mtproto_template = f.read()

View File

@ -21,6 +21,25 @@ from .force_reply import ForceReply
from .inline_keyboard_button import InlineKeyboardButton
from .inline_keyboard_markup import InlineKeyboardMarkup
from .inline_query import InlineQuery
from .inline_query_result_audio import InlineQueryResultAudio
from .inline_query_result_cached_audio import InlineQueryResultCachedAudio
from .inline_query_result_cached_document import InlineQueryResultCachedDocument
from .inline_query_result_cached_gif import InlineQueryResultCachedGif
from .inline_query_result_cached_mpeg4_gif import InlineQueryResultCachedMpeg4Gif
from .inline_query_result_cached_photo import InlineQueryResultCachedPhoto
from .inline_query_result_cached_sticker import InlineQueryResultCachedSticker
from .inline_query_result_cached_video import InlineQueryResultCachedVideo
from .inline_query_result_cached_voice import InlineQueryResultCachedVoice
from .inline_query_result_contact import InlineQueryResultContact
from .inline_query_result_document import InlineQueryResultDocument
from .inline_query_result_game import InlineQueryResultGame
from .inline_query_result_gif import InlineQueryResultGif
from .inline_query_result_location import InlineQueryResultLocation
from .inline_query_result_mpeg4_gif import InlineQueryResultMpeg4Gif
from .inline_query_result_photo import InlineQueryResultPhoto
from .inline_query_result_venue import InlineQueryResultVenue
from .inline_query_result_video import InlineQueryResultVideo
from .inline_query_result_voice import InlineQueryResultVoice
from .keyboard_button import KeyboardButton
from .reply_keyboard_markup import ReplyKeyboardMarkup
from .reply_keyboard_remove import ReplyKeyboardRemove

View File

@ -0,0 +1,72 @@
# Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2018 Dan Tès <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Pyrogram is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
from pyrogram.api.core import Object
class InlineQueryResultAudio(Object):
"""Represents a link to an mp3 audio file. By default, this audio file will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the audio.
Attributes:
ID: ``0xb0700004``
Args:
type (``str``):
Type of the result, must be audio.
id (``str``):
Unique identifier for this result, 1-64 bytes.
audio_url (``str``):
A valid URL for the audio file.
title (``str``):
Title.
caption (``str``, optional):
Caption, 0-200 characters.
parse_mode (``str``, optional):
Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
performer (``str``, optional):
Performer.
audio_duration (``int`` ``32-bit``, optional):
Audio duration in seconds.
reply_markup (:obj:`InlineKeyboardMarkup <pyrogram.types.InlineKeyboardMarkup>`, optional):
Inline keyboard attached to the message.
input_message_content (:obj:`InputMessageContent <pyrogram.types.InputMessageContent>`, optional):
Content of the message to be sent instead of the audio.
"""
ID = 0xb0700004
def __init__(self, type: str, id: str, audio_url: str, title: str, caption: str = None, parse_mode: str = None, performer: str = None, audio_duration: int = None, reply_markup=None, input_message_content=None):
self.type = type # string
self.id = id # string
self.audio_url = audio_url # string
self.title = title # string
self.caption = caption # flags.0?string
self.parse_mode = parse_mode # flags.1?string
self.performer = performer # flags.2?string
self.audio_duration = audio_duration # flags.3?int
self.reply_markup = reply_markup # flags.4?InlineKeyboardMarkup
self.input_message_content = input_message_content # flags.5?InputMessageContent

View File

@ -0,0 +1,60 @@
# Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2018 Dan Tès <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Pyrogram is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
from pyrogram.api.core import Object
class InlineQueryResultCachedAudio(Object):
"""Represents a link to an mp3 audio file stored on the Telegram servers. By default, this audio file will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the audio.
Attributes:
ID: ``0xb0700018``
Args:
type (``str``):
Type of the result, must be audio.
id (``str``):
Unique identifier for this result, 1-64 bytes.
audio_file_id (``str``):
A valid file identifier for the audio file.
caption (``str``, optional):
Caption, 0-200 characters.
parse_mode (``str``, optional):
Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
reply_markup (:obj:`InlineKeyboardMarkup <pyrogram.types.InlineKeyboardMarkup>`, optional):
Inline keyboard attached to the message.
input_message_content (:obj:`InputMessageContent <pyrogram.types.InputMessageContent>`, optional):
Content of the message to be sent instead of the audio.
"""
ID = 0xb0700018
def __init__(self, type: str, id: str, audio_file_id: str, caption: str = None, parse_mode: str = None, reply_markup=None, input_message_content=None):
self.type = type # string
self.id = id # string
self.audio_file_id = audio_file_id # string
self.caption = caption # flags.0?string
self.parse_mode = parse_mode # flags.1?string
self.reply_markup = reply_markup # flags.2?InlineKeyboardMarkup
self.input_message_content = input_message_content # flags.3?InputMessageContent

View File

@ -0,0 +1,68 @@
# Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2018 Dan Tès <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Pyrogram is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
from pyrogram.api.core import Object
class InlineQueryResultCachedDocument(Object):
"""Represents a link to a file stored on the Telegram servers. By default, this file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the file.
Attributes:
ID: ``0xb0700015``
Args:
type (``str``):
Type of the result, must be document.
id (``str``):
Unique identifier for this result, 1-64 bytes.
title (``str``):
Title for the result.
document_file_id (``str``):
A valid file identifier for the file.
description (``str``, optional):
Short description of the result.
caption (``str``, optional):
Caption of the document to be sent, 0-200 characters.
parse_mode (``str``, optional):
Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
reply_markup (:obj:`InlineKeyboardMarkup <pyrogram.types.InlineKeyboardMarkup>`, optional):
Inline keyboard attached to the message.
input_message_content (:obj:`InputMessageContent <pyrogram.types.InputMessageContent>`, optional):
Content of the message to be sent instead of the file.
"""
ID = 0xb0700015
def __init__(self, type: str, id: str, title: str, document_file_id: str, description: str = None, caption: str = None, parse_mode: str = None, reply_markup=None, input_message_content=None):
self.type = type # string
self.id = id # string
self.title = title # string
self.document_file_id = document_file_id # string
self.description = description # flags.0?string
self.caption = caption # flags.1?string
self.parse_mode = parse_mode # flags.2?string
self.reply_markup = reply_markup # flags.3?InlineKeyboardMarkup
self.input_message_content = input_message_content # flags.4?InputMessageContent

View File

@ -0,0 +1,64 @@
# Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2018 Dan Tès <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Pyrogram is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
from pyrogram.api.core import Object
class InlineQueryResultCachedGif(Object):
"""Represents a link to an animated GIF file stored on the Telegram servers. By default, this animated GIF file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with specified content instead of the animation.
Attributes:
ID: ``0xb0700012``
Args:
type (``str``):
Type of the result, must be gif.
id (``str``):
Unique identifier for this result, 1-64 bytes.
gif_file_id (``str``):
A valid file identifier for the GIF file.
title (``str``, optional):
Title for the result.
caption (``str``, optional):
Caption of the GIF file to be sent, 0-200 characters.
parse_mode (``str``, optional):
Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
reply_markup (:obj:`InlineKeyboardMarkup <pyrogram.types.InlineKeyboardMarkup>`, optional):
Inline keyboard attached to the message.
input_message_content (:obj:`InputMessageContent <pyrogram.types.InputMessageContent>`, optional):
Content of the message to be sent instead of the GIF animation.
"""
ID = 0xb0700012
def __init__(self, type: str, id: str, gif_file_id: str, title: str = None, caption: str = None, parse_mode: str = None, reply_markup=None, input_message_content=None):
self.type = type # string
self.id = id # string
self.gif_file_id = gif_file_id # string
self.title = title # flags.0?string
self.caption = caption # flags.1?string
self.parse_mode = parse_mode # flags.2?string
self.reply_markup = reply_markup # flags.3?InlineKeyboardMarkup
self.input_message_content = input_message_content # flags.4?InputMessageContent

View File

@ -0,0 +1,64 @@
# Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2018 Dan Tès <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Pyrogram is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
from pyrogram.api.core import Object
class InlineQueryResultCachedMpeg4Gif(Object):
"""Represents a link to a video animation (H.264/MPEG-4 AVC video without sound) stored on the Telegram servers. By default, this animated MPEG-4 file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the animation.
Attributes:
ID: ``0xb0700013``
Args:
type (``str``):
Type of the result, must be mpeg4_gif.
id (``str``):
Unique identifier for this result, 1-64 bytes.
mpeg4_file_id (``str``):
A valid file identifier for the MP4 file.
title (``str``, optional):
Title for the result.
caption (``str``, optional):
Caption of the MPEG-4 file to be sent, 0-200 characters.
parse_mode (``str``, optional):
Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
reply_markup (:obj:`InlineKeyboardMarkup <pyrogram.types.InlineKeyboardMarkup>`, optional):
Inline keyboard attached to the message.
input_message_content (:obj:`InputMessageContent <pyrogram.types.InputMessageContent>`, optional):
Content of the message to be sent instead of the video animation.
"""
ID = 0xb0700013
def __init__(self, type: str, id: str, mpeg4_file_id: str, title: str = None, caption: str = None, parse_mode: str = None, reply_markup=None, input_message_content=None):
self.type = type # string
self.id = id # string
self.mpeg4_file_id = mpeg4_file_id # string
self.title = title # flags.0?string
self.caption = caption # flags.1?string
self.parse_mode = parse_mode # flags.2?string
self.reply_markup = reply_markup # flags.3?InlineKeyboardMarkup
self.input_message_content = input_message_content # flags.4?InputMessageContent

View File

@ -0,0 +1,68 @@
# Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2018 Dan Tès <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Pyrogram is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
from pyrogram.api.core import Object
class InlineQueryResultCachedPhoto(Object):
"""Represents a link to a photo stored on the Telegram servers. By default, this photo will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the photo.
Attributes:
ID: ``0xb0700011``
Args:
type (``str``):
Type of the result, must be photo.
id (``str``):
Unique identifier for this result, 1-64 bytes.
photo_file_id (``str``):
A valid file identifier of the photo.
title (``str``, optional):
Title for the result.
description (``str``, optional):
Short description of the result.
caption (``str``, optional):
Caption of the photo to be sent, 0-200 characters.
parse_mode (``str``, optional):
Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
reply_markup (:obj:`InlineKeyboardMarkup <pyrogram.types.InlineKeyboardMarkup>`, optional):
Inline keyboard attached to the message.
input_message_content (:obj:`InputMessageContent <pyrogram.types.InputMessageContent>`, optional):
Content of the message to be sent instead of the photo.
"""
ID = 0xb0700011
def __init__(self, type: str, id: str, photo_file_id: str, title: str = None, description: str = None, caption: str = None, parse_mode: str = None, reply_markup=None, input_message_content=None):
self.type = type # string
self.id = id # string
self.photo_file_id = photo_file_id # string
self.title = title # flags.0?string
self.description = description # flags.1?string
self.caption = caption # flags.2?string
self.parse_mode = parse_mode # flags.3?string
self.reply_markup = reply_markup # flags.4?InlineKeyboardMarkup
self.input_message_content = input_message_content # flags.5?InputMessageContent

View File

@ -0,0 +1,52 @@
# Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2018 Dan Tès <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Pyrogram is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
from pyrogram.api.core import Object
class InlineQueryResultCachedSticker(Object):
"""Represents a link to a sticker stored on the Telegram servers. By default, this sticker will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the sticker.
Attributes:
ID: ``0xb0700014``
Args:
type (``str``):
Type of the result, must be sticker.
id (``str``):
Unique identifier for this result, 1-64 bytes.
sticker_file_id (``str``):
A valid file identifier of the sticker.
reply_markup (:obj:`InlineKeyboardMarkup <pyrogram.types.InlineKeyboardMarkup>`, optional):
Inline keyboard attached to the message.
input_message_content (:obj:`InputMessageContent <pyrogram.types.InputMessageContent>`, optional):
Content of the message to be sent instead of the sticker.
"""
ID = 0xb0700014
def __init__(self, type: str, id: str, sticker_file_id: str, reply_markup=None, input_message_content=None):
self.type = type # string
self.id = id # string
self.sticker_file_id = sticker_file_id # string
self.reply_markup = reply_markup # flags.0?InlineKeyboardMarkup
self.input_message_content = input_message_content # flags.1?InputMessageContent

View File

@ -0,0 +1,68 @@
# Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2018 Dan Tès <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Pyrogram is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
from pyrogram.api.core import Object
class InlineQueryResultCachedVideo(Object):
"""Represents a link to a video file stored on the Telegram servers. By default, this video file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the video.
Attributes:
ID: ``0xb0700016``
Args:
type (``str``):
Type of the result, must be video.
id (``str``):
Unique identifier for this result, 1-64 bytes.
video_file_id (``str``):
A valid file identifier for the video file.
title (``str``):
Title for the result.
description (``str``, optional):
Short description of the result.
caption (``str``, optional):
Caption of the video to be sent, 0-200 characters.
parse_mode (``str``, optional):
Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
reply_markup (:obj:`InlineKeyboardMarkup <pyrogram.types.InlineKeyboardMarkup>`, optional):
Inline keyboard attached to the message.
input_message_content (:obj:`InputMessageContent <pyrogram.types.InputMessageContent>`, optional):
Content of the message to be sent instead of the video.
"""
ID = 0xb0700016
def __init__(self, type: str, id: str, video_file_id: str, title: str, description: str = None, caption: str = None, parse_mode: str = None, reply_markup=None, input_message_content=None):
self.type = type # string
self.id = id # string
self.video_file_id = video_file_id # string
self.title = title # string
self.description = description # flags.0?string
self.caption = caption # flags.1?string
self.parse_mode = parse_mode # flags.2?string
self.reply_markup = reply_markup # flags.3?InlineKeyboardMarkup
self.input_message_content = input_message_content # flags.4?InputMessageContent

View File

@ -0,0 +1,64 @@
# Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2018 Dan Tès <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Pyrogram is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
from pyrogram.api.core import Object
class InlineQueryResultCachedVoice(Object):
"""Represents a link to a voice message stored on the Telegram servers. By default, this voice message will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the voice message.
Attributes:
ID: ``0xb0700017``
Args:
type (``str``):
Type of the result, must be voice.
id (``str``):
Unique identifier for this result, 1-64 bytes.
voice_file_id (``str``):
A valid file identifier for the voice message.
title (``str``):
Voice message title.
caption (``str``, optional):
Caption, 0-200 characters.
parse_mode (``str``, optional):
Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
reply_markup (:obj:`InlineKeyboardMarkup <pyrogram.types.InlineKeyboardMarkup>`, optional):
Inline keyboard attached to the message.
input_message_content (:obj:`InputMessageContent <pyrogram.types.InputMessageContent>`, optional):
Content of the message to be sent instead of the voice message.
"""
ID = 0xb0700017
def __init__(self, type: str, id: str, voice_file_id: str, title: str, caption: str = None, parse_mode: str = None, reply_markup=None, input_message_content=None):
self.type = type # string
self.id = id # string
self.voice_file_id = voice_file_id # string
self.title = title # string
self.caption = caption # flags.0?string
self.parse_mode = parse_mode # flags.1?string
self.reply_markup = reply_markup # flags.2?InlineKeyboardMarkup
self.input_message_content = input_message_content # flags.3?InputMessageContent

View File

@ -0,0 +1,76 @@
# Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2018 Dan Tès <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Pyrogram is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
from pyrogram.api.core import Object
class InlineQueryResultContact(Object):
"""Represents a contact with a phone number. By default, this contact will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the contact.
Attributes:
ID: ``0xb0700009``
Args:
type (``str``):
Type of the result, must be contact.
id (``str``):
Unique identifier for this result, 1-64 Bytes.
phone_number (``str``):
Contact's phone number.
first_name (``str``):
Contact's first name.
last_name (``str``, optional):
Contact's last name.
vcard (``str``, optional):
Additional data about the contact in the form of a vCard, 0-2048 bytes.
reply_markup (:obj:`InlineKeyboardMarkup <pyrogram.types.InlineKeyboardMarkup>`, optional):
Inline keyboard attached to the message.
input_message_content (:obj:`InputMessageContent <pyrogram.types.InputMessageContent>`, optional):
Content of the message to be sent instead of the contact.
thumb_url (``str``, optional):
Url of the thumbnail for the result.
thumb_width (``int`` ``32-bit``, optional):
Thumbnail width.
thumb_height (``int`` ``32-bit``, optional):
Thumbnail height.
"""
ID = 0xb0700009
def __init__(self, type: str, id: str, phone_number: str, first_name: str, last_name: str = None, vcard: str = None, reply_markup=None, input_message_content=None, thumb_url: str = None, thumb_width: int = None, thumb_height: int = None):
self.type = type # string
self.id = id # string
self.phone_number = phone_number # string
self.first_name = first_name # string
self.last_name = last_name # flags.0?string
self.vcard = vcard # flags.1?string
self.reply_markup = reply_markup # flags.2?InlineKeyboardMarkup
self.input_message_content = input_message_content # flags.3?InputMessageContent
self.thumb_url = thumb_url # flags.4?string
self.thumb_width = thumb_width # flags.5?int
self.thumb_height = thumb_height # flags.6?int

View File

@ -0,0 +1,84 @@
# Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2018 Dan Tès <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Pyrogram is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
from pyrogram.api.core import Object
class InlineQueryResultDocument(Object):
"""Represents a link to a file. By default, this file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the file. Currently, only .PDF and .ZIP files can be sent using this method.
Attributes:
ID: ``0xb0700006``
Args:
type (``str``):
Type of the result, must be document.
id (``str``):
Unique identifier for this result, 1-64 bytes.
title (``str``):
Title for the result.
document_url (``str``, optional):
Caption of the document to be sent, 0-200 characters.
mime_type (``str``, optional):
Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
caption (``str``):
A valid URL for the file.
parse_mode (``str``):
Mime type of the content of the file, either "application/pdf" or "application/zip".
description (``str``, optional):
Short description of the result.
reply_markup (:obj:`InlineKeyboardMarkup <pyrogram.types.InlineKeyboardMarkup>`, optional):
Inline keyboard attached to the message.
input_message_content (:obj:`InputMessageContent <pyrogram.types.InputMessageContent>`, optional):
Content of the message to be sent instead of the file.
thumb_url (``str``, optional):
URL of the thumbnail (jpeg only) for the file.
thumb_width (``int`` ``32-bit``, optional):
Thumbnail width.
thumb_height (``int`` ``32-bit``, optional):
Thumbnail height.
"""
ID = 0xb0700006
def __init__(self, type: str, id: str, title: str, document_url: str, mime_type: str, caption: str = None, parse_mode: str = None, description: str = None, reply_markup=None, input_message_content=None, thumb_url: str = None, thumb_width: int = None, thumb_height: int = None):
self.type = type # string
self.id = id # string
self.title = title # string
self.caption = caption # flags.0?string
self.parse_mode = parse_mode # flags.1?string
self.document_url = document_url # string
self.mime_type = mime_type # string
self.description = description # flags.2?string
self.reply_markup = reply_markup # flags.3?InlineKeyboardMarkup
self.input_message_content = input_message_content # flags.4?InputMessageContent
self.thumb_url = thumb_url # flags.5?string
self.thumb_width = thumb_width # flags.6?int
self.thumb_height = thumb_height # flags.7?int

View File

@ -0,0 +1,48 @@
# Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2018 Dan Tès <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Pyrogram is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
from pyrogram.api.core import Object
class InlineQueryResultGame(Object):
"""Represents a Game.
Attributes:
ID: ``0xb0700010``
Args:
type (``str``):
Type of the result, must be game.
id (``str``):
Unique identifier for this result, 1-64 bytes.
game_short_name (``str``):
Short name of the game.
reply_markup (:obj:`InlineKeyboardMarkup <pyrogram.types.InlineKeyboardMarkup>`, optional):
Inline keyboard attached to the message.
"""
ID = 0xb0700010
def __init__(self, type: str, id: str, game_short_name: str, reply_markup=None):
self.type = type # string
self.id = id # string
self.game_short_name = game_short_name # string
self.reply_markup = reply_markup # flags.0?InlineKeyboardMarkup

View File

@ -0,0 +1,80 @@
# Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2018 Dan Tès <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Pyrogram is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
from pyrogram.api.core import Object
class InlineQueryResultGif(Object):
"""Represents a link to an animated GIF file. By default, this animated GIF file will be sent by the user with optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the animation.
Attributes:
ID: ``0xb0700001``
Args:
type (``str``):
Type of the result, must be gif.
id (``str``):
Unique identifier for this result, 1-64 bytes.
gif_url (``str``):
A valid URL for the GIF file. File size must not exceed 1MB.
thumb_url (``str``, optional):
Width of the GIF.
gif_width (``int`` ``32-bit``, optional):
Height of the GIF.
gif_height (``int`` ``32-bit``, optional):
Duration of the GIF.
gif_duration (``int`` ``32-bit``):
URL of the static thumbnail for the result (jpeg or gif).
title (``str``, optional):
Title for the result.
caption (``str``, optional):
Caption of the GIF file to be sent, 0-200 characters.
parse_mode (``str``, optional):
Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
reply_markup (:obj:`InlineKeyboardMarkup <pyrogram.types.InlineKeyboardMarkup>`, optional):
Inline keyboard attached to the message.
input_message_content (:obj:`InputMessageContent <pyrogram.types.InputMessageContent>`, optional):
Content of the message to be sent instead of the GIF animation.
"""
ID = 0xb0700001
def __init__(self, type: str, id: str, gif_url: str, thumb_url: str, gif_width: int = None, gif_height: int = None, gif_duration: int = None, title: str = None, caption: str = None, parse_mode: str = None, reply_markup=None, input_message_content=None):
self.type = type # string
self.id = id # string
self.gif_url = gif_url # string
self.gif_width = gif_width # flags.0?int
self.gif_height = gif_height # flags.1?int
self.gif_duration = gif_duration # flags.2?int
self.thumb_url = thumb_url # string
self.title = title # flags.3?string
self.caption = caption # flags.4?string
self.parse_mode = parse_mode # flags.5?string
self.reply_markup = reply_markup # flags.6?InlineKeyboardMarkup
self.input_message_content = input_message_content # flags.7?InputMessageContent

View File

@ -0,0 +1,76 @@
# Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2018 Dan Tès <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Pyrogram is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
from pyrogram.api.core import Object
class InlineQueryResultLocation(Object):
"""Represents a location on a map. By default, the location will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the location.
Attributes:
ID: ``0xb0700007``
Args:
type (``str``):
Type of the result, must be location.
id (``str``):
Unique identifier for this result, 1-64 Bytes.
latitude (``float`` ``64-bit``):
Location latitude in degrees.
longitude (``float`` ``64-bit``):
Location longitude in degrees.
title (``str``):
Location title.
live_period (``int`` ``32-bit``, optional):
Period in seconds for which the location can be updated, should be between 60 and 86400.
reply_markup (:obj:`InlineKeyboardMarkup <pyrogram.types.InlineKeyboardMarkup>`, optional):
Inline keyboard attached to the message.
input_message_content (:obj:`InputMessageContent <pyrogram.types.InputMessageContent>`, optional):
Content of the message to be sent instead of the location.
thumb_url (``str``, optional):
Url of the thumbnail for the result.
thumb_width (``int`` ``32-bit``, optional):
Thumbnail width.
thumb_height (``int`` ``32-bit``, optional):
Thumbnail height.
"""
ID = 0xb0700007
def __init__(self, type: str, id: str, latitude: float, longitude: float, title: str, live_period: int = None, reply_markup=None, input_message_content=None, thumb_url: str = None, thumb_width: int = None, thumb_height: int = None):
self.type = type # string
self.id = id # string
self.latitude = latitude # double
self.longitude = longitude # double
self.title = title # string
self.live_period = live_period # flags.0?int
self.reply_markup = reply_markup # flags.1?InlineKeyboardMarkup
self.input_message_content = input_message_content # flags.2?InputMessageContent
self.thumb_url = thumb_url # flags.3?string
self.thumb_width = thumb_width # flags.4?int
self.thumb_height = thumb_height # flags.5?int

View File

@ -0,0 +1,80 @@
# Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2018 Dan Tès <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Pyrogram is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
from pyrogram.api.core import Object
class InlineQueryResultMpeg4Gif(Object):
"""Represents a link to a video animation (H.264/MPEG-4 AVC video without sound). By default, this animated MPEG-4 file will be sent by the user with optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the animation.
Attributes:
ID: ``0xb0700002``
Args:
type (``str``):
Type of the result, must be mpeg4_gif.
id (``str``):
Unique identifier for this result, 1-64 bytes.
mpeg4_url (``str``):
A valid URL for the MP4 file. File size must not exceed 1MB.
thumb_url (``str``, optional):
Video width.
mpeg4_width (``int`` ``32-bit``, optional):
Video height.
mpeg4_height (``int`` ``32-bit``, optional):
Video duration.
mpeg4_duration (``int`` ``32-bit``):
URL of the static thumbnail (jpeg or gif) for the result.
title (``str``, optional):
Title for the result.
caption (``str``, optional):
Caption of the MPEG-4 file to be sent, 0-200 characters.
parse_mode (``str``, optional):
Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
reply_markup (:obj:`InlineKeyboardMarkup <pyrogram.types.InlineKeyboardMarkup>`, optional):
Inline keyboard attached to the message.
input_message_content (:obj:`InputMessageContent <pyrogram.types.InputMessageContent>`, optional):
Content of the message to be sent instead of the video animation.
"""
ID = 0xb0700002
def __init__(self, type: str, id: str, mpeg4_url: str, thumb_url: str, mpeg4_width: int = None, mpeg4_height: int = None, mpeg4_duration: int = None, title: str = None, caption: str = None, parse_mode: str = None, reply_markup=None, input_message_content=None):
self.type = type # string
self.id = id # string
self.mpeg4_url = mpeg4_url # string
self.mpeg4_width = mpeg4_width # flags.0?int
self.mpeg4_height = mpeg4_height # flags.1?int
self.mpeg4_duration = mpeg4_duration # flags.2?int
self.thumb_url = thumb_url # string
self.title = title # flags.3?string
self.caption = caption # flags.4?string
self.parse_mode = parse_mode # flags.5?string
self.reply_markup = reply_markup # flags.6?InlineKeyboardMarkup
self.input_message_content = input_message_content # flags.7?InputMessageContent

View File

@ -0,0 +1,80 @@
# Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2018 Dan Tès <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Pyrogram is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
from pyrogram.api.core import Object
class InlineQueryResultPhoto(Object):
"""Represents a link to a photo. By default, this photo will be sent by the user with optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the photo.
Attributes:
ID: ``0xb0700000``
Args:
type (``str``):
Type of the result, must be photo.
id (``str``):
Unique identifier for this result, 1-64 bytes.
photo_url (``str``):
A valid URL of the photo. Photo must be in jpeg format. Photo size must not exceed 5MB.
thumb_url (``str``):
URL of the thumbnail for the photo.
photo_width (``int`` ``32-bit``, optional):
Width of the photo.
photo_height (``int`` ``32-bit``, optional):
Height of the photo.
title (``str``, optional):
Title for the result.
description (``str``, optional):
Short description of the result.
caption (``str``, optional):
Caption of the photo to be sent, 0-200 characters.
parse_mode (``str``, optional):
Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
reply_markup (:obj:`InlineKeyboardMarkup <pyrogram.types.InlineKeyboardMarkup>`, optional):
Inline keyboard attached to the message.
input_message_content (:obj:`InputMessageContent <pyrogram.types.InputMessageContent>`, optional):
Content of the message to be sent instead of the photo.
"""
ID = 0xb0700000
def __init__(self, type: str, id: str, photo_url: str, thumb_url: str, photo_width: int = None, photo_height: int = None, title: str = None, description: str = None, caption: str = None, parse_mode: str = None, reply_markup=None, input_message_content=None):
self.type = type # string
self.id = id # string
self.photo_url = photo_url # string
self.thumb_url = thumb_url # string
self.photo_width = photo_width # flags.0?int
self.photo_height = photo_height # flags.1?int
self.title = title # flags.2?string
self.description = description # flags.3?string
self.caption = caption # flags.4?string
self.parse_mode = parse_mode # flags.5?string
self.reply_markup = reply_markup # flags.6?InlineKeyboardMarkup
self.input_message_content = input_message_content # flags.7?InputMessageContent

View File

@ -0,0 +1,84 @@
# Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2018 Dan Tès <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Pyrogram is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
from pyrogram.api.core import Object
class InlineQueryResultVenue(Object):
"""Represents a venue. By default, the venue will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the venue.
Attributes:
ID: ``0xb0700008``
Args:
type (``str``):
Type of the result, must be venue.
id (``str``):
Unique identifier for this result, 1-64 Bytes.
latitude (``float`` ``64-bit``):
Latitude of the venue location in degrees.
longitude (``float`` ``64-bit``):
Longitude of the venue location in degrees.
title (``str``):
Title of the venue.
address (``str``):
Address of the venue.
foursquare_id (``str``, optional):
Foursquare identifier of the venue if known.
foursquare_type (``str``, optional):
Foursquare type of the venue, if known. (For example, "arts_entertainment/default", "arts_entertainment/aquarium" or "food/icecream".).
reply_markup (:obj:`InlineKeyboardMarkup <pyrogram.types.InlineKeyboardMarkup>`, optional):
Inline keyboard attached to the message.
input_message_content (:obj:`InputMessageContent <pyrogram.types.InputMessageContent>`, optional):
Content of the message to be sent instead of the venue.
thumb_url (``str``, optional):
Url of the thumbnail for the result.
thumb_width (``int`` ``32-bit``, optional):
Thumbnail width.
thumb_height (``int`` ``32-bit``, optional):
Thumbnail height.
"""
ID = 0xb0700008
def __init__(self, type: str, id: str, latitude: float, longitude: float, title: str, address: str, foursquare_id: str = None, foursquare_type: str = None, reply_markup=None, input_message_content=None, thumb_url: str = None, thumb_width: int = None, thumb_height: int = None):
self.type = type # string
self.id = id # string
self.latitude = latitude # double
self.longitude = longitude # double
self.title = title # string
self.address = address # string
self.foursquare_id = foursquare_id # flags.0?string
self.foursquare_type = foursquare_type # flags.1?string
self.reply_markup = reply_markup # flags.2?InlineKeyboardMarkup
self.input_message_content = input_message_content # flags.3?InputMessageContent
self.thumb_url = thumb_url # flags.4?string
self.thumb_width = thumb_width # flags.5?int
self.thumb_height = thumb_height # flags.6?int

View File

@ -0,0 +1,88 @@
# Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2018 Dan Tès <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Pyrogram is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
from pyrogram.api.core import Object
class InlineQueryResultVideo(Object):
"""Represents a link to a page containing an embedded video player or a video file. By default, this video file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the video.
Attributes:
ID: ``0xb0700003``
Args:
type (``str``):
Type of the result, must be video.
id (``str``):
Unique identifier for this result, 1-64 bytes.
video_url (``str``):
A valid URL for the embedded video player or video file.
mime_type (``str``):
Mime type of the content of video url, "text/html" or "video/mp4".
thumb_url (``str``):
URL of the thumbnail (jpeg only) for the video.
title (``str``):
Title for the result.
caption (``str``, optional):
Caption of the video to be sent, 0-200 characters.
parse_mode (``str``, optional):
Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
video_width (``int`` ``32-bit``, optional):
Video width.
video_height (``int`` ``32-bit``, optional):
Video height.
video_duration (``int`` ``32-bit``, optional):
Video duration in seconds.
description (``str``, optional):
Short description of the result.
reply_markup (:obj:`InlineKeyboardMarkup <pyrogram.types.InlineKeyboardMarkup>`, optional):
Inline keyboard attached to the message.
input_message_content (:obj:`InputMessageContent <pyrogram.types.InputMessageContent>`, optional):
Content of the message to be sent instead of the video. This field is required if InlineQueryResultVideo is used to send an HTML-page as a result (e.g., a YouTube video).
"""
ID = 0xb0700003
def __init__(self, type: str, id: str, video_url: str, mime_type: str, thumb_url: str, title: str, caption: str = None, parse_mode: str = None, video_width: int = None, video_height: int = None, video_duration: int = None, description: str = None, reply_markup=None, input_message_content=None):
self.type = type # string
self.id = id # string
self.video_url = video_url # string
self.mime_type = mime_type # string
self.thumb_url = thumb_url # string
self.title = title # string
self.caption = caption # flags.0?string
self.parse_mode = parse_mode # flags.1?string
self.video_width = video_width # flags.2?int
self.video_height = video_height # flags.3?int
self.video_duration = video_duration # flags.4?int
self.description = description # flags.5?string
self.reply_markup = reply_markup # flags.6?InlineKeyboardMarkup
self.input_message_content = input_message_content # flags.7?InputMessageContent

View File

@ -0,0 +1,68 @@
# Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2018 Dan Tès <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Pyrogram is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
from pyrogram.api.core import Object
class InlineQueryResultVoice(Object):
"""Represents a link to a voice recording in an .ogg container encoded with OPUS. By default, this voice recording will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the the voice message.
Attributes:
ID: ``0xb0700005``
Args:
type (``str``):
Type of the result, must be voice.
id (``str``):
Unique identifier for this result, 1-64 bytes.
voice_url (``str``):
A valid URL for the voice recording.
title (``str``):
Recording title.
caption (``str``, optional):
Caption, 0-200 characters.
parse_mode (``str``, optional):
Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
voice_duration (``int`` ``32-bit``, optional):
Recording duration in seconds.
reply_markup (:obj:`InlineKeyboardMarkup <pyrogram.types.InlineKeyboardMarkup>`, optional):
Inline keyboard attached to the message.
input_message_content (:obj:`InputMessageContent <pyrogram.types.InputMessageContent>`, optional):
Content of the message to be sent instead of the voice recording.
"""
ID = 0xb0700005
def __init__(self, type: str, id: str, voice_url: str, title: str, caption: str = None, parse_mode: str = None, voice_duration: int = None, reply_markup=None, input_message_content=None):
self.type = type # string
self.id = id # string
self.voice_url = voice_url # string
self.title = title # string
self.caption = caption # flags.0?string
self.parse_mode = parse_mode # flags.1?string
self.voice_duration = voice_duration # flags.2?int
self.reply_markup = reply_markup # flags.3?InlineKeyboardMarkup
self.input_message_content = input_message_content # flags.4?InputMessageContent