Method: bots.getPreviewInfo
Bot owners only, fetch main mini app preview information, see here » for more info.
Note: technically non-owners may also invoke this method, but it will always behave exactly as bots.getPreviewMedias, returning only previews for the current language and an empty lang_codes
array, regardless of the passed lang_code
, so please only use bots.getPreviewMedias if you’re not the owner of the bot
.
Parameters:
Name | Type | Description | Required |
---|---|---|---|
bot | Username, chat ID, Update, Message or InputUser | The bot that owns the Main Mini App. | Optional |
lang_code | string | Fetch previews for the specified ISO 639-1 language code. | Optional |
Return type: bots.PreviewInfo
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();
$bots_PreviewInfo = $MadelineProto->bots->getPreviewInfo(bot: $InputUser, lang_code: 'string', );