MadelineProto/docs/docs/SELF.md

11 lines
605 B
Markdown
Raw Normal View History

# Getting info about the current user
2018-03-20 13:04:44 +01:00
```php
$me = $MadelineProto->get_self();
\danog\MadelineProto\Logger::log("Hi ".$me['first_name']."!");
```
2018-03-20 16:02:36 +01:00
[`get_self`](https://docs.madelineproto.xyz/get_self.html) returns a [User object](API_docs/types/User.md) that contains info about the currently logged in user/bot, or false if the current instance is not logged in.
2018-03-21 10:53:02 +01:00
<form action="https://docs.madelineproto.xyz/docs/SETTINGS.html"><input type="submit" value="Previous section" /></form><form action="https://docs.madelineproto.xyz/docs/EXCEPTIONS.html"><input type="submit" value="Next section" /></form>