mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-27 12:28:09 +00:00
Remove generated inline query result types
This commit is contained in:
parent
7490f6cfa3
commit
e4a6d16cf3
@ -1,72 +0,0 @@
|
||||
# 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.client.types.object 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``
|
||||
|
||||
Parameters:
|
||||
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`, optional):
|
||||
Inline keyboard attached to the message.
|
||||
|
||||
input_message_content (:obj:`InputMessageContent`, optional):
|
||||
Content of the message to be sent instead of the audio.
|
||||
|
||||
"""
|
||||
|
||||
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
|
@ -1,103 +0,0 @@
|
||||
# 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/>.
|
||||
|
||||
import binascii
|
||||
import struct
|
||||
|
||||
from pyrogram.api import types
|
||||
from pyrogram.client.ext import utils, BaseClient
|
||||
from pyrogram.client.style import HTML, Markdown
|
||||
from pyrogram.client.types.object import Object
|
||||
from pyrogram.errors import FileIdInvalid
|
||||
|
||||
|
||||
class InlineQueryResultCachedAudio(Object):
|
||||
"""Represents a link to an 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.
|
||||
|
||||
Parameters:
|
||||
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.
|
||||
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
id: str,
|
||||
audio_file_id: str,
|
||||
caption: str = "",
|
||||
parse_mode: str = "",
|
||||
reply_markup=None,
|
||||
input_message_content=None
|
||||
):
|
||||
self.id = id
|
||||
self.audio_file_id = audio_file_id
|
||||
self.caption = caption
|
||||
self.parse_mode = parse_mode
|
||||
self.reply_markup = reply_markup
|
||||
self.input_message_content = input_message_content
|
||||
|
||||
self.style = HTML() if parse_mode.lower() == "html" else Markdown()
|
||||
|
||||
def write(self):
|
||||
try:
|
||||
decoded = utils.decode(self.audio_file_id)
|
||||
fmt = "<iiqqqqi" if len(decoded) > 24 else "<iiqq"
|
||||
unpacked = struct.unpack(fmt, decoded)
|
||||
except (AssertionError, binascii.Error, struct.error):
|
||||
raise FileIdInvalid from None
|
||||
else:
|
||||
if unpacked[0] != 9:
|
||||
media_type = BaseClient.MEDIA_TYPE_ID.get(unpacked[0], None)
|
||||
|
||||
if media_type:
|
||||
raise FileIdInvalid("The file_id belongs to a {}".format(media_type))
|
||||
else:
|
||||
raise FileIdInvalid("Unknown media type: {}".format(unpacked[0]))
|
||||
|
||||
audio = types.InputDocument(
|
||||
id=unpacked[2],
|
||||
access_hash=unpacked[3]
|
||||
)
|
||||
|
||||
return types.InputBotInlineResultDocument(
|
||||
id=self.id,
|
||||
type="audio",
|
||||
document=audio,
|
||||
send_message=types.InputBotInlineMessageMediaAuto(
|
||||
reply_markup=self.reply_markup.write() if self.reply_markup else None,
|
||||
**self.style.parse(self.caption)
|
||||
)
|
||||
)
|
@ -1,69 +0,0 @@
|
||||
# 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.client.types.object 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``
|
||||
|
||||
Parameters:
|
||||
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`, optional):
|
||||
Inline keyboard attached to the message.
|
||||
|
||||
input_message_content (:obj:`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
|
@ -1,65 +0,0 @@
|
||||
# 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.client.types.object 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``
|
||||
|
||||
Parameters:
|
||||
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`, optional):
|
||||
Inline keyboard attached to the message.
|
||||
|
||||
input_message_content (:obj:`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
|
@ -1,65 +0,0 @@
|
||||
# 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.client.types.object 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``
|
||||
|
||||
Parameters:
|
||||
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`, 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
|
@ -1,69 +0,0 @@
|
||||
# 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.client.types.object 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``
|
||||
|
||||
Parameters:
|
||||
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
|
@ -1,52 +0,0 @@
|
||||
# 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.client.types.object 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``
|
||||
|
||||
Parameters:
|
||||
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`, optional):
|
||||
Inline keyboard attached to the message.
|
||||
|
||||
input_message_content (:obj:`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
|
@ -1,69 +0,0 @@
|
||||
# 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.client.types.object 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``
|
||||
|
||||
Parameters:
|
||||
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
|
@ -1,65 +0,0 @@
|
||||
# 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.client.types.object 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``
|
||||
|
||||
Parameters:
|
||||
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`, optional):
|
||||
Inline keyboard attached to the message.
|
||||
|
||||
input_message_content (:obj:`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
|
@ -1,78 +0,0 @@
|
||||
# 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.client.types.object 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``
|
||||
|
||||
Parameters:
|
||||
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
|
@ -1,86 +0,0 @@
|
||||
# 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.client.types.object 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``
|
||||
|
||||
Parameters:
|
||||
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`, optional):
|
||||
Inline keyboard attached to the message.
|
||||
|
||||
input_message_content (:obj:`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
|
@ -1,48 +0,0 @@
|
||||
# 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.client.types.object import Object
|
||||
|
||||
|
||||
class InlineQueryResultGame(Object):
|
||||
"""Represents a Game.
|
||||
|
||||
Attributes:
|
||||
ID: ``0xb0700010``
|
||||
|
||||
Parameters:
|
||||
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`, 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
|
@ -1,82 +0,0 @@
|
||||
# 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.client.types.object 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``
|
||||
|
||||
Parameters:
|
||||
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
|
@ -1,78 +0,0 @@
|
||||
# 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.client.types.object 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``
|
||||
|
||||
Parameters:
|
||||
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
|
@ -1,82 +0,0 @@
|
||||
# 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.client.types.object 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``
|
||||
|
||||
Parameters:
|
||||
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
|
@ -1,126 +0,0 @@
|
||||
# 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 import types
|
||||
from pyrogram.client.style import HTML, Markdown
|
||||
from pyrogram.client.types.object 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.
|
||||
|
||||
Parameters:
|
||||
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``, *optional*):
|
||||
Width of the photo.
|
||||
|
||||
photo_height (``int``, *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`, *optional*):
|
||||
Inline keyboard attached to the message.
|
||||
|
||||
input_message_content (:obj:`InputMessageContent`, *optional*):
|
||||
Content of the message to be sent instead of the photo.
|
||||
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
id: str,
|
||||
photo_url: str,
|
||||
thumb_url: str,
|
||||
photo_width: int = 0,
|
||||
photo_height: int = 0,
|
||||
title: str = None,
|
||||
description: str = None,
|
||||
caption: str = "",
|
||||
parse_mode: str = "",
|
||||
reply_markup=None,
|
||||
input_message_content=None
|
||||
):
|
||||
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
|
||||
|
||||
self.style = HTML() if parse_mode.lower() == "html" else Markdown()
|
||||
|
||||
def write(self):
|
||||
return types.InputBotInlineResult(
|
||||
id=self.id,
|
||||
type="photo",
|
||||
send_message=types.InputBotInlineMessageMediaAuto(
|
||||
reply_markup=self.reply_markup.write() if self.reply_markup else None,
|
||||
**self.style.parse(self.caption)
|
||||
),
|
||||
title=self.title,
|
||||
description=self.description,
|
||||
url=self.photo_url,
|
||||
thumb=types.InputWebDocument(
|
||||
url=self.thumb_url,
|
||||
size=0,
|
||||
mime_type="image/jpeg",
|
||||
attributes=[
|
||||
types.DocumentAttributeImageSize(
|
||||
w=0,
|
||||
h=0
|
||||
)
|
||||
]
|
||||
),
|
||||
content=types.InputWebDocument(
|
||||
url=self.thumb_url,
|
||||
size=0,
|
||||
mime_type="image/jpeg",
|
||||
attributes=[
|
||||
types.DocumentAttributeImageSize(
|
||||
w=self.photo_width,
|
||||
h=self.photo_height
|
||||
)
|
||||
]
|
||||
)
|
||||
)
|
@ -1,86 +0,0 @@
|
||||
# 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.client.types.object 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``
|
||||
|
||||
Parameters:
|
||||
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`, optional):
|
||||
Inline keyboard attached to the message.
|
||||
|
||||
input_message_content (:obj:`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
|
@ -1,90 +0,0 @@
|
||||
# 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.client.types.object 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``
|
||||
|
||||
Parameters:
|
||||
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`, optional):
|
||||
Inline keyboard attached to the message.
|
||||
|
||||
input_message_content (:obj:`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
|
@ -1,69 +0,0 @@
|
||||
# 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.client.types.object 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``
|
||||
|
||||
Parameters:
|
||||
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`, optional):
|
||||
Inline keyboard attached to the message.
|
||||
|
||||
input_message_content (:obj:`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
|
Loading…
x
Reference in New Issue
Block a user