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

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

Collaboration diagram for Webhook:

Data Structures

struct  discord_ret_webhook
 Request's return context. More...
 
struct  discord_ret_webhooks
 Request's return context. More...
 

Functions

CCORDcode discord_create_webhook (struct discord *client, u64snowflake channel_id, struct discord_create_webhook *params, struct discord_ret_webhook *ret)
 Create a new webhook. More...
 
CCORDcode discord_get_channel_webhooks (struct discord *client, u64snowflake channel_id, struct discord_ret_webhooks *ret)
 Get webhooks from a given channel. More...
 
CCORDcode discord_get_guild_webhooks (struct discord *client, u64snowflake guild_id, struct discord_ret_webhooks *ret)
 Get webhooks from a given guild webhook objects. More...
 
CCORDcode discord_get_webhook (struct discord *client, u64snowflake webhook_id, struct discord_ret_webhook *ret)
 Get the new webhook object for the given id. More...
 
CCORDcode discord_get_webhook_with_token (struct discord *client, u64snowflake webhook_id, const char webhook_token[], struct discord_ret_webhook *ret)
 
CCORDcode discord_modify_webhook (struct discord *client, u64snowflake webhook_id, struct discord_modify_webhook *params, struct discord_ret_webhook *ret)
 Modify a webhook. More...
 
CCORDcode discord_modify_webhook_with_token (struct discord *client, u64snowflake webhook_id, const char webhook_token[], struct discord_modify_webhook_with_token *params, struct discord_ret_webhook *ret)
 
CCORDcode discord_delete_webhook (struct discord *client, u64snowflake webhook_id, struct discord_delete_webhook *params, struct discord_ret *ret)
 
CCORDcode discord_delete_webhook_with_token (struct discord *client, u64snowflake webhook_id, const char webhook_token[], struct discord_ret *ret)
 
CCORDcode discord_execute_webhook (struct discord *client, u64snowflake webhook_id, const char webhook_token[], struct discord_execute_webhook *params, struct discord_ret *ret)
 
CCORDcode discord_get_webhook_message (struct discord *client, u64snowflake webhook_id, const char webhook_token[], u64snowflake message_id, struct discord_ret_message *ret)
 Get previously-sent webhook message from the same token. More...
 
CCORDcode discord_edit_webhook_message (struct discord *client, u64snowflake webhook_id, const char webhook_token[], u64snowflake message_id, struct discord_edit_webhook_message *params, struct discord_ret_message *ret)
 Edits a previously-sent webhook message from the same token. More...
 
CCORDcode discord_delete_webhook_message (struct discord *client, u64snowflake webhook_id, const char webhook_token[], u64snowflake message_id, struct discord_ret *ret)
 Deletes a message that was created by the webhook. More...
 

Detailed Description

Webhook's public API supported by Concord.

Function Documentation

◆ discord_create_webhook()

CCORDcode discord_create_webhook ( struct discord client,
u64snowflake  channel_id,
struct discord_create_webhook params,
struct discord_ret_webhook ret 
)

Create a new webhook.

Note
Requires the MANAGE_WEBHOOKS permission
Parameters
clientthe client created with discord_init()
channel_idthe channel that the webhook belongs to
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_channel_webhooks()

CCORDcode discord_get_channel_webhooks ( struct discord client,
u64snowflake  channel_id,
struct discord_ret_webhooks ret 
)

Get webhooks from a given channel.

Note
Requires the MANAGE_WEBHOOKS permission
Parameters
clientthe client created with discord_init()
channel_idthe channel that the webhooks belongs to
retreturn context of the request. if successful a discord_webhooks will be sent over to its assigned done callback
See also
discord_ret_webhooks for more options
Returns
CCORDcode value for how the operation went, CCORD_OK means nothing out of the ordinary

◆ discord_get_guild_webhooks()

CCORDcode discord_get_guild_webhooks ( struct discord client,
u64snowflake  guild_id,
struct discord_ret_webhooks ret 
)

Get webhooks from a given guild webhook objects.

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

◆ discord_get_webhook()

CCORDcode discord_get_webhook ( struct discord client,
u64snowflake  webhook_id,
struct discord_ret_webhook ret 
)

Get the new webhook object for the given id.

Parameters
clientthe client created with discord_init()
webhook_idthe webhook itself
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_webhook_with_token()

CCORDcode discord_get_webhook_with_token ( struct discord client,
u64snowflake  webhook_id,
const char  webhook_token[],
struct discord_ret_webhook ret 
)

Same as discord_get_webhook(), except this call does not require authentication and returns no user in the webhook object

Parameters
clientthe client created with discord_init()
webhook_idthe webhook itself
webhook_tokenthe webhook token
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
Examples
webhook.c.

◆ discord_modify_webhook()

CCORDcode discord_modify_webhook ( struct discord client,
u64snowflake  webhook_id,
struct discord_modify_webhook params,
struct discord_ret_webhook ret 
)

Modify a webhook.

Note
Requires the MANAGE_WEBHOOKS permission
Parameters
clientthe client created with discord_init()
webhook_idthe webhook itself
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_modify_webhook_with_token()

CCORDcode discord_modify_webhook_with_token ( struct discord client,
u64snowflake  webhook_id,
const char  webhook_token[],
struct discord_modify_webhook_with_token params,
struct discord_ret_webhook ret 
)

Same discord_modify_webhook(), except this call does not require authentication and returns no user in the webhook object

Parameters
clientthe client created with discord_init()
webhook_idthe webhook itself
webhook_tokenthe webhook token
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_delete_webhook()

CCORDcode discord_delete_webhook ( struct discord client,
u64snowflake  webhook_id,
struct discord_delete_webhook params,
struct discord_ret ret 
)

Delete a webhook permanently. Requires the MANAGE_WEBHOOKS permission

Parameters
clientthe client created with discord_init()
webhook_idthe webhook itself
paramsrequest parameters
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_delete_webhook_with_token()

CCORDcode discord_delete_webhook_with_token ( struct discord client,
u64snowflake  webhook_id,
const char  webhook_token[],
struct discord_ret ret 
)

Same discord_delete_webhook(), except this call does not require authentication

Parameters
clientthe client created with discord_init()
webhook_idthe webhook itself
webhook_tokenthe webhook token
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_execute_webhook()

CCORDcode discord_execute_webhook ( struct discord client,
u64snowflake  webhook_id,
const char  webhook_token[],
struct discord_execute_webhook params,
struct discord_ret ret 
)
Parameters
clientthe client created with discord_init()
webhook_idthe webhook itself
webhook_tokenthe webhook token
paramsrequest parameters
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
Examples
webhook.c.

◆ discord_get_webhook_message()

CCORDcode discord_get_webhook_message ( struct discord client,
u64snowflake  webhook_id,
const char  webhook_token[],
u64snowflake  message_id,
struct discord_ret_message ret 
)

Get previously-sent webhook message from the same token.

Parameters
clientthe client created with discord_init()
webhook_idthe webhook itself
webhook_tokenthe webhook token
message_idthe message the webhook belongs to
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_webhook_message()

CCORDcode discord_edit_webhook_message ( struct discord client,
u64snowflake  webhook_id,
const char  webhook_token[],
u64snowflake  message_id,
struct discord_edit_webhook_message params,
struct discord_ret_message ret 
)

Edits a previously-sent webhook message from the same token.

Parameters
clientthe client created with discord_init()
webhook_idthe webhook itself
webhook_tokenthe webhook token
message_idthe message the webhook belongs to
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_webhook_message()

CCORDcode discord_delete_webhook_message ( struct discord client,
u64snowflake  webhook_id,
const char  webhook_token[],
u64snowflake  message_id,
struct discord_ret ret 
)

Deletes a message that was created by the webhook.

Parameters
clientthe client created with discord_init()
webhook_idthe webhook itself
webhook_tokenthe webhook token
message_idthe message the webhook belongs to
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