Concord - C Discord API library
A Discord API wrapper library written in C
invite.h
Go to the documentation of this file.
1
6#ifndef API_INVITE_H
7#define API_INVITE_H
8/* Allow symbols usage without GENCODECS_ prefix */
9#include <stddef.h>
10#include <stdbool.h>
11#include <inttypes.h>
12#include "carray.h"
13#include "cog-utils.h"
14#include "types.h"
15/* Custom JSON encoding macros */
16/* Custom JSON decoding macros */
17/* Custom field macros */
18/* if GENCODECS_READ is not specified then generate for all files */
19/*****************************************************************************
20 * Invite Datatypes
21 * **************************************************************************/
25};
29 char * code;
33
39
43
47
52
57 /* TODO: nullable */
61
66
71
72};
74struct discord_invites { int size;
75 struct discord_invite *array; int realsize; };
79 int uses;
89
90};
95
101 char * topic;
102};
103/*****************************************************************************
104 * Invite REST parameters
105 * **************************************************************************/
115
116};
119 char * reason;
120};
121#include <stddef.h>
122#include <stdbool.h>
123#define JSMN_STRICT
124#define JSMN_HEADER
125#include "jsmn.h"
126#include "jsmn-find.h"
127#define JSONB_HEADER
128#include "json-build.h"
129#include <inttypes.h>
130#include "carray.h"
131#include "cog-utils.h"
132#include "types.h"
133
134
135
136
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
188
189
190
191
192
193
194
195
196
197long discord_invite_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_invite *self); size_t discord_invite_from_json(const char buf[], size_t size, struct discord_invite *self);
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227long discord_invites_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_invites *self); size_t discord_invites_from_json(const char buf[], size_t size, struct discord_invites *self);
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247long discord_get_invite_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_get_invite *self); size_t discord_get_invite_from_json(const char buf[], size_t size, struct discord_get_invite *self);
248
249
250
251
252
253
254jsonbcode discord_invite_to_jsonb(jsonb *b, char buf[], size_t size, const struct discord_invite *self); size_t discord_invite_to_json(char buf[], size_t size, const struct discord_invite *self);
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284jsonbcode discord_invites_to_jsonb(jsonb *b, char buf[], size_t size, const struct discord_invites *self); size_t discord_invites_to_json(char buf[], size_t size, const struct discord_invites *self);
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304jsonbcode discord_get_invite_to_jsonb(jsonb *b, char buf[], size_t size, const struct discord_get_invite *self); size_t discord_get_invite_to_json(char buf[], size_t size, const struct discord_get_invite *self);
305
306
307
308
309
310
311#endif /* API_INVITE_H */
long discord_invite_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_invite *self)
size_t discord_get_invite_from_json(const char buf[], size_t size, struct discord_get_invite *self)
size_t discord_invite_from_json(const char buf[], size_t size, struct discord_invite *self)
jsonbcode discord_invite_to_jsonb(jsonb *b, char buf[], size_t size, const struct discord_invite *self)
void discord_invites_cleanup(struct discord_invites *self)
long discord_get_invite_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_get_invite *self)
size_t discord_invites_from_json(const char buf[], size_t size, struct discord_invites *self)
void discord_get_invite_cleanup(struct discord_get_invite *self)
long discord_invites_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_invites *self)
void discord_invite_init(struct discord_invite *self)
size_t discord_invites_to_json(char buf[], size_t size, const struct discord_invites *self)
void discord_invite_cleanup(struct discord_invite *self)
jsonbcode discord_get_invite_to_jsonb(jsonb *b, char buf[], size_t size, const struct discord_get_invite *self)
size_t discord_get_invite_to_json(char buf[], size_t size, const struct discord_get_invite *self)
size_t discord_invite_to_json(char buf[], size_t size, const struct discord_invite *self)
jsonbcode discord_invites_to_jsonb(jsonb *b, char buf[], size_t size, const struct discord_invites *self)
discord_invite_target_types
Definition: invite.h:22
@ DISCORD_INVITE_TARGET_EMBEDDED_APPLICATION
Definition: invite.h:24
@ DISCORD_INVITE_TARGET_STREAM
Definition: invite.h:23
void discord_get_invite_init(struct discord_get_invite *self)
uint64_t u64snowflake
Snowflake datatype.
Definition: types.h:28
uint64_t u64unix_ms
Unix time in milliseconds.
Definition: types.h:22
jsonbcode
json-builder return codes
Definition: json-build.h:34
Definition: application.h:35
Definition: channel.h:122
Definition: invite.h:117
char * reason
Definition: invite.h:119
Definition: invite.h:107
u64snowflake guild_scheduled_event_id
Definition: invite.h:114
bool with_expiration
Definition: invite.h:111
bool with_counts
Definition: invite.h:109
Definition: guild.h:331
Definition: guild_scheduled_event.h:38
Definition: guild.h:88
Definition: invite.h:77
u64unix_ms created_at
Definition: invite.h:88
int max_uses
Definition: invite.h:81
int uses
Definition: invite.h:79
int max_age
Definition: invite.h:83
bool temporary
Definition: invite.h:85
Definition: invite.h:91
struct discord_guild_members * members
Definition: invite.h:94
char * topic
Definition: invite.h:101
int participant_count
Definition: invite.h:97
int speaker_count
Definition: invite.h:99
Definition: invite.h:27
struct discord_user * inviter
Definition: invite.h:38
enum discord_invite_target_types target_type
Definition: invite.h:42
int approximate_member_count
Definition: invite.h:56
int approximate_presence_count
Definition: invite.h:54
struct discord_guild_scheduled_event * guild_scheduled_event
Definition: invite.h:70
u64unix_ms expires_at
Definition: invite.h:60
struct discord_application * target_application
Definition: invite.h:51
char * code
Definition: invite.h:29
struct discord_guild * guild
Definition: invite.h:32
struct discord_invite_stage_instance * stage_instance
Definition: invite.h:65
struct discord_channel * channel
Definition: invite.h:35
struct discord_user * target_user
Definition: invite.h:46
Definition: invite.h:74
struct discord_invite * array
Definition: invite.h:75
int size
Definition: invite.h:74
Definition: user.h:69
Handle for building a JSON string.
Definition: json-build.h:61