Link Search Menu Expand Document

Method: photos.uploadProfilePhoto

Back to methods index

Updates current user profile photo.

The file, video and video_emoji_markup flags are mutually exclusive.

Parameters:

NameTypeDescriptionRequired
fallbackBoolIf set, the chosen profile photo will be shown to users that can’t display your main profile photo due to your privacy settings.Optional
botUsername, chat ID, Update, Message or InputUserCan contain info of a bot we own, to change the profile photo of that bot, instead of the current user.Optional
fileFile path or InputFileProfile photoOptional
videoFile path or InputFileAnimated profile picture videoOptional
video_start_tsdoubleFloating point UNIX timestamp in seconds, indicating the frame of the video/sticker that should be used as static preview; can only be used if video or video_emoji_markup is set.Optional
video_emoji_markupVideoSizeAnimated sticker profile picture, must contain either a videoSizeEmojiMarkup or a videoSizeStickerMarkup constructor.Optional

Return type: photos.Photo

Can bots use this method: YES

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();

$photos_Photo = $MadelineProto->photos->uploadProfilePhoto(fallback: $Bool, bot: $InputUser, file: $InputFile, video: $InputFile, video_start_ts: $double, video_emoji_markup: $VideoSize, );