2017-03-11 19:54:51 +01:00
|
|
|
---
|
|
|
|
title: game
|
|
|
|
description: Describes a game
|
|
|
|
---
|
|
|
|
## Constructor: game
|
|
|
|
[Back to constructors index](index.md)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Describes a game
|
|
|
|
|
|
|
|
### Attributes:
|
|
|
|
|
|
|
|
| Name | Type | Required | Description |
|
2017-08-20 11:05:56 +02:00
|
|
|
|----------|---------------|----------|-------------|
|
2017-03-11 19:54:51 +01:00
|
|
|
|id|[long](../types/long.md) | Yes|Game id|
|
|
|
|
|short\_name|[string](../types/string.md) | Yes|Game short name, to share a game use a URL https: telegram.me/{bot_username}?game={game_short_name}|
|
|
|
|
|title|[string](../types/string.md) | Yes|Game title|
|
|
|
|
|text|[string](../types/string.md) | Yes|Game text, usually containing game scoreboards|
|
|
|
|
|text\_entities|Array of [MessageEntity](../constructors/MessageEntity.md) | Yes|Entities contained in the text|
|
|
|
|
|description|[string](../types/string.md) | Yes|Game description|
|
|
|
|
|photo|[photo](../types/photo.md) | Yes|Game photo|
|
|
|
|
|animation|[animation](../types/animation.md) | Yes|Game animation, nullable|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### Type: [Game](../types/Game.md)
|
|
|
|
|
|
|
|
|
|
|
|
### Example:
|
|
|
|
|
|
|
|
```
|
2017-07-23 16:33:46 +02:00
|
|
|
$game = ['_' => 'game', 'id' => long, 'short_name' => 'string', 'title' => 'string', 'text' => 'string', 'text_entities' => [MessageEntity], 'description' => 'string', 'photo' => photo, 'animation' => animation];
|
2017-03-11 19:54:51 +01:00
|
|
|
```
|
|
|
|
|
2017-07-23 16:11:02 +02:00
|
|
|
[PWRTelegram](https://pwrtelegram.xyz) json-encoded version:
|
|
|
|
|
|
|
|
```
|
2017-07-23 16:33:46 +02:00
|
|
|
{"_": "game", "id": long, "short_name": "string", "title": "string", "text": "string", "text_entities": [MessageEntity], "description": "string", "photo": photo, "animation": animation}
|
2017-07-23 16:11:02 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
|
2017-03-11 19:54:51 +01:00
|
|
|
Or, if you're into Lua:
|
|
|
|
|
|
|
|
|
|
|
|
```
|
2017-07-23 16:33:46 +02:00
|
|
|
game={_='game', id=long, short_name='string', title='string', text='string', text_entities={MessageEntity}, description='string', photo=photo, animation=animation}
|
2017-03-11 19:54:51 +01:00
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|