Message

public struct Message : Codable, Equatable, FunctionResult

Describes a message

  • id

    Message identifier, unique for the chat to which the message belongs

    Declaration

    Swift

    public let id: Int53
  • Identifier of the user who sent the message; 0 if unknown. Currently, it is unknown for channel posts and for channel posts automatically forwarded to discussion group

    Declaration

    Swift

    public let senderUserId: Int32
  • Chat identifier

    Declaration

    Swift

    public let chatId: Int53
  • Information about the sending state of the message; may be null

    Declaration

    Swift

    public let sendingState: MessageSendingState?
  • Information about the scheduling state of the message; may be null

    Declaration

    Swift

    public let schedulingState: MessageSchedulingState?
  • True, if the message is outgoing

    Declaration

    Swift

    public let isOutgoing: Bool
  • True, if the message can be edited. For live location and poll messages this fields shows whether editMessageLiveLocation or stopPoll can be used with this message by the client

    Declaration

    Swift

    public let canBeEdited: Bool
  • True, if the message can be forwarded

    Declaration

    Swift

    public let canBeForwarded: Bool
  • True, if the message can be deleted only for the current user while other users will continue to see it

    Declaration

    Swift

    public let canBeDeletedOnlyForSelf: Bool
  • True, if the message can be deleted for all users

    Declaration

    Swift

    public let canBeDeletedForAllUsers: Bool
  • True, if the message is a channel post. All messages to channels are channel posts, all other messages are not channel posts

    Declaration

    Swift

    public let isChannelPost: Bool
  • True, if the message contains an unread mention for the current user

    Declaration

    Swift

    public let containsUnreadMention: Bool
  • Point in time (Unix timestamp) when the message was sent

    Declaration

    Swift

    public let date: Int32
  • Point in time (Unix timestamp) when the message was last edited

    Declaration

    Swift

    public let editDate: Int32
  • Information about the initial message sender; may be null

    Declaration

    Swift

    public let forwardInfo: MessageForwardInfo?
  • If non-zero, the identifier of the message this message is replying to; can be the identifier of a deleted message

    Declaration

    Swift

    public let replyToMessageId: Int53
  • 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

    Declaration

    Swift

    public let ttl: Int32
  • Time left before the message expires, in seconds

    Declaration

    Swift

    public let ttlExpiresIn: Double
  • If non-zero, the user identifier of the bot through which this message was sent

    Declaration

    Swift

    public let viaBotUserId: Int32
  • For channel posts, optional author signature

    Declaration

    Swift

    public let authorSignature: String
  • Number of times this message was viewed

    Declaration

    Swift

    public let views: Int32
  • Unique identifier of an album this message belongs to. Only photos and videos can be grouped together in albums

    Declaration

    Swift

    public let mediaAlbumId: TDInt64
  • If non-empty, contains a human-readable description of the reason why access to this message must be restricted

    Declaration

    Swift

    public let restrictionReason: String
  • Content of the message

    Declaration

    Swift

    public let content: MessageContent
  • Reply markup for the message; may be null

    Declaration

    Swift

    public let replyMarkup: ReplyMarkup?
  • Describes a message

    Declaration

    Swift

    public init(id: Int53, senderUserId: Int32, chatId: Int53, sendingState: MessageSendingState?, schedulingState: MessageSchedulingState?, isOutgoing: Bool, canBeEdited: Bool, canBeForwarded: Bool, canBeDeletedOnlyForSelf: Bool, canBeDeletedForAllUsers: Bool, isChannelPost: Bool, containsUnreadMention: Bool, date: Int32, editDate: Int32, forwardInfo: MessageForwardInfo?, replyToMessageId: Int53, ttl: Int32, ttlExpiresIn: Double, viaBotUserId: Int32, authorSignature: String, views: Int32, mediaAlbumId: TDInt64, restrictionReason: String, content: MessageContent, replyMarkup: ReplyMarkup?)

    Parameters

    id

    Message identifier, unique for the chat to which the message belongs

    senderUserId

    Identifier of the user who sent the message; 0 if unknown. Currently, it is unknown for channel posts and for channel posts automatically forwarded to discussion group

    chatId

    Chat identifier

    sendingState

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

    schedulingState

    Information about the scheduling state of the message; may be null

    isOutgoing

    True, if the message is outgoing

    canBeEdited

    True, if the message can be edited. For live location and poll messages this fields shows whether editMessageLiveLocation or stopPoll can be used with this message by the client

    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

    restrictionReason

    If non-empty, contains a human-readable description of the reason why access to this message must be restricted

    content

    Content of the message

    replyMarkup

    Reply markup for the message; may be null