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