Skip to content

Commit

Permalink
fix: make embed data not required to create embed class
Browse files Browse the repository at this point in the history
  • Loading branch information
thewilloftheshadow committed Sep 23, 2024
1 parent a5debe3 commit c25cfac
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 11 deletions.
5 changes: 5 additions & 0 deletions .changeset/dirty-tips-flash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@buape/carbon": patch
---

fix: make embed data not required to create embed class
24 changes: 13 additions & 11 deletions packages/carbon/src/classes/Embed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,19 @@ export class Embed {
/**
* Create an embed from an API embed
*/
constructor(embed: APIEmbed) {
this.title = embed.title
this.description = embed.description
this.url = embed.url
this.timestamp = embed.timestamp
this.color = embed.color
this.footer = embed.footer
this.image = embed.image?.url
this.thumbnail = embed.thumbnail?.url
this.author = embed.author
this.fields = embed.fields
constructor(embed?: APIEmbed) {
if (embed) {
this.title = embed.title
this.description = embed.description
this.url = embed.url
this.timestamp = embed.timestamp
this.color = embed.color
this.footer = embed.footer
this.image = embed.image?.url
this.thumbnail = embed.thumbnail?.url
this.author = embed.author
this.fields = embed.fields
}
}

/**
Expand Down

0 comments on commit c25cfac

Please sign in to comment.