Concord - C Discord API library
A Discord API wrapper library written in C
auto_moderation.h
Go to the documentation of this file.
1
6#ifndef API_AUTO_MODERATION_H
7#define API_AUTO_MODERATION_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 * Auto Moderation Datatypes
21 * **************************************************************************/
44};
52};
56};
64};
76 struct integers * presets;
77};
82
88
89};
91 struct discord_auto_moderation_action *array; int realsize; };
100
108
109};
117 char * name;
123
127
138};
141 struct discord_auto_moderation_rule *array; int realsize; };
143/*****************************************************************************
144 * Auto Moderation REST parameters
145 * **************************************************************************/
149 char * reason;
151 char * name;
155
159
163
167
173
177
178};
182 char * reason;
185 char * name;
186
190
194
198
204
208
209};
212 char * reason;
213};
214#include <stddef.h>
215#include <stdbool.h>
216#define JSMN_STRICT
217#define JSMN_HEADER
218#include "jsmn.h"
219#include "jsmn-find.h"
220#define JSONB_HEADER
221#include "json-build.h"
222#include <inttypes.h>
223#include "carray.h"
224#include "cog-utils.h"
225#include "types.h"
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
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
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
286
287
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
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
359long discord_auto_moderation_rule_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_auto_moderation_rule *self); size_t discord_auto_moderation_rule_from_json(const char buf[], size_t size, struct discord_auto_moderation_rule *self);
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376long discord_auto_moderation_rules_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_auto_moderation_rules *self); size_t discord_auto_moderation_rules_from_json(const char buf[], size_t size, struct discord_auto_moderation_rules *self);
377
378
379long discord_create_auto_moderation_rule_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_create_auto_moderation_rule *self); size_t discord_create_auto_moderation_rule_from_json(const char buf[], size_t size, struct discord_create_auto_moderation_rule *self);
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401long discord_modify_auto_moderation_rule_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_modify_auto_moderation_rule *self); size_t discord_modify_auto_moderation_rule_from_json(const char buf[], size_t size, struct discord_modify_auto_moderation_rule *self);
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
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488#endif /* API_AUTO_MODERATION_H */
size_t discord_create_auto_moderation_rule_from_json(const char buf[], size_t size, struct discord_create_auto_moderation_rule *self)
jsonbcode discord_modify_auto_moderation_rule_to_jsonb(jsonb *b, char buf[], size_t size, const struct discord_modify_auto_moderation_rule *self)
jsonbcode discord_create_auto_moderation_rule_to_jsonb(jsonb *b, char buf[], size_t size, const struct discord_create_auto_moderation_rule *self)
void discord_create_auto_moderation_rule_cleanup(struct discord_create_auto_moderation_rule *self)
void discord_modify_auto_moderation_rule_init(struct discord_modify_auto_moderation_rule *self)
size_t discord_auto_moderation_rules_from_json(const char buf[], size_t size, struct discord_auto_moderation_rules *self)
discord_auto_moderation_keyword_preset_types
Definition: auto_moderation.h:45
@ DISCORD_AUTO_MODERATION_SLURS
Definition: auto_moderation.h:51
@ DISCORD_AUTO_MODERATION_SEXUAL_CONTENT
Definition: auto_moderation.h:49
@ DISCORD_AUTO_MODERATION_PROFANITY
Definition: auto_moderation.h:47
void discord_create_auto_moderation_rule_init(struct discord_create_auto_moderation_rule *self)
void discord_auto_moderation_rule_init(struct discord_auto_moderation_rule *self)
long discord_auto_moderation_rules_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_auto_moderation_rules *self)
discord_auto_moderation_action_types
Definition: auto_moderation.h:57
@ DISCORD_AUTO_MODERATION_ACTION_BLOCK_MESSAGE
Definition: auto_moderation.h:59
@ DISCORD_AUTO_MODERATION_ACTION_TIMEOUT
Definition: auto_moderation.h:63
@ DISCORD_AUTO_MODERATION_ACTION_SEND_ALERT_MESSAGE
Definition: auto_moderation.h:61
long discord_create_auto_moderation_rule_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_create_auto_moderation_rule *self)
void discord_modify_auto_moderation_rule_cleanup(struct discord_modify_auto_moderation_rule *self)
discord_auto_moderation_event_types
Definition: auto_moderation.h:53
@ DISCORD_AUTO_MODERATION_MESSAGE_SEND
Definition: auto_moderation.h:55
void discord_auto_moderation_rule_cleanup(struct discord_auto_moderation_rule *self)
size_t discord_auto_moderation_rule_from_json(const char buf[], size_t size, struct discord_auto_moderation_rule *self)
discord_auto_moderation_trigger_types
Characterizes the type of content which can trigger the rule.
Definition: auto_moderation.h:23
@ DISCORD_AUTO_MODERATION_KEYWORD
Definition: auto_moderation.h:28
@ DISCORD_AUTO_MODERATION_KEYWORD_PRESET
Definition: auto_moderation.h:43
@ DISCORD_AUTO_MODERATION_SPAM
Definition: auto_moderation.h:38
@ DISCORD_AUTO_MODERATION_HARMFUL_LINK
Definition: auto_moderation.h:33
size_t discord_modify_auto_moderation_rule_from_json(const char buf[], size_t size, struct discord_modify_auto_moderation_rule *self)
size_t discord_modify_auto_moderation_rule_to_json(char buf[], size_t size, const struct discord_modify_auto_moderation_rule *self)
size_t discord_create_auto_moderation_rule_to_json(char buf[], size_t size, const struct discord_create_auto_moderation_rule *self)
long discord_modify_auto_moderation_rule_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_modify_auto_moderation_rule *self)
void discord_auto_moderation_rules_cleanup(struct discord_auto_moderation_rules *self)
long discord_auto_moderation_rule_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_auto_moderation_rule *self)
uint64_t u64snowflake
Snowflake datatype.
Definition: types.h:28
jsonbcode
json-builder return codes
Definition: json-build.h:34
Definition: auto_moderation.h:93
int duration_seconds
Definition: auto_moderation.h:107
u64snowflake channel_id
Definition: auto_moderation.h:99
Definition: auto_moderation.h:78
enum discord_auto_moderation_action_types type
Definition: auto_moderation.h:81
struct discord_auto_moderation_action_metadata * metadata
Definition: auto_moderation.h:87
Definition: auto_moderation.h:90
int size
Definition: auto_moderation.h:90
struct discord_auto_moderation_action * array
Definition: auto_moderation.h:91
Definition: auto_moderation.h:111
enum discord_auto_moderation_trigger_types trigger_type
Definition: auto_moderation.h:126
u64snowflake guild_id
Definition: auto_moderation.h:115
enum discord_auto_moderation_event_types event_type
Definition: auto_moderation.h:122
bool enabled
Definition: auto_moderation.h:133
struct snowflakes * exempt_channels
Definition: auto_moderation.h:137
u64snowflake id
Definition: auto_moderation.h:113
struct discord_auto_moderation_actions * actions
Definition: auto_moderation.h:129
char * name
Definition: auto_moderation.h:117
struct discord_auto_moderation_trigger_metadata * trigger_metadata
Definition: auto_moderation.h:131
u64snowflake creator_id
Definition: auto_moderation.h:119
struct snowflakes * exempt_roles
Definition: auto_moderation.h:135
Definition: auto_moderation.h:140
struct discord_auto_moderation_rule * array
Definition: auto_moderation.h:141
int size
Definition: auto_moderation.h:140
Definition: auto_moderation.h:65
struct integers * presets
Definition: auto_moderation.h:76
struct strings * keyword_filter
Definition: auto_moderation.h:70
Definition: auto_moderation.h:147
char * name
Definition: auto_moderation.h:151
struct snowflakes * exempt_channels
Definition: auto_moderation.h:176
struct discord_auto_moderation_trigger_metadata * trigger_metadata
Definition: auto_moderation.h:166
enum discord_auto_moderation_event_types event_type
Definition: auto_moderation.h:154
struct discord_auto_moderation_actions * actions
Definition: auto_moderation.h:162
struct snowflakes * exempt_roles
Definition: auto_moderation.h:172
char * reason
Definition: auto_moderation.h:149
bool enabled
Definition: auto_moderation.h:169
enum discord_auto_moderation_trigger_types trigger_type
Definition: auto_moderation.h:158
Definition: auto_moderation.h:210
char * reason
Definition: auto_moderation.h:212
Definition: auto_moderation.h:180
struct discord_auto_moderation_actions * actions
Definition: auto_moderation.h:197
char * reason
Definition: auto_moderation.h:182
bool enabled
Definition: auto_moderation.h:200
struct snowflakes * exempt_channels
Definition: auto_moderation.h:207
struct snowflakes * exempt_roles
Definition: auto_moderation.h:203
enum discord_auto_moderation_event_types event_type
Definition: auto_moderation.h:189
char * name
Definition: auto_moderation.h:185
struct discord_auto_moderation_trigger_metadata * trigger_metadata
Definition: auto_moderation.h:193
Definition: custom.h:36
Handle for building a JSON string.
Definition: json-build.h:61
Definition: custom.h:28
Definition: custom.h:20