Concord - C Discord API library
A Discord API wrapper library written in C
gateway.h
Go to the documentation of this file.
1
6#ifndef API_GATEWAY_H
7#define API_GATEWAY_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 * Gateway Datatypes
21 * **************************************************************************/
26#define DISCORD_GATEWAY_GUILDS 1 << 0
27#define DISCORD_GATEWAY_GUILD_MEMBERS 1 << 1
28#define DISCORD_GATEWAY_GUILD_BANS 1 << 2
29#define DISCORD_GATEWAY_GUILD_EMOJIS_AND_STICKERS 1 << 3
30#define DISCORD_GATEWAY_GUILD_INTEGRATIONS 1 << 4
31#define DISCORD_GATEWAY_GUILD_WEBHOOKS 1 << 5
32#define DISCORD_GATEWAY_GUILD_INVITES 1 << 6
33#define DISCORD_GATEWAY_GUILD_VOICE_STATES 1 << 7
34#define DISCORD_GATEWAY_GUILD_PRESENCES 1 << 8
35#define DISCORD_GATEWAY_GUILD_MESSAGES 1 << 9
36#define DISCORD_GATEWAY_GUILD_MESSAGE_REACTIONS 1 << 10
37#define DISCORD_GATEWAY_GUILD_MESSAGE_TYPING 1 << 11
38#define DISCORD_GATEWAY_DIRECT_MESSAGES 1 << 12
39#define DISCORD_GATEWAY_DIRECT_MESSAGE_REACTIONS 1 << 13
40#define DISCORD_GATEWAY_DIRECT_MESSAGE_TYPING 1 << 14
41#define DISCORD_GATEWAY_MESSAGE_CONTENT 1 << 15
42#define DISCORD_GATEWAY_GUILD_SCHEDULED_EVENTS 1 << 16
43#define DISCORD_GATEWAY_AUTO_MODERATION_CONFIGURATION 1 << 20
44#define DISCORD_GATEWAY_AUTO_MODERATION_EXECUTION 1 << 21
50#define DISCORD_ACTIVITY_INSTANCE 1 << 0
51#define DISCORD_ACTIVITY_JOIN 1 << 1
52#define DISCORD_ACTIVITY_SPECTATE 1 << 2
53#define DISCORD_ACTIVITY_JOIN_REQUEST 1 << 3
54#define DISCORD_ACTIVITY_SYNC 1 << 4
55#define DISCORD_ACTIVITY_PLAY 1 << 5
56#define DISCORD_ACTIVITY_PARTY_PRIVACY_FRIENDS 1 << 6
57#define DISCORD_ACTIVITY_PARTY_PRIVACY_VOICE_CHANNEL 1 << 7
58#define DISCORD_ACTIVITY_EMBEDDED 1 << 8
76};
89};
107 char * name;
108
113 char * url;
114
119
123
127
130 char * details;
131
134 char * state;
135
139
143
147
151
160
161};
163 struct discord_activity *array; int realsize; };
170};
173 char * name;
178};
181 char * id;
184 struct integers * size;
185};
195};
198 char * join;
200 char * spectate;
202 char * match;
203};
206 char * label;
208 char * url;
209};
211 struct discord_activity_button *array; int realsize; };
218
222
225 char * status;
226
230
234
239
241 bool afk;
242};
246 char * desktop;
249 char * mobile;
252 char * web;
253};
255 struct discord_presence_update *array; int realsize; };
257/* GATEWAY COMMAND PAYLOADS ONLY NEED TO BE ENCODED INTO JSON */
261 char * token;
271 struct integers * shard;
272
276
280};
283 char * os;
285 char * browser;
287 char * device;
288};
292 char * token;
296 int seq;
297};
304 char * query;
307 int limit;
313
316 char * nonce;
317
318};
329};
330/* EVENT PAYLOADS ONLY NEED TO BE DECODED INTO STRUCTS */
334 int v;
343 struct integers * shard;
346};
367 char * content;
372};
389};
405};
414};
421};
428};
435};
442};
447};
454};
464 char * nick;
466 char * avatar;
472 bool deaf;
474 bool mute;
483};
502 char * nonce;
503};
510};
517};
524};
533};
542};
551};
557 char * code;
579 int uses;
580};
588 char * code;
589};
598};
602 struct snowflakes * ids;
607};
622};
635};
644};
655};
668};
672 char * token;
676 char * endpoint;
677};
684};
688 int total;
695};
696#include <stddef.h>
697#include <stdbool.h>
698#define JSMN_STRICT
699#define JSMN_HEADER
700#include "jsmn.h"
701#include "jsmn-find.h"
702#define JSONB_HEADER
703#include "json-build.h"
704#include <inttypes.h>
705#include "carray.h"
706#include "cog-utils.h"
707#include "types.h"
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
897
898
899
900
902
903
904
905
906
907
908
909
910
911
912
914
915
916
917
918
920
921
922
923
924
925
926
928
929
930
931
932
933
934
935
936
937
938
940
941
942
943
944
946
947
948
949
950
951
953
954
955
956
958
959
960
962
963
964
966
967
968
970
971
972
974
975
977
978
979
981
982
983
984
985
986
987
988
989
990
991
992
994
995
996
997
998
999
1000
1001
1003
1004
1005
1007
1008
1009
1011
1012
1013
1015
1016
1017
1018
1020
1021
1022
1023
1025
1026
1027
1028
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1044
1045
1046
1047
1049
1050
1051
1052
1054
1055
1056
1057
1059
1060
1061
1062
1063
1064
1065
1067
1068
1069
1070
1071
1072
1074
1075
1076
1077
1079
1080
1081
1082
1083
1085
1086
1087
1088
1089
1090
1092
1093
1094
1095
1097
1098
1099
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209long discord_presence_update_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_presence_update *self); size_t discord_presence_update_from_json(const char buf[], size_t size, struct discord_presence_update *self);
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238long discord_ready_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_ready *self); size_t discord_ready_from_json(const char buf[], size_t size, struct discord_ready *self);
1239
1240
1241
1242
1243
1244
1245
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258long discord_thread_list_sync_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_thread_list_sync *self); size_t discord_thread_list_sync_from_json(const char buf[], size_t size, struct discord_thread_list_sync *self);
1259
1260
1261
1262
1263
1264long discord_thread_members_update_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_thread_members_update *self); size_t discord_thread_members_update_from_json(const char buf[], size_t size, struct discord_thread_members_update *self);
1265
1266
1267
1268
1269
1270
1271long discord_channel_pins_update_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_channel_pins_update *self); size_t discord_channel_pins_update_from_json(const char buf[], size_t size, struct discord_channel_pins_update *self);
1272
1273
1274
1275
1276long discord_guild_ban_add_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_guild_ban_add *self); size_t discord_guild_ban_add_from_json(const char buf[], size_t size, struct discord_guild_ban_add *self);
1277
1278
1279
1280long discord_guild_ban_remove_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_guild_ban_remove *self); size_t discord_guild_ban_remove_from_json(const char buf[], size_t size, struct discord_guild_ban_remove *self);
1281
1282
1283
1284long discord_guild_emojis_update_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_guild_emojis_update *self); size_t discord_guild_emojis_update_from_json(const char buf[], size_t size, struct discord_guild_emojis_update *self);
1285
1286
1287
1288long discord_guild_stickers_update_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_guild_stickers_update *self); size_t discord_guild_stickers_update_from_json(const char buf[], size_t size, struct discord_guild_stickers_update *self);
1289
1290
1291
1292long discord_guild_integrations_update_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_guild_integrations_update *self); size_t discord_guild_integrations_update_from_json(const char buf[], size_t size, struct discord_guild_integrations_update *self);
1293
1294
1295long discord_guild_member_remove_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_guild_member_remove *self); size_t discord_guild_member_remove_from_json(const char buf[], size_t size, struct discord_guild_member_remove *self);
1296
1297
1298
1299long discord_guild_member_update_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_guild_member_update *self); size_t discord_guild_member_update_from_json(const char buf[], size_t size, struct discord_guild_member_update *self);
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312long discord_guild_members_chunk_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_guild_members_chunk *self); size_t discord_guild_members_chunk_from_json(const char buf[], size_t size, struct discord_guild_members_chunk *self);
1313
1314
1315
1316
1317
1318
1319
1320
1321long discord_guild_role_create_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_guild_role_create *self); size_t discord_guild_role_create_from_json(const char buf[], size_t size, struct discord_guild_role_create *self);
1322
1323
1324
1325long discord_guild_role_update_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_guild_role_update *self); size_t discord_guild_role_update_from_json(const char buf[], size_t size, struct discord_guild_role_update *self);
1326
1327
1328
1329long discord_guild_role_delete_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_guild_role_delete *self); size_t discord_guild_role_delete_from_json(const char buf[], size_t size, struct discord_guild_role_delete *self);
1330
1331
1332
1334
1335
1336
1337
1339
1340
1341
1342
1343long discord_integration_delete_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_integration_delete *self); size_t discord_integration_delete_from_json(const char buf[], size_t size, struct discord_integration_delete *self);
1344
1345
1346
1347
1348long discord_invite_create_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_invite_create *self); size_t discord_invite_create_from_json(const char buf[], size_t size, struct discord_invite_create *self);
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362long discord_invite_delete_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_invite_delete *self); size_t discord_invite_delete_from_json(const char buf[], size_t size, struct discord_invite_delete *self);
1363
1364
1365
1366
1367long discord_message_delete_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_message_delete *self); size_t discord_message_delete_from_json(const char buf[], size_t size, struct discord_message_delete *self);
1368
1369
1370
1371
1372long discord_message_delete_bulk_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_message_delete_bulk *self); size_t discord_message_delete_bulk_from_json(const char buf[], size_t size, struct discord_message_delete_bulk *self);
1373
1374
1375
1376
1377long discord_message_reaction_add_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_message_reaction_add *self); size_t discord_message_reaction_add_from_json(const char buf[], size_t size, struct discord_message_reaction_add *self);
1378
1379
1380
1381
1382
1383
1384
1385long discord_message_reaction_remove_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_message_reaction_remove *self); size_t discord_message_reaction_remove_from_json(const char buf[], size_t size, struct discord_message_reaction_remove *self);
1386
1387
1388
1389
1390
1391
1393
1394
1395
1396
1398
1399
1400
1401
1402
1403long discord_typing_start_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_typing_start *self); size_t discord_typing_start_from_json(const char buf[], size_t size, struct discord_typing_start *self);
1404
1405
1406
1407
1408
1409
1410long discord_voice_server_update_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_voice_server_update *self); size_t discord_voice_server_update_from_json(const char buf[], size_t size, struct discord_voice_server_update *self);
1411
1412
1413
1414
1415long discord_webhooks_update_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_webhooks_update *self); size_t discord_webhooks_update_from_json(const char buf[], size_t size, struct discord_webhooks_update *self);
1416
1417
1418
1419long discord_session_start_limit_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_session_start_limit *self); size_t discord_session_start_limit_from_json(const char buf[], size_t size, struct discord_session_start_limit *self);
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528jsonbcode discord_presence_update_to_jsonb(jsonb *b, char buf[], size_t size, const struct discord_presence_update *self); size_t discord_presence_update_to_json(char buf[], size_t size, const struct discord_presence_update *self);
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557jsonbcode discord_identify_to_jsonb(jsonb *b, char buf[], size_t size, const struct discord_identify *self); size_t discord_identify_to_json(char buf[], size_t size, const struct discord_identify *self);
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575jsonbcode discord_resume_to_jsonb(jsonb *b, char buf[], size_t size, const struct discord_resume *self); size_t discord_resume_to_json(char buf[], size_t size, const struct discord_resume *self);
1576
1577
1578
1579
1580jsonbcode discord_request_guild_members_to_jsonb(jsonb *b, char buf[], size_t size, const struct discord_request_guild_members *self); size_t discord_request_guild_members_to_json(char buf[], size_t size, const struct discord_request_guild_members *self);
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592jsonbcode discord_update_voice_state_to_jsonb(jsonb *b, char buf[], size_t size, const struct discord_update_voice_state *self); size_t discord_update_voice_state_to_json(char buf[], size_t size, const struct discord_update_voice_state *self);
1593
1594
1595
1596
1597
1598#endif /* API_GATEWAY_H */
discord_auto_moderation_trigger_types
Characterizes the type of content which can trigger the rule.
Definition: auto_moderation.h:23
void discord_message_reaction_add_init(struct discord_message_reaction_add *self)
long discord_guild_role_create_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_guild_role_create *self)
void discord_ready_init(struct discord_ready *self)
discord_gateway_opcodes
Definition: gateway.h:77
@ DISCORD_GATEWAY_HEARTBEAT_ACK
Definition: gateway.h:88
@ DISCORD_GATEWAY_DISPATCH
Definition: gateway.h:78
@ DISCORD_GATEWAY_RESUME
Definition: gateway.h:83
@ DISCORD_GATEWAY_RECONNECT
Definition: gateway.h:84
@ DISCORD_GATEWAY_HELLO
Definition: gateway.h:87
@ DISCORD_GATEWAY_IDENTIFY
Definition: gateway.h:80
@ DISCORD_GATEWAY_PRESENCE_UPDATE
Definition: gateway.h:81
@ DISCORD_GATEWAY_HEARTBEAT
Definition: gateway.h:79
@ DISCORD_GATEWAY_INVALID_SESSION
Definition: gateway.h:86
@ DISCORD_GATEWAY_VOICE_STATE_UPDATE
Definition: gateway.h:82
@ DISCORD_GATEWAY_REQUEST_GUILD_MEMBERS
Definition: gateway.h:85
void discord_guild_role_update_init(struct discord_guild_role_update *self)
size_t discord_guild_role_delete_from_json(const char buf[], size_t size, struct discord_guild_role_delete *self)
size_t discord_guild_member_update_from_json(const char buf[], size_t size, struct discord_guild_member_update *self)
size_t discord_session_start_limit_from_json(const char buf[], size_t size, struct discord_session_start_limit *self)
void discord_request_guild_members_cleanup(struct discord_request_guild_members *self)
size_t discord_message_reaction_remove_all_from_json(const char buf[], size_t size, struct discord_message_reaction_remove_all *self)
void discord_guild_ban_remove_init(struct discord_guild_ban_remove *self)
void discord_request_guild_members_init(struct discord_request_guild_members *self)
size_t discord_message_reaction_remove_from_json(const char buf[], size_t size, struct discord_message_reaction_remove *self)
long discord_guild_ban_remove_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_guild_ban_remove *self)
size_t discord_message_delete_bulk_from_json(const char buf[], size_t size, struct discord_message_delete_bulk *self)
long discord_message_reaction_add_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_message_reaction_add *self)
long discord_message_reaction_remove_all_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_message_reaction_remove_all *self)
size_t discord_identify_to_json(char buf[], size_t size, const struct discord_identify *self)
void discord_identify_init(struct discord_identify *self)
long discord_message_reaction_remove_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_message_reaction_remove *self)
void discord_message_reaction_remove_all_cleanup(struct discord_message_reaction_remove_all *self)
long discord_invite_create_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_invite_create *self)
long discord_integration_delete_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_integration_delete *self)
void discord_guild_ban_remove_cleanup(struct discord_guild_ban_remove *self)
size_t discord_channel_pins_update_from_json(const char buf[], size_t size, struct discord_channel_pins_update *self)
void discord_voice_server_update_init(struct discord_voice_server_update *self)
void discord_channel_pins_update_init(struct discord_channel_pins_update *self)
void discord_message_reaction_add_cleanup(struct discord_message_reaction_add *self)
long discord_guild_member_remove_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_guild_member_remove *self)
void discord_channel_pins_update_cleanup(struct discord_channel_pins_update *self)
void discord_resume_init(struct discord_resume *self)
long discord_guild_members_chunk_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_guild_members_chunk *self)
void discord_guild_scheduled_event_user_remove_init(struct discord_guild_scheduled_event_user_remove *self)
void discord_integration_delete_init(struct discord_integration_delete *self)
size_t discord_guild_stickers_update_from_json(const char buf[], size_t size, struct discord_guild_stickers_update *self)
size_t discord_guild_members_chunk_from_json(const char buf[], size_t size, struct discord_guild_members_chunk *self)
size_t discord_guild_role_create_from_json(const char buf[], size_t size, struct discord_guild_role_create *self)
void discord_integration_delete_cleanup(struct discord_integration_delete *self)
void discord_presence_update_init(struct discord_presence_update *self)
long discord_guild_stickers_update_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_guild_stickers_update *self)
long discord_presence_update_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_presence_update *self)
void discord_guild_members_chunk_cleanup(struct discord_guild_members_chunk *self)
size_t discord_guild_emojis_update_from_json(const char buf[], size_t size, struct discord_guild_emojis_update *self)
void discord_guild_members_chunk_init(struct discord_guild_members_chunk *self)
void discord_auto_moderation_action_execution_cleanup(struct discord_auto_moderation_action_execution *self)
void discord_ready_cleanup(struct discord_ready *self)
size_t discord_integration_delete_from_json(const char buf[], size_t size, struct discord_integration_delete *self)
void discord_guild_emojis_update_init(struct discord_guild_emojis_update *self)
long discord_channel_pins_update_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_channel_pins_update *self)
size_t discord_guild_scheduled_event_user_add_from_json(const char buf[], size_t size, struct discord_guild_scheduled_event_user_add *self)
long discord_thread_list_sync_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_thread_list_sync *self)
jsonbcode discord_request_guild_members_to_jsonb(jsonb *b, char buf[], size_t size, const struct discord_request_guild_members *self)
void discord_guild_member_remove_init(struct discord_guild_member_remove *self)
jsonbcode discord_identify_to_jsonb(jsonb *b, char buf[], size_t size, const struct discord_identify *self)
void discord_guild_role_create_cleanup(struct discord_guild_role_create *self)
void discord_guild_role_delete_cleanup(struct discord_guild_role_delete *self)
size_t discord_guild_member_remove_from_json(const char buf[], size_t size, struct discord_guild_member_remove *self)
void discord_guild_member_update_cleanup(struct discord_guild_member_update *self)
void discord_guild_role_create_init(struct discord_guild_role_create *self)
void discord_guild_ban_add_init(struct discord_guild_ban_add *self)
void discord_thread_members_update_cleanup(struct discord_thread_members_update *self)
jsonbcode discord_resume_to_jsonb(jsonb *b, char buf[], size_t size, const struct discord_resume *self)
size_t discord_presence_update_to_json(char buf[], size_t size, const struct discord_presence_update *self)
void discord_guild_member_remove_cleanup(struct discord_guild_member_remove *self)
void discord_message_reaction_remove_cleanup(struct discord_message_reaction_remove *self)
long discord_guild_scheduled_event_user_add_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_guild_scheduled_event_user_add *self)
size_t discord_auto_moderation_action_execution_from_json(const char buf[], size_t size, struct discord_auto_moderation_action_execution *self)
size_t discord_ready_from_json(const char buf[], size_t size, struct discord_ready *self)
void discord_guild_stickers_update_cleanup(struct discord_guild_stickers_update *self)
void discord_invite_create_init(struct discord_invite_create *self)
void discord_guild_role_update_cleanup(struct discord_guild_role_update *self)
size_t discord_resume_to_json(char buf[], size_t size, const struct discord_resume *self)
void discord_message_delete_bulk_cleanup(struct discord_message_delete_bulk *self)
void discord_invite_delete_init(struct discord_invite_delete *self)
void discord_guild_integrations_update_cleanup(struct discord_guild_integrations_update *self)
size_t discord_thread_list_sync_from_json(const char buf[], size_t size, struct discord_thread_list_sync *self)
void discord_voice_server_update_cleanup(struct discord_voice_server_update *self)
size_t discord_guild_ban_remove_from_json(const char buf[], size_t size, struct discord_guild_ban_remove *self)
void discord_guild_scheduled_event_user_remove_cleanup(struct discord_guild_scheduled_event_user_remove *self)
long discord_message_delete_bulk_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_message_delete_bulk *self)
long discord_auto_moderation_action_execution_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_auto_moderation_action_execution *self)
void discord_guild_member_update_init(struct discord_guild_member_update *self)
size_t discord_invite_create_from_json(const char buf[], size_t size, struct discord_invite_create *self)
void discord_guild_integrations_update_init(struct discord_guild_integrations_update *self)
void discord_message_delete_bulk_init(struct discord_message_delete_bulk *self)
void discord_webhooks_update_cleanup(struct discord_webhooks_update *self)
void discord_typing_start_cleanup(struct discord_typing_start *self)
void discord_session_start_limit_init(struct discord_session_start_limit *self)
void discord_message_reaction_remove_init(struct discord_message_reaction_remove *self)
void discord_guild_emojis_update_cleanup(struct discord_guild_emojis_update *self)
void discord_guild_role_delete_init(struct discord_guild_role_delete *self)
void discord_update_voice_state_init(struct discord_update_voice_state *self)
void discord_message_delete_init(struct discord_message_delete *self)
void discord_thread_list_sync_cleanup(struct discord_thread_list_sync *self)
void discord_thread_list_sync_init(struct discord_thread_list_sync *self)
discord_activity_types
Definition: gateway.h:90
@ DISCORD_ACTIVITY_COMPETING
Definition: gateway.h:102
@ DISCORD_ACTIVITY_GAME
Definition: gateway.h:92
@ DISCORD_ACTIVITY_WATCHING
Definition: gateway.h:98
@ DISCORD_ACTIVITY_CUSTOM
Definition: gateway.h:100
@ DISCORD_ACTIVITY_LISTENING
Definition: gateway.h:96
@ DISCORD_ACTIVITY_STREAMING
Definition: gateway.h:94
void discord_invite_delete_cleanup(struct discord_invite_delete *self)
void discord_message_reaction_remove_emoji_init(struct discord_message_reaction_remove_emoji *self)
size_t discord_voice_server_update_from_json(const char buf[], size_t size, struct discord_voice_server_update *self)
discord_gateway_close_opcodes
Definition: gateway.h:60
@ DISCORD_GATEWAY_CLOSE_REASON_INVALID_API_VERSION
Definition: gateway.h:72
@ DISCORD_GATEWAY_CLOSE_REASON_INVALID_SHARD
Definition: gateway.h:70
@ DISCORD_GATEWAY_CLOSE_REASON_RECONNECT
Definition: gateway.h:75
@ DISCORD_GATEWAY_CLOSE_REASON_AUTHENTICATION_FAILED
Definition: gateway.h:65
@ DISCORD_GATEWAY_CLOSE_REASON_DISALLOWED_INTENTS
Definition: gateway.h:74
@ DISCORD_GATEWAY_CLOSE_REASON_INVALID_SEQUENCE
Definition: gateway.h:67
@ DISCORD_GATEWAY_CLOSE_REASON_ALREADY_AUTHENTICATED
Definition: gateway.h:66
@ DISCORD_GATEWAY_CLOSE_REASON_RATE_LIMITED
Definition: gateway.h:68
@ DISCORD_GATEWAY_CLOSE_REASON_SESSION_TIMED_OUT
Definition: gateway.h:69
@ DISCORD_GATEWAY_CLOSE_REASON_SHARDING_REQUIRED
Definition: gateway.h:71
@ DISCORD_GATEWAY_CLOSE_REASON_DECODE_ERROR
Definition: gateway.h:63
@ DISCORD_GATEWAY_CLOSE_REASON_INVALID_INTENTS
Definition: gateway.h:73
@ DISCORD_GATEWAY_CLOSE_REASON_NOT_AUTHENTICATED
Definition: gateway.h:64
@ DISCORD_GATEWAY_CLOSE_REASON_UNKNOWN_ERROR
Definition: gateway.h:61
@ DISCORD_GATEWAY_CLOSE_REASON_UNKNOWN_OPCODE
Definition: gateway.h:62
void discord_message_delete_cleanup(struct discord_message_delete *self)
void discord_message_reaction_remove_all_init(struct discord_message_reaction_remove_all *self)
void discord_session_start_limit_cleanup(struct discord_session_start_limit *self)
long discord_guild_member_update_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_guild_member_update *self)
void discord_auto_moderation_action_execution_init(struct discord_auto_moderation_action_execution *self)
size_t discord_message_reaction_add_from_json(const char buf[], size_t size, struct discord_message_reaction_add *self)
jsonbcode discord_presence_update_to_jsonb(jsonb *b, char buf[], size_t size, const struct discord_presence_update *self)
long discord_message_delete_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_message_delete *self)
long discord_message_reaction_remove_emoji_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_message_reaction_remove_emoji *self)
void discord_resume_cleanup(struct discord_resume *self)
void discord_webhooks_update_init(struct discord_webhooks_update *self)
size_t discord_invite_delete_from_json(const char buf[], size_t size, struct discord_invite_delete *self)
void discord_guild_scheduled_event_user_add_cleanup(struct discord_guild_scheduled_event_user_add *self)
long discord_session_start_limit_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_session_start_limit *self)
void discord_guild_scheduled_event_user_add_init(struct discord_guild_scheduled_event_user_add *self)
long discord_typing_start_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_typing_start *self)
void discord_invite_create_cleanup(struct discord_invite_create *self)
size_t discord_guild_scheduled_event_user_remove_from_json(const char buf[], size_t size, struct discord_guild_scheduled_event_user_remove *self)
void discord_typing_start_init(struct discord_typing_start *self)
long discord_invite_delete_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_invite_delete *self)
size_t discord_typing_start_from_json(const char buf[], size_t size, struct discord_typing_start *self)
long discord_voice_server_update_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_voice_server_update *self)
size_t discord_update_voice_state_to_json(char buf[], size_t size, const struct discord_update_voice_state *self)
size_t discord_request_guild_members_to_json(char buf[], size_t size, const struct discord_request_guild_members *self)
void discord_thread_members_update_init(struct discord_thread_members_update *self)
long discord_guild_emojis_update_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_guild_emojis_update *self)
size_t discord_guild_integrations_update_from_json(const char buf[], size_t size, struct discord_guild_integrations_update *self)
void discord_message_reaction_remove_emoji_cleanup(struct discord_message_reaction_remove_emoji *self)
long discord_guild_integrations_update_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_guild_integrations_update *self)
long discord_thread_members_update_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_thread_members_update *self)
jsonbcode discord_update_voice_state_to_jsonb(jsonb *b, char buf[], size_t size, const struct discord_update_voice_state *self)
size_t discord_message_reaction_remove_emoji_from_json(const char buf[], size_t size, struct discord_message_reaction_remove_emoji *self)
long discord_webhooks_update_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_webhooks_update *self)
void discord_presence_update_cleanup(struct discord_presence_update *self)
size_t discord_guild_ban_add_from_json(const char buf[], size_t size, struct discord_guild_ban_add *self)
void discord_update_voice_state_cleanup(struct discord_update_voice_state *self)
void discord_guild_stickers_update_init(struct discord_guild_stickers_update *self)
void discord_identify_cleanup(struct discord_identify *self)
long discord_guild_scheduled_event_user_remove_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_guild_scheduled_event_user_remove *self)
size_t discord_guild_role_update_from_json(const char buf[], size_t size, struct discord_guild_role_update *self)
long discord_guild_role_update_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_guild_role_update *self)
size_t discord_webhooks_update_from_json(const char buf[], size_t size, struct discord_webhooks_update *self)
size_t discord_message_delete_from_json(const char buf[], size_t size, struct discord_message_delete *self)
size_t discord_presence_update_from_json(const char buf[], size_t size, struct discord_presence_update *self)
long discord_guild_role_delete_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_guild_role_delete *self)
long discord_ready_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_ready *self)
size_t discord_thread_members_update_from_json(const char buf[], size_t size, struct discord_thread_members_update *self)
long discord_guild_ban_add_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_guild_ban_add *self)
void discord_guild_ban_add_cleanup(struct discord_guild_ban_add *self)
discord_invite_target_types
Definition: invite.h:22
uint64_t u64snowflake
Snowflake datatype.
Definition: types.h:28
uint64_t u64bitmask
Bitmask primitive.
Definition: types.h:35
uint64_t u64unix_ms
Unix time in milliseconds.
Definition: types.h:22
jsonbcode
json-builder return codes
Definition: json-build.h:34
Definition: gateway.h:162
struct discord_activity * array
Definition: gateway.h:163
int size
Definition: gateway.h:162
Definition: gateway.h:186
char * large_text
Definition: gateway.h:190
char * small_image
Definition: gateway.h:192
char * small_text
Definition: gateway.h:194
char * large_image
Definition: gateway.h:188
Definition: gateway.h:204
char * label
Definition: gateway.h:206
char * url
Definition: gateway.h:208
Definition: gateway.h:210
int size
Definition: gateway.h:210
struct discord_activity_button * array
Definition: gateway.h:211
Definition: gateway.h:171
u64snowflake id
Definition: gateway.h:175
bool animated
Definition: gateway.h:177
char * name
Definition: gateway.h:173
Definition: gateway.h:179
struct integers * size
Definition: gateway.h:184
char * id
Definition: gateway.h:181
Definition: gateway.h:196
char * spectate
Definition: gateway.h:200
char * match
Definition: gateway.h:202
char * join
Definition: gateway.h:198
Definition: gateway.h:165
u64unix_ms end
Definition: gateway.h:169
u64unix_ms start
Definition: gateway.h:167
Definition: gateway.h:104
struct discord_activity_assets * assets
Definition: gateway.h:146
struct discord_activity_secrets * secrets
Definition: gateway.h:150
struct discord_activity_timestamps * timestamps
Definition: gateway.h:122
char * name
Definition: gateway.h:107
struct discord_activity_emoji * emoji
Definition: gateway.h:138
u64unix_ms created_at
Definition: gateway.h:118
char * state
Definition: gateway.h:134
bool instance
Definition: gateway.h:153
u64snowflake application_id
Definition: gateway.h:126
struct discord_activity_party * party
Definition: gateway.h:142
u64bitmask flags
Definition: gateway.h:156
char * details
Definition: gateway.h:130
enum discord_activity_types type
Definition: gateway.h:110
struct discord_activity_buttons * buttons
Definition: gateway.h:159
char * url
Definition: gateway.h:113
Definition: application.h:35
struct discord_auto_moderation_action * action
Definition: gateway.h:352
u64snowflake guild_id
Definition: gateway.h:350
enum discord_auto_moderation_trigger_types rule_trigger_type
Definition: gateway.h:354
char * matched_keyword
Definition: gateway.h:369
u64snowflake alert_system_message_id
Definition: gateway.h:365
u64snowflake message_id
Definition: gateway.h:360
char * content
Definition: gateway.h:367
u64snowflake user_id
Definition: gateway.h:356
u64snowflake channel_id
Definition: gateway.h:358
char * matched_content
Definition: gateway.h:371
Definition: auto_moderation.h:78
Definition: gateway.h:407
u64unix_ms last_pin_timestamp
Definition: gateway.h:413
u64snowflake guild_id
Definition: gateway.h:409
u64snowflake channel_id
Definition: gateway.h:411
Definition: channel.h:191
Definition: gateway.h:243
char * mobile
Definition: gateway.h:249
char * desktop
Definition: gateway.h:246
char * web
Definition: gateway.h:252
Definition: emoji.h:23
Definition: emoji.h:47
Definition: gateway.h:416
u64snowflake guild_id
Definition: gateway.h:418
struct discord_user * user
Definition: gateway.h:420
Definition: gateway.h:423
struct discord_user * user
Definition: gateway.h:427
u64snowflake guild_id
Definition: gateway.h:425
Definition: gateway.h:430
u64snowflake guild_id
Definition: gateway.h:432
struct discord_emojis * emojis
Definition: gateway.h:434
Definition: gateway.h:444
u64snowflake guild_id
Definition: gateway.h:446
Definition: gateway.h:449
u64snowflake guild_id
Definition: gateway.h:451
struct discord_user * user
Definition: gateway.h:453
Definition: gateway.h:456
u64unix_ms joined_at
Definition: gateway.h:468
u64unix_ms communication_disabled_until
Definition: gateway.h:482
bool deaf
Definition: gateway.h:472
struct snowflakes * roles
Definition: gateway.h:460
char * avatar
Definition: gateway.h:466
u64snowflake guild_id
Definition: gateway.h:458
bool mute
Definition: gateway.h:474
bool pending
Definition: gateway.h:477
struct discord_user * user
Definition: gateway.h:462
char * nick
Definition: gateway.h:464
u64unix_ms premium_since
Definition: gateway.h:470
Definition: guild.h:290
Definition: gateway.h:485
int chunk_index
Definition: gateway.h:492
struct snowflakes * not_found
Definition: gateway.h:497
int chunk_count
Definition: gateway.h:494
char * nonce
Definition: gateway.h:502
struct discord_guild_members * members
Definition: gateway.h:489
u64snowflake guild_id
Definition: gateway.h:487
struct discord_presence_updates * presences
Definition: gateway.h:500
Definition: guild.h:331
Definition: gateway.h:505
struct discord_role * role
Definition: gateway.h:509
u64snowflake guild_id
Definition: gateway.h:507
Definition: gateway.h:519
u64snowflake guild_id
Definition: gateway.h:521
u64snowflake role_id
Definition: gateway.h:523
Definition: gateway.h:512
u64snowflake guild_id
Definition: gateway.h:514
struct discord_role * role
Definition: gateway.h:516
u64snowflake user_id
Definition: gateway.h:530
u64snowflake guild_scheduled_event_id
Definition: gateway.h:528
u64snowflake guild_id
Definition: gateway.h:532
u64snowflake user_id
Definition: gateway.h:539
u64snowflake guild_scheduled_event_id
Definition: gateway.h:537
u64snowflake guild_id
Definition: gateway.h:541
Definition: gateway.h:437
struct discord_stickers * stickers
Definition: gateway.h:441
u64snowflake guild_id
Definition: gateway.h:439
Definition: guild.h:237
Definition: gateway.h:281
char * browser
Definition: gateway.h:285
char * os
Definition: gateway.h:283
char * device
Definition: gateway.h:287
Definition: gateway.h:259
char * token
Definition: gateway.h:261
struct integers * shard
Definition: gateway.h:271
struct discord_identify_connection * properties
Definition: gateway.h:263
bool compress
Definition: gateway.h:265
u64bitmask intents
Definition: gateway.h:279
int large_threshold
Definition: gateway.h:268
struct discord_presence_update * presence
Definition: gateway.h:275
Definition: gateway.h:544
u64snowflake id
Definition: gateway.h:546
u64snowflake application_id
Definition: gateway.h:550
u64snowflake guild_id
Definition: gateway.h:548
Definition: gateway.h:553
int max_age
Definition: gateway.h:565
u64unix_ms created_at
Definition: gateway.h:559
char * code
Definition: gateway.h:557
struct discord_user * target_user
Definition: gateway.h:571
struct discord_user * inviter
Definition: gateway.h:563
int max_uses
Definition: gateway.h:567
enum discord_invite_target_types target_type
Definition: gateway.h:569
int uses
Definition: gateway.h:579
u64snowflake guild_id
Definition: gateway.h:561
bool temporary
Definition: gateway.h:577
u64snowflake channel_id
Definition: gateway.h:555
struct discord_application * target_application
Definition: gateway.h:574
Definition: gateway.h:582
u64snowflake channel_id
Definition: gateway.h:584
u64snowflake guild_id
Definition: gateway.h:586
char * code
Definition: gateway.h:588
Definition: gateway.h:600
u64snowflake channel_id
Definition: gateway.h:604
u64snowflake guild_id
Definition: gateway.h:606
struct snowflakes * ids
Definition: gateway.h:602
Definition: gateway.h:591
u64snowflake channel_id
Definition: gateway.h:595
u64snowflake id
Definition: gateway.h:593
u64snowflake guild_id
Definition: gateway.h:597
Definition: gateway.h:609
u64snowflake message_id
Definition: gateway.h:615
u64snowflake user_id
Definition: gateway.h:611
struct discord_emoji * emoji
Definition: gateway.h:621
u64snowflake channel_id
Definition: gateway.h:613
struct discord_guild_member * member
Definition: gateway.h:619
u64snowflake guild_id
Definition: gateway.h:617
Definition: gateway.h:637
u64snowflake channel_id
Definition: gateway.h:639
u64snowflake message_id
Definition: gateway.h:641
u64snowflake guild_id
Definition: gateway.h:643
Definition: gateway.h:646
u64snowflake guild_id
Definition: gateway.h:650
u64snowflake channel_id
Definition: gateway.h:648
struct discord_emoji * emoji
Definition: gateway.h:654
u64snowflake message_id
Definition: gateway.h:652
Definition: gateway.h:624
struct discord_emoji * emoji
Definition: gateway.h:634
u64snowflake message_id
Definition: gateway.h:630
u64snowflake channel_id
Definition: gateway.h:628
u64snowflake guild_id
Definition: gateway.h:632
u64snowflake user_id
Definition: gateway.h:626
Definition: gateway.h:214
struct discord_activities * activities
Definition: gateway.h:233
struct discord_client_status * client_status
Definition: gateway.h:229
bool afk
Definition: gateway.h:241
char * status
Definition: gateway.h:225
u64snowflake guild_id
Definition: gateway.h:221
u64unix_ms since
Definition: gateway.h:238
struct discord_user * user
Definition: gateway.h:217
Definition: gateway.h:254
int size
Definition: gateway.h:254
struct discord_presence_update * array
Definition: gateway.h:255
Definition: gateway.h:332
struct discord_guilds * guilds
Definition: gateway.h:338
struct integers * shard
Definition: gateway.h:343
struct discord_application * application
Definition: gateway.h:345
char * session_id
Definition: gateway.h:340
struct discord_user * user
Definition: gateway.h:336
int v
Definition: gateway.h:334
Definition: gateway.h:299
struct snowflakes * user_ids
Definition: gateway.h:312
char * query
Definition: gateway.h:304
char * nonce
Definition: gateway.h:316
int limit
Definition: gateway.h:307
u64snowflake guild_id
Definition: gateway.h:301
bool presences
Definition: gateway.h:309
Definition: gateway.h:290
char * session_id
Definition: gateway.h:294
int seq
Definition: gateway.h:296
char * token
Definition: gateway.h:292
Definition: permissions.h:118
Definition: gateway.h:686
int max_concurrency
Definition: gateway.h:694
int total
Definition: gateway.h:688
int remaining
Definition: gateway.h:690
int reset_after
Definition: gateway.h:692
Definition: sticker.h:71
Definition: gateway.h:374
struct snowflakes * channel_ids
Definition: gateway.h:383
u64snowflake guild_id
Definition: gateway.h:376
struct discord_thread_members * members
Definition: gateway.h:388
struct discord_channels * threads
Definition: gateway.h:385
Definition: gateway.h:394
struct discord_thread_members * added_members
Definition: gateway.h:402
u64snowflake id
Definition: gateway.h:396
int member_count
Definition: gateway.h:400
u64snowflake guild_id
Definition: gateway.h:398
struct snowflakes * removed_member_ids
Definition: gateway.h:404
Definition: channel.h:349
Definition: gateway.h:657
u64snowflake guild_id
Definition: gateway.h:661
u64snowflake channel_id
Definition: gateway.h:659
u64snowflake user_id
Definition: gateway.h:663
struct discord_guild_member * member
Definition: gateway.h:667
u64unix_ms timestamp
Definition: gateway.h:665
Definition: gateway.h:320
u64snowflake channel_id
Definition: gateway.h:324
u64snowflake guild_id
Definition: gateway.h:322
bool self_mute
Definition: gateway.h:326
bool self_deaf
Definition: gateway.h:328
Definition: user.h:69
Definition: gateway.h:670
char * token
Definition: gateway.h:672
char * endpoint
Definition: gateway.h:676
u64snowflake guild_id
Definition: gateway.h:674
Definition: gateway.h:679
u64snowflake guild_id
Definition: gateway.h:681
u64snowflake channel_id
Definition: gateway.h:683
Definition: custom.h:36
Handle for building a JSON string.
Definition: json-build.h:61
Definition: custom.h:28