Skip to content

Commit

Permalink
Url property
Browse files Browse the repository at this point in the history
  • Loading branch information
abobija committed Aug 15, 2022
1 parent 7fd3ec9 commit c492aeb
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/discord/embed.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ extern "C" {
typedef struct {
char* title;
char* description;
char* url;
} discord_embed_t;

void discord_embed_free(discord_embed_t* embed);
Expand Down
1 change: 1 addition & 0 deletions src/discord/embed.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ void discord_embed_free(discord_embed_t* embed) {

free(embed->title);
free(embed->description);
free(embed->url);
free(embed);
}
1 change: 1 addition & 0 deletions src/discord/private/_json.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ cJSON* discord_embed_to_cjson(discord_embed_t* embed)

if(embed->title) cJSON_AddItemToObject(root, "title", cJSON_CreateStringReference(embed->title));
if(embed->description) cJSON_AddItemToObject(root, "description", cJSON_CreateStringReference(embed->description));
if(embed->url) cJSON_AddItemToObject(root, "url", cJSON_CreateStringReference(embed->url));

return root;
}
Expand Down

0 comments on commit c492aeb

Please sign in to comment.