2020-10-22 15:50:47 +00:00
|
|
|
import { Client } from '../models/client.ts'
|
2020-10-24 12:11:54 +00:00
|
|
|
import { Base } from './base.ts'
|
2020-10-22 15:50:47 +00:00
|
|
|
import {
|
|
|
|
EmbedAuthor,
|
|
|
|
EmbedField,
|
|
|
|
EmbedFooter,
|
|
|
|
EmbedImage,
|
|
|
|
EmbedPayload,
|
|
|
|
EmbedProvider,
|
|
|
|
EmbedThumbnail,
|
|
|
|
EmbedTypes,
|
|
|
|
EmbedVideo
|
|
|
|
} from '../types/channelTypes.ts'
|
|
|
|
|
2020-10-23 16:11:00 +00:00
|
|
|
export class Embed extends Base {
|
2020-10-22 15:50:47 +00:00
|
|
|
title?: string
|
|
|
|
type?: EmbedTypes
|
|
|
|
description?: string
|
|
|
|
url?: string
|
|
|
|
timestamp?: string
|
|
|
|
color?: number
|
|
|
|
footer?: EmbedFooter
|
|
|
|
image?: EmbedImage
|
|
|
|
thumbnail?: EmbedThumbnail
|
|
|
|
video?: EmbedVideo
|
|
|
|
provider?: EmbedProvider
|
|
|
|
author?: EmbedAuthor
|
|
|
|
fields?: EmbedField[]
|
|
|
|
constructor (client: Client, data: EmbedPayload) {
|
|
|
|
super(client)
|
2020-10-24 15:00:42 +00:00
|
|
|
this.title = data.title
|
|
|
|
this.type = data.type
|
|
|
|
this.description = data.description
|
|
|
|
this.url = data.url
|
|
|
|
this.timestamp = data.timestamp
|
|
|
|
this.color = data.color
|
|
|
|
this.footer = data.footer
|
|
|
|
this.image = data.image
|
|
|
|
this.thumbnail = data.thumbnail
|
|
|
|
this.video = data.video
|
|
|
|
this.provider = data.provider
|
|
|
|
this.author = data.author
|
|
|
|
this.fields = data.fields
|
|
|
|
}
|
|
|
|
|
|
|
|
toJSON () {
|
|
|
|
return {
|
|
|
|
title: this.title,
|
|
|
|
type: this.type,
|
|
|
|
description: this.description,
|
|
|
|
url: this.url,
|
|
|
|
timestamp: this.timestamp,
|
|
|
|
color: this.color,
|
|
|
|
footer: this.footer,
|
|
|
|
image: this.image,
|
|
|
|
thumbnail: this.thumbnail,
|
|
|
|
video: this.video,
|
|
|
|
provider: this.provider,
|
|
|
|
author: this.author,
|
|
|
|
fields: this.fields
|
|
|
|
}
|
2020-10-22 15:50:47 +00:00
|
|
|
}
|
|
|
|
}
|