Datatypes#
-
struct discord_webhook#
- #include <webhook.h>
Methods
Initializer:
void discord_webhook_init(struct discord_webhook *)
Cleanup:
void discord_webhook_cleanup(struct discord_webhook *)
void discord_webhook_list_free(struct discord_webhook **)
JSON Decoder:
void discord_webhook_from_json(char *rbuf, size_t len, struct discord_webhook *)
void discord_webhook_list_from_json(char *rbuf, size_t len, struct discord_webhook ***)
JSON Encoder:
void discord_webhook_to_json(char *wbuf, size_t len, struct discord_webhook *)
void discord_webhook_list_to_json(char *wbuf, size_t len, struct discord_webhook **)
Public Members
-
u64_snowflake_t id#
the id of the webhook
-
enum discord_webhook_types type#
the type of the webhook
-
u64_snowflake_t guild_id#
the guild id this webhook is for, if any
-
u64_snowflake_t channel_id#
the channel id this webhook is for, if any
-
struct discord_user *user#
the user this webhook was created by (not returned when getting a webhook with its token
-
char *name#
-
char *avatar#
the default user avatar has of the webhook
-
char *token#
the secure token of the webhook (returned for Incoming Webhooks)
-
u64_snowflake_t application_id#
the bot/OAuth2 application that created this webhook
-
struct discord_guild *source_guild#
the guild of the channel that this webhook is following (returned for Channel Follower Webhook)
-
struct discord_channel *source_channel#
the channel that this webhook is following (returned for Channel Follower Webhooks)
-
char *url#
the url used for executing the webhook (returned by the webhooks OAuth2 flow)
Enums
-
enum discord_webhook_types#
Methods
char* discord_webhook_types_print(enum discord_webhook_types code)
enum discord_webhook_types discord_webhook_types_eval(char *code_as_str)
Values:
-
enumerator DISCORD_WEBHOOK_INCOMING = 1#
Incoming Webhooks can post messages to channels with a generated token
-
enumerator DISCORD_WEBHOOK_CHANNEL_FOLLOWER = 2#
Channel Follower Webhooks are internal webhooks used with Channel Following to post new messages int channels
-
enumerator DISCORD_WEBHOOK_APPLICATION = 3#
Application webhooks are webhooks used with interactions