-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add getUserProfilePhotos method #35
add getUserProfilePhotos method #35
Conversation
Codecov Report
@@ Coverage Diff @@
## master #35 +/- ##
============================================
- Coverage 77.68% 74.48% -3.21%
- Complexity 116 121 +5
============================================
Files 11 11
Lines 372 388 +16
============================================
Hits 289 289
- Misses 83 99 +16
Continue to review full report at Codecov.
|
@feralheart Thank you for the PR. Hm I wonder if we should add this to the Telegram User object. |
@mpociot You're welcome. I thinked about it, too, but I didn't want to break the |
I don't think that we break it. The Telegram driver already has a custom user object that gets returned: https://github.com/botman/driver-telegram/blob/master/src/Extensions/User.php |
It's a good idea. I will do it :) |
if ($responsePhotoFile->getStatusCode() !== 200) { | ||
throw new TelegramException('Error retrieving user photos info: '.$responseDataPhotoFile['description']); | ||
} | ||
$userProfilePhotoPaths[] = 'https://api.telegram.org/file/bot'.env('TELEGRAM_TOKEN').'/'.$responseDataPhotoFile['result']['file_path']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Environment variable 'TELEGRAM_TOKEN' is hardcoded here. Maybe it is better to retrieve the token from $this->config?
@mpociot so? Merge maybe? |
@feralheart any upd? |
Move this to the User object, replace the env() call with $this->config() and I'll approve it. |
I made these changes for the Issue #33
Documentation: