UserMessage

@objc(SBDUserMessage)
open class UserMessage : BaseMessage

Represents a mesage object that contains a text message. Derived from BaseMessage.

  • The poll that is linked to this message

    Since

    4.1.0

    Declaration

    Swift

    @objc
    public internal(set) var poll: Poll? { get }
  • The translated message text.

    Declaration

    Swift

    @objc
    public let translations: [String : String]
  • The list of target translation languages with the language codes. The messages that have been sent or scheduled with translation option BaseChannel.sendUserMessage will have this list.

    Since

    4.0.0

    Declaration

    Swift

    @objc
    public private(set) var translationTargetLanguages: [String] { get }
  • The review information of message

    Since

    4.12.0

    Declaration

    Swift

    @objc
    public internal(set) var messageReviewInfo: MessageReviewInfo? { get }
  • Encodes this object.

    Declaration

    Swift

    public override func encode(to encoder: Encoder) throws

    Parameters

    encoder

    Encoder instance

  • Default constructor.

    Declaration

    Swift

    public required init(from decoder: Decoder) throws

    Parameters

    decoder

    Decoder instance

  • Applies updated poll data to this message object.

    This method is designed to be called when didUpdatePoll(:_) event passes the poll object

    Since

    4.1.0

    Declaration

    Swift

    @discardableResult
    @objc(applyPollUpdateEvent:)
    public func apply(pollUpdateEvent: PollUpdateEvent) -> Bool

    Parameters

    pollUpdateEvent

    PollUpdateEvent instance

    Return Value

    true if event is successfuly applied

  • Applies updated poll data to this message object.

    This method is designed to be called when didVotePoll(_:) event passes the vote event object

    Since

    4.1.0

    Declaration

    Swift

    @discardableResult
    @objc(applyPollVoteEvent:)
    public func apply(pollVoteEvent: PollVoteEvent) -> Bool

    Parameters

    pollVoteEvent

    PollVoteEvent instance

    Return Value

    true if event is successfuly applied all

  • Applies updated poll data to this message object.

    This method is designed to be called when pollChangeLog event passes the vote event object

    Since

    4.1.0

    Declaration

    Swift

    @discardableResult
    @objc(applyPoll:)
    public func apply(poll: Poll) -> Bool

    Parameters

    poll

    Poll instance

    Return Value

    true if event is successfuly applied all

  • Undocumented

    Declaration

    Swift

    @objc
    public func getUserMessageParams() -> UserMessageCreateParams?
  • Compares this object with given other object.

    Declaration

    Swift

    public override func isEqual(_ object: Any?) -> Bool

    Parameters

    object

    Any instance

    Return Value

    true if same otherwise false

  • Copies this object

    Declaration

    Swift

    public override func copy(with zone: NSZone? = nil) -> Any

    Parameters

    zone

    optional NSZone

    Return Value

    UserMessage instance

  • Deserializes and reconstructs the object

    Declaration

    Swift

    public final override class func build(fromSerializedData data: Data?) -> `Self`?

    Parameters

    data

    Data instance

    Return Value

    UserMessage if parameter is valid, otherwise nil