fix missing stuffs
This commit is contained in:
@@ -2,6 +2,6 @@
|
|||||||
"singleQuote": true,
|
"singleQuote": true,
|
||||||
"printWidth": 120,
|
"printWidth": 120,
|
||||||
"trailingComma": "all",
|
"trailingComma": "all",
|
||||||
"endOfLine": "lf",
|
"endOfLine": "auto",
|
||||||
"arrowParens": "avoid"
|
"arrowParens": "avoid"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ class FileComponent extends BaseMessageComponent {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {} [data={}]
|
* @param {FileComponent | APIFileComponent} [data={}]
|
||||||
*/
|
*/
|
||||||
constructor(data = {}) {
|
constructor(data = {}) {
|
||||||
super({ type: 'FILE' }, data);
|
super({ type: 'FILE' }, data);
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ class MediaGalleryComponent extends BaseMessageComponent {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {} [data={}]
|
* @param {MediaGalleryComponent | APIMediaGalleryComponent} [data={}]
|
||||||
*/
|
*/
|
||||||
constructor(data = {}) {
|
constructor(data = {}) {
|
||||||
super({ type: 'MEDIA_GALLERY' }, data);
|
super({ type: 'MEDIA_GALLERY' }, data);
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ class MediaGalleryItem {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {} [data={}]
|
* @param {MediaGalleryItem | APIMediaGalleryItem} [data={}]
|
||||||
*/
|
*/
|
||||||
constructor(data = {}) {
|
constructor(data = {}) {
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ class SectionComponent extends BaseMessageComponent {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {} [data={}]
|
* @param {SectionComponent | APISectionComponent} [data={}]
|
||||||
*/
|
*/
|
||||||
constructor(data = {}) {
|
constructor(data = {}) {
|
||||||
super({ type: 'SECTION' }, data);
|
super({ type: 'SECTION' }, data);
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ class SeparatorComponent extends BaseMessageComponent {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {} [data={}]
|
* @param {SeparatorComponent | APISeparatorComponent} [data={}]
|
||||||
*/
|
*/
|
||||||
constructor(data = {}) {
|
constructor(data = {}) {
|
||||||
super({ type: 'SEPARATOR' }, data);
|
super({ type: 'SEPARATOR' }, data);
|
||||||
|
|||||||
@@ -4,11 +4,26 @@ const BaseMessageComponent = require('./BaseMessageComponent');
|
|||||||
const { MessageComponentTypes } = require('../util/Constants');
|
const { MessageComponentTypes } = require('../util/Constants');
|
||||||
|
|
||||||
class TextDisplayComponent extends BaseMessageComponent {
|
class TextDisplayComponent extends BaseMessageComponent {
|
||||||
|
/**
|
||||||
|
* @property {String} [content] Text that will be displayed similar to a message
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {TextDisplayComponent | APITextDisplayComponent} [data={}]
|
||||||
|
*/
|
||||||
constructor(data = {}) {
|
constructor(data = {}) {
|
||||||
super({ type: 'TEXT_DISPLAY' }, data);
|
super({ type: 'TEXT_DISPLAY' }, data);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Text that will be displayed similar to a message
|
||||||
|
* @type {String}
|
||||||
|
*/
|
||||||
this.content = data.content ?? null;
|
this.content = data.content ?? null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @returns {APITextDisplayComponent}
|
||||||
|
*/
|
||||||
toJSON() {
|
toJSON() {
|
||||||
return {
|
return {
|
||||||
type: MessageComponentTypes[this.type],
|
type: MessageComponentTypes[this.type],
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ const { MessageComponentTypes } = require('../util/Constants');
|
|||||||
class ThumbnailComponent extends BaseMessageComponent {
|
class ThumbnailComponent extends BaseMessageComponent {
|
||||||
/**
|
/**
|
||||||
* @property {UnfurledMediaItem} [media] A url or attachment
|
* @property {UnfurledMediaItem} [media] A url or attachment
|
||||||
* @property {String} [description] Alt text for the media, max 1024 characters
|
* @property {String} [description] Alt text for the media, max 1024 characters
|
||||||
* @property {Boolean} [spoiler] Whether the thumbnail should be a spoiler (or blurred out). Defaults to false
|
* @property {Boolean} [spoiler] Whether the thumbnail should be a spoiler (or blurred out). Defaults to false
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -16,8 +16,23 @@ class ThumbnailComponent extends BaseMessageComponent {
|
|||||||
*/
|
*/
|
||||||
constructor(data = {}) {
|
constructor(data = {}) {
|
||||||
super({ type: 'THUMBNAIL' }, data);
|
super({ type: 'THUMBNAIL' }, data);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A url or attachment
|
||||||
|
* @type {UnfurledMediaItem}
|
||||||
|
*/
|
||||||
this.media = new UnfurledMediaItem(data.media);
|
this.media = new UnfurledMediaItem(data.media);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Alt text for the media, max 1024 characters
|
||||||
|
* @type {String}
|
||||||
|
*/
|
||||||
this.description = data.description ?? null;
|
this.description = data.description ?? null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether the thumbnail should be a spoiler (or blurred out). Defaults to false
|
||||||
|
* @type {Boolean}
|
||||||
|
*/
|
||||||
this.spoiler = data.spoiler ?? false;
|
this.spoiler = data.spoiler ?? false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,9 @@ class UnfurledMediaItem {
|
|||||||
/**
|
/**
|
||||||
* @property {string} [url] Supports arbitrary urls and `attachment://<filename>` references
|
* @property {string} [url] Supports arbitrary urls and `attachment://<filename>` references
|
||||||
*/
|
*/
|
||||||
|
/**
|
||||||
|
* @param {UnfurledMediaItem | APIUnfurledMediaItem} [data={}]
|
||||||
|
*/
|
||||||
constructor(data = {}) {
|
constructor(data = {}) {
|
||||||
/**
|
/**
|
||||||
* @type {string}
|
* @type {string}
|
||||||
|
|||||||
1
typings/rawDataTypes.d.ts
vendored
1
typings/rawDataTypes.d.ts
vendored
@@ -389,7 +389,6 @@ export interface APISectionComponent extends APIBaseComponent<MessageComponentTy
|
|||||||
accessory: APIThumbnailComponent | APIMessageButtonInteractionData
|
accessory: APIThumbnailComponent | APIMessageButtonInteractionData
|
||||||
}
|
}
|
||||||
|
|
||||||
// APIActionRowComponent<APIActionRowComponentTypes> ???
|
|
||||||
export type APIContainerComponents = APIActionRowComponent<APIActionRowComponentTypes> | APITextDisplayComponent | APISectionComponent | APIMediaGalleryComponent | APISeparatorComponent | APIFileComponent;
|
export type APIContainerComponents = APIActionRowComponent<APIActionRowComponentTypes> | APITextDisplayComponent | APISectionComponent | APIMediaGalleryComponent | APISeparatorComponent | APIFileComponent;
|
||||||
export interface APIContainerComponent extends APIBaseComponent<MessageComponentTypes.CONTAINER> {
|
export interface APIContainerComponent extends APIBaseComponent<MessageComponentTypes.CONTAINER> {
|
||||||
components: APIContainerComponents[];
|
components: APIContainerComponents[];
|
||||||
|
|||||||
Reference in New Issue
Block a user