Orca
A bot framework that is easy to reason about, easy to debug, and easy to use.
permissions.h
Go to the documentation of this file.
1 /* This file is generated from specs/discord/permissions.json, Please don't edit it. */
12 enum discord_permissions_bitwise_flags {
13  DISCORD_PERMISSIONS_ZERO = 0, // No permission bits
14  DISCORD_PERMISSIONS_CREATE_INSTANT_INVITE = 1, // Allows creation of instant invites T, V
15  DISCORD_PERMISSIONS_KICK_MEMBERS = 2, // Allows kicking members
16  DISCORD_PERMISSIONS_BAN_MEMBERS = 4, // Allows banning members
17  DISCORD_PERMISSIONS_ADMINISTRATOR = 8, // Allows all permissions and bypasses channel permission overwrites
18  DISCORD_PERMISSIONS_MANAGE_CHANNELS = 16, // Allows management and editing of channels T, V
19  DISCORD_PERMISSIONS_MANAGE_GUILD = 32, // Allows management and editing of the guild
20  DISCORD_PERMISSIONS_ADD_REACTIONS = 64, // Allows for the addition of reactions to messages T
21  DISCORD_PERMISSIONS_VIEW_AUDIT_LOG = 128, // Allows for viewing of audit logs
22  DISCORD_PERMISSIONS_PRIORITY_SPEAKER = 256, // Allows for using priority speaker in a voice channel V
23  DISCORD_PERMISSIONS_STREAM = 512, // Allows the user to go live V
24  DISCORD_PERMISSIONS_VIEW_CHANNEL = 1024, // Allows guild members to view a channel, which includes reading messages in text channels T, V
25  DISCORD_PERMISSIONS_SEND_MESSAGES = 2048, // Allows for sending messages in a channel T
26  DISCORD_PERMISSIONS_SEND_TTS_MESSAGES = 4096, // Allows for sending of /tts messages T
27  DISCORD_PERMISSIONS_MANAGE_MESSAGES = 8192, // Allows for deletion of other users messages T
28  DISCORD_PERMISSIONS_EMBED_LINKS = 16384, // Links sent by users with this permission will be auto-embedded T
29  DISCORD_PERMISSIONS_ATTACH_FILES = 32768, // Allows for uploading images and files T
30  DISCORD_PERMISSIONS_READ_MESSAGE_HISTORY = 65536, // Allows for reading of message history T
31  DISCORD_PERMISSIONS_MENTION_EVERYONE = 131072, // Allows for using the @everyone tag to notify all users in a channel, and the @here tag to notify all online users in a channel T
32  DISCORD_PERMISSIONS_USE_EXTERNAL_EMOJIS = 262144, // Allows the usage of custom emojis from other servers T
33  DISCORD_PERMISSIONS_VIEW_GUILD_INSIGHTS = 524288, // Allows for viewing guild insights
34  DISCORD_PERMISSIONS_CONNECT = 1048576, // Allows for joining of a voice channel V
35  DISCORD_PERMISSIONS_SPEAK = 2097152, // Allows for speaking in a voice channel V
36  DISCORD_PERMISSIONS_MUTE_MEMBERS = 4194304, // Allows for muting members in a voice channel V
37  DISCORD_PERMISSIONS_DEAFEN_MEMBERS = 8388608, // Allows for deafening of members in a voice channel V
38  DISCORD_PERMISSIONS_MOVE_MEMBERS = 16777216, // Allows for moving of members between voice channels V
39  DISCORD_PERMISSIONS_USE_VAD = 33554432, // Allows for using voice-activity-detection in a voice channel V
40  DISCORD_PERMISSIONS_CHANGE_NICKNAME = 67108864, // Allows for modification of own nickname
41  DISCORD_PERMISSIONS_MANAGE_NICKNAMES = 134217728, // Allows for modification of other users nicknames
42  DISCORD_PERMISSIONS_MANAGE_ROLES = 268435456, // Allows management and editing of roles T, V
43  DISCORD_PERMISSIONS_MANAGE_WEBHOOKS = 536870912, // Allows management and editing of webhooks T, V
44  DISCORD_PERMISSIONS_MANAGE_EMOJIS = 1073741824, // Allows management and editing of emojis
45 };
46 extern char* discord_permissions_bitwise_flags_to_string(enum discord_permissions_bitwise_flags);
47 extern enum discord_permissions_bitwise_flags discord_permissions_bitwise_flags_from_string(char*);
48 extern bool discord_permissions_bitwise_flags_has(enum discord_permissions_bitwise_flags, char*);
49 
57  /* specs/discord/permissions.json:52:20
58  '{ "name": "id", "type":{ "base":"char", "dec":"*", "converter":"snowflake" }}' */
59  u64_snowflake_t id;
60 
61  /* specs/discord/permissions.json:53:20
62  '{ "name": "name", "type":{ "base":"char", "dec":"[MAX_NAME_LEN]" }}' */
63  char name[MAX_NAME_LEN];
64 
65  /* specs/discord/permissions.json:54:20
66  '{ "name": "color", "type":{ "base":"int" }}' */
67  int color;
68 
69  /* specs/discord/permissions.json:55:20
70  '{ "name": "hoist", "type":{ "base":"bool" }}' */
71  bool hoist;
72 
73  /* specs/discord/permissions.json:56:20
74  '{ "name": "position", "type":{ "base":"int" }}' */
75  int position;
76 
77  /* specs/discord/permissions.json:57:20
78  '{ "name": "permissions", "type":{ "base":"char", "dec":"*" }}' */
79  char *permissions;
80 
81  /* specs/discord/permissions.json:58:20
82  '{ "name": "managed", "type":{ "base":"bool" }}' */
83  bool managed;
84 
85  /* specs/discord/permissions.json:59:20
86  '{ "name": "mentionable", "type":{ "base":"bool" }}' */
87  bool mentionable;
88 
89  /* specs/discord/permissions.json:60:20
90  '{ "name": "tags", "type":{"base":"struct discord_permissions_role_tags", "dec":"*"}}' */
91  struct discord_permissions_role_tags *tags;
92 
93  // The following is metadata used to
94  // 1. control which field should be extracted/injected
95  // 2. record which field is presented(defined) in JSON
96  // 3. record which field is null in JSON
98  struct {
99  bool enable_arg_switches;
100  bool enable_record_defined;
101  bool enable_record_null;
102  void *arg_switches[9];
103  void *record_defined[9];
104  void *record_null[9];
105  } __M; // metadata
107 };
108 extern void discord_permissions_role_cleanup_v(void *p);
109 extern void discord_permissions_role_cleanup(struct discord_permissions_role *p);
110 extern void discord_permissions_role_init_v(void *p);
111 extern void discord_permissions_role_init(struct discord_permissions_role *p);
112 extern struct discord_permissions_role * discord_permissions_role_alloc();
113 extern void discord_permissions_role_free_v(void *p);
114 extern void discord_permissions_role_free(struct discord_permissions_role *p);
115 extern void discord_permissions_role_from_json_v(char *json, size_t len, void *p);
116 extern void discord_permissions_role_from_json(char *json, size_t len, struct discord_permissions_role *p);
117 extern size_t discord_permissions_role_to_json_v(char *json, size_t len, void *p);
118 extern size_t discord_permissions_role_to_json(char *json, size_t len, struct discord_permissions_role *p);
119 extern size_t discord_permissions_role_to_query_v(char *json, size_t len, void *p);
120 extern size_t discord_permissions_role_to_query(char *json, size_t len, struct discord_permissions_role *p);
121 extern void discord_permissions_role_list_free_v(void **p);
122 extern void discord_permissions_role_list_free(struct discord_permissions_role **p);
123 extern void discord_permissions_role_list_from_json_v(char *str, size_t len, void *p);
124 extern void discord_permissions_role_list_from_json(char *str, size_t len, struct discord_permissions_role ***p);
125 extern size_t discord_permissions_role_list_to_json_v(char *str, size_t len, void *p);
126 extern size_t discord_permissions_role_list_to_json(char *str, size_t len, struct discord_permissions_role **p);
127 
135  /* specs/discord/permissions.json:70:20
136  '{ "name": "bot_id", "type":{ "base":"char", "dec":"*", "converter":"snowflake" }}' */
137  u64_snowflake_t bot_id;
138 
139  /* specs/discord/permissions.json:71:20
140  '{ "name": "integration_id", "type":{ "base":"char", "dec":"*", "converter":"snowflake" }}' */
141  u64_snowflake_t integration_id;
142 
143  /* specs/discord/permissions.json:72:20
144  '{ "name": "premium_subscriber", "type":{ "base":"int" }}' */
145  int premium_subscriber;
146 
147  // The following is metadata used to
148  // 1. control which field should be extracted/injected
149  // 2. record which field is presented(defined) in JSON
150  // 3. record which field is null in JSON
152  struct {
153  bool enable_arg_switches;
154  bool enable_record_defined;
155  bool enable_record_null;
156  void *arg_switches[3];
157  void *record_defined[3];
158  void *record_null[3];
159  } __M; // metadata
161 };
162 extern void discord_permissions_role_tags_cleanup_v(void *p);
163 extern void discord_permissions_role_tags_cleanup(struct discord_permissions_role_tags *p);
164 extern void discord_permissions_role_tags_init_v(void *p);
165 extern void discord_permissions_role_tags_init(struct discord_permissions_role_tags *p);
166 extern struct discord_permissions_role_tags * discord_permissions_role_tags_alloc();
167 extern void discord_permissions_role_tags_free_v(void *p);
168 extern void discord_permissions_role_tags_free(struct discord_permissions_role_tags *p);
169 extern void discord_permissions_role_tags_from_json_v(char *json, size_t len, void *p);
170 extern void discord_permissions_role_tags_from_json(char *json, size_t len, struct discord_permissions_role_tags *p);
171 extern size_t discord_permissions_role_tags_to_json_v(char *json, size_t len, void *p);
172 extern size_t discord_permissions_role_tags_to_json(char *json, size_t len, struct discord_permissions_role_tags *p);
173 extern size_t discord_permissions_role_tags_to_query_v(char *json, size_t len, void *p);
174 extern size_t discord_permissions_role_tags_to_query(char *json, size_t len, struct discord_permissions_role_tags *p);
175 extern void discord_permissions_role_tags_list_free_v(void **p);
176 extern void discord_permissions_role_tags_list_free(struct discord_permissions_role_tags **p);
177 extern void discord_permissions_role_tags_list_from_json_v(char *str, size_t len, void *p);
178 extern void discord_permissions_role_tags_list_from_json(char *str, size_t len, struct discord_permissions_role_tags ***p);
179 extern size_t discord_permissions_role_tags_list_to_json_v(char *str, size_t len, void *p);
180 extern size_t discord_permissions_role_tags_list_to_json(char *str, size_t len, struct discord_permissions_role_tags **p);
discord_permissions_role
Role Structure.
Definition: permissions.h:56
discord_permissions_role_tags
Role Tags Structure.
Definition: permissions.h:134
u64_snowflake_t
uint64_t u64_snowflake_t
snowflake datatype
Definition: discord.h:32