Concord - C Discord API library
A Discord API wrapper library written in C
Embed builder

Dynamic embed builder functions. More...

Collaboration diagram for Embed builder:

Functions

void discord_embed_set_title (struct discord_embed *embed, char format[],...)
 Add title to embed. More...
 
void discord_embed_set_description (struct discord_embed *embed, char format[],...)
 Add description to embed. More...
 
void discord_embed_set_url (struct discord_embed *embed, char format[],...)
 Add URL to embed. More...
 
void discord_embed_set_thumbnail (struct discord_embed *embed, char url[], char proxy_url[], int height, int width)
 Add thumbnail to embed. More...
 
void discord_embed_set_image (struct discord_embed *embed, char url[], char proxy_url[], int height, int width)
 Add image to embed. More...
 
void discord_embed_set_video (struct discord_embed *embed, char url[], char proxy_url[], int height, int width)
 Add video to embed. More...
 
void discord_embed_set_footer (struct discord_embed *embed, char text[], char icon_url[], char proxy_icon_url[])
 Add footer to embed. More...
 
void discord_embed_set_provider (struct discord_embed *embed, char name[], char url[])
 Add provider to embed. More...
 
void discord_embed_set_author (struct discord_embed *embed, char name[], char url[], char icon_url[], char proxy_icon_url[])
 Add author to embed. More...
 
void discord_embed_add_field (struct discord_embed *embed, char name[], char value[], bool Inline)
 Add field to embed. More...
 

Detailed Description

Dynamic embed builder functions.

Function Documentation

◆ discord_embed_set_title()

void discord_embed_set_title ( struct discord_embed embed,
char  format[],
  ... 
)

Add title to embed.

Note
the embed must be freed with discord_embed_cleanup() after its no longer being used
Parameters
embedthe embed being modified
formatprintf-like formatting string
...variadic arguments to be matched to format
Examples
embed.c.

◆ discord_embed_set_description()

void discord_embed_set_description ( struct discord_embed embed,
char  format[],
  ... 
)

Add description to embed.

Note
the embed must be freed with discord_embed_cleanup() after its no longer being used
Parameters
embedthe embed being modified
formatprintf-like formatting string
...variadic arguments to be matched to format
Examples
embed.c.

◆ discord_embed_set_url()

void discord_embed_set_url ( struct discord_embed embed,
char  format[],
  ... 
)

Add URL to embed.

Note
the embed must be freed with discord_embed_cleanup() after its no longer being used
Parameters
embedthe embed being modified
formatprintf-like formatting string
...variadic arguments to be matched to format
Examples
embed.c.

◆ discord_embed_set_thumbnail()

void discord_embed_set_thumbnail ( struct discord_embed embed,
char  url[],
char  proxy_url[],
int  height,
int  width 
)

Add thumbnail to embed.

Note
the embed must be freed with discord_embed_cleanup() after its no longer being used
Parameters
embedthe embed being modified
urlsource url of thumbnail
proxy_urla proxied url of the thumbnail
heightheight of thumbnail
widthwidth of thumbnail

◆ discord_embed_set_image()

void discord_embed_set_image ( struct discord_embed embed,
char  url[],
char  proxy_url[],
int  height,
int  width 
)

Add image to embed.

Note
the embed must be freed with discord_embed_cleanup() after its no longer being used
Parameters
embedthe embed being modified
urlsource url of image
proxy_urla proxied url of the image
heightheight of image
widthwidth of image
Examples
embed.c.

◆ discord_embed_set_video()

void discord_embed_set_video ( struct discord_embed embed,
char  url[],
char  proxy_url[],
int  height,
int  width 
)

Add video to embed.

Note
the embed must be freed with discord_embed_cleanup() after its no longer being used
Parameters
embedthe embed being modified
urlsource url of video
proxy_urla proxied url of the video
heightheight of video
widthwidth of video

◆ discord_embed_set_footer()

void discord_embed_set_footer ( struct discord_embed embed,
char  text[],
char  icon_url[],
char  proxy_icon_url[] 
)

Add footer to embed.

Note
the embed must be freed with discord_embed_cleanup() after its no longer being used
Parameters
embedthe embed being modified
textfooter text
icon_urlurl of footer icon
proxy_icon_urla proxied url of footer icon
Examples
embed.c.

◆ discord_embed_set_provider()

void discord_embed_set_provider ( struct discord_embed embed,
char  name[],
char  url[] 
)

Add provider to embed.

Note
the embed must be freed with discord_embed_cleanup() after its no longer being used
Parameters
embedthe embed being modified
namename of provider
urlurl of provider

◆ discord_embed_set_author()

void discord_embed_set_author ( struct discord_embed embed,
char  name[],
char  url[],
char  icon_url[],
char  proxy_icon_url[] 
)

Add author to embed.

Note
the embed must be freed with discord_embed_cleanup() after its no longer being used
Parameters
embedthe embed being modified
namename of author
urlurl of author
icon_urlurl of author icon
proxy_icon_urla proxied url of author icon
Examples
embed.c.

◆ discord_embed_add_field()

void discord_embed_add_field ( struct discord_embed embed,
char  name[],
char  value[],
bool  Inline 
)

Add field to embed.

Note
the embed must be freed with discord_embed_cleanup() after its no longer being used
Parameters
embedthe embed being modified
namename of the field
valuevalue of the field
Inlinewhether or not this field should display inline
Examples
embed.c.