This commit is contained in:
tungdo0602
2025-06-30 22:23:32 +07:00
parent 2e4542c069
commit fd9c0e0d0f
11 changed files with 206 additions and 210 deletions

View File

@@ -1,35 +1,35 @@
'use strict';
const BaseMessageComponent = require('./BaseMessageComponent');
const { MessageComponentTypes } = require('../util/Constants');
class TextDisplayComponent extends BaseMessageComponent {
/**
* @property {String} [content] Text that will be displayed similar to a message
*/
/**
* @param {TextDisplayComponent | APITextDisplayComponent} [data={}] The data
*/
constructor(data = {}) {
super({ type: 'TEXT_DISPLAY' }, data);
/**
* Text that will be displayed similar to a message
* @type {String}
*/
this.content = data.content ?? null;
}
/**
* @returns {APITextDisplayComponent}
*/
toJSON() {
return {
type: MessageComponentTypes[this.type],
content: this.content,
};
}
}
module.exports = TextDisplayComponent;
'use strict';
const BaseMessageComponent = require('./BaseMessageComponent');
const { MessageComponentTypes } = require('../util/Constants');
class TextDisplayComponent extends BaseMessageComponent {
/**
* @property {String} [content] Text that will be displayed similar to a message
*/
/**
* @param {TextDisplayComponent | APITextDisplayComponent} [data={}] The data
*/
constructor(data = {}) {
super({ type: 'TEXT_DISPLAY' }, data);
/**
* Text that will be displayed similar to a message
* @type {String}
*/
this.content = data.content ?? null;
}
/**
* @returns {APITextDisplayComponent}
*/
toJSON() {
return {
type: MessageComponentTypes[this.type],
content: this.content,
};
}
}
module.exports = TextDisplayComponent;