typings/lib2/messagev2/messagePayload/textMessage.js

  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.TextMessage = void 0;
  4. const internal_1 = require("../internal");
  5. /**
  6. * Represents a text message.
  7. * @extends NonRawMessage
  8. */
  9. class TextMessage extends internal_1.NonRawMessage {
  10. /**
  11. * Create a new TextMessage object.
  12. * @param {string} text - The text content of the message.
  13. */
  14. constructor(text) {
  15. super();
  16. this.type = 'text';
  17. this.text = text;
  18. }
  19. /**
  20. * Get the text content of the message.
  21. * @returns {string} The message text.
  22. */
  23. getText() {
  24. return this.text;
  25. }
  26. /**
  27. * Set the text content of the message.
  28. * @param {string} text - The text to set.
  29. * @returns {TextMessage} The current instance of the TextMessage class.
  30. */
  31. setText(text) {
  32. this.text = text;
  33. return this;
  34. }
  35. }
  36. exports.TextMessage = TextMessage;