Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions user-information.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- [Retrieve The User-ID](#retrieving-user-id)
- [Retrieve The Username](retrieving-username)
- [Retrieve The Raw User Information](#retrieving-raw-user-information)
- [Caching User Information](#caching-user-information)

## Introduction
BotMan makes it simple to access your chatbot user information. Which user fields are available purely depend on the messaging service you use. Some services offer more information than others do. Yet you can access them using the same API with BotMan.
Expand Down Expand Up @@ -69,4 +70,17 @@ You can access also access the unprocessed raw messaging service user informatio
$user = $bot->getUser();
// Access ID
$info = $user->getInfo();
```

<a id="caching-user-information"></a>
### Caching User Information

BotMan will cache user information for a duration of 30 minutes by default. This is especially useful for drivers like
Facebook where it takes an additional request to retrieve this information. In the BotMan config you are able to
change the duration. You can also set it to zero in order to prevent BotMan from caching the user information at all.

```php
'botman' => [
'user_cache_time' => 30
],
```