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
menu_refStringOptionalMenu reference for existing predefined Menu. The menu will be displayed as inline menu associated to the message.
inline_menuArray of MenuOptionalInline menu object to hold menus.If both inline_menu and menu_ref are defined. Priority for inline_menu.
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.
Language