Concord - C Discord API library
A Discord API wrapper library written in C
message_components.h File Reference

Generated code. More...

#include <stddef.h>
#include <stdbool.h>
#include <inttypes.h>
#include "carray.h"
#include "cog-utils.h"
#include "types.h"
#include "jsmn.h"
#include "jsmn-find.h"
#include "json-build.h"
Include dependency graph for message_components.h:

Go to the source code of this file.

Data Structures

struct  discord_component
 
struct  discord_components
 
struct  discord_select_option
 
struct  discord_select_options
 

Macros

#define JSMN_STRICT
 
#define JSMN_HEADER
 
#define JSONB_HEADER
 

Enumerations

enum  discord_component_types { DISCORD_COMPONENT_ACTION_ROW = 1 , DISCORD_COMPONENT_BUTTON = 2 , DISCORD_COMPONENT_SELECT_MENU = 3 , DISCORD_COMPONENT_TEXT_INPUT = 4 }
 
enum  discord_component_styles {
  DISCORD_BUTTON_PRIMARY = 1 , DISCORD_BUTTON_SECONDARY = 2 , DISCORD_BUTTON_SUCCESS = 3 , DISCORD_BUTTON_DANGER = 4 ,
  DISCORD_BUTTON_LINK = 5 , DISCORD_TEXT_SHORT = 1 , DISCORD_TEXT_PARAGRAPH = 2
}
 

Functions

void discord_component_init (struct discord_component *self)
 
void discord_component_cleanup (struct discord_component *self)
 
void discord_components_cleanup (struct discord_components *self)
 
void discord_select_options_cleanup (struct discord_select_options *self)
 
long discord_component_from_jsmnf (jsmnf_pair *root, const char *js, struct discord_component *self)
 
size_t discord_component_from_json (const char buf[], size_t size, struct discord_component *self)
 
long discord_components_from_jsmnf (jsmnf_pair *root, const char *js, struct discord_components *self)
 
size_t discord_components_from_json (const char buf[], size_t size, struct discord_components *self)
 
long discord_select_options_from_jsmnf (jsmnf_pair *root, const char *js, struct discord_select_options *self)
 
size_t discord_select_options_from_json (const char buf[], size_t size, struct discord_select_options *self)
 
jsonbcode discord_component_to_jsonb (jsonb *b, char buf[], size_t size, const struct discord_component *self)
 
size_t discord_component_to_json (char buf[], size_t size, const struct discord_component *self)
 
jsonbcode discord_components_to_jsonb (jsonb *b, char buf[], size_t size, const struct discord_components *self)
 
size_t discord_components_to_json (char buf[], size_t size, const struct discord_components *self)
 
jsonbcode discord_select_options_to_jsonb (jsonb *b, char buf[], size_t size, const struct discord_select_options *self)
 
size_t discord_select_options_to_json (char buf[], size_t size, const struct discord_select_options *self)
 

Detailed Description

Generated code.

Author
Cogmasters

Macro Definition Documentation

◆ JSMN_STRICT

#define JSMN_STRICT

◆ JSMN_HEADER

#define JSMN_HEADER

◆ JSONB_HEADER

#define JSONB_HEADER

Enumeration Type Documentation

◆ discord_component_types

Enumerator
DISCORD_COMPONENT_ACTION_ROW 

a container for the other components

DISCORD_COMPONENT_BUTTON 

a button object

DISCORD_COMPONENT_SELECT_MENU 

a select menu for picking from choices

DISCORD_COMPONENT_TEXT_INPUT 

a text input object

◆ discord_component_styles

Enumerator
DISCORD_BUTTON_PRIMARY 

blurple

DISCORD_BUTTON_SECONDARY 

grey

DISCORD_BUTTON_SUCCESS 

green

DISCORD_BUTTON_DANGER 

red

DISCORD_BUTTON_LINK 

grey, navigates to a URL

DISCORD_TEXT_SHORT 

a single-line input

DISCORD_TEXT_PARAGRAPH 

a multi-line input

Function Documentation

◆ discord_component_init()

void discord_component_init ( struct discord_component self)

◆ discord_component_cleanup()

void discord_component_cleanup ( struct discord_component self)

◆ discord_components_cleanup()

void discord_components_cleanup ( struct discord_components self)
Examples
components.c.

◆ discord_select_options_cleanup()

void discord_select_options_cleanup ( struct discord_select_options self)

◆ discord_component_from_jsmnf()

long discord_component_from_jsmnf ( jsmnf_pair root,
const char *  js,
struct discord_component self 
)

◆ discord_component_from_json()

size_t discord_component_from_json ( const char  buf[],
size_t  size,
struct discord_component self 
)

◆ discord_components_from_jsmnf()

long discord_components_from_jsmnf ( jsmnf_pair root,
const char *  js,
struct discord_components self 
)

◆ discord_components_from_json()

size_t discord_components_from_json ( const char  buf[],
size_t  size,
struct discord_components self 
)
Examples
components.c.

◆ discord_select_options_from_jsmnf()

long discord_select_options_from_jsmnf ( jsmnf_pair root,
const char *  js,
struct discord_select_options self 
)

◆ discord_select_options_from_json()

size_t discord_select_options_from_json ( const char  buf[],
size_t  size,
struct discord_select_options self 
)

◆ discord_component_to_jsonb()

jsonbcode discord_component_to_jsonb ( jsonb b,
char  buf[],
size_t  size,
const struct discord_component self 
)

◆ discord_component_to_json()

size_t discord_component_to_json ( char  buf[],
size_t  size,
const struct discord_component self 
)

◆ discord_components_to_jsonb()

jsonbcode discord_components_to_jsonb ( jsonb b,
char  buf[],
size_t  size,
const struct discord_components self 
)

◆ discord_components_to_json()

size_t discord_components_to_json ( char  buf[],
size_t  size,
const struct discord_components self 
)

◆ discord_select_options_to_jsonb()

jsonbcode discord_select_options_to_jsonb ( jsonb b,
char  buf[],
size_t  size,
const struct discord_select_options self 
)

◆ discord_select_options_to_json()

size_t discord_select_options_to_json ( char  buf[],
size_t  size,
const struct discord_select_options self 
)