Package it.ernytech.tdlib

## Class TdApi.Message

- java.lang.Object
- - it.ernytech.tdlib.TdApi.Object
  - - it.ernytech.tdlib.TdApi.Message

Enclosing class:
  TdApi

    public static class TdApi.Message
    extends TdApi.Object

Describes a message.

### Field Summary

Fields
`java.lang.String` `authorSignature` For channel posts, optional author signature.
`boolean` `canBeDeletedForAllUsers` True, if the message can be deleted for all users.
`boolean` `canBeDeletedOnlyForSelf` True, if the message can be deleted only for the current user while other users will continue to see it.
`boolean` `canBeEdited` True, if the message can be edited.
`boolean` `canBeForwarded` True, if the message can be forwarded.
`long` `chatId` Chat identifier.
`static int` `CONSTRUCTOR` Identifier uniquely determining type of the object.
`boolean` `containsUnreadMention` True, if the message contains an unread mention for the current user.
`TdApi.MessageContent` `content` Content of the message.
`int` `date` Point in time (Unix timestamp) when the message was sent.
`int` `editDate` Point in time (Unix timestamp) when the message was last edited.
`TdApi.MessageForwardInfo` `forwardInfo` Information about the initial message sender; may be null.
`long` `id` Unique message identifier.
`boolean` `isChannelPost` True, if the message is a channel post.
`boolean` `isOutgoing` True, if the message is outgoing.
`long` `mediaAlbumId` Unique identifier of an album this message belongs to.
`TdApi.ReplyMarkup` `replyMarkup` Reply markup for the message; may be null.
`long` `replyToMessageId` If non-zero, the identifier of the message this message is replying to; can be the identifier of a deleted message.
`int` `senderUserId` Identifier of the user who sent the message; 0 if unknown.
`TdApi.MessageSendingState` `sendingState` Information about the sending state of the message; may be null.
`int` `ttl` For self-destructing messages, the message's TTL (Time To Live), in seconds; 0 if none.
`double` `ttlExpiresIn` Time left before the message expires, in seconds.
`int` `viaBotUserId` If non-zero, the user identifier of the bot through which this message was sent.
`int` `views` Number of times this message was viewed.

### Constructor Summary

Constructors
`Message()` Default constructor.

`Message​(long id, int senderUserId, long chatId, TdApi.MessageSendingState sendingState, boolean isOutgoing, boolean canBeEdited, boolean canBeForwarded, boolean canBeDeletedOnlyForSelf, boolean canBeDeletedForAllUsers, boolean isChannelPost, boolean containsUnreadMention, int date, int editDate, TdApi.MessageForwardInfo forwardInfo, long replyToMessageId, int ttl, double ttlExpiresIn, int viaBotUserId, java.lang.String authorSignature, int views, long mediaAlbumId, TdApi.MessageContent content, TdApi.ReplyMarkup replyMarkup)`

Constructor for initialization of all fields.

### Method Summary

All Methods Instance Methods Concrete Methods
`int` `getConstructor()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Methods inherited from class it.ernytech.tdlib.TdApi.Object

`toString`

### Field Detail

#### id

    public long id

Unique message identifier.

#### senderUserId

    public int senderUserId

Identifier of the user who sent the message; 0 if unknown. It is unknown for channel posts.

#### chatId

    public long chatId

Chat identifier.

#### sendingState

    public TdApi.MessageSendingState sendingState

Information about the sending state of the message; may be null.

#### isOutgoing

    public boolean isOutgoing

True, if the message is outgoing.

#### canBeEdited

    public boolean canBeEdited

True, if the message can be edited.

#### canBeForwarded

    public boolean canBeForwarded

True, if the message can be forwarded.

#### canBeDeletedOnlyForSelf

    public boolean canBeDeletedOnlyForSelf

True, if the message can be deleted only for the current user while other users will continue to see it.

#### canBeDeletedForAllUsers

    public boolean canBeDeletedForAllUsers

True, if the message can be deleted for all users.

#### isChannelPost

    public boolean isChannelPost

True, if the message is a channel post. All messages to channels are channel posts, all other messages are not channel posts.

#### containsUnreadMention

    public boolean containsUnreadMention

True, if the message contains an unread mention for the current user.

#### date

    public int date

Point in time (Unix timestamp) when the message was sent.

#### editDate

    public int editDate

Point in time (Unix timestamp) when the message was last edited.

#### forwardInfo

    public TdApi.MessageForwardInfo forwardInfo

Information about the initial message sender; may be null.

#### replyToMessageId

    public long replyToMessageId

If non-zero, the identifier of the message this message is replying to; can be the identifier of a deleted message.

#### ttl

    public int ttl

For self-destructing messages, the message's TTL (Time To Live), in seconds; 0 if none. TDLib will send updateDeleteMessages or updateMessageContent once the TTL expires.

#### ttlExpiresIn

    public double ttlExpiresIn

Time left before the message expires, in seconds.

#### viaBotUserId

    public int viaBotUserId

If non-zero, the user identifier of the bot through which this message was sent.

#### authorSignature

    public java.lang.String authorSignature

For channel posts, optional author signature.

#### views

    public int views

Number of times this message was viewed.

#### mediaAlbumId

    public long mediaAlbumId

Unique identifier of an album this message belongs to. Only photos and videos can be grouped together in albums.

#### content

    public TdApi.MessageContent content

Content of the message.

#### replyMarkup

    public TdApi.ReplyMarkup replyMarkup

Reply markup for the message; may be null.

#### CONSTRUCTOR

    public static final int CONSTRUCTOR

Identifier uniquely determining type of the object.

See Also:
  Constant Field Values

### Constructor Detail

#### Message

    public Message()

Default constructor.

#### Message

    public Message​(long id,
                   int senderUserId,
                   long chatId,
                   TdApi.MessageSendingState sendingState,
                   boolean isOutgoing,
                   boolean canBeEdited,
                   boolean canBeForwarded,
                   boolean canBeDeletedOnlyForSelf,
                   boolean canBeDeletedForAllUsers,
                   boolean isChannelPost,
                   boolean containsUnreadMention,
                   int date,
                   int editDate,
                   TdApi.MessageForwardInfo forwardInfo,
                   long replyToMessageId,
                   int ttl,
                   double ttlExpiresIn,
                   int viaBotUserId,
                   java.lang.String authorSignature,
                   int views,
                   long mediaAlbumId,
                   TdApi.MessageContent content,
                   TdApi.ReplyMarkup replyMarkup)

Constructor for initialization of all fields.

Parameters:
  `id` - Unique message identifier.
  `senderUserId` - Identifier of the user who sent the message; 0 if unknown. It is unknown for channel posts.
  `chatId` - Chat identifier.
  `sendingState` - Information about the sending state of the message; may be null.
  `isOutgoing` - True, if the message is outgoing.
  `canBeEdited` - True, if the message can be edited.
  `canBeForwarded` - True, if the message can be forwarded.
  `canBeDeletedOnlyForSelf` - True, if the message can be deleted only for the current user while other users will continue to see it.
  `canBeDeletedForAllUsers` - True, if the message can be deleted for all users.
  `isChannelPost` - True, if the message is a channel post. All messages to channels are channel posts, all other messages are not channel posts.
  `containsUnreadMention` - True, if the message contains an unread mention for the current user.
  `date` - Point in time (Unix timestamp) when the message was sent.
  `editDate` - Point in time (Unix timestamp) when the message was last edited.
  `forwardInfo` - Information about the initial message sender; may be null.
  `replyToMessageId` - If non-zero, the identifier of the message this message is replying to; can be the identifier of a deleted message.
  `ttl` - For self-destructing messages, the message's TTL (Time To Live), in seconds; 0 if none. TDLib will send updateDeleteMessages or updateMessageContent once the TTL expires.
  `ttlExpiresIn` - Time left before the message expires, in seconds.
  `viaBotUserId` - If non-zero, the user identifier of the bot through which this message was sent.
  `authorSignature` - For channel posts, optional author signature.
  `views` - Number of times this message was viewed.
  `mediaAlbumId` - Unique identifier of an album this message belongs to. Only photos and videos can be grouped together in albums.
  `content` - Content of the message.
  `replyMarkup` - Reply markup for the message; may be null.

### Method Detail

#### getConstructor

    public int getConstructor()

Specified by:
  `getConstructor` in class `TdApi.Object`
Returns:
  this.CONSTRUCTOR