Orca
A bot framework that is easy to reason about, easy to debug, and easy to use.
webhook.h
Go to the documentation of this file.
1 /* This file is generated from specs/discord/webhook.json, Please don't edit it. */
18  /* specs/discord/webhook.json:12:20
19  '{ "name": "id", "type":{ "base":"char", "dec":"*", "converter":"snowflake" }}' */
20  u64_snowflake_t id;
21 
22  /* specs/discord/webhook.json:13:20
23  '{ "name": "type", "type":{ "base":"int", "int_alias":"enum discord_webhook_types" }}' */
24  enum discord_webhook_types type;
25 
26  /* specs/discord/webhook.json:14:20
27  '{ "name": "guild_id", "type":{ "base":"char", "dec":"*", "converter":"snowflake" }}' */
28  u64_snowflake_t guild_id;
29 
30  /* specs/discord/webhook.json:15:20
31  '{ "name": "channel_id", "type":{ "base":"char", "dec":"*", "converter":"snowflake" }}' */
32  u64_snowflake_t channel_id;
33 
34  /* specs/discord/webhook.json:16:20
35  '{ "name": "user", "type":{ "base":"struct discord_user", "dec":"*" }}' */
36  struct discord_user *user;
37 
38  /* specs/discord/webhook.json:17:20
39  '{ "name": "name", "type":{ "base":"char", "dec":"[WEBHOOK_NAME_LEN]" }}' */
40  char name[WEBHOOK_NAME_LEN];
41 
42  /* specs/discord/webhook.json:18:20
43  '{ "name": "avatar", "type":{ "base":"char", "dec":"*" }, "comment":"@todo fixed size limit"}' */
44  char *avatar; // @todo fixed size limit
45 
46  /* specs/discord/webhook.json:19:20
47  '{ "name": "token", "type":{ "base":"char", "dec":"*" }, "comment":"@todo fixed size limit"}' */
48  char *token; // @todo fixed size limit
49 
50  /* specs/discord/webhook.json:20:20
51  '{ "name": "application_id", "type":{ "base":"char", "dec":"*", "converter":"snowflake" }}' */
52  u64_snowflake_t application_id;
53 
54  // The following is metadata used to
55  // 1. control which field should be extracted/injected
56  // 2. record which field is presented(defined) in JSON
57  // 3. record which field is null in JSON
59  struct {
60  bool enable_arg_switches;
61  bool enable_record_defined;
62  bool enable_record_null;
63  void *arg_switches[9];
64  void *record_defined[9];
65  void *record_null[9];
66  } __M; // metadata
68 };
69 extern void discord_webhook_cleanup_v(void *p);
70 extern void discord_webhook_cleanup(struct discord_webhook *p);
71 extern void discord_webhook_init_v(void *p);
72 extern void discord_webhook_init(struct discord_webhook *p);
73 extern struct discord_webhook * discord_webhook_alloc();
74 extern void discord_webhook_free_v(void *p);
75 extern void discord_webhook_free(struct discord_webhook *p);
76 extern void discord_webhook_from_json_v(char *json, size_t len, void *p);
77 extern void discord_webhook_from_json(char *json, size_t len, struct discord_webhook *p);
78 extern size_t discord_webhook_to_json_v(char *json, size_t len, void *p);
79 extern size_t discord_webhook_to_json(char *json, size_t len, struct discord_webhook *p);
80 extern size_t discord_webhook_to_query_v(char *json, size_t len, void *p);
81 extern size_t discord_webhook_to_query(char *json, size_t len, struct discord_webhook *p);
82 extern void discord_webhook_list_free_v(void **p);
83 extern void discord_webhook_list_free(struct discord_webhook **p);
84 extern void discord_webhook_list_from_json_v(char *str, size_t len, void *p);
85 extern void discord_webhook_list_from_json(char *str, size_t len, struct discord_webhook ***p);
86 extern size_t discord_webhook_list_to_json_v(char *str, size_t len, void *p);
87 extern size_t discord_webhook_list_to_json(char *str, size_t len, struct discord_webhook **p);
88 
89 
90 enum discord_webhook_types {
91  DISCORD_WEBHOOK_INCOMING = 1,
92  DISCORD_WEBHOOK_CHANNEL_FOLLOWER = 2,
93 };
94 extern char* discord_webhook_types_to_string(enum discord_webhook_types);
95 extern enum discord_webhook_types discord_webhook_types_from_string(char*);
96 extern bool discord_webhook_types_has(enum discord_webhook_types, char*);
u64_snowflake_t
uint64_t u64_snowflake_t
snowflake datatype
Definition: discord.h:32
discord_user
User Structure.
Definition: user.h:45
discord_webhook
Webhook Structure.
Definition: webhook.h:17