typings/lib2/messagev2/messagePayload/textMessage.js

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TextMessage = void 0;
const internal_1 = require("../internal");
/**
 * Represents a text message.
 * @extends NonRawMessage
 */
class TextMessage extends internal_1.NonRawMessage {
    /**
     * Create a new TextMessage object.
     * @param {string} text - The text content of the message.
     */
    constructor(text) {
        super();
        this.type = 'text';
        this.text = text;
    }
    /**
     * Get the text content of the message.
     * @returns {string} The message text.
     */
    getText() {
        return this.text;
    }
    /**
     * Set the text content of the message.
     * @param {string} text - The text to set.
     * @returns {TextMessage} The current instance of the TextMessage class.
     */
    setText(text) {
        this.text = text;
        return this;
    }
}
exports.TextMessage = TextMessage;