aiogram/docs/api/methods/send_game.md
2020-01-11 22:59:14 +02:00

64 lines
1.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# sendGame
## Description
Use this method to send a game. On success, the sent Message is returned.
## Arguments
| Name | Type | Description |
| - | - | - |
| `chat_id` | `#!python3 int` | Unique identifier for the target chat |
| `game_short_name` | `#!python3 str` | Short name of the game, serves as the unique identifier for the game. Set up your games via Botfather. |
| `disable_notification` | `#!python3 Optional[bool]` | Optional. Sends the message silently. Users will receive a notification with no sound. |
| `reply_to_message_id` | `#!python3 Optional[int]` | Optional. If the message is a reply, ID of the original message |
| `reply_markup` | `#!python3 Optional[InlineKeyboardMarkup]` | Optional. A JSON-serialized object for an inline keyboard. If empty, one Play game_title button will be shown. If not empty, the first button must launch the game. |
## Response
Type: `#!python3 Message`
Description: On success, the sent Message is returned.
## Usage
### As bot method bot
```python3
result: Message = await bot.send_game(...)
```
### Method as object
Imports:
- `from aiogram.methods import SendGame`
- `from aiogram.api.methods import SendGame`
- `from aiogram.api.methods.send_game import SendGame`
#### In handlers with current bot
```python3
result: Message = await SendGame(...)
```
#### With specific bot
```python3
result: Message = await bot(SendGame(...))
```
#### As reply into Webhook in handler
```python3
return SendGame(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#sendgame)
- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md)
- [aiogram.types.Message](../types/message.md)