Link Search Menu Expand Document

Method: bots.editPreviewMedia

Back to methods index

Edit a main mini app preview, see here » for more info.

Only owners of bots with a configured Main Mini App can use this method, see see here » for more info on how to check if you can invoke this method.

Parameters:

NameTypeDescriptionRequired
botUsername, chat ID, Update, Message or InputUserThe bot that owns the Main Mini App.Optional
lang_codestringISO 639-1 language code, indicating the localization of the preview to edit.Optional
mediaMessageMedia, Update, Message or InputMediaThe photo/video preview to replace, previously fetched as specified here ».Optional
new_mediaMessageMedia, Update, Message or InputMediaThe new photo/video preview, uploaded using messages.uploadMedia.Optional

Return type: BotPreviewMedia

Can userbots use this method: YES

Can bots use this method: NO

MadelineProto Example (now async for huge speed and parallelism!):

if (!file_exists('madeline.php')) {
    copy('https://phar.madelineproto.xyz/madeline.php', 'madeline.php');
}
include 'madeline.php';

$MadelineProto = new \danog\MadelineProto\API('session.madeline');
$MadelineProto->start();

$BotPreviewMedia = $MadelineProto->bots->editPreviewMedia(bot: $InputUser, lang_code: 'string', media: $InputMedia, new_media: $InputMedia, );