refactor: update Embed structure to remove fields and adjust image source handling

This commit is contained in:
fzzinchemical
2025-04-01 23:04:46 +02:00
parent 2fcc67dbd7
commit 8ceac891ca
2 changed files with 7 additions and 7 deletions

View File

@@ -22,10 +22,10 @@ export async function requestWorker(requestString: string){
for (const img of response) { for (const img of response) {
stack.push(new Embed( stack.push(new Embed(
`ID: ${img.id}`, `ID: ${img.id}`,
img.file_url, img.source,
new EmbedAuthor(img.owner), new EmbedAuthor(img.owner),
[new EmbedField("Tags", img.tags, true)], // [new EmbedField("Tags", img.tags, true)],
new EmbedImage(img.preview_url, img.height, img.width) new EmbedImage(img.file_url, img.height, img.width)
)) ))
} }
return stack return stack

View File

@@ -6,7 +6,7 @@ export class Embed implements DiscordEmbed{
title: string title: string
url: string url: string
author: DiscordEmbedAuthor author: DiscordEmbedAuthor
fields: Field[] // fields: DiscordEmbedField[]
image: DiscordEmbedImage image: DiscordEmbedImage
// timestamp: Time // timestamp: Time
@@ -14,13 +14,13 @@ export class Embed implements DiscordEmbed{
title: string, title: string,
url: string, url: string,
author:DiscordEmbedAuthor, author:DiscordEmbedAuthor,
fields: EmbedField[], // fields: EmbedField[],
image: DiscordEmbedImage, image: DiscordEmbedImage,
){ ){
this.title = title this.title = title
this.url = url this.url = url
this.author = author this.author = author
this.fields= fields // this.fields= fields
this.image = image this.image = image
} }
@@ -29,7 +29,7 @@ export class Embed implements DiscordEmbed{
title: this.title, title: this.title,
url : this.url, url : this.url,
author: this.author, author: this.author,
fields: this.fields, // fields: this.fields,
image: this.image image: this.image
} }
} }