Closed christophrumpel closed 7 years ago
Merging #6 into master will increase coverage by
0.61%
. The diff coverage is100%
.
@@ Coverage Diff @@
## master #6 +/- ##
============================================
+ Coverage 79.54% 80.15% +0.61%
- Complexity 231 236 +5
============================================
Files 25 26 +1
Lines 611 630 +19
============================================
+ Hits 486 505 +19
Misses 125 125
Impacted Files | Coverage Δ | Complexity Δ | |
---|---|---|---|
src/FacebookDriver.php | 85.15% <100%> (ø) |
41 <0> (-2) |
:arrow_down: |
src/FacebookUser.php | 100% <100%> (ø) |
7 <7> (?) |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 1f6065b...427b68d. Read the comment docs.
@christophrumpel can you create a new FacebookUser object that gives access to the new fields? It can just extend the normal user object.
There you go. Here is an example on how to test it.
PS: Is there a way that the IDE knows about the FB specific methods too? (see image attached)
// Simple respond method
$botman->hears('Hello', function (BotMan $bot) {
$user = $bot->getUser();
$bot->reply('Hi there :)'
. ' Firstname: '. $bot->getUser()->getFirstName()
. ' lastname: '. $bot->getUser()->getLastName()
. ' Profile Pic: '. json_encode($bot->getUser()->getProfilePic())
. ' Locale: '. $bot->getUser()->getLocale()
. ' timezone: '. $bot->getUser()->getTimezone()
. ' gender: '. $bot->getUser()->getGender()
. ' getIsPaymentEnabled: '. $bot->getUser()->getIsPaymentEnabled()
. ' getLastAdReferral: '. json_encode($bot->getUser()->getLastAdReferral()));
});
Love it, thank you!
This PR adds all the available FB user info to the new user_info property.