The main message method defines all parameters for all incoming messages to the bot.
Field | Type | Required | Description |
message_id | String | Yes | Unique identifier for this message. |
reference | Long | Yes | Unique local identifier. |
chat | Yes | Conversation the message belongs to. | |
from | Yes | Sender (user) of this message. | |
sent_to | Yes | Receiver (user): in most cases, it is the bot ID, except if the channel has multiple administrators; it will be the specific admin who should receive the message. | |
type | String | Yes | type:
βtextβ: for text messages.
βtext_fileβ: any message exceeding 1800 characters will be converted to text file.
βphotoβ: message is a photo.
βgifβ: message is a GIF
βstickerβ: message is a sticker.
βvideoβ: message is a video.
βaudioβ: message is an audio.
βvoiceβ: message is a voice note.
βlocationβ: message is a location.
βcontactβ: message is a contact.
βdocumentβ: message is a document. |
date | Long | Yes | The date of the message that was sent is the Unix Epoch timestamp in milliseconds. |
reply_to_message_id | String | Optional | Unique identifier for the parent message. |
from_admin | Integer | Optional | 1 if its from an admin user; otherwise, it is 0. |
text | String | Conditional | Only available when its type is text. |
text_file | Conditional | Only available when its type is text_file. | |
photo | Conditional | Only available when its type is photo. | |
gif | Conditional | Only available when its type is gif. | |
sticker | Sticker | Conditional | Only available when its type is sticker. |
video | Conditional | Only available when its type is video. | |
audio | Conditional | Only available when its type is audio. | |
voice | Conditional | Only available when its type is voice. | |
document | Conditional | Only available when its type is document. | |
location | Conditional | Only available when its type is location. | |
contact | Conditional | Only available when its type is contact. | |
status | String | Optional | βdeletedβ: if messages is recalled and updated if it is updated. |
chat_settings | Integer | Optional | 1 if its from chat settings bot; otherwise, it is 0. |
menu_ref | String | Optional | Menu reference for existing predefined menu: the menu will be displayed as inline menu associated to the message. |
inline_menu | Array of Menu | Optional | Inline menu object to hold menus: if both inline_menu and menu_ref are defined, the priority goes to inline_menu. |
caption | String | ||
bg_color | String | ||
article | Article | ||
url | String | ||
white_list_user | |||
tag | |||
schedule_date | Long | Optional | Long-time format: ex. (1579102262) |
Text_File
This object represents a text file.
Field | Type | Required | Description |
Id | String | Yes | Unique identifier for this file. |
size | Integer | Yes | File size. |
Objects
json{ "message": { "date": 1512445910180, "gif": { "thumbnail": { "width": 256, "id": "cfdb3cc5.gif.thumb.jpg", "height": 191 }, "size": 4136640, "width": 443, "id": "cfdb3cc5.gif.thumb.jpg", "height": 332 }, "chat": { "name": "chat 1", "id": "4522291356145774", "type": 0 }, "message_id": "d2_QhlW1MAH12617138", "from": { "name": "john smith", "id": "4521191845180798", "type": 0, "version": "('0hn0','1YDA','2ViB','32Fg')" }, "type": "gif" } }