Concord - C Discord API library
A Discord API wrapper library written in C
audit_log.h
Go to the documentation of this file.
1
6#ifndef API_AUDIT_LOG_H
7#define API_AUDIT_LOG_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 * Audit Logs Datatypes
21 * **************************************************************************/
75};
81
85
89
93
97
101
102};
109
117
121
123 char * reason;
124};
126 struct discord_audit_log_entry *array; int realsize; };
132 char * count;
142 char * role_name;
144 char * type;
145};
147 struct discord_optional_audit_entry_info *array; int realsize; };
155 char * key;
156};
158 struct discord_audit_log_change *array; int realsize; };
160/*****************************************************************************
161 * Audit Logs REST parameters
162 * **************************************************************************/
172 int limit;
173
174};
175#include <stddef.h>
176#include <stdbool.h>
177#define JSMN_STRICT
178#define JSMN_HEADER
179#include "jsmn.h"
180#include "jsmn-find.h"
181#define JSONB_HEADER
182#include "json-build.h"
183#include <inttypes.h>
184#include "carray.h"
185#include "cog-utils.h"
186#include "types.h"
187
188
189
190
191
192
193
194
195
196
197
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
227
228
229
230
231
232
233
234
235
236
237
238
239
240
242
243
244
245
246
247
248
249
250
251
252
253
254
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
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308long discord_audit_log_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_audit_log *self); size_t discord_audit_log_from_json(const char buf[], size_t size, struct discord_audit_log *self);
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367jsonbcode discord_audit_log_to_jsonb(jsonb *b, char buf[], size_t size, const struct discord_audit_log *self); size_t discord_audit_log_to_json(char buf[], size_t size, const struct discord_audit_log *self);
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426#endif /* API_AUDIT_LOG_H */
discord_audit_log_events
Definition: audit_log.h:22
@ DISCORD_AUDIT_LOG_INTEGRATION_CREATE
Definition: audit_log.h:55
@ DISCORD_AUDIT_LOG_WEBHOOK_CREATE
Definition: audit_log.h:45
@ DISCORD_AUDIT_LOG_AUTO_MODERATION_RULE_UPDATE
Definition: audit_log.h:72
@ DISCORD_AUDIT_LOG_EMOJI_DELETE
Definition: audit_log.h:50
@ DISCORD_AUDIT_LOG_MEMBER_UPDATE
Definition: audit_log.h:34
@ DISCORD_AUDIT_LOG_STICKER_UPDATE
Definition: audit_log.h:62
@ DISCORD_AUDIT_LOG_GUILD_SCHEDULED_EVENT_CREATE
Definition: audit_log.h:64
@ DISCORD_AUDIT_LOG_CHANNEL_CREATE
Definition: audit_log.h:24
@ DISCORD_AUDIT_LOG_MEMBER_MOVE
Definition: audit_log.h:36
@ DISCORD_AUDIT_LOG_APPLICATION_COMMAND_PERMISSION_UPDATE
Definition: audit_log.h:70
@ DISCORD_AUDIT_LOG_GUILD_UPDATE
Definition: audit_log.h:23
@ DISCORD_AUDIT_LOG_ROLE_UPDATE
Definition: audit_log.h:40
@ DISCORD_AUDIT_LOG_BOT_ADD
Definition: audit_log.h:38
@ DISCORD_AUDIT_LOG_STAGE_INSTANCE_CREATE
Definition: audit_log.h:58
@ DISCORD_AUDIT_LOG_CHANNEL_DELETE
Definition: audit_log.h:26
@ DISCORD_AUDIT_LOG_MEMBER_BAN_ADD
Definition: audit_log.h:32
@ DISCORD_AUDIT_LOG_INVITE_UPDATE
Definition: audit_log.h:43
@ DISCORD_AUDIT_LOG_ROLE_DELETE
Definition: audit_log.h:41
@ DISCORD_AUDIT_LOG_GUILD_SCHEDULED_EVENT_DELETE
Definition: audit_log.h:66
@ DISCORD_AUDIT_LOG_CHANNEL_OVERWRITE_DELETE
Definition: audit_log.h:29
@ DISCORD_AUDIT_LOG_INVITE_DELETE
Definition: audit_log.h:44
@ DISCORD_AUDIT_LOG_AUTO_MODERATION_RULE_DELETE
Definition: audit_log.h:73
@ DISCORD_AUDIT_LOG_INTEGRATION_DELETE
Definition: audit_log.h:57
@ DISCORD_AUDIT_LOG_MEMBER_ROLE_UPDATE
Definition: audit_log.h:35
@ DISCORD_AUDIT_LOG_EMOJI_UPDATE
Definition: audit_log.h:49
@ DISCORD_AUDIT_LOG_MEMBER_KICK
Definition: audit_log.h:30
@ DISCORD_AUDIT_LOG_THREAD_DELETE
Definition: audit_log.h:69
@ DISCORD_AUDIT_LOG_AUTO_MODERATION_BLOCK_MESSAGE
Definition: audit_log.h:74
@ DISCORD_AUDIT_LOG_THREAD_CREATE
Definition: audit_log.h:67
@ DISCORD_AUDIT_LOG_STICKER_CREATE
Definition: audit_log.h:61
@ DISCORD_AUDIT_LOG_MESSAGE_PIN
Definition: audit_log.h:53
@ DISCORD_AUDIT_LOG_MEMBER_BAN_REMOVE
Definition: audit_log.h:33
@ DISCORD_AUDIT_LOG_EMOJI_CREATE
Definition: audit_log.h:48
@ DISCORD_AUDIT_LOG_CHANNEL_OVERWRITE_UPDATE
Definition: audit_log.h:28
@ DISCORD_AUDIT_LOG_MESSAGE_DELETE
Definition: audit_log.h:51
@ DISCORD_AUDIT_LOG_ROLE_CREATE
Definition: audit_log.h:39
@ DISCORD_AUDIT_LOG_THREAD_UPDATE
Definition: audit_log.h:68
@ DISCORD_AUDIT_LOG_INVITE_CREATE
Definition: audit_log.h:42
@ DISCORD_AUDIT_LOG_MESSAGE_UNPIN
Definition: audit_log.h:54
@ DISCORD_AUDIT_LOG_CHANNEL_UPDATE
Definition: audit_log.h:25
@ DISCORD_AUDIT_LOG_WEBHOOK_UPDATE
Definition: audit_log.h:46
@ DISCORD_AUDIT_LOG_MESSAGE_BULK_DELETE
Definition: audit_log.h:52
@ DISCORD_AUDIT_LOG_CHANNEL_OVERWRITE_CREATE
Definition: audit_log.h:27
@ DISCORD_AUDIT_LOG_STICKER_DELETE
Definition: audit_log.h:63
@ DISCORD_AUDIT_LOG_GUILD_SCHEDULED_EVENT_UPDATE
Definition: audit_log.h:65
@ DISCORD_AUDIT_LOG_STAGE_INSTANCE_UPDATE
Definition: audit_log.h:59
@ DISCORD_AUDIT_LOG_MEMBER_PRUNE
Definition: audit_log.h:31
@ DISCORD_AUDIT_LOG_MEMBER_DISCONNECT
Definition: audit_log.h:37
@ DISCORD_AUDIT_LOG_INTEGRATION_UPDATE
Definition: audit_log.h:56
@ DISCORD_AUDIT_LOG_STAGE_INSTANCE_DELETE
Definition: audit_log.h:60
@ DISCORD_AUDIT_LOG_WEBHOOK_DELETE
Definition: audit_log.h:47
@ DISCORD_AUDIT_LOG_AUTO_MODERATION_RULE_CREATE
Definition: audit_log.h:71
void discord_audit_log_cleanup(struct discord_audit_log *self)
jsonbcode discord_audit_log_to_jsonb(jsonb *b, char buf[], size_t size, const struct discord_audit_log *self)
long discord_audit_log_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_audit_log *self)
void discord_audit_log_init(struct discord_audit_log *self)
size_t discord_audit_log_to_json(char buf[], size_t size, const struct discord_audit_log *self)
size_t discord_audit_log_from_json(const char buf[], size_t size, struct discord_audit_log *self)
uint64_t u64snowflake
Snowflake datatype.
Definition: types.h:28
char json_char
Raw JSON string.
Definition: types.h:44
jsonbcode
json-builder return codes
Definition: json-build.h:34
Definition: audit_log.h:149
json_char * new_value
Definition: audit_log.h:151
char * key
Definition: audit_log.h:155
json_char * old_value
Definition: audit_log.h:153
Definition: audit_log.h:157
int size
Definition: audit_log.h:157
struct discord_audit_log_change * array
Definition: audit_log.h:158
Definition: audit_log.h:125
struct discord_audit_log_entry * array
Definition: audit_log.h:126
int size
Definition: audit_log.h:125
Definition: audit_log.h:103
enum discord_audit_log_events action_type
Definition: audit_log.h:116
char * reason
Definition: audit_log.h:123
u64snowflake target_id
Definition: audit_log.h:105
u64snowflake user_id
Definition: audit_log.h:111
struct discord_optional_audit_entry_infos * options
Definition: audit_log.h:120
struct discord_audit_log_changes * changes
Definition: audit_log.h:108
u64snowflake id
Definition: audit_log.h:113
Definition: audit_log.h:77
struct discord_guild_scheduled_events * guild_scheduled_events
Definition: audit_log.h:84
struct discord_integrations * integrations
Definition: audit_log.h:88
struct discord_audit_log_entries * audit_log_entries
Definition: audit_log.h:80
struct discord_webhooks * webhooks
Definition: audit_log.h:100
struct discord_users * users
Definition: audit_log.h:96
struct discord_channels * threads
Definition: audit_log.h:92
Definition: channel.h:191
Definition: audit_log.h:163
u64snowflake before
Definition: audit_log.h:169
int action_type
Definition: audit_log.h:167
int limit
Definition: audit_log.h:172
u64snowflake user_id
Definition: audit_log.h:165
Definition: guild_scheduled_event.h:91
Definition: guild.h:371
Definition: audit_log.h:128
u64snowflake message_id
Definition: audit_log.h:140
char * delete_member_days
Definition: audit_log.h:134
char * role_name
Definition: audit_log.h:142
char * count
Definition: audit_log.h:132
u64snowflake id
Definition: audit_log.h:136
char * members_removed
Definition: audit_log.h:138
char * type
Definition: audit_log.h:144
u64snowflake channel_id
Definition: audit_log.h:130
Definition: audit_log.h:146
struct discord_optional_audit_entry_info * array
Definition: audit_log.h:147
int size
Definition: audit_log.h:146
Definition: user.h:104
Definition: webhook.h:64
Handle for building a JSON string.
Definition: json-build.h:61