Concord - C Discord API library
A Discord API wrapper library written in C
Guild Template

Guild Template's public API supported by Concord. More...

Collaboration diagram for Guild Template:

Data Structures

struct  discord_ret_guild_template
 Request's return context. More...
 
struct  discord_ret_guild_templates
 Request's return context. More...
 

Functions

CCORDcode discord_get_guild_template (struct discord *client, const char template_code[], struct discord_ret_guild_template *ret)
 Get a guild template for the given code. More...
 
CCORDcode discord_create_guild_from_guild_template (struct discord *client, const char template_code[], struct discord_create_guild_from_guild_template *params, struct discord_ret_guild *ret)
 Create a new guild based on a template. More...
 
CCORDcode discord_get_guild_templates (struct discord *client, u64snowflake guild_id, struct discord_ret_guild_templates *ret)
 Returns discord_guild_templates from a guild. More...
 
CCORDcode discord_create_guild_template (struct discord *client, u64snowflake guild_id, struct discord_create_guild_template *params, struct discord_ret_guild_template *ret)
 Creates a template for the guild. More...
 
CCORDcode discord_sync_guild_template (struct discord *client, u64snowflake guild_id, const char template_code[], struct discord_ret_guild_template *ret)
 Syncs the template to the guild's current state. More...
 
CCORDcode discord_modify_guild_template (struct discord *client, u64snowflake guild_id, const char template_code[], struct discord_modify_guild_template *params, struct discord_ret_guild_template *ret)
 Modifies the template's metadata. More...
 
CCORDcode discord_delete_guild_template (struct discord *client, u64snowflake guild_id, const char template_code[], struct discord_ret_guild_template *ret)
 Deletes the guild template. More...
 

Detailed Description

Guild Template's public API supported by Concord.

Function Documentation

◆ discord_get_guild_template()

CCORDcode discord_get_guild_template ( struct discord client,
const char  template_code[],
struct discord_ret_guild_template ret 
)

Get a guild template for the given code.

Parameters
clientthe client created with discord_init()
template_codethe guild template code
retreturn context of the request. if successful a discord_guild_template will be sent over to its assigned done callback
See also
discord_ret_guild_template for more options
Returns
CCORDcode value for how the operation went, CCORD_OK means nothing out of the ordinary
Examples
guild-template.c.

◆ discord_create_guild_from_guild_template()

CCORDcode discord_create_guild_from_guild_template ( struct discord client,
const char  template_code[],
struct discord_create_guild_from_guild_template params,
struct discord_ret_guild ret 
)

Create a new guild based on a template.

Note
This endpoint can be used only by bots in less than 10 guilds
Parameters
clientthe client created with discord_init()
template_codethe guild template code
paramsthe request parameters
retreturn context of the request. if successful a discord_guild will be sent over to its assigned done callback
See also
discord_ret_guild for more options
Returns
CCORDcode value for how the operation went, CCORD_OK means nothing out of the ordinary

◆ discord_get_guild_templates()

CCORDcode discord_get_guild_templates ( struct discord client,
u64snowflake  guild_id,
struct discord_ret_guild_templates ret 
)

Returns discord_guild_templates from a guild.

Note
Requires the MANAGE_GUILD permission
Parameters
clientthe client created with discord_init()
guild_idthe guild to fetch the templates from
retreturn context of the request. if successful a discord_guild_templates will be sent over to its assigned done callback
See also
discord_ret_guild_templates for more options
Returns
CCORDcode value for how the operation went, CCORD_OK means nothing out of the ordinary

◆ discord_create_guild_template()

CCORDcode discord_create_guild_template ( struct discord client,
u64snowflake  guild_id,
struct discord_create_guild_template params,
struct discord_ret_guild_template ret 
)

Creates a template for the guild.

Note
Requires the MANAGE_GUILD permission
Parameters
clientthe client created with discord_init()
guild_idthe guild to create a template from
paramsthe request parameters
retreturn context of the request. if successful a discord_guild_template will be sent over to its assigned done callback
See also
discord_ret_guild_template for more options
Returns
CCORDcode value for how the operation went, CCORD_OK means nothing out of the ordinary
Examples
guild-template.c.

◆ discord_sync_guild_template()

CCORDcode discord_sync_guild_template ( struct discord client,
u64snowflake  guild_id,
const char  template_code[],
struct discord_ret_guild_template ret 
)

Syncs the template to the guild's current state.

Note
Requires the MANAGE_GUILD permission
Parameters
clientthe client created with discord_init()
guild_idthe guild to sync the template from
template_codethe guild template code
retreturn context of the request. if successful a discord_guild_template will be sent over to its assigned done callback
See also
discord_ret_guild_template for more options
Returns
CCORDcode value for how the operation went, CCORD_OK means nothing out of the ordinary
Examples
guild-template.c.

◆ discord_modify_guild_template()

CCORDcode discord_modify_guild_template ( struct discord client,
u64snowflake  guild_id,
const char  template_code[],
struct discord_modify_guild_template params,
struct discord_ret_guild_template ret 
)

Modifies the template's metadata.

Note
Requires the MANAGE_GUILD permission
Parameters
clientthe client created with discord_init()
guild_idthe guild to modify the template at
template_codethe guild template code
paramsthe request parameters
retreturn context of the request. if successful a discord_guild_template will be sent over to its assigned done callback
See also
discord_ret_guild_template for more options
Returns
CCORDcode value for how the operation went, CCORD_OK means nothing out of the ordinary

◆ discord_delete_guild_template()

CCORDcode discord_delete_guild_template ( struct discord client,
u64snowflake  guild_id,
const char  template_code[],
struct discord_ret_guild_template ret 
)

Deletes the guild template.

Note
Requires the MANAGE_GUILD permission
Parameters
clientthe client created with discord_init()
guild_idthe guild to delete the template at
template_codethe guild template code
retreturn context of the request. if successful a discord_guild_template will be sent over to its assigned done callback
See also
discord_ret_guild_template for more options
Returns
CCORDcode value for how the operation went, CCORD_OK means nothing out of the ordinary