Concord - C Discord API library
A Discord API wrapper library written in C
Receiving and sending

Receiving and sending interactions. More...

Collaboration diagram for Receiving and sending:

Data Structures

struct  discord_ret_interaction_response
 Request's return context. More...
 

Functions

CCORDcode discord_create_interaction_response (struct discord *client, u64snowflake interaction_id, const char interaction_token[], struct discord_interaction_response *params, struct discord_ret_interaction_response *ret)
 Create a response to an Interaction from the gateway. More...
 
CCORDcode discord_get_original_interaction_response (struct discord *client, u64snowflake application_id, const char interaction_token[], struct discord_ret_interaction_response *ret)
 Get the initial Interaction response. More...
 
CCORDcode discord_edit_original_interaction_response (struct discord *client, u64snowflake application_id, const char interaction_token[], struct discord_edit_original_interaction_response *params, struct discord_ret_interaction_response *ret)
 Edit the initial Interaction response. More...
 
CCORDcode discord_delete_original_interaction_response (struct discord *client, u64snowflake application_id, const char interaction_token[], struct discord_ret *ret)
 Delete the initial Interaction response. More...
 
CCORDcode discord_create_followup_message (struct discord *client, u64snowflake application_id, const char interaction_token[], struct discord_create_followup_message *params, struct discord_ret_webhook *ret)
 Create a followup message for an Interaction. More...
 
CCORDcode discord_get_followup_message (struct discord *client, u64snowflake application_id, const char interaction_token[], u64snowflake message_id, struct discord_ret_message *ret)
 Get a followup message for an interaction. More...
 
CCORDcode discord_edit_followup_message (struct discord *client, u64snowflake application_id, const char interaction_token[], u64snowflake message_id, struct discord_edit_followup_message *params, struct discord_ret_message *ret)
 Edits a followup message for an interaction. More...
 
CCORDcode discord_delete_followup_message (struct discord *client, u64snowflake application_id, const char interaction_token[], u64snowflake message_id, struct discord_ret *ret)
 Edits a followup message for an interaction. More...
 

Detailed Description

Receiving and sending interactions.

Function Documentation

◆ discord_create_interaction_response()

CCORDcode discord_create_interaction_response ( struct discord client,
u64snowflake  interaction_id,
const char  interaction_token[],
struct discord_interaction_response params,
struct discord_ret_interaction_response ret 
)

Create a response to an Interaction from the gateway.

Parameters
clientthe client created with discord_init()
interaction_idthe unique id of the interaction
interaction_tokenthe unique token of the interaction
paramsthe request parameters
retreturn context of the request. if successful a discord_interaction_response will be sent over to its assigned done callback
See also
discord_ret_interaction_response for more options
Returns
CCORDcode value for how the operation went, CCORD_OK means nothing out of the ordinary
Examples
components.c, slash-commands.c, and slash-commands2.c.

◆ discord_get_original_interaction_response()

CCORDcode discord_get_original_interaction_response ( struct discord client,
u64snowflake  application_id,
const char  interaction_token[],
struct discord_ret_interaction_response ret 
)

Get the initial Interaction response.

Parameters
clientthe client created with discord_init()
application_idthe unique id of the application
interaction_tokenthe unique token of the interaction
retreturn context of the request. if successful a discord_interaction_response will be sent over to its assigned done callback
See also
discord_ret_interaction_response for more options
Returns
CCORDcode value for how the operation went, CCORD_OK means nothing out of the ordinary

◆ discord_edit_original_interaction_response()

CCORDcode discord_edit_original_interaction_response ( struct discord client,
u64snowflake  application_id,
const char  interaction_token[],
struct discord_edit_original_interaction_response params,
struct discord_ret_interaction_response ret 
)

Edit the initial Interaction response.

Parameters
clientthe client created with discord_init()
application_idthe unique id of the application
interaction_tokenthe unique token of the interaction
paramsrequest parameters
retreturn context of the request. if successful a discord_interaction_response will be sent over to its assigned done callback
See also
discord_ret_interaction_response for more options
Returns
CCORDcode value for how the operation went, CCORD_OK means nothing out of the ordinary

◆ discord_delete_original_interaction_response()

CCORDcode discord_delete_original_interaction_response ( struct discord client,
u64snowflake  application_id,
const char  interaction_token[],
struct discord_ret ret 
)

Delete the initial Interaction response.

Parameters
clientthe client created with discord_init()
application_idthe unique id of the application
interaction_tokenthe unique token of the interaction
retreturn context of the request. if successful the assigned done will be triggered
See also
discord_ret for more options
Returns
CCORDcode value for how the operation went, CCORD_OK means nothing out of the ordinary

◆ discord_create_followup_message()

CCORDcode discord_create_followup_message ( struct discord client,
u64snowflake  application_id,
const char  interaction_token[],
struct discord_create_followup_message params,
struct discord_ret_webhook ret 
)

Create a followup message for an Interaction.

Parameters
clientthe client created with discord_init()
application_idthe unique id of the application
interaction_tokenthe unique token of the interaction
paramsrequest parameters
retreturn context of the request. if successful a discord_webhook will be sent over to its assigned done callback
See also
discord_ret_webhook for more options
Returns
CCORDcode value for how the operation went, CCORD_OK means nothing out of the ordinary

◆ discord_get_followup_message()

CCORDcode discord_get_followup_message ( struct discord client,
u64snowflake  application_id,
const char  interaction_token[],
u64snowflake  message_id,
struct discord_ret_message ret 
)

Get a followup message for an interaction.

Parameters
clientthe client created with discord_init()
application_idthe unique id of the application
interaction_tokenthe unique token of the interaction
message_idthe unique id of the message
retreturn context of the request. if successful a discord_message will be sent over to its assigned done callback
See also
discord_ret_message for more options
Returns
CCORDcode value for how the operation went, CCORD_OK means nothing out of the ordinary

◆ discord_edit_followup_message()

CCORDcode discord_edit_followup_message ( struct discord client,
u64snowflake  application_id,
const char  interaction_token[],
u64snowflake  message_id,
struct discord_edit_followup_message params,
struct discord_ret_message ret 
)

Edits a followup message for an interaction.

Parameters
clientthe client created with discord_init()
application_idthe unique id of the application
interaction_tokenthe unique token of the interaction
message_idthe unique id of the message
paramsrequest parameters
retreturn context of the request. if successful a discord_message will be sent over to its assigned done callback
See also
discord_ret_message for more options
Returns
CCORDcode value for how the operation went, CCORD_OK means nothing out of the ordinary

◆ discord_delete_followup_message()

CCORDcode discord_delete_followup_message ( struct discord client,
u64snowflake  application_id,
const char  interaction_token[],
u64snowflake  message_id,
struct discord_ret ret 
)

Edits a followup message for an interaction.

Parameters
clientthe client created with discord_init()
application_idthe unique id of the application
interaction_tokenthe unique token of the interaction
message_idthe unique id of the message
retreturn context of the request. if successful the assigned done will be triggered
See also
discord_ret for more options
Returns
CCORDcode value for how the operation went, CCORD_OK means nothing out of the ordinary