2019-11-16 22:32:05 +02:00
|
|
|
# getMe
|
|
|
|
|
|
|
|
|
|
## Description
|
|
|
|
|
|
|
|
|
|
A simple method for testing your bot's auth token. Requires no parameters. Returns basic information about the bot in form of a User object.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Response
|
|
|
|
|
|
|
|
|
|
Type: `#!python3 User`
|
|
|
|
|
|
|
|
|
|
Description: Returns basic information about the bot in form of a User object.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### As bot method bot
|
|
|
|
|
|
|
|
|
|
```python3
|
|
|
|
|
result: User = await bot.get_me(...)
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### Method as object
|
|
|
|
|
|
|
|
|
|
Imports:
|
|
|
|
|
|
2019-12-11 16:52:21 +02:00
|
|
|
- `from aiogram.methods import GetMe`
|
|
|
|
|
- `from aiogram.api.methods import GetMe`
|
|
|
|
|
- `from aiogram.api.methods.get_me import GetMe`
|
2019-11-16 22:32:05 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
#### With specific bot
|
|
|
|
|
```python3
|
|
|
|
|
result: User = await bot.emit(GetMe(...))
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
#### In handlers with current bot
|
|
|
|
|
```python3
|
|
|
|
|
result: User = await GetMe(...)
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Related pages:
|
|
|
|
|
|
|
|
|
|
- [Official documentation](https://core.telegram.org/bots/api#getme)
|
|
|
|
|
- [aiogram.types.User](../types/user.md)
|