Remove url uploading from send_story/edit_story

This commit is contained in:
KurimuzonAkuma 2023-11-30 10:34:05 +03:00
parent ad74313a17
commit 0818572e8c
2 changed files with 0 additions and 26 deletions

View File

@ -49,8 +49,6 @@ class EditStory:
.. include:: /_includes/usable-by/users.rst
Note: You must pass one of following paramater *animation*, *photo*, *video*
Parameters:
chat_id (``int`` | ``str``):
Unique identifier (int) or username (str) of the target chat.
@ -60,7 +58,6 @@ class EditStory:
media (``str`` | ``BinaryIO``, *optional*):
Video or photo to send.
Pass a file_id as string to send a animation that exists on the Telegram servers,
pass an HTTP URL as a string for Telegram to get a animation from the Internet,
pass a file path as string to upload a new animation that exists on your local machine, or
pass a binary file-like object with its attribute ".name" set for in-memory uploads.
@ -159,16 +156,6 @@ class EditStory:
media = raw.types.InputMediaUploadedPhoto(
file=file,
)
elif re.match("^https?://", media):
mime_type = self.guess_mime_type(media)
if mime_type == "video/mp4":
media = raw.types.InputMediaDocumentExternal(
url=media,
)
else:
media = raw.types.InputMediaPhotoExternal(
url=media,
)
else:
media = utils.get_input_media_from_file_id(media)
else:

View File

@ -51,8 +51,6 @@ class SendStory:
.. include:: /_includes/usable-by/users.rst
Note: You must pass one of following paramater *animation*, *photo*, *video*
Parameters:
chat_id (``int`` | ``str``):
Unique identifier (int) or username (str) of the target chat.
@ -61,7 +59,6 @@ class SendStory:
media (``str`` | ``BinaryIO``):
Video or photo to send.
Pass a file_id as string to send a animation that exists on the Telegram servers,
pass an HTTP URL as a string for Telegram to get a animation from the Internet,
pass a file path as string to upload a new animation that exists on your local machine, or
pass a binary file-like object with its attribute ".name" set for in-memory uploads.
@ -168,16 +165,6 @@ class SendStory:
media = raw.types.InputMediaUploadedPhoto(
file=file,
)
elif re.match("^https?://", media):
mime_type = self.guess_mime_type(media)
if mime_type == "video/mp4":
media = raw.types.InputMediaDocumentExternal(
url=media,
)
else:
media = raw.types.InputMediaPhotoExternal(
url=media,
)
else:
media = utils.get_input_media_from_file_id(media)
else: