diff --git a/.changeset/dirty-tips-flash.md b/.changeset/dirty-tips-flash.md new file mode 100644 index 00000000..c6c1acfb --- /dev/null +++ b/.changeset/dirty-tips-flash.md @@ -0,0 +1,5 @@ +--- +"@buape/carbon": patch +--- + +fix: make embed data not required to create embed class diff --git a/packages/carbon/src/classes/Embed.ts b/packages/carbon/src/classes/Embed.ts index 0f0c75b2..68418714 100644 --- a/packages/carbon/src/classes/Embed.ts +++ b/packages/carbon/src/classes/Embed.ts @@ -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 + } } /**