Message

Message

The main message method defines all parameters for all incoming messages to the bot.

FieldTypeRequiredDescription
message_idStringYesUnique identifier for this message.
referenceLongYesUnique local identifier
chatChatYesConversation the message belongs to.
fromUserYesSender User of this message
sent_toUserYesReceiver user, most of the case it is the bot ID except if channel has multiple administrators, it will be the specific admin who should receive the message.
typeStringYes"text": For text messages "text_file": Message is a text tile. Any message exceeds 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
dateLongYesDate the message was sent in Unix Epoch timestamp in milliseconds.
reply_to_message_idStringOptionalParent message Unique identifier.
from_adminIntegerOptional1 if from user is admin, otherwise it is 0
textStringConditionalOnly available when type is text
text_fileText_FileConditionalOnly available when type is text_file
photoPhotoConditionalOnly available when type is photo
gifGIFConditionalOnly available when type is gif
stickerStickerConditionalOnly available when type is sticker
videoVideoConditionalOnly available when type is video
audioAudioConditionalOnly available when type is audio
voiceVoiceConditionalOnly available when type is voice
documentDocumentConditionalOnly available when type is document
locationLocationConditionalOnly available when type is location
contactContactConditionalOnly available when type is contact
statusStringOptional"deleted" if messages is recalled and "updated" if it is updated.
chat_settingsIntegerOptional1 if from chat settings bot, otherwise it is 0
captionString
bg_colorString
articleArticle
urlString
white_list_userWhiteListUser
tagTagDefinition
schedule_dateLongOptionalLong time format like this example 1579102262

Text_File

This object represents a text file.

FieldTypeRequiredDescription
IdStringYesUnique identifier for this file
sizeIntegerYesFile size.

Menu

Each Menu consists of a set of rows. At least one row should be defined.

FieldTypeRequiredDescription
menu_refStringYesUnique identifier of this Menu as defined by bot.
rowsArray of RowYesRows belong to this menu. Row which is an Array of buttons

Row

Each row belongs to one keypad menu that composes of set of buttons. At least one button should be defined.

FieldTypeRequiredDescription
buttonsArray of ButtonYesButton belongs to the row.
row_orderIntegerYesRow order in the menu.

Button

This object represents the button for replying. The button must have a button_callback which is the unique identifier defined by bot.

FieldTypeRequiredDescription
button_callbackStringYesThis is unique identifier as defined by bot. The button_callback returned in inlineMessageCallback and ChatMenuCallback when button pressed.
next_menuMenuOptionalMenu unique identifier that reference the next menu to navigate to it when the button pressed.
button_spanIntegerOptionalButton Span
button_orderIntegerOptionalThe number of button order by ascending
button_text_colorStringOptionalText color of the button Title The color should be in hexadecimal format (Hex triplet ) or according to its common English name. Example : Red color can be set as "RED" or "#FF0000"
button_bg_colorStringOptionalButton background color. The color should be in hexadecimal format (Hex triplet ) or according to its common English name. Example : Red color can be set as "RED" or "#FF0000"
button_labelStringOptionalButton label or title.
button_urlStringOptionalButton URL. When button pressed, an external URL link will be opened.
button_queryStringOptionalField used to query information from app, this can take one of two values as follows Location: to ask user to get location or point of map information. Contact : to ask user to get his contact number.
chatChatOptionalChat is a unique identifier that references the specific channel or group to be opened when button is pressed. The user should be a member of the specified channel or group. If button_url and chat are both defined, both will be executed.
nav_typeStringOptional-Null is default to show navigation button for channel, group or contact-Type "admin" for show admin navigation button in chat setting.

ButtonQueryResult

This object represents an incoming button query results from a callback button

FieldTypeRequiredDescription
latitudeStringOptionalOnly sent in case of buttonQuery is location
longitudeStringOptionalOnly sent in case of buttonQuery is location
contactStringOptionOnly sent in case of buttonQuery is phone_number.
Language