Concord - C Discord API library
A Discord API wrapper library written in C
Gateway

Gateway's public API supported by Concord. More...

Collaboration diagram for Gateway:

Modules

 Helper functions
 Custom helper functions.
 

Functions

CCORDcode discord_get_gateway (struct discord *client, struct ccord_szbuf *ret)
 Get a single valid WSS URL, which the client can use for connecting. More...
 
CCORDcode discord_get_gateway_bot (struct discord *client, struct ccord_szbuf *ret)
 Get a single valid WSS URL, and additional metadata that can help during the operation of large bots. More...
 

Detailed Description

Gateway's public API supported by Concord.

Function Documentation

◆ discord_get_gateway()

CCORDcode discord_get_gateway ( struct discord client,
struct ccord_szbuf ret 
)

Get a single valid WSS URL, which the client can use for connecting.

Note
This route should be cached, and only call the function again if unable to properly establishing a connection with the cached version
Warning
This function blocks the running thread
Parameters
clientthe client created with discord_init()
retif successful, a ccord_szbuf containing the JSON response
reta sized buffer containing the response JSON
Returns
CCORDcode value for how the operation went, CCORD_OK means nothing out of the ordinary

◆ discord_get_gateway_bot()

CCORDcode discord_get_gateway_bot ( struct discord client,
struct ccord_szbuf ret 
)

Get a single valid WSS URL, and additional metadata that can help during the operation of large bots.

Note
This route should not be cached for extended periods of time as the value is not guaranteed to be the same per-call, and changes as the bot joins/leaves guilds
Warning
This function blocks the running thread
Parameters
clientthe client created with discord_init()
retif successful, a ccord_szbuf containing the JSON response
reta sized buffer containing the response JSON
Returns
CCORDcode value for how the operation went, CCORD_OK means nothing out of the ordinary