diff --git a/telegram/bot.py b/telegram/bot.py index 6aed87118..0b2f74e8c 100644 --- a/telegram/bot.py +++ b/telegram/bot.py @@ -369,7 +369,7 @@ class Bot(TelegramObject): Internet, or upload a new photo using multipart/form-data. Lastly you can pass an existing :class:`telegram.PhotoSize` object to send. caption (:obj:`str`, optional): Photo caption (may also be used when resending photos - by file_id), 0-200 characters. + by file_id), 0-1024 characters. parse_mode (:obj:`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. See the constants in :class:`telegram.ParseMode` for the available modes. @@ -442,7 +442,7 @@ class Bot(TelegramObject): (recommended), pass an HTTP URL as a String for Telegram to get an audio file from the Internet, or upload a new one using multipart/form-data. Lastly you can pass an existing :class:`telegram.Audio` object to send. - caption (:obj:`str`, optional): Audio caption, 0-200 characters. + caption (:obj:`str`, optional): Audio caption, 0-1024 characters. parse_mode (:obj:`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. See the constants in :class:`telegram.ParseMode` for the available modes. @@ -527,7 +527,7 @@ class Bot(TelegramObject): filename (:obj:`str`, optional): File name that shows in telegram message (it is useful when you send file generated by temp module, for example). Undocumented. caption (:obj:`str`, optional): Document caption (may also be used when resending - documents by file_id), 0-200 characters. + documents by file_id), 0-1024 characters. parse_mode (:obj:`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. See the constants in :class:`telegram.ParseMode` for the available modes. @@ -661,7 +661,7 @@ class Bot(TelegramObject): width (:obj:`int`, optional): Video width. height (:obj:`int`, optional): Video height. caption (:obj:`str`, optional): Video caption (may also be used when resending videos - by file_id), 0-200 characters. + by file_id), 0-1024 characters. parse_mode (:obj:`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. See the constants in :class:`telegram.ParseMode` for the available modes. @@ -821,7 +821,7 @@ class Bot(TelegramObject): A thumbnail's width and height should not exceed 90. Ignored if the file is not is passed as a string or file_id. caption (:obj:`str`, optional): Animation caption (may also be used when resending - animations by file_id), 0-200 characters. + animations by file_id), 0-1024 characters. parse_mode (:obj:`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. See the constants in :class:`telegram.ParseMode` for the available modes. @@ -898,7 +898,7 @@ class Bot(TelegramObject): (recommended), pass an HTTP URL as a String for Telegram to get an voice file from the Internet, or upload a new one using multipart/form-data. Lastly you can pass an existing :class:`telegram.Voice` object to send. - caption (:obj:`str`, optional): Voice message caption, 0-200 characters. + caption (:obj:`str`, optional): Voice message caption, 0-1024 characters. parse_mode (:obj:`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. See the constants in :class:`telegram.ParseMode` for the available modes. diff --git a/telegram/constants.py b/telegram/constants.py index d386382b7..9bb20940e 100644 --- a/telegram/constants.py +++ b/telegram/constants.py @@ -21,7 +21,7 @@ The following constants were extracted from the Attributes: MAX_MESSAGE_LENGTH (:obj:`int`): 4096 - MAX_CAPTION_LENGTH (:obj:`int`): 200 + MAX_CAPTION_LENGTH (:obj:`int`): 1024 SUPPORTED_WEBHOOK_PORTS (List[:obj:`int`]): [443, 80, 88, 8443] MAX_FILESIZE_DOWNLOAD (:obj:`int`): In bytes (20MB) MAX_FILESIZE_UPLOAD (:obj:`int`): In bytes (50MB) @@ -40,7 +40,7 @@ Attributes: """ MAX_MESSAGE_LENGTH = 4096 -MAX_CAPTION_LENGTH = 200 +MAX_CAPTION_LENGTH = 1024 # constants above this line are tested diff --git a/telegram/files/inputmedia.py b/telegram/files/inputmedia.py index b6398727d..5bac800f1 100644 --- a/telegram/files/inputmedia.py +++ b/telegram/files/inputmedia.py @@ -44,7 +44,7 @@ class InputMediaAnimation(InputMedia): file sent. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 90. Ignored if the file is not is passed as a string or file_id. - caption (:obj:`str`): Optional. Caption of the animation to be sent, 0-200 characters. + caption (:obj:`str`): Optional. Caption of the animation to be sent, 0-1024 characters. parse_mode (:obj:`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. See the constants in :class:`telegram.ParseMode` for the available modes. @@ -61,7 +61,7 @@ class InputMediaAnimation(InputMedia): file sent. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 90. Ignored if the file is not is passed as a string or file_id. - caption (:obj:`str`, optional): Caption of the animation to be sent, 0-200 characters. + caption (:obj:`str`, optional): Caption of the animation to be sent, 0-1024 characters. parse_mode (:obj:`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. See the constants in :class:`telegram.ParseMode` for the available modes. @@ -114,7 +114,7 @@ class InputMediaPhoto(InputMedia): media (:obj:`str`): File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet. Lastly you can pass an existing :class:`telegram.PhotoSize` object to send. - caption (:obj:`str`): Optional. Caption of the photo to be sent, 0-200 characters. + caption (:obj:`str`): Optional. Caption of the photo to be sent, 0-1024 characters. parse_mode (:obj:`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. See the constants in :class:`telegram.ParseMode` for the available modes. @@ -123,7 +123,7 @@ class InputMediaPhoto(InputMedia): media (:obj:`str`): File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet. Lastly you can pass an existing :class:`telegram.PhotoSize` object to send. - caption (:obj:`str`, optional ): Caption of the photo to be sent, 0-200 characters. + caption (:obj:`str`, optional ): Caption of the photo to be sent, 0-1024 characters. parse_mode (:obj:`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. See the constants in :class:`telegram.ParseMode` for the available modes. @@ -153,7 +153,7 @@ class InputMediaVideo(InputMedia): media (:obj:`str`): File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet. Lastly you can pass an existing :class:`telegram.Video` object to send. - caption (:obj:`str`): Optional. Caption of the video to be sent, 0-200 characters. + caption (:obj:`str`): Optional. Caption of the video to be sent, 0-1024 characters. parse_mode (:obj:`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. See the constants in :class:`telegram.ParseMode` for the available modes. @@ -171,7 +171,7 @@ class InputMediaVideo(InputMedia): media (:obj:`str`): File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet. Lastly you can pass an existing :class:`telegram.Video` object to send. - caption (:obj:`str`, optional): Caption of the video to be sent, 0-200 characters. + caption (:obj:`str`, optional): Caption of the video to be sent, 0-1024 characters. parse_mode (:obj:`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. See the constants in :class:`telegram.ParseMode` for the available modes. @@ -232,7 +232,7 @@ class InputMediaAudio(InputMedia): media (:obj:`str`): File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet. Lastly you can pass an existing :class:`telegram.Audio` object to send. - caption (:obj:`str`): Optional. Caption of the audio to be sent, 0-200 characters. + caption (:obj:`str`): Optional. Caption of the audio to be sent, 0-1024 characters. parse_mode (:obj:`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. See the constants in :class:`telegram.ParseMode` for the available modes. @@ -249,7 +249,7 @@ class InputMediaAudio(InputMedia): media (:obj:`str`): File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet. Lastly you can pass an existing :class:`telegram.Document` object to send. - caption (:obj:`str`, optional): Caption of the audio to be sent, 0-200 characters. + caption (:obj:`str`, optional): Caption of the audio to be sent, 0-1024 characters. parse_mode (:obj:`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. See the constants in :class:`telegram.ParseMode` for the available modes. @@ -307,7 +307,7 @@ class InputMediaDocument(InputMedia): media (:obj:`str`): File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet. Lastly you can pass an existing :class:`telegram.Document` object to send. - caption (:obj:`str`): Optional. Caption of the document to be sent, 0-200 characters. + caption (:obj:`str`): Optional. Caption of the document to be sent, 0-1024 characters. parse_mode (:obj:`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. See the constants in :class:`telegram.ParseMode` for the available modes. @@ -320,7 +320,7 @@ class InputMediaDocument(InputMedia): media (:obj:`str`): File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet. Lastly you can pass an existing :class:`telegram.Document` object to send. - caption (:obj:`str`, optional): Caption of the document to be sent, 0-200 characters. + caption (:obj:`str`, optional): Caption of the document to be sent, 0-1024 characters. parse_mode (:obj:`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. See the constants in :class:`telegram.ParseMode` for the available modes. diff --git a/telegram/inline/inlinequeryresultcachedaudio.py b/telegram/inline/inlinequeryresultcachedaudio.py index 221616fbd..d225f4129 100644 --- a/telegram/inline/inlinequeryresultcachedaudio.py +++ b/telegram/inline/inlinequeryresultcachedaudio.py @@ -31,7 +31,7 @@ class InlineQueryResultCachedAudio(InlineQueryResult): type (:obj:`str`): 'audio'. id (:obj:`str`): Unique identifier for this result, 1-64 bytes. audio_file_id (:obj:`str`): A valid file identifier for the audio file. - caption (:obj:`str`): Optional. Caption, 0-200 characters + caption (:obj:`str`): Optional. Caption, 0-1024 characters parse_mode (:obj:`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. See the constants in :class:`telegram.ParseMode` for the available modes. @@ -43,7 +43,7 @@ class InlineQueryResultCachedAudio(InlineQueryResult): Args: id (:obj:`str`): Unique identifier for this result, 1-64 bytes. audio_file_id (:obj:`str`): A valid file identifier for the audio file. - caption (:obj:`str`, optional): Caption, 0-200 characters + caption (:obj:`str`, optional): Caption, 0-1024 characters parse_mode (:obj:`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. See the constants in :class:`telegram.ParseMode` for the available modes. diff --git a/telegram/inline/inlinequeryresultcacheddocument.py b/telegram/inline/inlinequeryresultcacheddocument.py index 49816b522..28606949a 100644 --- a/telegram/inline/inlinequeryresultcacheddocument.py +++ b/telegram/inline/inlinequeryresultcacheddocument.py @@ -33,7 +33,7 @@ class InlineQueryResultCachedDocument(InlineQueryResult): title (:obj:`str`): Title for the result. document_file_id (:obj:`str`): A valid file identifier for the file. description (:obj:`str`): Optional. Short description of the result. - caption (:obj:`str`): Optional. Caption, 0-200 characters + caption (:obj:`str`): Optional. Caption, 0-1024 characters parse_mode (:obj:`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.. See the constants in :class:`telegram.ParseMode` for the available modes. @@ -47,7 +47,7 @@ class InlineQueryResultCachedDocument(InlineQueryResult): title (:obj:`str`): Title for the result. document_file_id (:obj:`str`): A valid file identifier for the file. description (:obj:`str`, optional): Short description of the result. - caption (:obj:`str`, optional): Caption, 0-200 characters + caption (:obj:`str`, optional): Caption, 0-1024 characters parse_mode (:obj:`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.. See the constants in :class:`telegram.ParseMode` for the available modes. diff --git a/telegram/inline/inlinequeryresultcachedgif.py b/telegram/inline/inlinequeryresultcachedgif.py index dd01b33c1..bfdb5bb97 100644 --- a/telegram/inline/inlinequeryresultcachedgif.py +++ b/telegram/inline/inlinequeryresultcachedgif.py @@ -33,7 +33,7 @@ class InlineQueryResultCachedGif(InlineQueryResult): id (:obj:`str`): Unique identifier for this result, 1-64 bytes. gif_file_id (:obj:`str`): A valid file identifier for the GIF file. title (:obj:`str`): Optional. Title for the result. - caption (:obj:`str`): Optional. Caption, 0-200 characters + caption (:obj:`str`): Optional. Caption, 0-1024 characters parse_mode (:obj:`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. See the constants in :class:`telegram.ParseMode` for the available modes. @@ -46,7 +46,7 @@ class InlineQueryResultCachedGif(InlineQueryResult): id (:obj:`str`): Unique identifier for this result, 1-64 bytes. gif_file_id (:obj:`str`): A valid file identifier for the GIF file. title (:obj:`str`, optional): Title for the result.caption (:obj:`str`, optional): - caption (:obj:`str`, optional): Caption, 0-200 characters + caption (:obj:`str`, optional): Caption, 0-1024 characters parse_mode (:obj:`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. See the constants in :class:`telegram.ParseMode` for the available modes. diff --git a/telegram/inline/inlinequeryresultcachedmpeg4gif.py b/telegram/inline/inlinequeryresultcachedmpeg4gif.py index 41f099e9b..4dfbd8d9e 100644 --- a/telegram/inline/inlinequeryresultcachedmpeg4gif.py +++ b/telegram/inline/inlinequeryresultcachedmpeg4gif.py @@ -33,7 +33,7 @@ class InlineQueryResultCachedMpeg4Gif(InlineQueryResult): id (:obj:`str`): Unique identifier for this result, 1-64 bytes. mpeg4_file_id (:obj:`str`): A valid file identifier for the MP4 file. title (:obj:`str`): Optional. Title for the result. - caption (:obj:`str`): Optional. Caption, 0-200 characters + caption (:obj:`str`): Optional. Caption, 0-1024 characters parse_mode (:obj:`str`): Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. See the constants in :class:`telegram.ParseMode` for the available modes. @@ -46,7 +46,7 @@ class InlineQueryResultCachedMpeg4Gif(InlineQueryResult): id (:obj:`str`): Unique identifier for this result, 1-64 bytes. mpeg4_file_id (:obj:`str`): A valid file identifier for the MP4 file. title (:obj:`str`, optional): Title for the result. - caption (:obj:`str`, optional): Caption, 0-200 characters + caption (:obj:`str`, optional): Caption, 0-1024 characters parse_mode (:obj:`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. See the constants in :class:`telegram.ParseMode` for the available modes. diff --git a/telegram/inline/inlinequeryresultcachedphoto.py b/telegram/inline/inlinequeryresultcachedphoto.py index 89b8dad11..dd2c58451 100644 --- a/telegram/inline/inlinequeryresultcachedphoto.py +++ b/telegram/inline/inlinequeryresultcachedphoto.py @@ -34,7 +34,7 @@ class InlineQueryResultCachedPhoto(InlineQueryResult): photo_file_id (:obj:`str`): A valid file identifier of the photo. title (:obj:`str`): Optional. Title for the result. description (:obj:`str`): Optional. Short description of the result. - caption (:obj:`str`): Optional. Caption, 0-200 characters + caption (:obj:`str`): Optional. Caption, 0-1024 characters parse_mode (:obj:`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. See the constants in :class:`telegram.ParseMode` for the available modes. @@ -48,7 +48,7 @@ class InlineQueryResultCachedPhoto(InlineQueryResult): photo_file_id (:obj:`str`): A valid file identifier of the photo. title (:obj:`str`, optional): Title for the result. description (:obj:`str`, optional): Short description of the result. - caption (:obj:`str`, optional): Caption, 0-200 characters + caption (:obj:`str`, optional): Caption, 0-1024 characters parse_mode (:obj:`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. See the constants in :class:`telegram.ParseMode` for the available modes. diff --git a/telegram/inline/inlinequeryresultcachedvideo.py b/telegram/inline/inlinequeryresultcachedvideo.py index 75cd67577..0038adf8c 100644 --- a/telegram/inline/inlinequeryresultcachedvideo.py +++ b/telegram/inline/inlinequeryresultcachedvideo.py @@ -34,7 +34,7 @@ class InlineQueryResultCachedVideo(InlineQueryResult): video_file_id (:obj:`str`): A valid file identifier for the video file. title (:obj:`str`): Title for the result. description (:obj:`str`): Optional. Short description of the result. - caption (:obj:`str`): Optional. Caption, 0-200 characters. + caption (:obj:`str`): Optional. Caption, 0-1024 characters. parse_mode (:obj:`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. See the constants in :class:`telegram.ParseMode` for the available modes. @@ -48,7 +48,7 @@ class InlineQueryResultCachedVideo(InlineQueryResult): video_file_id (:obj:`str`): A valid file identifier for the video file. title (:obj:`str`): Title for the result. description (:obj:`str`, optional): Short description of the result. - caption (:obj:`str`, optional): Caption, 0-200 characters. + caption (:obj:`str`, optional): Caption, 0-1024 characters. parse_mode (:obj:`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. See the constants in :class:`telegram.ParseMode` for the available modes. diff --git a/telegram/inline/inlinequeryresultcachedvoice.py b/telegram/inline/inlinequeryresultcachedvoice.py index 503325c49..687be9bae 100644 --- a/telegram/inline/inlinequeryresultcachedvoice.py +++ b/telegram/inline/inlinequeryresultcachedvoice.py @@ -32,7 +32,7 @@ class InlineQueryResultCachedVoice(InlineQueryResult): id (:obj:`str`): Unique identifier for this result, 1-64 bytes. voice_file_id (:obj:`str`): A valid file identifier for the voice message. title (:obj:`str`): Voice message title. - caption (:obj:`str`): Optional. Caption, 0-200 characters. + caption (:obj:`str`): Optional. Caption, 0-1024 characters. parse_mode (:obj:`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. See the constants in :class:`telegram.ParseMode` for the available modes. @@ -45,7 +45,7 @@ class InlineQueryResultCachedVoice(InlineQueryResult): id (:obj:`str`): Unique identifier for this result, 1-64 bytes. voice_file_id (:obj:`str`): A valid file identifier for the voice message. title (:obj:`str`): Voice message title. - caption (:obj:`str`, optional): Caption, 0-200 characters. + caption (:obj:`str`, optional): Caption, 0-1024 characters. parse_mode (:obj:`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. See the constants in :class:`telegram.ParseMode` for the available modes. diff --git a/telegram/inline/inlinequeryresultdocument.py b/telegram/inline/inlinequeryresultdocument.py index a4584a963..bb480e4d5 100644 --- a/telegram/inline/inlinequeryresultdocument.py +++ b/telegram/inline/inlinequeryresultdocument.py @@ -32,7 +32,7 @@ class InlineQueryResultDocument(InlineQueryResult): type (:obj:`str`): 'document'. id (:obj:`str`): Unique identifier for this result, 1-64 bytes. title (:obj:`str`): Title for the result. - caption (:obj:`str`): Optional. Caption, 0-200 characters + caption (:obj:`str`): Optional. Caption, 0-1024 characters parse_mode (:obj:`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. See the constants in :class:`telegram.ParseMode` for the available modes. @@ -51,7 +51,7 @@ class InlineQueryResultDocument(InlineQueryResult): Args: id (:obj:`str`): Unique identifier for this result, 1-64 bytes. title (:obj:`str`): Title for the result. - caption (:obj:`str`, optional): Caption, 0-200 characters + caption (:obj:`str`, optional): Caption, 0-1024 characters parse_mode (:obj:`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. See the constants in :class:`telegram.ParseMode` for the available modes. diff --git a/telegram/inline/inlinequeryresultgif.py b/telegram/inline/inlinequeryresultgif.py index d8b62c6e5..53b863f06 100644 --- a/telegram/inline/inlinequeryresultgif.py +++ b/telegram/inline/inlinequeryresultgif.py @@ -36,7 +36,7 @@ class InlineQueryResultGif(InlineQueryResult): gif_duration (:obj:`int`): Optional. Duration of the GIF. thumb_url (:obj:`str`): URL of the static thumbnail for the result (jpeg or gif). title (:obj:`str`): Optional. Title for the result. - caption (:obj:`str`): Optional. Caption, 0-200 characters + caption (:obj:`str`): Optional. Caption, 0-1024 characters parse_mode (:obj:`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. See the constants in :class:`telegram.ParseMode` for the available modes. @@ -53,7 +53,7 @@ class InlineQueryResultGif(InlineQueryResult): gif_duration (:obj:`int`, optional): Duration of the GIF thumb_url (:obj:`str`): URL of the static thumbnail for the result (jpeg or gif). title (:obj:`str`, optional): Title for the result.caption (:obj:`str`, optional): - caption (:obj:`str`, optional): Caption, 0-200 characters + caption (:obj:`str`, optional): Caption, 0-1024 characters parse_mode (:obj:`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. See the constants in :class:`telegram.ParseMode` for the available modes. diff --git a/telegram/inline/inlinequeryresultmpeg4gif.py b/telegram/inline/inlinequeryresultmpeg4gif.py index 3459d775b..63610b43a 100644 --- a/telegram/inline/inlinequeryresultmpeg4gif.py +++ b/telegram/inline/inlinequeryresultmpeg4gif.py @@ -37,7 +37,7 @@ class InlineQueryResultMpeg4Gif(InlineQueryResult): mpeg4_duration (:obj:`int`): Optional. Video duration. thumb_url (:obj:`str`): URL of the static thumbnail (jpeg or gif) for the result. title (:obj:`str`): Optional. Title for the result. - caption (:obj:`str`): Optional. Caption, 0-200 characters + caption (:obj:`str`): Optional. Caption, 0-1024 characters parse_mode (:obj:`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. See the constants in :class:`telegram.ParseMode` for the available modes. @@ -54,7 +54,7 @@ class InlineQueryResultMpeg4Gif(InlineQueryResult): mpeg4_duration (:obj:`int`, optional): Video duration. thumb_url (:obj:`str`): URL of the static thumbnail (jpeg or gif) for the result. title (:obj:`str`, optional): Title for the result. - caption (:obj:`str`, optional): Caption, 0-200 characters + caption (:obj:`str`, optional): Caption, 0-1024 characters parse_mode (:obj:`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. See the constants in :class:`telegram.ParseMode` for the available modes. diff --git a/telegram/inline/inlinequeryresultphoto.py b/telegram/inline/inlinequeryresultphoto.py index efaf95fde..243e6f43a 100644 --- a/telegram/inline/inlinequeryresultphoto.py +++ b/telegram/inline/inlinequeryresultphoto.py @@ -37,7 +37,7 @@ class InlineQueryResultPhoto(InlineQueryResult): photo_height (:obj:`int`): Optional. Height of the photo. title (:obj:`str`): Optional. Title for the result. description (:obj:`str`): Optional. Short description of the result. - caption (:obj:`str`): Optional. Caption, 0-200 characters + caption (:obj:`str`): Optional. Caption, 0-1024 characters parse_mode (:obj:`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. See the constants in :class:`telegram.ParseMode` for the available modes. @@ -55,7 +55,7 @@ class InlineQueryResultPhoto(InlineQueryResult): photo_height (:obj:`int`, optional): Height of the photo. title (:obj:`str`, optional): Title for the result. description (:obj:`str`, optional): Short description of the result. - caption (:obj:`str`, optional): Caption, 0-200 characters + caption (:obj:`str`, optional): Caption, 0-1024 characters parse_mode (:obj:`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. See the constants in :class:`telegram.ParseMode` for the available modes. diff --git a/telegram/inline/inlinequeryresultvideo.py b/telegram/inline/inlinequeryresultvideo.py index a21c52509..ac885dee4 100644 --- a/telegram/inline/inlinequeryresultvideo.py +++ b/telegram/inline/inlinequeryresultvideo.py @@ -35,7 +35,7 @@ class InlineQueryResultVideo(InlineQueryResult): mime_type (:obj:`str`): Mime type of the content of video url, "text/html" or "video/mp4". thumb_url (:obj:`str`): URL of the thumbnail (jpeg only) for the video. title (:obj:`str`): Title for the result. - caption (:obj:`str`): Optional. Caption, 0-200 characters + caption (:obj:`str`): Optional. Caption, 0-1024 characters parse_mode (:obj:`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. See the constants in :class:`telegram.ParseMode` for the available modes. @@ -54,7 +54,7 @@ class InlineQueryResultVideo(InlineQueryResult): mime_type (:obj:`str`): Mime type of the content of video url, "text/html" or "video/mp4". thumb_url (:obj:`str`): URL of the thumbnail (jpeg only) for the video. title (:obj:`str`): Title for the result. - caption (:obj:`str`, optional): Caption, 0-200 characters. + caption (:obj:`str`, optional): Caption, 0-1024 characters. parse_mode (:obj:`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. See the constants in :class:`telegram.ParseMode` for the available modes. diff --git a/telegram/inline/inlinequeryresultvoice.py b/telegram/inline/inlinequeryresultvoice.py index 817eca4bc..535d8b6c6 100644 --- a/telegram/inline/inlinequeryresultvoice.py +++ b/telegram/inline/inlinequeryresultvoice.py @@ -33,7 +33,7 @@ class InlineQueryResultVoice(InlineQueryResult): id (:obj:`str`): Unique identifier for this result, 1-64 bytes. voice_url (:obj:`str`): A valid URL for the voice recording. title (:obj:`str`): Voice message title. - caption (:obj:`str`): Optional. Caption, 0-200 characters. + caption (:obj:`str`): Optional. Caption, 0-1024 characters. parse_mode (:obj:`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.. See the constants in :class:`telegram.ParseMode` for the available modes. @@ -47,7 +47,7 @@ class InlineQueryResultVoice(InlineQueryResult): id (:obj:`str`): Unique identifier for this result, 1-64 bytes. voice_url (:obj:`str`): A valid URL for the voice recording. title (:obj:`str`): Voice message title. - caption (:obj:`str`, optional): Caption, 0-200 characters. + caption (:obj:`str`, optional): Caption, 0-1024 characters. parse_mode (:obj:`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.. See the constants in :class:`telegram.ParseMode` for the available modes. diff --git a/telegram/message.py b/telegram/message.py index 9ed3d7746..a8c96dde0 100644 --- a/telegram/message.py +++ b/telegram/message.py @@ -73,7 +73,8 @@ class Message(TelegramObject): video_note (:class:`telegram.VideoNote`): Optional. Information about the video message. new_chat_members (List[:class:`telegram.User`]): Optional. Information about new members to the chat. (the bot itself may be one of these members). - caption (:obj:`str`): Optional. Caption for the document, photo or video, 0-200 characters. + caption (:obj:`str`): Optional. Caption for the document, photo or video, 0-1024 + characters. contact (:class:`telegram.Contact`): Optional. Information about the contact. location (:class:`telegram.Location`): Optional. Information about the location. venue (:class:`telegram.Venue`): Optional. Information about the venue. @@ -154,7 +155,8 @@ class Message(TelegramObject): new_chat_members (List[:class:`telegram.User`], optional): New members that were added to the group or supergroup and information about them (the bot itself may be one of these members). - caption (:obj:`str`, optional): Caption for the document, photo or video, 0-200 characters. + caption (:obj:`str`, optional): Caption for the document, photo or video, 0-1024 + characters. contact (:class:`telegram.Contact`, optional): Message is a shared contact, information about the contact. location (:class:`telegram.Location`, optional): Message is a shared location, information diff --git a/tests/test_constants.py b/tests/test_constants.py index 3f1747bd0..7974c6faa 100644 --- a/tests/test_constants.py +++ b/tests/test_constants.py @@ -29,8 +29,8 @@ class TestConstants(object): def test_max_message_length(self, bot, chat_id): bot.send_message(chat_id=chat_id, text='a' * constants.MAX_MESSAGE_LENGTH) - with pytest.raises(BadRequest, message='MAX_MESSAGE_LENGTH is no longer valid', - match='too long'): + with pytest.raises(BadRequest, match='Message is too long', + message='MAX_MESSAGE_LENGTH is no longer valid'): bot.send_message(chat_id=chat_id, text='a' * (constants.MAX_MESSAGE_LENGTH + 1)) @flaky(3, 1) @@ -42,6 +42,7 @@ class TestConstants(object): assert good_msg.caption == good_caption bad_caption = good_caption + 'Z' - with pytest.raises(BadRequest, message="Media_caption_too_long"): + with pytest.raises(BadRequest, match="Media_caption_too_long", + message='MAX_CAPTION_LENGTH is no longer valid'): with open('tests/data/telegram.png', 'rb') as f: bot.send_photo(photo=f, caption=bad_caption, chat_id=chat_id)