DiscordCoreAPI
A Discord bot library written in C++, with custom asynchronous coroutines.
Loading...
Searching...
No Matches
FoundationEntities.hpp
Go to the documentation of this file.
1/*
2 MIT License
3
4 DiscordCoreAPI, A bot library for Discord, written in C++, and featuring explicit multithreading through the usage of custom, asynchronous C++ CoRoutines.
5
6 Copyright 2022, 2023 Chris M. (RealTimeChris)
7
8 Permission is hereby granted, free of charge, to any person obtaining a copy
9 of this software and associated documentation files (the "Software"), to deal
10 in the Software without restriction, including without limitation the rights
11 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 copies of the Software, and to permit persons to whom the Software is
13 furnished to do so, subject to the following conditions:
14
15 The above copyright notice and this permission notice shall be included in all
16 copies or substantial portions of the Software.
17
18 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24 SOFTWARE.
25*/
26/// FoundationEntities.hpp - Header for all of the discord/support api data structures.
27/// May 12, 2021 Chris M.
28/// https://discordcoreapi.com
29/// \file FoundationEntities.hpp
30#pragma once
31
33
34namespace discord_core_api {
35
36 namespace discord_core_internal {
37
38 struct voice_connection_data {
39 jsonifier::string sessionId{};
40 jsonifier::string endPoint{};
41 jsonifier::string token{};
42 };
43
44 struct DiscordCoreAPI_Dll websocket_resume_data {
45 uint64_t lastNumberReceived{};
46 jsonifier::string sessionId{};
47 jsonifier::string botToken{};
48
49 operator discord_core_internal::etf_serializer();
50 };
51
52 struct connect_properties {
53 jsonifier::string_view browser{ "DiscordCoreAPI" };
54 jsonifier::string_view device{ "DiscordCoreAPI" };
55#if defined _WIN32
56 jsonifier::string_view os{ "Windows" };
57#elif __linux__
58 jsonifier::string_view os{ "Linux" };
59#else
60 jsonifier::string_view os{ "MacOs" };
61#endif
62 };
63
64 struct DiscordCoreAPI_Dll websocket_identify_data {
65 update_presence_data presence{ presence_update_state::online };
66 std::array<uint64_t, 2> shard{};
67 connect_properties properties{};
68 uint64_t largeThreshold{ 250 };
69 jsonifier::string botToken{};
70 int64_t intents{};
71
72 operator discord_core_internal::etf_serializer();
73 };
74
75 struct voice_socket_protocol_payload_data_data {
76 jsonifier::string address{};
77 jsonifier::string mode{};
78 uint16_t port{};
79 };
80
81 struct voice_socket_protocol_payload_data {
82 voice_socket_protocol_payload_data_data data{};
83 jsonifier::string_view protocol{ "udp" };
84 };
85
86 struct voice_identify_data {
87 jsonifier::string sessionId{};
88 jsonifier::string serverId{};
89 jsonifier::string token{};
90 snowflake userId{};
91 };
92
93 enum class send_speaking_type : uint8_t {
94 None = 0,
95 Microphone = 1 << 0,
96 Soundshare = 1 << 1,
97 Priority = 1 << 2,
98 Priority_And_Voice = Microphone | Priority,
99 };
100
101 struct send_speaking_data {
102 send_speaking_type type{};
103 uint64_t delay{};
104 uint64_t ssrc{};
105 };
106
107 enum class https_workload_class : uint8_t { Get = 0, Put = 1, Post = 2, Patch = 3, Delete = 4 };
108
109 enum class payload_type : uint8_t { Application_Json = 1, Multipart_Form = 2 };
110
111 enum class https_workload_type : uint8_t {
112 Unset = 0,
113 Get_Global_Application_Commands = 1,
114 Post_Global_Application_Command = 2,
115 Get_Global_Application_Command = 3,
116 Patch_Global_Application_Command = 4,
117 Delete_Global_Application_Command = 5,
118 Bulk_Put_Global_Application_Commands = 6,
119 Get_Guild_Application_Commands = 7,
120 Post_Guild_Application_Command = 8,
121 Get_Guild_Application_Command = 9,
122 Patch_Guild_Application_Command = 10,
123 Delete_Guild_Application_Command = 11,
124 Bulk_Put_Guild_Application_Commands = 12,
125 Get_Guild_Application_Commands_Permissions = 13,
126 Get_Guild_Application_Command_Permissions = 14,
127 Put_Guild_Application_Command_Permissions = 15,
128 Batch_Put_Guild_Application_Command_Permissions = 16,
129 Post_Interaction_Response = 17,
130 Get_Interaction_Response = 18,
131 Patch_Interaction_Response = 19,
132 Delete_Interaction_Response = 20,
133 Post_Followup_Message = 21,
134 Get_Followup_Message = 22,
135 Patch_Followup_Message = 23,
136 Delete_Followup_Message = 24,
137 Get_Guild_Audit_Logs = 25,
138 Get_Channel = 26,
139 Patch_Channel = 27,
140 Delete_Channel = 28,
141 Get_Messages = 29,
142 Get_Message = 30,
143 Post_Message = 31,
144 Crosspost_Message = 32,
145 Put_Reaction = 33,
146 Delete_Own_Reaction = 34,
147 Delete_User_Reaction = 35,
148 Get_Reactions = 36,
149 Delete_All_Reactions = 37,
150 Delete_Reactions_By_Emoji = 38,
151 Patch_Message = 39,
152 Delete_Message = 40,
153 Delete_Message_Old = 41,
154 Bulk_Delete_Messages = 42,
155 Put_Channel_Permission_Overwrites = 43,
156 Get_Channel_Invites = 44,
157 Post_Channel_Invite = 45,
158 Delete_Channel_Permission_Overwrites = 46,
159 Post_Follow_News_Channel = 47,
160 Post_Trigger_Typing_Indicator = 48,
161 Get_Pinned_Messages = 49,
162 Put_Pin_Message = 50,
163 Delete_Pin_Message = 51,
164 Put_Recipient_To_Group_Dm = 52,
165 Delete_Recipient_From_Group_Dm = 53,
166 Post_Thread_With_Message = 54,
167 Post_Thread_Without_Message = 55,
168 Put_Self_In_Thread = 56,
169 Put_Thread_Member = 57,
170 Delete_Self_From_Thread = 58,
171 Delete_Thread_Member = 59,
172 Get_Thread_Member = 60,
173 Get_Thread_Members = 61,
174 Get_Active_Threads = 62,
175 Get_Public_Archived_Threads = 63,
176 Get_Private_Archived_Threads = 64,
177 Get_Joined_Private_Archived_Threads = 65,
178 Get_Emoji_List = 66,
179 Get_Guild_Emoji = 67,
180 Post_Guild_Emoji = 68,
181 Patch_Guild_Emoji = 69,
182 Delete_Guild_Emoji = 70,
183 Post_Guild = 71,
184 Get_Guild = 72,
185 Get_Guild_Preview = 73,
186 Patch_Guild = 74,
187 Delete_Guild = 75,
188 Get_Guild_Channels = 76,
189 Post_Guild_Channel = 77,
190 Patch_Guild_Channel_Positions = 78,
191 Get_Guild_Active_Threads = 79,
192 Get_Guild_Member = 80,
193 Get_Guild_Members = 81,
194 Get_Search_Guild_Members = 82,
195 Put_Guild_Member = 83,
196 Patch_Guild_Member = 84,
197 Patch_Current_Guild_Member = 85,
198 Put_Guild_Member_Role = 86,
199 Delete_Guild_Member_Role = 87,
200 Delete_Guild_Member = 88,
201 Get_Guild_Bans = 89,
202 Get_Guild_Ban = 90,
203 Put_Guild_Ban = 91,
204 Delete_Guild_Ban = 92,
205 Get_Guild_Roles = 93,
206 Post_Guild_Role = 94,
207 Patch_Guild_Role_Positions = 95,
208 Patch_Guild_Role = 96,
209 Delete_Guild_Role = 97,
210 Get_Guild_Prune_Count = 98,
211 Post_Guild_Prune = 99,
212 Get_Guild_Voice_Regions = 100,
213 Get_Guild_Invites = 101,
214 Get_Guild_Integrations = 102,
215 Delete_Guild_Integration = 103,
216 Get_Guild_Widget_Settings = 104,
217 Patch_Guild_Widget = 105,
218 Get_Guild_Widget = 106,
219 Get_Vanity_Invite = 107,
220 Get_Guild_Widget_Image = 108,
221 Get_Guild_Welcome_Screen = 109,
222 Patch_Guild_Welcome_Screen = 110,
223 Patch_Current_User_Voice_State = 111,
224 Patch_User_Voice_State = 112,
225 Get_Guild_Scheduled_Events = 113,
226 Post_Guild_Scheduled_Event = 114,
227 Get_Guild_Scheduled_Event = 115,
228 Patch_Guild_Scheduled_Event = 116,
229 Delete_Guild_Scheduled_Event = 117,
230 Get_Guild_Scheduled_Event_Users = 118,
231 Get_Guild_Template = 119,
232 Post_Guild_From_Guild_Template = 120,
233 Get_Guild_Templates = 121,
234 Post_Guild_Template = 122,
235 Put_Guild_Template = 123,
236 Patch_Guild_Template = 124,
237 Delete_Guild_Template = 125,
238 Get_Invite = 126,
239 Delete_Invite = 127,
240 Post_Stage_Instance = 128,
241 Get_Stage_Instance = 129,
242 Patch_Stage_Instance = 130,
243 Delete_Stage_Instance = 131,
244 Get_Sticker = 132,
245 Get_Nitro_Sticker_Packs = 133,
246 Get_Guild_Stickers = 134,
247 Post_Guild_Sticker = 135,
248 Patch_Guild_Sticker = 136,
249 Delete_Guild_Sticker = 137,
250 Get_Current_User = 138,
251 Get_User = 139,
252 Patch_Current_User = 140,
253 Get_Current_User_Guilds = 141,
254 Delete_Leave_Guild = 142,
255 Post_Create_User_Dm = 143,
256 Get_User_Connections = 144,
257 Get_Voice_Regions = 145,
258 Post_Webhook = 146,
259 Get_Channel_Webhooks = 147,
260 Get_Guild_Webhooks = 148,
261 Get_Webhook = 149,
262 Get_Webhook_With_Token = 150,
263 Patch_Webhook = 151,
264 Patch_Webhook_With_Token = 152,
265 Delete_Webhook = 153,
266 Delete_Webhook_With_Token = 154,
267 Post_Execute_Webhook = 155,
268 Get_Webhook_Message = 156,
269 Patch_Webhook_Message = 157,
270 Delete_Webhook_Message = 158,
271 Get_Application_Info = 159,
272 Get_Authorization_Info = 160,
273 Get_Gateway_Bot = 161,
274 Post_Thread_In_Forum_Channel = 162,
275 Get_Auto_Moderation_Rules = 163,
276 Get_Auto_Moderation_Rule = 164,
277 Post_Auto_Moderation_Rule = 165,
278 Patch_Auto_Moderation_Rule = 166,
279 Delete_Auto_Moderation_Rule = 167,
280 YouTube_Get_Search_Results = 168,
281 SoundCloud_Get_Search_Results = 169,
282 SoundCloud_Get_Client_Id = 170,
283 SoundCloud_Get_Download_Links = 171,
284 Last = 172
285 };
286
287 class DiscordCoreAPI_Dll https_workload_data {
288 public:
289 friend class https_client;
290
291 unordered_map<jsonifier::string, jsonifier::string> headersToInsert{};
292 payload_type payloadType{ payload_type::Application_Json };
293 https_workload_class workloadClass{};
294 jsonifier::string relativePath{};
295 jsonifier::string callStack{};
296 jsonifier::string baseUrl{};
297 jsonifier::string content{};
298
299 https_workload_data() = default;
300
301 https_workload_data& operator=(https_workload_data&& other) noexcept;
302 https_workload_data(https_workload_data&& other) noexcept;
303
304 https_workload_data& operator=(const https_workload_data& other) = delete;
305 https_workload_data(const https_workload_data& other) = delete;
306
307 https_workload_data& operator=(https_workload_type type);
308
309 https_workload_data(https_workload_type type);
310
311 https_workload_type getWorkloadType() const;
312
313 protected:
314 https_workload_type workloadType{};
315 };
316
317 struct DiscordCoreAPI_Dll hello_data {
318 hello_data() = default;
319 jsonifier::vector<jsonifier::string> _trace{};
320 uint64_t heartbeatInterval{};
321 };
322
323 struct websocket_message {
324 jsonifier::string t{};
325 int64_t op{ -1 };
326 int64_t s{};
327 };
328
329 template<typename value_type> struct websocket_message_data {
330 unordered_set<jsonifier::string> jsonifierExcludedKeys{};
331 jsonifier::string t{};
332 value_type d{};
333 int64_t op{};
334 int64_t s{};
335
336 DCA_INLINE operator discord_core_internal::etf_serializer() {
337 etf_serializer data{};
338 data["op"] = op;
339 data["s"] = s;
340 data["t"] = t;
341 data["d"] = d.operator discord_core_internal::etf_serializer();
342 return data;
343 }
344 };
345 }
346
347 template<typename value_type, typename value_type02> struct updated_event_data;
348 template<typename value_type> struct event_data;
349
350 /**
351 * \addtogroup foundation_entities
352 * @{
353 */
354
355 struct connection_package {
356 uint64_t currentReconnectTries{};
357 uint32_t currentShard{};
358 bool areWeResuming{};
359 };
360
361 /// @brief Timeout durations for the timeout command.
362 enum class timeout_durations : uint16_t {
363 None = 0,///< None - erase timeout.
364 Minute = 1,///< 1 minute timeout.
365 Five_Minutes = 5,///< 5 minute timeout.
366 Ten_Minutes = 10,///< 10 minute timeout.
367 Hour = 60,///< 1 hour timeout.
368 Day = 1440,///< 1 day timeout.
369 Week = 10080///< 1 week timeout.
370 };
371
372 /// @brief Role_data tags data.
374 jsonifier::string premiumSubscriber{};///< Are they a premium subscriber?
375 snowflake integrationId{};///< What is the integration id?
376 snowflake botId{};///< What is the bot id?
377 };
378
379 /// @brief User_data flags.
380 enum class user_flags : uint32_t {
381 Staff = 1 << 0,///< Discord employee.
382 Partner = 1 << 1,///< Partnered server owner.
383 Hypesquad = 1 << 2,///< Hype_squad events member.
384 Bug_Hunter_Level_1 = 1 << 3,///< Bug hunter level 1.
385 Hypesquad_Online_House_1 = 1 << 6,///< House bravery member.
386 Hypesquad_Online_House_2 = 1 << 7,///< House brilliance member.
387 Hypesquad_Online_House_3 = 1 << 8,///< House balance member.
388 Premium_Early_Suppoerter = 1 << 9,///< Early nitro supporter.
389 Team_Pseudo_User = 1 << 10,///< User_data is a team.
390 Bug_Hunter_Level_2 = 1 << 14,///< Bug hunter level 2.
391 Verified_Bot = 1 << 16,///< Verified bot.
392 Verified_Developer = 1 << 17,///< Early verified bot developer.
393 Certified_Moderator = 1 << 18,///< Discord certified moderator.
394 Bot_Https_Interactions = 1 << 19,///< Bot uses only https interactions and is shown in the online member list.
395 Bot = 1 << 20,///< Is it a bot?
396 Mfaenabled = 1 << 21,///< Is mfa enabled?
397 System = 1 << 22,///< Is it a system integration?
398 Verified = 1 << 23///< Is it verified?
399 };
400
401 /// @brief Premium types denote the level of premium a user has.
402 enum class premium_type : uint8_t {
403 None = 0,///< None.
404 Nitro_Classic = 1,///< Nitro classic.
405 Nitro = 2///< Nitro.
406 };
407
408 template<typename value_type> class flag_entity {
409 public:
410 template<jsonifier::concepts::enum_t value_type02> DCA_INLINE auto setFlagValue(value_type02 theFlagToSet, bool enabled) {
411 auto newValue = static_cast<int64_t>(static_cast<value_type*>(this)->flags);
412 if (enabled) {
413 newValue |= static_cast<int64_t>(theFlagToSet);
414 } else {
415 newValue &= ~static_cast<int64_t>(theFlagToSet);
416 }
417 static_cast<value_type*>(this)->flags = static_cast<value_type02>(newValue);
418 }
419
420 template<jsonifier::concepts::enum_t value_type02> DCA_INLINE bool getFlagValue(value_type02 theFlagToCheckFor) const {
421 return static_cast<int64_t>(static_cast<const value_type*>(this)->flags) & static_cast<int64_t>(theFlagToCheckFor);
422 }
423
424 protected:
425 DCA_INLINE flag_entity() = default;
426 DCA_INLINE ~flag_entity() = default;
427 };
428
429 enum class user_image_types {
430 Banner = 0,
431 Default_Avatar = 1,
432 Avatar = 2,
433 Avatar_Decoration = 3,
434 };
435
436 template<typename value_type> class get_user_image_url {
437 public:
438 template<user_image_types type> DCA_INLINE jsonifier::string getUserImageUrl() const {
439 jsonifier::string baseUrl{ "https://cdn.discordapp.com/" };
440 switch (type) {
441 case user_image_types::Banner: {
442 baseUrl += "banners/" + static_cast<jsonifier::string>(static_cast<const value_type*>(this)->id) + "/" +
443 static_cast<jsonifier::string>(static_cast<const value_type*>(this)->banner) + ".png";
444 return baseUrl;
445 }
446 case user_image_types::Default_Avatar: {
447 uint64_t index{};
448 if (static_cast<jsonifier::string>(static_cast<const value_type*>(this)->discriminator) == "0") {
449 index = (jsonifier::strToUint64(static_cast<jsonifier::string>(static_cast<const value_type*>(this)->id).data()) >> 22) % 6;
450 } else {
451 index = jsonifier::strToUint64(static_cast<jsonifier::string>(static_cast<const value_type*>(this)->discriminator).data()) % 5;
452 }
453 baseUrl += "embed/avatars/" + jsonifier::toString(index) + ".png";
454 return baseUrl;
455 }
456 case user_image_types::Avatar: {
457 baseUrl += "avatars/" + static_cast<jsonifier::string>(static_cast<const value_type*>(this)->id) + "/" +
458 static_cast<jsonifier::string>(static_cast<const value_type*>(this)->avatar) + ".png";
459 return baseUrl;
460 }
461 case user_image_types::Avatar_Decoration: {
462 baseUrl += "avatar-decorations/" + static_cast<jsonifier::string>(static_cast<const value_type*>(this)->id) + "/" +
463 static_cast<jsonifier::string>(static_cast<const value_type*>(this)->avatarDecoration) + ".png";
464 return baseUrl;
465 }
466 default: {
467 return {};
468 }
469 }
470 }
471
472 protected:
473 DCA_INLINE get_user_image_url() = default;
474 DCA_INLINE ~get_user_image_url() = default;
475 };
476
477 enum class guild_member_image_types {
478 Avatar = 0,
479 Banner = 1,
480 };
481
482 template<typename value_type> class get_guild_member_image_url {
483 public:
484 template<guild_member_image_types type> jsonifier::string getGuildMemberImageUrl() const {
485 jsonifier::string baseUrl{ "https://cdn.discordapp.com/" };
486 switch (type) {
487 case guild_member_image_types::Avatar: {
488 baseUrl += "guilds/" + static_cast<jsonifier::string>(static_cast<const value_type*>(this)->guildId) + "/users/" +
489 static_cast<jsonifier::string>(static_cast<const value_type*>(this)->user.id) + "/avatars/" +
490 static_cast<jsonifier::string>(static_cast<const value_type*>(this)->avatar) + ".png";
491 return baseUrl;
492 }
493 case guild_member_image_types::Banner: {
494 return baseUrl;
495 }
496 default: {
497 return {};
498 }
499 }
500 }
501
502 protected:
503 DCA_INLINE get_guild_member_image_url() = default;
504 DCA_INLINE ~get_guild_member_image_url() = default;
505 };
506
507 enum class guild_image_types {
508 Icon = 0,
509 Splash = 1,
510 Discovery_Splash = 2,
511 Banner = 3,
512 };
513
514 template<typename value_type> class get_guild_image_url {
515 public:
516 template<guild_image_types type> jsonifier::string getGuildImageUrl() const {
517 jsonifier::string baseUrl{ "https://cdn.discordapp.com/" };
518 switch (type) {
519 case guild_image_types::Icon: {
520 baseUrl += "icons/" + static_cast<jsonifier::string>(static_cast<const value_type*>(this)->id) + "/" +
521 static_cast<jsonifier::string>(static_cast<const value_type*>(this)->icon) + ".png";
522 return baseUrl;
523 }
524 case guild_image_types::Splash: {
525 baseUrl += "splashes/" + static_cast<jsonifier::string>(static_cast<const value_type*>(this)->id) + "/" +
526 static_cast<jsonifier::string>(static_cast<const value_type*>(this)->splash) + ".png";
527 return baseUrl;
528 }
529 case guild_image_types::Discovery_Splash: {
530 baseUrl += "icons/" + static_cast<jsonifier::string>(static_cast<const value_type*>(this)->id) + "/" +
531 static_cast<jsonifier::string>(static_cast<const value_type*>(this)->discoverySplash) + ".png";
532 return baseUrl;
533 }
534 case guild_image_types::Banner: {
535 baseUrl += "banners/" + static_cast<jsonifier::string>(static_cast<const value_type*>(this)->id) + "/" +
536 static_cast<jsonifier::string>(static_cast<const value_type*>(this)->banner) + ".png";
537 return baseUrl;
538 }
539 default: {
540 return {};
541 }
542 }
543 }
544
545 protected:
546 DCA_INLINE get_guild_image_url() = default;
547 DCA_INLINE ~get_guild_image_url() = default;
548 };
549
550 /// @brief Attachment data.
552 public:
553 jsonifier::string contentType{};///< Type of content for the attachment.
554 jsonifier::string description{};///< A description of the attachment.
555 jsonifier::string filename{};///< The file name of the attachment.
556 jsonifier::string proxyUrl{};///< The proxy url for the attachment.
557 jsonifier::string url{};///< The url for the attachment.
558 uint64_t height{};///< The height of the attachment.
559 bool ephemeral{};///< Whether it was an ephemeral response.
560 uint64_t width{};///< The width of the attachment.
561 uint64_t size{};///< The size of the attachment.
562 snowflake id{};///< This attachment data's id.
563 };
564
565 /// @brief Sticker_data format types.
566 enum class sticker_format_type : uint8_t {
567 png = 1,///< Png.
568 apng = 2,///< Apng.
569 lottie = 3///< Lottie
570 };
571
572 /// @brief Embed footer data.
574 jsonifier::string proxyIconUrl{};///< Proxy icon url.
575 jsonifier::string iconUrl{};///< Icon url.
576 jsonifier::string text{};///< Footer text.
577 };
578
579 /// @brief Embed image data.
581 unordered_set<jsonifier::string> jsonifierExcludedKeys{};///< For excluding certain keys from parsing/serialization.
582 jsonifier::string proxyUrl{};///< Proxy url.
583 jsonifier::string url{};///< Image url.
584 uint64_t height{};///< Image height.
585 uint64_t width{};///< Image width.
586
587 void generateExcludedKeys();
588 };
589
590 /// @brief Embed thumbnail data.
592 jsonifier::string proxyUrl{};///< Proxy url.
593 jsonifier::string url{};///< Image url.
594 uint64_t height{};///< Image height.
595 uint64_t width{};///< Image width.
596 };
597
598 /// @brief Embed video data.
600 jsonifier::string proxyUrl{};///< Proxy url.
601 jsonifier::string url{};///< Image url.
602 uint64_t height{};///< Image height.
603 uint64_t width{};///< Image width.
604 };
605
606 /// @brief Embed provider data.
608 jsonifier::string name{};///< Name.
609 jsonifier::string url{};///< Url.
610 };
611
612 /// @brief Embed author data.
614 unordered_set<jsonifier::string> jsonifierExcludedKeys{};///< For excluding certain keys from parsing/serialization.
615 jsonifier::string proxyIconUrl{};///< Proxy icon url.
616 jsonifier::string iconUrl{};///< Icon url.
617 jsonifier::string name{};///< Name.
618 jsonifier::string url{};///< Url.
619
620 void generateExcludedKeys();
621 };
622
623 /// @brief Embed field data.
625 jsonifier::string value{};///< The text on the field.
626 jsonifier::string name{};///< The title of the field.
627 bool Inline{};///< Is the field DCA_INLINE with the rest of them?
628 };
629
630 /// @brief Embed types.
631 enum class embed_type : uint8_t {
632 Rich = 0,///< Rich.
633 Image = 1,///< Image.
634 Video = 2,///< Video.
635 Gifv = 3,///< Gifv.
636 Article = 4,///< Article.
637 Link = 5///< Link.
638 };
639
640 /// @brief Embed data.
641 class DiscordCoreAPI_Dll embed_data {
642 public:
643 unordered_set<jsonifier::string> jsonifierExcludedKeys{};///< For excluding certain keys from parsing/serialization.
644 jsonifier::vector<embed_field_data> fields{};///< Array of embed fields.
645 embed_thumbnail_data thumbnail{};///< Embed thumbnail data.
646 jsonifier::string description{};///< Description of the embed.
647 embed_provider_data provider{};///< Embed provider data.
648 embed_footer_data footer{};///< Embed footer data.
649 embed_author_data author{};///< Embed author data.
650 jsonifier::string title{};///< Title of the embed.
651 uint64_t hexColorValue{};///< Hex color value of the embed.
652 jsonifier::string type{};///< Type of the embed.
653 embed_image_data image{};///< Embed image data.
654 embed_video_data video{};///< Embed video data.
655 jsonifier::string url{};///< Url for the embed.
656 time_stamp timeStamp{};///< Timestamp to be placed on the embed.
657
658 void generateExcludedKeys();
659
660 /// @brief Sets the author's name and avatar for the embed.
661 /// @param authorName the author's name.
662 /// @param authorAvatarUrl the url to their avatar.
663 /// @return embed_data& A reference to this embed_data instance.
664 embed_data& setAuthor(const jsonifier::string& authorName, const jsonifier::string& authorAvatarUrl = "");
665
666 /// @brief Sets the footer's values for the embed.
667 /// @param footerText the footer's text.
668 /// @param footerIconUrlText url to the footer's icon.
669 /// @return embed_data& A reference to this embed_data instance.
670 embed_data& setFooter(const jsonifier::string& footerText, const jsonifier::string& footerIconUrlText = "");
671
672 /// @brief Sets the timeStamp on the embed.
673 /// @param timeStamp the timeStamp to be set.
674 /// @return embed_data& A reference to this embed_data instance.
675 embed_data& setTimeStamp(const jsonifier::string& timeStamp);
676
677 /// @brief Adds a field to the embed.
678 /// @param name the title of the embed field.
679 /// @param value the contents of the embed field.
680 /// @param Inline is it DCA_INLINE with the rest of the fields on the embed?
681 /// @return embed_data& A reference to this embed_data instance.
682 embed_data& addField(const jsonifier::string& name, const jsonifier::string& value, bool Inline = true);
683
684 /// @brief Sets the description (the main contents) of the embed.
685 /// @param descriptionNew the contents of the description to set.
686 /// @return embed_data& A reference to this embed_data instance.
687 embed_data& setDescription(const jsonifier::string& descriptionNew);
688
689 /// @brief Sets the color of the embed, by applying a hex-color value.
690 /// @param hexColorValueNew a string containing a hex-number value (between 0x00 0xFFFFFF).
691 /// @return embed_data& A reference to this embed_data instance.
692 embed_data& setColor(const jsonifier::string& hexColorValueNew);
693
694 /// @brief Sets the thumbnail of the embed.
695 /// @param thumbnailUrl the url to the thumbnail to be used.
696 /// @return embed_data& A reference to this embed_data instance.
697 embed_data& setThumbnail(const jsonifier::string& thumbnailUrl);
698
699 /// @brief Sets the title of the embed.
700 /// @param titleNew a string containing the desired title.
701 /// @return embed_data& A reference to this embed_data instance.
702 embed_data& setTitle(const jsonifier::string& titleNew);
703
704 /// @brief Sets the image of the embed.
705 /// @param imageUrl the url of the image to be set on the embed.
706 /// @return embed_data& A reference to this embed_data instance.
707 embed_data& setImage(const jsonifier::string& imageUrl);
708 };
709
710 /// @brief Message reference data.
712 bool failIfNotExists{};///< Fail if the message doesn't exist?
713 snowflake messageId{};///< snowflake of the message to reference.
714 snowflake channelId{};///< snowflake of the channel_data that the referenced message was sent in.
715 snowflake guildId{};///< snowflake of the guild that the referenced message was sent in.
716 };
717
718 enum class media_type : uint8_t { png = 0, gif = 1, jpeg = 2, mpeg = 3, mp3 = 4 };
719
720 /// @brief Data representing a file to be sent via multipart-form data.
721 struct file {
722 jsonifier::string fileName{};///< The name of the file.
723 jsonifier::string data{};///< The data of the file.
724 };
725
726 /// @brief The sorting order, for guild forum channels.
727 enum class sort_order_types {
728 Latest_Activity = 0,///< Sort forum posts by activity.
729 Creation_Date = 1///< Sort forum posts by creation time(from most recent to oldest).
730 };
731
732 /// @brief Channel_data types.
733 enum class channel_type : uint8_t {
734 Guild_Text = 0,///< A text channel within a server.
735 Dm = 1,///< A direct message between users.
736 Guild_Voice = 2,///< A voice channel within a server.
737 Group_DM = 3,///< A direct message between multiple users.
738 Guild_Category = 4,///< An organizational category that contains up to 50 channels.
739 Guild_Announcement = 5,///< A channel that users can follow and crosspost into their own server (formerly news channels).
740 Announcement_Thread = 10,///< A temporary sub-channel within a GUILD_ANNOUNCEMENT channel.
741 Public_Thread = 11,///< A temporary sub-channel within a GUILD_TEXT or GUILD_FORUM channel.
742 Private_Thread = 12,///< A temporary sub-channel within a GUILD_TEXT channel that is only viewable by those invited and those with the MANAGE_THREADS permission.
743 Guild_Stage_Voice = 13,///< A voice channel for hosting events with an audience.
744 Guild_Directory = 14,///< The channel in a hub containing the listed servers.
745 Guild_Forum = 15///< channel_data that can only contain threads.
746 };
747
748 /// @brief Meta data for a thread_data type of channel_data.
750 jsonifier::string archiveTimestamp{};///< (where applicable) the time at which this thread_data was archived.
751 uint64_t autoArchiveDuration{};///< How int64_t before archiving this thread_data.
752 bool invitable{};///< The id of the individual who archived this thread_data.
753 bool archived{};///< Whether or not this thread_data is currently archived.
754 bool locked{};///< Whether or not this thread_data is currently locked.
755 };
756
757 /// @brief Data for a single member of a thread_data.
759 public:
760 jsonifier::string joinTimestamp{};///< The time at which the member joined this thread_data.
761 snowflake userId{};///< The user_data's id.
762 uint64_t flags{};///< Flags.
763 snowflake id{};///< This threadmemberdata's id.
764
765 DCA_INLINE thread_member_data() = default;
766 };
767
768 /// @brief Thread_data types.
769 enum class thread_type : uint8_t {
770 Guild_News_Thread = 10,///< Guild news thread_data.
771 Guild_Public_Thread = 11,///< Guild public thread_data.
772 Guild_Private_Thread = 12///< Guild protected thread_data.
773 };
774
775 /// @brief Voice state data.
777 snowflake channelId{};///< The channel_data id this user_data is connected to.
778 snowflake guildId{};///< The guild id this voice state is for.
779 snowflake userId{};///< The user_data id this voice state is for.
780
781 virtual DCA_INLINE ~voice_state_data_light() = default;
782 };
783
784 struct voice_server_update_data {
785 jsonifier::string endpoint{};
786 snowflake guildId{};
787 jsonifier::string token{};
788 };
789
790 /// @brief Voice state data.
792 jsonifier::string requestToSpeakTimestamp{};///< The time at which the user_data requested to speak.
793 jsonifier::string sessionId{};///< The session id for this voice state.
794 bool selfStream{};///< Whether this user_data is streaming using "go live".
795 bool selfVideo{};///< Whether this user_data's camera is enabled.
796 bool selfDeaf{};///< Whether this user_data is locally deafened.
797 bool selfMute{};///< Whether this user_data is locally muted.
798 bool suppress{};///< Whether this user_data is muted by the current user_data.
799 bool deaf{};///< Whether this user_data is deafened by the server.
800 bool mute{};///< Whether this user_data is muted by the server.
801 };
802
803 /// @brief Automatic thread_data archiving durations.
804 enum class thread_auto_archive_duration : uint16_t {
805 Shortest = 60,///< Shortest.
806 Short = 1440,///< Short.
807 Long = 4320,///< Long.
808 Longest = 10080///< Longest.
809 };
810
811 enum class role_flags : uint8_t { mentionable = 1 << 0, managed = 1 << 1, hoist = 1 << 2 };
812
813 /// @brief A single user_data.
814 class DiscordCoreAPI_Dll user_data : public get_user_image_url<user_data>, public flag_entity<user_data> {
815 public:
816 template<typename value_type> friend struct jsonifier::core;
817 friend class get_user_image_url<user_data>;
818
819 jsonifier::string avatarDecoration{};///< The user's avatar decoration hash.
820 jsonifier::string discriminator{};///< The user's discord-tag.
821 jsonifier::string globalName{};///< The user's display name, if it is set. for bots, this is the application name.
822 jsonifier::string userName{};///< The user's username, not unique across the platform.
823 jsonifier::string locale{};///< The user's chosen language option.
824 jsonifier::string banner{};///< The user's banner hash.
825 jsonifier::string avatar{};///< The user's avatar hash.
826 jsonifier::string email{};///< The user's email.
827 uint64_t accentColor{};///< The user's banner color encoded as an integer representation of hexadecimal color code.
828 int32_t premiumType{};///< The type of nitro subscription on a user's account.
829 int32_t publicFlags{};///< The public flags on a user's account.
830 bool mfaEnabled{};///< Whether the user has two-factor enabled on their account.
831 user_flags flags{};///< The flags on a user's account.
832 bool verified{};///< Whether the email on this account has been verified.
833 snowflake id{};///< The user's id.
834 bool system{};///< Whether the user is an official discord system user (part of the urgent message system).
835 bool bot{};///< Whether the user belongs to an oauth2 application.
836
837 DCA_INLINE user_data() = default;
838
839 user_data(snowflake);
840 };
841
842 /// @brief A single user_data.
843 class DiscordCoreAPI_Dll user_cache_data : public get_user_image_url<user_cache_data>, public flag_entity<user_cache_data> {
844 public:
845 template<typename value_type> friend struct jsonifier::core;
846 friend class get_user_image_url<user_cache_data>;
847
848 jsonifier::string avatarDecoration{};///< The user's avatar decoration hash.
849 jsonifier::string discriminator{};///< The user's 4-digit discord-tag identify.
850 jsonifier::string globalName{};///< The user's global name.
851 jsonifier::string userName{};///< The user's username.
852 jsonifier::string avatar{};///< The user's avatar hash.
853 jsonifier::string banner{};///< The user's banner hash.
854 premium_type premiumType{};///< The type of nitro subscription on a user's account.
855 uint64_t accentColor{};///< The user's banner color encoded as an integer representation of hexadecimal color code.
856 user_flags flags{};///< The public flags on a user's account.
857 snowflake id{};///< This user's id.
858
859 DCA_INLINE user_cache_data() = default;
860
861 user_cache_data& operator=(user_data&& other) noexcept;
862 user_cache_data(user_data&& other) noexcept;
863
864 user_cache_data& operator=(const user_data& other);
865 user_cache_data(const user_data& other);
866
867 operator user_data();
868
869
870 DCA_INLINE bool operator==(const snowflake& other) const {
871 return id == other;
872 }
873 };
874
875 /// a single role_data.
876 class DiscordCoreAPI_Dll role_data : public flag_entity<role_data> {
877 public:
878 jsonifier::string unicodeEmoji{};///< Role unicode emoji. (optional)
879 permissions_parse permissions{};///< Permission bit set.
880 jsonifier::string name{};///< Role name.
881 jsonifier::string icon{};///< Role icon hash. (optional).
882 role_tags_data tags{};///< Role tags object. (optional)
883 uint32_t position{};///< Position of this role.
884 bool mentionable{};///< Whether this role is mentionable.
885 role_flags flags{};///< Role flags combined as a bitfield.
886 uint32_t color{};///< Integer representation of hexadecimal color code.
887 snowflake id{};///< Role id.
888 bool managed{};///< Whether this role is managed by an integration.
889 bool hoist{};///< Whether this role is pinned in the user listing.
890
891 DCA_INLINE role_data() = default;
892
893 role_data(snowflake);
894 };
895
896 /// @brief Data structure representing a single role_data.
897 class DiscordCoreAPI_Dll role_cache_data : public flag_entity<role_cache_data> {
898 public:
899 friend class guild_data;
900
901 jsonifier::string unicodeEmoji{};///< Emoji representing the role_data.
902 permissions permissionsVal{};///< The role_data's base guild permissions.
903 jsonifier::string name{};///< The role_data's name.
904 snowflake guildId{};///< The id of the guild that this role_data is from.
905 uint32_t position{};///< Its position amongst the rest of the guild's roles.
906 role_flags flags{};///< Role_data flags.
907 uint32_t color{};///< The role_data's color.
908 snowflake id{};///< This role's id.
909
910 DCA_INLINE role_cache_data() = default;
911
912 role_cache_data& operator=(role_data&& other) noexcept;
913 role_cache_data(role_data&& other) noexcept;
914
915 role_cache_data& operator=(const role_data&);
916 role_cache_data(const role_data&);
917
918 operator role_data();
919
920 DCA_INLINE bool operator==(const snowflake& other) const {
921 return id == other;
922 }
923 };
924
925 /// @brief Data structure representing a single emoji.
926 class DiscordCoreAPI_Dll partial_emoji_data {
927 public:
928 friend class emoji_data;
929 unordered_set<jsonifier::string> jsonifierExcludedKeys{};///< Excluding keys from parsing/serializing.
930 jsonifier::string name{};///< What is its name?
931 bool animated{};///< Is it animated?
932 snowflake id{};///< This emoji's id.
933
934 DCA_INLINE partial_emoji_data() = default;
935
936 void generateExcludedKeys();
937 };
938
939 /// @brief Data structure representing a single emoji.
940 class DiscordCoreAPI_Dll emoji_data : public partial_emoji_data {
941 public:
942 unordered_set<jsonifier::string> jsonifierExcludedKeys{};///< Excluding keys from parsing/serializing.
943 jsonifier::vector<role_data> roles{};///< Roles that are allowed to use this emoji.
944 std::wstring unicodeName{ L"" };///< What is its unicode name?
945 bool available{ true };///< Is it available to be used?
946 bool requireColons{};///< Require colons to render it?
947 user_data user{};///< User_data that created this emoji.
948 bool managed{};///< Is it managed?
949
950 void generateExcludedKeys();
951 };
952
953 enum class presence_update_flags : uint8_t {
954 Desktop_Online = 0b00000001,
955 Desktop_Idle = 0b00000010,
956 Desktop_Dnd = 0b000000011,
957 Mobile_Online = 0b00000010,
958 Mobile_Idle = 0b00000100,
959 Mobile_Dnd = 0b00000110,
960 Web_Online = 0b00000100,
961 Web_Idle = 0b00001000,
962 Web_Dnd = 0b00001100,
963 Status_Online = 0b00001000,
964 Status_Idle = 0b00010000,
965 Status_Dnd = 0b00011000
966 };
967
968 struct client_status {
969 jsonifier::string desktop{};///< User_data's status set for an active desktop (windows, linux, mac) application session.
970 jsonifier::string mobile{};///< User_data's status set for an active mobile (iOS, android) application session.
971 jsonifier::string web{};///< User_data's status set for an active web (browser, bot account) application session.
972 };
973
974 /// @brief Presence update data.
976 jsonifier::vector<activity_data> activities{};///< Array of activity objects user_data's current activities.
977 client_status clientStatus{};///< user_data's platform-dependent status
978 jsonifier::string status{};///< Either "idle", "dnd", "online", or "offline".
979 snowflake guildId{};///< snowflake id of the guild.
980 user_data user{};///< User_data object user_data whose presence is being updated.
981 };
982
983 enum class guild_member_flags : uint8_t { Pending = 1 << 0, Deaf = 1 << 1, Mute = 1 << 2 };
984
985 class user_id_base {
986 public:
987 snowflake id{};
988
989 DCA_INLINE user_id_base() = default;
990 };
991
992 class guild_data;
994
995 /// @brief Data structure representing a single guild_member_data.
996 class DiscordCoreAPI_Dll guild_member_data : public flag_entity<guild_member_data>, public get_guild_member_image_url<guild_member_data> {
997 public:
998 template<typename value_type> friend class get_guild_member_image_url;
999 template<typename value_type> friend struct jsonifier::core;
1000 template<typename value_type> friend struct event_data;
1001 friend class guild_data;
1002
1003 time_stamp communicationDisabledUntil{};///< Iso8601 timestamp when the user's timeout will expire.
1004 jsonifier::vector<snowflake> roles{};///< Array of role object ids.
1005 jsonifier::string premiumSince{};///< Iso8601 timestamp when the user started boosting the guild.
1006 permissions_parse permissions{};///< Total permissions of the member in the channel, including overwrites.
1007 jsonifier::string avatar{};///< The member's guild avatar hash.
1008 guild_member_flags flags{};///< Guild member flags represented as a bit set, defaults to 0.
1009 jsonifier::string nick{};///< This user's guild nickname.
1010 time_stamp joinedAt{};///< Iso8601 timestamp when the user joined the guild.
1011 snowflake guildId{};///< The guild that this member belongs to.
1012 user_data user{};///< The user this guild member represents.
1013 bool pending{};///< Whether the user has not yet passed the guild's membership screening requirements.
1014 bool deaf{};///< Whether the user is deafened in voice channels.
1015 bool mute{};///< Whether the user is muted in voice channels.
1016
1017 DCA_INLINE guild_member_data() = default;
1018
1019 voice_state_data_light getVoiceStateData();
1020
1021 user_cache_data getUserData();
1022 };
1023
1024 /// @brief Data structure representing a single guild_member_data.
1025 class DiscordCoreAPI_Dll guild_member_cache_data : public flag_entity<guild_member_cache_data>, public get_guild_member_image_url<guild_member_cache_data> {
1026 public:
1027 template<typename value_type> friend struct jsonifier::core;
1028 template<typename value_type> friend struct std::hash;
1029 template<typename value_type> friend struct event_data;
1030 friend class guild_data;
1031
1032 jsonifier::vector<snowflake> roles{};///< The guild roGuildMemberDatales that they have.
1033 permissions permissionsVal{};///< Their base-level permissions in the guild.
1034 guild_member_flags flags{};///< Guild_member_data flags.
1035 jsonifier::string nick{};///< Their nick/display name.
1036 time_stamp joinedAt{};///< When they joined the guild.
1037 user_id_base user{};///< The user id for this guild_member_data.
1038 snowflake guildId{};///< The current guild's id.
1039 icon_hash avatar{};///< This guild_member_data's guild avatar.
1040
1041 guild_member_cache_data() = default;
1042
1043 guild_member_cache_data& operator=(guild_member_data&& other) noexcept;
1044 guild_member_cache_data(guild_member_data&& other) noexcept;
1045
1046 guild_member_cache_data& operator=(const guild_member_data&);
1047 guild_member_cache_data(const guild_member_data&);
1048
1049 operator guild_member_data();
1050
1051 voice_state_data_light getVoiceStateData();
1052
1053 user_cache_data getUserData();
1054
1055 DCA_INLINE guild_member_cache_data(uint64_t snowFlake) {
1056 user.id = snowFlake;
1057 }
1058 };
1059
1060 /// @brief Permission_types overwrites types.
1061 enum class permission_overwrites_type : uint8_t {
1062 role_data = 0,///< Role_data.
1063 user_data = 1///< User_data.
1064 };
1065
1066 /// @brief A permission_types overwrite, for a given channel.
1068 public:
1069 permission_overwrites_type type{};///< Role_data or user_data type.
1070 permissions_parse allow{};///< collection of permissions to allow.
1071 permissions_parse deny{};///< collection of permissions to deny.
1072 snowflake id{};///< This overwrite's id.
1073 };
1074
1075 enum class channel_flags : uint8_t { nsfw = 1 << 0, managed = 1 << 1 };
1076
1077 struct default_reaction_data {
1078 jsonifier::string emojiName{};///< The unicode character of the emoji.
1079 snowflake emojiId{};///< The id of a guild's custom emoji.
1080 };
1081
1082 /// forum tags.
1084 jsonifier::string emojiName{};///< The unicode character of the emoji.
1085 jsonifier::string name{};///< The name of the tag(0 - 20 characters).
1086 snowflake emojiId{};///< The id of a guild's custom emoji.
1087 bool moderated{};///< Whether this tag can only be added to or removed from threads by a member with the MANAGE_THREADS permission.
1088 snowflake id{};///< snowflake of the tag.
1089 };
1090
1091 /// forum layout types.
1093 Not_set = 0,///< No default has been set for forum channel.
1094 List_View = 1,///< Display posts as a list.
1095 Gallery_View = 2,///< Display posts as a collection of tiles.
1096 };
1097
1098 /// @brief A channel_data object.
1099 class DiscordCoreAPI_Dll channel_data : public flag_entity<channel_data> {
1100 public:
1101 jsonifier::vector<over_write_data> permissionOverwrites{};///< Explicit permission overwrites for members and roles.
1102 jsonifier::vector<forum_tag_data> availableTags{};///< The set of tags that can be used in a GUILD_FORUM channel.
1103 default_reaction_data defaultReactionEmoji{};///< The emoji to show in the add reaction button on a thread in a G
1104 jsonifier::vector<snowflake> appliedTags{};///< The ids of the set of tags that have been applied to a thread in a GUILD_FORUM channel.UILD_FORUM channel.
1105 jsonifier::vector<user_data> recipients{};///< The recipients of the dm.
1106 uint32_t defaultThreadRateLimitPerUser{};/// the initial rate_limit_per_user to set on newly created threads in a channel.
1107 forum_layout_types defaultForumLayout{};///< The default forum layout view used to display posts in GUILD_FORUM channels. defaults to 0.
1108 uint32_t defaultAutoArchiveDuration{};///< Default duration, copied onto newly created threads, in minutes.
1109 thread_metadata_data threadMetadata{};///< Metadata in the case that this channel_data is a thread_data.
1110 jsonifier::string lastPinTimestamp{};///< When the last pinned message was pinned. this may be null in certain events.
1111 sort_order_types defaultSortOrder{};///< The default sort order type used to order posts in GUILD_FORUM channels. defaults to null.
1112 permissions_parse permissions{};///< computed permissions for the invoking user in the channel, including overwrites.
1113 jsonifier::string rtcRegion{};///< Voice region id for the voice channel, automatic when set to null.
1114 uint32_t totalMessageSent{};///< Number of messages ever sent in a thread, it's similar to messageCount on message creation.
1115 uint32_t rateLimitPerUser{};///< Amount of seconds a user has to wait before sending another message (0-21600); bots.
1116 uint32_t videoQualityMode{};///< The camera video quality mode of the voice channel, 1 when not present.
1117 thread_member_data member{};///< Thread_data member object for the current user, if they have joined the
1118 jsonifier::string topic{};///< The channel topic (0-4096 characters for GUILD_FORUM channels, 0-1024 characters for all others). thread.
1119 snowflake lastMessageId{};///< The id of the last message sent in this channel (or thread for GUILD_FORUM channels).
1120 snowflake applicationId{};///< Application id of the group dm creator if it is bot-created.
1121 jsonifier::string name{};///< The name of the channel (1-100 characters).
1122 jsonifier::string icon{};///< Icon hash of the group dm.
1123 uint32_t messageCount{};///< Number of messages (not including the initial message or deleted messages) in a thread.
1124 uint32_t memberCount{};///< An approximate count of users in a thread, stops counting at 50.
1125 channel_flags flags{};///< channel flags combined as a bitfiel
1126 snowflake parentId{};///< For guild channels: id of the parent category for a channel (each parent category can contain up to 50 channels).d.
1127 uint32_t userLimit{};///< The user limit of the voice channel.
1128 snowflake ownerId{};///< Id of the creator of the group dm or thread.
1129 snowflake guildId{};///< The id of the guild (may be missing for some channel objects received over gateway guild dispatches).
1130 uint32_t position{};///< Sorting position of the channel.
1131 channel_type type{};///< The type of channel.
1132 uint32_t bitrate{};///< The bitrate (in bits) of the voice channel.
1133 snowflake id{};///< The id of this channel.
1134 bool managed{};///< For group dm channels: whether the channel is managed by an application via the gdm.join oauth2 scope.
1135 bool nsfw{};///< Whether the channel is nsfw.
1136
1137 DCA_INLINE channel_data() = default;
1138
1139 channel_data(snowflake);
1140
1141 jsonifier::string getIconUrl();
1142 };
1143
1144 /// @brief Data structure representing a single channel_data.
1145 class DiscordCoreAPI_Dll channel_cache_data : public flag_entity<channel_cache_data> {
1146 public:
1147 friend class guild_data;
1148
1149 jsonifier::vector<over_write_data> permissionOverwrites{};///< Permission overwrites.
1150 channel_type type{ channel_type::Dm };///< The type of the channel_data.
1151 jsonifier::string topic{};///< channel_data topic.
1152 jsonifier::string name{};///< Name of the channel_data.
1153 uint32_t memberCount{};///< count of members active in the channel_data.
1154 snowflake parentId{};///< snowflake of the channel_data's parent channel_data/category.
1155 channel_flags flags{};///< Flags combined as a bitmask.
1156 uint32_t position{};///< The position of the channel_data, in the guild's channel_data list.
1157 snowflake ownerId{};///< snowflake of the channel_data's owner.
1158 snowflake guildId{};///< snowflake of the channel_data's guild, if applicable.
1159 snowflake id{};///< This channel's id.
1160
1161 DCA_INLINE channel_cache_data() = default;
1162
1163 channel_cache_data& operator=(channel_data&& other) noexcept;
1164 channel_cache_data(channel_data&& other) noexcept;
1165
1166 channel_cache_data& operator=(const channel_data& snowFlake);
1167 channel_cache_data(const channel_data& snowFlake);
1168
1169 /// @brief For converting this into a channel_data instance.
1170 operator channel_data();
1171
1172 DCA_INLINE bool operator==(const snowflake& other) const {
1173 return id == other;
1174 }
1175 };
1176
1177 /// @brief Data representing an active thread_data.
1179 jsonifier::vector<thread_member_data> members{};
1180 jsonifier::vector<channel_data> threads{};
1181 bool hasMore{};
1182 };
1183
1184 /// @brief Data representing an archived thread_data.
1186 jsonifier::vector<thread_member_data> members{};
1187 jsonifier::vector<channel_data> threads{};
1188 bool hasMore{};
1189 };
1190
1191 /// @brief Application command-option types.
1192 enum class application_command_option_type : uint8_t {
1193 Sub_Command = 1,///< Sub-command.
1194 Sub_Command_Group = 2,///< Sub-command group.
1195 String = 3,///< Jsonifier::string.
1196 Integer = 4,///< Integer.
1197 Boolean = 5,///< Boolean.
1198 User_Data = 6,///< User_data.
1199 Channel_Data = 7,///< channel_data.
1200 Role_Data = 8,///< Role_data.
1201 Mentionable = 9,///< Mentionable.
1202 Number = 10,///< Number.
1203 Attachment = 11///< Attachment.
1204 };
1205
1206 /// @brief Application command permission-types.
1208 Role_Data = 1,///< Role_data.
1209 User_Data = 2,///< User_data.
1210 Channel_Data = 3///< channel_data.
1211 };
1212
1213 /// @brief Event types for auto-moderation.
1214 enum class event_type : uint8_t {
1215 Message_Send = 1,///< When a member sends or edits a message in the guild.
1216 };
1217
1218 /// @brief Trigger types for auto-moderation.
1219 enum class trigger_type : uint8_t {
1220 Keyword = 1,///< check if content contains words from a user defined list of keywords.
1221 Spam = 3,///< check if content represents generic spam.
1222 Keyword_Preset = 4,///< check if content contains words from internal pre-defined wordsets.
1223 Mention_Spam = 5///< check if content contains more unique mentions than allowed.
1224 };
1225
1226 /// @brief Keyword preset types for auto-moderation.
1227 enum class keyword_preset_type : uint8_t {
1228 Profanity = 1,///< Words that may be considered forms of swearing or cursing.
1229 Sexual_Content = 2,///< Words that refer to sexually explicit behavior or activity
1230 Slurs = 3///< Personal insults or words that may be considered hate speech.
1231 };
1232
1233 /// @brief Action types for auto-moderation.
1234 enum class action_type : uint8_t {
1235 Block_Message = 1,///< Blocks the content of a message according to the rule.
1236 Send_Alert_Message = 2,///< Logs user content to a specified channel.
1237 Timeout = 3///< Timeout user for a specified duration.
1238 };
1239
1240 /// @brief Action metadata for auto-moderation-rules.
1242 int64_t durationSeconds{};///< Timeout duration in seconds.
1243 snowflake channelId{};///< channel_data to which user content should be logged.
1244 };
1245
1246 /// @brief Trigger metadata for auto-moderation-rules.
1248 jsonifier::vector<jsonifier::string> regexPatterns{};///< Array of strings** keyword regular expression patterns which will be matched against content.
1249 jsonifier::vector<jsonifier::string> keywordFilter{};///< Substrings which will be searched for in content.keyword_filter array of strings.
1250 jsonifier::vector<jsonifier::string> allowList{};///< Substrings which will be exempt from triggering the preset trigger type.
1251 jsonifier::vector<keyword_preset_type> presets{};///< The internally pre-defined wordsets which will be searched for in content.
1252 bool mentionRaidProtectionEnabled{};///< MENTION_SPAM whether to automatically detect mention raids.
1253 uint64_t mentionTotalLimit{};///< Total number of unique role and user mentions allowed per message (maximum of 50).
1254 };
1255
1256 /// @brief For representing a single auto-moderation-rule-action.
1258 action_meta_data metadata{};///< Additional metadata needed during execution for this specific action type.
1259 action_type type{};///< The type of action.
1260 };
1261
1262 /// @brief Represents an auto-moderation-rule.
1264 public:
1265 jsonifier::vector<snowflake> exemptChannels{};///< The channel ids that should not be affected by the rule(maximum of 50).
1266 jsonifier::vector<snowflake> exemptRoles{};///< The role ids that should not be affected by the rule(maximum of 20).
1267 jsonifier::vector<action_data> actions{};///< Actions which will execute when the rule is triggered.
1268 trigger_meta_data triggerMetaData{};///< The rule trigger metadata actions array of action objects the.
1269 trigger_type triggerType{};///< The rule trigger type.
1270 jsonifier::string name{};///< The rule name.
1271 event_type eventType{};///< The rule event type.
1272 snowflake creatorId{};///< The user which first created this rule.
1273 snowflake guildId{};///< The guild which this rule belongs to.
1274 bool enabled{};///< Whether the rule is enabled.
1275 snowflake id{};
1276
1277 DCA_INLINE auto_moderation_rule_data() = default;
1278 };
1279
1280 /// @brief Permissions data for an application_command_data.
1282 public:
1284 bool permission{};///< Whether the permission_types is active or not.
1285 snowflake id{};
1286 };
1287
1288 /// @brief Represents the permissions for accessing an application_command_data from within a guild.
1290 public:
1291 jsonifier::vector<application_command_permission_data> permissions{};///< The permissions.
1292 snowflake applicationId{};///< The application's id.
1293 snowflake guildId{};///< The guild's id.
1294 snowflake id{};
1295
1296 DCA_INLINE guild_application_command_permissions_data() = default;
1297 };
1298
1299 /// @brief For updating/modifying a given channel's properties.
1301 jsonifier::vector<over_write_data> permissionOverwrites{};
1302 uint64_t defaultAutoArchiveDuration{ 10080 };
1303 uint64_t videoQualityMode{ 1 };
1304 jsonifier::string parentId{};
1305 jsonifier::string rtcRgion{};
1306 uint64_t rateLimitPerUser{};
1307 uint64_t bitrate{ 48000 };
1308 jsonifier::string topic{};
1309 jsonifier::string name{};
1310 uint64_t userLimit{};
1311 uint64_t position{};
1312 channel_type type{};
1313 bool nsfw{};
1314 };
1315
1316 /// @brief/// data structure representing a single reaction.
1318 public:
1319 guild_member_data member{};///< The guild_member_data who placed the reaction.
1320 snowflake channelId{};///< The id of the channel_data where it was placed.
1321 snowflake messageId{};///< The id of the message upon which it was placed.
1322 snowflake guildId{};///< The id of the guild where it was placed.
1323 snowflake userId{};///< The id of the user_data who placed the reaction.
1324 emoji_data emoji{};///< The emoji that was placed as a reaction.
1325 uint64_t count{};///< The number of times this particular emoji was placed as a reaction to the given message_data.
1326 snowflake id{};
1327 bool me{};///< Whether or not i (the bot) placed it.
1328
1329 DCA_INLINE reaction_data() = default;
1330 };
1331
1332 /// @brief Structure representing voice region data.
1334 jsonifier::string name{};///< Name of the region.
1335 bool deprecated{};///< Whether this is a deprecated voice region(avoid switching to these).
1336 snowflake id{};///< Unique id for the region.
1337 bool optimal{};///< True for a single server that is closest to the current user_data's client.
1338 bool custom{};///< Whether this is a custom voice region(used for events / etc).
1339 };
1340
1341 /// @brief Message activity types.
1342 enum class message_activity_type : uint8_t {
1343 Join = 1,///< Join.
1344 Spectate = 2,///< Spectate.
1345 Listen = 3,///< Listen.
1346 Join_Request = 5///< Join-request.
1347 };
1348
1349 /// @brief Message activity data.
1352 jsonifier::string partyId{};///< Party id.
1353 };
1354
1355 /// @brief Ban data.
1356 struct ban_data {
1357 bool failedDueToPerms{};///< Failed due to perms?
1358 jsonifier::string reason{};///< Reason for the ban.
1359 user_data user{};///< User_data that was banned.
1360 };
1361
1362 /// @brief Team members object data.
1364 jsonifier::vector<permissions_parse> permissions{};///< Permissions for the team.
1365 uint64_t membershipState{};///< current state.
1366 snowflake teamId{};///< snowflake of the current team.
1367 user_data user{};///< User_data data of the current user_data.
1368 };
1369
1370 /// @brief For updating the current voice state.
1372 snowflake channelId{};///< snowflake of the desired voice channel_data. leave blank to disconnect.
1373 snowflake guildId{};///< The id of the guild fo which we would like to establish a voice connection.
1374 bool selfMute{};///< Whether or not we self-mute ourselves.
1375 bool selfDeaf{};///< Whether or not we self-deafen ourselves.
1376
1377 operator discord_core_internal::etf_serializer();
1378 };
1379
1380 /// @brief For updating the current voice state.
1382 std::nullptr_t channelId{ nullptr };///< snowflake of the desired voice channel_data. leave blank to disconnect.
1383 snowflake guildId{};///< The id of the guild fo which we would like to establish a voice connection.
1384 bool selfDeaf{};///< Whether or not we self-deafen ourselves.
1385 bool selfMute{};///< Whether or not we self-mute ourselves.
1386
1387 operator discord_core_internal::etf_serializer();
1388 };
1389
1390 /// @brief Team object data.
1392 public:
1393 jsonifier::vector<team_members_object_data> members{};///< Array of team members object data.
1394 snowflake ownerUserId{};///< User_data id of the team owner.
1395 jsonifier::string icon{};///< Icon for the team.
1396 snowflake id{};
1397
1398 DCA_INLINE team_object_data() = default;
1399 };
1400
1401 /// application flags, for the application_data structure.
1402 enum class application_flags : uint32_t {
1403 Gateway_Presence = 1 << 12,///< Intent required for bots in 100 or more servers to receive presence_update events.
1404 Gateway_Presence_Limited = 1 << 13,///< Intent required for bots in under 100 servers to receive presence_update events, found in bot settings.
1405 Gateway_Guild_Members = 1 << 14,///< Intent required for bots in 100 or more servers to receive member-related events like guild_member_add.
1406 Gateway_Guild_Members_Limited = 1 << 15,///< Intent required for bots in under 100 servers to receive member-related events like guild_member_add, found in bot settings.
1407 Verificatino_Pending_Guild_Limit = 1 << 16,///< Indicates unusual growth of an app that prevents verification
1408 embedded = 1 << 17,///< Indicates if an app is embedded within the discord client (currently unavailable publicly)
1409 Gateway_Message_Content = 1 << 18,///< Intent required for bots in 100 or more servers to receive message content
1410 Gateway_Message_Content_Limited = 1 << 19///< Intent required for bots in under 100 servers to receive message content, found in bot settings};
1411 };
1412
1413 /// @brief Install params data, for application data.
1415 jsonifier::vector<jsonifier::string> scopes{};///< The scopes to add the application to the server with.
1416 permissions_parse permissions{};///< The permissions to request for the bot role.
1417 };
1418
1419 /// @brief Application data.
1421 public:
1422 jsonifier::vector<jsonifier::string> rpcOrigins{};///< Array of rpc origin strings.
1423 jsonifier::vector<jsonifier::string> tags{};///< Up to 5 tags describing the content and functionality of the application install_params.
1424 jsonifier::string termsOfServiceUrl{};///< Terms of service url.
1425 jsonifier::string privacyPolicyUrl{};///< Privacy policy url.
1426 jsonifier::string customInstallUrl{};
1427 jsonifier::string primarySkuId{};///< Primary sku snowflake.
1428 jsonifier::string description{};///< Description of the application.
1429 jsonifier::string coverImage{};///< The cover image.
1430 jsonifier::string verifyKey{};///< The verification key.
1431 install_params_data params{};///< Settings for the application's default in-app authorization link, if enabled.
1432 jsonifier::string summary{};///< Summary of the application.
1433 bool botRequireCodeGrant{};///< Does the bot require a code grant?
1434 application_flags flags{};///< Application flags.
1435 jsonifier::string slug{};///< Sluhg.
1436 jsonifier::string name{};///< Application's name.
1437 jsonifier::string icon{};///< Application's icon.
1438 team_object_data team{};///< Team object data.
1439 snowflake guildId{};///< Guild id.
1440 user_data owner{};///< Application's owner.
1441 bool botPublic{};///< Is the bot public?
1442 snowflake id{};
1443
1444 DCA_INLINE application_data() = default;
1445 };
1446
1447 /// @brief Authorization info structure.
1449 jsonifier::vector<jsonifier::string> scopes{};///< Array of strings - the scopes the user_data has authorized the application for.
1450 application_data application{};///< Partial application object the current application.
1451 jsonifier::string expires{};///< When the access token expires.
1452 user_data user{};/// the user_data who has authorized, if the user_data has authorized with the identify scope.
1453 };
1454
1455 /// @brief Account data.
1457 public:
1458 jsonifier::string name{};///< Name of the account.
1459 snowflake id{};
1460
1461 DCA_INLINE account_data() = default;
1462 };
1463
1464 /// @brief Guild widget data.
1466 snowflake channelId{};///< The widget channel_data id.
1467 bool enabled{};///< Whether the widget is enabled.
1468 };
1469
1470 /// @brief Get guild widget data.
1472 jsonifier::vector<channel_data> channels{};///< Voice and stage channels which are accessible by everyone.
1473 jsonifier::vector<user_data> members{};///< Special widget user objects that includes users presence (limit 100).
1474 jsonifier::string instantInvite{};///< Instant invite for the guilds specified widget invite channel.
1475 uint64_t presenceCount{};///< Number of online members in this guild.
1476 jsonifier::string name{};///< Guild name (2-100 characters).
1477 snowflake id{};
1478 };
1479
1480 /// @brief Widget style options.
1481 enum class widget_style_options : uint8_t {
1482 Shield = 0,///< Shield
1483 Banner1 = 1,///< Banner1
1484 Banner2 = 2,///< Banner2
1485 Banner3 = 3,///< Banner3
1486 Banner4 = 4///< Banner4
1487 };
1488
1489 /// @brief Guild widget image data.
1491 jsonifier::string url{};
1492 };
1493
1494 /// @brief Integration data.
1496 public:
1497 application_data application{};///< Application data.
1498 jsonifier::string syncedAt{};///< Time it was last synced at.
1499 bool enableEmoticons{ true };///< Emoticons enabled?
1500 uint64_t expireGracePeriod{};///< How int64_t before the integration expires.
1501 uint64_t subscriberCount{};///< Number of current subscribers.
1502 uint64_t expireBehavior{};///< What to do upon expiry.
1503 jsonifier::string name{};///< Name of the integration.
1504 jsonifier::string type{};///< Type of integration.
1505 account_data account{};///< Account data.
1506 snowflake roleId{};///< Role_data snowflake.
1507 user_data user{};///< User_data data for the integration.
1508 bool revoked{};///< Has it been revoked?
1509 bool enabled{};///< Enabled?
1510 bool syncing{};///< Is it syncing?
1511 snowflake id{};
1512
1513 DCA_INLINE integration_data() = default;
1514 };
1515
1516 /// @brief Audit log events.
1517 enum class audit_log_event : uint8_t {
1518 Guild_Update = 1,///< Guild update.
1519 Channel_Create = 10,///< channel_data create.
1520 Channel_Update = 11,///< channel_data update.
1521 Channel_Delete = 12,///< channel_data delete.
1522 Channel_Overwrite_Create = 13,///< channel_data overwrite create.
1523 Channel_Overwrite_Update = 14,///< channel_data overwrite update.
1524 Channel_Overwrite_Delete = 15,///< channel_data overwrite delete.
1525 Member_Kick = 20,///< Member kick.
1526 Member_Prune = 21,///< Member prune.
1527 Member_Ban_Add = 22,///< Member ban add.
1528 Member_Ban_Remove = 23,///< Member ban erase.
1529 Member_Update = 24,///< Member update.
1530 Member_Role_Update = 25,///< Member role update.
1531 Member_Move = 26,///< Member move.
1532 Member_Disconnect = 27,///< Member disconnect.
1533 Bot_Add = 28,///< Bot add.
1534 Role_Create = 30,///< Role_data create.
1535 Role_Update = 31,///< Role_data update.
1536 Role_Delete = 32,///< Role_data delete.
1537 Invite_Create = 40,///< Invite create.
1538 Invite_Update = 41,///< Invite update.
1539 Invite_Delete = 42,///< Invite delete.
1540 Webhook_Create = 50,///< Webhook create.
1541 Webhook_Update = 51,///< Webhook update.
1542 Webhook_Delete = 52,///< Webhook delete.
1543 Emoji_Create = 60,///< Emoji create.
1544 Emoji_Update = 61,///< Emoji update.
1545 Emoji_Delete = 62,///< Emoji delete.
1546 Message_Delete = 72,///< Message delete.
1547 Message_Bulk_Delete = 73,///< Message bulk delete.
1548 Message_Pin = 74,///< Message pin.
1549 Message_Unpin = 75,///< Message unpin.
1550 Integration_Create = 80,///< Integration create.
1551 Integration_Update = 81,///< Integration update.
1552 Integration_Delete = 82,///< Integration delete.
1553 Stage_Instance_Create = 83,///< Stage-instance create.
1554 Stage_Instance_Update = 84,///< Stage-instance update.
1555 Stage_Instance_Delete = 85,///< Stage-instance delete.
1556 Sticker_Create = 90,///< Sticker_data create.
1557 Sticker_Update = 91,///< Sticker_data update.
1558 Sticker_Delete = 92,///< Sticker_data delete.
1559 Guild_Scheduled_Event_Create = 100,///< Guild-scheduled-event create.
1560 Guild_Scheduled_Event_Update = 101,///< Guild-scheduled-event update.
1561 Guild_Scheduled_Event_Delete = 102,///< Guild-scheduled-event delete.
1562 Thread_Create = 110,///< Thread_data create.
1563 Thread_Update = 111,///< Thread_data update.
1564 Thread_Delete = 112,///< Thread_data delete.
1565 Application_Command_Permission_Update = 121,///< Permissions were updated for a command.
1566 Auto_Moderation_Rule_Create = 140,///< Auto moderation rule was created.
1567 Auto_Moderation_Rule_Update = 141,///< Auto moderation rule was updated.
1568 Auto_Moderation_Rule_Delete = 142,///< Auto moderation rule was deleted.
1569 Auto_Moderation_Block_Message = 143///< Message was blocked by auto_mod (according to a rule).
1570 };
1571
1572 /// audit log entry info data @brief Audit log entry info data.
1574 public:
1575 jsonifier::string deleteMemberDays{};///< Number of days for which the member's messages were deleted.
1576 jsonifier::string membersRemoved{};///< Number of members that were removed upon a prune.
1577 jsonifier::string roleName{};///< Role_data name.
1578 snowflake applicationId{};///< Id of the app whose permissions were targeted APPLICATION_COMMAND_PERMISSION_UPDATE.
1579 jsonifier::string count{};///< count.
1580 jsonifier::string type{};///< Type.
1581 snowflake channelId{};///< channel_data snowflake.
1582 snowflake messageId{};///< Message snowflake.
1583 snowflake id{};
1584
1585 DCA_INLINE optional_audit_entry_info_data() = default;
1586 };
1587
1588 /// @brief Audit log change data.
1590 jsonifier::string newValue{};///< New value.
1591 jsonifier::string oldValue{};///< Old value.
1592 jsonifier::string key{};///< The key of the audit log change.
1593 };
1594
1595 /// @brief Guild prune count data.
1597 uint64_t count{};
1598 };
1599
1600 /// @brief Audit log entry data.
1602 public:
1603 jsonifier::vector<audit_log_change_data> changes{};///< Array of audit log change data.
1604 optional_audit_entry_info_data options{};///< Audit log entry info data.
1605 time_stamp createdTimeStamp{};///< Time at which this entry was created.
1606 audit_log_event actionType{};///< Audit log action type.
1607 jsonifier::string reason{};///< The reason that was entered for the given change.
1608 snowflake targetId{};///< snowflake of the target user_data.
1609 snowflake userId{};///< snowflake of the executing user_data.
1610 snowflake id{};
1611 };
1612
1613 /// @brief Premium tier levels.
1614 enum class premium_tier : uint8_t {
1615 None = 0,///< None.
1616 Tier_1 = 1,///< Tier 1.
1617 Tier_2 = 2,///< Tier 2.
1618 Tier_3 = 3///< Tier 3.
1619 };
1620
1621 /// @brief Default message notification
1622 /// levels.
1624 All_Messages = 0,///< All messages.
1625 Only_Mentions = 1///< Only mentions.
1626 };
1627
1628 /// @brief Explicit content filter levels.
1629 enum class explicit_content_filter_level : uint8_t {
1630 Disabled = 0,///< Disabled.
1631 Members_Without_Roles = 1,///< Members without roles.
1632 All_Members = 2///< All members.
1633 };
1634
1635 /// @brief Mfa levels.
1636 enum class mfalevel : uint8_t {
1637 None = 0,///< None.
1638 Elevated = 1///< Elevated.
1639 };
1640
1641 /// @brief/// verification levels.
1642 enum class verification_level : uint8_t {
1643 None = 0,///< None.
1644 Low = 1,///< Low.
1645 Medium = 2,///< Medium.
1646 High = 3,///< High.
1647 Very_High = 4///< Very high.
1648 };
1649
1650 /// @brief Welcome screen channel_data data.
1652 jsonifier::string description{};///< Description of the welcome channel_data.
1653 jsonifier::string emojiName{};///< Emoji name for the channel_data.
1654 snowflake channelId{};///< snowflake of the welcome channel_data.
1655 snowflake emojiId{};///< Emoji id for the channel_data.
1656 };
1657
1658 /// @brief Welcome screen data.
1660 jsonifier::vector<welcome_screen_channel_data> welcomeChannels{};///< Welcome screen channel_data data.
1661 jsonifier::string description{};///< Description of the welcome screen.
1662 };
1663
1664 /// @brief Stage instance privacy levels.
1665 enum class stage_instance_privacy_level : uint8_t {
1666 Public = 1,///< Public.
1667 Guild_Only = 2///< Guild only.
1668 };
1669
1670 /// @brief Stage instance data.
1672 public:
1673 stage_instance_privacy_level privacyLevel{};///< Privacy level of the channel_data.
1674 bool discoverableDisabled{};///< Is it discoverable?
1675 jsonifier::string topic{};///< The topic of the stage_instance_data.
1676 snowflake channelId{};///< The channel_data's id.
1677 snowflake guildId{};///< The guild id for which the channel_data exists in.
1678 snowflake id{};
1679
1680 DCA_INLINE stage_instance_data() = default;
1681 };
1682
1683 /// @brief Sticker_data types.
1684 enum class sticker_type : uint8_t {
1685 Standard = 1,///< Standard.
1686 Guild = 2///< Guild.
1687 };
1688
1689 enum class sticker_flags : uint8_t { Available = 1 << 0 };
1690
1691 /// @brief Data representing a single sticker_data.
1693 public:
1694 jsonifier::string description{};///< Description of the sticker_data.
1696 jsonifier::string packId{};///< Pack id of the sticker_data.
1697 jsonifier::string asset{};///< Asset value for the sticker_data
1698 jsonifier::string name{};///< The sticker_data's name.
1699 jsonifier::string tags{};///< Tags for the sticker_data to use.
1700 sticker_flags flags{};///< Sticker_data flags.
1701 uint64_t nsfwLevel{};///< Nsfw warning level.
1702 uint64_t sortValue{};///< Where in the stack of stickers it resides.
1703 snowflake guildId{};///< The guild id for which the sticker_data exists in.
1704 sticker_type type{};///< The type of sticker_data.
1705 user_data user{};///< The user_data that uploaded the guild sticker_data.
1706 snowflake id{};
1707
1708 DCA_INLINE sticker_data() = default;
1709 };
1710
1711 /// @brief Data representing a single guild preview.
1713 jsonifier::vector<jsonifier::string> features{};
1714 jsonifier::vector<sticker_data> stickers{};
1715 jsonifier::vector<emoji_data> emojis{};
1716 jsonifier::string discoverySplash{};
1717 uint64_t approximatePresenceCount{};
1718 uint64_t approximateMemberCount{};
1719 jsonifier::string description{};
1720 jsonifier::string splash{};
1721 jsonifier::string name{};
1722 jsonifier::string icon{};
1723 snowflake id{};
1724 };
1725
1726 /// @brief Afk timeout durations.
1727 enum class afk_time_out_durations : uint16_t {
1728 Shortest = 60,///< Shortest.
1729 Short = 300,///< Short.
1730 Medium = 900,///< Medium.
1731 Long = 1800,///< Long.
1732 Longest = 3600///< Longest.
1733 };
1734
1735 /// @brief Guild nsfw level.
1736 enum class guild_nsfwlevel : uint8_t {
1737 Default = 0,///< Default.
1738 Explicit = 1,///< Explicit.
1739 Safe = 2,///< Safe.
1740 Age_Restricted = 3///< Age restricted.
1741 };
1742
1743 /// @brief System channel flags.
1744 enum class system_channel_flags : uint8_t {
1745 Suppress_Join_Notifications = 1 << 0,///< Suppress member join notifications.
1746 Suppress_Premium_Subscriptions = 1 << 1,///< Suppress server boost notifications.
1747 Suppress_Guild_Reminder_Notifications = 1 << 2,///< Suppress server setup tips.
1748 Suppress_Join_Notification_Replies = 1 << 3///< Hide member join sticker reply buttons.
1749 };
1750
1751 class guild_cache_data;
1752 class guild;
1753
1754 /// @brief Guild scheduled event privacy levels.
1756 Public = 1,///< Public.
1757 Guild_Only = 2///< Guild only.
1758 };
1759
1760 /// @brief Guild_scheduled_event_status.
1761 enum class guild_scheduled_event_status : uint8_t {
1762 Scheduled = 1,///< Scheduled.
1763 Active = 2,///< Active.
1764 Completed = 3,///< completed.
1765 Canceled = 4///< cancelled.
1766 };
1767
1768 /// @brief Guild scheduled event entity types.
1770 None = 0,///< None.
1771 State_Instance = 1,///< Stage instance.
1772 Voice = 2,///< Voice.
1773 External = 3///< External.
1774 };
1775
1776 /// @brief Guild scheduled event entity metadata.
1778 jsonifier::string location{};
1779 };
1780
1781 /// @brief Data representing a guild scheduled event.
1783 public:
1784 guild_scheduled_event_privacy_level privacyLevel{};///< The privacy level of the scheduled event.
1785 guild_scheduled_event_metadata entityMetadata{};///< Additional metadata for the guild scheduled event.
1786 guild_scheduled_event_entity_type entityType{};///< The type of the scheduled event.
1787 jsonifier::string scheduledStartTime{};///< The time the scheduled event will start.
1788 jsonifier::string scheduledEndTime{};///< The time the scheduled event will end, required if entity_type is external.
1789 guild_scheduled_event_status status{};///< The status of the scheduled event.
1790 jsonifier::string description{};///< The description of the scheduled event(1 - 1000 characters.
1791 jsonifier::string name{};///< The name of the scheduled event(1 - 100 characters).
1792 snowflake creatorId{};///< The id of the user_data that created the scheduled event *.
1793 snowflake channelId{};///< The channel_data id in which the scheduled event will be hosted, or null if scheduled entity type is external.
1794 snowflake entityId{};///< The id of an entity associated with a guild scheduled event.
1795 uint32_t userCount{};///< The number of users subscribed to the scheduled event.
1796 snowflake guildId{};///< The guild id which the scheduled event belongs to.
1797 user_data creator{};///< The user_data that created the scheduled event.
1798 snowflake id{};
1799
1800 DCA_INLINE guild_scheduled_event_data() = default;
1801 };
1802
1803 /// @brief Data representing a single guild_scheduled_event_user.
1805 snowflake guildScheduledEventId{};///< The scheduled event id which the user_data subscribed to/
1806 guild_member_data member{};///< Guild member data for this user_data for the guild which this event belongs to, if any.
1807 user_data user{};///< User_data which subscribed to an event.
1808 };
1809
1810 /// @brief Invite target types.
1811 enum class invite_target_types : uint8_t {
1812 Stream = 1,///< Stream.
1813 Embedded_Application = 2///< Embedded application.
1814 };
1815
1816 /// @brief Web_hook_data types.
1817 enum class web_hook_type : uint8_t {
1818 Incoming = 1,///< Incoming.
1819 Channel_Follower = 2,///< channel_data follower.
1820 Application = 3///< Application.
1821 };
1822
1823 /// @brief For removing a reaction.
1825 snowflake channelId{};
1826 snowflake messageId{};
1827 snowflake guildId{};
1828 snowflake userId{};
1829 emoji_data emoji{};
1830 };
1831
1832 /// @brief For storing interaction-related values.
1834 jsonifier::string interactionToken{};
1835 snowflake applicationId{};
1836 snowflake interactionId{};
1837 };
1838
1839 /// @brief For storing message_data-related values.
1841 snowflake channelId{};
1842 snowflake messageId{};
1843 };
1844
1845 /// @brief Data structure representing an application_command_data's option choice.
1847 public:
1848 unordered_map<jsonifier::string, jsonifier::string> nameLocalizations{};///< Dictionary with keys in available locales localization dictionary for the name.
1849 unordered_set<jsonifier::string> jsonifierExcludedKeys{};
1850 jsonifier::raw_json_data value{};///< The value of the option.
1851 jsonifier::string name{};///< The name of the current choice.
1852
1853 void generateExcludedKeys();
1854
1855 bool operator==(const application_command_option_choice_data&) const;
1856 };
1857
1858 /// @brief Data structure representing an application_command_data's option.
1860 unordered_map<jsonifier::string, jsonifier::string> descriptionLocalizations{};///< Dictionary for the description localizations field.
1861 unordered_map<jsonifier::string, jsonifier::string> nameLocalizations{};///< Dictionary for the name localizations field.
1862 jsonifier::vector<application_command_option_choice_data> choices{};///< A vector of possible choices for the current application_command_data option.
1863 jsonifier::vector<application_command_option_data> options{};///< A vector of possible options for the current application_command_data option.
1864 int64_t minValue{ std::numeric_limits<int64_t>::max() };///< If the option is an integer or number type, the minimum value permitted.
1865 int64_t maxValue{ std::numeric_limits<int64_t>::min() };///< If the option is an integer or number type, the maximum value permitted.
1866 unordered_set<jsonifier::string> jsonifierExcludedKeys{};
1867 jsonifier::vector<channel_type> channelTypes{};///< Set when the application_command_data option type is set to channel_data.
1868 application_command_option_type type{};///< The type of command option.
1869 jsonifier::string description{};///< A description of the current application_command_data option.
1870 jsonifier::string name{};///< Name of the current application_command_data option.
1871 bool autocomplete{};///< If autocomplete interactions are enabled for this string, integer, or number type option.
1872 bool required{};///< If the parameter is required or optional-- default false.
1873
1874 void generateExcludedKeys();
1875
1876 bool operator==(const application_command_option_data&) const;
1877 };
1878
1879 /// @brief Representing "typing_start" data.
1881 guild_member_data member{};
1882 time_stamp timeStamp{};
1883 snowflake channelId{};
1884 snowflake guildId{};
1885 snowflake userId{};
1886 };
1887
1888 struct you_tube_format {
1889 jsonifier::string signatureCipher{};
1890 jsonifier::string audioSampleRate{};
1891 jsonifier::string audioQuality{};
1892 jsonifier::string downloadUrl{};
1893 jsonifier::string signature{};
1894 jsonifier::string mimeType{};
1895 jsonifier::string quality{};
1896 jsonifier::string codecs{};
1897 jsonifier::string aitags{};
1898 uint64_t averageBitrate{};
1899 int64_t contentLength{};
1900 uint64_t bitrate{};
1901 uint64_t height{};
1902 uint64_t width{};
1903 uint64_t itag{};
1904 uint64_t fps{};
1905 };
1906
1907 /// @brief Application command types.
1908 enum class application_command_type : uint8_t {
1909 Chat_Input = 1,///< chat input.
1910 User_Data = 2,///< User_data.
1911 Message = 3///< Message.
1912 };
1913
1914 /// @brief Component types.
1915 enum class component_type : uint8_t {
1916 Action_Row = 1,///< container for other components.
1917 Button = 2,///< Button object.
1918 String_Select = 3,///< Select menu for picking from defined text options.
1919 Text_Input = 4,///< Text input object.
1920 User_Select = 5,///< Select menu for users.
1921 Role_Select = 6,///< Select menu for roles.
1922 Mentionable_Select = 7,///< Select menu for mentionables (users and roles).
1923 Channel_Select = 8,///< Select menu for channels.
1924 };
1925
1926 enum class select_menu_type : uint8_t { String_Select = 3, User_Select = 5, Role_Select = 6, Mentionable_Select = 7, Channel_Select = 8 };
1927
1928 enum class select_default_value_type { user = 0, role = 1, channel = 2 };
1929
1930 class select_default_value_data {
1931 public:
1932 DCA_INLINE select_default_value_data() = default;
1933
1934 DCA_INLINE select_default_value_data(select_default_value_type typeNew) {
1935 switch (typeNew) {
1936 case select_default_value_type::user: {
1937 type = "user";
1938 break;
1939 }
1940 case select_default_value_type::role: {
1941 type = "role";
1942 break;
1943 }
1944 case select_default_value_type::channel: {
1945 type = "channel";
1946 break;
1947 }
1948 }
1949 }
1950 jsonifier::string type{};
1951 snowflake id{};
1952 };
1953
1954 /// @brief Allowable mentions for a message.
1956 public:
1957 jsonifier::vector<jsonifier::string> parse{};///< A vector of allowed mention types to parse from the content.
1958 jsonifier::vector<jsonifier::string> roles{};///< Array of role_ids to mention (max size of 100)
1959 jsonifier::vector<jsonifier::string> users{};///< Array of user_ids to mention (max size of 100)
1960 bool repliedUser{};///< For replies, whether to mention the author of the message being replied to (default false).
1961 };
1962
1963 /// @brief Interaction types.
1964 enum class interaction_type : uint8_t {
1965 Ping = 1,///< Ping.
1966 Application_Command = 2,///< Application command.
1967 Message_Component = 3,///< Message component.
1968 Application_Command_Autocomplete = 4,///< Application command autocomplete.
1969 Modal_Submit = 5///< Modal submission.
1970 };
1971
1972 /// @brief Represents a single selection from a select-menu.
1974 public:
1975 jsonifier::string description{};///< Description of the select-menu-option.
1976 partial_emoji_data emoji{};///< An optional emoji to put on it.
1977 jsonifier::string label{};///< A visible label for the select-menu-option.
1978 jsonifier::string value{};///< A value for identifying the option.
1979 bool _default{};///< Is it the default option?
1980 };
1981
1982 /// @brief Button styles.
1983 enum class button_style : uint8_t {
1984 Primary = 1,///< Primary.
1985 Success = 3,///< Success.
1986 Secondary = 2,///< Secondary.
1987 Danger = 4,///< Danger.
1988 Link = 5///< Link.
1989 };
1990
1991 struct DiscordCoreAPI_Dll component_data {
1992 jsonifier::vector<select_default_value_data> defaultValues{};
1993 unordered_set<jsonifier::string> jsonifierExcludedKeys{};
1994 jsonifier::vector<select_option_data> options{};
1995 jsonifier::vector<channel_type> channelTypes{};
1996 jsonifier::string placeholder{};
1997 jsonifier::string customId{};
1998 partial_emoji_data emoji{};
1999 jsonifier::string label{};
2000 jsonifier::string value{};
2001 jsonifier::string title{};
2002 jsonifier::string url{};
2003 component_type type{};
2004 uint64_t minValues{};
2005 uint64_t maxValues{};
2006 uint64_t minLength{};
2007 uint64_t maxLength{};
2008 uint64_t style{};
2009 bool disabled{};
2010 bool required{};
2011
2012 void generateExcludedKeys();
2013 };
2014
2015 /// @brief Action row data of message components.
2017 public:
2019 jsonifier::vector<component_data> components{};///< Array of components to make up the action-row.
2020 unordered_set<jsonifier::string> jsonifierExcludedKeys{};
2021
2022 void generateExcludedKeys();
2023 };
2024
2025 /// @brief Interaction callback types.
2026 enum class interaction_callback_type : uint8_t {
2027 Pong = 1,///< Ack a ping.
2028 Channel_Message_With_Source = 4,///< Respond to an interaction with a message.
2029 Deferred_Channel_Message_With_Source = 5,///< Ack an interaction and edit a response later, the user sees a loading state.
2030 Deferred_Update_Message = 6,///< For components, ack an interaction and edit the original message later; the user does not see a loading state.
2031 Update_Message = 7,///< For components, edit the message the component was attached to.
2032 Application_Command_Autocomplete_Result = 8,///< Respond to an autocomplete interaction with suggested choices.
2033 Modal = 9///< Respond to an interaction with a popup modal.
2034 };
2035
2036 /// @brief Interaction application_command_data callback data.
2037 struct DiscordCoreAPI_Dll interaction_callback_data {
2038 jsonifier::vector<application_command_option_choice_data> choices{};///< Autocomplete choices(max of 25 choices).
2039 jsonifier::vector<attachment_data> attachments{};///< Array of partial attachment objects attachment objects with filename and description.
2040 unordered_set<jsonifier::string> jsonifierExcludedKeys{};///< Keys to exclude from parsing/serializing.
2041 jsonifier::vector<action_row_data> components{};///< Message components.
2042 allowed_mentions_data allowedMentions{};///< Allowed mentions data.
2043 jsonifier::vector<embed_data> embeds{};///< Message embeds.
2044 jsonifier::vector<file> files{};///< Files for uploading.
2045 jsonifier::string customId{};///< A developer-defined identifier for the component, max 100 characters.
2046 jsonifier::string content{};///< Message content.
2047 jsonifier::string title{};///< The title of the popup modal.
2048 uint64_t flags{};///< Flags.
2049 bool tts{};///< Is it tts?
2050
2051 void generateExcludedKeys();
2052 };
2053
2055
2056 /// @brief Data structure representing an application_command_data.
2058 public:
2059 unordered_map<jsonifier::string, jsonifier::string> descriptionLocalizations{};///< Dictionary with keys in available locales.
2060 unordered_map<jsonifier::string, jsonifier::string> nameLocalizations{};///< Dictionary with keys in available locales.
2061 jsonifier::vector<application_command_option_data> options{};///< A vector of possible options for the current application_command_data.
2062 unordered_set<jsonifier::string> jsonifierExcludedKeys{};///< Keys to exclude at serialization time.
2063 permission defaultMemberPermissions{};///< Set of permissions represented as a bit set all
2064 jsonifier::string description{};///< A description of the current application_command_data.
2065 application_command_type type{};///< The type of application_command_data.
2066 jsonifier::string version{};///< An autoincremented version.
2067 snowflake applicationId{};///< The current application id.
2068 jsonifier::string name{};///< Name of the current application_command_data.
2069 bool dmPermission{};///< Indicates whether the command is available in dms with the app, only for globally - scoped commands.
2070 snowflake guildId{};///< (where applicable) a guild id for which guild to assign this application_command_data to.
2071 snowflake id{};
2072
2073 DCA_INLINE application_command_data() = default;
2074
2075 void generateExcludedKeys();
2076
2077 bool operator==(const application_command_data&) const;
2078 };
2079
2080 /// @brief Channel_data mention data.
2082 public:
2083 snowflake guildId{};///< The id of the guild where it took place.
2084 jsonifier::string name{};///< The name of the channel_data that was mentioned.
2085 channel_type type{};///< The type of channel_data that was mentioned.
2086 snowflake id{};
2087 };
2088
2089 /// @brief Data for when some channel_data pins are updated.
2091 time_stamp lastPinTimeStamp{};///< The time of the last pinned message.
2092 snowflake channelId{};///< The id of the channel_data within which the message was pinned.
2093 snowflake guildId{};///< The id of the guild within which the message was pinned.
2094 };
2095
2096 /// @brief Data for when threads are synced.
2098 jsonifier::vector<jsonifier::string> channelIds{};///< The parent channel_data ids whose threads are being synced.
2099 jsonifier::vector<thread_member_data> members{};///< Array of members that are a part of the thread_data.
2100 jsonifier::vector<channel_data> threads{};///< All active threads in the given channels that the current user_data can access.
2101 snowflake guildId{};///< The id of the guild for which the threads are being synced.
2102 };
2103
2104 /// @brief Represents a thread_data-members-update.
2106 public:
2107 jsonifier::vector<jsonifier::string> removedMemberIds{};///< Members who have been removed.
2108 jsonifier::vector<thread_member_data> addedMembers{};///< New members added to the thread_data.
2109 uint32_t memberCount{};///< Number of guild-members in the thread_data.
2110 snowflake guildId{};///< Guild id of the thread_data.
2111 snowflake id{};
2112
2113 DCA_INLINE thread_members_update_data() = default;
2114 };
2115
2116 /// @brief Message interaction data.
2118 public:
2119 guild_member_data member{};
2120 jsonifier::string name{};
2121 interaction_type type{};
2122 user_data user{};
2123 snowflake id{};
2124
2125 DCA_INLINE message_interaction_data() = default;
2126 };
2127
2128 /// @brief Message types.
2129 enum class message_type : uint8_t {
2130 Default = 0,///< Default.
2131 Recipient_Add = 1,///< Recipient add.
2132 Recipient_Remove = 2,///< Recipient erase.
2133 Call = 3,///< call.
2134 Channel_Name_Change = 4,///< channel_data name change.
2135 Channel_Icon_Change = 5,///< channel_data icon change.
2136 Channel_Pinned_Message = 6,///< channel_data pinned message.
2137 Guild_Member_Join = 7,///< Guild memeber join.
2138 User_Premium_Guild_Subscription = 8,///< User_data premium guild subscription.
2139 User_Premium_Guild_Subscription_Tier_1 = 9,///< User_data premium guild subscription tier 1.
2140 User_Premium_Guild_Subscription_Tier_2 = 10,///< User_data premium guild subscription tier 2.
2141 User_Premium_Guild_Subscription_Tier_3 = 11,///< User_data premium guild subscription tier 3.
2142 Channel_Follow_Add = 12,///< channel_data follow add.
2143 Guild_Discovery_Disqualified = 14,///< Guild discovery disqualified.
2144 Guild_Discovery_Requalified = 15,///< Guild discovery requalified.
2145 Guild_Discovery_Grace_Period_Initial_Warning = 16,///< Guild discovery grade period initial warning.
2146 Guild_Discovery_Grace_Period_Final_Warning = 17,///< Guild discovery grade period final warning.
2147 Thread_Created = 18,///< Thread_data created.
2148 Reply = 19,///< Reply.
2149 Chat_Input_Command = 20,///< chat input command.
2150 Thread_Starter_Message = 21,///< Thread_data starter message_data.
2151 Guild_Invite_Reminder = 22,///< Guild invite reminder.
2152 Context_Menu_Command = 23///< context menu command.
2153 };
2154
2155 /// @brief Message flags.
2156 enum class message_flags : uint8_t {
2157 Crossposted = 1 << 0,///< crossposted.
2158 Is_Crosspost = 1 << 1,///< Is crosspost.
2159 Suppress_Embeds = 1 << 2,///< Supress embeds.
2160 Source_Message_Deleted = 1 << 3,///< Source message deleted.
2161 Urgent = 1 << 4,///< Urgent.
2162 Has_Thread = 1 << 5,///< Has thread_data.
2163 Ephemeral = 1 << 6,///< Ephemeral.
2164 Loading = 1 << 7///< Loading.
2165 };
2166
2167 /// @brief Sticker_data item types.
2168 enum class sticker_item_type : uint8_t {
2169 png = 1,///< Png.
2170 apng = 2,///< Apng.
2171 lottie = 3///< Lottie.
2172 };
2173
2174 /// @brief Represents a forum thread message.
2176 jsonifier::vector<jsonifier::string> stickerIds{};///< Array of snowflakes ids of up to 3 stickers in the server to send in the message.
2177 jsonifier::vector<attachment_data> attachments{};///< Array of partial attachment objects attachment objects with filename.
2178 jsonifier::vector<action_row_data> components{};///< Array of message component objects the components to include with the message.
2179 allowed_mentions_data allowedMentions{};///< Allowed mention object allowed mentions for the message.
2180 jsonifier::vector<embed_data> embeds{};///< Array of embed objects embedded rich content (up to 6000 characters).
2181 jsonifier::vector<file> files{};///< File contents the contents of the file being sent one of content, file, embed(s), sticker_ids.
2182 jsonifier::string content{};///< The message contents (up to 2000 characters).
2183 uint64_t flags{};///< Flags to be set for the message.
2184 };
2185
2186 /// @brief Message sticker_data item data.
2188 public:
2189 sticker_item_type formatType{};///< Message sticker_data item type.
2190 jsonifier::string name{};///< The name of the sticker_data.
2191 snowflake id{};
2192 };
2193
2194 /// @brief The core of a message's data structure.
2196 public:
2197 jsonifier::vector<channel_mention_data> mentionChannels{};///< Array of channel_data mention data.
2198 jsonifier::vector<jsonifier::string> mentionRoles{};///< Jsonifier::vector of "mention roles" ids.
2199 jsonifier::vector<sticker_item_data> stickerItems{};///< Array of message sticker_data item data.
2200 jsonifier::vector<attachment_data> attachments{};///< Array of attachment data.
2201 jsonifier::vector<action_row_data> components{};///< Array of action row data.
2202 jsonifier::vector<reaction_data> reactions{};//< array of reaction data.
2203 jsonifier::vector<sticker_data> stickers{};///< Array of message sticker_data data.
2204 message_reference_data messageReference{};///< Message reference data.
2205 jsonifier::vector<user_data> mentions{};///< Array of user_data data, for individual's that were mentioned.
2206 jsonifier::vector<embed_data> embeds{};///< Array of message embeds.
2207 message_interaction_data interaction{};///< Message interaction data.
2208 jsonifier::string editedTimestamp{};///< The time at which it was edited.
2209 message_activity_data activity{};///< Message activity data.
2210 application_data application{};///< A
2211 jsonifier::string content{};///< The message's content.
2212 guild_member_data member{};///< The author's guild member data.pplication data.
2213 snowflake applicationId{};///< Application id.
2214 jsonifier::string nonce{};///< Nonce.
2215 time_stamp timeStamp{};///< The timeStamp of when the message was created.
2216 bool mentionEveryone{};///< Does the message mention everyone?
2217 snowflake channelId{};///< The channel_data it was sent in.
2218 snowflake webHookId{};///< Web_hook id of the message_data, if applicable.
2219 channel_data thread{};///< The thread_data that the message was sent in, if applicable.
2220 snowflake guildId{};///< The id of the guild the message was sent in.
2221 message_type type{};///< Message type.
2222 user_data author{};///< The author's user_data data.
2223 uint64_t flags{};///< Flags.
2224 snowflake id{};
2225 bool pinned{};///< Is it pinned?
2226 bool tts{};///< Is it a text-to-speech message_data?
2227
2228 virtual DCA_INLINE ~message_data() = default;
2229 };
2230
2231 /// @brief Resolved data.
2233 unordered_map<snowflake, attachment_data> attachments{};///< Unordered_map of snowflakes to attachment objects the ids.
2234 unordered_map<snowflake, guild_member_data> members{};///< Unordered_map full of guild_memeber_data.
2235 unordered_map<snowflake, channel_data> channels{};///< Unordered_map full of channel_data.
2236 unordered_map<snowflake, message_data> messages{};///< Unordered_map full of messageData.
2237 unordered_map<snowflake, user_data> users{};///< Unordered_map full of user_data.
2238 unordered_map<snowflake, role_data> roles{};///< Unordered_map full of role_data.
2239 };
2240
2241 /// @brief Represents a sticker_data pack.
2243 jsonifier::vector<sticker_data> stickers{};///< Array of sticker_data objects the stickers in the pack.
2244 jsonifier::string coverStickerId{};///< snowflake of a sticker_data in the pack which is shown as the pack's icon.
2245 jsonifier::string bannerAssetId{};///< snowflake of the sticker_data pack's banner image.
2246 jsonifier::string description{};///< Description of the sticker_data pack.
2247 jsonifier::string skuId{};///< snowflake of the pack's sku.
2248 jsonifier::string name{};///< Name of the sticker_data pack.
2249 snowflake id{};///< snowflake of the sticker_data pack.
2250 };
2251
2252 /// @brief Connection visibility types.
2253 enum class connection_visibility_types : uint8_t {
2254 None = 0,///< None.
2255 Everyone = 1///< Everyone.
2256 };
2257
2258 /// @brief Represents a single user_data connection.
2260 jsonifier::vector<integration_data> integrations{};///< An array of partial server integrations.
2261 connection_visibility_types visibility{};///< Visibility of this connecti
2262 jsonifier::string name{};///< The username of the connection account.
2263 jsonifier::string type{};///< The service of the connection(twitch, youtube).
2264 bool showActivity{};///< Whether activities related to this connection will be shown in presence updates.on.
2265 bool friendSync{};///< Whether friend sync is enabled for this connection.
2266 bool verified{};///< Whether the connection is verified.
2267 bool revoked{};///< Whether the connection is revoked.
2268 snowflake id{};///< snowflake of the connection account.
2269 };
2270
2272
2273 /// @brief Application_command_data interaction data option.
2275 jsonifier::vector<application_command_interaction_data_option> options{};///< Application_command_data interaction data options.
2276 application_command_option_type type{};///< The type of application_command_data options.
2277 jsonifier::raw_json_data value{};///< The value.
2278 jsonifier::string name{};///< The name of the current option.
2279 bool focused{};///< True if this option is the currently focused option for autocomplete.
2280 };
2281
2282 /// @brief Interaction data data.
2284 jsonifier::vector<application_command_interaction_data_option> options{};///< Application_command_data interaction data options.
2285 jsonifier::vector<action_row_data> components{};///< Array of message componentsthe values submitted by the user.
2286 jsonifier::vector<jsonifier::string> values{};///< Array of select option values the user selected in a select menu component.
2287 application_command_type type{};///< The type of application_command.
2288 component_type componentType{};///< The type of the component.
2289 jsonifier::string customId{};///< The custom_id of the component.
2290 jsonifier::string name{};///< The name of the invoked command.
2291 resolved_data resolved{};///< Resolved data.
2292 snowflake targetId{};///< The target message_data's id.
2293 snowflake guildId{};///< The guild that the command took place in.
2294 snowflake id{};///< The ID of the invoked command.
2295 };
2296
2297 /// @brief Data from the session_start info.
2299 uint32_t maxConcurrency{};///< The number of identify requests allowed per 5 seconds.
2300 uint32_t resetAfter{};///< The number of milliseconds after which the limit resets.
2301 uint32_t remaining{};///< The remaining number of session starts the current user_data is allowed.
2302 uint32_t total{};///< The total number of session starts the current user_data is allowed.
2303 };
2304
2305 /// @brief Data from the get_gateway_bot endpoint.
2307 session_start_data sessionStartLimit{};///< Information on the current session start limit.
2308 jsonifier::string url{};///< The wss url that can be used for connecting to the gateway.
2309 uint32_t shards{};///< The recommended number of shards to use when connecting.
2310 };
2311
2312 /// @brief Text input style for modals.
2313 enum class text_input_style : uint8_t {
2314 Short = 1,///< A single-line input.
2315 Paragraph = 2///< A multi-line input.
2316 };
2317
2318 /// @brief Data representing a guild emoji update event.
2320 jsonifier::vector<emoji_data> emojis{};
2321 snowflake guildId{};
2322 };
2323
2324 /// @brief Data representing a guild stickers update event.
2326 jsonifier::vector<sticker_data> stickers{};
2327 snowflake guildId{};
2328 };
2329
2330 struct guild_members_chunk_event_data {
2331 jsonifier::vector<presence_update_data> presences{};
2332 jsonifier::vector<jsonifier::string> notFound{};
2333 jsonifier::vector<guild_member_data> members{};
2334 jsonifier::string nonce{};
2335 uint64_t chunkIndex{};
2336 uint64_t chunkCount{};
2337 snowflake guildId{};
2338 };
2339
2340 /// @brief A type of user_data, to represent the bot and some of its associated endpoints.
2341 class DiscordCoreAPI_Dll bot_user : public user_data {
2342 public:
2343 template<typename value_type> friend class get_user_image_url;
2344 friend class discord_core_client;
2345
2346 bot_user(user_data& dataPackage, discord_core_internal::base_socket_agent* pBaseBaseSocketAgentNew);
2347
2348 /// @brief Updates the bot's current voice-status. joins/leaves a channel, and/or self deafens/mutes.
2349 /// @param dataPackage the new voice_state_data.
2350 void updateVoiceStatus(update_voice_state_data dataPackage);
2351
2352 /// @brief Updates the bot's current activity status, to be viewed by others in the same server as the bot.
2353 /// @param dataPackage the new presence data.
2354 void updatePresence(update_presence_data dataPackage);
2355
2356 protected:
2357 bot_user() = default;
2358
2359 discord_core_internal::base_socket_agent* baseSocketAgent{};
2360 };
2361
2362 /// @brief Guild flags.
2363 enum class guild_flags : uint8_t {
2364 Widget_enabled = 1 << 0,///< Widget enabled.
2365 Unavailable = 1 << 1,///< Unavailable.
2366 Owner = 1 << 2,///< Owner.
2367 Large = 1 << 3,///< Is it a large guild?
2368 Premium_Progress_Bar_Enabled = 1 << 4///< Premium progress bar enabled
2369 };
2370
2371 template<guild_member_t value_type> two_id_key::two_id_key(const value_type& other) {
2372 idOne = other.guildId;
2373 idTwo = other.user.id;
2374 }
2375
2376 template<voice_state_t value_type> two_id_key::two_id_key(const value_type& other) {
2377 idOne = other.guildId;
2378 idTwo = other.userId;
2379 }
2380
2381 /// crtp-based struct for exposing the connectToVoice functionality of the guild-related classes.
2382 template<typename value_type, typename discord_core_client_t, typename guild_members_type> struct connect_to_voice {
2383 /// @brief For connecting to an individual voice channel.
2384 /// @param guildMemberId an id of the guild member who's current voice channel to connect to.
2385 /// @param channelId an id of the voice channel to connect to.
2386 /// @param selfDeaf whether or not to self-deafen the bot.
2387 /// @param selfMute whether or not to self-mute the bot.
2388 /// @param streamInfoNew for usage with the vc-to-vc audio streaming option.
2389 /// @return voice_connection* a pointer to the currently held voice connection, or nullptr if it failed to connect.
2390 DCA_INLINE voice_connection& connectToVoice(const snowflake guildMemberId, const snowflake channelId = 0, bool selfDeaf = false, bool selfMute = false,
2391 stream_info streamInfoNew = stream_info{}) {
2392 if (static_cast<discord_core_client_t*>(static_cast<value_type*>(this)->getDiscordCoreClient())
2393 ->getVoiceConnection(static_cast<value_type*>(this)->id)
2394 .areWeConnected()) {
2395 return static_cast<discord_core_client_t*>(static_cast<value_type*>(this)->getDiscordCoreClient())->getVoiceConnection(static_cast<value_type*>(this)->id);
2396 } else if (guildMemberId != 0 || channelId != 0) {
2397 snowflake channelIdNew{};
2398 if (guildMemberId != 0) {
2399 voice_state_data_light dataLight{};
2400 dataLight.guildId = static_cast<value_type*>(this)->id;
2401 dataLight.userId = guildMemberId;
2402 guild_member_data getData{};
2403 getData.guildId = static_cast<value_type*>(this)->id;
2404 getData.user.id = guildMemberId;
2405 auto voiceStateData = guild_members_type::getVoiceStateData(getData);
2406 if (voiceStateData.channelId != 0) {
2407 channelIdNew = voiceStateData.channelId;
2408 }
2409 } else {
2410 channelIdNew = channelId;
2411 }
2412 int32_t theShardId{ static_cast<int32_t>((static_cast<value_type*>(this)->id.operator const uint64_t&() >> 22) %
2413 static_cast<discord_core_client_t*>(static_cast<value_type*>(this)->getDiscordCoreClient())->getConfigManager().getTotalShardCount()) };
2414 voice_connect_init_data voiceConnectInitData{};
2415 voiceConnectInitData.currentShard = theShardId;
2416 voiceConnectInitData.streamInfo = streamInfoNew;
2417 voiceConnectInitData.channelId = channelIdNew;
2418 voiceConnectInitData.guildId = static_cast<value_type*>(this)->id;
2419 voiceConnectInitData.userId = static_cast<discord_core_client_t*>(static_cast<value_type*>(this)->getDiscordCoreClient())->getBotUser().id;
2420 voiceConnectInitData.selfDeaf = selfDeaf;
2421 voiceConnectInitData.selfMute = selfMute;
2422 auto& voiceConnectionNew =
2423 static_cast<discord_core_client_t*>(static_cast<value_type*>(this)->getDiscordCoreClient())->getVoiceConnection(static_cast<value_type*>(this)->id);
2424 stop_watch<milliseconds> stopWatch{ milliseconds{ 10000 } };
2425 stopWatch.reset();
2426 voiceConnectionNew.connect(voiceConnectInitData);
2427 while (!voiceConnectionNew.areWeConnected()) {
2428 if (stopWatch.hasTimeElapsed()) {
2429 break;
2430 }
2431 std::this_thread::sleep_for(1ms);
2432 }
2433 return voiceConnectionNew;
2434 }
2435 return static_cast<discord_core_client_t*>(static_cast<value_type*>(this)->getDiscordCoreClient())->getVoiceConnection(static_cast<value_type*>(this)->id);
2436 }
2437 };
2438
2439 /// @brief A discord guild. used to connect to/disconnect from voice.
2440 class DiscordCoreAPI_Dll guild_data : public flag_entity<guild_data>,
2441 public get_guild_image_url<guild_data>,
2442 public connect_to_voice<guild_data, discord_core_client, guild_members> {
2443 public:
2444 friend class guilds;
2445
2446 jsonifier::vector<guild_scheduled_event_data> guildScheduledEvents{};///< Scheduled events in the guild.
2447 default_message_notification_level defaultMessageNotifications{};///< Default message notifications level.
2448 jsonifier::vector<stage_instance_data> stageInstances{};///< Stage instances in the guild.
2449 jsonifier::vector<voice_state_data_light> voiceStates{};///< Voice states for the current guild_members.
2450 explicit_content_filter_level explicitContentFilter{};///< Explicit content filter level.
2451 jsonifier::vector<presence_update_data> presences{};///< Presences of the members in the guild.
2452 jsonifier::vector<jsonifier::string> features{};///< Enabled guild features.
2453 jsonifier::vector<guild_member_data> members{};///< custom guild emojis.
2454 jsonifier::vector<channel_data> channels{};///< custom guild emojis.
2455 jsonifier::vector<sticker_data> stickers{};///< custom guild stickers.
2456 jsonifier::vector<channel_data> threads{};///< All active threads in the guild that the current user has permission to view.
2457 system_channel_flags systemChannelFlags{};///< System channel flags.
2458 verification_level verificationLevel{};///< Verification level required for the guild.
2459 jsonifier::vector<emoji_data> emoji{};///< custom guild emojis.
2460 uint32_t maxStageVideoChannelUsers{};///< The maximum amount of users in a stage video channel.
2461 jsonifier::vector<role_data> roles{};///< Roles in the guild.
2462 uint32_t premiumSubscriptionCount{};///< The number of boosts this guild currently has.
2463 jsonifier::string preferredLocale{};///< The preferred locale of a community guild; used in server discovery and notices from discord.
2464 jsonifier::string discoverySplash{};///< Discovery splash hash; only present for guilds with the "discoverable" feature.
2465 uint32_t approximatePresenceCount{};///< Approximate number of non-offline members in this guild, returned sometimes.
2466 voice_connection* voiceConnection{};///< Voice connection potentially held by the current guild.
2467 welcome_screen_data welcomeScreen{};///< The welcome screen of a community guild, shown to new members, returned in an invite's guild object.
2468 snowflake publicUpdatesChannelId{};///< The id of the channel where admins and moderators of community guilds receive notices from discord.
2469 snowflake safetyAlertsChannelId{};///< The id of the channel where admins and moderators of community guilds receive safety alerts.
2470 uint32_t approximateMemberCount{};///< Approximate number of members in this guild, returned from the get /guilds/id and /users/me/guilds.
2471 jsonifier::string vanityUrlCode{};///< The vanity url code for the guild.
2472 bool premiumProgressBarEnabled{};///< Whether the guild has the boost progress bar enabled.
2473 uint32_t maxVideoChannelUsers{};///< The maximum amount of users in a video channel.
2474 jsonifier::string description{};///< The description of a guild.
2475 permissions_parse permissions{};///< Total permissions for the user in the guild (excludes overwrites).
2476 jsonifier::string discovery{};///< Url to the guild's icon.
2477 snowflake systemChannelId{};///< The id of the channel where guild notices such as welcome messages and boost events are posted.
2478 snowflake widgetChannelId{};///< The channel id that the widget will generate an invite to, or null if set to no invite.
2479 guild_nsfwlevel nsfwLevel{};///< Guild nsfw level.
2480 jsonifier::string splash{};///< Splash hash.
2481 jsonifier::string banner{};///< Banner hash.
2482 premium_tier premiumTier{};///< Premium tier (server boost level).
2483 snowflake rulesChannelId{};///< The id of the channel where community guilds can display rules and/or guidelines.
2484 snowflake applicationId{};///< Application id of the guild creator if it is bot-created.
2485 snowflake afkChannelId{};///< Id of afk channel.
2486 jsonifier::string name{};///< Guild name (2-100 characters, excluding trailing and leading whitespace).
2487 jsonifier::string icon{};///< Icon hash.
2488 uint32_t maxPresences{};///< The maximum number of presences for the guild (null is always returned, apart from the largest of guilds).
2489 uint32_t memberCount{};///< The number of members in this guild.jsonifier::string region{};///< Voice region id for the guild (deprecated).
2490 uint32_t maxMembers{};///< The maximum number of members for the guild.
2491 uint32_t afkTimeout{};///< Afk timeout in seconds.
2492 time_stamp joinedAt{};///< When the bot joined this guild.
2493 bool widgetEnabled{};///< True if the server widget is enabled.
2494 mfalevel mfaLevel{};///< Required mfa level for the guild.
2495 snowflake ownerId{};///< Id of owner.
2496 guild_flags flags{};/// the flags for this guild.
2497 bool unavailable{};///< True if this guild is unavailable due to an outage.
2498 snowflake id{};///< Guild id.
2499 bool large{};///< True if this is considered a large guild.
2500 bool owner{};///< True if the user is the owner of the guild.
2501
2502 DCA_INLINE guild_data() = default;
2503
2504 guild_data(snowflake snowflake);
2505
2506 discord_core_client* getDiscordCoreClient();
2507
2508 bool areWeConnected();
2509
2510 /// \brief For disconnecting from the current guild's voice channel.
2511 void disconnect();
2512 };
2513
2514 /// @brief Represents a single thread_data.
2515 class thread_data : public channel_data {
2516 public:
2517 };
2518
2519 /// @brief Data structure representing a single guild, for the purposes of populating the cache.
2520 class DiscordCoreAPI_Dll guild_cache_data : public flag_entity<guild_cache_data>,
2521 public get_guild_image_url<guild_cache_data>,
2522 public connect_to_voice<guild_cache_data, discord_core_client, guild_members> {
2523 public:
2524 jsonifier::vector<snowflake> channels{};///< Array of guild channels.
2525 jsonifier::vector<snowflake> members{};///< Array of guild_members.
2526 jsonifier::vector<snowflake> emoji{};///< Array of guild channels.
2527 jsonifier::vector<snowflake> roles{};///< Array of guild roles.
2528 voice_connection* voiceConnection{};///< A pointer to the voice_connection, if present.
2529 icon_hash discoverySplash{};///< Url to the guild's icon.
2530 jsonifier::string name{};///< The guild's name.
2531 uint32_t memberCount{};///< Member count.
2532 time_stamp joinedAt{};///< When the bot joined this guild.
2533 icon_hash discovery{};///< Url to the guild's icon.
2534 snowflake ownerId{};///< User_data id of the guild's owner.
2535 guild_flags flags{};///< Guild flags.
2536 icon_hash banner{};///< Url to the guild's icon.
2537 icon_hash splash{};///< Url to the guild's icon.
2538 icon_hash icon{};///< Url to the guild's icon.
2539 snowflake id{};///< The id of this guild.
2540
2541 DCA_INLINE guild_cache_data() = default;
2542
2543 guild_cache_data(snowflake snowflakeNew);
2544
2545 guild_cache_data& operator=(guild_data&& data) noexcept;
2546 guild_cache_data(guild_data&& data) noexcept;
2547
2548 guild_cache_data& operator=(const guild_data&);
2549
2550 guild_cache_data(const guild_data&);
2551
2552 operator guild_data();
2553
2554 discord_core_client* getDiscordCoreClient();
2555
2556 DCA_INLINE bool operator==(const snowflake& other) const {
2557 return id == other;
2558 }
2559
2560 bool areWeConnected();
2561
2562 /// \brief For disconnecting from the current guild's voice channel.
2563 void disconnect();
2564 };
2565
2566 /// @brief Interaction data.
2568 public:
2569 jsonifier::string appPermissions{};
2570 jsonifier::string guildLocale{};
2571 interaction_data_data data{};
2572 jsonifier::string locale{};
2573 guild_member_data member{};
2574 snowflake applicationId{};
2575 jsonifier::string token{};
2576 interaction_type type{};
2577 message_data message{};
2578 channel_data channel{};
2579 snowflake channelId{};
2580 snowflake guildId{};
2581 guild_data guild{};
2582 int64_t version{};
2583 user_data user{};
2584 snowflake id{};
2585
2586 DCA_INLINE interaction_data() = default;
2587 };
2588
2589 class partial_guild_data {
2590 public:
2591 bool unavailable{};
2592 snowflake id{};
2593 };
2594
2595 /// @brief Invite data.
2597 guild_scheduled_event_data guildScheduledEvent{};///< Scheduled guild event.
2598 application_data targetApplication{};///< Application data.
2599 uint64_t approximatePresenceCount{};///< Approximate presence count.
2600 stage_instance_data stageInstance{};///< Stage instance data.
2601 uint64_t approximateMemberCount{};///< Approximate member count.
2602 jsonifier::string expiresAt{};///< When the invite expires.
2603 jsonifier::string createdAt{};///< Time it was created at.
2604 partial_guild_data guild{};///< Guild data of the channel_data that the invite is for.
2605 jsonifier::string code{};///< Unique invite code.
2606 user_data targetUser{};///< Target user_data of the invite.
2607 channel_data channel{};///< channel_data data of the channel_data that the invite is for.
2608 uint64_t targetType{};///< Target type.
2609 snowflake guildId{};///< The guild this invite is for.
2610 user_data inviter{};///< The user_data who created the invite.
2611 uint64_t maxUses{};///< Max number of uses.
2612 uint64_t maxAge{};///< Maximum age of the invite.
2613 bool temporary{};///< Is it temporary?
2614 uint64_t uses{};///< The current number of uses.
2615 };
2616
2617 /// @brief Represents a guild template.
2619 guild_data serializedSourceGuild{};///< The guild snapshot this template contains.
2620 jsonifier::string sourceGuildId{};///< The id of the guild this template is based on.
2621 jsonifier::string description{};///< The description for the template.
2622 jsonifier::string creatorId{};///< The id of the user_data who created the template.
2623 jsonifier::string createdAt{};///< When this template was created.
2624 jsonifier::string updatedAt{};///< When this template was last synced to the source guild.
2625 jsonifier::string code{};///< The template code(unique id).
2626 jsonifier::string name{};///< Template name.
2627 uint32_t usageCount{};///< Number of times this template has been used.
2628 user_data creator{};///< The user_data who created the template.
2629 bool isDirty{};///< Whether the template has unsynced changes.
2630 };
2631
2632 /// @brief Web_hook_data data.
2634 public:
2635 channel_data sourceChannel{};///< channel_data for which th web_hook_data was issued.
2636 jsonifier::string avatar{};///< Avatar of the web_hook_data.
2637 jsonifier::string token{};///< Token of the web_hook_data.
2638 snowflake applicationId{};///< Application id.
2639 jsonifier::string name{};///< Name of the web_hook_data.
2640 guild_data sourceGuild{};///< Source guild id.
2641 jsonifier::string url{};///< Url of the web_hook_data.
2642 snowflake channelId{};///< channel_data id for which the web_hook_data was issued.
2643 web_hook_type type{};///< Type of web_hook_data.
2644 snowflake guildId{};///< Guild id for which the web_hook_data was issued.
2645 user_data user{};///< User_data which create the web_hook_data.
2646 snowflake id{};
2647
2648 DCA_INLINE web_hook_data() = default;
2649 };
2650
2651 /// @brief Audit log data.
2652 class DiscordCoreAPI_Dll audit_log_data {
2653 public:
2654 jsonifier::vector<guild_scheduled_event_data> guildScheduledEvents{};///< Array of guild scheduled event objects.
2655 jsonifier::vector<auto_moderation_rule_data> autoModerationRules{};///< List of auto moderation rules referenced in the audit log.
2656 jsonifier::vector<audit_log_entry_data> auditLogEntries{};///< Array of audit log entry objects.
2657 jsonifier::vector<integration_data> integrations{};///< Array of partial integration objects.
2658 jsonifier::vector<web_hook_data> webhooks{};///< Array of webhook objects.
2659 jsonifier::vector<channel_data> threads{};///< Array of thread-specific channel objects.
2660 jsonifier::vector<user_data> users{};///< Array of user objects.
2661
2662 auto getAuditLogData(const snowflake userIdOfChanger, audit_log_event auditLogType);
2663
2664 auto getAuditLogData(audit_log_event auditLogType, const snowflake userIdOfTarget);
2665 };
2666
2667 /// @brief Data representing an input-event, which is any message or interaction that is coming into the bot as an input.
2668 class DiscordCoreAPI_Dll input_event_data {
2669 public:
2670 template<typename value_type> friend struct jsonifier::core;
2671 template<typename value_type> friend struct event_data;
2672 friend struct on_interaction_creation_data;
2673 friend struct base_function_arguments;
2674
2675 friend class discord_core_internal::websocket_client;
2676 friend class discord_core_internal::base_socket_agent;
2677 friend class respond_to_input_event_data;
2678 friend class discord_core_client;
2679 friend class command_data;
2680 friend class input_events;
2681
2682 input_event_response_type responseType{};///< The type of response that this input value represents.
2683
2684 input_event_data& operator=(input_event_data&& other) noexcept;
2685
2686 input_event_data(input_event_data&& other) noexcept;
2687
2688 input_event_data& operator=(const input_event_data& other);
2689
2690 input_event_data(const input_event_data& other);
2691
2692 input_event_data& operator=(const interaction_data& other);
2693
2694 input_event_data(const interaction_data& interactionData);
2695
2696 DCA_INLINE input_event_data() = default;
2697
2698 /// @brief Returns the interaction data, if appplicable, of this input-event.
2699 /// @return interaction_data a snowflake containing the interaction data.
2700 const interaction_data& getInteractionData() const;
2701
2702 /// @brief Returns the guild_member_data of this input-event.
2703 /// @return guild_member_data a guild_member_data containing the guild_member_data data.
2704 const guild_member_data& getGuildMemberData() const;
2705
2706 /// @brief Returns the channel_data of this input-event.
2707 /// @return channel_data a channel_data containing the channel_data data.
2708 const channel_data& getChannelData() const;
2709
2710 /// @brief Returns the message data, if applicable, of this input-event.
2711 /// @return message a message structure.
2712 const message_data& getMessageData() const;
2713
2714 /// @brief Returns the user_data of this input-event.
2715 /// @return user_data a user_data containing the user_data data.
2716 const user_data& getUserData() const;
2717
2718 protected:
2719 unique_ptr<interaction_data> interactionData{ makeUnique<interaction_data>() };
2720 };
2721
2722 struct DiscordCoreAPI_Dll move_through_message_pages_data;
2723
2724 /// @brief Data for responding to an input-event.
2725 class DiscordCoreAPI_Dll respond_to_input_event_data {
2726 public:
2727 friend struct delete_interaction_response_data;
2728 friend struct delete_follow_up_message_data;
2729 friend struct interaction_response_data;
2730
2731 friend DiscordCoreAPI_Dll move_through_message_pages_data moveThroughMessagePages(const jsonifier::string& userID, input_event_data originalEvent,
2732 uint32_t currentPageIndex, const jsonifier::vector<embed_data>& messageEmbeds, bool deleteAfter, uint32_t waitForMaxMs, bool returnResult);
2733
2734 friend class create_ephemeral_interaction_response_data;
2735 friend class create_deferred_interaction_response_data;
2736 friend class create_ephemeral_follow_up_message_data;
2737 friend class create_interaction_response_data;
2738 friend class edit_interaction_response_data;
2739 friend class create_follow_up_message_data;
2740 friend class edit_follow_up_message_data;
2741 friend class create_message_data;
2742 friend class edit_message_data;
2743 friend class input_events;
2744 friend class send_dmdata;
2745
2746 operator interaction_callback_data() const;
2747
2748 DCA_INLINE respond_to_input_event_data() noexcept = default;
2749
2750 respond_to_input_event_data& operator=(const interaction_data dataPackage);
2751
2752 respond_to_input_event_data(const interaction_data dataPackage);
2753
2754 respond_to_input_event_data& operator=(const input_event_data dataPackage);
2755
2756 respond_to_input_event_data(const input_event_data dataPackage);
2757
2758 /// @brief Adds a button to the response message_data.
2759 /// @param disabled whether the button is active or not.
2760 /// @param customIdNew a custom id to give for identifying the button.
2761 /// @param buttonLabel a visible label for the button.
2762 /// @param buttonStyle the style of the button.
2763 /// @param emojiName an emoji name, if desired.
2764 /// @param emojiId an emoji id, if desired.
2765 /// @param url a url, if applicable.
2766 /// @return respond_to_input_event_data& a reference to this data structure.
2767 respond_to_input_event_data& addButton(bool disabled, const jsonifier::string& customIdNew, const jsonifier::string& buttonLabel, button_style buttonStyle,
2768 const jsonifier::string& emojiName = "", snowflake emojiId = snowflake{}, const jsonifier::string& url = "");
2769
2770 /// @brief Adds a select-menu to the response message_data.
2771 /// @param disabled whether the select-menu is active or not.
2772 /// @param customIdNew a custom id to give for identifying the select-menu.
2773 /// @param options a vector of select-menu-options to offer.
2774 /// @param placeholder custom placeholder text if nothing is selected, max 100 characters.
2775 /// @param maxValues maximum number of selections that are possible.
2776 /// @param minValues minimum required number of selections that are required.
2777 /// @param type the type of select-menu that this is.
2778 /// @param channelTypes types of channels that can be accepted if this is of the type channel_type.
2779 /// @return respond_to_input_event_data& a reference to this data structure.
2780 respond_to_input_event_data& addSelectMenu(bool disabled, const jsonifier::string& customIdNew, const jsonifier::vector<select_option_data>& options,
2781 const jsonifier::string& placeholder, uint64_t maxValues, uint64_t minValues, select_menu_type type,
2782 jsonifier::vector<channel_type> channelTypes = jsonifier::vector<channel_type>{});
2783
2784 /// @brief Adds a modal to the response message_data.
2785 /// @param topTitleNew a title for the modal.
2786 /// @param topCustomIdNew a custom id to give for the modal.
2787 /// @param titleNew a title for the modal's individual input.
2788 /// @param customIdNew a custom id to give for the modal's individual input.
2789 /// @param required is it a required response?
2790 /// @param minLength minimum length.
2791 /// @param maxLength maximum length.
2792 /// @param inputStyle the input style.
2793 /// @param label a label for the modal.
2794 /// @param placeholder a placeholder for the modal.
2795 /// @return respond_to_input_event_data& a reference to this data structure.
2796 respond_to_input_event_data& addModal(const jsonifier::string& topTitleNew, const jsonifier::string& topCustomIdNew, const jsonifier::string& titleNew,
2797 const jsonifier::string& customIdNew, bool required, uint64_t minLength, uint64_t maxLength, text_input_style inputStyle, const jsonifier::string& label = "",
2798 const jsonifier::string& placeholder = "");
2799
2800 /// @brief Adds a file to the current collection of files for this message response.
2801 /// @param theFile the file to be added.
2802 /// @return respond_to_input_event_data& a reference to this data structure.
2803 respond_to_input_event_data& addFile(const file& theFile);
2804
2805 /// @brief For setting the allowable mentions in a response.
2806 /// @param dataPackage an allowed_mentions_data structure.
2807 /// @return respond_to_input_event_data& a reference to this data structure.
2808 respond_to_input_event_data& addAllowedMentions(const allowed_mentions_data& dataPackage);
2809
2810 /// @brief For setting the type of response to make.
2811 /// @param typeNew an input_event_response_type.
2812 /// @return respond_to_input_event_data& a reference to this data structure.
2813 respond_to_input_event_data& setResponseType(input_event_response_type typeNew);
2814
2815 /// @brief For setting the components in a response.
2816 /// @param dataPackage an action_row_data structure.
2817 /// @return respond_to_input_event_data& a reference to this data structure.
2818 respond_to_input_event_data& addComponentRow(const action_row_data& dataPackage);
2819
2820 /// @brief For setting the embeds in a response.
2821 /// @param dataPackage an embed_data structure.
2822 /// @return respond_to_input_event_data& a reference to this data structure.
2823 respond_to_input_event_data& addMessageEmbed(const embed_data dataPackage);
2824
2825 /// @brief For setting the message content in a response.
2826 /// @param dataPackage a string, containing the content.
2827 /// @return respond_to_input_event_data& a reference to this data structure.
2828 respond_to_input_event_data& addContent(const jsonifier::string& dataPackage);
2829
2830 /// @brief For setting the tts status of a response.
2831 /// @param enabledTTs a bool.
2832 /// @return respond_to_input_event_data& a reference to this data structure.
2833 respond_to_input_event_data& setTTSStatus(bool enabledTTs);
2834
2835 /// @brief For setting the choices of an autocomplete response.
2836 /// @param value an simdjson::ondemand::object value that is either a double, uint64_t or a string.
2837 /// @param theName a string for the name of the choice.
2838 /// @param theNameLocalizations a unordered_map<jsonifier::string, jsonifier::string> for the name localizations.
2839 /// @return respond_to_input_event_data& a reference to this data structure.
2840 respond_to_input_event_data& setAutoCompleteChoice(discord_core_internal::etf_serializer value, const jsonifier::string& theName,
2841 const unordered_map<jsonifier::string, jsonifier::string>& theNameLocalizations);
2842
2843 /// @brief For setting the direct-message_data user target of a response.
2844 /// @param targetUserIdNew a string, containing the target user_data's id.
2845 /// @return respond_to_input_event_data& a reference to this data structure.
2846 respond_to_input_event_data& setTargetUserID(const snowflake targetUserIdNew);
2847
2848 protected:
2849 jsonifier::vector<application_command_option_choice_data> choices{};
2850 jsonifier::vector<action_row_data> components{};
2851 allowed_mentions_data allowedMentions{};
2852 jsonifier::vector<embed_data> embeds{};
2853 jsonifier::string interactionToken{};
2854 input_event_response_type type{};///< The type of response to make.
2855 jsonifier::vector<file> files{};
2856 interaction_type eventType{};
2857 jsonifier::string customId{};
2858 jsonifier::string content{};
2859 jsonifier::string title{};
2860 snowflake interactionId{};
2861 snowflake applicationId{};
2862 snowflake targetUserId{};
2863 snowflake channelId{};
2864 snowflake messageId{};
2865 uint64_t flags{};
2866 bool tts{};
2867 };
2868
2869 /// @brief Message response base, for responding to messages.
2870 class DiscordCoreAPI_Dll message_response_base {
2871 public:
2872 template<typename value_type> friend struct jsonifier::core;
2873 /// @brief Adds a button to the response message_data.
2874 /// @param disabled whether the button is active or not.
2875 /// @param customIdNew a custom id to give for identifying the button.
2876 /// @param buttonLabel a visible label for the button.
2877 /// @param buttonStyle the style of the button.
2878 /// @param emojiName an emoji name, if desired.
2879 /// @param emojiId an emoji id, if desired.
2880 /// @param url a url, if applicable.
2881 /// @return message_response_base& a reference to this data structure.
2882 message_response_base& addButton(bool disabled, const jsonifier::string& customIdNew, const jsonifier::string& buttonLabel, button_style buttonStyle,
2883 const jsonifier::string& emojiName = "", snowflake emojiId = snowflake{}, const jsonifier::string& url = "");
2884
2885 /// @brief Adds a select-menu to the response message_data.
2886 /// @param disabled whether the select-menu is active or not.
2887 /// @param customIdNew a custom id to give for identifying the select-menu.
2888 /// @param options a vector of select-menu-options to offer.
2889 /// @param placeholder custom placeholder text if nothing is selected, max 100 characters.
2890 /// @param maxValues maximum number of selections that are possible.
2891 /// @param minValues minimum required number of selections that are required.
2892 /// @param type the type of select-menu that this is.
2893 /// @param channelTypes types of channels that can be accepted if this is of the type channel_type.
2894 /// @return respond_to_input_event_data& a reference to this data structure.
2895 message_response_base& addSelectMenu(bool disabled, const jsonifier::string& customIdNew, const jsonifier::vector<select_option_data>& options,
2896 const jsonifier::string& placeholder, uint64_t maxValues, uint64_t minValues, select_menu_type type,
2897 jsonifier::vector<channel_type> channelTypes = jsonifier::vector<channel_type>{});
2898
2899 /// @brief Adds a modal to the response message_data.
2900 /// @param topTitleNew a title for the modal.
2901 /// @param topCustomIdNew a custom id to give for the modal.
2902 /// @param titleNew a title for the modal's individual input.
2903 /// @param customIdNew a custom id to give for the modal's individual input.
2904 /// @param required is it a required response?
2905 /// @param minLength minimum length.
2906 /// @param maxLength maximum length.
2907 /// @param inputStyle the input style.
2908 /// @param label a label for the modal.
2909 /// @param placeholder a placeholder for the modal.
2910 /// @return message_response_base& a reference to this data structure.
2911 message_response_base& addModal(const jsonifier::string& topTitleNew, const jsonifier::string& topCustomIdNew, const jsonifier::string& titleNew,
2912 const jsonifier::string& customIdNew, bool required, uint64_t minLength, uint64_t maxLength, text_input_style inputStyle, const jsonifier::string& label = "",
2913 const jsonifier::string& placeholder = "");
2914
2915 /// @brief Adds a file to the current collection of files for this message response.
2916 /// @param theFile the file to be added.
2917 /// @return message_response_base& a reference to this data structure.
2918 message_response_base& addFile(const file& theFile);
2919
2920 /// @brief For setting the allowable mentions in a response.
2921 /// @param dataPackage an allowed_mentions_data structure.
2922 /// @return message_response_base& a reference to this data structure.
2923 message_response_base& addAllowedMentions(const allowed_mentions_data& dataPackage);
2924
2925 /// @brief For setting the components in a response.
2926 /// @param dataPackage an action_row_data structure.
2927 /// @return message_response_base& a reference to this data structure.
2928 message_response_base& addComponentRow(const action_row_data& dataPackage);
2929
2930 /// @brief For setting the embeds in a response.
2931 /// @param dataPackage an embed_data structure.
2932 /// @return message_response_base& a reference to this data structure.
2933 message_response_base& addMessageEmbed(const embed_data& dataPackage);
2934
2935 /// @brief For setting the message content in a response.
2936 /// @param dataPackage a string, containing the content.
2937 /// @return message_response_base& a reference to this data structure.
2938 message_response_base& addContent(const jsonifier::string& dataPackage);
2939
2940 /// @brief For setting the tts status of a response.
2941 /// @param enabledTTs a bool.
2942 /// @return message_response_base& a reference to this data structure.
2943 message_response_base& setTTSStatus(bool enabledTTs);
2944
2945 protected:
2946 jsonifier::vector<action_row_data> components{};
2947 allowed_mentions_data allowedMentions{};
2948 jsonifier::vector<embed_data> embeds{};
2949 jsonifier::vector<file> files{};
2950 jsonifier::string customId{};
2951 jsonifier::string content{};
2952 jsonifier::string title{};
2953 uint64_t flags{};
2954 bool tts{};
2955 };
2956
2957 /// @brief Interaction response data.
2958 struct DiscordCoreAPI_Dll interaction_response_data {
2959 interaction_callback_data data{};///< Interaction application_command_data callback data.
2960 interaction_callback_type type{};///< Interaction callback type.
2961
2962 interaction_response_data& operator=(const respond_to_input_event_data& other);
2963
2964 interaction_response_data(const respond_to_input_event_data& other);
2965
2966 interaction_response_data() = default;
2967 };
2968
2969 /// @brief Guild application command permissions data.
2971 public:
2972 jsonifier::vector<application_command_permission_data> permissions{};
2973 snowflake applicationId{};
2974 snowflake guildId{};
2975 snowflake id{};
2976 };
2977
2978 /**@}*/
2979
2980 /// @brief Song types.
2981 enum class song_type : uint8_t {
2982 Neutral = 0,///< For either type.
2983 YouTube = 1,///< You_tube.
2984 SoundCloud = 2///< Sound_cloud.
2985 };
2986
2987 /// @brief Represents a download url.
2989 uint64_t contentSize{};
2990 jsonifier::string urlPath{};
2991 };
2992
2993 /**
2994 * \addtogroup voice_connection
2995 * @{
2996 */
2997
2998 class song {
2999 public:
3000 friend class discord_core_internal::sound_cloud_request_builder;
3001 friend class discord_core_internal::you_tube_request_builder;
3002 friend class discord_core_internal::sound_cloud_api;
3003 friend class discord_core_internal::you_tube_api;
3004 friend class song_api;
3005
3006 jsonifier::vector<download_url> finalDownloadUrls{};
3007 song_type type{ song_type::Neutral };///< The type of song.
3008 jsonifier::string secondDownloadUrl{};
3009 jsonifier::string firstDownloadUrl{};
3010 jsonifier::string addedByUserName{};///< The user_data name of the individual who added this song to the
3011 jsonifier::string thumbnailUrl{};///< The url of the thumbnail image of this song.
3012 jsonifier::string description{};///< A description of the song.
3013 jsonifier::string songTitle{};///< The title of the song.
3014 jsonifier::string duration{};///< The duration of the song.
3015 jsonifier::string viewUrl{};///< The url for listening to this song through a browser.
3016 jsonifier::string songId{};
3017 snowflake addedByUserId{};///< The user_data id of the individual who added this song to the.
3018 uint64_t contentLength{};
3019 };
3020
3021 /// @brief Song completion event data.
3023 snowflake guildMemberId{};///< The sending guild_member_data.
3024 snowflake guildId{};///< The sending guild.
3025 bool wasItAFail{};///< Is this a replay? (did a track recently fail to play?)
3026 };
3027
3028 /// @brief Playlist of songs and other variables.
3029 struct playlist {
3030 jsonifier::vector<song> songQueue{};///< The list of songs that are stored to be played.
3031 bool isLoopSongEnabled{};///< Is looping of songs currently enabled?
3032 bool isLoopAllEnabled{};///< Is looping of the entire playlist currently enabled?
3033 song currentSong{};///< The current song that is playing.
3034
3035 DCA_INLINE bool areThereAnySongs() {
3036 if (isLoopAllEnabled) {
3037 return songQueue.size() > 0 || currentSong.songId != "";
3038 } else if (isLoopSongEnabled) {
3039 return songQueue.size() > 0 || currentSong.songId != "";
3040 } else {
3041 return songQueue.size() > 0;
3042 }
3043 }
3044
3045 DCA_INLINE bool sendNextSong() {
3046 if (isLoopSongEnabled) {
3047 if (songQueue.size() > 0 && currentSong.songId == "") {
3048 currentSong = songQueue.at(0);
3049 songQueue.erase(songQueue.begin());
3050 return true;
3051 } else if (songQueue.size() == 0 && currentSong.songId == "") {
3052 return false;
3053 } else {
3054 return true;
3055 }
3056 } else if (isLoopAllEnabled) {
3057 if (songQueue.size() > 0 && currentSong.songId == "") {
3058 currentSong = songQueue.at(0);
3059 songQueue.erase(songQueue.begin());
3060 return true;
3061 } else if (songQueue.size() > 0 && currentSong.songId != "") {
3062 song tempSong02 = currentSong;
3063 currentSong = songQueue.at(0);
3064 songQueue.erase(songQueue.begin());
3065 songQueue.emplace_back(tempSong02);
3066 return true;
3067 } else if (songQueue.size() == 0 && currentSong.songId == "") {
3068 return false;
3069 }
3070 } else {
3071 if (songQueue.size() > 0) {
3072 currentSong = songQueue.at(0);
3073 songQueue.erase(songQueue.begin());
3074 return true;
3075 } else if (songQueue.size() == 0) {
3076 currentSong = song{};
3077 return false;
3078 }
3079 }
3080 return false;
3081 }
3082
3083 DCA_INLINE void modifyQueue(uint64_t firstSongPosition, uint64_t secondSongPosition) {
3084 song tempSong = songQueue.at(firstSongPosition);
3085 songQueue.at(firstSongPosition) = songQueue.at(secondSongPosition);
3086 songQueue.at(secondSongPosition) = tempSong;
3087 }
3088 };
3089
3090 /**@}*/
3091
3092 /**
3093 * \addtogroup utilities
3094 * @{
3095 */
3096
3097 struct serializer_value {
3098 unordered_map<jsonifier::string, jsonifier::raw_json_data> values{};
3099 };
3100
3101 /// @brief Command data, for functions executed by the command_controller.
3102 class DiscordCoreAPI_Dll command_data {
3103 public:
3104 template<typename value_type> friend struct event_data;
3105 friend struct on_interaction_creation_data;
3106
3107 command_data() = default;
3108
3109 command_data& operator=(command_data&&) = default;
3110
3111 command_data(command_data&&) = default;
3112
3113 command_data& operator=(const command_data&);
3114
3115 command_data(const command_data&);
3116
3117 command_data(const input_event_data& inputEventData);
3118
3119 /// @brief Returns the interaction data, if appplicable, of this input-event.
3120 /// @return interaction_data a snowflake containing the interaction data.
3121 const interaction_data& getInteractionData() const;
3122
3123 /// @brief Returns the guild_member_data of this input-event.
3124 /// @return guild_member_data a guild_member_data containing the guild_member_data data.
3125 const guild_member_data& getGuildMemberData() const;
3126
3127 /// @brief Returns the channel_data of this input-event.
3128 /// @return channel_data a channel_data containing the channel_data data.
3129 const channel_data& getChannelData() const;
3130
3131 /// @brief Returns the message data, if applicable, of this input-event.
3132 /// @return message a message structure.
3133 const message_data& getMessageData() const;
3134
3135 /// @brief Returns the user_data of this input-event.
3136 /// @return user_data a user_data containing the user_data data.
3137 const user_data& getUserData() const;
3138
3139 /// @brief Returns the name of this entered command.
3140 /// @return jsonifier::string a string containing the name of this command.
3141 jsonifier::string getCommandName() const;
3142
3143 /// @brief Returns the subcommand-name of this entered command.
3144 /// @return jsonifier::string a string containing the name of this sub-command.
3145 jsonifier::string getSubCommandName() const;
3146
3147 /// @brief Returns the subcommand-name of this entered command group.
3148 /// @return jsonifier::string a string containing the name of this sub-command's group.
3149 jsonifier::string getSubCommandGroupName() const;
3150
3151 /// @brief Returns the collection of command inputs/options for this command.
3152 /// @return serializer_value a serializer_value containing the arguments entered with this command.
3153 serializer_value getCommandArguments() const;
3154
3155 /// @brief Returns the input_event_data for this command.
3156 /// @return input_event_data an input_event_data containing the data associated with this command.
3157 const input_event_data& getInputEventData() const;
3158
3159 virtual ~command_data() = default;
3160
3161 protected:
3162 unique_ptr<input_event_data> eventData{};
3163 jsonifier::string subCommandGroupName{};
3164 jsonifier::string subCommandName{};
3165 jsonifier::string commandName{};
3166 serializer_value optionsArgs{};
3167 };
3168
3169 /// @brief Base arguments for the command classes.
3170 struct DiscordCoreAPI_Dll base_function_arguments : public command_data {
3171 base_function_arguments() = default;
3172
3173 base_function_arguments(const command_data& commandData);
3174 };
3175
3176 /// @brief Base class for the command classes.
3177 struct DiscordCoreAPI_Dll base_function {
3178 jsonifier::string helpDescription{};///< Description of the command for the help command.
3179 jsonifier::string commandName{};///< Name of the command for calling purposes.
3180 embed_data helpEmbed{};///< A message embed for displaying the command via the help command.
3181
3182 /// @brief The base function for the command's execute function.
3183 /// @param args a reference to an instance of base_function_arguments.
3184 virtual void execute(const base_function_arguments& args) = 0;
3185 virtual unique_ptr<base_function> create() = 0;
3186 virtual ~base_function() = default;
3187 };
3188
3189 struct DiscordCoreAPI_Dll move_through_message_pages_data {
3190 input_event_data inputEventData{};
3191 jsonifier::string buttonId{};
3192 uint32_t currentPageIndex{};
3193 };
3194
3195 DiscordCoreAPI_Dll move_through_message_pages_data moveThroughMessagePages(snowflake userID, input_event_data originalEvent, uint32_t currentPageIndex,
3196 const jsonifier::vector<embed_data>& messageEmbeds, bool deleteAfter, uint32_t waitForMaxMs, bool returnResult);
3197
3198 /**@}*/
3199
3200 struct ready_data {
3201 unordered_set<jsonifier::string> jsonifierExcludedKeys{};
3202 jsonifier::vector<jsonifier::string> trace{};
3203 jsonifier::string resumeGatewayUrl{};
3204 application_data application{};
3205 jsonifier::string sessionId{};
3206 jsonifier::string shard{};
3207 user_data user{};
3208 uint64_t v{};
3209 };
3210
3211}
jsonifier::string name
Name of the account.
Action row data of message components.
jsonifier::vector< component_data > components
Array of components to make up the action-row.
Allowable mentions for a message.
bool repliedUser
For replies, whether to mention the author of the message being replied to (default false).
jsonifier::vector< jsonifier::string > roles
Array of role_ids to mention (max size of 100)
jsonifier::vector< jsonifier::string > users
Array of user_ids to mention (max size of 100)
jsonifier::vector< jsonifier::string > parse
A vector of allowed mention types to parse from the content.
Data structure representing an application_command_data.
snowflake applicationId
The current application id.
jsonifier::vector< application_command_option_data > options
A vector of possible options for the current application_command_data.
unordered_map< jsonifier::string, jsonifier::string > descriptionLocalizations
Dictionary with keys in available locales.
application_command_type type
The type of application_command_data.
permission defaultMemberPermissions
Set of permissions represented as a bit set all.
unordered_set< jsonifier::string > jsonifierExcludedKeys
Keys to exclude at serialization time.
snowflake guildId
(where applicable) a guild id for which guild to assign this application_command_data to.
jsonifier::string description
A description of the current application_command_data.
bool dmPermission
Indicates whether the command is available in dms with the app, only for globally - scoped commands.
jsonifier::string version
An autoincremented version.
unordered_map< jsonifier::string, jsonifier::string > nameLocalizations
Dictionary with keys in available locales.
jsonifier::string name
Name of the current application_command_data.
Data structure representing an application_command_data's option choice.
jsonifier::string name
The name of the current choice.
unordered_map< jsonifier::string, jsonifier::string > nameLocalizations
Dictionary with keys in available locales localization dictionary for the name.
jsonifier::raw_json_data value
The value of the option.
Permissions data for an application_command_data.
bool permission
Whether the permission_types is active or not.
application_command_permission_type type
The type of permission_types.
jsonifier::string termsOfServiceUrl
Terms of service url.
jsonifier::vector< jsonifier::string > tags
Up to 5 tags describing the content and functionality of the application install_params.
application_flags flags
Application flags.
jsonifier::vector< jsonifier::string > rpcOrigins
Array of rpc origin strings.
jsonifier::string coverImage
The cover image.
jsonifier::string summary
Summary of the application.
bool botRequireCodeGrant
Does the bot require a code grant?
user_data owner
Application's owner.
jsonifier::string icon
Application's icon.
jsonifier::string verifyKey
The verification key.
team_object_data team
Team object data.
jsonifier::string description
Description of the application.
jsonifier::string privacyPolicyUrl
Privacy policy url.
install_params_data params
Settings for the application's default in-app authorization link, if enabled.
jsonifier::string primarySkuId
Primary sku snowflake.
jsonifier::string name
Application's name.
jsonifier::string description
A description of the attachment.
jsonifier::string filename
The file name of the attachment.
uint64_t height
The height of the attachment.
uint64_t size
The size of the attachment.
jsonifier::string contentType
Type of content for the attachment.
jsonifier::string proxyUrl
The proxy url for the attachment.
uint64_t width
The width of the attachment.
bool ephemeral
Whether it was an ephemeral response.
jsonifier::string url
The url for the attachment.
Audit log entry data.
optional_audit_entry_info_data options
Audit log entry info data.
jsonifier::string reason
The reason that was entered for the given change.
jsonifier::vector< audit_log_change_data > changes
Array of audit log change data.
snowflake targetId
snowflake of the target user_data.
audit_log_event actionType
Audit log action type.
time_stamp createdTimeStamp
Time at which this entry was created.
snowflake userId
snowflake of the executing user_data.
jsonifier::vector< action_data > actions
Actions which will execute when the rule is triggered.
snowflake creatorId
The user which first created this rule.
snowflake guildId
The guild which this rule belongs to.
trigger_type triggerType
The rule trigger type.
trigger_meta_data triggerMetaData
The rule trigger metadata actions array of action objects the.
jsonifier::vector< snowflake > exemptRoles
The role ids that should not be affected by the rule(maximum of 20).
jsonifier::vector< snowflake > exemptChannels
The channel ids that should not be affected by the rule(maximum of 50).
A type of user_data, to represent the bot and some of its associated endpoints.
Data structure representing a single channel_data.
snowflake guildId
The id of the guild where it took place.
channel_type type
The type of channel_data that was mentioned.
jsonifier::string name
The name of the channel_data that was mentioned.
Command data, for functions executed by the command_controller.
Data structure representing a single emoji.
Represents the permissions for accessing an application_command_data from within a guild.
jsonifier::vector< application_command_permission_data > permissions
The permissions.
Data structure representing a single guild, for the purposes of populating the cache.
A discord guild. used to connect to/disconnect from voice.
Data structure representing a single guild_member_data.
Data structure representing a single guild_member_data.
Data representing a guild scheduled event.
jsonifier::string scheduledStartTime
The time the scheduled event will start.
guild_scheduled_event_status status
The status of the scheduled event.
guild_scheduled_event_privacy_level privacyLevel
The privacy level of the scheduled event.
jsonifier::string description
The description of the scheduled event(1 - 1000 characters.
snowflake guildId
The guild id which the scheduled event belongs to.
jsonifier::string name
The name of the scheduled event(1 - 100 characters).
snowflake creatorId
The id of the user_data that created the scheduled event *.
jsonifier::string scheduledEndTime
The time the scheduled event will end, required if entity_type is external.
snowflake channelId
The channel_data id in which the scheduled event will be hosted, or null if scheduled entity type is ...
snowflake entityId
The id of an entity associated with a guild scheduled event.
uint32_t userCount
The number of users subscribed to the scheduled event.
guild_scheduled_event_metadata entityMetadata
Additional metadata for the guild scheduled event.
user_data creator
The user_data that created the scheduled event.
guild_scheduled_event_entity_type entityType
The type of the scheduled event.
Data representing an input-event, which is any message or interaction that is coming into the bot as ...
jsonifier::string type
Type of integration.
application_data application
Application data.
uint64_t subscriberCount
Number of current subscribers.
user_data user
User_data data for the integration.
jsonifier::string syncedAt
Time it was last synced at.
jsonifier::string name
Name of the integration.
uint64_t expireBehavior
What to do upon expiry.
snowflake roleId
Role_data snowflake.
uint64_t expireGracePeriod
How int64_t before the integration expires.
The core of a message's data structure.
jsonifier::vector< embed_data > embeds
Array of message embeds.
jsonifier::vector< channel_mention_data > mentionChannels
Array of channel_data mention data.
jsonifier::string content
The message's content.
message_activity_data activity
Message activity data.
snowflake guildId
The id of the guild the message was sent in.
jsonifier::vector< action_row_data > components
Array of action row data.
time_stamp timeStamp
The timeStamp of when the message was created.
guild_member_data member
The author's guild member data.pplication data.
bool tts
Is it a text-to-speech message_data?
jsonifier::vector< attachment_data > attachments
Array of attachment data.
message_reference_data messageReference
Message reference data.
snowflake webHookId
Web_hook id of the message_data, if applicable.
jsonifier::vector< sticker_data > stickers
Array of message sticker_data data.
jsonifier::string editedTimestamp
The time at which it was edited.
jsonifier::vector< sticker_item_data > stickerItems
Array of message sticker_data item data.
channel_data thread
The thread_data that the message was sent in, if applicable.
user_data author
The author's user_data data.
message_interaction_data interaction
Message interaction data.
snowflake channelId
The channel_data it was sent in.
jsonifier::vector< jsonifier::string > mentionRoles
Jsonifier::vector of "mention roles" ids.
jsonifier::vector< user_data > mentions
Array of user_data data, for individual's that were mentioned.
bool mentionEveryone
Does the message mention everyone?
snowflake applicationId
Application id.
Message response base, for responding to messages.
audit log entry info data
snowflake messageId
Message snowflake.
jsonifier::string roleName
Role_data name.
jsonifier::string type
Type.
snowflake channelId
channel_data snowflake.
jsonifier::string deleteMemberDays
Number of days for which the member's messages were deleted.
jsonifier::string count
count.
jsonifier::string membersRemoved
Number of members that were removed upon a prune.
snowflake applicationId
Id of the app whose permissions were targeted APPLICATION_COMMAND_PERMISSION_UPDATE.
A permission_types overwrite, for a given channel.
permissions_parse allow
collection of permissions to allow.
permission_overwrites_type type
Role_data or user_data type.
permissions_parse deny
collection of permissions to deny.
Data structure representing a single emoji.
/// data structure representing a single reaction.
bool me
Whether or not i (the bot) placed it.
emoji_data emoji
The emoji that was placed as a reaction.
guild_member_data member
The guild_member_data who placed the reaction.
snowflake channelId
The id of the channel_data where it was placed.
snowflake guildId
The id of the guild where it was placed.
snowflake userId
The id of the user_data who placed the reaction.
snowflake messageId
The id of the message upon which it was placed.
uint64_t count
The number of times this particular emoji was placed as a reaction to the given message_data.
Data for responding to an input-event.
Data structure representing a single role_data.
Represents a single selection from a select-menu.
jsonifier::string value
A value for identifying the option.
jsonifier::string label
A visible label for the select-menu-option.
jsonifier::string description
Description of the select-menu-option.
partial_emoji_data emoji
An optional emoji to put on it.
bool _default
Is it the default option?
A class representing a snowflake identifier with various operations.
Definition Base.hpp:701
uint64_t id
The snowflake id.
Definition Base.hpp:832
snowflake guildId
The guild id for which the channel_data exists in.
snowflake channelId
The channel_data's id.
stage_instance_privacy_level privacyLevel
Privacy level of the channel_data.
jsonifier::string topic
The topic of the stage_instance_data.
Data representing a single sticker_data.
uint64_t nsfwLevel
Nsfw warning level.
jsonifier::string tags
Tags for the sticker_data to use.
jsonifier::string name
The sticker_data's name.
sticker_type type
The type of sticker_data.
jsonifier::string description
Description of the sticker_data.
user_data user
The user_data that uploaded the guild sticker_data.
sticker_flags flags
Sticker_data flags.
uint64_t sortValue
Where in the stack of stickers it resides.
sticker_format_type formatType
Format type.
jsonifier::string asset
Asset value for the sticker_data.
jsonifier::string packId
Pack id of the sticker_data.
snowflake guildId
The guild id for which the sticker_data exists in.
Message sticker_data item data.
sticker_item_type formatType
Message sticker_data item type.
jsonifier::string name
The name of the sticker_data.
jsonifier::string icon
Icon for the team.
jsonifier::vector< team_members_object_data > members
Array of team members object data.
snowflake ownerUserId
User_data id of the team owner.
Represents a single thread_data.
Data for a single member of a thread_data.
jsonifier::string joinTimestamp
The time at which the member joined this thread_data.
Represents a thread_data-members-update.
snowflake guildId
Guild id of the thread_data.
uint32_t memberCount
Number of guild-members in the thread_data.
jsonifier::vector< jsonifier::string > removedMemberIds
Members who have been removed.
jsonifier::vector< thread_member_data > addedMembers
New members added to the thread_data.
guild_data sourceGuild
Source guild id.
channel_data sourceChannel
channel_data for which th web_hook_data was issued.
snowflake applicationId
Application id.
jsonifier::string token
Token of the web_hook_data.
jsonifier::string name
Name of the web_hook_data.
snowflake channelId
channel_data id for which the web_hook_data was issued.
web_hook_type type
Type of web_hook_data.
snowflake guildId
Guild id for which the web_hook_data was issued.
user_data user
User_data which create the web_hook_data.
jsonifier::string url
Url of the web_hook_data.
jsonifier::string avatar
Avatar of the web_hook_data.
input_event_response_type
Input event response types.
forum_layout_types
forum layout types.
system_channel_flags
System channel flags.
application_flags
application flags, for the application_data structure.
sticker_item_type
Sticker_data item types.
sticker_format_type
Sticker_data format types.
guild_scheduled_event_status
Guild_scheduled_event_status.
application_command_permission_type
Application command permission-types.
premium_tier
Premium tier levels.
explicit_content_filter_level
Explicit content filter levels.
message_activity_type
Message activity types.
interaction_callback_type
Interaction callback types.
audit_log_event
Audit log events.
verification_level
/// verification levels.
channel_type
Channel_data types.
text_input_style
Text input style for modals.
stage_instance_privacy_level
Stage instance privacy levels.
sticker_type
Sticker_data types.
sort_order_types
The sorting order, for guild forum channels.
user_flags
User_data flags.
component_type
Component types.
widget_style_options
Widget style options.
guild_scheduled_event_privacy_level
Guild scheduled event privacy levels.
guild_nsfwlevel
Guild nsfw level.
permission_overwrites_type
Permission_types overwrites types.
keyword_preset_type
Keyword preset types for auto-moderation.
event_type
Event types for auto-moderation.
application_command_type
Application command types.
afk_time_out_durations
Afk timeout durations.
application_command_option_type
Application command-option types.
premium_type
Premium types denote the level of premium a user has.
invite_target_types
Invite target types.
permission
Permission values, for a given channel, by role_data or guild_member_data.
thread_type
Thread_data types.
default_message_notification_level
Default message notification levels.
timeout_durations
Timeout durations for the timeout command.
guild_scheduled_event_entity_type
Guild scheduled event entity types.
web_hook_type
Web_hook_data types.
action_type
Action types for auto-moderation.
trigger_type
Trigger types for auto-moderation.
connection_visibility_types
Connection visibility types.
interaction_type
Interaction types.
thread_auto_archive_duration
Automatic thread_data archiving durations.
@ Guild_Discovery_Grace_Period_Final_Warning
Guild discovery grade period final warning.
@ User_Premium_Guild_Subscription
User_data premium guild subscription.
@ Guild_Discovery_Grace_Period_Initial_Warning
Guild discovery grade period initial warning.
@ User_Premium_Guild_Subscription_Tier_3
User_data premium guild subscription tier 3.
@ Context_Menu_Command
context menu command.
@ User_Premium_Guild_Subscription_Tier_2
User_data premium guild subscription tier 2.
@ Channel_Icon_Change
channel_data icon change.
@ Channel_Follow_Add
channel_data follow add.
@ Guild_Discovery_Requalified
Guild discovery requalified.
@ Channel_Pinned_Message
channel_data pinned message.
@ Channel_Name_Change
channel_data name change.
@ Thread_Starter_Message
Thread_data starter message_data.
@ Guild_Invite_Reminder
Guild invite reminder.
@ Guild_Discovery_Disqualified
Guild discovery disqualified.
@ User_Premium_Guild_Subscription_Tier_1
User_data premium guild subscription tier 1.
@ Not_set
No default has been set for forum channel.
@ Gallery_View
Display posts as a collection of tiles.
@ Suppress_Join_Notification_Replies
Hide member join sticker reply buttons.
@ Suppress_Guild_Reminder_Notifications
Suppress server setup tips.
@ Suppress_Join_Notifications
Suppress member join notifications.
@ Suppress_Premium_Subscriptions
Suppress server boost notifications.
@ Verificatino_Pending_Guild_Limit
Indicates unusual growth of an app that prevents verification.
@ Gateway_Guild_Members
Intent required for bots in 100 or more servers to receive member-related events like guild_member_ad...
@ Gateway_Message_Content_Limited
Intent required for bots in under 100 servers to receive message content, found in bot settings}...
@ Gateway_Guild_Members_Limited
Intent required for bots in under 100 servers to receive member-related events like guild_member_add,...
@ embedded
Indicates if an app is embedded within the discord client (currently unavailable publicly)
@ Gateway_Presence_Limited
Intent required for bots in under 100 servers to receive presence_update events, found in bot setting...
@ Gateway_Message_Content
Intent required for bots in 100 or more servers to receive message content.
@ Gateway_Presence
Intent required for bots in 100 or more servers to receive presence_update events.
@ Deferred_Channel_Message_With_Source
Ack an interaction and edit a response later, the user sees a loading state.
@ Channel_Message_With_Source
Respond to an interaction with a message.
@ Deferred_Update_Message
For components, ack an interaction and edit the original message later; the user does not see a loadi...
@ Modal
Respond to an interaction with a popup modal.
@ Application_Command_Autocomplete_Result
Respond to an autocomplete interaction with suggested choices.
@ Update_Message
For components, edit the message the component was attached to.
@ Channel_Overwrite_Update
channel_data overwrite update.
@ Channel_Overwrite_Create
channel_data overwrite create.
@ Channel_Overwrite_Delete
channel_data overwrite delete.
@ Auto_Moderation_Rule_Update
Auto moderation rule was updated.
@ Application_Command_Permission_Update
Permissions were updated for a command.
@ Guild_Scheduled_Event_Create
Guild-scheduled-event create.
@ Stage_Instance_Update
Stage-instance update.
@ Guild_Scheduled_Event_Update
Guild-scheduled-event update.
@ Stage_Instance_Create
Stage-instance create.
@ Auto_Moderation_Block_Message
Message was blocked by auto_mod (according to a rule).
@ Guild_Scheduled_Event_Delete
Guild-scheduled-event delete.
@ Stage_Instance_Delete
Stage-instance delete.
@ Auto_Moderation_Rule_Delete
Auto moderation rule was deleted.
@ Auto_Moderation_Rule_Create
Auto moderation rule was created.
@ Dm
A direct message between users.
@ Guild_Announcement
A channel that users can follow and crosspost into their own server (formerly news channels).
@ Group_DM
A direct message between multiple users.
@ Announcement_Thread
A temporary sub-channel within a GUILD_ANNOUNCEMENT channel.
@ Guild_Stage_Voice
A voice channel for hosting events with an audience.
@ Guild_Text
A text channel within a server.
@ Guild_Voice
A voice channel within a server.
@ Guild_Category
An organizational category that contains up to 50 channels.
@ Guild_Directory
The channel in a hub containing the listed servers.
@ Private_Thread
A temporary sub-channel within a GUILD_TEXT channel that is only viewable by those invited and those ...
@ Guild_Forum
channel_data that can only contain threads.
@ Public_Thread
A temporary sub-channel within a GUILD_TEXT or GUILD_FORUM channel.
@ Latest_Activity
Sort forum posts by activity.
@ Creation_Date
Sort forum posts by creation time(from most recent to oldest).
@ Bug_Hunter_Level_1
Bug hunter level 1.
@ Bot_Https_Interactions
Bot uses only https interactions and is shown in the online member list.
@ Bug_Hunter_Level_2
Bug hunter level 2.
@ Premium_Early_Suppoerter
Early nitro supporter.
@ Hypesquad
Hype_squad events member.
@ Partner
Partnered server owner.
@ Verified_Developer
Early verified bot developer.
@ Hypesquad_Online_House_1
House bravery member.
@ Hypesquad_Online_House_2
House brilliance member.
@ System
Is it a system integration?
@ Team_Pseudo_User
User_data is a team.
@ Certified_Moderator
Discord certified moderator.
@ Hypesquad_Online_House_3
House balance member.
@ Action_Row
container for other components.
@ Mentionable_Select
Select menu for mentionables (users and roles).
@ Channel_Select
Select menu for channels.
@ String_Select
Select menu for picking from defined text options.
@ Sexual_Content
Words that refer to sexually explicit behavior or activity.
@ Profanity
Words that may be considered forms of swearing or cursing.
@ Slurs
Personal insults or words that may be considered hate speech.
@ Message_Send
When a member sends or edits a message in the guild.
@ guilds
Intent for receipt of guild information.
@ Premium_Progress_Bar_Enabled
Premium progress bar enabled.
@ Guild_News_Thread
Guild news thread_data.
@ Guild_Public_Thread
Guild public thread_data.
@ Guild_Private_Thread
Guild protected thread_data.
@ Source_Message_Deleted
Source message deleted.
@ Channel_Follower
channel_data follower.
@ Block_Message
Blocks the content of a message according to the rule.
@ Timeout
Timeout user for a specified duration.
@ Send_Alert_Message
Logs user content to a specified channel.
@ Keyword
check if content contains words from a user defined list of keywords.
@ Mention_Spam
check if content contains more unique mentions than allowed.
@ Keyword_Preset
check if content contains words from internal pre-defined wordsets.
@ Spam
check if content represents generic spam.
@ Application_Command_Autocomplete
Application command autocomplete.
The main namespace for the forward-facing interfaces.
For representing a single auto-moderation-rule-action.
action_type type
The type of action.
action_meta_data metadata
Additional metadata needed during execution for this specific action type.
Action metadata for auto-moderation-rules.
int64_t durationSeconds
Timeout duration in seconds.
snowflake channelId
channel_data to which user content should be logged.
Data representing an active thread_data.
Application_command_data interaction data option.
jsonifier::vector< application_command_interaction_data_option > options
Application_command_data interaction data options.
application_command_option_type type
The type of application_command_data options.
bool focused
True if this option is the currently focused option for autocomplete.
jsonifier::string name
The name of the current option.
Data structure representing an application_command_data's option.
int64_t minValue
If the option is an integer or number type, the minimum value permitted.
bool autocomplete
If autocomplete interactions are enabled for this string, integer, or number type option.
jsonifier::string description
A description of the current application_command_data option.
jsonifier::vector< channel_type > channelTypes
Set when the application_command_data option type is set to channel_data.
bool required
If the parameter is required or optional– default false.
jsonifier::vector< application_command_option_choice_data > choices
A vector of possible choices for the current application_command_data option.
jsonifier::vector< application_command_option_data > options
A vector of possible options for the current application_command_data option.
jsonifier::string name
Name of the current application_command_data option.
application_command_option_type type
The type of command option.
unordered_map< jsonifier::string, jsonifier::string > nameLocalizations
Dictionary for the name localizations field.
int64_t maxValue
If the option is an integer or number type, the maximum value permitted.
unordered_map< jsonifier::string, jsonifier::string > descriptionLocalizations
Dictionary for the description localizations field.
Data representing an archived thread_data.
jsonifier::string key
The key of the audit log change.
jsonifier::vector< jsonifier::string > scopes
Array of strings - the scopes the user_data has authorized the application for.
jsonifier::string expires
When the access token expires.
application_data application
Partial application object the current application.
bool failedDueToPerms
Failed due to perms?
user_data user
User_data that was banned.
jsonifier::string reason
Reason for the ban.
Base arguments for the command classes.
Base class for the command classes.
virtual void execute(const base_function_arguments &args)=0
The base function for the command's execute function.
Data for when some channel_data pins are updated.
snowflake guildId
The id of the guild within which the message was pinned.
time_stamp lastPinTimeStamp
The time of the last pinned message.
snowflake channelId
The id of the channel_data within which the message was pinned.
crtp-based struct for exposing the connectToVoice functionality of the guild-related classes.
DCA_INLINE voice_connection & connectToVoice(const snowflake guildMemberId, const snowflake channelId=0, bool selfDeaf=false, bool selfMute=false, stream_info streamInfoNew=stream_info{})
For connecting to an individual voice channel.
Represents a single user_data connection.
bool showActivity
Whether activities related to this connection will be shown in presence updates.on.
jsonifier::vector< integration_data > integrations
An array of partial server integrations.
bool verified
Whether the connection is verified.
bool revoked
Whether the connection is revoked.
jsonifier::string name
The username of the connection account.
connection_visibility_types visibility
Visibility of this connecti.
bool friendSync
Whether friend sync is enabled for this connection.
jsonifier::string type
The service of the connection(twitch, youtube).
jsonifier::string proxyIconUrl
Proxy icon url.
unordered_set< jsonifier::string > jsonifierExcludedKeys
For excluding certain keys from parsing/serialization.
jsonifier::string value
The text on the field.
jsonifier::string name
The title of the field.
bool Inline
Is the field DCA_INLINE with the rest of them?
unordered_set< jsonifier::string > jsonifierExcludedKeys
For excluding certain keys from parsing/serialization.
jsonifier::string proxyUrl
Proxy url.
jsonifier::string proxyUrl
Proxy url.
Data representing a file to be sent via multipart-form data.
jsonifier::string data
The data of the file.
jsonifier::string fileName
The name of the file.
bool moderated
Whether this tag can only be added to or removed from threads by a member with the MANAGE_THREADS per...
snowflake emojiId
The id of a guild's custom emoji.
jsonifier::string emojiName
The unicode character of the emoji.
jsonifier::string name
The name of the tag(0 - 20 characters).
uint64_t flags
Flags to be set for the message.
jsonifier::vector< file > files
File contents the contents of the file being sent one of content, file, embed(s), sticker_ids.
jsonifier::vector< jsonifier::string > stickerIds
Array of snowflakes ids of up to 3 stickers in the server to send in the message.
jsonifier::vector< attachment_data > attachments
Array of partial attachment objects attachment objects with filename.
jsonifier::vector< embed_data > embeds
Array of embed objects embedded rich content (up to 6000 characters).
jsonifier::string content
The message contents (up to 2000 characters).
allowed_mentions_data allowedMentions
Allowed mention object allowed mentions for the message.
jsonifier::vector< action_row_data > components
Array of message component objects the components to include with the message.
Data from the get_gateway_bot endpoint.
uint32_t shards
The recommended number of shards to use when connecting.
session_start_data sessionStartLimit
Information on the current session start limit.
jsonifier::string url
The wss url that can be used for connecting to the gateway.
jsonifier::vector< user_data > members
Special widget user objects that includes users presence (limit 100).
jsonifier::string instantInvite
Instant invite for the guilds specified widget invite channel.
jsonifier::string name
Guild name (2-100 characters).
uint64_t presenceCount
Number of online members in this guild.
jsonifier::vector< channel_data > channels
Voice and stage channels which are accessible by everyone.
Data representing a guild emoji update event.
Data representing a single guild preview.
Data representing a single guild_scheduled_event_user.
user_data user
User_data which subscribed to an event.
snowflake guildScheduledEventId
The scheduled event id which the user_data subscribed to/.
guild_member_data member
Guild member data for this user_data for the guild which this event belongs to, if any.
Data representing a guild stickers update event.
jsonifier::string description
The description for the template.
guild_data serializedSourceGuild
The guild snapshot this template contains.
jsonifier::string code
The template code(unique id).
user_data creator
The user_data who created the template.
bool isDirty
Whether the template has unsynced changes.
jsonifier::string updatedAt
When this template was last synced to the source guild.
uint32_t usageCount
Number of times this template has been used.
jsonifier::string createdAt
When this template was created.
jsonifier::string name
Template name.
jsonifier::string sourceGuildId
The id of the guild this template is based on.
jsonifier::string creatorId
The id of the user_data who created the template.
snowflake channelId
The widget channel_data id.
bool enabled
Whether the widget is enabled.
Install params data, for application data.
permissions_parse permissions
The permissions to request for the bot role.
jsonifier::vector< jsonifier::string > scopes
The scopes to add the application to the server with.
Interaction application_command_data callback data.
application_command_type type
The type of application_command.
snowflake targetId
The target message_data's id.
jsonifier::vector< action_row_data > components
Array of message componentsthe values submitted by the user.
component_type componentType
The type of the component.
jsonifier::vector< application_command_interaction_data_option > options
Application_command_data interaction data options.
jsonifier::string customId
The custom_id of the component.
jsonifier::string name
The name of the invoked command.
jsonifier::vector< jsonifier::string > values
Array of select option values the user selected in a select menu component.
snowflake guildId
The guild that the command took place in.
For storing interaction-related values.
uint64_t uses
The current number of uses.
jsonifier::string expiresAt
When the invite expires.
application_data targetApplication
Application data.
jsonifier::string createdAt
Time it was created at.
uint64_t maxUses
Max number of uses.
jsonifier::string code
Unique invite code.
guild_scheduled_event_data guildScheduledEvent
Scheduled guild event.
partial_guild_data guild
Guild data of the channel_data that the invite is for.
user_data inviter
The user_data who created the invite.
uint64_t approximateMemberCount
Approximate member count.
snowflake guildId
The guild this invite is for.
user_data targetUser
Target user_data of the invite.
stage_instance_data stageInstance
Stage instance data.
uint64_t approximatePresenceCount
Approximate presence count.
uint64_t maxAge
Maximum age of the invite.
channel_data channel
channel_data data of the channel_data that the invite is for.
message_activity_type type
Message activity type.
For storing message_data-related values.
snowflake guildId
snowflake of the guild that the referenced message was sent in.
snowflake messageId
snowflake of the message to reference.
snowflake channelId
snowflake of the channel_data that the referenced message was sent in.
bool failIfNotExists
Fail if the message doesn't exist?
Playlist of songs and other variables.
song currentSong
The current song that is playing.
bool isLoopAllEnabled
Is looping of the entire playlist currently enabled?
jsonifier::vector< song > songQueue
The list of songs that are stored to be played.
bool isLoopSongEnabled
Is looping of songs currently enabled?
client_status clientStatus
user_data's platform-dependent status
snowflake guildId
snowflake id of the guild.
jsonifier::vector< activity_data > activities
Array of activity objects user_data's current activities.
user_data user
User_data object user_data whose presence is being updated.
jsonifier::string status
Either "idle", "dnd", "online", or "offline".
unordered_map< snowflake, user_data > users
Unordered_map full of user_data.
unordered_map< snowflake, attachment_data > attachments
Unordered_map of snowflakes to attachment objects the ids.
unordered_map< snowflake, channel_data > channels
Unordered_map full of channel_data.
unordered_map< snowflake, role_data > roles
Unordered_map full of role_data.
unordered_map< snowflake, guild_member_data > members
Unordered_map full of guild_memeber_data.
unordered_map< snowflake, message_data > messages
Unordered_map full of messageData.
jsonifier::string premiumSubscriber
Are they a premium subscriber?
snowflake botId
What is the bot id?
snowflake integrationId
What is the integration id?
Data from the session_start info.
uint32_t total
The total number of session starts the current user_data is allowed.
uint32_t resetAfter
The number of milliseconds after which the limit resets.
uint32_t maxConcurrency
The number of identify requests allowed per 5 seconds.
uint32_t remaining
The remaining number of session starts the current user_data is allowed.
snowflake guildMemberId
The sending guild_member_data.
bool wasItAFail
Is this a replay? (did a track recently fail to play?)
Represents a sticker_data pack.
jsonifier::string coverStickerId
snowflake of a sticker_data in the pack which is shown as the pack's icon.
jsonifier::string description
Description of the sticker_data pack.
jsonifier::string bannerAssetId
snowflake of the sticker_data pack's banner image.
jsonifier::vector< sticker_data > stickers
Array of sticker_data objects the stickers in the pack.
jsonifier::string name
Name of the sticker_data pack.
jsonifier::string skuId
snowflake of the pack's sku.
user_data user
User_data data of the current user_data.
snowflake teamId
snowflake of the current team.
jsonifier::vector< permissions_parse > permissions
Permissions for the team.
Data for when threads are synced.
jsonifier::vector< thread_member_data > members
Array of members that are a part of the thread_data.
snowflake guildId
The id of the guild for which the threads are being synced.
jsonifier::vector< channel_data > threads
All active threads in the given channels that the current user_data can access.
jsonifier::vector< jsonifier::string > channelIds
The parent channel_data ids whose threads are being synced.
Meta data for a thread_data type of channel_data.
bool invitable
The id of the individual who archived this thread_data.
uint64_t autoArchiveDuration
How int64_t before archiving this thread_data.
jsonifier::string archiveTimestamp
(where applicable) the time at which this thread_data was archived.
bool locked
Whether or not this thread_data is currently locked.
bool archived
Whether or not this thread_data is currently archived.
Trigger metadata for auto-moderation-rules.
uint64_t mentionTotalLimit
Total number of unique role and user mentions allowed per message (maximum of 50).
bool mentionRaidProtectionEnabled
MENTION_SPAM whether to automatically detect mention raids.
jsonifier::vector< jsonifier::string > regexPatterns
Array of strings** keyword regular expression patterns which will be matched against content.
jsonifier::vector< jsonifier::string > keywordFilter
Substrings which will be searched for in content.keyword_filter array of strings.
jsonifier::vector< keyword_preset_type > presets
The internally pre-defined wordsets which will be searched for in content.
jsonifier::vector< jsonifier::string > allowList
Substrings which will be exempt from triggering the preset trigger type.
Representing "typing_start" data.
For updating/modifying a given channel's properties.
For updating the current voice state.
bool selfMute
Whether or not we self-mute ourselves.
std::nullptr_t channelId
snowflake of the desired voice channel_data. leave blank to disconnect.
snowflake guildId
The id of the guild fo which we would like to establish a voice connection.
bool selfDeaf
Whether or not we self-deafen ourselves.
For updating the current voice state.
bool selfDeaf
Whether or not we self-deafen ourselves.
bool selfMute
Whether or not we self-mute ourselves.
snowflake channelId
snowflake of the desired voice channel_data. leave blank to disconnect.
snowflake guildId
The id of the guild fo which we would like to establish a voice connection.
Structure representing voice region data.
bool optimal
True for a single server that is closest to the current user_data's client.
jsonifier::string name
Name of the region.
bool custom
Whether this is a custom voice region(used for events / etc).
bool deprecated
Whether this is a deprecated voice region(avoid switching to these).
snowflake channelId
The channel_data id this user_data is connected to.
snowflake guildId
The guild id this voice state is for.
snowflake userId
The user_data id this voice state is for.
bool selfMute
Whether this user_data is locally muted.
bool selfDeaf
Whether this user_data is locally deafened.
jsonifier::string requestToSpeakTimestamp
The time at which the user_data requested to speak.
bool selfStream
Whether this user_data is streaming using "go live".
bool mute
Whether this user_data is muted by the server.
bool selfVideo
Whether this user_data's camera is enabled.
bool suppress
Whether this user_data is muted by the current user_data.
jsonifier::string sessionId
The session id for this voice state.
bool deaf
Whether this user_data is deafened by the server.
jsonifier::string emojiName
Emoji name for the channel_data.
snowflake emojiId
Emoji id for the channel_data.
jsonifier::string description
Description of the welcome channel_data.
snowflake channelId
snowflake of the welcome channel_data.
jsonifier::vector< welcome_screen_channel_data > welcomeChannels
Welcome screen channel_data data.
jsonifier::string description
Description of the welcome screen.