MadelineProto/docs/TD_docs/constructors/message.md
2017-07-23 16:33:46 +02:00

3.4 KiB

title description
message Describes message

Constructor: message

Back to constructors index

Describes message

Attributes:

Name Type Required Description
id long Yes Unique message identifier
sender_user_id int Yes Identifier of the user who sent the message, 0 if unknown. It can be unknown for channel posts which are not signed by the author
chat_id long Yes Chat identifier
send_state MessageSendState Yes Information about sending state of the message
can_be_edited Bool Yes True, if message can be edited
can_be_deleted Bool Yes True, if message can be deleted
is_post Bool Yes True, if message is channel post. All messages to broadcast channels are posts, all other messages are not posts
date int Yes Date when message was sent, unix time
edit_date int Yes Date when message was edited last time, unix time
forward_info MessageForwardInfo Yes Information about initial message sender, nullable
reply_to_message_id long Yes If non-zero, identifier of the message this message replies to, can be identifier of deleted message
ttl int Yes Message TTL for messages in secret chats in seconds, 0 if none. TDLib will send updateDeleteMessages when TTL expires
ttl_expires_in double Yes Time left for message ttl to expire in seconds
via_bot_user_id int Yes If non-zero, user identifier of the bot this message is sent via
views int Yes Number of times this message was viewed
content MessageContent Yes Content of the message
reply_markup ReplyMarkup Yes Reply markup for the message, nullable

Type: Message

Example:

$message = ['_' => 'message', 'id' => long, 'sender_user_id' => int, 'chat_id' => long, 'send_state' => MessageSendState, 'can_be_edited' => Bool, 'can_be_deleted' => Bool, 'is_post' => Bool, 'date' => int, 'edit_date' => int, 'forward_info' => MessageForwardInfo, 'reply_to_message_id' => long, 'ttl' => int, 'ttl_expires_in' => double, 'via_bot_user_id' => int, 'views' => int, 'content' => MessageContent, 'reply_markup' => ReplyMarkup];

PWRTelegram json-encoded version:

{"_": "message", "id": long, "sender_user_id": int, "chat_id": long, "send_state": MessageSendState, "can_be_edited": Bool, "can_be_deleted": Bool, "is_post": Bool, "date": int, "edit_date": int, "forward_info": MessageForwardInfo, "reply_to_message_id": long, "ttl": int, "ttl_expires_in": double, "via_bot_user_id": int, "views": int, "content": MessageContent, "reply_markup": ReplyMarkup}

Or, if you're into Lua:

message={_='message', id=long, sender_user_id=int, chat_id=long, send_state=MessageSendState, can_be_edited=Bool, can_be_deleted=Bool, is_post=Bool, date=int, edit_date=int, forward_info=MessageForwardInfo, reply_to_message_id=long, ttl=int, ttl_expires_in=double, via_bot_user_id=int, views=int, content=MessageContent, reply_markup=ReplyMarkup}

Usage of reply_markup

You can provide bot API reply_markup objects here.