Skip to content

Instantly share code, notes, and snippets.

@antimech
Last active November 22, 2023 08:24
Show Gist options
  • Save antimech/31560625c1e375d21a8834d4bab2ae93 to your computer and use it in GitHub Desktop.
Save antimech/31560625c1e375d21a8834d4bab2ae93 to your computer and use it in GitHub Desktop.
BotMan 2.0 + Laravel: Telegram Bot user profile picture snippet. The user have to `/start` the bot first.
<?php
$userId = 16246463;
// Get a list of profile pictures for a user
$userProfilePictures = $this->bot->sendRequest('getUserProfilePhotos', [
'user_id' => $userId,
]);
info($userProfilePictures);
$fileId = 'AgADAgADx7IxG7_m9wABEsX9bK0-UTeLuLcOAARCx8W22ekEAnHtAgABAg';
// Prepare the profile picture file
$profilePictureFile = $this->bot->sendRequest('getFile', [
'file_id' => $fileId
]);
info($profilePictureFile);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment