Skip to content

Commit 56e79c1

Browse files
authored
Fix captions being None when editing media message (pyrogram#617)
* added missing doc string * Fix for "None" for default caption
1 parent 3be981a commit 56e79c1

File tree

6 files changed

+16
-13
lines changed

6 files changed

+16
-13
lines changed

pyrogram/types/input_media/input_media.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class InputMedia(Object):
3737
def __init__(
3838
self,
3939
media: str,
40-
caption: str = None,
40+
caption: str = "",
4141
parse_mode: str = None,
4242
caption_entities: List[MessageEntity] = None
4343
):

pyrogram/types/input_media/input_media_animation.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ class InputMediaAnimation(InputMedia):
2929
media (``str``):
3030
Animation to send.
3131
Pass a file_id as string to send a file that exists on the Telegram servers or
32-
pass a file path as string to upload a new file that exists on your local machine.
32+
pass a file path as string to upload a new file that exists on your local machine or
33+
pass an HTTP URL as a string for Telegram to get an animation from the Internet.
3334
3435
thumb (``str``, *optional*):
3536
Thumbnail of the animation file sent.
@@ -65,7 +66,7 @@ def __init__(
6566
self,
6667
media: str,
6768
thumb: str = None,
68-
caption: str = None,
69+
caption: str = "",
6970
parse_mode: Optional[str] = object,
7071
caption_entities: List[MessageEntity] = None,
7172
width: int = 0,

pyrogram/types/input_media/input_media_audio.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ class InputMediaAudio(InputMedia):
3131
media (``str``):
3232
Audio to send.
3333
Pass a file_id as string to send an audio that exists on the Telegram servers or
34-
pass a file path as string to upload a new audio that exists on your local machine.
34+
pass a file path as string to upload a new audio that exists on your local machine or
35+
pass an HTTP URL as a string for Telegram to get an audio file from the Internet.
3536
3637
thumb (``str``, *optional*):
3738
Thumbnail of the music file album cover.
@@ -67,7 +68,7 @@ def __init__(
6768
self,
6869
media: str,
6970
thumb: str = None,
70-
caption: str = None,
71+
caption: str = "",
7172
parse_mode: Optional[str] = object,
7273
caption_entities: List[MessageEntity] = None,
7374
duration: int = 0,

pyrogram/types/input_media/input_media_document.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ class InputMediaDocument(InputMedia):
2929
media (``str``):
3030
File to send.
3131
Pass a file_id as string to send a file that exists on the Telegram servers or
32-
pass a file path as string to upload a new file that exists on your local machine.
32+
pass a file path as string to upload a new file that exists on your local machine or
33+
pass an HTTP URL as a string for Telegram to get a file from the Internet.
3334
3435
thumb (``str``):
3536
Thumbnail of the file sent.
@@ -56,7 +57,7 @@ def __init__(
5657
self,
5758
media: str,
5859
thumb: str = None,
59-
caption: str = None,
60+
caption: str = "",
6061
parse_mode: Optional[str] = object,
6162
caption_entities: List[MessageEntity] = None
6263
):

pyrogram/types/input_media/input_media_photo.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ class InputMediaPhoto(InputMedia):
3030
media (``str``):
3131
Photo to send.
3232
Pass a file_id as string to send a photo that exists on the Telegram servers or
33-
pass a file path as string to upload a new photo that exists on your local machine.
34-
Sending photo by a URL is currently unsupported.
33+
pass a file path as string to upload a new photo that exists on your local machine or
34+
pass an HTTP URL as a string for Telegram to get a photo from the Internet.
3535
3636
caption (``str``, *optional*):
3737
Caption of the photo to be sent, 0-1024 characters.
@@ -51,7 +51,7 @@ class InputMediaPhoto(InputMedia):
5151
def __init__(
5252
self,
5353
media: str,
54-
caption: str = None,
54+
caption: str = "",
5555
parse_mode: Optional[str] = object,
5656
caption_entities: List[MessageEntity] = None
5757
):

pyrogram/types/input_media/input_media_video.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ class InputMediaVideo(InputMedia):
3030
media (``str``):
3131
Video to send.
3232
Pass a file_id as string to send a video that exists on the Telegram servers or
33-
pass a file path as string to upload a new video that exists on your local machine.
34-
Sending video by a URL is currently unsupported.
33+
pass a file path as string to upload a new video that exists on your local machine or
34+
pass an HTTP URL as a string for Telegram to get a video from the Internet.
3535
3636
thumb (``str``):
3737
Thumbnail of the video sent.
@@ -70,7 +70,7 @@ def __init__(
7070
self,
7171
media: str,
7272
thumb: str = None,
73-
caption: str = None,
73+
caption: str = "",
7474
parse_mode: Optional[str] = object,
7575
caption_entities: List[MessageEntity] = None,
7676
width: int = 0,

0 commit comments

Comments
 (0)