2020-10-22 15:50:47 +00:00
|
|
|
import { Client } from '../models/client.ts'
|
|
|
|
import {
|
|
|
|
EmbedAuthor,
|
|
|
|
EmbedField,
|
|
|
|
EmbedFooter,
|
|
|
|
EmbedImage,
|
|
|
|
EmbedPayload,
|
|
|
|
EmbedProvider,
|
|
|
|
EmbedThumbnail,
|
|
|
|
EmbedTypes,
|
|
|
|
EmbedVideo
|
|
|
|
} from '../types/channelTypes.ts'
|
|
|
|
|
2020-10-25 06:50:32 +00:00
|
|
|
export class Embed {
|
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[]
|
2020-10-25 06:50:32 +00:00
|
|
|
constructor (client: Client, data?: EmbedPayload) {
|
2020-10-25 17:03:53 +00:00
|
|
|
if (data !== undefined) {
|
2020-10-25 06:50:32 +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
|
|
|
|
}
|
2020-10-24 15:00:42 +00:00
|
|
|
}
|
2020-10-22 15:50:47 +00:00
|
|
|
}
|