Skip to main content

edit_media

Edits the media of a message.

async def edit_media(
self: "swibots.ApiClient",
message_id: Optional[int] = None,
media_id: Optional[int] = None,
message: Optional[str] = None,
document: Optional[str] = None,
thumb: Optional[str] = None,
inline_markup: InlineMarkup = None,
progress=None,
progress_args: Optional[Tuple] = None,
mime_type: Optional[str] = None,
file_name: Optional[str] = None,
) -> Message:

Parameters

ParameterTypeDescription
message_idOptional[int]The ID of the message to edit.
media_idOptional[int]The ID of the media to update.
messageOptional[str]The new message or caption.
documentOptional[str]The path to the new media file.
thumbOptional[str]The path to the new thumbnail file.
inline_markupInlineMarkup, optionalThe new inline markup for the message.
progresstype, optionalA callback function to be called during the upload progress.
progress_argsOptional[Tuple], optionalArguments to be passed to the progress callback.
mime_typeOptional[str], optionalThe MIME type of the new media file.
file_nameOptional[str], optionalThe name of the new media file.

Returns

TypeDescription
MediaThe edited message.

Example

message_id = 1111

await client.edit_media(
message_id=message_id,
document="file.pdf",
thumb="image.png"
)