Discord Social SDK
Loading...
Searching...
No Matches
discordpp.h
1// Generated with <3 by Discord.Sdk.Derive
2#ifndef DISCORD_HEADER_DISCORDPP_H_
3#define DISCORD_HEADER_DISCORDPP_H_
4#include "cdiscord.h"
5#include <atomic>
6#include <cassert>
7#include <cstring>
8#include <functional>
9#include <memory>
10#include <optional>
11#include <string>
12#include <unordered_map>
13#include <vector>
14
16namespace discordpp {
17
25
29inline void RunCallbacks()
30{
31 Discord_RunCallbacks();
32}
33
42
45
47 Join = 1,
48
51};
52
55
63
68 Public = 1,
69};
70
77enum class ActivityTypes {
78
81
84
87
90
93
96
99};
100
105
107 Name = 0,
108
110 State = 1,
111
114};
115
118
121
123 Xbox = 2,
124
127
129 IOS = 8,
130
133
136
138 PS4 = 64,
139
141 PS5 = 128,
142};
143
145enum class ErrorType {
146
148 None = 0,
149
153
161
171
174
177
187
190
195
200};
201
207enum class HttpStatusCode {
208
210 None = 0,
211
213 Continue = 100,
214
217
220
223
225 Ok = 200,
226
228 Created = 201,
229
231 Accepted = 202,
232
235
238
241
244
247
250
252 ImUsed = 209,
253
256
259
261 Found = 302,
262
264 SeeOther = 303,
265
268
271
274
277
280
283
286
288 NotFound = 404,
289
292
295
298
301
303 Conflict = 409,
304
306 Gone = 410,
307
310
313
316
319
322
325
328
331
334
336 Locked = 423,
337
340
342 TooEarly = 425,
343
346
349
352
355
358
361
364
367
370
373
376
379
382
385
388};
389
394
396 S256 = 0,
397};
398
400enum class IntegrationType {
401
404
407};
408
412enum class ChannelType {
413
416
418 Dm = 1,
419
422
425
428
431
434
437
440
443
446
449
452
455
457 Lobby = 17,
458
461};
462
465
467 Other = 0,
468
471
473 Poll = 2,
474
477
480
482 Embed = 5,
483
486};
487
489enum class AudioSystem {
490
493
495 Game = 1,
496};
497
499enum class AudioModeType {
500
503
506
509};
510
513
515 None = 0,
516
519
523
528
532
535
538};
539
542
544 OIDC = 0,
545
548
550 Steam = 2,
551
553 Unity = 3,
554
557
559 None = 5,
560
563};
564
569enum class StatusType {
570
573
576
579
582 Idle = 3,
583
585 Dnd = 4,
586
589
592
595};
596
609
613
615 User = 0,
616
619};
620
649
651enum class LoggingSeverity {
652
655
657 Info = 2,
658
661
663 Error = 4,
664
666 None = 5,
667};
668
682class ActivityInvite;
683class ActivityAssets;
684class ActivityTimestamps;
685class ActivityParty;
686class ActivitySecrets;
687class ActivityButton;
688class Activity;
689class ClientResult;
690class AuthorizationCodeChallenge;
691class AuthorizationCodeVerifier;
692class AuthorizationArgs;
693class DeviceAuthorizationArgs;
694class VoiceStateHandle;
695class VADThresholdSettings;
696class Call;
697class ChannelHandle;
698class GuildMinimal;
699class GuildChannel;
700class LinkedLobby;
701class LinkedChannel;
702class RelationshipHandle;
703class UserApplicationProfileHandle;
704class UserHandle;
705class LobbyMemberHandle;
706class LobbyHandle;
707class AdditionalContent;
708class MessageHandle;
709class AudioDevice;
710class UserMessageSummary;
711class ClientCreateOptions;
712class Client;
713class CallInfoHandle;
714
720 mutable Discord_ActivityInvite instance_{};
723
724public:
726 Discord_ActivityInvite* instance() const { return &instance_; }
729 explicit ActivityInvite(Discord_ActivityInvite instance, DiscordObjectState state);
739 operator bool() const { return state_ != DiscordObjectState::Invalid; }
740
745
746 explicit ActivityInvite();
747
749 void Drop();
751
753 uint64_t SenderId() const;
755 void SetSenderId(uint64_t SenderId);
756
758 uint64_t ChannelId() const;
760 void SetChannelId(uint64_t ChannelId);
761
763 uint64_t MessageId() const;
765 void SetMessageId(uint64_t MessageId);
766
771
773 uint64_t ApplicationId() const;
776
779 uint64_t ParentApplicationId() const;
782
784 std::string PartyId() const;
786 void SetPartyId(std::string PartyId);
787
789 std::string SessionId() const;
791 void SetSessionId(std::string SessionId);
792
795 bool IsValid() const;
797 void SetIsValid(bool IsValid);
798};
799
818 mutable Discord_ActivityAssets instance_{};
821
822public:
824 Discord_ActivityAssets* instance() const { return &instance_; }
827 explicit ActivityAssets(Discord_ActivityAssets instance, DiscordObjectState state);
837 operator bool() const { return state_ != DiscordObjectState::Invalid; }
838
843
844 explicit ActivityAssets();
845
847 void Drop();
849
854 std::optional<std::string> LargeImage() const;
856 void SetLargeImage(std::optional<std::string> LargeImage);
857
861 std::optional<std::string> LargeText() const;
863 void SetLargeText(std::optional<std::string> LargeText);
864
868 std::optional<std::string> LargeUrl() const;
870 void SetLargeUrl(std::optional<std::string> LargeUrl);
871
875 std::optional<std::string> SmallImage() const;
877 void SetSmallImage(std::optional<std::string> SmallImage);
878
882 std::optional<std::string> SmallText() const;
884 void SetSmallText(std::optional<std::string> SmallText);
885
889 std::optional<std::string> SmallUrl() const;
891 void SetSmallUrl(std::optional<std::string> SmallUrl);
892
897 std::optional<std::string> InviteCoverImage() const;
899 void SetInviteCoverImage(std::optional<std::string> InviteCoverImage);
900};
901
905 mutable Discord_ActivityTimestamps instance_{};
908
909public:
911 Discord_ActivityTimestamps* instance() const { return &instance_; }
914 explicit ActivityTimestamps(Discord_ActivityTimestamps instance, DiscordObjectState state);
924 operator bool() const { return state_ != DiscordObjectState::Invalid; }
925
930
931 explicit ActivityTimestamps();
932
934 void Drop();
936
942 uint64_t Start() const;
944 void SetStart(uint64_t Start);
945
951 uint64_t End() const;
953 void SetEnd(uint64_t End);
954};
955
959 mutable Discord_ActivityParty instance_{};
962
963public:
965 Discord_ActivityParty* instance() const { return &instance_; }
968 explicit ActivityParty(Discord_ActivityParty instance, DiscordObjectState state);
972 ActivityParty(ActivityParty&& other) noexcept;
976 static const ActivityParty nullobj;
978 operator bool() const { return state_ != DiscordObjectState::Invalid; }
979
984
985 explicit ActivityParty();
986
988 void Drop();
990
997 std::string Id() const;
999 void SetId(std::string Id);
1000
1002 int32_t CurrentSize() const;
1005
1008 int32_t MaxSize() const;
1010 void SetMaxSize(int32_t MaxSize);
1011
1016};
1017
1021 mutable Discord_ActivitySecrets instance_{};
1024
1025public:
1027 Discord_ActivitySecrets* instance() const { return &instance_; }
1030 explicit ActivitySecrets(Discord_ActivitySecrets instance, DiscordObjectState state);
1040 operator bool() const { return state_ != DiscordObjectState::Invalid; }
1041
1046
1047 explicit ActivitySecrets();
1048
1050 void Drop();
1052
1057 std::string Join() const;
1059 void SetJoin(std::string Join);
1060};
1061
1065 mutable Discord_ActivityButton instance_{};
1068
1069public:
1071 Discord_ActivityButton* instance() const { return &instance_; }
1074 explicit ActivityButton(Discord_ActivityButton instance, DiscordObjectState state);
1084 operator bool() const { return state_ != DiscordObjectState::Invalid; }
1085
1090
1091 explicit ActivityButton();
1092
1094 void Drop();
1096
1098 std::string Label() const;
1100 void SetLabel(std::string Label);
1101
1103 std::string Url() const;
1105 void SetUrl(std::string Url);
1106};
1107
1290 mutable Discord_Activity instance_{};
1293
1294public:
1296 Discord_Activity* instance() const { return &instance_; }
1299 explicit Activity(Discord_Activity instance, DiscordObjectState state);
1300 ~Activity();
1303 Activity(Activity&& other) noexcept;
1305 Activity& operator=(Activity&& other) noexcept;
1307 static const Activity nullobj;
1309 operator bool() const { return state_ != DiscordObjectState::Invalid; }
1310
1312 Activity(const Activity& arg0);
1315
1316 explicit Activity();
1317
1319 void Drop();
1321
1324
1326 bool Equals(discordpp::Activity other) const;
1327
1329 std::vector<discordpp::ActivityButton> GetButtons() const;
1330
1334 std::string Name() const;
1336 void SetName(std::string Name);
1337
1344
1348 std::optional<discordpp::StatusDisplayTypes> StatusDisplayType() const;
1350 void SetStatusDisplayType(std::optional<discordpp::StatusDisplayTypes> StatusDisplayType);
1351
1356 std::optional<std::string> State() const;
1358 void SetState(std::optional<std::string> State);
1359
1364 std::optional<std::string> StateUrl() const;
1366 void SetStateUrl(std::optional<std::string> StateUrl);
1367
1372 std::optional<std::string> Details() const;
1374 void SetDetails(std::optional<std::string> Details);
1375
1380 std::optional<std::string> DetailsUrl() const;
1382 void SetDetailsUrl(std::optional<std::string> DetailsUrl);
1383
1388 std::optional<uint64_t> ApplicationId() const;
1390 void SetApplicationId(std::optional<uint64_t> ApplicationId);
1391
1397 std::optional<uint64_t> ParentApplicationId() const;
1399 void SetParentApplicationId(std::optional<uint64_t> ParentApplicationId);
1400
1402 std::optional<discordpp::ActivityAssets> Assets() const;
1404 void SetAssets(std::optional<discordpp::ActivityAssets> Assets);
1405
1409 std::optional<discordpp::ActivityTimestamps> Timestamps() const;
1411 void SetTimestamps(std::optional<discordpp::ActivityTimestamps> Timestamps);
1412
1415 std::optional<discordpp::ActivityParty> Party() const;
1417 void SetParty(std::optional<discordpp::ActivityParty> Party);
1418
1421 std::optional<discordpp::ActivitySecrets> Secrets() const;
1423 void SetSecrets(std::optional<discordpp::ActivitySecrets> Secrets);
1424
1433};
1434
1446 mutable Discord_ClientResult instance_{};
1449
1450public:
1452 Discord_ClientResult* instance() const { return &instance_; }
1455 explicit ClientResult(Discord_ClientResult instance, DiscordObjectState state);
1456 ~ClientResult();
1459 ClientResult(ClientResult&& other) noexcept;
1463 static const ClientResult nullobj;
1465 operator bool() const { return state_ != DiscordObjectState::Invalid; }
1466
1471
1473 void Drop();
1475
1477 std::string ToString() const;
1478
1483
1485 std::string Error() const;
1487 void SetError(std::string Error);
1488
1497 int32_t ErrorCode() const;
1500
1507
1515 std::string ResponseBody() const;
1518
1520 bool Successful() const;
1523
1525 bool Retryable() const;
1528
1531 float RetryAfter() const;
1534};
1535
1539 mutable Discord_AuthorizationCodeChallenge instance_{};
1542
1543public:
1545 Discord_AuthorizationCodeChallenge* instance() const { return &instance_; }
1548 explicit AuthorizationCodeChallenge(Discord_AuthorizationCodeChallenge instance,
1549 DiscordObjectState state);
1559 operator bool() const { return state_ != DiscordObjectState::Invalid; }
1560
1565
1566 explicit AuthorizationCodeChallenge();
1567
1569 void Drop();
1571
1576
1578 std::string Challenge() const;
1580 void SetChallenge(std::string Challenge);
1581};
1582
1586 mutable Discord_AuthorizationCodeVerifier instance_{};
1589
1590public:
1592 Discord_AuthorizationCodeVerifier* instance() const { return &instance_; }
1595 explicit AuthorizationCodeVerifier(Discord_AuthorizationCodeVerifier instance,
1596 DiscordObjectState state);
1606 operator bool() const { return state_ != DiscordObjectState::Invalid; }
1607
1612
1614 void Drop();
1616
1621
1623 std::string Verifier() const;
1625 void SetVerifier(std::string Verifier);
1626};
1627
1631 mutable Discord_AuthorizationArgs instance_{};
1634
1635public:
1637 Discord_AuthorizationArgs* instance() const { return &instance_; }
1640 explicit AuthorizationArgs(Discord_AuthorizationArgs instance, DiscordObjectState state);
1650 operator bool() const { return state_ != DiscordObjectState::Invalid; }
1651
1656
1657 explicit AuthorizationArgs();
1658
1660 void Drop();
1662
1665 uint64_t ClientId() const;
1667 void SetClientId(uint64_t ClientId);
1668
1681 std::string Scopes() const;
1683 void SetScopes(std::string Scopes);
1684
1690 std::optional<std::string> State() const;
1692 void SetState(std::optional<std::string> State);
1693
1698 std::optional<std::string> Nonce() const;
1700 void SetNonce(std::optional<std::string> Nonce);
1701
1707 std::optional<discordpp::AuthorizationCodeChallenge> CodeChallenge() const;
1709 void SetCodeChallenge(std::optional<discordpp::AuthorizationCodeChallenge> CodeChallenge);
1710
1714 std::optional<discordpp::IntegrationType> IntegrationType() const;
1716 void SetIntegrationType(std::optional<discordpp::IntegrationType> IntegrationType);
1717
1729 std::optional<std::string> CustomSchemeParam() const;
1731 void SetCustomSchemeParam(std::optional<std::string> CustomSchemeParam);
1732};
1733
1737 mutable Discord_DeviceAuthorizationArgs instance_{};
1740
1741public:
1743 Discord_DeviceAuthorizationArgs* instance() const { return &instance_; }
1746 explicit DeviceAuthorizationArgs(Discord_DeviceAuthorizationArgs instance,
1747 DiscordObjectState state);
1757 operator bool() const { return state_ != DiscordObjectState::Invalid; }
1758
1763
1764 explicit DeviceAuthorizationArgs();
1765
1767 void Drop();
1769
1772 uint64_t ClientId() const;
1774 void SetClientId(uint64_t ClientId);
1775
1788 std::string Scopes() const;
1790 void SetScopes(std::string Scopes);
1791};
1792
1805 mutable Discord_VoiceStateHandle instance_{};
1808
1809public:
1811 Discord_VoiceStateHandle* instance() const { return &instance_; }
1814 explicit VoiceStateHandle(Discord_VoiceStateHandle instance, DiscordObjectState state);
1824 operator bool() const { return state_ != DiscordObjectState::Invalid; }
1825
1830
1832 void Drop();
1834
1837 bool SelfDeaf() const;
1838
1841 bool SelfMute() const;
1842};
1843
1847 mutable Discord_VADThresholdSettings instance_{};
1850
1851public:
1853 Discord_VADThresholdSettings* instance() const { return &instance_; }
1856 explicit VADThresholdSettings(Discord_VADThresholdSettings instance, DiscordObjectState state);
1866 operator bool() const { return state_ != DiscordObjectState::Invalid; }
1867
1870
1872 void Drop();
1874
1877 float VadThreshold() const;
1880
1883 bool Automatic() const;
1886};
1887
1889class Call {
1891 mutable Discord_Call instance_{};
1894
1895public:
1917
1919 enum class Status {
1920
1923
1926
1929
1932
1935
1938
1941 };
1942
1944 using OnVoiceStateChanged = std::function<void(uint64_t userId)>;
1945
1947 using OnParticipantChanged = std::function<void(uint64_t userId, bool added)>;
1948
1950 using OnSpeakingStatusChanged = std::function<void(uint64_t userId, bool isPlayingSound)>;
1951
1953 using OnStatusChanged = std::function<
1954 void(discordpp::Call::Status status, discordpp::Call::Error error, int32_t errorDetail)>;
1956 Discord_Call* instance() const { return &instance_; }
1959 explicit Call(Discord_Call instance, DiscordObjectState state);
1960 ~Call();
1963 Call(Call&& other) noexcept;
1965 Call& operator=(Call&& other) noexcept;
1967 static const Call nullobj;
1969 operator bool() const { return state_ != DiscordObjectState::Invalid; }
1970
1972 Call(const Call& other);
1974 Call& operator=(const Call& other);
1975
1977 void Drop();
1979
1981 static std::string ErrorToString(discordpp::Call::Error type);
1982
1986
1988 uint64_t GetChannelId() const;
1989
1991 uint64_t GetGuildId() const;
1992
1994 bool GetLocalMute(uint64_t userId);
1995
1997 std::vector<uint64_t> GetParticipants() const;
1998
2003 float GetParticipantVolume(uint64_t userId);
2004
2008
2012
2015
2018
2023
2027
2033 std::optional<discordpp::VoiceStateHandle> GetVoiceStateHandle(uint64_t userId) const;
2034
2041
2045 void SetLocalMute(uint64_t userId, bool mute);
2046
2054
2057
2062 void SetParticipantVolume(uint64_t userId, float volume);
2063
2067 void SetPTTActive(bool active);
2068
2073 void SetPTTReleaseDelay(uint32_t releaseDelayMs);
2074
2078 void SetSelfDeaf(bool deaf);
2079
2082 void SetSelfMute(bool mute);
2083
2090
2094
2101 void SetVADThreshold(bool automatic, float threshold);
2102
2104 static std::string StatusToString(discordpp::Call::Status type);
2105};
2106
2118 mutable Discord_ChannelHandle instance_{};
2121
2122public:
2124 Discord_ChannelHandle* instance() const { return &instance_; }
2127 explicit ChannelHandle(Discord_ChannelHandle instance, DiscordObjectState state);
2131 ChannelHandle(ChannelHandle&& other) noexcept;
2137 operator bool() const { return state_ != DiscordObjectState::Invalid; }
2138
2143
2145 void Drop();
2147
2149 uint64_t Id() const;
2150
2155 std::string Name() const;
2156
2159 std::vector<uint64_t> Recipients() const;
2160
2163};
2164
2169 mutable Discord_GuildMinimal instance_{};
2172
2173public:
2175 Discord_GuildMinimal* instance() const { return &instance_; }
2178 explicit GuildMinimal(Discord_GuildMinimal instance, DiscordObjectState state);
2179 ~GuildMinimal();
2182 GuildMinimal(GuildMinimal&& other) noexcept;
2186 static const GuildMinimal nullobj;
2188 operator bool() const { return state_ != DiscordObjectState::Invalid; }
2189
2194
2196 void Drop();
2198
2200 uint64_t Id() const;
2202 void SetId(uint64_t Id);
2203
2205 std::string Name() const;
2207 void SetName(std::string Name);
2208};
2209
2214 mutable Discord_GuildChannel instance_{};
2217
2218public:
2220 Discord_GuildChannel* instance() const { return &instance_; }
2223 explicit GuildChannel(Discord_GuildChannel instance, DiscordObjectState state);
2224 ~GuildChannel();
2227 GuildChannel(GuildChannel&& other) noexcept;
2231 static const GuildChannel nullobj;
2233 operator bool() const { return state_ != DiscordObjectState::Invalid; }
2234
2239
2241 void Drop();
2243
2245 uint64_t Id() const;
2247 void SetId(uint64_t Id);
2248
2250 std::string Name() const;
2252 void SetName(std::string Name);
2253
2258
2260 int32_t Position() const;
2262 void SetPosition(int32_t Position);
2263
2265 std::optional<uint64_t> ParentId() const;
2267 void SetParentId(std::optional<uint64_t> ParentId);
2268
2279 bool IsLinkable() const;
2282
2299
2302 std::optional<discordpp::LinkedLobby> LinkedLobby() const;
2304 void SetLinkedLobby(std::optional<discordpp::LinkedLobby> LinkedLobby);
2305};
2306
2310 mutable Discord_LinkedLobby instance_{};
2313
2314public:
2316 Discord_LinkedLobby* instance() const { return &instance_; }
2319 explicit LinkedLobby(Discord_LinkedLobby instance, DiscordObjectState state);
2320 ~LinkedLobby();
2323 LinkedLobby(LinkedLobby&& other) noexcept;
2327 static const LinkedLobby nullobj;
2329 operator bool() const { return state_ != DiscordObjectState::Invalid; }
2330
2335
2336 explicit LinkedLobby();
2337
2339 void Drop();
2341
2343 uint64_t ApplicationId() const;
2346
2348 uint64_t LobbyId() const;
2350 void SetLobbyId(uint64_t LobbyId);
2351};
2352
2356 mutable Discord_LinkedChannel instance_{};
2359
2360public:
2362 Discord_LinkedChannel* instance() const { return &instance_; }
2365 explicit LinkedChannel(Discord_LinkedChannel instance, DiscordObjectState state);
2369 LinkedChannel(LinkedChannel&& other) noexcept;
2375 operator bool() const { return state_ != DiscordObjectState::Invalid; }
2376
2381
2383 void Drop();
2385
2387 uint64_t Id() const;
2389 void SetId(uint64_t Id);
2390
2392 std::string Name() const;
2394 void SetName(std::string Name);
2395
2397 uint64_t GuildId() const;
2399 void SetGuildId(uint64_t GuildId);
2400};
2401
2438 mutable Discord_RelationshipHandle instance_{};
2441
2442public:
2444 Discord_RelationshipHandle* instance() const { return &instance_; }
2447 explicit RelationshipHandle(Discord_RelationshipHandle instance, DiscordObjectState state);
2457 operator bool() const { return state_ != DiscordObjectState::Invalid; }
2458
2463
2465 void Drop();
2467
2470
2473
2475 uint64_t Id() const;
2476
2478 bool IsSpamRequest() const;
2479
2482 std::optional<discordpp::UserHandle> User() const;
2483};
2484
2496 mutable Discord_UserApplicationProfileHandle instance_{};
2499
2500public:
2502 Discord_UserApplicationProfileHandle* instance() const { return &instance_; }
2505 explicit UserApplicationProfileHandle(Discord_UserApplicationProfileHandle instance,
2506 DiscordObjectState state);
2516 operator bool() const { return state_ != DiscordObjectState::Invalid; }
2517
2522
2524 void Drop();
2526
2528 std::string AvatarHash() const;
2529
2531 std::string Metadata() const;
2532
2534 std::optional<std::string> ProviderId() const;
2535
2537 std::string ProviderIssuedUserId() const;
2538
2541
2543 std::string Username() const;
2544};
2545
2558 mutable Discord_UserHandle instance_{};
2561
2562public:
2564 enum class AvatarType {
2565
2567 Gif = 0,
2568
2570 Webp = 1,
2571
2573 Png = 2,
2574
2576 Jpeg = 3,
2577 };
2578
2579 Discord_UserHandle* instance() const { return &instance_; }
2582 explicit UserHandle(Discord_UserHandle instance, DiscordObjectState state);
2583 ~UserHandle();
2586 UserHandle(UserHandle&& other) noexcept;
2588 UserHandle& operator=(UserHandle&& other) noexcept;
2590 static const UserHandle nullobj;
2592 operator bool() const { return state_ != DiscordObjectState::Invalid; }
2593
2598
2600 void Drop();
2602
2604 std::optional<std::string> Avatar() const;
2605
2608
2614 discordpp::UserHandle::AvatarType staticType) const;
2615
2618 std::string DisplayName() const;
2619
2629 std::optional<discordpp::Activity> GameActivity() const;
2630
2639 std::optional<std::string> GlobalName() const;
2640
2644 uint64_t Id() const;
2645
2647 bool IsProvisional() const;
2648
2652
2655
2659 std::vector<discordpp::UserApplicationProfileHandle> UserApplicationProfiles() const;
2660
2667 std::string Username() const;
2668};
2669
2688 mutable Discord_LobbyMemberHandle instance_{};
2691
2692public:
2694 Discord_LobbyMemberHandle* instance() const { return &instance_; }
2697 explicit LobbyMemberHandle(Discord_LobbyMemberHandle instance, DiscordObjectState state);
2707 operator bool() const { return state_ != DiscordObjectState::Invalid; }
2708
2713
2715 void Drop();
2717
2724 bool CanLinkLobby() const;
2725
2727 bool Connected() const;
2728
2730 uint64_t Id() const;
2731
2737 std::unordered_map<std::string, std::string> Metadata() const;
2738
2740 std::optional<discordpp::UserHandle> User() const;
2741};
2742
2831 mutable Discord_LobbyHandle instance_{};
2834
2835public:
2837 Discord_LobbyHandle* instance() const { return &instance_; }
2840 explicit LobbyHandle(Discord_LobbyHandle instance, DiscordObjectState state);
2841 ~LobbyHandle();
2844 LobbyHandle(LobbyHandle&& other) noexcept;
2848 static const LobbyHandle nullobj;
2850 operator bool() const { return state_ != DiscordObjectState::Invalid; }
2851
2856
2858 void Drop();
2860
2866 std::optional<discordpp::CallInfoHandle> GetCallInfoHandle() const;
2867
2870 std::optional<discordpp::LobbyMemberHandle> GetLobbyMemberHandle(uint64_t memberId) const;
2871
2873 uint64_t Id() const;
2874
2876 std::optional<discordpp::LinkedChannel> LinkedChannel() const;
2877
2879 std::vector<uint64_t> LobbyMemberIds() const;
2880
2882 std::vector<discordpp::LobbyMemberHandle> LobbyMembers() const;
2883
2888 std::unordered_map<std::string, std::string> Metadata() const;
2889};
2890
2895 mutable Discord_AdditionalContent instance_{};
2898
2899public:
2901 Discord_AdditionalContent* instance() const { return &instance_; }
2904 explicit AdditionalContent(Discord_AdditionalContent instance, DiscordObjectState state);
2914 operator bool() const { return state_ != DiscordObjectState::Invalid; }
2915
2920
2921 explicit AdditionalContent();
2922
2924 void Drop();
2926
2929
2932
2937
2940 std::optional<std::string> Title() const;
2942 void SetTitle(std::optional<std::string> Title);
2943
2946 uint8_t Count() const;
2948 void SetCount(uint8_t Count);
2949};
2950
3007 mutable Discord_MessageHandle instance_{};
3010
3011public:
3013 Discord_MessageHandle* instance() const { return &instance_; }
3016 explicit MessageHandle(Discord_MessageHandle instance, DiscordObjectState state);
3020 MessageHandle(MessageHandle&& other) noexcept;
3026 operator bool() const { return state_ != DiscordObjectState::Invalid; }
3027
3032
3034 void Drop();
3036
3039 std::optional<discordpp::AdditionalContent> AdditionalContent() const;
3040
3047 std::optional<uint64_t> ApplicationId() const;
3048
3050 std::optional<discordpp::UserHandle> Author() const;
3051
3053 uint64_t AuthorId() const;
3054
3056 std::optional<discordpp::ChannelHandle> Channel() const;
3057
3059 uint64_t ChannelId() const;
3060
3066 std::string Content() const;
3067
3070 std::optional<discordpp::DisclosureTypes> DisclosureType() const;
3071
3075 uint64_t EditedTimestamp() const;
3076
3078 uint64_t Id() const;
3079
3081 std::optional<discordpp::LobbyHandle> Lobby() const;
3082
3088 std::unordered_map<std::string, std::string> Metadata() const;
3089
3095 std::string RawContent() const;
3096
3099 std::optional<discordpp::UserHandle> Recipient() const;
3100
3103 uint64_t RecipientId() const;
3104
3108 bool SentFromGame() const;
3109
3111 uint64_t SentTimestamp() const;
3112};
3113
3120 mutable Discord_AudioDevice instance_{};
3123
3124public:
3126 Discord_AudioDevice* instance() const { return &instance_; }
3129 explicit AudioDevice(Discord_AudioDevice instance, DiscordObjectState state);
3130 ~AudioDevice();
3133 AudioDevice(AudioDevice&& other) noexcept;
3137 static const AudioDevice nullobj;
3139 operator bool() const { return state_ != DiscordObjectState::Invalid; }
3140
3145
3147 void Drop();
3149
3152
3154 std::string Id() const;
3156 void SetId(std::string Id);
3157
3159 std::string Name() const;
3161 void SetName(std::string Name);
3162
3164 bool IsDefault() const;
3167};
3168
3172 mutable Discord_UserMessageSummary instance_{};
3175
3176public:
3178 Discord_UserMessageSummary* instance() const { return &instance_; }
3181 explicit UserMessageSummary(Discord_UserMessageSummary instance, DiscordObjectState state);
3191 operator bool() const { return state_ != DiscordObjectState::Invalid; }
3192
3197
3199 void Drop();
3201
3203 uint64_t LastMessageId() const;
3204
3206 uint64_t UserId() const;
3207};
3208
3214 mutable Discord_ClientCreateOptions instance_{};
3217
3218public:
3220 Discord_ClientCreateOptions* instance() const { return &instance_; }
3223 explicit ClientCreateOptions(Discord_ClientCreateOptions instance, DiscordObjectState state);
3233 operator bool() const { return state_ != DiscordObjectState::Invalid; }
3234
3239
3240 explicit ClientCreateOptions();
3241
3243 void Drop();
3245
3247 std::string WebBase() const;
3249 void SetWebBase(std::string WebBase);
3250
3252 std::string ApiBase() const;
3254 void SetApiBase(std::string ApiBase);
3255
3267
3280
3283 std::optional<uint64_t> CpuAffinityMask() const;
3285 void SetCpuAffinityMask(std::optional<uint64_t> CpuAffinityMask);
3286};
3287
3292class Client {
3294 mutable Discord_Client instance_{};
3297
3298public:
3306 enum class Error {
3307
3309 None = 0,
3310
3313
3316
3319 };
3320
3335 enum class Status {
3336
3339
3342
3345
3348
3351
3354
3357 };
3358
3360 enum class Thread {
3361
3364
3367
3370 };
3371
3373 using EndCallCallback = std::function<void()>;
3374
3376 using EndCallsCallback = std::function<void()>;
3377
3379 using GetCurrentInputDeviceCallback = std::function<void(discordpp::AudioDevice device)>;
3380
3382 using GetCurrentOutputDeviceCallback = std::function<void(discordpp::AudioDevice device)>;
3383
3386 std::function<void(std::vector<discordpp::AudioDevice> devices)>;
3387
3390 std::function<void(std::vector<discordpp::AudioDevice> devices)>;
3391
3394 std::function<void(std::vector<discordpp::AudioDevice> inputDevices,
3395 std::vector<discordpp::AudioDevice> outputDevices)>;
3396
3398 using SetInputDeviceCallback = std::function<void(discordpp::ClientResult result)>;
3399
3401 using NoAudioInputCallback = std::function<void(bool inputDetected)>;
3402
3404 using SetOutputDeviceCallback = std::function<void(discordpp::ClientResult result)>;
3405
3408 std::function<void(uint64_t lobbyId, uint64_t memberId, bool added)>;
3409
3413 using UserAudioReceivedCallback = std::function<void(uint64_t userId,
3414 int16_t* data,
3415 uint64_t samplesPerChannel,
3416 int32_t sampleRate,
3417 uint64_t channels,
3418 bool& outShouldMute)>;
3419
3423 using UserAudioCapturedCallback = std::function<
3424 void(int16_t* data, uint64_t samplesPerChannel, int32_t sampleRate, uint64_t channels)>;
3425
3432 using AuthorizationCallback = std::function<
3433 void(discordpp::ClientResult result, std::string code, std::string redirectUri)>;
3434
3437 std::function<void(discordpp::ClientResult result,
3438 std::string accessToken,
3440 int32_t expiresIn,
3441 std::string scopes)>;
3442
3445 std::function<void(discordpp::ClientResult result, uint64_t id, std::string name)>;
3446
3448 using TokenExchangeCallback = std::function<void(discordpp::ClientResult result,
3449 std::string accessToken,
3450 std::string refreshToken,
3452 int32_t expiresIn,
3453 std::string scopes)>;
3454
3460 using AuthorizeRequestCallback = std::function<void()>;
3461
3463 using RevokeTokenCallback = std::function<void(discordpp::ClientResult result)>;
3464
3466 using AuthorizeDeviceScreenClosedCallback = std::function<void()>;
3467
3469 using TokenExpirationCallback = std::function<void()>;
3470
3473 std::function<void(discordpp::ClientResult result)>;
3474
3477 std::function<void(discordpp::ClientResult result)>;
3478
3481 using UpdateTokenCallback = std::function<void(discordpp::ClientResult result)>;
3482
3484 using DeleteUserMessageCallback = std::function<void(discordpp::ClientResult result)>;
3485
3487 using EditUserMessageCallback = std::function<void(discordpp::ClientResult result)>;
3488
3491 std::function<void(discordpp::ClientResult result,
3492 std::vector<discordpp::MessageHandle> messages)>;
3493
3496 std::function<void(discordpp::ClientResult result,
3497 std::vector<discordpp::UserMessageSummary> summaries)>;
3498
3501 std::function<void(discordpp::ClientResult result,
3502 std::vector<discordpp::MessageHandle> messages)>;
3503
3505 using ProvisionalUserMergeRequiredCallback = std::function<void()>;
3506
3508 using OpenMessageInDiscordCallback = std::function<void(discordpp::ClientResult result)>;
3509
3514 std::function<void(discordpp::ClientResult result, uint64_t messageId)>;
3515
3517 using MessageCreatedCallback = std::function<void(uint64_t messageId)>;
3518
3520 using MessageDeletedCallback = std::function<void(uint64_t messageId, uint64_t channelId)>;
3521
3523 using MessageUpdatedCallback = std::function<void(uint64_t messageId)>;
3524
3527 std::function<void(std::string message, discordpp::LoggingSeverity severity)>;
3528
3531 std::function<void(discordpp::ClientResult result)>;
3532
3537 using OnStatusChanged = std::function<
3538 void(discordpp::Client::Status status, discordpp::Client::Error error, int32_t errorDetail)>;
3539
3542 std::function<void(discordpp::ClientResult result, uint64_t lobbyId)>;
3543
3546 std::function<void(discordpp::ClientResult result,
3547 std::vector<discordpp::GuildChannel> guildChannels)>;
3548
3550 using GetUserGuildsCallback = std::function<void(discordpp::ClientResult result,
3551 std::vector<discordpp::GuildMinimal> guilds)>;
3552
3555 std::function<void(discordpp::ClientResult result, std::string inviteUrl)>;
3556
3558 using LeaveLobbyCallback = std::function<void(discordpp::ClientResult result)>;
3559
3561 using LinkOrUnlinkChannelCallback = std::function<void(discordpp::ClientResult result)>;
3562
3564 using LobbyCreatedCallback = std::function<void(uint64_t lobbyId)>;
3565
3567 using LobbyDeletedCallback = std::function<void(uint64_t lobbyId)>;
3568
3570 using LobbyMemberAddedCallback = std::function<void(uint64_t lobbyId, uint64_t memberId)>;
3571
3573 using LobbyMemberRemovedCallback = std::function<void(uint64_t lobbyId, uint64_t memberId)>;
3574
3576 using LobbyMemberUpdatedCallback = std::function<void(uint64_t lobbyId, uint64_t memberId)>;
3577
3579 using LobbyUpdatedCallback = std::function<void(uint64_t lobbyId)>;
3580
3583 std::function<void(discordpp::ClientResult result, std::string joinSecret)>;
3584
3587 using SendActivityInviteCallback = std::function<void(discordpp::ClientResult result)>;
3588
3591 using ActivityInviteCallback = std::function<void(discordpp::ActivityInvite invite)>;
3592
3594 using ActivityJoinCallback = std::function<void(std::string joinSecret)>;
3595
3598 std::function<void(uint64_t applicationId, std::string joinSecret)>;
3599
3601 using UpdateStatusCallback = std::function<void(discordpp::ClientResult result)>;
3602
3604 using UpdateRichPresenceCallback = std::function<void(discordpp::ClientResult result)>;
3605
3608 using UpdateRelationshipCallback = std::function<void(discordpp::ClientResult result)>;
3609
3612 using SendFriendRequestCallback = std::function<void(discordpp::ClientResult result)>;
3613
3619 std::function<void(uint64_t userId, bool isDiscordRelationshipUpdate)>;
3620
3626 std::function<void(uint64_t userId, bool isDiscordRelationshipUpdate)>;
3627
3630 std::function<void(discordpp::ClientResult result,
3631 std::optional<discordpp::UserHandle> user)>;
3632
3634 using RelationshipGroupsUpdatedCallback = std::function<void(uint64_t userId)>;
3635
3637 using UserUpdatedCallback = std::function<void(uint64_t userId)>;
3639 Discord_Client* instance() const { return &instance_; }
3642 explicit Client(Discord_Client instance, DiscordObjectState state);
3643 ~Client();
3646 Client(Client&& other) noexcept;
3648 Client& operator=(Client&& other) noexcept;
3650 static const Client nullobj;
3652 operator bool() const { return state_ != DiscordObjectState::Invalid; }
3653
3654 Client(const Client&) = delete;
3655 Client& operator=(const Client&) = delete;
3656
3658 explicit Client();
3659
3661 explicit Client(std::string apiBase, std::string webBase);
3662
3665
3667 void Drop();
3669
3671 static std::string ErrorToString(discordpp::Client::Error type);
3672
3678
3682 [[deprecated("Please use GetCurrentUserV2 instead. This will be removed in a future version.")]]
3684
3687 static std::string GetDefaultAudioDeviceId();
3688
3703 static std::string GetDefaultCommunicationScopes();
3704
3715 static std::string GetDefaultPresenceScopes();
3716
3718 static std::string GetVersionHash();
3719
3721 static int32_t GetVersionMajor();
3722
3724 static int32_t GetVersionMinor();
3725
3727 static int32_t GetVersionPatch();
3728
3730 void SetHttpRequestTimeout(int32_t httpTimeoutInMilliseconds);
3731
3734
3737
3740
3743 void EndCall(uint64_t channelId, discordpp::Client::EndCallCallback callback);
3744
3748
3750 discordpp::Call GetCall(uint64_t channelId);
3751
3753 std::vector<discordpp::Call> GetCalls();
3754
3757
3760
3763
3769
3772
3778
3780 bool GetSelfDeafAll() const;
3781
3783 bool GetSelfMuteAll() const;
3784
3789 void SetAecDump(bool on);
3790
3799
3803
3810 void SetEchoCancellation(bool on);
3811
3822 void SetEngineManagedAudioSession(bool isEngineManaged);
3823
3828
3833 void SetInputVolume(float inputVolume);
3834
3838
3847 void SetNoAudioInputThreshold(float dBFSThreshold);
3848
3855 void SetNoiseSuppression(bool on);
3856
3863 void SetOpusHardwareCoding(bool encode, bool decode);
3864
3869
3874 void SetOutputVolume(float outputVolume);
3875
3880 void SetSelfDeafAll(bool deaf);
3881
3884 void SetSelfMuteAll(bool mute);
3885
3889 [[deprecated("Calling Client::SetSpeakerMode is DEPRECATED.")]]
3890 bool SetSpeakerMode(bool speakerMode);
3891
3898 void SetThreadPriority(discordpp::Client::Thread thread, int32_t priority);
3899
3906
3909
3920 discordpp::Call StartCall(uint64_t channelId);
3921
3941 uint64_t lobbyId,
3945
3948
3954
3957
4053
4060
4066
4082 void ExchangeChildToken(std::string const& parentApplicationToken,
4083 uint64_t childApplicationId,
4085
4092 std::string const& token,
4094
4128 void GetProvisionalToken(uint64_t applicationId,
4130 std::string const& externalAuthToken,
4132
4156 void GetToken(uint64_t applicationId,
4157 std::string const& code,
4158 std::string const& codeVerifier,
4159 std::string const& redirectUri,
4161
4189
4229 std::string const& externalAuthToken,
4231
4262 void GetTokenFromProvisionalMerge(uint64_t applicationId,
4263 std::string const& code,
4264 std::string const& codeVerifier,
4265 std::string const& redirectUri,
4267 std::string const& externalAuthToken,
4269
4273
4278 void OpenAuthorizeDeviceScreen(uint64_t clientId, std::string const& userCode);
4279
4287
4302 void RefreshToken(uint64_t applicationId,
4303 std::string const& refreshToken,
4305
4316
4323
4336 void RevokeToken(uint64_t applicationId,
4337 std::string const& token,
4339
4344
4350 void SetGameWindowPid(int32_t pid);
4351
4365
4383 uint64_t applicationId,
4385 std::string const& externalAuthToken,
4387
4394 std::string const& name,
4396
4404 std::string token,
4407
4410
4416 bool CanOpenMessageInDiscord(uint64_t messageId);
4417
4419 void DeleteUserMessage(uint64_t recipientId,
4420 uint64_t messageId,
4422
4426 void EditUserMessage(uint64_t recipientId,
4427 uint64_t messageId,
4428 std::string const& content,
4430
4437 std::optional<discordpp::ChannelHandle> GetChannelHandle(uint64_t channelId) const;
4438
4450 void GetLobbyMessagesWithLimit(uint64_t lobbyId,
4451 int32_t limit,
4453
4458 std::optional<discordpp::MessageHandle> GetMessageHandle(uint64_t messageId) const;
4459
4467
4479 void GetUserMessagesWithLimit(uint64_t recipientId,
4480 int32_t limit,
4482
4489 uint64_t messageId,
4490 discordpp::Client::ProvisionalUserMergeRequiredCallback provisionalUserMergeRequiredCallback,
4492
4503 void SendLobbyMessage(uint64_t lobbyId,
4504 std::string const& content,
4506
4513 void SendLobbyMessageWithMetadata(uint64_t lobbyId,
4514 std::string const& content,
4515 std::unordered_map<std::string, std::string> const& metadata,
4517
4530 void SendUserMessage(uint64_t recipientId,
4531 std::string const& content,
4533
4540 void SendUserMessageWithMetadata(uint64_t recipientId,
4541 std::string const& content,
4542 std::unordered_map<std::string, std::string> const& metadata,
4544
4557
4565
4573
4584 void SetShowingChat(bool showingChat);
4586
4589
4600 discordpp::LoggingSeverity minSeverity);
4601
4608 discordpp::LoggingSeverity minSeverity);
4609
4616 void Connect();
4617
4624
4628
4638
4643 void SetApplicationId(uint64_t applicationId);
4644
4659 bool SetLogDir(std::string const& path, discordpp::LoggingSeverity minSeverity);
4660
4663
4676 void SetVoiceLogDir(std::string const& path, discordpp::LoggingSeverity minSeverity);
4678
4681
4699 void CreateOrJoinLobby(std::string const& secret,
4701
4709 std::string const& secret,
4710 std::unordered_map<std::string, std::string> const& lobbyMetadata,
4711 std::unordered_map<std::string, std::string> const& memberMetadata,
4713
4722
4724 std::optional<discordpp::LobbyHandle> GetLobbyHandle(uint64_t lobbyId) const;
4725
4731 std::vector<uint64_t> GetLobbyIds() const;
4732
4740
4748 uint64_t lobbyId,
4749 discordpp::Client::ProvisionalUserMergeRequiredCallback provisionalUserMergeRequiredCallback,
4751
4758 void LeaveLobby(uint64_t lobbyId, discordpp::Client::LeaveLobbyCallback callback);
4759
4764 void LinkChannelToLobby(uint64_t lobbyId,
4765 uint64_t channelId,
4767
4780
4791
4800
4809
4816
4820
4826 void UnlinkChannelFromLobby(uint64_t lobbyId,
4829
4832
4840
4843
4863 bool RegisterLaunchCommand(uint64_t applicationId, std::string command);
4864
4871 bool RegisterLaunchSteamApplication(uint64_t applicationId, uint32_t steamAppId);
4872
4883 void SendActivityInvite(uint64_t userId,
4884 std::string const& content,
4886
4894
4900
4910
4917
4925
4934
4938
4958
4961
4967 void AcceptDiscordFriendRequest(uint64_t userId,
4969
4975
4983
4989 void CancelDiscordFriendRequest(uint64_t userId,
4991
4997
5001
5004 std::vector<discordpp::RelationshipHandle> GetRelationships() const;
5005
5013 std::vector<discordpp::RelationshipHandle> GetRelationshipsByGroup(
5014 discordpp::RelationshipGroupType groupType) const;
5015
5021 void RejectDiscordFriendRequest(uint64_t userId,
5023
5029
5034 void RemoveDiscordAndGameFriend(uint64_t userId,
5036
5041
5046 std::vector<discordpp::UserHandle> SearchFriendsByUsername(std::string searchStr) const;
5047
5063 void SendDiscordFriendRequest(std::string const& username,
5065
5081 void SendDiscordFriendRequestById(uint64_t userId,
5083
5099 void SendGameFriendRequest(std::string const& username,
5101
5117 void SendGameFriendRequestById(uint64_t userId,
5119
5126
5133
5140
5143
5147 std::optional<discordpp::UserHandle> GetCurrentUserV2() const;
5148
5153 uint64_t applicationId,
5155
5161 std::optional<discordpp::UserHandle> GetUser(uint64_t userId) const;
5162
5169
5176};
5177
5181 mutable Discord_CallInfoHandle instance_{};
5184
5185public:
5187 Discord_CallInfoHandle* instance() const { return &instance_; }
5190 explicit CallInfoHandle(Discord_CallInfoHandle instance, DiscordObjectState state);
5200 operator bool() const { return state_ != DiscordObjectState::Invalid; }
5201
5206
5208 void Drop();
5210
5212 uint64_t ChannelId() const;
5213
5215 std::vector<uint64_t> GetParticipants() const;
5216
5219 std::optional<discordpp::VoiceStateHandle> GetVoiceStateHandle(uint64_t userId) const;
5220
5222 uint64_t GuildId() const;
5223};
5224
5226{
5227 switch (value) {
5229 return "Invalid";
5231 return "Join";
5233 return "JoinRequest";
5234 default:
5235 return "unknown";
5236 }
5237}
5238
5240{
5241 switch (value) {
5243 return "Private";
5245 return "Public";
5246 default:
5247 return "unknown";
5248 }
5249}
5250
5252{
5253 switch (value) {
5255 return "Playing";
5257 return "Streaming";
5259 return "Listening";
5261 return "Watching";
5263 return "CustomStatus";
5265 return "Competing";
5267 return "HangStatus";
5268 default:
5269 return "unknown";
5270 }
5271}
5272
5274{
5275 switch (value) {
5277 return "Name";
5279 return "State";
5281 return "Details";
5282 default:
5283 return "unknown";
5284 }
5285}
5286
5288{
5289 switch (value) {
5291 return "Desktop";
5293 return "Xbox";
5295 return "Samsung";
5297 return "IOS";
5299 return "Android";
5301 return "Embedded";
5303 return "PS4";
5305 return "PS5";
5306 default:
5307 return "unknown";
5308 }
5309}
5310
5311inline const char* EnumToString(discordpp::ErrorType value)
5312{
5313 switch (value) {
5315 return "None";
5317 return "NetworkError";
5319 return "HTTPError";
5321 return "ClientNotReady";
5323 return "Disabled";
5325 return "ClientDestroyed";
5327 return "ValidationError";
5329 return "Aborted";
5331 return "AuthorizationFailed";
5333 return "RPCError";
5334 default:
5335 return "unknown";
5336 }
5337}
5338
5340{
5341 switch (value) {
5343 return "None";
5345 return "Continue";
5347 return "SwitchingProtocols";
5349 return "Processing";
5351 return "EarlyHints";
5353 return "Ok";
5355 return "Created";
5357 return "Accepted";
5359 return "NonAuthoritativeInfo";
5361 return "NoContent";
5363 return "ResetContent";
5365 return "PartialContent";
5367 return "MultiStatus";
5369 return "AlreadyReported";
5371 return "ImUsed";
5373 return "MultipleChoices";
5375 return "MovedPermanently";
5377 return "Found";
5379 return "SeeOther";
5381 return "NotModified";
5383 return "TemporaryRedirect";
5385 return "PermanentRedirect";
5387 return "BadRequest";
5389 return "Unauthorized";
5391 return "PaymentRequired";
5393 return "Forbidden";
5395 return "NotFound";
5397 return "MethodNotAllowed";
5399 return "NotAcceptable";
5401 return "ProxyAuthRequired";
5403 return "RequestTimeout";
5405 return "Conflict";
5407 return "Gone";
5409 return "LengthRequired";
5411 return "PreconditionFailed";
5413 return "PayloadTooLarge";
5415 return "UriTooLong";
5417 return "UnsupportedMediaType";
5419 return "RangeNotSatisfiable";
5421 return "ExpectationFailed";
5423 return "MisdirectedRequest";
5425 return "UnprocessableEntity";
5427 return "Locked";
5429 return "FailedDependency";
5431 return "TooEarly";
5433 return "UpgradeRequired";
5435 return "PreconditionRequired";
5437 return "TooManyRequests";
5439 return "RequestHeaderFieldsTooLarge";
5441 return "InternalServerError";
5443 return "NotImplemented";
5445 return "BadGateway";
5447 return "ServiceUnavailable";
5449 return "GatewayTimeout";
5451 return "HttpVersionNotSupported";
5453 return "VariantAlsoNegotiates";
5455 return "InsufficientStorage";
5457 return "LoopDetected";
5459 return "NotExtended";
5461 return "NetworkAuthorizationRequired";
5462 default:
5463 return "unknown";
5464 }
5465}
5466
5468{
5469 switch (value) {
5471 return "S256";
5472 default:
5473 return "unknown";
5474 }
5475}
5476
5478{
5479 switch (value) {
5481 return "GuildInstall";
5483 return "UserInstall";
5484 default:
5485 return "unknown";
5486 }
5487}
5488
5489inline const char* EnumToString(discordpp::ChannelType value)
5490{
5491 switch (value) {
5493 return "GuildText";
5495 return "Dm";
5497 return "GuildVoice";
5499 return "GroupDm";
5501 return "GuildCategory";
5503 return "GuildNews";
5505 return "GuildStore";
5507 return "GuildNewsThread";
5509 return "GuildPublicThread";
5511 return "GuildPrivateThread";
5513 return "GuildStageVoice";
5515 return "GuildDirectory";
5517 return "GuildForum";
5519 return "GuildMedia";
5521 return "Lobby";
5523 return "EphemeralDm";
5524 default:
5525 return "unknown";
5526 }
5527}
5528
5530{
5531 switch (value) {
5533 return "Other";
5535 return "Attachment";
5537 return "Poll";
5539 return "VoiceMessage";
5541 return "Thread";
5543 return "Embed";
5545 return "Sticker";
5546 default:
5547 return "unknown";
5548 }
5549}
5550
5551inline const char* EnumToString(discordpp::AudioSystem value)
5552{
5553 switch (value) {
5555 return "Standard";
5557 return "Game";
5558 default:
5559 return "unknown";
5560 }
5561}
5562
5563inline const char* EnumToString(discordpp::Call::Error value)
5564{
5565 switch (value) {
5567 return "None";
5569 return "SignalingConnectionFailed";
5571 return "SignalingUnexpectedClose";
5573 return "VoiceConnectionFailed";
5575 return "JoinTimeout";
5577 return "Forbidden";
5578 default:
5579 return "unknown";
5580 }
5581}
5582
5584{
5585 switch (value) {
5587 return "MODE_UNINIT";
5589 return "MODE_VAD";
5591 return "MODE_PTT";
5592 default:
5593 return "unknown";
5594 }
5595}
5596
5597inline const char* EnumToString(discordpp::Call::Status value)
5598{
5599 switch (value) {
5601 return "Disconnected";
5603 return "Joining";
5605 return "Connecting";
5607 return "SignalingConnected";
5609 return "Connected";
5611 return "Reconnecting";
5613 return "Disconnecting";
5614 default:
5615 return "unknown";
5616 }
5617}
5618
5620{
5621 switch (value) {
5623 return "None";
5625 return "Friend";
5627 return "Blocked";
5629 return "PendingIncoming";
5631 return "PendingOutgoing";
5633 return "Implicit";
5635 return "Suggestion";
5636 default:
5637 return "unknown";
5638 }
5639}
5640
5642{
5643 switch (value) {
5645 return "OIDC";
5647 return "EpicOnlineServices";
5649 return "Steam";
5651 return "Unity";
5653 return "DiscordBot";
5655 return "None";
5657 return "Unknown";
5658 default:
5659 return "unknown";
5660 }
5661}
5662
5664{
5665 switch (value) {
5667 return "Gif";
5669 return "Webp";
5671 return "Png";
5673 return "Jpeg";
5674 default:
5675 return "unknown";
5676 }
5677}
5678
5679inline const char* EnumToString(discordpp::StatusType value)
5680{
5681 switch (value) {
5683 return "Online";
5685 return "Offline";
5687 return "Blocked";
5689 return "Idle";
5691 return "Dnd";
5693 return "Invisible";
5695 return "Streaming";
5697 return "Unknown";
5698 default:
5699 return "unknown";
5700 }
5701}
5702
5704{
5705 switch (value) {
5707 return "MessageDataVisibleOnDiscord";
5708 default:
5709 return "unknown";
5710 }
5711}
5712
5714{
5715 switch (value) {
5717 return "None";
5719 return "ConnectionFailed";
5721 return "UnexpectedClose";
5723 return "ConnectionCanceled";
5724 default:
5725 return "unknown";
5726 }
5727}
5728
5730{
5731 switch (value) {
5733 return "Disconnected";
5735 return "Connecting";
5737 return "Connected";
5739 return "Ready";
5741 return "Reconnecting";
5743 return "Disconnecting";
5745 return "HttpWait";
5746 default:
5747 return "unknown";
5748 }
5749}
5750
5752{
5753 switch (value) {
5755 return "Client";
5757 return "Voice";
5759 return "Network";
5760 default:
5761 return "unknown";
5762 }
5763}
5764
5766{
5767 switch (value) {
5769 return "User";
5771 return "Bearer";
5772 default:
5773 return "unknown";
5774 }
5775}
5776
5778{
5779 switch (value) {
5781 return "OIDC";
5783 return "EpicOnlineServicesAccessToken";
5785 return "EpicOnlineServicesIdToken";
5787 return "SteamSessionTicket";
5789 return "UnityServicesIdToken";
5791 return "DiscordBotIssuedAccessToken";
5793 return "AppleIdToken";
5795 return "PlayStationNetworkIdToken";
5796 default:
5797 return "unknown";
5798 }
5799}
5800
5802{
5803 switch (value) {
5805 return "Verbose";
5807 return "Info";
5809 return "Warning";
5811 return "Error";
5813 return "None";
5814 default:
5815 return "unknown";
5816 }
5817}
5818
5820{
5821 switch (value) {
5823 return "OnlinePlayingGame";
5825 return "OnlineElsewhere";
5827 return "Offline";
5828 default:
5829 return "unknown";
5830 }
5831}
5832} // namespace discordpp
5833#endif // DISCORD_HEADER_DISCORDPP_H_
5834#ifdef DISCORDPP_IMPLEMENTATION
5835#undef DISCORDPP_IMPLEMENTATION
5836#ifdef __clang__
5837#pragma clang diagnostic push
5838#pragma clang diagnostic ignored "-Wunused-parameter"
5839#endif
5840namespace discordpp {
5841std::function<void(std::function<void()>)> s_synchronizationContext;
5842
5843inline bool HasSynchronizationContext()
5844{
5845 return !!s_synchronizationContext;
5846}
5847
5848inline void PostTask(std::function<void()> task)
5849{
5850 assert(s_synchronizationContext);
5851 s_synchronizationContext(std::move(task));
5852}
5853
5854void SetSynchronizationContext(std::function<void(std::function<void()>)> executor)
5855{
5856 s_synchronizationContext = std::move(executor);
5857}
5858
5859template <typename T>
5860struct TDelegateUserData {
5861 T delegate;
5862 TDelegateUserData(T delegate)
5863 : delegate{delegate}
5864 {
5865 }
5866
5867 static void Free(void* ptr) { delete reinterpret_cast<TDelegateUserData*>(ptr); }
5868
5869 static T& Get(void* userData)
5870 {
5871 return reinterpret_cast<TDelegateUserData*>(userData)->delegate;
5872 }
5873};
5874
5875struct ConvertedProperties {
5876 ConvertedProperties(std::unordered_map<std::string, std::string> const& PropertyMap)
5877 {
5878 Properties.size = PropertyMap.size();
5879 Properties.keys = reinterpret_cast<Discord_String*>(
5880 Discord_Alloc(Properties.size * sizeof(Discord_String)));
5881 Properties.values = reinterpret_cast<Discord_String*>(
5882 Discord_Alloc(Properties.size * sizeof(Discord_String)));
5883 size_t i = 0;
5884 for (auto& pair : PropertyMap) {
5885 Properties.keys[i] = AllocateString(pair.first);
5886 Properties.values[i] = AllocateString(pair.second);
5887 ++i;
5888 }
5889 }
5890 ~ConvertedProperties() { Discord_FreeProperties(Properties); }
5891 Discord_Properties Properties{};
5892
5893private:
5894 Discord_String AllocateString(std::string const& str)
5895 {
5896 Discord_String result;
5897 result.ptr = reinterpret_cast<uint8_t*>(Discord_Alloc(str.size()));
5898 result.size = str.size();
5899 std::memcpy(result.ptr, str.data(), result.size);
5900 return result;
5901 }
5902};
5903
5904std::unordered_map<std::string, std::string> ConvertReturnedProperties(
5905 Discord_Properties const& Properties)
5906{
5907 std::unordered_map<std::string, std::string> result;
5908 for (size_t i = 0; i < Properties.size; ++i) {
5909 std::string key(reinterpret_cast<char*>(Properties.keys[i].ptr), Properties.keys[i].size);
5910 std::string value(reinterpret_cast<char*>(Properties.values[i].ptr),
5911 Properties.values[i].size);
5912 result.emplace(std::move(key), std::move(value));
5913 }
5914 return result;
5915}
5917ActivityInvite::~ActivityInvite()
5918{
5919 if (state_ == DiscordObjectState::Owned) {
5920 Drop();
5922 }
5923}
5925 : instance_(other.instance_)
5926 , state_(other.state_)
5927{
5928 other.state_ = DiscordObjectState::Invalid;
5929}
5931{
5932 if (this != &other) {
5933 if (state_ == DiscordObjectState::Owned) {
5934 Drop();
5935 }
5936 instance_ = other.instance_;
5937 state_ = other.state_;
5938 other.state_ = DiscordObjectState::Invalid;
5939 }
5940 return *this;
5941}
5943 : instance_{}
5944 , state_(DiscordObjectState::Invalid)
5945{
5946 if (rhs.state_ == DiscordObjectState::Owned) {
5947 Discord_ActivityInvite_Clone(&instance_, rhs.instance());
5948
5949 state_ = DiscordObjectState::Owned;
5950 }
5951}
5952ActivityInvite& ActivityInvite::operator=(const ActivityInvite& rhs)
5953{
5954 if (this != &rhs) {
5955 if (state_ == DiscordObjectState::Owned) {
5956 Drop();
5957 state_ = DiscordObjectState::Invalid;
5958 }
5959 if (rhs.state_ == DiscordObjectState::Owned) {
5960 Discord_ActivityInvite_Clone(&instance_, rhs.instance());
5961
5962 state_ = DiscordObjectState::Owned;
5963 }
5964 }
5965 return *this;
5966}
5967ActivityInvite::ActivityInvite(Discord_ActivityInvite instance, DiscordObjectState state)
5968 : instance_(instance)
5969 , state_(state)
5970{
5971}
5972ActivityInvite::ActivityInvite()
5973{
5974 assert(state_ == DiscordObjectState::Invalid);
5975 Discord_ActivityInvite_Init(&instance_);
5976 state_ = DiscordObjectState::Owned;
5977}
5978void ActivityInvite::Drop()
5979{
5980 if (state_ != DiscordObjectState::Owned) {
5981 return;
5982 }
5983 Discord_ActivityInvite_Drop(&instance_);
5984 state_ = DiscordObjectState::Invalid;
5985}
5986uint64_t ActivityInvite::SenderId() const
5987{
5988 assert(state_ == DiscordObjectState::Owned);
5989 uint64_t returnValue__;
5990 returnValue__ = Discord_ActivityInvite_SenderId(&instance_);
5991 return returnValue__;
5992}
5993void ActivityInvite::SetSenderId(uint64_t SenderId)
5994{
5995 assert(state_ == DiscordObjectState::Owned);
5996 Discord_ActivityInvite_SetSenderId(&instance_, SenderId);
5997}
5998uint64_t ActivityInvite::ChannelId() const
5999{
6000 assert(state_ == DiscordObjectState::Owned);
6001 uint64_t returnValue__;
6002 returnValue__ = Discord_ActivityInvite_ChannelId(&instance_);
6003 return returnValue__;
6004}
6005void ActivityInvite::SetChannelId(uint64_t ChannelId)
6006{
6007 assert(state_ == DiscordObjectState::Owned);
6008 Discord_ActivityInvite_SetChannelId(&instance_, ChannelId);
6009}
6010uint64_t ActivityInvite::MessageId() const
6011{
6012 assert(state_ == DiscordObjectState::Owned);
6013 uint64_t returnValue__;
6014 returnValue__ = Discord_ActivityInvite_MessageId(&instance_);
6015 return returnValue__;
6016}
6017void ActivityInvite::SetMessageId(uint64_t MessageId)
6018{
6019 assert(state_ == DiscordObjectState::Owned);
6020 Discord_ActivityInvite_SetMessageId(&instance_, MessageId);
6021}
6022discordpp::ActivityActionTypes ActivityInvite::Type() const
6023{
6024 assert(state_ == DiscordObjectState::Owned);
6025 Discord_ActivityActionTypes returnValue__;
6026 returnValue__ = Discord_ActivityInvite_Type(&instance_);
6027 return static_cast<discordpp::ActivityActionTypes>(returnValue__);
6028}
6029void ActivityInvite::SetType(discordpp::ActivityActionTypes Type)
6030{
6031 assert(state_ == DiscordObjectState::Owned);
6032 Discord_ActivityInvite_SetType(&instance_, static_cast<Discord_ActivityActionTypes>(Type));
6033}
6034uint64_t ActivityInvite::ApplicationId() const
6035{
6036 assert(state_ == DiscordObjectState::Owned);
6037 uint64_t returnValue__;
6038 returnValue__ = Discord_ActivityInvite_ApplicationId(&instance_);
6039 return returnValue__;
6040}
6041void ActivityInvite::SetApplicationId(uint64_t ApplicationId)
6042{
6043 assert(state_ == DiscordObjectState::Owned);
6044 Discord_ActivityInvite_SetApplicationId(&instance_, ApplicationId);
6045}
6046uint64_t ActivityInvite::ParentApplicationId() const
6047{
6048 assert(state_ == DiscordObjectState::Owned);
6049 uint64_t returnValue__;
6050 returnValue__ = Discord_ActivityInvite_ParentApplicationId(&instance_);
6051 return returnValue__;
6052}
6053void ActivityInvite::SetParentApplicationId(uint64_t ParentApplicationId)
6054{
6055 assert(state_ == DiscordObjectState::Owned);
6056 Discord_ActivityInvite_SetParentApplicationId(&instance_, ParentApplicationId);
6057}
6058std::string ActivityInvite::PartyId() const
6059{
6060 assert(state_ == DiscordObjectState::Owned);
6061 Discord_String returnValueNative__;
6062 Discord_ActivityInvite_PartyId(&instance_, &returnValueNative__);
6063 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
6064 returnValueNative__.size);
6065 Discord_Free(returnValueNative__.ptr);
6066 return returnValue__;
6067}
6068void ActivityInvite::SetPartyId(std::string PartyId)
6069{
6070 assert(state_ == DiscordObjectState::Owned);
6071 Discord_String PartyId__str{(uint8_t*)(PartyId.data()), PartyId.size()};
6072 Discord_ActivityInvite_SetPartyId(&instance_, PartyId__str);
6073}
6074std::string ActivityInvite::SessionId() const
6075{
6076 assert(state_ == DiscordObjectState::Owned);
6077 Discord_String returnValueNative__;
6078 Discord_ActivityInvite_SessionId(&instance_, &returnValueNative__);
6079 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
6080 returnValueNative__.size);
6081 Discord_Free(returnValueNative__.ptr);
6082 return returnValue__;
6083}
6084void ActivityInvite::SetSessionId(std::string SessionId)
6085{
6086 assert(state_ == DiscordObjectState::Owned);
6087 Discord_String SessionId__str{(uint8_t*)(SessionId.data()), SessionId.size()};
6088 Discord_ActivityInvite_SetSessionId(&instance_, SessionId__str);
6089}
6090bool ActivityInvite::IsValid() const
6091{
6092 assert(state_ == DiscordObjectState::Owned);
6093 bool returnValue__;
6094 returnValue__ = Discord_ActivityInvite_IsValid(&instance_);
6095 return returnValue__;
6096}
6097void ActivityInvite::SetIsValid(bool IsValid)
6098{
6099 assert(state_ == DiscordObjectState::Owned);
6100 Discord_ActivityInvite_SetIsValid(&instance_, IsValid);
6101}
6102const ActivityAssets ActivityAssets::nullobj{{}, DiscordObjectState::Invalid};
6103ActivityAssets::~ActivityAssets()
6104{
6105 if (state_ == DiscordObjectState::Owned) {
6106 Drop();
6107 state_ = DiscordObjectState::Invalid;
6108 }
6109}
6110ActivityAssets::ActivityAssets(ActivityAssets&& other) noexcept
6111 : instance_(other.instance_)
6112 , state_(other.state_)
6113{
6114 other.state_ = DiscordObjectState::Invalid;
6115}
6116ActivityAssets& ActivityAssets::operator=(ActivityAssets&& other) noexcept
6117{
6118 if (this != &other) {
6119 if (state_ == DiscordObjectState::Owned) {
6120 Drop();
6121 }
6122 instance_ = other.instance_;
6123 state_ = other.state_;
6124 other.state_ = DiscordObjectState::Invalid;
6125 }
6126 return *this;
6127}
6128ActivityAssets::ActivityAssets(const ActivityAssets& arg0)
6129 : instance_{}
6130 , state_(DiscordObjectState::Invalid)
6131{
6132 if (arg0.state_ == DiscordObjectState::Owned) {
6133 Discord_ActivityAssets_Clone(&instance_, arg0.instance());
6134
6135 state_ = DiscordObjectState::Owned;
6136 }
6137}
6138ActivityAssets& ActivityAssets::operator=(const ActivityAssets& arg0)
6139{
6140 if (this != &arg0) {
6141 if (state_ == DiscordObjectState::Owned) {
6142 Drop();
6143 state_ = DiscordObjectState::Invalid;
6144 }
6145 if (arg0.state_ == DiscordObjectState::Owned) {
6146 Discord_ActivityAssets_Clone(&instance_, arg0.instance());
6147
6148 state_ = DiscordObjectState::Owned;
6149 }
6150 }
6151 return *this;
6152}
6153ActivityAssets::ActivityAssets(Discord_ActivityAssets instance, DiscordObjectState state)
6154 : instance_(instance)
6155 , state_(state)
6156{
6157}
6158ActivityAssets::ActivityAssets()
6159{
6160 assert(state_ == DiscordObjectState::Invalid);
6161 Discord_ActivityAssets_Init(&instance_);
6162 state_ = DiscordObjectState::Owned;
6163}
6164void ActivityAssets::Drop()
6165{
6166 if (state_ != DiscordObjectState::Owned) {
6167 return;
6168 }
6169 Discord_ActivityAssets_Drop(&instance_);
6170 state_ = DiscordObjectState::Invalid;
6171}
6172std::optional<std::string> ActivityAssets::LargeImage() const
6173{
6174 assert(state_ == DiscordObjectState::Owned);
6175 bool returnIsNonNull__;
6176 Discord_String returnValueNative__;
6177 returnIsNonNull__ = Discord_ActivityAssets_LargeImage(&instance_, &returnValueNative__);
6178 if (!returnIsNonNull__) {
6179 return {};
6180 }
6181 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
6182 returnValueNative__.size);
6183 Discord_Free(returnValueNative__.ptr);
6184 return returnValue__;
6185}
6186void ActivityAssets::SetLargeImage(std::optional<std::string> LargeImage)
6187{
6188 assert(state_ == DiscordObjectState::Owned);
6189 Discord_String LargeImage__str{};
6190 if (LargeImage.has_value()) {
6191 LargeImage__str.ptr = reinterpret_cast<uint8_t*>(LargeImage->data());
6192 LargeImage__str.size = LargeImage->size();
6193 }
6194 Discord_ActivityAssets_SetLargeImage(&instance_,
6195 (LargeImage.has_value() ? &LargeImage__str : nullptr));
6196}
6197std::optional<std::string> ActivityAssets::LargeText() const
6198{
6199 assert(state_ == DiscordObjectState::Owned);
6200 bool returnIsNonNull__;
6201 Discord_String returnValueNative__;
6202 returnIsNonNull__ = Discord_ActivityAssets_LargeText(&instance_, &returnValueNative__);
6203 if (!returnIsNonNull__) {
6204 return {};
6205 }
6206 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
6207 returnValueNative__.size);
6208 Discord_Free(returnValueNative__.ptr);
6209 return returnValue__;
6210}
6211void ActivityAssets::SetLargeText(std::optional<std::string> LargeText)
6212{
6213 assert(state_ == DiscordObjectState::Owned);
6214 Discord_String LargeText__str{};
6215 if (LargeText.has_value()) {
6216 LargeText__str.ptr = reinterpret_cast<uint8_t*>(LargeText->data());
6217 LargeText__str.size = LargeText->size();
6218 }
6219 Discord_ActivityAssets_SetLargeText(&instance_,
6220 (LargeText.has_value() ? &LargeText__str : nullptr));
6221}
6222std::optional<std::string> ActivityAssets::LargeUrl() const
6223{
6224 assert(state_ == DiscordObjectState::Owned);
6225 bool returnIsNonNull__;
6226 Discord_String returnValueNative__;
6227 returnIsNonNull__ = Discord_ActivityAssets_LargeUrl(&instance_, &returnValueNative__);
6228 if (!returnIsNonNull__) {
6229 return {};
6230 }
6231 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
6232 returnValueNative__.size);
6233 Discord_Free(returnValueNative__.ptr);
6234 return returnValue__;
6235}
6236void ActivityAssets::SetLargeUrl(std::optional<std::string> LargeUrl)
6237{
6238 assert(state_ == DiscordObjectState::Owned);
6239 Discord_String LargeUrl__str{};
6240 if (LargeUrl.has_value()) {
6241 LargeUrl__str.ptr = reinterpret_cast<uint8_t*>(LargeUrl->data());
6242 LargeUrl__str.size = LargeUrl->size();
6243 }
6244 Discord_ActivityAssets_SetLargeUrl(&instance_,
6245 (LargeUrl.has_value() ? &LargeUrl__str : nullptr));
6246}
6247std::optional<std::string> ActivityAssets::SmallImage() const
6248{
6249 assert(state_ == DiscordObjectState::Owned);
6250 bool returnIsNonNull__;
6251 Discord_String returnValueNative__;
6252 returnIsNonNull__ = Discord_ActivityAssets_SmallImage(&instance_, &returnValueNative__);
6253 if (!returnIsNonNull__) {
6254 return {};
6255 }
6256 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
6257 returnValueNative__.size);
6258 Discord_Free(returnValueNative__.ptr);
6259 return returnValue__;
6260}
6261void ActivityAssets::SetSmallImage(std::optional<std::string> SmallImage)
6262{
6263 assert(state_ == DiscordObjectState::Owned);
6264 Discord_String SmallImage__str{};
6265 if (SmallImage.has_value()) {
6266 SmallImage__str.ptr = reinterpret_cast<uint8_t*>(SmallImage->data());
6267 SmallImage__str.size = SmallImage->size();
6268 }
6269 Discord_ActivityAssets_SetSmallImage(&instance_,
6270 (SmallImage.has_value() ? &SmallImage__str : nullptr));
6271}
6272std::optional<std::string> ActivityAssets::SmallText() const
6273{
6274 assert(state_ == DiscordObjectState::Owned);
6275 bool returnIsNonNull__;
6276 Discord_String returnValueNative__;
6277 returnIsNonNull__ = Discord_ActivityAssets_SmallText(&instance_, &returnValueNative__);
6278 if (!returnIsNonNull__) {
6279 return {};
6280 }
6281 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
6282 returnValueNative__.size);
6283 Discord_Free(returnValueNative__.ptr);
6284 return returnValue__;
6285}
6286void ActivityAssets::SetSmallText(std::optional<std::string> SmallText)
6287{
6288 assert(state_ == DiscordObjectState::Owned);
6289 Discord_String SmallText__str{};
6290 if (SmallText.has_value()) {
6291 SmallText__str.ptr = reinterpret_cast<uint8_t*>(SmallText->data());
6292 SmallText__str.size = SmallText->size();
6293 }
6294 Discord_ActivityAssets_SetSmallText(&instance_,
6295 (SmallText.has_value() ? &SmallText__str : nullptr));
6296}
6297std::optional<std::string> ActivityAssets::SmallUrl() const
6298{
6299 assert(state_ == DiscordObjectState::Owned);
6300 bool returnIsNonNull__;
6301 Discord_String returnValueNative__;
6302 returnIsNonNull__ = Discord_ActivityAssets_SmallUrl(&instance_, &returnValueNative__);
6303 if (!returnIsNonNull__) {
6304 return {};
6305 }
6306 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
6307 returnValueNative__.size);
6308 Discord_Free(returnValueNative__.ptr);
6309 return returnValue__;
6310}
6311void ActivityAssets::SetSmallUrl(std::optional<std::string> SmallUrl)
6312{
6313 assert(state_ == DiscordObjectState::Owned);
6314 Discord_String SmallUrl__str{};
6315 if (SmallUrl.has_value()) {
6316 SmallUrl__str.ptr = reinterpret_cast<uint8_t*>(SmallUrl->data());
6317 SmallUrl__str.size = SmallUrl->size();
6318 }
6319 Discord_ActivityAssets_SetSmallUrl(&instance_,
6320 (SmallUrl.has_value() ? &SmallUrl__str : nullptr));
6321}
6322std::optional<std::string> ActivityAssets::InviteCoverImage() const
6323{
6324 assert(state_ == DiscordObjectState::Owned);
6325 bool returnIsNonNull__;
6326 Discord_String returnValueNative__;
6327 returnIsNonNull__ = Discord_ActivityAssets_InviteCoverImage(&instance_, &returnValueNative__);
6328 if (!returnIsNonNull__) {
6329 return {};
6330 }
6331 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
6332 returnValueNative__.size);
6333 Discord_Free(returnValueNative__.ptr);
6334 return returnValue__;
6335}
6336void ActivityAssets::SetInviteCoverImage(std::optional<std::string> InviteCoverImage)
6337{
6338 assert(state_ == DiscordObjectState::Owned);
6339 Discord_String InviteCoverImage__str{};
6340 if (InviteCoverImage.has_value()) {
6341 InviteCoverImage__str.ptr = reinterpret_cast<uint8_t*>(InviteCoverImage->data());
6342 InviteCoverImage__str.size = InviteCoverImage->size();
6343 }
6344 Discord_ActivityAssets_SetInviteCoverImage(
6345 &instance_, (InviteCoverImage.has_value() ? &InviteCoverImage__str : nullptr));
6346}
6347const ActivityTimestamps ActivityTimestamps::nullobj{{}, DiscordObjectState::Invalid};
6348ActivityTimestamps::~ActivityTimestamps()
6349{
6350 if (state_ == DiscordObjectState::Owned) {
6351 Drop();
6352 state_ = DiscordObjectState::Invalid;
6353 }
6354}
6355ActivityTimestamps::ActivityTimestamps(ActivityTimestamps&& other) noexcept
6356 : instance_(other.instance_)
6357 , state_(other.state_)
6358{
6359 other.state_ = DiscordObjectState::Invalid;
6360}
6361ActivityTimestamps& ActivityTimestamps::operator=(ActivityTimestamps&& other) noexcept
6362{
6363 if (this != &other) {
6364 if (state_ == DiscordObjectState::Owned) {
6365 Drop();
6366 }
6367 instance_ = other.instance_;
6368 state_ = other.state_;
6369 other.state_ = DiscordObjectState::Invalid;
6370 }
6371 return *this;
6372}
6373ActivityTimestamps::ActivityTimestamps(const ActivityTimestamps& arg0)
6374 : instance_{}
6375 , state_(DiscordObjectState::Invalid)
6376{
6377 if (arg0.state_ == DiscordObjectState::Owned) {
6378 Discord_ActivityTimestamps_Clone(&instance_, arg0.instance());
6379
6380 state_ = DiscordObjectState::Owned;
6381 }
6382}
6383ActivityTimestamps& ActivityTimestamps::operator=(const ActivityTimestamps& arg0)
6384{
6385 if (this != &arg0) {
6386 if (state_ == DiscordObjectState::Owned) {
6387 Drop();
6388 state_ = DiscordObjectState::Invalid;
6389 }
6390 if (arg0.state_ == DiscordObjectState::Owned) {
6391 Discord_ActivityTimestamps_Clone(&instance_, arg0.instance());
6392
6393 state_ = DiscordObjectState::Owned;
6394 }
6395 }
6396 return *this;
6397}
6398ActivityTimestamps::ActivityTimestamps(Discord_ActivityTimestamps instance,
6399 DiscordObjectState state)
6400 : instance_(instance)
6401 , state_(state)
6402{
6403}
6404ActivityTimestamps::ActivityTimestamps()
6405{
6406 assert(state_ == DiscordObjectState::Invalid);
6407 Discord_ActivityTimestamps_Init(&instance_);
6408 state_ = DiscordObjectState::Owned;
6409}
6410void ActivityTimestamps::Drop()
6411{
6412 if (state_ != DiscordObjectState::Owned) {
6413 return;
6414 }
6415 Discord_ActivityTimestamps_Drop(&instance_);
6416 state_ = DiscordObjectState::Invalid;
6417}
6418uint64_t ActivityTimestamps::Start() const
6419{
6420 assert(state_ == DiscordObjectState::Owned);
6421 uint64_t returnValue__;
6422 returnValue__ = Discord_ActivityTimestamps_Start(&instance_);
6423 return returnValue__;
6424}
6425void ActivityTimestamps::SetStart(uint64_t Start)
6426{
6427 assert(state_ == DiscordObjectState::Owned);
6428 Discord_ActivityTimestamps_SetStart(&instance_, Start);
6429}
6430uint64_t ActivityTimestamps::End() const
6431{
6432 assert(state_ == DiscordObjectState::Owned);
6433 uint64_t returnValue__;
6434 returnValue__ = Discord_ActivityTimestamps_End(&instance_);
6435 return returnValue__;
6436}
6437void ActivityTimestamps::SetEnd(uint64_t End)
6438{
6439 assert(state_ == DiscordObjectState::Owned);
6440 Discord_ActivityTimestamps_SetEnd(&instance_, End);
6441}
6442const ActivityParty ActivityParty::nullobj{{}, DiscordObjectState::Invalid};
6443ActivityParty::~ActivityParty()
6444{
6445 if (state_ == DiscordObjectState::Owned) {
6446 Drop();
6447 state_ = DiscordObjectState::Invalid;
6448 }
6449}
6450ActivityParty::ActivityParty(ActivityParty&& other) noexcept
6451 : instance_(other.instance_)
6452 , state_(other.state_)
6453{
6454 other.state_ = DiscordObjectState::Invalid;
6455}
6456ActivityParty& ActivityParty::operator=(ActivityParty&& other) noexcept
6457{
6458 if (this != &other) {
6459 if (state_ == DiscordObjectState::Owned) {
6460 Drop();
6461 }
6462 instance_ = other.instance_;
6463 state_ = other.state_;
6464 other.state_ = DiscordObjectState::Invalid;
6465 }
6466 return *this;
6467}
6468ActivityParty::ActivityParty(const ActivityParty& arg0)
6469 : instance_{}
6470 , state_(DiscordObjectState::Invalid)
6471{
6472 if (arg0.state_ == DiscordObjectState::Owned) {
6473 Discord_ActivityParty_Clone(&instance_, arg0.instance());
6474
6475 state_ = DiscordObjectState::Owned;
6476 }
6477}
6478ActivityParty& ActivityParty::operator=(const ActivityParty& arg0)
6479{
6480 if (this != &arg0) {
6481 if (state_ == DiscordObjectState::Owned) {
6482 Drop();
6483 state_ = DiscordObjectState::Invalid;
6484 }
6485 if (arg0.state_ == DiscordObjectState::Owned) {
6486 Discord_ActivityParty_Clone(&instance_, arg0.instance());
6487
6488 state_ = DiscordObjectState::Owned;
6489 }
6490 }
6491 return *this;
6492}
6493ActivityParty::ActivityParty(Discord_ActivityParty instance, DiscordObjectState state)
6494 : instance_(instance)
6495 , state_(state)
6496{
6497}
6498ActivityParty::ActivityParty()
6499{
6500 assert(state_ == DiscordObjectState::Invalid);
6501 Discord_ActivityParty_Init(&instance_);
6502 state_ = DiscordObjectState::Owned;
6503}
6504void ActivityParty::Drop()
6505{
6506 if (state_ != DiscordObjectState::Owned) {
6507 return;
6508 }
6509 Discord_ActivityParty_Drop(&instance_);
6510 state_ = DiscordObjectState::Invalid;
6511}
6512std::string ActivityParty::Id() const
6513{
6514 assert(state_ == DiscordObjectState::Owned);
6515 Discord_String returnValueNative__;
6516 Discord_ActivityParty_Id(&instance_, &returnValueNative__);
6517 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
6518 returnValueNative__.size);
6519 Discord_Free(returnValueNative__.ptr);
6520 return returnValue__;
6521}
6522void ActivityParty::SetId(std::string Id)
6523{
6524 assert(state_ == DiscordObjectState::Owned);
6525 Discord_String Id__str{(uint8_t*)(Id.data()), Id.size()};
6526 Discord_ActivityParty_SetId(&instance_, Id__str);
6527}
6528int32_t ActivityParty::CurrentSize() const
6529{
6530 assert(state_ == DiscordObjectState::Owned);
6531 int32_t returnValue__;
6532 returnValue__ = Discord_ActivityParty_CurrentSize(&instance_);
6533 return returnValue__;
6534}
6535void ActivityParty::SetCurrentSize(int32_t CurrentSize)
6536{
6537 assert(state_ == DiscordObjectState::Owned);
6538 Discord_ActivityParty_SetCurrentSize(&instance_, CurrentSize);
6539}
6540int32_t ActivityParty::MaxSize() const
6541{
6542 assert(state_ == DiscordObjectState::Owned);
6543 int32_t returnValue__;
6544 returnValue__ = Discord_ActivityParty_MaxSize(&instance_);
6545 return returnValue__;
6546}
6547void ActivityParty::SetMaxSize(int32_t MaxSize)
6548{
6549 assert(state_ == DiscordObjectState::Owned);
6550 Discord_ActivityParty_SetMaxSize(&instance_, MaxSize);
6551}
6552discordpp::ActivityPartyPrivacy ActivityParty::Privacy() const
6553{
6554 assert(state_ == DiscordObjectState::Owned);
6555 Discord_ActivityPartyPrivacy returnValue__;
6556 returnValue__ = Discord_ActivityParty_Privacy(&instance_);
6557 return static_cast<discordpp::ActivityPartyPrivacy>(returnValue__);
6558}
6559void ActivityParty::SetPrivacy(discordpp::ActivityPartyPrivacy Privacy)
6560{
6561 assert(state_ == DiscordObjectState::Owned);
6562 Discord_ActivityParty_SetPrivacy(&instance_,
6563 static_cast<Discord_ActivityPartyPrivacy>(Privacy));
6564}
6565const ActivitySecrets ActivitySecrets::nullobj{{}, DiscordObjectState::Invalid};
6566ActivitySecrets::~ActivitySecrets()
6567{
6568 if (state_ == DiscordObjectState::Owned) {
6569 Drop();
6570 state_ = DiscordObjectState::Invalid;
6571 }
6572}
6573ActivitySecrets::ActivitySecrets(ActivitySecrets&& other) noexcept
6574 : instance_(other.instance_)
6575 , state_(other.state_)
6576{
6577 other.state_ = DiscordObjectState::Invalid;
6578}
6579ActivitySecrets& ActivitySecrets::operator=(ActivitySecrets&& other) noexcept
6580{
6581 if (this != &other) {
6582 if (state_ == DiscordObjectState::Owned) {
6583 Drop();
6584 }
6585 instance_ = other.instance_;
6586 state_ = other.state_;
6587 other.state_ = DiscordObjectState::Invalid;
6588 }
6589 return *this;
6590}
6591ActivitySecrets::ActivitySecrets(const ActivitySecrets& arg0)
6592 : instance_{}
6593 , state_(DiscordObjectState::Invalid)
6594{
6595 if (arg0.state_ == DiscordObjectState::Owned) {
6596 Discord_ActivitySecrets_Clone(&instance_, arg0.instance());
6597
6598 state_ = DiscordObjectState::Owned;
6599 }
6600}
6601ActivitySecrets& ActivitySecrets::operator=(const ActivitySecrets& arg0)
6602{
6603 if (this != &arg0) {
6604 if (state_ == DiscordObjectState::Owned) {
6605 Drop();
6606 state_ = DiscordObjectState::Invalid;
6607 }
6608 if (arg0.state_ == DiscordObjectState::Owned) {
6609 Discord_ActivitySecrets_Clone(&instance_, arg0.instance());
6610
6611 state_ = DiscordObjectState::Owned;
6612 }
6613 }
6614 return *this;
6615}
6616ActivitySecrets::ActivitySecrets(Discord_ActivitySecrets instance, DiscordObjectState state)
6617 : instance_(instance)
6618 , state_(state)
6619{
6620}
6621ActivitySecrets::ActivitySecrets()
6622{
6623 assert(state_ == DiscordObjectState::Invalid);
6624 Discord_ActivitySecrets_Init(&instance_);
6625 state_ = DiscordObjectState::Owned;
6626}
6627void ActivitySecrets::Drop()
6628{
6629 if (state_ != DiscordObjectState::Owned) {
6630 return;
6631 }
6632 Discord_ActivitySecrets_Drop(&instance_);
6633 state_ = DiscordObjectState::Invalid;
6634}
6635std::string ActivitySecrets::Join() const
6636{
6637 assert(state_ == DiscordObjectState::Owned);
6638 Discord_String returnValueNative__;
6639 Discord_ActivitySecrets_Join(&instance_, &returnValueNative__);
6640 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
6641 returnValueNative__.size);
6642 Discord_Free(returnValueNative__.ptr);
6643 return returnValue__;
6644}
6645void ActivitySecrets::SetJoin(std::string Join)
6646{
6647 assert(state_ == DiscordObjectState::Owned);
6648 Discord_String Join__str{(uint8_t*)(Join.data()), Join.size()};
6649 Discord_ActivitySecrets_SetJoin(&instance_, Join__str);
6650}
6651const ActivityButton ActivityButton::nullobj{{}, DiscordObjectState::Invalid};
6652ActivityButton::~ActivityButton()
6653{
6654 if (state_ == DiscordObjectState::Owned) {
6655 Drop();
6656 state_ = DiscordObjectState::Invalid;
6657 }
6658}
6659ActivityButton::ActivityButton(ActivityButton&& other) noexcept
6660 : instance_(other.instance_)
6661 , state_(other.state_)
6662{
6663 other.state_ = DiscordObjectState::Invalid;
6664}
6665ActivityButton& ActivityButton::operator=(ActivityButton&& other) noexcept
6666{
6667 if (this != &other) {
6668 if (state_ == DiscordObjectState::Owned) {
6669 Drop();
6670 }
6671 instance_ = other.instance_;
6672 state_ = other.state_;
6673 other.state_ = DiscordObjectState::Invalid;
6674 }
6675 return *this;
6676}
6677ActivityButton::ActivityButton(const ActivityButton& arg0)
6678 : instance_{}
6679 , state_(DiscordObjectState::Invalid)
6680{
6681 if (arg0.state_ == DiscordObjectState::Owned) {
6682 Discord_ActivityButton_Clone(&instance_, arg0.instance());
6683
6684 state_ = DiscordObjectState::Owned;
6685 }
6686}
6687ActivityButton& ActivityButton::operator=(const ActivityButton& arg0)
6688{
6689 if (this != &arg0) {
6690 if (state_ == DiscordObjectState::Owned) {
6691 Drop();
6692 state_ = DiscordObjectState::Invalid;
6693 }
6694 if (arg0.state_ == DiscordObjectState::Owned) {
6695 Discord_ActivityButton_Clone(&instance_, arg0.instance());
6696
6697 state_ = DiscordObjectState::Owned;
6698 }
6699 }
6700 return *this;
6701}
6702ActivityButton::ActivityButton(Discord_ActivityButton instance, DiscordObjectState state)
6703 : instance_(instance)
6704 , state_(state)
6705{
6706}
6707ActivityButton::ActivityButton()
6708{
6709 assert(state_ == DiscordObjectState::Invalid);
6710 Discord_ActivityButton_Init(&instance_);
6711 state_ = DiscordObjectState::Owned;
6712}
6713void ActivityButton::Drop()
6714{
6715 if (state_ != DiscordObjectState::Owned) {
6716 return;
6717 }
6718 Discord_ActivityButton_Drop(&instance_);
6719 state_ = DiscordObjectState::Invalid;
6720}
6721std::string ActivityButton::Label() const
6722{
6723 assert(state_ == DiscordObjectState::Owned);
6724 Discord_String returnValueNative__;
6725 Discord_ActivityButton_Label(&instance_, &returnValueNative__);
6726 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
6727 returnValueNative__.size);
6728 Discord_Free(returnValueNative__.ptr);
6729 return returnValue__;
6730}
6731void ActivityButton::SetLabel(std::string Label)
6732{
6733 assert(state_ == DiscordObjectState::Owned);
6734 Discord_String Label__str{(uint8_t*)(Label.data()), Label.size()};
6735 Discord_ActivityButton_SetLabel(&instance_, Label__str);
6736}
6737std::string ActivityButton::Url() const
6738{
6739 assert(state_ == DiscordObjectState::Owned);
6740 Discord_String returnValueNative__;
6741 Discord_ActivityButton_Url(&instance_, &returnValueNative__);
6742 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
6743 returnValueNative__.size);
6744 Discord_Free(returnValueNative__.ptr);
6745 return returnValue__;
6746}
6747void ActivityButton::SetUrl(std::string Url)
6748{
6749 assert(state_ == DiscordObjectState::Owned);
6750 Discord_String Url__str{(uint8_t*)(Url.data()), Url.size()};
6751 Discord_ActivityButton_SetUrl(&instance_, Url__str);
6752}
6753const Activity Activity::nullobj{{}, DiscordObjectState::Invalid};
6754Activity::~Activity()
6755{
6756 if (state_ == DiscordObjectState::Owned) {
6757 Drop();
6758 state_ = DiscordObjectState::Invalid;
6759 }
6760}
6761Activity::Activity(Activity&& other) noexcept
6762 : instance_(other.instance_)
6763 , state_(other.state_)
6764{
6765 other.state_ = DiscordObjectState::Invalid;
6766}
6767Activity& Activity::operator=(Activity&& other) noexcept
6768{
6769 if (this != &other) {
6770 if (state_ == DiscordObjectState::Owned) {
6771 Drop();
6772 }
6773 instance_ = other.instance_;
6774 state_ = other.state_;
6775 other.state_ = DiscordObjectState::Invalid;
6776 }
6777 return *this;
6778}
6779Activity::Activity(const Activity& arg0)
6780 : instance_{}
6781 , state_(DiscordObjectState::Invalid)
6782{
6783 if (arg0.state_ == DiscordObjectState::Owned) {
6784 Discord_Activity_Clone(&instance_, arg0.instance());
6785
6786 state_ = DiscordObjectState::Owned;
6787 }
6788}
6789Activity& Activity::operator=(const Activity& arg0)
6790{
6791 if (this != &arg0) {
6792 if (state_ == DiscordObjectState::Owned) {
6793 Drop();
6794 state_ = DiscordObjectState::Invalid;
6795 }
6796 if (arg0.state_ == DiscordObjectState::Owned) {
6797 Discord_Activity_Clone(&instance_, arg0.instance());
6798
6799 state_ = DiscordObjectState::Owned;
6800 }
6801 }
6802 return *this;
6803}
6804Activity::Activity(Discord_Activity instance, DiscordObjectState state)
6805 : instance_(instance)
6806 , state_(state)
6807{
6808}
6809Activity::Activity()
6810{
6811 assert(state_ == DiscordObjectState::Invalid);
6812 Discord_Activity_Init(&instance_);
6813 state_ = DiscordObjectState::Owned;
6814}
6815void Activity::Drop()
6816{
6817 if (state_ != DiscordObjectState::Owned) {
6818 return;
6819 }
6820 Discord_Activity_Drop(&instance_);
6821 state_ = DiscordObjectState::Invalid;
6822}
6823void Activity::AddButton(discordpp::ActivityButton button)
6824{
6825 assert(state_ == DiscordObjectState::Owned);
6826 Discord_Activity_AddButton(&instance_, button.instance());
6827}
6828bool Activity::Equals(discordpp::Activity other) const
6829{
6830 assert(state_ == DiscordObjectState::Owned);
6831 bool returnValue__;
6832 returnValue__ = Discord_Activity_Equals(&instance_, other.instance());
6833 return returnValue__;
6834}
6835std::vector<discordpp::ActivityButton> Activity::GetButtons() const
6836{
6837 assert(state_ == DiscordObjectState::Owned);
6838 Discord_ActivityButtonSpan returnValueNative__;
6839 Discord_Activity_GetButtons(&instance_, &returnValueNative__);
6840 std::vector<discordpp::ActivityButton> returnValue__;
6841 returnValue__.reserve(returnValueNative__.size);
6842 for (size_t i__ = 0; i__ < returnValueNative__.size; ++i__) {
6843 returnValue__.emplace_back(returnValueNative__.ptr[i__], DiscordObjectState::Owned);
6844 }
6845 Discord_Free(returnValueNative__.ptr);
6846 return returnValue__;
6847}
6848std::string Activity::Name() const
6849{
6850 assert(state_ == DiscordObjectState::Owned);
6851 Discord_String returnValueNative__;
6852 Discord_Activity_Name(&instance_, &returnValueNative__);
6853 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
6854 returnValueNative__.size);
6855 Discord_Free(returnValueNative__.ptr);
6856 return returnValue__;
6857}
6858void Activity::SetName(std::string Name)
6859{
6860 assert(state_ == DiscordObjectState::Owned);
6861 Discord_String Name__str{(uint8_t*)(Name.data()), Name.size()};
6862 Discord_Activity_SetName(&instance_, Name__str);
6863}
6864discordpp::ActivityTypes Activity::Type() const
6865{
6866 assert(state_ == DiscordObjectState::Owned);
6867 Discord_ActivityTypes returnValue__;
6868 returnValue__ = Discord_Activity_Type(&instance_);
6869 return static_cast<discordpp::ActivityTypes>(returnValue__);
6870}
6871void Activity::SetType(discordpp::ActivityTypes Type)
6872{
6873 assert(state_ == DiscordObjectState::Owned);
6874 Discord_Activity_SetType(&instance_, static_cast<Discord_ActivityTypes>(Type));
6875}
6876std::optional<discordpp::StatusDisplayTypes> Activity::StatusDisplayType() const
6877{
6878 assert(state_ == DiscordObjectState::Owned);
6879 bool returnIsNonNull__;
6880 Discord_StatusDisplayTypes returnValueNative__;
6881 returnIsNonNull__ = Discord_Activity_StatusDisplayType(&instance_, &returnValueNative__);
6882 if (!returnIsNonNull__) {
6883 return {};
6884 }
6885 auto returnValue__ = static_cast<discordpp::StatusDisplayTypes>(returnValueNative__);
6886 return returnValue__;
6887}
6888void Activity::SetStatusDisplayType(std::optional<discordpp::StatusDisplayTypes> StatusDisplayType)
6889{
6890 assert(state_ == DiscordObjectState::Owned);
6891 Discord_Activity_SetStatusDisplayType(
6892 &instance_,
6893 (StatusDisplayType.has_value()
6894 ? reinterpret_cast<Discord_StatusDisplayTypes*>(&*StatusDisplayType)
6895 : nullptr));
6896}
6897std::optional<std::string> Activity::State() const
6898{
6899 assert(state_ == DiscordObjectState::Owned);
6900 bool returnIsNonNull__;
6901 Discord_String returnValueNative__;
6902 returnIsNonNull__ = Discord_Activity_State(&instance_, &returnValueNative__);
6903 if (!returnIsNonNull__) {
6904 return {};
6905 }
6906 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
6907 returnValueNative__.size);
6908 Discord_Free(returnValueNative__.ptr);
6909 return returnValue__;
6910}
6911void Activity::SetState(std::optional<std::string> State)
6912{
6913 assert(state_ == DiscordObjectState::Owned);
6914 Discord_String State__str{};
6915 if (State.has_value()) {
6916 State__str.ptr = reinterpret_cast<uint8_t*>(State->data());
6917 State__str.size = State->size();
6918 }
6919 Discord_Activity_SetState(&instance_, (State.has_value() ? &State__str : nullptr));
6920}
6921std::optional<std::string> Activity::StateUrl() const
6922{
6923 assert(state_ == DiscordObjectState::Owned);
6924 bool returnIsNonNull__;
6925 Discord_String returnValueNative__;
6926 returnIsNonNull__ = Discord_Activity_StateUrl(&instance_, &returnValueNative__);
6927 if (!returnIsNonNull__) {
6928 return {};
6929 }
6930 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
6931 returnValueNative__.size);
6932 Discord_Free(returnValueNative__.ptr);
6933 return returnValue__;
6934}
6935void Activity::SetStateUrl(std::optional<std::string> StateUrl)
6936{
6937 assert(state_ == DiscordObjectState::Owned);
6938 Discord_String StateUrl__str{};
6939 if (StateUrl.has_value()) {
6940 StateUrl__str.ptr = reinterpret_cast<uint8_t*>(StateUrl->data());
6941 StateUrl__str.size = StateUrl->size();
6942 }
6943 Discord_Activity_SetStateUrl(&instance_, (StateUrl.has_value() ? &StateUrl__str : nullptr));
6944}
6945std::optional<std::string> Activity::Details() const
6946{
6947 assert(state_ == DiscordObjectState::Owned);
6948 bool returnIsNonNull__;
6949 Discord_String returnValueNative__;
6950 returnIsNonNull__ = Discord_Activity_Details(&instance_, &returnValueNative__);
6951 if (!returnIsNonNull__) {
6952 return {};
6953 }
6954 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
6955 returnValueNative__.size);
6956 Discord_Free(returnValueNative__.ptr);
6957 return returnValue__;
6958}
6959void Activity::SetDetails(std::optional<std::string> Details)
6960{
6961 assert(state_ == DiscordObjectState::Owned);
6962 Discord_String Details__str{};
6963 if (Details.has_value()) {
6964 Details__str.ptr = reinterpret_cast<uint8_t*>(Details->data());
6965 Details__str.size = Details->size();
6966 }
6967 Discord_Activity_SetDetails(&instance_, (Details.has_value() ? &Details__str : nullptr));
6968}
6969std::optional<std::string> Activity::DetailsUrl() const
6970{
6971 assert(state_ == DiscordObjectState::Owned);
6972 bool returnIsNonNull__;
6973 Discord_String returnValueNative__;
6974 returnIsNonNull__ = Discord_Activity_DetailsUrl(&instance_, &returnValueNative__);
6975 if (!returnIsNonNull__) {
6976 return {};
6977 }
6978 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
6979 returnValueNative__.size);
6980 Discord_Free(returnValueNative__.ptr);
6981 return returnValue__;
6982}
6983void Activity::SetDetailsUrl(std::optional<std::string> DetailsUrl)
6984{
6985 assert(state_ == DiscordObjectState::Owned);
6986 Discord_String DetailsUrl__str{};
6987 if (DetailsUrl.has_value()) {
6988 DetailsUrl__str.ptr = reinterpret_cast<uint8_t*>(DetailsUrl->data());
6989 DetailsUrl__str.size = DetailsUrl->size();
6990 }
6991 Discord_Activity_SetDetailsUrl(&instance_,
6992 (DetailsUrl.has_value() ? &DetailsUrl__str : nullptr));
6993}
6994std::optional<uint64_t> Activity::ApplicationId() const
6995{
6996 assert(state_ == DiscordObjectState::Owned);
6997 bool returnIsNonNull__;
6998 uint64_t returnValue__;
6999 returnIsNonNull__ = Discord_Activity_ApplicationId(&instance_, &returnValue__);
7000 if (!returnIsNonNull__) {
7001 return std::nullopt;
7002 }
7003 return returnValue__;
7004}
7005void Activity::SetApplicationId(std::optional<uint64_t> ApplicationId)
7006{
7007 assert(state_ == DiscordObjectState::Owned);
7008 Discord_Activity_SetApplicationId(&instance_,
7009 (ApplicationId.has_value() ? &*ApplicationId : nullptr));
7010}
7011std::optional<uint64_t> Activity::ParentApplicationId() const
7012{
7013 assert(state_ == DiscordObjectState::Owned);
7014 bool returnIsNonNull__;
7015 uint64_t returnValue__;
7016 returnIsNonNull__ = Discord_Activity_ParentApplicationId(&instance_, &returnValue__);
7017 if (!returnIsNonNull__) {
7018 return std::nullopt;
7019 }
7020 return returnValue__;
7021}
7022void Activity::SetParentApplicationId(std::optional<uint64_t> ParentApplicationId)
7023{
7024 assert(state_ == DiscordObjectState::Owned);
7025 Discord_Activity_SetParentApplicationId(
7026 &instance_, (ParentApplicationId.has_value() ? &*ParentApplicationId : nullptr));
7027}
7028std::optional<discordpp::ActivityAssets> Activity::Assets() const
7029{
7030 assert(state_ == DiscordObjectState::Owned);
7031 bool returnIsNonNull__;
7032 Discord_ActivityAssets returnValueNative__;
7033 returnIsNonNull__ = Discord_Activity_Assets(&instance_, &returnValueNative__);
7034 if (!returnIsNonNull__) {
7035 return {};
7036 }
7037 discordpp::ActivityAssets returnValue__(returnValueNative__, DiscordObjectState::Owned);
7038 return returnValue__;
7039}
7040void Activity::SetAssets(std::optional<discordpp::ActivityAssets> Assets)
7041{
7042 assert(state_ == DiscordObjectState::Owned);
7043 Discord_Activity_SetAssets(&instance_, (Assets.has_value() ? Assets->instance() : nullptr));
7044}
7045std::optional<discordpp::ActivityTimestamps> Activity::Timestamps() const
7046{
7047 assert(state_ == DiscordObjectState::Owned);
7048 bool returnIsNonNull__;
7049 Discord_ActivityTimestamps returnValueNative__;
7050 returnIsNonNull__ = Discord_Activity_Timestamps(&instance_, &returnValueNative__);
7051 if (!returnIsNonNull__) {
7052 return {};
7053 }
7054 discordpp::ActivityTimestamps returnValue__(returnValueNative__, DiscordObjectState::Owned);
7055 return returnValue__;
7056}
7057void Activity::SetTimestamps(std::optional<discordpp::ActivityTimestamps> Timestamps)
7058{
7059 assert(state_ == DiscordObjectState::Owned);
7060 Discord_Activity_SetTimestamps(&instance_,
7061 (Timestamps.has_value() ? Timestamps->instance() : nullptr));
7062}
7063std::optional<discordpp::ActivityParty> Activity::Party() const
7064{
7065 assert(state_ == DiscordObjectState::Owned);
7066 bool returnIsNonNull__;
7067 Discord_ActivityParty returnValueNative__;
7068 returnIsNonNull__ = Discord_Activity_Party(&instance_, &returnValueNative__);
7069 if (!returnIsNonNull__) {
7070 return {};
7071 }
7072 discordpp::ActivityParty returnValue__(returnValueNative__, DiscordObjectState::Owned);
7073 return returnValue__;
7074}
7075void Activity::SetParty(std::optional<discordpp::ActivityParty> Party)
7076{
7077 assert(state_ == DiscordObjectState::Owned);
7078 Discord_Activity_SetParty(&instance_, (Party.has_value() ? Party->instance() : nullptr));
7079}
7080std::optional<discordpp::ActivitySecrets> Activity::Secrets() const
7081{
7082 assert(state_ == DiscordObjectState::Owned);
7083 bool returnIsNonNull__;
7084 Discord_ActivitySecrets returnValueNative__;
7085 returnIsNonNull__ = Discord_Activity_Secrets(&instance_, &returnValueNative__);
7086 if (!returnIsNonNull__) {
7087 return {};
7088 }
7089 discordpp::ActivitySecrets returnValue__(returnValueNative__, DiscordObjectState::Owned);
7090 return returnValue__;
7091}
7092void Activity::SetSecrets(std::optional<discordpp::ActivitySecrets> Secrets)
7093{
7094 assert(state_ == DiscordObjectState::Owned);
7095 Discord_Activity_SetSecrets(&instance_, (Secrets.has_value() ? Secrets->instance() : nullptr));
7096}
7097discordpp::ActivityGamePlatforms Activity::SupportedPlatforms() const
7098{
7099 assert(state_ == DiscordObjectState::Owned);
7100 Discord_ActivityGamePlatforms returnValue__;
7101 returnValue__ = Discord_Activity_SupportedPlatforms(&instance_);
7102 return static_cast<discordpp::ActivityGamePlatforms>(returnValue__);
7103}
7104void Activity::SetSupportedPlatforms(discordpp::ActivityGamePlatforms SupportedPlatforms)
7105{
7106 assert(state_ == DiscordObjectState::Owned);
7107 Discord_Activity_SetSupportedPlatforms(
7108 &instance_, static_cast<Discord_ActivityGamePlatforms>(SupportedPlatforms));
7109}
7110const ClientResult ClientResult::nullobj{{}, DiscordObjectState::Invalid};
7111ClientResult::~ClientResult()
7112{
7113 if (state_ == DiscordObjectState::Owned) {
7114 Drop();
7115 state_ = DiscordObjectState::Invalid;
7116 }
7117}
7118ClientResult::ClientResult(ClientResult&& other) noexcept
7119 : instance_(other.instance_)
7120 , state_(other.state_)
7121{
7122 other.state_ = DiscordObjectState::Invalid;
7123}
7124ClientResult& ClientResult::operator=(ClientResult&& other) noexcept
7125{
7126 if (this != &other) {
7127 if (state_ == DiscordObjectState::Owned) {
7128 Drop();
7129 }
7130 instance_ = other.instance_;
7131 state_ = other.state_;
7132 other.state_ = DiscordObjectState::Invalid;
7133 }
7134 return *this;
7135}
7136ClientResult::ClientResult(const ClientResult& arg0)
7137 : instance_{}
7138 , state_(DiscordObjectState::Invalid)
7139{
7140 if (arg0.state_ == DiscordObjectState::Owned) {
7141 Discord_ClientResult_Clone(&instance_, arg0.instance());
7142
7143 state_ = DiscordObjectState::Owned;
7144 }
7145}
7146ClientResult& ClientResult::operator=(const ClientResult& arg0)
7147{
7148 if (this != &arg0) {
7149 if (state_ == DiscordObjectState::Owned) {
7150 Drop();
7151 state_ = DiscordObjectState::Invalid;
7152 }
7153 if (arg0.state_ == DiscordObjectState::Owned) {
7154 Discord_ClientResult_Clone(&instance_, arg0.instance());
7155
7156 state_ = DiscordObjectState::Owned;
7157 }
7158 }
7159 return *this;
7160}
7161ClientResult::ClientResult(Discord_ClientResult instance, DiscordObjectState state)
7162 : instance_(instance)
7163 , state_(state)
7164{
7165}
7166void ClientResult::Drop()
7167{
7168 if (state_ != DiscordObjectState::Owned) {
7169 return;
7170 }
7171 Discord_ClientResult_Drop(&instance_);
7172 state_ = DiscordObjectState::Invalid;
7173}
7174std::string ClientResult::ToString() const
7175{
7176 assert(state_ == DiscordObjectState::Owned);
7177 Discord_String returnValueNative__;
7178 Discord_ClientResult_ToString(&instance_, &returnValueNative__);
7179 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
7180 returnValueNative__.size);
7181 Discord_Free(returnValueNative__.ptr);
7182 return returnValue__;
7183}
7184discordpp::ErrorType ClientResult::Type() const
7185{
7186 assert(state_ == DiscordObjectState::Owned);
7187 Discord_ErrorType returnValue__;
7188 returnValue__ = Discord_ClientResult_Type(&instance_);
7189 return static_cast<discordpp::ErrorType>(returnValue__);
7190}
7191void ClientResult::SetType(discordpp::ErrorType Type)
7192{
7193 assert(state_ == DiscordObjectState::Owned);
7194 Discord_ClientResult_SetType(&instance_, static_cast<Discord_ErrorType>(Type));
7195}
7196std::string ClientResult::Error() const
7197{
7198 assert(state_ == DiscordObjectState::Owned);
7199 Discord_String returnValueNative__;
7200 Discord_ClientResult_Error(&instance_, &returnValueNative__);
7201 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
7202 returnValueNative__.size);
7203 Discord_Free(returnValueNative__.ptr);
7204 return returnValue__;
7205}
7206void ClientResult::SetError(std::string Error)
7207{
7208 assert(state_ == DiscordObjectState::Owned);
7209 Discord_String Error__str{(uint8_t*)(Error.data()), Error.size()};
7210 Discord_ClientResult_SetError(&instance_, Error__str);
7211}
7212int32_t ClientResult::ErrorCode() const
7213{
7214 assert(state_ == DiscordObjectState::Owned);
7215 int32_t returnValue__;
7216 returnValue__ = Discord_ClientResult_ErrorCode(&instance_);
7217 return returnValue__;
7218}
7219void ClientResult::SetErrorCode(int32_t ErrorCode)
7220{
7221 assert(state_ == DiscordObjectState::Owned);
7222 Discord_ClientResult_SetErrorCode(&instance_, ErrorCode);
7223}
7224discordpp::HttpStatusCode ClientResult::Status() const
7225{
7226 assert(state_ == DiscordObjectState::Owned);
7227 Discord_HttpStatusCode returnValue__;
7228 returnValue__ = Discord_ClientResult_Status(&instance_);
7229 return static_cast<discordpp::HttpStatusCode>(returnValue__);
7230}
7231void ClientResult::SetStatus(discordpp::HttpStatusCode Status)
7232{
7233 assert(state_ == DiscordObjectState::Owned);
7234 Discord_ClientResult_SetStatus(&instance_, static_cast<Discord_HttpStatusCode>(Status));
7235}
7236std::string ClientResult::ResponseBody() const
7237{
7238 assert(state_ == DiscordObjectState::Owned);
7239 Discord_String returnValueNative__;
7240 Discord_ClientResult_ResponseBody(&instance_, &returnValueNative__);
7241 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
7242 returnValueNative__.size);
7243 Discord_Free(returnValueNative__.ptr);
7244 return returnValue__;
7245}
7246void ClientResult::SetResponseBody(std::string ResponseBody)
7247{
7248 assert(state_ == DiscordObjectState::Owned);
7249 Discord_String ResponseBody__str{(uint8_t*)(ResponseBody.data()), ResponseBody.size()};
7250 Discord_ClientResult_SetResponseBody(&instance_, ResponseBody__str);
7251}
7252bool ClientResult::Successful() const
7253{
7254 assert(state_ == DiscordObjectState::Owned);
7255 bool returnValue__;
7256 returnValue__ = Discord_ClientResult_Successful(&instance_);
7257 return returnValue__;
7258}
7259void ClientResult::SetSuccessful(bool Successful)
7260{
7261 assert(state_ == DiscordObjectState::Owned);
7262 Discord_ClientResult_SetSuccessful(&instance_, Successful);
7263}
7264bool ClientResult::Retryable() const
7265{
7266 assert(state_ == DiscordObjectState::Owned);
7267 bool returnValue__;
7268 returnValue__ = Discord_ClientResult_Retryable(&instance_);
7269 return returnValue__;
7270}
7271void ClientResult::SetRetryable(bool Retryable)
7272{
7273 assert(state_ == DiscordObjectState::Owned);
7274 Discord_ClientResult_SetRetryable(&instance_, Retryable);
7275}
7276float ClientResult::RetryAfter() const
7277{
7278 assert(state_ == DiscordObjectState::Owned);
7279 float returnValue__;
7280 returnValue__ = Discord_ClientResult_RetryAfter(&instance_);
7281 return returnValue__;
7282}
7283void ClientResult::SetRetryAfter(float RetryAfter)
7284{
7285 assert(state_ == DiscordObjectState::Owned);
7286 Discord_ClientResult_SetRetryAfter(&instance_, RetryAfter);
7287}
7288const AuthorizationCodeChallenge AuthorizationCodeChallenge::nullobj{{},
7289 DiscordObjectState::Invalid};
7290AuthorizationCodeChallenge::~AuthorizationCodeChallenge()
7291{
7292 if (state_ == DiscordObjectState::Owned) {
7293 Drop();
7294 state_ = DiscordObjectState::Invalid;
7295 }
7296}
7297AuthorizationCodeChallenge::AuthorizationCodeChallenge(AuthorizationCodeChallenge&& other) noexcept
7298 : instance_(other.instance_)
7299 , state_(other.state_)
7300{
7301 other.state_ = DiscordObjectState::Invalid;
7302}
7303AuthorizationCodeChallenge& AuthorizationCodeChallenge::operator=(
7304 AuthorizationCodeChallenge&& other) noexcept
7305{
7306 if (this != &other) {
7307 if (state_ == DiscordObjectState::Owned) {
7308 Drop();
7309 }
7310 instance_ = other.instance_;
7311 state_ = other.state_;
7312 other.state_ = DiscordObjectState::Invalid;
7313 }
7314 return *this;
7315}
7316AuthorizationCodeChallenge::AuthorizationCodeChallenge(const AuthorizationCodeChallenge& arg0)
7317 : instance_{}
7318 , state_(DiscordObjectState::Invalid)
7319{
7320 if (arg0.state_ == DiscordObjectState::Owned) {
7321 Discord_AuthorizationCodeChallenge_Clone(&instance_, arg0.instance());
7322
7323 state_ = DiscordObjectState::Owned;
7324 }
7325}
7326AuthorizationCodeChallenge& AuthorizationCodeChallenge::operator=(
7327 const AuthorizationCodeChallenge& arg0)
7328{
7329 if (this != &arg0) {
7330 if (state_ == DiscordObjectState::Owned) {
7331 Drop();
7332 state_ = DiscordObjectState::Invalid;
7333 }
7334 if (arg0.state_ == DiscordObjectState::Owned) {
7335 Discord_AuthorizationCodeChallenge_Clone(&instance_, arg0.instance());
7336
7337 state_ = DiscordObjectState::Owned;
7338 }
7339 }
7340 return *this;
7341}
7342AuthorizationCodeChallenge::AuthorizationCodeChallenge(Discord_AuthorizationCodeChallenge instance,
7343 DiscordObjectState state)
7344 : instance_(instance)
7345 , state_(state)
7346{
7347}
7348AuthorizationCodeChallenge::AuthorizationCodeChallenge()
7349{
7350 assert(state_ == DiscordObjectState::Invalid);
7351 Discord_AuthorizationCodeChallenge_Init(&instance_);
7352 state_ = DiscordObjectState::Owned;
7353}
7354void AuthorizationCodeChallenge::Drop()
7355{
7356 if (state_ != DiscordObjectState::Owned) {
7357 return;
7358 }
7359 Discord_AuthorizationCodeChallenge_Drop(&instance_);
7360 state_ = DiscordObjectState::Invalid;
7361}
7362discordpp::AuthenticationCodeChallengeMethod AuthorizationCodeChallenge::Method() const
7363{
7364 assert(state_ == DiscordObjectState::Owned);
7365 Discord_AuthenticationCodeChallengeMethod returnValue__;
7366 returnValue__ = Discord_AuthorizationCodeChallenge_Method(&instance_);
7367 return static_cast<discordpp::AuthenticationCodeChallengeMethod>(returnValue__);
7368}
7369void AuthorizationCodeChallenge::SetMethod(discordpp::AuthenticationCodeChallengeMethod Method)
7370{
7371 assert(state_ == DiscordObjectState::Owned);
7372 Discord_AuthorizationCodeChallenge_SetMethod(
7373 &instance_, static_cast<Discord_AuthenticationCodeChallengeMethod>(Method));
7374}
7375std::string AuthorizationCodeChallenge::Challenge() const
7376{
7377 assert(state_ == DiscordObjectState::Owned);
7378 Discord_String returnValueNative__;
7379 Discord_AuthorizationCodeChallenge_Challenge(&instance_, &returnValueNative__);
7380 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
7381 returnValueNative__.size);
7382 Discord_Free(returnValueNative__.ptr);
7383 return returnValue__;
7384}
7385void AuthorizationCodeChallenge::SetChallenge(std::string Challenge)
7386{
7387 assert(state_ == DiscordObjectState::Owned);
7388 Discord_String Challenge__str{(uint8_t*)(Challenge.data()), Challenge.size()};
7389 Discord_AuthorizationCodeChallenge_SetChallenge(&instance_, Challenge__str);
7390}
7391const AuthorizationCodeVerifier AuthorizationCodeVerifier::nullobj{{}, DiscordObjectState::Invalid};
7392AuthorizationCodeVerifier::~AuthorizationCodeVerifier()
7393{
7394 if (state_ == DiscordObjectState::Owned) {
7395 Drop();
7396 state_ = DiscordObjectState::Invalid;
7397 }
7398}
7399AuthorizationCodeVerifier::AuthorizationCodeVerifier(AuthorizationCodeVerifier&& other) noexcept
7400 : instance_(other.instance_)
7401 , state_(other.state_)
7402{
7403 other.state_ = DiscordObjectState::Invalid;
7404}
7405AuthorizationCodeVerifier& AuthorizationCodeVerifier::operator=(
7406 AuthorizationCodeVerifier&& other) noexcept
7407{
7408 if (this != &other) {
7409 if (state_ == DiscordObjectState::Owned) {
7410 Drop();
7411 }
7412 instance_ = other.instance_;
7413 state_ = other.state_;
7414 other.state_ = DiscordObjectState::Invalid;
7415 }
7416 return *this;
7417}
7418AuthorizationCodeVerifier::AuthorizationCodeVerifier(const AuthorizationCodeVerifier& arg0)
7419 : instance_{}
7420 , state_(DiscordObjectState::Invalid)
7421{
7422 if (arg0.state_ == DiscordObjectState::Owned) {
7423 Discord_AuthorizationCodeVerifier_Clone(&instance_, arg0.instance());
7424
7425 state_ = DiscordObjectState::Owned;
7426 }
7427}
7428AuthorizationCodeVerifier& AuthorizationCodeVerifier::operator=(
7429 const AuthorizationCodeVerifier& arg0)
7430{
7431 if (this != &arg0) {
7432 if (state_ == DiscordObjectState::Owned) {
7433 Drop();
7434 state_ = DiscordObjectState::Invalid;
7435 }
7436 if (arg0.state_ == DiscordObjectState::Owned) {
7437 Discord_AuthorizationCodeVerifier_Clone(&instance_, arg0.instance());
7438
7439 state_ = DiscordObjectState::Owned;
7440 }
7441 }
7442 return *this;
7443}
7444AuthorizationCodeVerifier::AuthorizationCodeVerifier(Discord_AuthorizationCodeVerifier instance,
7445 DiscordObjectState state)
7446 : instance_(instance)
7447 , state_(state)
7448{
7449}
7450void AuthorizationCodeVerifier::Drop()
7451{
7452 if (state_ != DiscordObjectState::Owned) {
7453 return;
7454 }
7455 Discord_AuthorizationCodeVerifier_Drop(&instance_);
7456 state_ = DiscordObjectState::Invalid;
7457}
7458discordpp::AuthorizationCodeChallenge AuthorizationCodeVerifier::Challenge() const
7459{
7460 assert(state_ == DiscordObjectState::Owned);
7461 Discord_AuthorizationCodeChallenge returnValueNative__{};
7462 Discord_AuthorizationCodeVerifier_Challenge(&instance_, &returnValueNative__);
7463 discordpp::AuthorizationCodeChallenge returnValue__(returnValueNative__,
7464 DiscordObjectState::Owned);
7465 return returnValue__;
7466}
7467void AuthorizationCodeVerifier::SetChallenge(discordpp::AuthorizationCodeChallenge Challenge)
7468{
7469 assert(state_ == DiscordObjectState::Owned);
7470 Discord_AuthorizationCodeVerifier_SetChallenge(&instance_, Challenge.instance());
7471}
7472std::string AuthorizationCodeVerifier::Verifier() const
7473{
7474 assert(state_ == DiscordObjectState::Owned);
7475 Discord_String returnValueNative__;
7476 Discord_AuthorizationCodeVerifier_Verifier(&instance_, &returnValueNative__);
7477 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
7478 returnValueNative__.size);
7479 Discord_Free(returnValueNative__.ptr);
7480 return returnValue__;
7481}
7482void AuthorizationCodeVerifier::SetVerifier(std::string Verifier)
7483{
7484 assert(state_ == DiscordObjectState::Owned);
7485 Discord_String Verifier__str{(uint8_t*)(Verifier.data()), Verifier.size()};
7486 Discord_AuthorizationCodeVerifier_SetVerifier(&instance_, Verifier__str);
7487}
7488const AuthorizationArgs AuthorizationArgs::nullobj{{}, DiscordObjectState::Invalid};
7489AuthorizationArgs::~AuthorizationArgs()
7490{
7491 if (state_ == DiscordObjectState::Owned) {
7492 Drop();
7493 state_ = DiscordObjectState::Invalid;
7494 }
7495}
7496AuthorizationArgs::AuthorizationArgs(AuthorizationArgs&& other) noexcept
7497 : instance_(other.instance_)
7498 , state_(other.state_)
7499{
7500 other.state_ = DiscordObjectState::Invalid;
7501}
7502AuthorizationArgs& AuthorizationArgs::operator=(AuthorizationArgs&& other) noexcept
7503{
7504 if (this != &other) {
7505 if (state_ == DiscordObjectState::Owned) {
7506 Drop();
7507 }
7508 instance_ = other.instance_;
7509 state_ = other.state_;
7510 other.state_ = DiscordObjectState::Invalid;
7511 }
7512 return *this;
7513}
7514AuthorizationArgs::AuthorizationArgs(const AuthorizationArgs& arg0)
7515 : instance_{}
7516 , state_(DiscordObjectState::Invalid)
7517{
7518 if (arg0.state_ == DiscordObjectState::Owned) {
7519 Discord_AuthorizationArgs_Clone(&instance_, arg0.instance());
7520
7521 state_ = DiscordObjectState::Owned;
7522 }
7523}
7524AuthorizationArgs& AuthorizationArgs::operator=(const AuthorizationArgs& arg0)
7525{
7526 if (this != &arg0) {
7527 if (state_ == DiscordObjectState::Owned) {
7528 Drop();
7529 state_ = DiscordObjectState::Invalid;
7530 }
7531 if (arg0.state_ == DiscordObjectState::Owned) {
7532 Discord_AuthorizationArgs_Clone(&instance_, arg0.instance());
7533
7534 state_ = DiscordObjectState::Owned;
7535 }
7536 }
7537 return *this;
7538}
7539AuthorizationArgs::AuthorizationArgs(Discord_AuthorizationArgs instance, DiscordObjectState state)
7540 : instance_(instance)
7541 , state_(state)
7542{
7543}
7544AuthorizationArgs::AuthorizationArgs()
7545{
7546 assert(state_ == DiscordObjectState::Invalid);
7547 Discord_AuthorizationArgs_Init(&instance_);
7548 state_ = DiscordObjectState::Owned;
7549}
7550void AuthorizationArgs::Drop()
7551{
7552 if (state_ != DiscordObjectState::Owned) {
7553 return;
7554 }
7555 Discord_AuthorizationArgs_Drop(&instance_);
7556 state_ = DiscordObjectState::Invalid;
7557}
7558uint64_t AuthorizationArgs::ClientId() const
7559{
7560 assert(state_ == DiscordObjectState::Owned);
7561 uint64_t returnValue__;
7562 returnValue__ = Discord_AuthorizationArgs_ClientId(&instance_);
7563 return returnValue__;
7564}
7565void AuthorizationArgs::SetClientId(uint64_t ClientId)
7566{
7567 assert(state_ == DiscordObjectState::Owned);
7568 Discord_AuthorizationArgs_SetClientId(&instance_, ClientId);
7569}
7570std::string AuthorizationArgs::Scopes() const
7571{
7572 assert(state_ == DiscordObjectState::Owned);
7573 Discord_String returnValueNative__;
7574 Discord_AuthorizationArgs_Scopes(&instance_, &returnValueNative__);
7575 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
7576 returnValueNative__.size);
7577 Discord_Free(returnValueNative__.ptr);
7578 return returnValue__;
7579}
7580void AuthorizationArgs::SetScopes(std::string Scopes)
7581{
7582 assert(state_ == DiscordObjectState::Owned);
7583 Discord_String Scopes__str{(uint8_t*)(Scopes.data()), Scopes.size()};
7584 Discord_AuthorizationArgs_SetScopes(&instance_, Scopes__str);
7585}
7586std::optional<std::string> AuthorizationArgs::State() const
7587{
7588 assert(state_ == DiscordObjectState::Owned);
7589 bool returnIsNonNull__;
7590 Discord_String returnValueNative__;
7591 returnIsNonNull__ = Discord_AuthorizationArgs_State(&instance_, &returnValueNative__);
7592 if (!returnIsNonNull__) {
7593 return {};
7594 }
7595 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
7596 returnValueNative__.size);
7597 Discord_Free(returnValueNative__.ptr);
7598 return returnValue__;
7599}
7600void AuthorizationArgs::SetState(std::optional<std::string> State)
7601{
7602 assert(state_ == DiscordObjectState::Owned);
7603 Discord_String State__str{};
7604 if (State.has_value()) {
7605 State__str.ptr = reinterpret_cast<uint8_t*>(State->data());
7606 State__str.size = State->size();
7607 }
7608 Discord_AuthorizationArgs_SetState(&instance_, (State.has_value() ? &State__str : nullptr));
7609}
7610std::optional<std::string> AuthorizationArgs::Nonce() const
7611{
7612 assert(state_ == DiscordObjectState::Owned);
7613 bool returnIsNonNull__;
7614 Discord_String returnValueNative__;
7615 returnIsNonNull__ = Discord_AuthorizationArgs_Nonce(&instance_, &returnValueNative__);
7616 if (!returnIsNonNull__) {
7617 return {};
7618 }
7619 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
7620 returnValueNative__.size);
7621 Discord_Free(returnValueNative__.ptr);
7622 return returnValue__;
7623}
7624void AuthorizationArgs::SetNonce(std::optional<std::string> Nonce)
7625{
7626 assert(state_ == DiscordObjectState::Owned);
7627 Discord_String Nonce__str{};
7628 if (Nonce.has_value()) {
7629 Nonce__str.ptr = reinterpret_cast<uint8_t*>(Nonce->data());
7630 Nonce__str.size = Nonce->size();
7631 }
7632 Discord_AuthorizationArgs_SetNonce(&instance_, (Nonce.has_value() ? &Nonce__str : nullptr));
7633}
7634std::optional<discordpp::AuthorizationCodeChallenge> AuthorizationArgs::CodeChallenge() const
7635{
7636 assert(state_ == DiscordObjectState::Owned);
7637 bool returnIsNonNull__;
7638 Discord_AuthorizationCodeChallenge returnValueNative__;
7639 returnIsNonNull__ = Discord_AuthorizationArgs_CodeChallenge(&instance_, &returnValueNative__);
7640 if (!returnIsNonNull__) {
7641 return {};
7642 }
7643 discordpp::AuthorizationCodeChallenge returnValue__(returnValueNative__,
7644 DiscordObjectState::Owned);
7645 return returnValue__;
7646}
7647void AuthorizationArgs::SetCodeChallenge(
7648 std::optional<discordpp::AuthorizationCodeChallenge> CodeChallenge)
7649{
7650 assert(state_ == DiscordObjectState::Owned);
7651 Discord_AuthorizationArgs_SetCodeChallenge(
7652 &instance_, (CodeChallenge.has_value() ? CodeChallenge->instance() : nullptr));
7653}
7654std::optional<discordpp::IntegrationType> AuthorizationArgs::IntegrationType() const
7655{
7656 assert(state_ == DiscordObjectState::Owned);
7657 bool returnIsNonNull__;
7658 Discord_IntegrationType returnValueNative__;
7659 returnIsNonNull__ = Discord_AuthorizationArgs_IntegrationType(&instance_, &returnValueNative__);
7660 if (!returnIsNonNull__) {
7661 return {};
7662 }
7663 auto returnValue__ = static_cast<discordpp::IntegrationType>(returnValueNative__);
7664 return returnValue__;
7665}
7666void AuthorizationArgs::SetIntegrationType(
7667 std::optional<discordpp::IntegrationType> IntegrationType)
7668{
7669 assert(state_ == DiscordObjectState::Owned);
7670 Discord_AuthorizationArgs_SetIntegrationType(
7671 &instance_,
7672 (IntegrationType.has_value() ? reinterpret_cast<Discord_IntegrationType*>(&*IntegrationType)
7673 : nullptr));
7674}
7675std::optional<std::string> AuthorizationArgs::CustomSchemeParam() const
7676{
7677 assert(state_ == DiscordObjectState::Owned);
7678 bool returnIsNonNull__;
7679 Discord_String returnValueNative__;
7680 returnIsNonNull__ =
7681 Discord_AuthorizationArgs_CustomSchemeParam(&instance_, &returnValueNative__);
7682 if (!returnIsNonNull__) {
7683 return {};
7684 }
7685 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
7686 returnValueNative__.size);
7687 Discord_Free(returnValueNative__.ptr);
7688 return returnValue__;
7689}
7690void AuthorizationArgs::SetCustomSchemeParam(std::optional<std::string> CustomSchemeParam)
7691{
7692 assert(state_ == DiscordObjectState::Owned);
7693 Discord_String CustomSchemeParam__str{};
7694 if (CustomSchemeParam.has_value()) {
7695 CustomSchemeParam__str.ptr = reinterpret_cast<uint8_t*>(CustomSchemeParam->data());
7696 CustomSchemeParam__str.size = CustomSchemeParam->size();
7697 }
7698 Discord_AuthorizationArgs_SetCustomSchemeParam(
7699 &instance_, (CustomSchemeParam.has_value() ? &CustomSchemeParam__str : nullptr));
7700}
7701const DeviceAuthorizationArgs DeviceAuthorizationArgs::nullobj{{}, DiscordObjectState::Invalid};
7702DeviceAuthorizationArgs::~DeviceAuthorizationArgs()
7703{
7704 if (state_ == DiscordObjectState::Owned) {
7705 Drop();
7706 state_ = DiscordObjectState::Invalid;
7707 }
7708}
7709DeviceAuthorizationArgs::DeviceAuthorizationArgs(DeviceAuthorizationArgs&& other) noexcept
7710 : instance_(other.instance_)
7711 , state_(other.state_)
7712{
7713 other.state_ = DiscordObjectState::Invalid;
7714}
7715DeviceAuthorizationArgs& DeviceAuthorizationArgs::operator=(
7716 DeviceAuthorizationArgs&& other) noexcept
7717{
7718 if (this != &other) {
7719 if (state_ == DiscordObjectState::Owned) {
7720 Drop();
7721 }
7722 instance_ = other.instance_;
7723 state_ = other.state_;
7724 other.state_ = DiscordObjectState::Invalid;
7725 }
7726 return *this;
7727}
7728DeviceAuthorizationArgs::DeviceAuthorizationArgs(const DeviceAuthorizationArgs& arg0)
7729 : instance_{}
7730 , state_(DiscordObjectState::Invalid)
7731{
7732 if (arg0.state_ == DiscordObjectState::Owned) {
7733 Discord_DeviceAuthorizationArgs_Clone(&instance_, arg0.instance());
7734
7735 state_ = DiscordObjectState::Owned;
7736 }
7737}
7738DeviceAuthorizationArgs& DeviceAuthorizationArgs::operator=(const DeviceAuthorizationArgs& arg0)
7739{
7740 if (this != &arg0) {
7741 if (state_ == DiscordObjectState::Owned) {
7742 Drop();
7743 state_ = DiscordObjectState::Invalid;
7744 }
7745 if (arg0.state_ == DiscordObjectState::Owned) {
7746 Discord_DeviceAuthorizationArgs_Clone(&instance_, arg0.instance());
7747
7748 state_ = DiscordObjectState::Owned;
7749 }
7750 }
7751 return *this;
7752}
7753DeviceAuthorizationArgs::DeviceAuthorizationArgs(Discord_DeviceAuthorizationArgs instance,
7754 DiscordObjectState state)
7755 : instance_(instance)
7756 , state_(state)
7757{
7758}
7759DeviceAuthorizationArgs::DeviceAuthorizationArgs()
7760{
7761 assert(state_ == DiscordObjectState::Invalid);
7762 Discord_DeviceAuthorizationArgs_Init(&instance_);
7763 state_ = DiscordObjectState::Owned;
7764}
7765void DeviceAuthorizationArgs::Drop()
7766{
7767 if (state_ != DiscordObjectState::Owned) {
7768 return;
7769 }
7770 Discord_DeviceAuthorizationArgs_Drop(&instance_);
7771 state_ = DiscordObjectState::Invalid;
7772}
7773uint64_t DeviceAuthorizationArgs::ClientId() const
7774{
7775 assert(state_ == DiscordObjectState::Owned);
7776 uint64_t returnValue__;
7777 returnValue__ = Discord_DeviceAuthorizationArgs_ClientId(&instance_);
7778 return returnValue__;
7779}
7780void DeviceAuthorizationArgs::SetClientId(uint64_t ClientId)
7781{
7782 assert(state_ == DiscordObjectState::Owned);
7783 Discord_DeviceAuthorizationArgs_SetClientId(&instance_, ClientId);
7784}
7785std::string DeviceAuthorizationArgs::Scopes() const
7786{
7787 assert(state_ == DiscordObjectState::Owned);
7788 Discord_String returnValueNative__;
7789 Discord_DeviceAuthorizationArgs_Scopes(&instance_, &returnValueNative__);
7790 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
7791 returnValueNative__.size);
7792 Discord_Free(returnValueNative__.ptr);
7793 return returnValue__;
7794}
7795void DeviceAuthorizationArgs::SetScopes(std::string Scopes)
7796{
7797 assert(state_ == DiscordObjectState::Owned);
7798 Discord_String Scopes__str{(uint8_t*)(Scopes.data()), Scopes.size()};
7799 Discord_DeviceAuthorizationArgs_SetScopes(&instance_, Scopes__str);
7800}
7801const VoiceStateHandle VoiceStateHandle::nullobj{{}, DiscordObjectState::Invalid};
7802VoiceStateHandle::~VoiceStateHandle()
7803{
7804 if (state_ == DiscordObjectState::Owned) {
7805 Drop();
7806 state_ = DiscordObjectState::Invalid;
7807 }
7808}
7809VoiceStateHandle::VoiceStateHandle(VoiceStateHandle&& other) noexcept
7810 : instance_(other.instance_)
7811 , state_(other.state_)
7812{
7813 other.state_ = DiscordObjectState::Invalid;
7814}
7815VoiceStateHandle& VoiceStateHandle::operator=(VoiceStateHandle&& other) noexcept
7816{
7817 if (this != &other) {
7818 if (state_ == DiscordObjectState::Owned) {
7819 Drop();
7820 }
7821 instance_ = other.instance_;
7822 state_ = other.state_;
7823 other.state_ = DiscordObjectState::Invalid;
7824 }
7825 return *this;
7826}
7827VoiceStateHandle::VoiceStateHandle(const VoiceStateHandle& other)
7828 : instance_{}
7829 , state_(DiscordObjectState::Invalid)
7830{
7831 if (other.state_ == DiscordObjectState::Owned) {
7832 Discord_VoiceStateHandle_Clone(&instance_, other.instance());
7833
7834 state_ = DiscordObjectState::Owned;
7835 }
7836}
7837VoiceStateHandle& VoiceStateHandle::operator=(const VoiceStateHandle& other)
7838{
7839 if (this != &other) {
7840 if (state_ == DiscordObjectState::Owned) {
7841 Drop();
7842 state_ = DiscordObjectState::Invalid;
7843 }
7844 if (other.state_ == DiscordObjectState::Owned) {
7845 Discord_VoiceStateHandle_Clone(&instance_, other.instance());
7846
7847 state_ = DiscordObjectState::Owned;
7848 }
7849 }
7850 return *this;
7851}
7852VoiceStateHandle::VoiceStateHandle(Discord_VoiceStateHandle instance, DiscordObjectState state)
7853 : instance_(instance)
7854 , state_(state)
7855{
7856}
7857void VoiceStateHandle::Drop()
7858{
7859 if (state_ != DiscordObjectState::Owned) {
7860 return;
7861 }
7862 Discord_VoiceStateHandle_Drop(&instance_);
7863 state_ = DiscordObjectState::Invalid;
7864}
7865bool VoiceStateHandle::SelfDeaf() const
7866{
7867 assert(state_ == DiscordObjectState::Owned);
7868 bool returnValue__;
7869 returnValue__ = Discord_VoiceStateHandle_SelfDeaf(&instance_);
7870 return returnValue__;
7871}
7872bool VoiceStateHandle::SelfMute() const
7873{
7874 assert(state_ == DiscordObjectState::Owned);
7875 bool returnValue__;
7876 returnValue__ = Discord_VoiceStateHandle_SelfMute(&instance_);
7877 return returnValue__;
7878}
7879const VADThresholdSettings VADThresholdSettings::nullobj{{}, DiscordObjectState::Invalid};
7880VADThresholdSettings::~VADThresholdSettings()
7881{
7882 if (state_ == DiscordObjectState::Owned) {
7883 Drop();
7884 state_ = DiscordObjectState::Invalid;
7885 }
7886}
7887VADThresholdSettings::VADThresholdSettings(VADThresholdSettings&& other) noexcept
7888 : instance_(other.instance_)
7889 , state_(other.state_)
7890{
7891 other.state_ = DiscordObjectState::Invalid;
7892}
7893VADThresholdSettings& VADThresholdSettings::operator=(VADThresholdSettings&& other) noexcept
7894{
7895 if (this != &other) {
7896 if (state_ == DiscordObjectState::Owned) {
7897 Drop();
7898 }
7899 instance_ = other.instance_;
7900 state_ = other.state_;
7901 other.state_ = DiscordObjectState::Invalid;
7902 }
7903 return *this;
7904}
7905VADThresholdSettings::VADThresholdSettings(Discord_VADThresholdSettings instance,
7906 DiscordObjectState state)
7907 : instance_(instance)
7908 , state_(state)
7909{
7910}
7911void VADThresholdSettings::Drop()
7912{
7913 if (state_ != DiscordObjectState::Owned) {
7914 return;
7915 }
7916 Discord_VADThresholdSettings_Drop(&instance_);
7917 state_ = DiscordObjectState::Invalid;
7918}
7919float VADThresholdSettings::VadThreshold() const
7920{
7921 assert(state_ == DiscordObjectState::Owned);
7922 float returnValue__;
7923 returnValue__ = Discord_VADThresholdSettings_VadThreshold(&instance_);
7924 return returnValue__;
7925}
7926void VADThresholdSettings::SetVadThreshold(float VadThreshold)
7927{
7928 assert(state_ == DiscordObjectState::Owned);
7929 Discord_VADThresholdSettings_SetVadThreshold(&instance_, VadThreshold);
7930}
7931bool VADThresholdSettings::Automatic() const
7932{
7933 assert(state_ == DiscordObjectState::Owned);
7934 bool returnValue__;
7935 returnValue__ = Discord_VADThresholdSettings_Automatic(&instance_);
7936 return returnValue__;
7937}
7938void VADThresholdSettings::SetAutomatic(bool Automatic)
7939{
7940 assert(state_ == DiscordObjectState::Owned);
7941 Discord_VADThresholdSettings_SetAutomatic(&instance_, Automatic);
7942}
7943const Call Call::nullobj{{}, DiscordObjectState::Invalid};
7944Call::~Call()
7945{
7946 if (state_ == DiscordObjectState::Owned) {
7947 Drop();
7948 state_ = DiscordObjectState::Invalid;
7949 }
7950}
7951Call::Call(Call&& other) noexcept
7952 : instance_(other.instance_)
7953 , state_(other.state_)
7954{
7955 other.state_ = DiscordObjectState::Invalid;
7956}
7957Call& Call::operator=(Call&& other) noexcept
7958{
7959 if (this != &other) {
7960 if (state_ == DiscordObjectState::Owned) {
7961 Drop();
7962 }
7963 instance_ = other.instance_;
7964 state_ = other.state_;
7965 other.state_ = DiscordObjectState::Invalid;
7966 }
7967 return *this;
7968}
7969Call::Call(const Call& other)
7970 : instance_{}
7971 , state_(DiscordObjectState::Invalid)
7972{
7973 if (other.state_ == DiscordObjectState::Owned) {
7974 Discord_Call_Clone(&instance_, other.instance());
7975
7976 state_ = DiscordObjectState::Owned;
7977 }
7978}
7979Call& Call::operator=(const Call& other)
7980{
7981 if (this != &other) {
7982 if (state_ == DiscordObjectState::Owned) {
7983 Drop();
7984 state_ = DiscordObjectState::Invalid;
7985 }
7986 if (other.state_ == DiscordObjectState::Owned) {
7987 Discord_Call_Clone(&instance_, other.instance());
7988
7989 state_ = DiscordObjectState::Owned;
7990 }
7991 }
7992 return *this;
7993}
7994Call::Call(Discord_Call instance, DiscordObjectState state)
7995 : instance_(instance)
7996 , state_(state)
7997{
7998}
7999void Call::Drop()
8000{
8001 if (state_ != DiscordObjectState::Owned) {
8002 return;
8003 }
8004 Discord_Call_Drop(&instance_);
8005 state_ = DiscordObjectState::Invalid;
8006}
8007std::string Call::ErrorToString(discordpp::Call::Error type)
8008{
8009 Discord_String returnValueNative__;
8010 Discord_Call_ErrorToString(static_cast<Discord_Call_Error>(type), &returnValueNative__);
8011 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
8012 returnValueNative__.size);
8013 Discord_Free(returnValueNative__.ptr);
8014 return returnValue__;
8015}
8016discordpp::AudioModeType Call::GetAudioMode()
8017{
8018 assert(state_ == DiscordObjectState::Owned);
8019 Discord_AudioModeType returnValue__;
8020 returnValue__ = Discord_Call_GetAudioMode(&instance_);
8021 return static_cast<discordpp::AudioModeType>(returnValue__);
8022}
8023uint64_t Call::GetChannelId() const
8024{
8025 assert(state_ == DiscordObjectState::Owned);
8026 uint64_t returnValue__;
8027 returnValue__ = Discord_Call_GetChannelId(&instance_);
8028 return returnValue__;
8029}
8030uint64_t Call::GetGuildId() const
8031{
8032 assert(state_ == DiscordObjectState::Owned);
8033 uint64_t returnValue__;
8034 returnValue__ = Discord_Call_GetGuildId(&instance_);
8035 return returnValue__;
8036}
8037bool Call::GetLocalMute(uint64_t userId)
8038{
8039 assert(state_ == DiscordObjectState::Owned);
8040 bool returnValue__;
8041 returnValue__ = Discord_Call_GetLocalMute(&instance_, userId);
8042 return returnValue__;
8043}
8044std::vector<uint64_t> Call::GetParticipants() const
8045{
8046 assert(state_ == DiscordObjectState::Owned);
8047 Discord_UInt64Span returnValueNative__;
8048 Discord_Call_GetParticipants(&instance_, &returnValueNative__);
8049 std::vector<uint64_t> returnValue__(returnValueNative__.ptr,
8050 returnValueNative__.ptr + returnValueNative__.size);
8051 Discord_Free(returnValueNative__.ptr);
8052 return returnValue__;
8053}
8054float Call::GetParticipantVolume(uint64_t userId)
8055{
8056 assert(state_ == DiscordObjectState::Owned);
8057 float returnValue__;
8058 returnValue__ = Discord_Call_GetParticipantVolume(&instance_, userId);
8059 return returnValue__;
8060}
8061bool Call::GetPTTActive()
8062{
8063 assert(state_ == DiscordObjectState::Owned);
8064 bool returnValue__;
8065 returnValue__ = Discord_Call_GetPTTActive(&instance_);
8066 return returnValue__;
8067}
8068uint32_t Call::GetPTTReleaseDelay()
8069{
8070 assert(state_ == DiscordObjectState::Owned);
8071 uint32_t returnValue__;
8072 returnValue__ = Discord_Call_GetPTTReleaseDelay(&instance_);
8073 return returnValue__;
8074}
8075bool Call::GetSelfDeaf()
8076{
8077 assert(state_ == DiscordObjectState::Owned);
8078 bool returnValue__;
8079 returnValue__ = Discord_Call_GetSelfDeaf(&instance_);
8080 return returnValue__;
8081}
8082bool Call::GetSelfMute()
8083{
8084 assert(state_ == DiscordObjectState::Owned);
8085 bool returnValue__;
8086 returnValue__ = Discord_Call_GetSelfMute(&instance_);
8087 return returnValue__;
8088}
8089discordpp::Call::Status Call::GetStatus() const
8090{
8091 assert(state_ == DiscordObjectState::Owned);
8092 Discord_Call_Status returnValue__;
8093 returnValue__ = Discord_Call_GetStatus(&instance_);
8094 return static_cast<discordpp::Call::Status>(returnValue__);
8095}
8096discordpp::VADThresholdSettings Call::GetVADThreshold() const
8097{
8098 assert(state_ == DiscordObjectState::Owned);
8099 Discord_VADThresholdSettings returnValueNative__{};
8100 Discord_Call_GetVADThreshold(&instance_, &returnValueNative__);
8101 discordpp::VADThresholdSettings returnValue__(returnValueNative__, DiscordObjectState::Owned);
8102 return returnValue__;
8103}
8104std::optional<discordpp::VoiceStateHandle> Call::GetVoiceStateHandle(uint64_t userId) const
8105{
8106 assert(state_ == DiscordObjectState::Owned);
8107 bool returnIsNonNull__;
8108 Discord_VoiceStateHandle returnValueNative__;
8109 returnIsNonNull__ = Discord_Call_GetVoiceStateHandle(&instance_, userId, &returnValueNative__);
8110 if (!returnIsNonNull__) {
8111 return {};
8112 }
8113 discordpp::VoiceStateHandle returnValue__(returnValueNative__, DiscordObjectState::Owned);
8114 return returnValue__;
8115}
8116void Call::SetAudioMode(discordpp::AudioModeType audioMode)
8117{
8118 assert(state_ == DiscordObjectState::Owned);
8119 Discord_Call_SetAudioMode(&instance_, static_cast<Discord_AudioModeType>(audioMode));
8120}
8121void Call::SetLocalMute(uint64_t userId, bool mute)
8122{
8123 assert(state_ == DiscordObjectState::Owned);
8124 Discord_Call_SetLocalMute(&instance_, userId, mute);
8125}
8126void Call::SetOnVoiceStateChangedCallback(discordpp::Call::OnVoiceStateChanged cb)
8127{
8128 assert(state_ == DiscordObjectState::Owned);
8129 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
8130 auto cb__userData = new Tcb__UserData(cb);
8131 Discord_Call_OnVoiceStateChanged cb__native = [](auto userId, void* userData__) {
8132 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
8133 userData__typed->delegate(userId);
8134 };
8135 Discord_Call_SetOnVoiceStateChangedCallback(
8136 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
8137}
8138void Call::SetParticipantChangedCallback(discordpp::Call::OnParticipantChanged cb)
8139{
8140 assert(state_ == DiscordObjectState::Owned);
8141 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
8142 auto cb__userData = new Tcb__UserData(cb);
8143 Discord_Call_OnParticipantChanged cb__native = [](auto userId, auto added, void* userData__) {
8144 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
8145 userData__typed->delegate(userId, added);
8146 };
8147 Discord_Call_SetParticipantChangedCallback(
8148 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
8149}
8150void Call::SetParticipantVolume(uint64_t userId, float volume)
8151{
8152 assert(state_ == DiscordObjectState::Owned);
8153 Discord_Call_SetParticipantVolume(&instance_, userId, volume);
8154}
8155void Call::SetPTTActive(bool active)
8156{
8157 assert(state_ == DiscordObjectState::Owned);
8158 Discord_Call_SetPTTActive(&instance_, active);
8159}
8160void Call::SetPTTReleaseDelay(uint32_t releaseDelayMs)
8161{
8162 assert(state_ == DiscordObjectState::Owned);
8163 Discord_Call_SetPTTReleaseDelay(&instance_, releaseDelayMs);
8164}
8165void Call::SetSelfDeaf(bool deaf)
8166{
8167 assert(state_ == DiscordObjectState::Owned);
8168 Discord_Call_SetSelfDeaf(&instance_, deaf);
8169}
8170void Call::SetSelfMute(bool mute)
8171{
8172 assert(state_ == DiscordObjectState::Owned);
8173 Discord_Call_SetSelfMute(&instance_, mute);
8174}
8175void Call::SetSpeakingStatusChangedCallback(discordpp::Call::OnSpeakingStatusChanged cb)
8176{
8177 assert(state_ == DiscordObjectState::Owned);
8178 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
8179 auto cb__userData = new Tcb__UserData(cb);
8180 Discord_Call_OnSpeakingStatusChanged cb__native =
8181 [](auto userId, auto isPlayingSound, void* userData__) {
8182 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
8183 userData__typed->delegate(userId, isPlayingSound);
8184 };
8185 Discord_Call_SetSpeakingStatusChangedCallback(
8186 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
8187}
8188void Call::SetStatusChangedCallback(discordpp::Call::OnStatusChanged cb)
8189{
8190 assert(state_ == DiscordObjectState::Owned);
8191 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
8192 auto cb__userData = new Tcb__UserData(cb);
8193 Discord_Call_OnStatusChanged cb__native =
8194 [](auto status, auto error, auto errorDetail, void* userData__) {
8195 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
8196 userData__typed->delegate(static_cast<discordpp::Call::Status>(status),
8197 static_cast<discordpp::Call::Error>(error),
8198 errorDetail);
8199 };
8200 Discord_Call_SetStatusChangedCallback(
8201 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
8202}
8203void Call::SetVADThreshold(bool automatic, float threshold)
8204{
8205 assert(state_ == DiscordObjectState::Owned);
8206 Discord_Call_SetVADThreshold(&instance_, automatic, threshold);
8207}
8208std::string Call::StatusToString(discordpp::Call::Status type)
8209{
8210 Discord_String returnValueNative__;
8211 Discord_Call_StatusToString(static_cast<Discord_Call_Status>(type), &returnValueNative__);
8212 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
8213 returnValueNative__.size);
8214 Discord_Free(returnValueNative__.ptr);
8215 return returnValue__;
8216}
8217const ChannelHandle ChannelHandle::nullobj{{}, DiscordObjectState::Invalid};
8218ChannelHandle::~ChannelHandle()
8219{
8220 if (state_ == DiscordObjectState::Owned) {
8221 Drop();
8222 state_ = DiscordObjectState::Invalid;
8223 }
8224}
8225ChannelHandle::ChannelHandle(ChannelHandle&& other) noexcept
8226 : instance_(other.instance_)
8227 , state_(other.state_)
8228{
8229 other.state_ = DiscordObjectState::Invalid;
8230}
8231ChannelHandle& ChannelHandle::operator=(ChannelHandle&& other) noexcept
8232{
8233 if (this != &other) {
8234 if (state_ == DiscordObjectState::Owned) {
8235 Drop();
8236 }
8237 instance_ = other.instance_;
8238 state_ = other.state_;
8239 other.state_ = DiscordObjectState::Invalid;
8240 }
8241 return *this;
8242}
8243ChannelHandle::ChannelHandle(const ChannelHandle& other)
8244 : instance_{}
8245 , state_(DiscordObjectState::Invalid)
8246{
8247 if (other.state_ == DiscordObjectState::Owned) {
8248 Discord_ChannelHandle_Clone(&instance_, other.instance());
8249
8250 state_ = DiscordObjectState::Owned;
8251 }
8252}
8253ChannelHandle& ChannelHandle::operator=(const ChannelHandle& other)
8254{
8255 if (this != &other) {
8256 if (state_ == DiscordObjectState::Owned) {
8257 Drop();
8258 state_ = DiscordObjectState::Invalid;
8259 }
8260 if (other.state_ == DiscordObjectState::Owned) {
8261 Discord_ChannelHandle_Clone(&instance_, other.instance());
8262
8263 state_ = DiscordObjectState::Owned;
8264 }
8265 }
8266 return *this;
8267}
8268ChannelHandle::ChannelHandle(Discord_ChannelHandle instance, DiscordObjectState state)
8269 : instance_(instance)
8270 , state_(state)
8271{
8272}
8273void ChannelHandle::Drop()
8274{
8275 if (state_ != DiscordObjectState::Owned) {
8276 return;
8277 }
8278 Discord_ChannelHandle_Drop(&instance_);
8279 state_ = DiscordObjectState::Invalid;
8280}
8281uint64_t ChannelHandle::Id() const
8282{
8283 assert(state_ == DiscordObjectState::Owned);
8284 uint64_t returnValue__;
8285 returnValue__ = Discord_ChannelHandle_Id(&instance_);
8286 return returnValue__;
8287}
8288std::string ChannelHandle::Name() const
8289{
8290 assert(state_ == DiscordObjectState::Owned);
8291 Discord_String returnValueNative__;
8292 Discord_ChannelHandle_Name(&instance_, &returnValueNative__);
8293 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
8294 returnValueNative__.size);
8295 Discord_Free(returnValueNative__.ptr);
8296 return returnValue__;
8297}
8298std::vector<uint64_t> ChannelHandle::Recipients() const
8299{
8300 assert(state_ == DiscordObjectState::Owned);
8301 Discord_UInt64Span returnValueNative__;
8302 Discord_ChannelHandle_Recipients(&instance_, &returnValueNative__);
8303 std::vector<uint64_t> returnValue__(returnValueNative__.ptr,
8304 returnValueNative__.ptr + returnValueNative__.size);
8305 Discord_Free(returnValueNative__.ptr);
8306 return returnValue__;
8307}
8308discordpp::ChannelType ChannelHandle::Type() const
8309{
8310 assert(state_ == DiscordObjectState::Owned);
8311 Discord_ChannelType returnValue__;
8312 returnValue__ = Discord_ChannelHandle_Type(&instance_);
8313 return static_cast<discordpp::ChannelType>(returnValue__);
8314}
8315const GuildMinimal GuildMinimal::nullobj{{}, DiscordObjectState::Invalid};
8316GuildMinimal::~GuildMinimal()
8317{
8318 if (state_ == DiscordObjectState::Owned) {
8319 Drop();
8320 state_ = DiscordObjectState::Invalid;
8321 }
8322}
8323GuildMinimal::GuildMinimal(GuildMinimal&& other) noexcept
8324 : instance_(other.instance_)
8325 , state_(other.state_)
8326{
8327 other.state_ = DiscordObjectState::Invalid;
8328}
8329GuildMinimal& GuildMinimal::operator=(GuildMinimal&& other) noexcept
8330{
8331 if (this != &other) {
8332 if (state_ == DiscordObjectState::Owned) {
8333 Drop();
8334 }
8335 instance_ = other.instance_;
8336 state_ = other.state_;
8337 other.state_ = DiscordObjectState::Invalid;
8338 }
8339 return *this;
8340}
8341GuildMinimal::GuildMinimal(const GuildMinimal& arg0)
8342 : instance_{}
8343 , state_(DiscordObjectState::Invalid)
8344{
8345 if (arg0.state_ == DiscordObjectState::Owned) {
8346 Discord_GuildMinimal_Clone(&instance_, arg0.instance());
8347
8348 state_ = DiscordObjectState::Owned;
8349 }
8350}
8351GuildMinimal& GuildMinimal::operator=(const GuildMinimal& arg0)
8352{
8353 if (this != &arg0) {
8354 if (state_ == DiscordObjectState::Owned) {
8355 Drop();
8356 state_ = DiscordObjectState::Invalid;
8357 }
8358 if (arg0.state_ == DiscordObjectState::Owned) {
8359 Discord_GuildMinimal_Clone(&instance_, arg0.instance());
8360
8361 state_ = DiscordObjectState::Owned;
8362 }
8363 }
8364 return *this;
8365}
8366GuildMinimal::GuildMinimal(Discord_GuildMinimal instance, DiscordObjectState state)
8367 : instance_(instance)
8368 , state_(state)
8369{
8370}
8371void GuildMinimal::Drop()
8372{
8373 if (state_ != DiscordObjectState::Owned) {
8374 return;
8375 }
8376 Discord_GuildMinimal_Drop(&instance_);
8377 state_ = DiscordObjectState::Invalid;
8378}
8379uint64_t GuildMinimal::Id() const
8380{
8381 assert(state_ == DiscordObjectState::Owned);
8382 uint64_t returnValue__;
8383 returnValue__ = Discord_GuildMinimal_Id(&instance_);
8384 return returnValue__;
8385}
8386void GuildMinimal::SetId(uint64_t Id)
8387{
8388 assert(state_ == DiscordObjectState::Owned);
8389 Discord_GuildMinimal_SetId(&instance_, Id);
8390}
8391std::string GuildMinimal::Name() const
8392{
8393 assert(state_ == DiscordObjectState::Owned);
8394 Discord_String returnValueNative__;
8395 Discord_GuildMinimal_Name(&instance_, &returnValueNative__);
8396 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
8397 returnValueNative__.size);
8398 Discord_Free(returnValueNative__.ptr);
8399 return returnValue__;
8400}
8401void GuildMinimal::SetName(std::string Name)
8402{
8403 assert(state_ == DiscordObjectState::Owned);
8404 Discord_String Name__str{(uint8_t*)(Name.data()), Name.size()};
8405 Discord_GuildMinimal_SetName(&instance_, Name__str);
8406}
8407const GuildChannel GuildChannel::nullobj{{}, DiscordObjectState::Invalid};
8408GuildChannel::~GuildChannel()
8409{
8410 if (state_ == DiscordObjectState::Owned) {
8411 Drop();
8412 state_ = DiscordObjectState::Invalid;
8413 }
8414}
8415GuildChannel::GuildChannel(GuildChannel&& other) noexcept
8416 : instance_(other.instance_)
8417 , state_(other.state_)
8418{
8419 other.state_ = DiscordObjectState::Invalid;
8420}
8421GuildChannel& GuildChannel::operator=(GuildChannel&& other) noexcept
8422{
8423 if (this != &other) {
8424 if (state_ == DiscordObjectState::Owned) {
8425 Drop();
8426 }
8427 instance_ = other.instance_;
8428 state_ = other.state_;
8429 other.state_ = DiscordObjectState::Invalid;
8430 }
8431 return *this;
8432}
8433GuildChannel::GuildChannel(const GuildChannel& arg0)
8434 : instance_{}
8435 , state_(DiscordObjectState::Invalid)
8436{
8437 if (arg0.state_ == DiscordObjectState::Owned) {
8438 Discord_GuildChannel_Clone(&instance_, arg0.instance());
8439
8440 state_ = DiscordObjectState::Owned;
8441 }
8442}
8443GuildChannel& GuildChannel::operator=(const GuildChannel& arg0)
8444{
8445 if (this != &arg0) {
8446 if (state_ == DiscordObjectState::Owned) {
8447 Drop();
8448 state_ = DiscordObjectState::Invalid;
8449 }
8450 if (arg0.state_ == DiscordObjectState::Owned) {
8451 Discord_GuildChannel_Clone(&instance_, arg0.instance());
8452
8453 state_ = DiscordObjectState::Owned;
8454 }
8455 }
8456 return *this;
8457}
8458GuildChannel::GuildChannel(Discord_GuildChannel instance, DiscordObjectState state)
8459 : instance_(instance)
8460 , state_(state)
8461{
8462}
8463void GuildChannel::Drop()
8464{
8465 if (state_ != DiscordObjectState::Owned) {
8466 return;
8467 }
8468 Discord_GuildChannel_Drop(&instance_);
8469 state_ = DiscordObjectState::Invalid;
8470}
8471uint64_t GuildChannel::Id() const
8472{
8473 assert(state_ == DiscordObjectState::Owned);
8474 uint64_t returnValue__;
8475 returnValue__ = Discord_GuildChannel_Id(&instance_);
8476 return returnValue__;
8477}
8478void GuildChannel::SetId(uint64_t Id)
8479{
8480 assert(state_ == DiscordObjectState::Owned);
8481 Discord_GuildChannel_SetId(&instance_, Id);
8482}
8483std::string GuildChannel::Name() const
8484{
8485 assert(state_ == DiscordObjectState::Owned);
8486 Discord_String returnValueNative__;
8487 Discord_GuildChannel_Name(&instance_, &returnValueNative__);
8488 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
8489 returnValueNative__.size);
8490 Discord_Free(returnValueNative__.ptr);
8491 return returnValue__;
8492}
8493void GuildChannel::SetName(std::string Name)
8494{
8495 assert(state_ == DiscordObjectState::Owned);
8496 Discord_String Name__str{(uint8_t*)(Name.data()), Name.size()};
8497 Discord_GuildChannel_SetName(&instance_, Name__str);
8498}
8499discordpp::ChannelType GuildChannel::Type() const
8500{
8501 assert(state_ == DiscordObjectState::Owned);
8502 Discord_ChannelType returnValue__;
8503 returnValue__ = Discord_GuildChannel_Type(&instance_);
8504 return static_cast<discordpp::ChannelType>(returnValue__);
8505}
8506void GuildChannel::SetType(discordpp::ChannelType Type)
8507{
8508 assert(state_ == DiscordObjectState::Owned);
8509 Discord_GuildChannel_SetType(&instance_, static_cast<Discord_ChannelType>(Type));
8510}
8511int32_t GuildChannel::Position() const
8512{
8513 assert(state_ == DiscordObjectState::Owned);
8514 int32_t returnValue__;
8515 returnValue__ = Discord_GuildChannel_Position(&instance_);
8516 return returnValue__;
8517}
8518void GuildChannel::SetPosition(int32_t Position)
8519{
8520 assert(state_ == DiscordObjectState::Owned);
8521 Discord_GuildChannel_SetPosition(&instance_, Position);
8522}
8523std::optional<uint64_t> GuildChannel::ParentId() const
8524{
8525 assert(state_ == DiscordObjectState::Owned);
8526 bool returnIsNonNull__;
8527 uint64_t returnValue__;
8528 returnIsNonNull__ = Discord_GuildChannel_ParentId(&instance_, &returnValue__);
8529 if (!returnIsNonNull__) {
8530 return std::nullopt;
8531 }
8532 return returnValue__;
8533}
8534void GuildChannel::SetParentId(std::optional<uint64_t> ParentId)
8535{
8536 assert(state_ == DiscordObjectState::Owned);
8537 Discord_GuildChannel_SetParentId(&instance_, (ParentId.has_value() ? &*ParentId : nullptr));
8538}
8539bool GuildChannel::IsLinkable() const
8540{
8541 assert(state_ == DiscordObjectState::Owned);
8542 bool returnValue__;
8543 returnValue__ = Discord_GuildChannel_IsLinkable(&instance_);
8544 return returnValue__;
8545}
8546void GuildChannel::SetIsLinkable(bool IsLinkable)
8547{
8548 assert(state_ == DiscordObjectState::Owned);
8549 Discord_GuildChannel_SetIsLinkable(&instance_, IsLinkable);
8550}
8551bool GuildChannel::IsViewableAndWriteableByAllMembers() const
8552{
8553 assert(state_ == DiscordObjectState::Owned);
8554 bool returnValue__;
8555 returnValue__ = Discord_GuildChannel_IsViewableAndWriteableByAllMembers(&instance_);
8556 return returnValue__;
8557}
8558void GuildChannel::SetIsViewableAndWriteableByAllMembers(bool IsViewableAndWriteableByAllMembers)
8559{
8560 assert(state_ == DiscordObjectState::Owned);
8561 Discord_GuildChannel_SetIsViewableAndWriteableByAllMembers(&instance_,
8562 IsViewableAndWriteableByAllMembers);
8563}
8564std::optional<discordpp::LinkedLobby> GuildChannel::LinkedLobby() const
8565{
8566 assert(state_ == DiscordObjectState::Owned);
8567 bool returnIsNonNull__;
8568 Discord_LinkedLobby returnValueNative__;
8569 returnIsNonNull__ = Discord_GuildChannel_LinkedLobby(&instance_, &returnValueNative__);
8570 if (!returnIsNonNull__) {
8571 return {};
8572 }
8573 discordpp::LinkedLobby returnValue__(returnValueNative__, DiscordObjectState::Owned);
8574 return returnValue__;
8575}
8576void GuildChannel::SetLinkedLobby(std::optional<discordpp::LinkedLobby> LinkedLobby)
8577{
8578 assert(state_ == DiscordObjectState::Owned);
8579 Discord_GuildChannel_SetLinkedLobby(
8580 &instance_, (LinkedLobby.has_value() ? LinkedLobby->instance() : nullptr));
8581}
8582const LinkedLobby LinkedLobby::nullobj{{}, DiscordObjectState::Invalid};
8583LinkedLobby::~LinkedLobby()
8584{
8585 if (state_ == DiscordObjectState::Owned) {
8586 Drop();
8587 state_ = DiscordObjectState::Invalid;
8588 }
8589}
8590LinkedLobby::LinkedLobby(LinkedLobby&& other) noexcept
8591 : instance_(other.instance_)
8592 , state_(other.state_)
8593{
8594 other.state_ = DiscordObjectState::Invalid;
8595}
8596LinkedLobby& LinkedLobby::operator=(LinkedLobby&& other) noexcept
8597{
8598 if (this != &other) {
8599 if (state_ == DiscordObjectState::Owned) {
8600 Drop();
8601 }
8602 instance_ = other.instance_;
8603 state_ = other.state_;
8604 other.state_ = DiscordObjectState::Invalid;
8605 }
8606 return *this;
8607}
8608LinkedLobby::LinkedLobby(const LinkedLobby& arg0)
8609 : instance_{}
8610 , state_(DiscordObjectState::Invalid)
8611{
8612 if (arg0.state_ == DiscordObjectState::Owned) {
8613 Discord_LinkedLobby_Clone(&instance_, arg0.instance());
8614
8615 state_ = DiscordObjectState::Owned;
8616 }
8617}
8618LinkedLobby& LinkedLobby::operator=(const LinkedLobby& arg0)
8619{
8620 if (this != &arg0) {
8621 if (state_ == DiscordObjectState::Owned) {
8622 Drop();
8623 state_ = DiscordObjectState::Invalid;
8624 }
8625 if (arg0.state_ == DiscordObjectState::Owned) {
8626 Discord_LinkedLobby_Clone(&instance_, arg0.instance());
8627
8628 state_ = DiscordObjectState::Owned;
8629 }
8630 }
8631 return *this;
8632}
8633LinkedLobby::LinkedLobby(Discord_LinkedLobby instance, DiscordObjectState state)
8634 : instance_(instance)
8635 , state_(state)
8636{
8637}
8638LinkedLobby::LinkedLobby()
8639{
8640 assert(state_ == DiscordObjectState::Invalid);
8641 Discord_LinkedLobby_Init(&instance_);
8642 state_ = DiscordObjectState::Owned;
8643}
8644void LinkedLobby::Drop()
8645{
8646 if (state_ != DiscordObjectState::Owned) {
8647 return;
8648 }
8649 Discord_LinkedLobby_Drop(&instance_);
8650 state_ = DiscordObjectState::Invalid;
8651}
8652uint64_t LinkedLobby::ApplicationId() const
8653{
8654 assert(state_ == DiscordObjectState::Owned);
8655 uint64_t returnValue__;
8656 returnValue__ = Discord_LinkedLobby_ApplicationId(&instance_);
8657 return returnValue__;
8658}
8659void LinkedLobby::SetApplicationId(uint64_t ApplicationId)
8660{
8661 assert(state_ == DiscordObjectState::Owned);
8662 Discord_LinkedLobby_SetApplicationId(&instance_, ApplicationId);
8663}
8664uint64_t LinkedLobby::LobbyId() const
8665{
8666 assert(state_ == DiscordObjectState::Owned);
8667 uint64_t returnValue__;
8668 returnValue__ = Discord_LinkedLobby_LobbyId(&instance_);
8669 return returnValue__;
8670}
8671void LinkedLobby::SetLobbyId(uint64_t LobbyId)
8672{
8673 assert(state_ == DiscordObjectState::Owned);
8674 Discord_LinkedLobby_SetLobbyId(&instance_, LobbyId);
8675}
8676const LinkedChannel LinkedChannel::nullobj{{}, DiscordObjectState::Invalid};
8677LinkedChannel::~LinkedChannel()
8678{
8679 if (state_ == DiscordObjectState::Owned) {
8680 Drop();
8681 state_ = DiscordObjectState::Invalid;
8682 }
8683}
8684LinkedChannel::LinkedChannel(LinkedChannel&& other) noexcept
8685 : instance_(other.instance_)
8686 , state_(other.state_)
8687{
8688 other.state_ = DiscordObjectState::Invalid;
8689}
8690LinkedChannel& LinkedChannel::operator=(LinkedChannel&& other) noexcept
8691{
8692 if (this != &other) {
8693 if (state_ == DiscordObjectState::Owned) {
8694 Drop();
8695 }
8696 instance_ = other.instance_;
8697 state_ = other.state_;
8698 other.state_ = DiscordObjectState::Invalid;
8699 }
8700 return *this;
8701}
8702LinkedChannel::LinkedChannel(const LinkedChannel& arg0)
8703 : instance_{}
8704 , state_(DiscordObjectState::Invalid)
8705{
8706 if (arg0.state_ == DiscordObjectState::Owned) {
8707 Discord_LinkedChannel_Clone(&instance_, arg0.instance());
8708
8709 state_ = DiscordObjectState::Owned;
8710 }
8711}
8712LinkedChannel& LinkedChannel::operator=(const LinkedChannel& arg0)
8713{
8714 if (this != &arg0) {
8715 if (state_ == DiscordObjectState::Owned) {
8716 Drop();
8717 state_ = DiscordObjectState::Invalid;
8718 }
8719 if (arg0.state_ == DiscordObjectState::Owned) {
8720 Discord_LinkedChannel_Clone(&instance_, arg0.instance());
8721
8722 state_ = DiscordObjectState::Owned;
8723 }
8724 }
8725 return *this;
8726}
8727LinkedChannel::LinkedChannel(Discord_LinkedChannel instance, DiscordObjectState state)
8728 : instance_(instance)
8729 , state_(state)
8730{
8731}
8732void LinkedChannel::Drop()
8733{
8734 if (state_ != DiscordObjectState::Owned) {
8735 return;
8736 }
8737 Discord_LinkedChannel_Drop(&instance_);
8738 state_ = DiscordObjectState::Invalid;
8739}
8740uint64_t LinkedChannel::Id() const
8741{
8742 assert(state_ == DiscordObjectState::Owned);
8743 uint64_t returnValue__;
8744 returnValue__ = Discord_LinkedChannel_Id(&instance_);
8745 return returnValue__;
8746}
8747void LinkedChannel::SetId(uint64_t Id)
8748{
8749 assert(state_ == DiscordObjectState::Owned);
8750 Discord_LinkedChannel_SetId(&instance_, Id);
8751}
8752std::string LinkedChannel::Name() const
8753{
8754 assert(state_ == DiscordObjectState::Owned);
8755 Discord_String returnValueNative__;
8756 Discord_LinkedChannel_Name(&instance_, &returnValueNative__);
8757 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
8758 returnValueNative__.size);
8759 Discord_Free(returnValueNative__.ptr);
8760 return returnValue__;
8761}
8762void LinkedChannel::SetName(std::string Name)
8763{
8764 assert(state_ == DiscordObjectState::Owned);
8765 Discord_String Name__str{(uint8_t*)(Name.data()), Name.size()};
8766 Discord_LinkedChannel_SetName(&instance_, Name__str);
8767}
8768uint64_t LinkedChannel::GuildId() const
8769{
8770 assert(state_ == DiscordObjectState::Owned);
8771 uint64_t returnValue__;
8772 returnValue__ = Discord_LinkedChannel_GuildId(&instance_);
8773 return returnValue__;
8774}
8775void LinkedChannel::SetGuildId(uint64_t GuildId)
8776{
8777 assert(state_ == DiscordObjectState::Owned);
8778 Discord_LinkedChannel_SetGuildId(&instance_, GuildId);
8779}
8780const RelationshipHandle RelationshipHandle::nullobj{{}, DiscordObjectState::Invalid};
8781RelationshipHandle::~RelationshipHandle()
8782{
8783 if (state_ == DiscordObjectState::Owned) {
8784 Drop();
8785 state_ = DiscordObjectState::Invalid;
8786 }
8787}
8788RelationshipHandle::RelationshipHandle(RelationshipHandle&& other) noexcept
8789 : instance_(other.instance_)
8790 , state_(other.state_)
8791{
8792 other.state_ = DiscordObjectState::Invalid;
8793}
8794RelationshipHandle& RelationshipHandle::operator=(RelationshipHandle&& other) noexcept
8795{
8796 if (this != &other) {
8797 if (state_ == DiscordObjectState::Owned) {
8798 Drop();
8799 }
8800 instance_ = other.instance_;
8801 state_ = other.state_;
8802 other.state_ = DiscordObjectState::Invalid;
8803 }
8804 return *this;
8805}
8806RelationshipHandle::RelationshipHandle(const RelationshipHandle& other)
8807 : instance_{}
8808 , state_(DiscordObjectState::Invalid)
8809{
8810 if (other.state_ == DiscordObjectState::Owned) {
8811 Discord_RelationshipHandle_Clone(&instance_, other.instance());
8812
8813 state_ = DiscordObjectState::Owned;
8814 }
8815}
8816RelationshipHandle& RelationshipHandle::operator=(const RelationshipHandle& other)
8817{
8818 if (this != &other) {
8819 if (state_ == DiscordObjectState::Owned) {
8820 Drop();
8821 state_ = DiscordObjectState::Invalid;
8822 }
8823 if (other.state_ == DiscordObjectState::Owned) {
8824 Discord_RelationshipHandle_Clone(&instance_, other.instance());
8825
8826 state_ = DiscordObjectState::Owned;
8827 }
8828 }
8829 return *this;
8830}
8831RelationshipHandle::RelationshipHandle(Discord_RelationshipHandle instance,
8832 DiscordObjectState state)
8833 : instance_(instance)
8834 , state_(state)
8835{
8836}
8837void RelationshipHandle::Drop()
8838{
8839 if (state_ != DiscordObjectState::Owned) {
8840 return;
8841 }
8842 Discord_RelationshipHandle_Drop(&instance_);
8843 state_ = DiscordObjectState::Invalid;
8844}
8845discordpp::RelationshipType RelationshipHandle::DiscordRelationshipType() const
8846{
8847 assert(state_ == DiscordObjectState::Owned);
8848 Discord_RelationshipType returnValue__;
8849 returnValue__ = Discord_RelationshipHandle_DiscordRelationshipType(&instance_);
8850 return static_cast<discordpp::RelationshipType>(returnValue__);
8851}
8852discordpp::RelationshipType RelationshipHandle::GameRelationshipType() const
8853{
8854 assert(state_ == DiscordObjectState::Owned);
8855 Discord_RelationshipType returnValue__;
8856 returnValue__ = Discord_RelationshipHandle_GameRelationshipType(&instance_);
8857 return static_cast<discordpp::RelationshipType>(returnValue__);
8858}
8859uint64_t RelationshipHandle::Id() const
8860{
8861 assert(state_ == DiscordObjectState::Owned);
8862 uint64_t returnValue__;
8863 returnValue__ = Discord_RelationshipHandle_Id(&instance_);
8864 return returnValue__;
8865}
8866bool RelationshipHandle::IsSpamRequest() const
8867{
8868 assert(state_ == DiscordObjectState::Owned);
8869 bool returnValue__;
8870 returnValue__ = Discord_RelationshipHandle_IsSpamRequest(&instance_);
8871 return returnValue__;
8872}
8873std::optional<discordpp::UserHandle> RelationshipHandle::User() const
8874{
8875 assert(state_ == DiscordObjectState::Owned);
8876 bool returnIsNonNull__;
8877 Discord_UserHandle returnValueNative__;
8878 returnIsNonNull__ = Discord_RelationshipHandle_User(&instance_, &returnValueNative__);
8879 if (!returnIsNonNull__) {
8880 return {};
8881 }
8882 discordpp::UserHandle returnValue__(returnValueNative__, DiscordObjectState::Owned);
8883 return returnValue__;
8884}
8885const UserApplicationProfileHandle UserApplicationProfileHandle::nullobj{
8886 {},
8887 DiscordObjectState::Invalid};
8888UserApplicationProfileHandle::~UserApplicationProfileHandle()
8889{
8890 if (state_ == DiscordObjectState::Owned) {
8891 Drop();
8892 state_ = DiscordObjectState::Invalid;
8893 }
8894}
8895UserApplicationProfileHandle::UserApplicationProfileHandle(
8896 UserApplicationProfileHandle&& other) noexcept
8897 : instance_(other.instance_)
8898 , state_(other.state_)
8899{
8900 other.state_ = DiscordObjectState::Invalid;
8901}
8902UserApplicationProfileHandle& UserApplicationProfileHandle::operator=(
8903 UserApplicationProfileHandle&& other) noexcept
8904{
8905 if (this != &other) {
8906 if (state_ == DiscordObjectState::Owned) {
8907 Drop();
8908 }
8909 instance_ = other.instance_;
8910 state_ = other.state_;
8911 other.state_ = DiscordObjectState::Invalid;
8912 }
8913 return *this;
8914}
8915UserApplicationProfileHandle::UserApplicationProfileHandle(
8916 const UserApplicationProfileHandle& other)
8917 : instance_{}
8918 , state_(DiscordObjectState::Invalid)
8919{
8920 if (other.state_ == DiscordObjectState::Owned) {
8921 Discord_UserApplicationProfileHandle_Clone(&instance_, other.instance());
8922
8923 state_ = DiscordObjectState::Owned;
8924 }
8925}
8926UserApplicationProfileHandle& UserApplicationProfileHandle::operator=(
8927 const UserApplicationProfileHandle& other)
8928{
8929 if (this != &other) {
8930 if (state_ == DiscordObjectState::Owned) {
8931 Drop();
8932 state_ = DiscordObjectState::Invalid;
8933 }
8934 if (other.state_ == DiscordObjectState::Owned) {
8935 Discord_UserApplicationProfileHandle_Clone(&instance_, other.instance());
8936
8937 state_ = DiscordObjectState::Owned;
8938 }
8939 }
8940 return *this;
8941}
8942UserApplicationProfileHandle::UserApplicationProfileHandle(
8943 Discord_UserApplicationProfileHandle instance,
8944 DiscordObjectState state)
8945 : instance_(instance)
8946 , state_(state)
8947{
8948}
8949void UserApplicationProfileHandle::Drop()
8950{
8951 if (state_ != DiscordObjectState::Owned) {
8952 return;
8953 }
8954 Discord_UserApplicationProfileHandle_Drop(&instance_);
8955 state_ = DiscordObjectState::Invalid;
8956}
8957std::string UserApplicationProfileHandle::AvatarHash() const
8958{
8959 assert(state_ == DiscordObjectState::Owned);
8960 Discord_String returnValueNative__;
8961 Discord_UserApplicationProfileHandle_AvatarHash(&instance_, &returnValueNative__);
8962 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
8963 returnValueNative__.size);
8964 Discord_Free(returnValueNative__.ptr);
8965 return returnValue__;
8966}
8967std::string UserApplicationProfileHandle::Metadata() const
8968{
8969 assert(state_ == DiscordObjectState::Owned);
8970 Discord_String returnValueNative__;
8971 Discord_UserApplicationProfileHandle_Metadata(&instance_, &returnValueNative__);
8972 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
8973 returnValueNative__.size);
8974 Discord_Free(returnValueNative__.ptr);
8975 return returnValue__;
8976}
8977std::optional<std::string> UserApplicationProfileHandle::ProviderId() const
8978{
8979 assert(state_ == DiscordObjectState::Owned);
8980 bool returnIsNonNull__;
8981 Discord_String returnValueNative__;
8982 returnIsNonNull__ =
8983 Discord_UserApplicationProfileHandle_ProviderId(&instance_, &returnValueNative__);
8984 if (!returnIsNonNull__) {
8985 return {};
8986 }
8987 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
8988 returnValueNative__.size);
8989 Discord_Free(returnValueNative__.ptr);
8990 return returnValue__;
8991}
8992std::string UserApplicationProfileHandle::ProviderIssuedUserId() const
8993{
8994 assert(state_ == DiscordObjectState::Owned);
8995 Discord_String returnValueNative__;
8996 Discord_UserApplicationProfileHandle_ProviderIssuedUserId(&instance_, &returnValueNative__);
8997 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
8998 returnValueNative__.size);
8999 Discord_Free(returnValueNative__.ptr);
9000 return returnValue__;
9001}
9002discordpp::ExternalIdentityProviderType UserApplicationProfileHandle::ProviderType() const
9003{
9004 assert(state_ == DiscordObjectState::Owned);
9005 Discord_ExternalIdentityProviderType returnValue__;
9006 returnValue__ = Discord_UserApplicationProfileHandle_ProviderType(&instance_);
9007 return static_cast<discordpp::ExternalIdentityProviderType>(returnValue__);
9008}
9009std::string UserApplicationProfileHandle::Username() const
9010{
9011 assert(state_ == DiscordObjectState::Owned);
9012 Discord_String returnValueNative__;
9013 Discord_UserApplicationProfileHandle_Username(&instance_, &returnValueNative__);
9014 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
9015 returnValueNative__.size);
9016 Discord_Free(returnValueNative__.ptr);
9017 return returnValue__;
9018}
9019const UserHandle UserHandle::nullobj{{}, DiscordObjectState::Invalid};
9020UserHandle::~UserHandle()
9021{
9022 if (state_ == DiscordObjectState::Owned) {
9023 Drop();
9024 state_ = DiscordObjectState::Invalid;
9025 }
9026}
9027UserHandle::UserHandle(UserHandle&& other) noexcept
9028 : instance_(other.instance_)
9029 , state_(other.state_)
9030{
9031 other.state_ = DiscordObjectState::Invalid;
9032}
9033UserHandle& UserHandle::operator=(UserHandle&& other) noexcept
9034{
9035 if (this != &other) {
9036 if (state_ == DiscordObjectState::Owned) {
9037 Drop();
9038 }
9039 instance_ = other.instance_;
9040 state_ = other.state_;
9041 other.state_ = DiscordObjectState::Invalid;
9042 }
9043 return *this;
9044}
9045UserHandle::UserHandle(const UserHandle& arg0)
9046 : instance_{}
9047 , state_(DiscordObjectState::Invalid)
9048{
9049 if (arg0.state_ == DiscordObjectState::Owned) {
9050 Discord_UserHandle_Clone(&instance_, arg0.instance());
9051
9052 state_ = DiscordObjectState::Owned;
9053 }
9054}
9055UserHandle& UserHandle::operator=(const UserHandle& arg0)
9056{
9057 if (this != &arg0) {
9058 if (state_ == DiscordObjectState::Owned) {
9059 Drop();
9060 state_ = DiscordObjectState::Invalid;
9061 }
9062 if (arg0.state_ == DiscordObjectState::Owned) {
9063 Discord_UserHandle_Clone(&instance_, arg0.instance());
9064
9065 state_ = DiscordObjectState::Owned;
9066 }
9067 }
9068 return *this;
9069}
9070UserHandle::UserHandle(Discord_UserHandle instance, DiscordObjectState state)
9071 : instance_(instance)
9072 , state_(state)
9073{
9074}
9075void UserHandle::Drop()
9076{
9077 if (state_ != DiscordObjectState::Owned) {
9078 return;
9079 }
9080 Discord_UserHandle_Drop(&instance_);
9081 state_ = DiscordObjectState::Invalid;
9082}
9083std::optional<std::string> UserHandle::Avatar() const
9084{
9085 assert(state_ == DiscordObjectState::Owned);
9086 bool returnIsNonNull__;
9087 Discord_String returnValueNative__;
9088 returnIsNonNull__ = Discord_UserHandle_Avatar(&instance_, &returnValueNative__);
9089 if (!returnIsNonNull__) {
9090 return {};
9091 }
9092 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
9093 returnValueNative__.size);
9094 Discord_Free(returnValueNative__.ptr);
9095 return returnValue__;
9096}
9097std::string UserHandle::AvatarTypeToString(discordpp::UserHandle::AvatarType type)
9098{
9099 Discord_String returnValueNative__;
9100 Discord_UserHandle_AvatarTypeToString(static_cast<Discord_UserHandle_AvatarType>(type),
9101 &returnValueNative__);
9102 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
9103 returnValueNative__.size);
9104 Discord_Free(returnValueNative__.ptr);
9105 return returnValue__;
9106}
9107std::string UserHandle::AvatarUrl(discordpp::UserHandle::AvatarType animatedType,
9108 discordpp::UserHandle::AvatarType staticType) const
9109{
9110 assert(state_ == DiscordObjectState::Owned);
9111 Discord_String returnValueNative__;
9112 Discord_UserHandle_AvatarUrl(&instance_,
9113 static_cast<Discord_UserHandle_AvatarType>(animatedType),
9114 static_cast<Discord_UserHandle_AvatarType>(staticType),
9115 &returnValueNative__);
9116 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
9117 returnValueNative__.size);
9118 Discord_Free(returnValueNative__.ptr);
9119 return returnValue__;
9120}
9121std::string UserHandle::DisplayName() const
9122{
9123 assert(state_ == DiscordObjectState::Owned);
9124 Discord_String returnValueNative__;
9125 Discord_UserHandle_DisplayName(&instance_, &returnValueNative__);
9126 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
9127 returnValueNative__.size);
9128 Discord_Free(returnValueNative__.ptr);
9129 return returnValue__;
9130}
9131std::optional<discordpp::Activity> UserHandle::GameActivity() const
9132{
9133 assert(state_ == DiscordObjectState::Owned);
9134 bool returnIsNonNull__;
9135 Discord_Activity returnValueNative__;
9136 returnIsNonNull__ = Discord_UserHandle_GameActivity(&instance_, &returnValueNative__);
9137 if (!returnIsNonNull__) {
9138 return {};
9139 }
9140 discordpp::Activity returnValue__(returnValueNative__, DiscordObjectState::Owned);
9141 return returnValue__;
9142}
9143std::optional<std::string> UserHandle::GlobalName() const
9144{
9145 assert(state_ == DiscordObjectState::Owned);
9146 bool returnIsNonNull__;
9147 Discord_String returnValueNative__;
9148 returnIsNonNull__ = Discord_UserHandle_GlobalName(&instance_, &returnValueNative__);
9149 if (!returnIsNonNull__) {
9150 return {};
9151 }
9152 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
9153 returnValueNative__.size);
9154 Discord_Free(returnValueNative__.ptr);
9155 return returnValue__;
9156}
9157uint64_t UserHandle::Id() const
9158{
9159 assert(state_ == DiscordObjectState::Owned);
9160 uint64_t returnValue__;
9161 returnValue__ = Discord_UserHandle_Id(&instance_);
9162 return returnValue__;
9163}
9164bool UserHandle::IsProvisional() const
9165{
9166 assert(state_ == DiscordObjectState::Owned);
9167 bool returnValue__;
9168 returnValue__ = Discord_UserHandle_IsProvisional(&instance_);
9169 return returnValue__;
9170}
9171discordpp::RelationshipHandle UserHandle::Relationship() const
9172{
9173 assert(state_ == DiscordObjectState::Owned);
9174 Discord_RelationshipHandle returnValueNative__{};
9175 Discord_UserHandle_Relationship(&instance_, &returnValueNative__);
9176 discordpp::RelationshipHandle returnValue__(returnValueNative__, DiscordObjectState::Owned);
9177 return returnValue__;
9178}
9179discordpp::StatusType UserHandle::Status() const
9180{
9181 assert(state_ == DiscordObjectState::Owned);
9182 Discord_StatusType returnValue__;
9183 returnValue__ = Discord_UserHandle_Status(&instance_);
9184 return static_cast<discordpp::StatusType>(returnValue__);
9185}
9186std::vector<discordpp::UserApplicationProfileHandle> UserHandle::UserApplicationProfiles() const
9187{
9188 assert(state_ == DiscordObjectState::Owned);
9189 Discord_UserApplicationProfileHandleSpan returnValueNative__;
9190 Discord_UserHandle_UserApplicationProfiles(&instance_, &returnValueNative__);
9191 std::vector<discordpp::UserApplicationProfileHandle> returnValue__;
9192 returnValue__.reserve(returnValueNative__.size);
9193 for (size_t i__ = 0; i__ < returnValueNative__.size; ++i__) {
9194 returnValue__.emplace_back(returnValueNative__.ptr[i__], DiscordObjectState::Owned);
9195 }
9196 Discord_Free(returnValueNative__.ptr);
9197 return returnValue__;
9198}
9199std::string UserHandle::Username() const
9200{
9201 assert(state_ == DiscordObjectState::Owned);
9202 Discord_String returnValueNative__;
9203 Discord_UserHandle_Username(&instance_, &returnValueNative__);
9204 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
9205 returnValueNative__.size);
9206 Discord_Free(returnValueNative__.ptr);
9207 return returnValue__;
9208}
9209const LobbyMemberHandle LobbyMemberHandle::nullobj{{}, DiscordObjectState::Invalid};
9210LobbyMemberHandle::~LobbyMemberHandle()
9211{
9212 if (state_ == DiscordObjectState::Owned) {
9213 Drop();
9214 state_ = DiscordObjectState::Invalid;
9215 }
9216}
9217LobbyMemberHandle::LobbyMemberHandle(LobbyMemberHandle&& other) noexcept
9218 : instance_(other.instance_)
9219 , state_(other.state_)
9220{
9221 other.state_ = DiscordObjectState::Invalid;
9222}
9223LobbyMemberHandle& LobbyMemberHandle::operator=(LobbyMemberHandle&& other) noexcept
9224{
9225 if (this != &other) {
9226 if (state_ == DiscordObjectState::Owned) {
9227 Drop();
9228 }
9229 instance_ = other.instance_;
9230 state_ = other.state_;
9231 other.state_ = DiscordObjectState::Invalid;
9232 }
9233 return *this;
9234}
9235LobbyMemberHandle::LobbyMemberHandle(const LobbyMemberHandle& other)
9236 : instance_{}
9237 , state_(DiscordObjectState::Invalid)
9238{
9239 if (other.state_ == DiscordObjectState::Owned) {
9240 Discord_LobbyMemberHandle_Clone(&instance_, other.instance());
9241
9242 state_ = DiscordObjectState::Owned;
9243 }
9244}
9245LobbyMemberHandle& LobbyMemberHandle::operator=(const LobbyMemberHandle& other)
9246{
9247 if (this != &other) {
9248 if (state_ == DiscordObjectState::Owned) {
9249 Drop();
9250 state_ = DiscordObjectState::Invalid;
9251 }
9252 if (other.state_ == DiscordObjectState::Owned) {
9253 Discord_LobbyMemberHandle_Clone(&instance_, other.instance());
9254
9255 state_ = DiscordObjectState::Owned;
9256 }
9257 }
9258 return *this;
9259}
9260LobbyMemberHandle::LobbyMemberHandle(Discord_LobbyMemberHandle instance, DiscordObjectState state)
9261 : instance_(instance)
9262 , state_(state)
9263{
9264}
9265void LobbyMemberHandle::Drop()
9266{
9267 if (state_ != DiscordObjectState::Owned) {
9268 return;
9269 }
9270 Discord_LobbyMemberHandle_Drop(&instance_);
9271 state_ = DiscordObjectState::Invalid;
9272}
9273bool LobbyMemberHandle::CanLinkLobby() const
9274{
9275 assert(state_ == DiscordObjectState::Owned);
9276 bool returnValue__;
9277 returnValue__ = Discord_LobbyMemberHandle_CanLinkLobby(&instance_);
9278 return returnValue__;
9279}
9280bool LobbyMemberHandle::Connected() const
9281{
9282 assert(state_ == DiscordObjectState::Owned);
9283 bool returnValue__;
9284 returnValue__ = Discord_LobbyMemberHandle_Connected(&instance_);
9285 return returnValue__;
9286}
9287uint64_t LobbyMemberHandle::Id() const
9288{
9289 assert(state_ == DiscordObjectState::Owned);
9290 uint64_t returnValue__;
9291 returnValue__ = Discord_LobbyMemberHandle_Id(&instance_);
9292 return returnValue__;
9293}
9294std::unordered_map<std::string, std::string> LobbyMemberHandle::Metadata() const
9295{
9296 assert(state_ == DiscordObjectState::Owned);
9297 Discord_Properties returnValueNative__;
9298 Discord_LobbyMemberHandle_Metadata(&instance_, &returnValueNative__);
9299 std::unordered_map<std::string, std::string> returnValue__ =
9300 ConvertReturnedProperties(returnValueNative__);
9301 Discord_FreeProperties(returnValueNative__);
9302 return returnValue__;
9303}
9304std::optional<discordpp::UserHandle> LobbyMemberHandle::User() const
9305{
9306 assert(state_ == DiscordObjectState::Owned);
9307 bool returnIsNonNull__;
9308 Discord_UserHandle returnValueNative__;
9309 returnIsNonNull__ = Discord_LobbyMemberHandle_User(&instance_, &returnValueNative__);
9310 if (!returnIsNonNull__) {
9311 return {};
9312 }
9313 discordpp::UserHandle returnValue__(returnValueNative__, DiscordObjectState::Owned);
9314 return returnValue__;
9315}
9316const LobbyHandle LobbyHandle::nullobj{{}, DiscordObjectState::Invalid};
9317LobbyHandle::~LobbyHandle()
9318{
9319 if (state_ == DiscordObjectState::Owned) {
9320 Drop();
9321 state_ = DiscordObjectState::Invalid;
9322 }
9323}
9324LobbyHandle::LobbyHandle(LobbyHandle&& other) noexcept
9325 : instance_(other.instance_)
9326 , state_(other.state_)
9327{
9328 other.state_ = DiscordObjectState::Invalid;
9329}
9330LobbyHandle& LobbyHandle::operator=(LobbyHandle&& other) noexcept
9331{
9332 if (this != &other) {
9333 if (state_ == DiscordObjectState::Owned) {
9334 Drop();
9335 }
9336 instance_ = other.instance_;
9337 state_ = other.state_;
9338 other.state_ = DiscordObjectState::Invalid;
9339 }
9340 return *this;
9341}
9342LobbyHandle::LobbyHandle(const LobbyHandle& other)
9343 : instance_{}
9344 , state_(DiscordObjectState::Invalid)
9345{
9346 if (other.state_ == DiscordObjectState::Owned) {
9347 Discord_LobbyHandle_Clone(&instance_, other.instance());
9348
9349 state_ = DiscordObjectState::Owned;
9350 }
9351}
9352LobbyHandle& LobbyHandle::operator=(const LobbyHandle& other)
9353{
9354 if (this != &other) {
9355 if (state_ == DiscordObjectState::Owned) {
9356 Drop();
9357 state_ = DiscordObjectState::Invalid;
9358 }
9359 if (other.state_ == DiscordObjectState::Owned) {
9360 Discord_LobbyHandle_Clone(&instance_, other.instance());
9361
9362 state_ = DiscordObjectState::Owned;
9363 }
9364 }
9365 return *this;
9366}
9367LobbyHandle::LobbyHandle(Discord_LobbyHandle instance, DiscordObjectState state)
9368 : instance_(instance)
9369 , state_(state)
9370{
9371}
9372void LobbyHandle::Drop()
9373{
9374 if (state_ != DiscordObjectState::Owned) {
9375 return;
9376 }
9377 Discord_LobbyHandle_Drop(&instance_);
9378 state_ = DiscordObjectState::Invalid;
9379}
9380std::optional<discordpp::CallInfoHandle> LobbyHandle::GetCallInfoHandle() const
9381{
9382 assert(state_ == DiscordObjectState::Owned);
9383 bool returnIsNonNull__;
9384 Discord_CallInfoHandle returnValueNative__;
9385 returnIsNonNull__ = Discord_LobbyHandle_GetCallInfoHandle(&instance_, &returnValueNative__);
9386 if (!returnIsNonNull__) {
9387 return {};
9388 }
9389 discordpp::CallInfoHandle returnValue__(returnValueNative__, DiscordObjectState::Owned);
9390 return returnValue__;
9391}
9392std::optional<discordpp::LobbyMemberHandle> LobbyHandle::GetLobbyMemberHandle(
9393 uint64_t memberId) const
9394{
9395 assert(state_ == DiscordObjectState::Owned);
9396 bool returnIsNonNull__;
9397 Discord_LobbyMemberHandle returnValueNative__;
9398 returnIsNonNull__ =
9399 Discord_LobbyHandle_GetLobbyMemberHandle(&instance_, memberId, &returnValueNative__);
9400 if (!returnIsNonNull__) {
9401 return {};
9402 }
9403 discordpp::LobbyMemberHandle returnValue__(returnValueNative__, DiscordObjectState::Owned);
9404 return returnValue__;
9405}
9406uint64_t LobbyHandle::Id() const
9407{
9408 assert(state_ == DiscordObjectState::Owned);
9409 uint64_t returnValue__;
9410 returnValue__ = Discord_LobbyHandle_Id(&instance_);
9411 return returnValue__;
9412}
9413std::optional<discordpp::LinkedChannel> LobbyHandle::LinkedChannel() const
9414{
9415 assert(state_ == DiscordObjectState::Owned);
9416 bool returnIsNonNull__;
9417 Discord_LinkedChannel returnValueNative__;
9418 returnIsNonNull__ = Discord_LobbyHandle_LinkedChannel(&instance_, &returnValueNative__);
9419 if (!returnIsNonNull__) {
9420 return {};
9421 }
9422 discordpp::LinkedChannel returnValue__(returnValueNative__, DiscordObjectState::Owned);
9423 return returnValue__;
9424}
9425std::vector<uint64_t> LobbyHandle::LobbyMemberIds() const
9426{
9427 assert(state_ == DiscordObjectState::Owned);
9428 Discord_UInt64Span returnValueNative__;
9429 Discord_LobbyHandle_LobbyMemberIds(&instance_, &returnValueNative__);
9430 std::vector<uint64_t> returnValue__(returnValueNative__.ptr,
9431 returnValueNative__.ptr + returnValueNative__.size);
9432 Discord_Free(returnValueNative__.ptr);
9433 return returnValue__;
9434}
9435std::vector<discordpp::LobbyMemberHandle> LobbyHandle::LobbyMembers() const
9436{
9437 assert(state_ == DiscordObjectState::Owned);
9438 Discord_LobbyMemberHandleSpan returnValueNative__;
9439 Discord_LobbyHandle_LobbyMembers(&instance_, &returnValueNative__);
9440 std::vector<discordpp::LobbyMemberHandle> returnValue__;
9441 returnValue__.reserve(returnValueNative__.size);
9442 for (size_t i__ = 0; i__ < returnValueNative__.size; ++i__) {
9443 returnValue__.emplace_back(returnValueNative__.ptr[i__], DiscordObjectState::Owned);
9444 }
9445 Discord_Free(returnValueNative__.ptr);
9446 return returnValue__;
9447}
9448std::unordered_map<std::string, std::string> LobbyHandle::Metadata() const
9449{
9450 assert(state_ == DiscordObjectState::Owned);
9451 Discord_Properties returnValueNative__;
9452 Discord_LobbyHandle_Metadata(&instance_, &returnValueNative__);
9453 std::unordered_map<std::string, std::string> returnValue__ =
9454 ConvertReturnedProperties(returnValueNative__);
9455 Discord_FreeProperties(returnValueNative__);
9456 return returnValue__;
9457}
9458const AdditionalContent AdditionalContent::nullobj{{}, DiscordObjectState::Invalid};
9459AdditionalContent::~AdditionalContent()
9460{
9461 if (state_ == DiscordObjectState::Owned) {
9462 Drop();
9463 state_ = DiscordObjectState::Invalid;
9464 }
9465}
9466AdditionalContent::AdditionalContent(AdditionalContent&& other) noexcept
9467 : instance_(other.instance_)
9468 , state_(other.state_)
9469{
9470 other.state_ = DiscordObjectState::Invalid;
9471}
9472AdditionalContent& AdditionalContent::operator=(AdditionalContent&& other) noexcept
9473{
9474 if (this != &other) {
9475 if (state_ == DiscordObjectState::Owned) {
9476 Drop();
9477 }
9478 instance_ = other.instance_;
9479 state_ = other.state_;
9480 other.state_ = DiscordObjectState::Invalid;
9481 }
9482 return *this;
9483}
9484AdditionalContent::AdditionalContent(const AdditionalContent& arg0)
9485 : instance_{}
9486 , state_(DiscordObjectState::Invalid)
9487{
9488 if (arg0.state_ == DiscordObjectState::Owned) {
9489 Discord_AdditionalContent_Clone(&instance_, arg0.instance());
9490
9491 state_ = DiscordObjectState::Owned;
9492 }
9493}
9494AdditionalContent& AdditionalContent::operator=(const AdditionalContent& arg0)
9495{
9496 if (this != &arg0) {
9497 if (state_ == DiscordObjectState::Owned) {
9498 Drop();
9499 state_ = DiscordObjectState::Invalid;
9500 }
9501 if (arg0.state_ == DiscordObjectState::Owned) {
9502 Discord_AdditionalContent_Clone(&instance_, arg0.instance());
9503
9504 state_ = DiscordObjectState::Owned;
9505 }
9506 }
9507 return *this;
9508}
9509AdditionalContent::AdditionalContent(Discord_AdditionalContent instance, DiscordObjectState state)
9510 : instance_(instance)
9511 , state_(state)
9512{
9513}
9514AdditionalContent::AdditionalContent()
9515{
9516 assert(state_ == DiscordObjectState::Invalid);
9517 Discord_AdditionalContent_Init(&instance_);
9518 state_ = DiscordObjectState::Owned;
9519}
9520void AdditionalContent::Drop()
9521{
9522 if (state_ != DiscordObjectState::Owned) {
9523 return;
9524 }
9525 Discord_AdditionalContent_Drop(&instance_);
9526 state_ = DiscordObjectState::Invalid;
9527}
9528bool AdditionalContent::Equals(discordpp::AdditionalContent rhs) const
9529{
9530 assert(state_ == DiscordObjectState::Owned);
9531 bool returnValue__;
9532 returnValue__ = Discord_AdditionalContent_Equals(&instance_, rhs.instance());
9533 return returnValue__;
9534}
9535std::string AdditionalContent::TypeToString(discordpp::AdditionalContentType type)
9536{
9537 Discord_String returnValueNative__;
9538 Discord_AdditionalContent_TypeToString(static_cast<Discord_AdditionalContentType>(type),
9539 &returnValueNative__);
9540 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
9541 returnValueNative__.size);
9542 Discord_Free(returnValueNative__.ptr);
9543 return returnValue__;
9544}
9545discordpp::AdditionalContentType AdditionalContent::Type() const
9546{
9547 assert(state_ == DiscordObjectState::Owned);
9548 Discord_AdditionalContentType returnValue__;
9549 returnValue__ = Discord_AdditionalContent_Type(&instance_);
9550 return static_cast<discordpp::AdditionalContentType>(returnValue__);
9551}
9552void AdditionalContent::SetType(discordpp::AdditionalContentType Type)
9553{
9554 assert(state_ == DiscordObjectState::Owned);
9555 Discord_AdditionalContent_SetType(&instance_, static_cast<Discord_AdditionalContentType>(Type));
9556}
9557std::optional<std::string> AdditionalContent::Title() const
9558{
9559 assert(state_ == DiscordObjectState::Owned);
9560 bool returnIsNonNull__;
9561 Discord_String returnValueNative__;
9562 returnIsNonNull__ = Discord_AdditionalContent_Title(&instance_, &returnValueNative__);
9563 if (!returnIsNonNull__) {
9564 return {};
9565 }
9566 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
9567 returnValueNative__.size);
9568 Discord_Free(returnValueNative__.ptr);
9569 return returnValue__;
9570}
9571void AdditionalContent::SetTitle(std::optional<std::string> Title)
9572{
9573 assert(state_ == DiscordObjectState::Owned);
9574 Discord_String Title__str{};
9575 if (Title.has_value()) {
9576 Title__str.ptr = reinterpret_cast<uint8_t*>(Title->data());
9577 Title__str.size = Title->size();
9578 }
9579 Discord_AdditionalContent_SetTitle(&instance_, (Title.has_value() ? &Title__str : nullptr));
9580}
9581uint8_t AdditionalContent::Count() const
9582{
9583 assert(state_ == DiscordObjectState::Owned);
9584 uint8_t returnValue__;
9585 returnValue__ = Discord_AdditionalContent_Count(&instance_);
9586 return returnValue__;
9587}
9588void AdditionalContent::SetCount(uint8_t Count)
9589{
9590 assert(state_ == DiscordObjectState::Owned);
9591 Discord_AdditionalContent_SetCount(&instance_, Count);
9592}
9593const MessageHandle MessageHandle::nullobj{{}, DiscordObjectState::Invalid};
9594MessageHandle::~MessageHandle()
9595{
9596 if (state_ == DiscordObjectState::Owned) {
9597 Drop();
9598 state_ = DiscordObjectState::Invalid;
9599 }
9600}
9601MessageHandle::MessageHandle(MessageHandle&& other) noexcept
9602 : instance_(other.instance_)
9603 , state_(other.state_)
9604{
9605 other.state_ = DiscordObjectState::Invalid;
9606}
9607MessageHandle& MessageHandle::operator=(MessageHandle&& other) noexcept
9608{
9609 if (this != &other) {
9610 if (state_ == DiscordObjectState::Owned) {
9611 Drop();
9612 }
9613 instance_ = other.instance_;
9614 state_ = other.state_;
9615 other.state_ = DiscordObjectState::Invalid;
9616 }
9617 return *this;
9618}
9619MessageHandle::MessageHandle(const MessageHandle& other)
9620 : instance_{}
9621 , state_(DiscordObjectState::Invalid)
9622{
9623 if (other.state_ == DiscordObjectState::Owned) {
9624 Discord_MessageHandle_Clone(&instance_, other.instance());
9625
9626 state_ = DiscordObjectState::Owned;
9627 }
9628}
9629MessageHandle& MessageHandle::operator=(const MessageHandle& other)
9630{
9631 if (this != &other) {
9632 if (state_ == DiscordObjectState::Owned) {
9633 Drop();
9634 state_ = DiscordObjectState::Invalid;
9635 }
9636 if (other.state_ == DiscordObjectState::Owned) {
9637 Discord_MessageHandle_Clone(&instance_, other.instance());
9638
9639 state_ = DiscordObjectState::Owned;
9640 }
9641 }
9642 return *this;
9643}
9644MessageHandle::MessageHandle(Discord_MessageHandle instance, DiscordObjectState state)
9645 : instance_(instance)
9646 , state_(state)
9647{
9648}
9649void MessageHandle::Drop()
9650{
9651 if (state_ != DiscordObjectState::Owned) {
9652 return;
9653 }
9654 Discord_MessageHandle_Drop(&instance_);
9655 state_ = DiscordObjectState::Invalid;
9656}
9657std::optional<discordpp::AdditionalContent> MessageHandle::AdditionalContent() const
9658{
9659 assert(state_ == DiscordObjectState::Owned);
9660 bool returnIsNonNull__;
9661 Discord_AdditionalContent returnValueNative__;
9662 returnIsNonNull__ = Discord_MessageHandle_AdditionalContent(&instance_, &returnValueNative__);
9663 if (!returnIsNonNull__) {
9664 return {};
9665 }
9666 discordpp::AdditionalContent returnValue__(returnValueNative__, DiscordObjectState::Owned);
9667 return returnValue__;
9668}
9669std::optional<uint64_t> MessageHandle::ApplicationId() const
9670{
9671 assert(state_ == DiscordObjectState::Owned);
9672 bool returnIsNonNull__;
9673 uint64_t returnValue__;
9674 returnIsNonNull__ = Discord_MessageHandle_ApplicationId(&instance_, &returnValue__);
9675 if (!returnIsNonNull__) {
9676 return std::nullopt;
9677 }
9678 return returnValue__;
9679}
9680std::optional<discordpp::UserHandle> MessageHandle::Author() const
9681{
9682 assert(state_ == DiscordObjectState::Owned);
9683 bool returnIsNonNull__;
9684 Discord_UserHandle returnValueNative__;
9685 returnIsNonNull__ = Discord_MessageHandle_Author(&instance_, &returnValueNative__);
9686 if (!returnIsNonNull__) {
9687 return {};
9688 }
9689 discordpp::UserHandle returnValue__(returnValueNative__, DiscordObjectState::Owned);
9690 return returnValue__;
9691}
9692uint64_t MessageHandle::AuthorId() const
9693{
9694 assert(state_ == DiscordObjectState::Owned);
9695 uint64_t returnValue__;
9696 returnValue__ = Discord_MessageHandle_AuthorId(&instance_);
9697 return returnValue__;
9698}
9699std::optional<discordpp::ChannelHandle> MessageHandle::Channel() const
9700{
9701 assert(state_ == DiscordObjectState::Owned);
9702 bool returnIsNonNull__;
9703 Discord_ChannelHandle returnValueNative__;
9704 returnIsNonNull__ = Discord_MessageHandle_Channel(&instance_, &returnValueNative__);
9705 if (!returnIsNonNull__) {
9706 return {};
9707 }
9708 discordpp::ChannelHandle returnValue__(returnValueNative__, DiscordObjectState::Owned);
9709 return returnValue__;
9710}
9711uint64_t MessageHandle::ChannelId() const
9712{
9713 assert(state_ == DiscordObjectState::Owned);
9714 uint64_t returnValue__;
9715 returnValue__ = Discord_MessageHandle_ChannelId(&instance_);
9716 return returnValue__;
9717}
9718std::string MessageHandle::Content() const
9719{
9720 assert(state_ == DiscordObjectState::Owned);
9721 Discord_String returnValueNative__;
9722 Discord_MessageHandle_Content(&instance_, &returnValueNative__);
9723 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
9724 returnValueNative__.size);
9725 Discord_Free(returnValueNative__.ptr);
9726 return returnValue__;
9727}
9728std::optional<discordpp::DisclosureTypes> MessageHandle::DisclosureType() const
9729{
9730 assert(state_ == DiscordObjectState::Owned);
9731 bool returnIsNonNull__;
9732 Discord_DisclosureTypes returnValueNative__;
9733 returnIsNonNull__ = Discord_MessageHandle_DisclosureType(&instance_, &returnValueNative__);
9734 if (!returnIsNonNull__) {
9735 return {};
9736 }
9737 auto returnValue__ = static_cast<discordpp::DisclosureTypes>(returnValueNative__);
9738 return returnValue__;
9739}
9740uint64_t MessageHandle::EditedTimestamp() const
9741{
9742 assert(state_ == DiscordObjectState::Owned);
9743 uint64_t returnValue__;
9744 returnValue__ = Discord_MessageHandle_EditedTimestamp(&instance_);
9745 return returnValue__;
9746}
9747uint64_t MessageHandle::Id() const
9748{
9749 assert(state_ == DiscordObjectState::Owned);
9750 uint64_t returnValue__;
9751 returnValue__ = Discord_MessageHandle_Id(&instance_);
9752 return returnValue__;
9753}
9754std::optional<discordpp::LobbyHandle> MessageHandle::Lobby() const
9755{
9756 assert(state_ == DiscordObjectState::Owned);
9757 bool returnIsNonNull__;
9758 Discord_LobbyHandle returnValueNative__;
9759 returnIsNonNull__ = Discord_MessageHandle_Lobby(&instance_, &returnValueNative__);
9760 if (!returnIsNonNull__) {
9761 return {};
9762 }
9763 discordpp::LobbyHandle returnValue__(returnValueNative__, DiscordObjectState::Owned);
9764 return returnValue__;
9765}
9766std::unordered_map<std::string, std::string> MessageHandle::Metadata() const
9767{
9768 assert(state_ == DiscordObjectState::Owned);
9769 Discord_Properties returnValueNative__;
9770 Discord_MessageHandle_Metadata(&instance_, &returnValueNative__);
9771 std::unordered_map<std::string, std::string> returnValue__ =
9772 ConvertReturnedProperties(returnValueNative__);
9773 Discord_FreeProperties(returnValueNative__);
9774 return returnValue__;
9775}
9776std::string MessageHandle::RawContent() const
9777{
9778 assert(state_ == DiscordObjectState::Owned);
9779 Discord_String returnValueNative__;
9780 Discord_MessageHandle_RawContent(&instance_, &returnValueNative__);
9781 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
9782 returnValueNative__.size);
9783 Discord_Free(returnValueNative__.ptr);
9784 return returnValue__;
9785}
9786std::optional<discordpp::UserHandle> MessageHandle::Recipient() const
9787{
9788 assert(state_ == DiscordObjectState::Owned);
9789 bool returnIsNonNull__;
9790 Discord_UserHandle returnValueNative__;
9791 returnIsNonNull__ = Discord_MessageHandle_Recipient(&instance_, &returnValueNative__);
9792 if (!returnIsNonNull__) {
9793 return {};
9794 }
9795 discordpp::UserHandle returnValue__(returnValueNative__, DiscordObjectState::Owned);
9796 return returnValue__;
9797}
9798uint64_t MessageHandle::RecipientId() const
9799{
9800 assert(state_ == DiscordObjectState::Owned);
9801 uint64_t returnValue__;
9802 returnValue__ = Discord_MessageHandle_RecipientId(&instance_);
9803 return returnValue__;
9804}
9805bool MessageHandle::SentFromGame() const
9806{
9807 assert(state_ == DiscordObjectState::Owned);
9808 bool returnValue__;
9809 returnValue__ = Discord_MessageHandle_SentFromGame(&instance_);
9810 return returnValue__;
9811}
9812uint64_t MessageHandle::SentTimestamp() const
9813{
9814 assert(state_ == DiscordObjectState::Owned);
9815 uint64_t returnValue__;
9816 returnValue__ = Discord_MessageHandle_SentTimestamp(&instance_);
9817 return returnValue__;
9818}
9819const AudioDevice AudioDevice::nullobj{{}, DiscordObjectState::Invalid};
9820AudioDevice::~AudioDevice()
9821{
9822 if (state_ == DiscordObjectState::Owned) {
9823 Drop();
9824 state_ = DiscordObjectState::Invalid;
9825 }
9826}
9827AudioDevice::AudioDevice(AudioDevice&& other) noexcept
9828 : instance_(other.instance_)
9829 , state_(other.state_)
9830{
9831 other.state_ = DiscordObjectState::Invalid;
9832}
9833AudioDevice& AudioDevice::operator=(AudioDevice&& other) noexcept
9834{
9835 if (this != &other) {
9836 if (state_ == DiscordObjectState::Owned) {
9837 Drop();
9838 }
9839 instance_ = other.instance_;
9840 state_ = other.state_;
9841 other.state_ = DiscordObjectState::Invalid;
9842 }
9843 return *this;
9844}
9845AudioDevice::AudioDevice(const AudioDevice& arg0)
9846 : instance_{}
9847 , state_(DiscordObjectState::Invalid)
9848{
9849 if (arg0.state_ == DiscordObjectState::Owned) {
9850 Discord_AudioDevice_Clone(&instance_, arg0.instance());
9851
9852 state_ = DiscordObjectState::Owned;
9853 }
9854}
9855AudioDevice& AudioDevice::operator=(const AudioDevice& arg0)
9856{
9857 if (this != &arg0) {
9858 if (state_ == DiscordObjectState::Owned) {
9859 Drop();
9860 state_ = DiscordObjectState::Invalid;
9861 }
9862 if (arg0.state_ == DiscordObjectState::Owned) {
9863 Discord_AudioDevice_Clone(&instance_, arg0.instance());
9864
9865 state_ = DiscordObjectState::Owned;
9866 }
9867 }
9868 return *this;
9869}
9870AudioDevice::AudioDevice(Discord_AudioDevice instance, DiscordObjectState state)
9871 : instance_(instance)
9872 , state_(state)
9873{
9874}
9875void AudioDevice::Drop()
9876{
9877 if (state_ != DiscordObjectState::Owned) {
9878 return;
9879 }
9880 Discord_AudioDevice_Drop(&instance_);
9881 state_ = DiscordObjectState::Invalid;
9882}
9883bool AudioDevice::Equals(discordpp::AudioDevice rhs)
9884{
9885 assert(state_ == DiscordObjectState::Owned);
9886 bool returnValue__;
9887 returnValue__ = Discord_AudioDevice_Equals(&instance_, rhs.instance());
9888 return returnValue__;
9889}
9890std::string AudioDevice::Id() const
9891{
9892 assert(state_ == DiscordObjectState::Owned);
9893 Discord_String returnValueNative__;
9894 Discord_AudioDevice_Id(&instance_, &returnValueNative__);
9895 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
9896 returnValueNative__.size);
9897 Discord_Free(returnValueNative__.ptr);
9898 return returnValue__;
9899}
9900void AudioDevice::SetId(std::string Id)
9901{
9902 assert(state_ == DiscordObjectState::Owned);
9903 Discord_String Id__str{(uint8_t*)(Id.data()), Id.size()};
9904 Discord_AudioDevice_SetId(&instance_, Id__str);
9905}
9906std::string AudioDevice::Name() const
9907{
9908 assert(state_ == DiscordObjectState::Owned);
9909 Discord_String returnValueNative__;
9910 Discord_AudioDevice_Name(&instance_, &returnValueNative__);
9911 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
9912 returnValueNative__.size);
9913 Discord_Free(returnValueNative__.ptr);
9914 return returnValue__;
9915}
9916void AudioDevice::SetName(std::string Name)
9917{
9918 assert(state_ == DiscordObjectState::Owned);
9919 Discord_String Name__str{(uint8_t*)(Name.data()), Name.size()};
9920 Discord_AudioDevice_SetName(&instance_, Name__str);
9921}
9922bool AudioDevice::IsDefault() const
9923{
9924 assert(state_ == DiscordObjectState::Owned);
9925 bool returnValue__;
9926 returnValue__ = Discord_AudioDevice_IsDefault(&instance_);
9927 return returnValue__;
9928}
9929void AudioDevice::SetIsDefault(bool IsDefault)
9930{
9931 assert(state_ == DiscordObjectState::Owned);
9932 Discord_AudioDevice_SetIsDefault(&instance_, IsDefault);
9933}
9934const UserMessageSummary UserMessageSummary::nullobj{{}, DiscordObjectState::Invalid};
9935UserMessageSummary::~UserMessageSummary()
9936{
9937 if (state_ == DiscordObjectState::Owned) {
9938 Drop();
9939 state_ = DiscordObjectState::Invalid;
9940 }
9941}
9942UserMessageSummary::UserMessageSummary(UserMessageSummary&& other) noexcept
9943 : instance_(other.instance_)
9944 , state_(other.state_)
9945{
9946 other.state_ = DiscordObjectState::Invalid;
9947}
9948UserMessageSummary& UserMessageSummary::operator=(UserMessageSummary&& other) noexcept
9949{
9950 if (this != &other) {
9951 if (state_ == DiscordObjectState::Owned) {
9952 Drop();
9953 }
9954 instance_ = other.instance_;
9955 state_ = other.state_;
9956 other.state_ = DiscordObjectState::Invalid;
9957 }
9958 return *this;
9959}
9960UserMessageSummary::UserMessageSummary(const UserMessageSummary& arg0)
9961 : instance_{}
9962 , state_(DiscordObjectState::Invalid)
9963{
9964 if (arg0.state_ == DiscordObjectState::Owned) {
9965 Discord_UserMessageSummary_Clone(&instance_, arg0.instance());
9966
9967 state_ = DiscordObjectState::Owned;
9968 }
9969}
9970UserMessageSummary& UserMessageSummary::operator=(const UserMessageSummary& arg0)
9971{
9972 if (this != &arg0) {
9973 if (state_ == DiscordObjectState::Owned) {
9974 Drop();
9975 state_ = DiscordObjectState::Invalid;
9976 }
9977 if (arg0.state_ == DiscordObjectState::Owned) {
9978 Discord_UserMessageSummary_Clone(&instance_, arg0.instance());
9979
9980 state_ = DiscordObjectState::Owned;
9981 }
9982 }
9983 return *this;
9984}
9985UserMessageSummary::UserMessageSummary(Discord_UserMessageSummary instance,
9986 DiscordObjectState state)
9987 : instance_(instance)
9988 , state_(state)
9989{
9990}
9991void UserMessageSummary::Drop()
9992{
9993 if (state_ != DiscordObjectState::Owned) {
9994 return;
9995 }
9996 Discord_UserMessageSummary_Drop(&instance_);
9997 state_ = DiscordObjectState::Invalid;
9998}
9999uint64_t UserMessageSummary::LastMessageId() const
10000{
10001 assert(state_ == DiscordObjectState::Owned);
10002 uint64_t returnValue__;
10003 returnValue__ = Discord_UserMessageSummary_LastMessageId(&instance_);
10004 return returnValue__;
10005}
10006uint64_t UserMessageSummary::UserId() const
10007{
10008 assert(state_ == DiscordObjectState::Owned);
10009 uint64_t returnValue__;
10010 returnValue__ = Discord_UserMessageSummary_UserId(&instance_);
10011 return returnValue__;
10012}
10013const ClientCreateOptions ClientCreateOptions::nullobj{{}, DiscordObjectState::Invalid};
10014ClientCreateOptions::~ClientCreateOptions()
10015{
10016 if (state_ == DiscordObjectState::Owned) {
10017 Drop();
10018 state_ = DiscordObjectState::Invalid;
10019 }
10020}
10021ClientCreateOptions::ClientCreateOptions(ClientCreateOptions&& other) noexcept
10022 : instance_(other.instance_)
10023 , state_(other.state_)
10024{
10025 other.state_ = DiscordObjectState::Invalid;
10026}
10027ClientCreateOptions& ClientCreateOptions::operator=(ClientCreateOptions&& other) noexcept
10028{
10029 if (this != &other) {
10030 if (state_ == DiscordObjectState::Owned) {
10031 Drop();
10032 }
10033 instance_ = other.instance_;
10034 state_ = other.state_;
10035 other.state_ = DiscordObjectState::Invalid;
10036 }
10037 return *this;
10038}
10039ClientCreateOptions::ClientCreateOptions(const ClientCreateOptions& arg0)
10040 : instance_{}
10041 , state_(DiscordObjectState::Invalid)
10042{
10043 if (arg0.state_ == DiscordObjectState::Owned) {
10044 Discord_ClientCreateOptions_Clone(&instance_, arg0.instance());
10045
10046 state_ = DiscordObjectState::Owned;
10047 }
10048}
10049ClientCreateOptions& ClientCreateOptions::operator=(const ClientCreateOptions& arg0)
10050{
10051 if (this != &arg0) {
10052 if (state_ == DiscordObjectState::Owned) {
10053 Drop();
10054 state_ = DiscordObjectState::Invalid;
10055 }
10056 if (arg0.state_ == DiscordObjectState::Owned) {
10057 Discord_ClientCreateOptions_Clone(&instance_, arg0.instance());
10058
10059 state_ = DiscordObjectState::Owned;
10060 }
10061 }
10062 return *this;
10063}
10064ClientCreateOptions::ClientCreateOptions(Discord_ClientCreateOptions instance,
10065 DiscordObjectState state)
10066 : instance_(instance)
10067 , state_(state)
10068{
10069}
10070ClientCreateOptions::ClientCreateOptions()
10071{
10072 assert(state_ == DiscordObjectState::Invalid);
10073 Discord_ClientCreateOptions_Init(&instance_);
10074 state_ = DiscordObjectState::Owned;
10075}
10076void ClientCreateOptions::Drop()
10077{
10078 if (state_ != DiscordObjectState::Owned) {
10079 return;
10080 }
10081 Discord_ClientCreateOptions_Drop(&instance_);
10082 state_ = DiscordObjectState::Invalid;
10083}
10084std::string ClientCreateOptions::WebBase() const
10085{
10086 assert(state_ == DiscordObjectState::Owned);
10087 Discord_String returnValueNative__;
10088 Discord_ClientCreateOptions_WebBase(&instance_, &returnValueNative__);
10089 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
10090 returnValueNative__.size);
10091 Discord_Free(returnValueNative__.ptr);
10092 return returnValue__;
10093}
10094void ClientCreateOptions::SetWebBase(std::string WebBase)
10095{
10096 assert(state_ == DiscordObjectState::Owned);
10097 Discord_String WebBase__str{(uint8_t*)(WebBase.data()), WebBase.size()};
10098 Discord_ClientCreateOptions_SetWebBase(&instance_, WebBase__str);
10099}
10100std::string ClientCreateOptions::ApiBase() const
10101{
10102 assert(state_ == DiscordObjectState::Owned);
10103 Discord_String returnValueNative__;
10104 Discord_ClientCreateOptions_ApiBase(&instance_, &returnValueNative__);
10105 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
10106 returnValueNative__.size);
10107 Discord_Free(returnValueNative__.ptr);
10108 return returnValue__;
10109}
10110void ClientCreateOptions::SetApiBase(std::string ApiBase)
10111{
10112 assert(state_ == DiscordObjectState::Owned);
10113 Discord_String ApiBase__str{(uint8_t*)(ApiBase.data()), ApiBase.size()};
10114 Discord_ClientCreateOptions_SetApiBase(&instance_, ApiBase__str);
10115}
10116discordpp::AudioSystem ClientCreateOptions::ExperimentalAudioSystem() const
10117{
10118 assert(state_ == DiscordObjectState::Owned);
10119 Discord_AudioSystem returnValue__;
10120 returnValue__ = Discord_ClientCreateOptions_ExperimentalAudioSystem(&instance_);
10121 return static_cast<discordpp::AudioSystem>(returnValue__);
10122}
10123void ClientCreateOptions::SetExperimentalAudioSystem(discordpp::AudioSystem ExperimentalAudioSystem)
10124{
10125 assert(state_ == DiscordObjectState::Owned);
10126 Discord_ClientCreateOptions_SetExperimentalAudioSystem(
10127 &instance_, static_cast<Discord_AudioSystem>(ExperimentalAudioSystem));
10128}
10129bool ClientCreateOptions::ExperimentalAndroidPreventCommsForBluetooth() const
10130{
10131 assert(state_ == DiscordObjectState::Owned);
10132 bool returnValue__;
10133 returnValue__ =
10134 Discord_ClientCreateOptions_ExperimentalAndroidPreventCommsForBluetooth(&instance_);
10135 return returnValue__;
10136}
10137void ClientCreateOptions::SetExperimentalAndroidPreventCommsForBluetooth(
10138 bool ExperimentalAndroidPreventCommsForBluetooth)
10139{
10140 assert(state_ == DiscordObjectState::Owned);
10141 Discord_ClientCreateOptions_SetExperimentalAndroidPreventCommsForBluetooth(
10142 &instance_, ExperimentalAndroidPreventCommsForBluetooth);
10143}
10144std::optional<uint64_t> ClientCreateOptions::CpuAffinityMask() const
10145{
10146 assert(state_ == DiscordObjectState::Owned);
10147 bool returnIsNonNull__;
10148 uint64_t returnValue__;
10149 returnIsNonNull__ = Discord_ClientCreateOptions_CpuAffinityMask(&instance_, &returnValue__);
10150 if (!returnIsNonNull__) {
10151 return std::nullopt;
10152 }
10153 return returnValue__;
10154}
10155void ClientCreateOptions::SetCpuAffinityMask(std::optional<uint64_t> CpuAffinityMask)
10156{
10157 assert(state_ == DiscordObjectState::Owned);
10158 Discord_ClientCreateOptions_SetCpuAffinityMask(
10159 &instance_, (CpuAffinityMask.has_value() ? &*CpuAffinityMask : nullptr));
10160}
10161const Client Client::nullobj{{}, DiscordObjectState::Invalid};
10162Client::~Client()
10163{
10164 if (state_ == DiscordObjectState::Owned) {
10165 Drop();
10166 state_ = DiscordObjectState::Invalid;
10167 }
10168}
10169Client::Client(Client&& other) noexcept
10170 : instance_(other.instance_)
10171 , state_(other.state_)
10172{
10173 other.state_ = DiscordObjectState::Invalid;
10174}
10175Client& Client::operator=(Client&& other) noexcept
10176{
10177 if (this != &other) {
10178 if (state_ == DiscordObjectState::Owned) {
10179 Drop();
10180 }
10181 instance_ = other.instance_;
10182 state_ = other.state_;
10183 other.state_ = DiscordObjectState::Invalid;
10184 }
10185 return *this;
10186}
10187Client::Client(Discord_Client instance, DiscordObjectState state)
10188 : instance_(instance)
10189 , state_(state)
10190{
10191}
10192Client::Client()
10193{
10194 assert(state_ == DiscordObjectState::Invalid);
10195 Discord_Client_Init(&instance_);
10196 state_ = DiscordObjectState::Owned;
10197}
10198Client::Client(std::string apiBase, std::string webBase)
10199{
10200 assert(state_ == DiscordObjectState::Invalid);
10201 Discord_String apiBase__str{(uint8_t*)(apiBase.data()), apiBase.size()};
10202 Discord_String webBase__str{(uint8_t*)(webBase.data()), webBase.size()};
10203 Discord_Client_InitWithBases(&instance_, apiBase__str, webBase__str);
10204 state_ = DiscordObjectState::Owned;
10205}
10206Client::Client(discordpp::ClientCreateOptions options)
10207{
10208 assert(state_ == DiscordObjectState::Invalid);
10209 Discord_Client_InitWithOptions(&instance_, options.instance());
10210 state_ = DiscordObjectState::Owned;
10211}
10212void Client::Drop()
10213{
10214 if (state_ != DiscordObjectState::Owned) {
10215 return;
10216 }
10217 Discord_Client_Drop(&instance_);
10218 state_ = DiscordObjectState::Invalid;
10219}
10220std::string Client::ErrorToString(discordpp::Client::Error type)
10221{
10222 Discord_String returnValueNative__;
10223 Discord_Client_ErrorToString(static_cast<Discord_Client_Error>(type), &returnValueNative__);
10224 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
10225 returnValueNative__.size);
10226 Discord_Free(returnValueNative__.ptr);
10227 return returnValue__;
10228}
10229uint64_t Client::GetApplicationId()
10230{
10231 assert(state_ == DiscordObjectState::Owned);
10232 uint64_t returnValue__;
10233 returnValue__ = Discord_Client_GetApplicationId(&instance_);
10234 return returnValue__;
10235}
10236discordpp::UserHandle Client::GetCurrentUser() const
10237{
10238 assert(state_ == DiscordObjectState::Owned);
10239 Discord_UserHandle returnValueNative__{};
10240 Discord_Client_GetCurrentUser(&instance_, &returnValueNative__);
10241 discordpp::UserHandle returnValue__(returnValueNative__, DiscordObjectState::Owned);
10242 return returnValue__;
10243}
10244std::string Client::GetDefaultAudioDeviceId()
10245{
10246 Discord_String returnValueNative__;
10247 Discord_Client_GetDefaultAudioDeviceId(&returnValueNative__);
10248 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
10249 returnValueNative__.size);
10250 Discord_Free(returnValueNative__.ptr);
10251 return returnValue__;
10252}
10253std::string Client::GetDefaultCommunicationScopes()
10254{
10255 Discord_String returnValueNative__;
10256 Discord_Client_GetDefaultCommunicationScopes(&returnValueNative__);
10257 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
10258 returnValueNative__.size);
10259 Discord_Free(returnValueNative__.ptr);
10260 return returnValue__;
10261}
10262std::string Client::GetDefaultPresenceScopes()
10263{
10264 Discord_String returnValueNative__;
10265 Discord_Client_GetDefaultPresenceScopes(&returnValueNative__);
10266 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
10267 returnValueNative__.size);
10268 Discord_Free(returnValueNative__.ptr);
10269 return returnValue__;
10270}
10271std::string Client::GetVersionHash()
10272{
10273 Discord_String returnValueNative__;
10274 Discord_Client_GetVersionHash(&returnValueNative__);
10275 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
10276 returnValueNative__.size);
10277 Discord_Free(returnValueNative__.ptr);
10278 return returnValue__;
10279}
10280int32_t Client::GetVersionMajor()
10281{
10282 int32_t returnValue__;
10283 returnValue__ = Discord_Client_GetVersionMajor();
10284 return returnValue__;
10285}
10286int32_t Client::GetVersionMinor()
10287{
10288 int32_t returnValue__;
10289 returnValue__ = Discord_Client_GetVersionMinor();
10290 return returnValue__;
10291}
10292int32_t Client::GetVersionPatch()
10293{
10294 int32_t returnValue__;
10295 returnValue__ = Discord_Client_GetVersionPatch();
10296 return returnValue__;
10297}
10298void Client::SetHttpRequestTimeout(int32_t httpTimeoutInMilliseconds)
10299{
10300 assert(state_ == DiscordObjectState::Owned);
10301 Discord_Client_SetHttpRequestTimeout(&instance_, httpTimeoutInMilliseconds);
10302}
10303std::string Client::StatusToString(discordpp::Client::Status type)
10304{
10305 Discord_String returnValueNative__;
10306 Discord_Client_StatusToString(static_cast<Discord_Client_Status>(type), &returnValueNative__);
10307 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
10308 returnValueNative__.size);
10309 Discord_Free(returnValueNative__.ptr);
10310 return returnValue__;
10311}
10312std::string Client::ThreadToString(discordpp::Client::Thread type)
10313{
10314 Discord_String returnValueNative__;
10315 Discord_Client_ThreadToString(static_cast<Discord_Client_Thread>(type), &returnValueNative__);
10316 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
10317 returnValueNative__.size);
10318 Discord_Free(returnValueNative__.ptr);
10319 return returnValue__;
10320}
10321void Client::EndCall(uint64_t channelId, discordpp::Client::EndCallCallback callback)
10322{
10323 assert(state_ == DiscordObjectState::Owned);
10324 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
10325 auto callback__userData = new Tcallback__UserData(callback);
10326 Discord_Client_EndCallCallback callback__native = [](void* userData__) {
10327 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
10328 userData__typed->delegate();
10329 };
10330 Discord_Client_EndCall(
10331 &instance_, channelId, callback__native, Tcallback__UserData::Free, callback__userData);
10332}
10333void Client::EndCalls(discordpp::Client::EndCallsCallback callback)
10334{
10335 assert(state_ == DiscordObjectState::Owned);
10336 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
10337 auto callback__userData = new Tcallback__UserData(callback);
10338 Discord_Client_EndCallsCallback callback__native = [](void* userData__) {
10339 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
10340 userData__typed->delegate();
10341 };
10342 Discord_Client_EndCalls(
10343 &instance_, callback__native, Tcallback__UserData::Free, callback__userData);
10344}
10345discordpp::Call Client::GetCall(uint64_t channelId)
10346{
10347 assert(state_ == DiscordObjectState::Owned);
10348 bool returnIsNonNull__;
10349 Discord_Call returnValueNative__{};
10350 returnIsNonNull__ = Discord_Client_GetCall(&instance_, channelId, &returnValueNative__);
10351 discordpp::Call returnValue__(
10352 returnValueNative__,
10353 returnIsNonNull__ ? DiscordObjectState::Owned : DiscordObjectState::Invalid);
10354 return returnValue__;
10355}
10356std::vector<discordpp::Call> Client::GetCalls()
10357{
10358 assert(state_ == DiscordObjectState::Owned);
10359 Discord_CallSpan returnValueNative__;
10360 Discord_Client_GetCalls(&instance_, &returnValueNative__);
10361 std::vector<discordpp::Call> returnValue__;
10362 returnValue__.reserve(returnValueNative__.size);
10363 for (size_t i__ = 0; i__ < returnValueNative__.size; ++i__) {
10364 returnValue__.emplace_back(returnValueNative__.ptr[i__], DiscordObjectState::Owned);
10365 }
10366 Discord_Free(returnValueNative__.ptr);
10367 return returnValue__;
10368}
10369void Client::GetCurrentInputDevice(discordpp::Client::GetCurrentInputDeviceCallback cb)
10370{
10371 assert(state_ == DiscordObjectState::Owned);
10372 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
10373 auto cb__userData = new Tcb__UserData(cb);
10374 Discord_Client_GetCurrentInputDeviceCallback cb__native = [](auto device, void* userData__) {
10375 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
10376 discordpp::AudioDevice device__obj(*device, DiscordObjectState::Owned);
10377 userData__typed->delegate(std::move(device__obj));
10378 };
10379 Discord_Client_GetCurrentInputDevice(&instance_, cb__native, Tcb__UserData::Free, cb__userData);
10380}
10381void Client::GetCurrentOutputDevice(discordpp::Client::GetCurrentOutputDeviceCallback cb)
10382{
10383 assert(state_ == DiscordObjectState::Owned);
10384 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
10385 auto cb__userData = new Tcb__UserData(cb);
10386 Discord_Client_GetCurrentOutputDeviceCallback cb__native = [](auto device, void* userData__) {
10387 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
10388 discordpp::AudioDevice device__obj(*device, DiscordObjectState::Owned);
10389 userData__typed->delegate(std::move(device__obj));
10390 };
10391 Discord_Client_GetCurrentOutputDevice(
10392 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
10393}
10394void Client::GetInputDevices(discordpp::Client::GetInputDevicesCallback cb)
10395{
10396 assert(state_ == DiscordObjectState::Owned);
10397 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
10398 auto cb__userData = new Tcb__UserData(cb);
10399 Discord_Client_GetInputDevicesCallback cb__native = [](auto devices, void* userData__) {
10400 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
10401 std::vector<discordpp::AudioDevice> devices__vec;
10402 devices__vec.reserve(devices.size);
10403 for (size_t i__ = 0; i__ < devices.size; ++i__) {
10404 devices__vec.emplace_back(devices.ptr[i__], DiscordObjectState::Owned);
10405 }
10406 Discord_Free(devices.ptr);
10407 userData__typed->delegate(std::move(devices__vec));
10408 };
10409 Discord_Client_GetInputDevices(&instance_, cb__native, Tcb__UserData::Free, cb__userData);
10410}
10411float Client::GetInputVolume()
10412{
10413 assert(state_ == DiscordObjectState::Owned);
10414 float returnValue__;
10415 returnValue__ = Discord_Client_GetInputVolume(&instance_);
10416 return returnValue__;
10417}
10418void Client::GetOutputDevices(discordpp::Client::GetOutputDevicesCallback cb)
10419{
10420 assert(state_ == DiscordObjectState::Owned);
10421 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
10422 auto cb__userData = new Tcb__UserData(cb);
10423 Discord_Client_GetOutputDevicesCallback cb__native = [](auto devices, void* userData__) {
10424 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
10425 std::vector<discordpp::AudioDevice> devices__vec;
10426 devices__vec.reserve(devices.size);
10427 for (size_t i__ = 0; i__ < devices.size; ++i__) {
10428 devices__vec.emplace_back(devices.ptr[i__], DiscordObjectState::Owned);
10429 }
10430 Discord_Free(devices.ptr);
10431 userData__typed->delegate(std::move(devices__vec));
10432 };
10433 Discord_Client_GetOutputDevices(&instance_, cb__native, Tcb__UserData::Free, cb__userData);
10434}
10435float Client::GetOutputVolume()
10436{
10437 assert(state_ == DiscordObjectState::Owned);
10438 float returnValue__;
10439 returnValue__ = Discord_Client_GetOutputVolume(&instance_);
10440 return returnValue__;
10441}
10442bool Client::GetSelfDeafAll() const
10443{
10444 assert(state_ == DiscordObjectState::Owned);
10445 bool returnValue__;
10446 returnValue__ = Discord_Client_GetSelfDeafAll(&instance_);
10447 return returnValue__;
10448}
10449bool Client::GetSelfMuteAll() const
10450{
10451 assert(state_ == DiscordObjectState::Owned);
10452 bool returnValue__;
10453 returnValue__ = Discord_Client_GetSelfMuteAll(&instance_);
10454 return returnValue__;
10455}
10456void Client::SetAecDump(bool on)
10457{
10458 assert(state_ == DiscordObjectState::Owned);
10459 Discord_Client_SetAecDump(&instance_, on);
10460}
10461void Client::SetAutomaticGainControl(bool on)
10462{
10463 assert(state_ == DiscordObjectState::Owned);
10464 Discord_Client_SetAutomaticGainControl(&instance_, on);
10465}
10466void Client::SetDeviceChangeCallback(discordpp::Client::DeviceChangeCallback callback)
10467{
10468 assert(state_ == DiscordObjectState::Owned);
10469 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
10470 auto callback__userData = new Tcallback__UserData(callback);
10471 Discord_Client_DeviceChangeCallback callback__native =
10472 [](auto inputDevices, auto outputDevices, void* userData__) {
10473 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
10474 std::vector<discordpp::AudioDevice> inputDevices__vec;
10475 inputDevices__vec.reserve(inputDevices.size);
10476 for (size_t i__ = 0; i__ < inputDevices.size; ++i__) {
10477 inputDevices__vec.emplace_back(inputDevices.ptr[i__], DiscordObjectState::Owned);
10478 }
10479 Discord_Free(inputDevices.ptr);
10480 std::vector<discordpp::AudioDevice> outputDevices__vec;
10481 outputDevices__vec.reserve(outputDevices.size);
10482 for (size_t i__ = 0; i__ < outputDevices.size; ++i__) {
10483 outputDevices__vec.emplace_back(outputDevices.ptr[i__], DiscordObjectState::Owned);
10484 }
10485 Discord_Free(outputDevices.ptr);
10486 userData__typed->delegate(std::move(inputDevices__vec), std::move(outputDevices__vec));
10487 };
10488 Discord_Client_SetDeviceChangeCallback(
10489 &instance_, callback__native, Tcallback__UserData::Free, callback__userData);
10490}
10491void Client::SetEchoCancellation(bool on)
10492{
10493 assert(state_ == DiscordObjectState::Owned);
10494 Discord_Client_SetEchoCancellation(&instance_, on);
10495}
10496void Client::SetEngineManagedAudioSession(bool isEngineManaged)
10497{
10498 assert(state_ == DiscordObjectState::Owned);
10499 Discord_Client_SetEngineManagedAudioSession(&instance_, isEngineManaged);
10500}
10501void Client::SetInputDevice(std::string deviceId, discordpp::Client::SetInputDeviceCallback cb)
10502{
10503 assert(state_ == DiscordObjectState::Owned);
10504 Discord_String deviceId__str{(uint8_t*)(deviceId.data()), deviceId.size()};
10505 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
10506 auto cb__userData = new Tcb__UserData(cb);
10507 Discord_Client_SetInputDeviceCallback cb__native = [](auto result, void* userData__) {
10508 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
10509 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
10510 userData__typed->delegate(std::move(result__obj));
10511 };
10512 Discord_Client_SetInputDevice(
10513 &instance_, deviceId__str, cb__native, Tcb__UserData::Free, cb__userData);
10514}
10515void Client::SetInputVolume(float inputVolume)
10516{
10517 assert(state_ == DiscordObjectState::Owned);
10518 Discord_Client_SetInputVolume(&instance_, inputVolume);
10519}
10520void Client::SetNoAudioInputCallback(discordpp::Client::NoAudioInputCallback callback)
10521{
10522 assert(state_ == DiscordObjectState::Owned);
10523 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
10524 auto callback__userData = new Tcallback__UserData(callback);
10525 Discord_Client_NoAudioInputCallback callback__native = [](auto inputDetected,
10526 void* userData__) {
10527 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
10528 userData__typed->delegate(inputDetected);
10529 };
10530 Discord_Client_SetNoAudioInputCallback(
10531 &instance_, callback__native, Tcallback__UserData::Free, callback__userData);
10532}
10533void Client::SetNoAudioInputThreshold(float dBFSThreshold)
10534{
10535 assert(state_ == DiscordObjectState::Owned);
10536 Discord_Client_SetNoAudioInputThreshold(&instance_, dBFSThreshold);
10537}
10538void Client::SetNoiseSuppression(bool on)
10539{
10540 assert(state_ == DiscordObjectState::Owned);
10541 Discord_Client_SetNoiseSuppression(&instance_, on);
10542}
10543void Client::SetOpusHardwareCoding(bool encode, bool decode)
10544{
10545 assert(state_ == DiscordObjectState::Owned);
10546 Discord_Client_SetOpusHardwareCoding(&instance_, encode, decode);
10547}
10548void Client::SetOutputDevice(std::string deviceId, discordpp::Client::SetOutputDeviceCallback cb)
10549{
10550 assert(state_ == DiscordObjectState::Owned);
10551 Discord_String deviceId__str{(uint8_t*)(deviceId.data()), deviceId.size()};
10552 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
10553 auto cb__userData = new Tcb__UserData(cb);
10554 Discord_Client_SetOutputDeviceCallback cb__native = [](auto result, void* userData__) {
10555 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
10556 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
10557 userData__typed->delegate(std::move(result__obj));
10558 };
10559 Discord_Client_SetOutputDevice(
10560 &instance_, deviceId__str, cb__native, Tcb__UserData::Free, cb__userData);
10561}
10562void Client::SetOutputVolume(float outputVolume)
10563{
10564 assert(state_ == DiscordObjectState::Owned);
10565 Discord_Client_SetOutputVolume(&instance_, outputVolume);
10566}
10567void Client::SetSelfDeafAll(bool deaf)
10568{
10569 assert(state_ == DiscordObjectState::Owned);
10570 Discord_Client_SetSelfDeafAll(&instance_, deaf);
10571}
10572void Client::SetSelfMuteAll(bool mute)
10573{
10574 assert(state_ == DiscordObjectState::Owned);
10575 Discord_Client_SetSelfMuteAll(&instance_, mute);
10576}
10577bool Client::SetSpeakerMode(bool speakerMode)
10578{
10579 assert(state_ == DiscordObjectState::Owned);
10580 bool returnValue__;
10581 returnValue__ = Discord_Client_SetSpeakerMode(&instance_, speakerMode);
10582 return returnValue__;
10583}
10584void Client::SetThreadPriority(discordpp::Client::Thread thread, int32_t priority)
10585{
10586 assert(state_ == DiscordObjectState::Owned);
10587 Discord_Client_SetThreadPriority(
10588 &instance_, static_cast<Discord_Client_Thread>(thread), priority);
10589}
10590void Client::SetVoiceParticipantChangedCallback(
10592{
10593 assert(state_ == DiscordObjectState::Owned);
10594 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
10595 auto cb__userData = new Tcb__UserData(cb);
10596 Discord_Client_VoiceParticipantChangedCallback cb__native =
10597 [](auto lobbyId, auto memberId, auto added, void* userData__) {
10598 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
10599 userData__typed->delegate(lobbyId, memberId, added);
10600 };
10601 Discord_Client_SetVoiceParticipantChangedCallback(
10602 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
10603}
10604bool Client::ShowAudioRoutePicker()
10605{
10606 assert(state_ == DiscordObjectState::Owned);
10607 bool returnValue__;
10608 returnValue__ = Discord_Client_ShowAudioRoutePicker(&instance_);
10609 return returnValue__;
10610}
10611discordpp::Call Client::StartCall(uint64_t channelId)
10612{
10613 assert(state_ == DiscordObjectState::Owned);
10614 bool returnIsNonNull__;
10615 Discord_Call returnValueNative__{};
10616 returnIsNonNull__ = Discord_Client_StartCall(&instance_, channelId, &returnValueNative__);
10617 discordpp::Call returnValue__(
10618 returnValueNative__,
10619 returnIsNonNull__ ? DiscordObjectState::Owned : DiscordObjectState::Invalid);
10620 return returnValue__;
10621}
10622discordpp::Call Client::StartCallWithAudioCallbacks(
10623 uint64_t lobbyId,
10626{
10627 assert(state_ == DiscordObjectState::Owned);
10628 bool returnIsNonNull__;
10629 Discord_Call returnValueNative__{};
10630 using TreceivedCb__UserData = TDelegateUserData<std::remove_reference_t<decltype(receivedCb)>>;
10631 auto receivedCb__userData = new TreceivedCb__UserData(receivedCb);
10632 Discord_Client_UserAudioReceivedCallback receivedCb__native = [](auto userId,
10633 auto data,
10634 auto samplesPerChannel,
10635 auto sampleRate,
10636 auto channels,
10637 auto outShouldMute,
10638 void* userData__) {
10639 auto userData__typed = static_cast<TreceivedCb__UserData*>(userData__);
10640 userData__typed->delegate(
10641 userId, data, samplesPerChannel, sampleRate, channels, *outShouldMute);
10642 };
10643 using TcapturedCb__UserData = TDelegateUserData<std::remove_reference_t<decltype(capturedCb)>>;
10644 auto capturedCb__userData = new TcapturedCb__UserData(capturedCb);
10645 Discord_Client_UserAudioCapturedCallback capturedCb__native =
10646 [](auto data, auto samplesPerChannel, auto sampleRate, auto channels, void* userData__) {
10647 auto userData__typed = static_cast<TcapturedCb__UserData*>(userData__);
10648 userData__typed->delegate(data, samplesPerChannel, sampleRate, channels);
10649 };
10650 returnIsNonNull__ = Discord_Client_StartCallWithAudioCallbacks(&instance_,
10651 lobbyId,
10652 receivedCb__native,
10653 TreceivedCb__UserData::Free,
10654 receivedCb__userData,
10655 capturedCb__native,
10656 TcapturedCb__UserData::Free,
10657 capturedCb__userData,
10658 &returnValueNative__);
10659 discordpp::Call returnValue__(
10660 returnValueNative__,
10661 returnIsNonNull__ ? DiscordObjectState::Owned : DiscordObjectState::Invalid);
10662 return returnValue__;
10663}
10664void Client::AbortAuthorize()
10665{
10666 assert(state_ == DiscordObjectState::Owned);
10667 Discord_Client_AbortAuthorize(&instance_);
10668}
10669void Client::AbortGetTokenFromDevice()
10670{
10671 assert(state_ == DiscordObjectState::Owned);
10672 Discord_Client_AbortGetTokenFromDevice(&instance_);
10673}
10674void Client::Authorize(discordpp::AuthorizationArgs args,
10676{
10677 assert(state_ == DiscordObjectState::Owned);
10678 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
10679 auto callback__userData = new Tcallback__UserData(callback);
10680 Discord_Client_AuthorizationCallback callback__native =
10681 [](auto result, auto code, auto redirectUri, void* userData__) {
10682 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
10683 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
10684 std::string code__str(reinterpret_cast<char*>(code.ptr), code.size);
10685 std::string redirectUri__str(reinterpret_cast<char*>(redirectUri.ptr), redirectUri.size);
10686 userData__typed->delegate(
10687 std::move(result__obj), std::move(code__str), std::move(redirectUri__str));
10688 Discord_Free(redirectUri.ptr);
10689 Discord_Free(code.ptr);
10690 };
10691 Discord_Client_Authorize(
10692 &instance_, args.instance(), callback__native, Tcallback__UserData::Free, callback__userData);
10693}
10694void Client::CloseAuthorizeDeviceScreen()
10695{
10696 assert(state_ == DiscordObjectState::Owned);
10697 Discord_Client_CloseAuthorizeDeviceScreen(&instance_);
10698}
10699discordpp::AuthorizationCodeVerifier Client::CreateAuthorizationCodeVerifier()
10700{
10701 assert(state_ == DiscordObjectState::Owned);
10702 Discord_AuthorizationCodeVerifier returnValueNative__{};
10703 Discord_Client_CreateAuthorizationCodeVerifier(&instance_, &returnValueNative__);
10704 discordpp::AuthorizationCodeVerifier returnValue__(returnValueNative__,
10705 DiscordObjectState::Owned);
10706 return returnValue__;
10707}
10708void Client::ExchangeChildToken(std::string const& parentApplicationToken,
10709 uint64_t childApplicationId,
10711{
10712 assert(state_ == DiscordObjectState::Owned);
10713 Discord_String parentApplicationToken__str{(uint8_t*)(parentApplicationToken.data()),
10714 parentApplicationToken.size()};
10715 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
10716 auto callback__userData = new Tcallback__UserData(callback);
10717 Discord_Client_ExchangeChildTokenCallback callback__native = [](auto result,
10718 auto accessToken,
10719 auto tokenType,
10720 auto expiresIn,
10721 auto scopes,
10722 void* userData__) {
10723 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
10724 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
10725 std::string accessToken__str(reinterpret_cast<char*>(accessToken.ptr), accessToken.size);
10726 std::string scopes__str(reinterpret_cast<char*>(scopes.ptr), scopes.size);
10727 userData__typed->delegate(std::move(result__obj),
10728 std::move(accessToken__str),
10729 static_cast<discordpp::AuthorizationTokenType>(tokenType),
10730 expiresIn,
10731 std::move(scopes__str));
10732 Discord_Free(scopes.ptr);
10733 Discord_Free(accessToken.ptr);
10734 };
10735 Discord_Client_ExchangeChildToken(&instance_,
10736 parentApplicationToken__str,
10737 childApplicationId,
10738 callback__native,
10739 Tcallback__UserData::Free,
10740 callback__userData);
10741}
10742void Client::FetchCurrentUser(discordpp::AuthorizationTokenType tokenType,
10743 std::string const& token,
10745{
10746 assert(state_ == DiscordObjectState::Owned);
10747 Discord_String token__str{(uint8_t*)(token.data()), token.size()};
10748 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
10749 auto callback__userData = new Tcallback__UserData(callback);
10750 Discord_Client_FetchCurrentUserCallback callback__native =
10751 [](auto result, auto id, auto name, void* userData__) {
10752 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
10753 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
10754 std::string name__str(reinterpret_cast<char*>(name.ptr), name.size);
10755 userData__typed->delegate(std::move(result__obj), id, std::move(name__str));
10756 Discord_Free(name.ptr);
10757 };
10758 Discord_Client_FetchCurrentUser(&instance_,
10759 static_cast<Discord_AuthorizationTokenType>(tokenType),
10760 token__str,
10761 callback__native,
10762 Tcallback__UserData::Free,
10763 callback__userData);
10764}
10765void Client::GetProvisionalToken(uint64_t applicationId,
10767 std::string const& externalAuthToken,
10769{
10770 assert(state_ == DiscordObjectState::Owned);
10771 Discord_String externalAuthToken__str{(uint8_t*)(externalAuthToken.data()),
10772 externalAuthToken.size()};
10773 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
10774 auto callback__userData = new Tcallback__UserData(callback);
10775 Discord_Client_TokenExchangeCallback callback__native = [](auto result,
10776 auto accessToken,
10777 auto refreshToken,
10778 auto tokenType,
10779 auto expiresIn,
10780 auto scopes,
10781 void* userData__) {
10782 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
10783 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
10784 std::string accessToken__str(reinterpret_cast<char*>(accessToken.ptr), accessToken.size);
10785 std::string refreshToken__str(reinterpret_cast<char*>(refreshToken.ptr), refreshToken.size);
10786 std::string scopes__str(reinterpret_cast<char*>(scopes.ptr), scopes.size);
10787 userData__typed->delegate(std::move(result__obj),
10788 std::move(accessToken__str),
10789 std::move(refreshToken__str),
10790 static_cast<discordpp::AuthorizationTokenType>(tokenType),
10791 expiresIn,
10792 std::move(scopes__str));
10793 Discord_Free(scopes.ptr);
10794 Discord_Free(refreshToken.ptr);
10795 Discord_Free(accessToken.ptr);
10796 };
10797 Discord_Client_GetProvisionalToken(
10798 &instance_,
10799 applicationId,
10800 static_cast<Discord_AuthenticationExternalAuthType>(externalAuthType),
10801 externalAuthToken__str,
10802 callback__native,
10803 Tcallback__UserData::Free,
10804 callback__userData);
10805}
10806void Client::GetToken(uint64_t applicationId,
10807 std::string const& code,
10808 std::string const& codeVerifier,
10809 std::string const& redirectUri,
10811{
10812 assert(state_ == DiscordObjectState::Owned);
10813 Discord_String code__str{(uint8_t*)(code.data()), code.size()};
10814 Discord_String codeVerifier__str{(uint8_t*)(codeVerifier.data()), codeVerifier.size()};
10815 Discord_String redirectUri__str{(uint8_t*)(redirectUri.data()), redirectUri.size()};
10816 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
10817 auto callback__userData = new Tcallback__UserData(callback);
10818 Discord_Client_TokenExchangeCallback callback__native = [](auto result,
10819 auto accessToken,
10820 auto refreshToken,
10821 auto tokenType,
10822 auto expiresIn,
10823 auto scopes,
10824 void* userData__) {
10825 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
10826 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
10827 std::string accessToken__str(reinterpret_cast<char*>(accessToken.ptr), accessToken.size);
10828 std::string refreshToken__str(reinterpret_cast<char*>(refreshToken.ptr), refreshToken.size);
10829 std::string scopes__str(reinterpret_cast<char*>(scopes.ptr), scopes.size);
10830 userData__typed->delegate(std::move(result__obj),
10831 std::move(accessToken__str),
10832 std::move(refreshToken__str),
10833 static_cast<discordpp::AuthorizationTokenType>(tokenType),
10834 expiresIn,
10835 std::move(scopes__str));
10836 Discord_Free(scopes.ptr);
10837 Discord_Free(refreshToken.ptr);
10838 Discord_Free(accessToken.ptr);
10839 };
10840 Discord_Client_GetToken(&instance_,
10841 applicationId,
10842 code__str,
10843 codeVerifier__str,
10844 redirectUri__str,
10845 callback__native,
10846 Tcallback__UserData::Free,
10847 callback__userData);
10848}
10849void Client::GetTokenFromDevice(discordpp::DeviceAuthorizationArgs args,
10851{
10852 assert(state_ == DiscordObjectState::Owned);
10853 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
10854 auto callback__userData = new Tcallback__UserData(callback);
10855 Discord_Client_TokenExchangeCallback callback__native = [](auto result,
10856 auto accessToken,
10857 auto refreshToken,
10858 auto tokenType,
10859 auto expiresIn,
10860 auto scopes,
10861 void* userData__) {
10862 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
10863 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
10864 std::string accessToken__str(reinterpret_cast<char*>(accessToken.ptr), accessToken.size);
10865 std::string refreshToken__str(reinterpret_cast<char*>(refreshToken.ptr), refreshToken.size);
10866 std::string scopes__str(reinterpret_cast<char*>(scopes.ptr), scopes.size);
10867 userData__typed->delegate(std::move(result__obj),
10868 std::move(accessToken__str),
10869 std::move(refreshToken__str),
10870 static_cast<discordpp::AuthorizationTokenType>(tokenType),
10871 expiresIn,
10872 std::move(scopes__str));
10873 Discord_Free(scopes.ptr);
10874 Discord_Free(refreshToken.ptr);
10875 Discord_Free(accessToken.ptr);
10876 };
10877 Discord_Client_GetTokenFromDevice(
10878 &instance_, args.instance(), callback__native, Tcallback__UserData::Free, callback__userData);
10879}
10880void Client::GetTokenFromDeviceProvisionalMerge(
10883 std::string const& externalAuthToken,
10885{
10886 assert(state_ == DiscordObjectState::Owned);
10887 Discord_String externalAuthToken__str{(uint8_t*)(externalAuthToken.data()),
10888 externalAuthToken.size()};
10889 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
10890 auto callback__userData = new Tcallback__UserData(callback);
10891 Discord_Client_TokenExchangeCallback callback__native = [](auto result,
10892 auto accessToken,
10893 auto refreshToken,
10894 auto tokenType,
10895 auto expiresIn,
10896 auto scopes,
10897 void* userData__) {
10898 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
10899 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
10900 std::string accessToken__str(reinterpret_cast<char*>(accessToken.ptr), accessToken.size);
10901 std::string refreshToken__str(reinterpret_cast<char*>(refreshToken.ptr), refreshToken.size);
10902 std::string scopes__str(reinterpret_cast<char*>(scopes.ptr), scopes.size);
10903 userData__typed->delegate(std::move(result__obj),
10904 std::move(accessToken__str),
10905 std::move(refreshToken__str),
10906 static_cast<discordpp::AuthorizationTokenType>(tokenType),
10907 expiresIn,
10908 std::move(scopes__str));
10909 Discord_Free(scopes.ptr);
10910 Discord_Free(refreshToken.ptr);
10911 Discord_Free(accessToken.ptr);
10912 };
10913 Discord_Client_GetTokenFromDeviceProvisionalMerge(
10914 &instance_,
10915 args.instance(),
10916 static_cast<Discord_AuthenticationExternalAuthType>(externalAuthType),
10917 externalAuthToken__str,
10918 callback__native,
10919 Tcallback__UserData::Free,
10920 callback__userData);
10921}
10922void Client::GetTokenFromProvisionalMerge(
10923 uint64_t applicationId,
10924 std::string const& code,
10925 std::string const& codeVerifier,
10926 std::string const& redirectUri,
10928 std::string const& externalAuthToken,
10930{
10931 assert(state_ == DiscordObjectState::Owned);
10932 Discord_String code__str{(uint8_t*)(code.data()), code.size()};
10933 Discord_String codeVerifier__str{(uint8_t*)(codeVerifier.data()), codeVerifier.size()};
10934 Discord_String redirectUri__str{(uint8_t*)(redirectUri.data()), redirectUri.size()};
10935 Discord_String externalAuthToken__str{(uint8_t*)(externalAuthToken.data()),
10936 externalAuthToken.size()};
10937 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
10938 auto callback__userData = new Tcallback__UserData(callback);
10939 Discord_Client_TokenExchangeCallback callback__native = [](auto result,
10940 auto accessToken,
10941 auto refreshToken,
10942 auto tokenType,
10943 auto expiresIn,
10944 auto scopes,
10945 void* userData__) {
10946 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
10947 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
10948 std::string accessToken__str(reinterpret_cast<char*>(accessToken.ptr), accessToken.size);
10949 std::string refreshToken__str(reinterpret_cast<char*>(refreshToken.ptr), refreshToken.size);
10950 std::string scopes__str(reinterpret_cast<char*>(scopes.ptr), scopes.size);
10951 userData__typed->delegate(std::move(result__obj),
10952 std::move(accessToken__str),
10953 std::move(refreshToken__str),
10954 static_cast<discordpp::AuthorizationTokenType>(tokenType),
10955 expiresIn,
10956 std::move(scopes__str));
10957 Discord_Free(scopes.ptr);
10958 Discord_Free(refreshToken.ptr);
10959 Discord_Free(accessToken.ptr);
10960 };
10961 Discord_Client_GetTokenFromProvisionalMerge(
10962 &instance_,
10963 applicationId,
10964 code__str,
10965 codeVerifier__str,
10966 redirectUri__str,
10967 static_cast<Discord_AuthenticationExternalAuthType>(externalAuthType),
10968 externalAuthToken__str,
10969 callback__native,
10970 Tcallback__UserData::Free,
10971 callback__userData);
10972}
10973bool Client::IsAuthenticated()
10974{
10975 assert(state_ == DiscordObjectState::Owned);
10976 bool returnValue__;
10977 returnValue__ = Discord_Client_IsAuthenticated(&instance_);
10978 return returnValue__;
10979}
10980void Client::OpenAuthorizeDeviceScreen(uint64_t clientId, std::string const& userCode)
10981{
10982 assert(state_ == DiscordObjectState::Owned);
10983 Discord_String userCode__str{(uint8_t*)(userCode.data()), userCode.size()};
10984 Discord_Client_OpenAuthorizeDeviceScreen(&instance_, clientId, userCode__str);
10985}
10986void Client::ProvisionalUserMergeCompleted(bool success)
10987{
10988 assert(state_ == DiscordObjectState::Owned);
10989 Discord_Client_ProvisionalUserMergeCompleted(&instance_, success);
10990}
10991void Client::RefreshToken(uint64_t applicationId,
10992 std::string const& refreshToken,
10994{
10995 assert(state_ == DiscordObjectState::Owned);
10996 Discord_String refreshToken__str{(uint8_t*)(refreshToken.data()), refreshToken.size()};
10997 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
10998 auto callback__userData = new Tcallback__UserData(callback);
10999 Discord_Client_TokenExchangeCallback callback__native = [](auto result,
11000 auto accessToken,
11001 auto refreshToken,
11002 auto tokenType,
11003 auto expiresIn,
11004 auto scopes,
11005 void* userData__) {
11006 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
11007 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11008 std::string accessToken__str(reinterpret_cast<char*>(accessToken.ptr), accessToken.size);
11009 std::string refreshToken__str(reinterpret_cast<char*>(refreshToken.ptr), refreshToken.size);
11010 std::string scopes__str(reinterpret_cast<char*>(scopes.ptr), scopes.size);
11011 userData__typed->delegate(std::move(result__obj),
11012 std::move(accessToken__str),
11013 std::move(refreshToken__str),
11014 static_cast<discordpp::AuthorizationTokenType>(tokenType),
11015 expiresIn,
11016 std::move(scopes__str));
11017 Discord_Free(scopes.ptr);
11018 Discord_Free(refreshToken.ptr);
11019 Discord_Free(accessToken.ptr);
11020 };
11021 Discord_Client_RefreshToken(&instance_,
11022 applicationId,
11023 refreshToken__str,
11024 callback__native,
11025 Tcallback__UserData::Free,
11026 callback__userData);
11027}
11028void Client::RegisterAuthorizeRequestCallback(discordpp::Client::AuthorizeRequestCallback callback)
11029{
11030 assert(state_ == DiscordObjectState::Owned);
11031 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
11032 auto callback__userData = new Tcallback__UserData(callback);
11033 Discord_Client_AuthorizeRequestCallback callback__native = [](void* userData__) {
11034 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
11035 userData__typed->delegate();
11036 };
11037 Discord_Client_RegisterAuthorizeRequestCallback(
11038 &instance_, callback__native, Tcallback__UserData::Free, callback__userData);
11039}
11040void Client::RemoveAuthorizeRequestCallback()
11041{
11042 assert(state_ == DiscordObjectState::Owned);
11043 Discord_Client_RemoveAuthorizeRequestCallback(&instance_);
11044}
11045void Client::RevokeToken(uint64_t applicationId,
11046 std::string const& token,
11048{
11049 assert(state_ == DiscordObjectState::Owned);
11050 Discord_String token__str{(uint8_t*)(token.data()), token.size()};
11051 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
11052 auto callback__userData = new Tcallback__UserData(callback);
11053 Discord_Client_RevokeTokenCallback callback__native = [](auto result, void* userData__) {
11054 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
11055 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11056 userData__typed->delegate(std::move(result__obj));
11057 };
11058 Discord_Client_RevokeToken(&instance_,
11059 applicationId,
11060 token__str,
11061 callback__native,
11062 Tcallback__UserData::Free,
11063 callback__userData);
11064}
11065void Client::SetAuthorizeDeviceScreenClosedCallback(
11067{
11068 assert(state_ == DiscordObjectState::Owned);
11069 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11070 auto cb__userData = new Tcb__UserData(cb);
11071 Discord_Client_AuthorizeDeviceScreenClosedCallback cb__native = [](void* userData__) {
11072 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
11073 userData__typed->delegate();
11074 };
11075 Discord_Client_SetAuthorizeDeviceScreenClosedCallback(
11076 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11077}
11078void Client::SetGameWindowPid(int32_t pid)
11079{
11080 assert(state_ == DiscordObjectState::Owned);
11081 Discord_Client_SetGameWindowPid(&instance_, pid);
11082}
11083void Client::SetTokenExpirationCallback(discordpp::Client::TokenExpirationCallback callback)
11084{
11085 assert(state_ == DiscordObjectState::Owned);
11086 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
11087 auto callback__userData = new Tcallback__UserData(callback);
11088 Discord_Client_TokenExpirationCallback callback__native = [](void* userData__) {
11089 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
11090 userData__typed->delegate();
11091 };
11092 Discord_Client_SetTokenExpirationCallback(
11093 &instance_, callback__native, Tcallback__UserData::Free, callback__userData);
11094}
11095void Client::UnmergeIntoProvisionalAccount(
11096 uint64_t applicationId,
11098 std::string const& externalAuthToken,
11100{
11101 assert(state_ == DiscordObjectState::Owned);
11102 Discord_String externalAuthToken__str{(uint8_t*)(externalAuthToken.data()),
11103 externalAuthToken.size()};
11104 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
11105 auto callback__userData = new Tcallback__UserData(callback);
11106 Discord_Client_UnmergeIntoProvisionalAccountCallback callback__native = [](auto result,
11107 void* userData__) {
11108 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
11109 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11110 userData__typed->delegate(std::move(result__obj));
11111 };
11112 Discord_Client_UnmergeIntoProvisionalAccount(
11113 &instance_,
11114 applicationId,
11115 static_cast<Discord_AuthenticationExternalAuthType>(externalAuthType),
11116 externalAuthToken__str,
11117 callback__native,
11118 Tcallback__UserData::Free,
11119 callback__userData);
11120}
11121void Client::UpdateProvisionalAccountDisplayName(
11122 std::string const& name,
11124{
11125 assert(state_ == DiscordObjectState::Owned);
11126 Discord_String name__str{(uint8_t*)(name.data()), name.size()};
11127 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
11128 auto callback__userData = new Tcallback__UserData(callback);
11129 Discord_Client_UpdateProvisionalAccountDisplayNameCallback callback__native =
11130 [](auto result, void* userData__) {
11131 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
11132 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11133 userData__typed->delegate(std::move(result__obj));
11134 };
11135 Discord_Client_UpdateProvisionalAccountDisplayName(
11136 &instance_, name__str, callback__native, Tcallback__UserData::Free, callback__userData);
11137}
11138void Client::UpdateToken(discordpp::AuthorizationTokenType tokenType,
11139 std::string token,
11141{
11142 assert(state_ == DiscordObjectState::Owned);
11143 Discord_String token__str{(uint8_t*)(token.data()), token.size()};
11144 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
11145 auto callback__userData = new Tcallback__UserData(callback);
11146 Discord_Client_UpdateTokenCallback callback__native = [](auto result, void* userData__) {
11147 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
11148 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11149 userData__typed->delegate(std::move(result__obj));
11150 };
11151 Discord_Client_UpdateToken(&instance_,
11152 static_cast<Discord_AuthorizationTokenType>(tokenType),
11153 token__str,
11154 callback__native,
11155 Tcallback__UserData::Free,
11156 callback__userData);
11157}
11158bool Client::CanOpenMessageInDiscord(uint64_t messageId)
11159{
11160 assert(state_ == DiscordObjectState::Owned);
11161 bool returnValue__;
11162 returnValue__ = Discord_Client_CanOpenMessageInDiscord(&instance_, messageId);
11163 return returnValue__;
11164}
11165void Client::DeleteUserMessage(uint64_t recipientId,
11166 uint64_t messageId,
11168{
11169 assert(state_ == DiscordObjectState::Owned);
11170 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11171 auto cb__userData = new Tcb__UserData(cb);
11172 Discord_Client_DeleteUserMessageCallback cb__native = [](auto result, void* userData__) {
11173 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
11174 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11175 userData__typed->delegate(std::move(result__obj));
11176 };
11177 Discord_Client_DeleteUserMessage(
11178 &instance_, recipientId, messageId, cb__native, Tcb__UserData::Free, cb__userData);
11179}
11180void Client::EditUserMessage(uint64_t recipientId,
11181 uint64_t messageId,
11182 std::string const& content,
11184{
11185 assert(state_ == DiscordObjectState::Owned);
11186 Discord_String content__str{(uint8_t*)(content.data()), content.size()};
11187 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11188 auto cb__userData = new Tcb__UserData(cb);
11189 Discord_Client_EditUserMessageCallback cb__native = [](auto result, void* userData__) {
11190 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
11191 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11192 userData__typed->delegate(std::move(result__obj));
11193 };
11194 Discord_Client_EditUserMessage(&instance_,
11195 recipientId,
11196 messageId,
11197 content__str,
11198 cb__native,
11199 Tcb__UserData::Free,
11200 cb__userData);
11201}
11202std::optional<discordpp::ChannelHandle> Client::GetChannelHandle(uint64_t channelId) const
11203{
11204 assert(state_ == DiscordObjectState::Owned);
11205 bool returnIsNonNull__;
11206 Discord_ChannelHandle returnValueNative__;
11207 returnIsNonNull__ =
11208 Discord_Client_GetChannelHandle(&instance_, channelId, &returnValueNative__);
11209 if (!returnIsNonNull__) {
11210 return {};
11211 }
11212 discordpp::ChannelHandle returnValue__(returnValueNative__, DiscordObjectState::Owned);
11213 return returnValue__;
11214}
11215void Client::GetLobbyMessagesWithLimit(uint64_t lobbyId,
11216 int32_t limit,
11218{
11219 assert(state_ == DiscordObjectState::Owned);
11220 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11221 auto cb__userData = new Tcb__UserData(cb);
11222 Discord_Client_GetLobbyMessagesCallback cb__native =
11223 [](auto result, auto messages, void* userData__) {
11224 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
11225 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11226 std::vector<discordpp::MessageHandle> messages__vec;
11227 messages__vec.reserve(messages.size);
11228 for (size_t i__ = 0; i__ < messages.size; ++i__) {
11229 messages__vec.emplace_back(messages.ptr[i__], DiscordObjectState::Owned);
11230 }
11231 Discord_Free(messages.ptr);
11232 userData__typed->delegate(std::move(result__obj), std::move(messages__vec));
11233 };
11234 Discord_Client_GetLobbyMessagesWithLimit(
11235 &instance_, lobbyId, limit, cb__native, Tcb__UserData::Free, cb__userData);
11236}
11237std::optional<discordpp::MessageHandle> Client::GetMessageHandle(uint64_t messageId) const
11238{
11239 assert(state_ == DiscordObjectState::Owned);
11240 bool returnIsNonNull__;
11241 Discord_MessageHandle returnValueNative__;
11242 returnIsNonNull__ =
11243 Discord_Client_GetMessageHandle(&instance_, messageId, &returnValueNative__);
11244 if (!returnIsNonNull__) {
11245 return {};
11246 }
11247 discordpp::MessageHandle returnValue__(returnValueNative__, DiscordObjectState::Owned);
11248 return returnValue__;
11249}
11250void Client::GetUserMessageSummaries(discordpp::Client::UserMessageSummariesCallback cb)
11251{
11252 assert(state_ == DiscordObjectState::Owned);
11253 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11254 auto cb__userData = new Tcb__UserData(cb);
11255 Discord_Client_UserMessageSummariesCallback cb__native =
11256 [](auto result, auto summaries, void* userData__) {
11257 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
11258 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11259 std::vector<discordpp::UserMessageSummary> summaries__vec;
11260 summaries__vec.reserve(summaries.size);
11261 for (size_t i__ = 0; i__ < summaries.size; ++i__) {
11262 summaries__vec.emplace_back(summaries.ptr[i__], DiscordObjectState::Owned);
11263 }
11264 Discord_Free(summaries.ptr);
11265 userData__typed->delegate(std::move(result__obj), std::move(summaries__vec));
11266 };
11267 Discord_Client_GetUserMessageSummaries(
11268 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11269}
11270void Client::GetUserMessagesWithLimit(uint64_t recipientId,
11271 int32_t limit,
11273{
11274 assert(state_ == DiscordObjectState::Owned);
11275 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11276 auto cb__userData = new Tcb__UserData(cb);
11277 Discord_Client_UserMessagesWithLimitCallback cb__native =
11278 [](auto result, auto messages, void* userData__) {
11279 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
11280 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11281 std::vector<discordpp::MessageHandle> messages__vec;
11282 messages__vec.reserve(messages.size);
11283 for (size_t i__ = 0; i__ < messages.size; ++i__) {
11284 messages__vec.emplace_back(messages.ptr[i__], DiscordObjectState::Owned);
11285 }
11286 Discord_Free(messages.ptr);
11287 userData__typed->delegate(std::move(result__obj), std::move(messages__vec));
11288 };
11289 Discord_Client_GetUserMessagesWithLimit(
11290 &instance_, recipientId, limit, cb__native, Tcb__UserData::Free, cb__userData);
11291}
11292void Client::OpenMessageInDiscord(
11293 uint64_t messageId,
11294 discordpp::Client::ProvisionalUserMergeRequiredCallback provisionalUserMergeRequiredCallback,
11296{
11297 assert(state_ == DiscordObjectState::Owned);
11298 using TprovisionalUserMergeRequiredCallback__UserData =
11299 TDelegateUserData<std::remove_reference_t<decltype(provisionalUserMergeRequiredCallback)>>;
11300 auto provisionalUserMergeRequiredCallback__userData =
11301 new TprovisionalUserMergeRequiredCallback__UserData(provisionalUserMergeRequiredCallback);
11302 Discord_Client_ProvisionalUserMergeRequiredCallback
11303 provisionalUserMergeRequiredCallback__native = [](void* userData__) {
11304 auto userData__typed =
11305 static_cast<TprovisionalUserMergeRequiredCallback__UserData*>(userData__);
11306 userData__typed->delegate();
11307 };
11308 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
11309 auto callback__userData = new Tcallback__UserData(callback);
11310 Discord_Client_OpenMessageInDiscordCallback callback__native = [](auto result,
11311 void* userData__) {
11312 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
11313 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11314 userData__typed->delegate(std::move(result__obj));
11315 };
11316 Discord_Client_OpenMessageInDiscord(&instance_,
11317 messageId,
11318 provisionalUserMergeRequiredCallback__native,
11319 TprovisionalUserMergeRequiredCallback__UserData::Free,
11320 provisionalUserMergeRequiredCallback__userData,
11321 callback__native,
11322 Tcallback__UserData::Free,
11323 callback__userData);
11324}
11325void Client::SendLobbyMessage(uint64_t lobbyId,
11326 std::string const& content,
11328{
11329 assert(state_ == DiscordObjectState::Owned);
11330 Discord_String content__str{(uint8_t*)(content.data()), content.size()};
11331 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11332 auto cb__userData = new Tcb__UserData(cb);
11333 Discord_Client_SendUserMessageCallback cb__native =
11334 [](auto result, auto messageId, void* userData__) {
11335 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
11336 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11337 userData__typed->delegate(std::move(result__obj), messageId);
11338 };
11339 Discord_Client_SendLobbyMessage(
11340 &instance_, lobbyId, content__str, cb__native, Tcb__UserData::Free, cb__userData);
11341}
11342void Client::SendLobbyMessageWithMetadata(
11343 uint64_t lobbyId,
11344 std::string const& content,
11345 std::unordered_map<std::string, std::string> const& metadata,
11347{
11348 assert(state_ == DiscordObjectState::Owned);
11349 Discord_String content__str{(uint8_t*)(content.data()), content.size()};
11350 ConvertedProperties metadata__convert(metadata);
11351 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11352 auto cb__userData = new Tcb__UserData(cb);
11353 Discord_Client_SendUserMessageCallback cb__native =
11354 [](auto result, auto messageId, void* userData__) {
11355 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
11356 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11357 userData__typed->delegate(std::move(result__obj), messageId);
11358 };
11359 Discord_Client_SendLobbyMessageWithMetadata(&instance_,
11360 lobbyId,
11361 content__str,
11362 metadata__convert.Properties,
11363 cb__native,
11364 Tcb__UserData::Free,
11365 cb__userData);
11366}
11367void Client::SendUserMessage(uint64_t recipientId,
11368 std::string const& content,
11370{
11371 assert(state_ == DiscordObjectState::Owned);
11372 Discord_String content__str{(uint8_t*)(content.data()), content.size()};
11373 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11374 auto cb__userData = new Tcb__UserData(cb);
11375 Discord_Client_SendUserMessageCallback cb__native =
11376 [](auto result, auto messageId, void* userData__) {
11377 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
11378 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11379 userData__typed->delegate(std::move(result__obj), messageId);
11380 };
11381 Discord_Client_SendUserMessage(
11382 &instance_, recipientId, content__str, cb__native, Tcb__UserData::Free, cb__userData);
11383}
11384void Client::SendUserMessageWithMetadata(
11385 uint64_t recipientId,
11386 std::string const& content,
11387 std::unordered_map<std::string, std::string> const& metadata,
11389{
11390 assert(state_ == DiscordObjectState::Owned);
11391 Discord_String content__str{(uint8_t*)(content.data()), content.size()};
11392 ConvertedProperties metadata__convert(metadata);
11393 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11394 auto cb__userData = new Tcb__UserData(cb);
11395 Discord_Client_SendUserMessageCallback cb__native =
11396 [](auto result, auto messageId, void* userData__) {
11397 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
11398 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11399 userData__typed->delegate(std::move(result__obj), messageId);
11400 };
11401 Discord_Client_SendUserMessageWithMetadata(&instance_,
11402 recipientId,
11403 content__str,
11404 metadata__convert.Properties,
11405 cb__native,
11406 Tcb__UserData::Free,
11407 cb__userData);
11408}
11409void Client::SetMessageCreatedCallback(discordpp::Client::MessageCreatedCallback cb)
11410{
11411 assert(state_ == DiscordObjectState::Owned);
11412 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11413 auto cb__userData = new Tcb__UserData(cb);
11414 Discord_Client_MessageCreatedCallback cb__native = [](auto messageId, void* userData__) {
11415 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
11416 userData__typed->delegate(messageId);
11417 };
11418 Discord_Client_SetMessageCreatedCallback(
11419 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11420}
11421void Client::SetMessageDeletedCallback(discordpp::Client::MessageDeletedCallback cb)
11422{
11423 assert(state_ == DiscordObjectState::Owned);
11424 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11425 auto cb__userData = new Tcb__UserData(cb);
11426 Discord_Client_MessageDeletedCallback cb__native =
11427 [](auto messageId, auto channelId, void* userData__) {
11428 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
11429 userData__typed->delegate(messageId, channelId);
11430 };
11431 Discord_Client_SetMessageDeletedCallback(
11432 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11433}
11434void Client::SetMessageUpdatedCallback(discordpp::Client::MessageUpdatedCallback cb)
11435{
11436 assert(state_ == DiscordObjectState::Owned);
11437 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11438 auto cb__userData = new Tcb__UserData(cb);
11439 Discord_Client_MessageUpdatedCallback cb__native = [](auto messageId, void* userData__) {
11440 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
11441 userData__typed->delegate(messageId);
11442 };
11443 Discord_Client_SetMessageUpdatedCallback(
11444 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11445}
11446void Client::SetShowingChat(bool showingChat)
11447{
11448 assert(state_ == DiscordObjectState::Owned);
11449 Discord_Client_SetShowingChat(&instance_, showingChat);
11450}
11451void Client::AddLogCallback(discordpp::Client::LogCallback callback,
11452 discordpp::LoggingSeverity minSeverity)
11453{
11454 assert(state_ == DiscordObjectState::Owned);
11455 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
11456 auto callback__userData = new Tcallback__UserData(callback);
11457 Discord_Client_LogCallback callback__native = [](
11458 auto message, auto severity, void* userData__) {
11459 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
11460 std::string message__str(reinterpret_cast<char*>(message.ptr), message.size);
11461 userData__typed->delegate(std::move(message__str),
11462 static_cast<discordpp::LoggingSeverity>(severity));
11463 Discord_Free(message.ptr);
11464 };
11465 Discord_Client_AddLogCallback(&instance_,
11466 callback__native,
11467 Tcallback__UserData::Free,
11468 callback__userData,
11469 static_cast<Discord_LoggingSeverity>(minSeverity));
11470}
11471void Client::AddVoiceLogCallback(discordpp::Client::LogCallback callback,
11472 discordpp::LoggingSeverity minSeverity)
11473{
11474 assert(state_ == DiscordObjectState::Owned);
11475 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
11476 auto callback__userData = new Tcallback__UserData(callback);
11477 Discord_Client_LogCallback callback__native = [](
11478 auto message, auto severity, void* userData__) {
11479 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
11480 std::string message__str(reinterpret_cast<char*>(message.ptr), message.size);
11481 userData__typed->delegate(std::move(message__str),
11482 static_cast<discordpp::LoggingSeverity>(severity));
11483 Discord_Free(message.ptr);
11484 };
11485 Discord_Client_AddVoiceLogCallback(&instance_,
11486 callback__native,
11487 Tcallback__UserData::Free,
11488 callback__userData,
11489 static_cast<Discord_LoggingSeverity>(minSeverity));
11490}
11491void Client::Connect()
11492{
11493 assert(state_ == DiscordObjectState::Owned);
11494 Discord_Client_Connect(&instance_);
11495}
11496void Client::Disconnect()
11497{
11498 assert(state_ == DiscordObjectState::Owned);
11499 Discord_Client_Disconnect(&instance_);
11500}
11501discordpp::Client::Status Client::GetStatus() const
11502{
11503 assert(state_ == DiscordObjectState::Owned);
11504 Discord_Client_Status returnValue__;
11505 returnValue__ = Discord_Client_GetStatus(&instance_);
11506 return static_cast<discordpp::Client::Status>(returnValue__);
11507}
11508void Client::OpenConnectedGamesSettingsInDiscord(
11510{
11511 assert(state_ == DiscordObjectState::Owned);
11512 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
11513 auto callback__userData = new Tcallback__UserData(callback);
11514 Discord_Client_OpenConnectedGamesSettingsInDiscordCallback callback__native =
11515 [](auto result, void* userData__) {
11516 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
11517 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11518 userData__typed->delegate(std::move(result__obj));
11519 };
11520 Discord_Client_OpenConnectedGamesSettingsInDiscord(
11521 &instance_, callback__native, Tcallback__UserData::Free, callback__userData);
11522}
11523void Client::SetApplicationId(uint64_t applicationId)
11524{
11525 assert(state_ == DiscordObjectState::Owned);
11526 Discord_Client_SetApplicationId(&instance_, applicationId);
11527}
11528bool Client::SetLogDir(std::string const& path, discordpp::LoggingSeverity minSeverity)
11529{
11530 assert(state_ == DiscordObjectState::Owned);
11531 bool returnValue__;
11532 Discord_String path__str{(uint8_t*)(path.data()), path.size()};
11533 returnValue__ = Discord_Client_SetLogDir(
11534 &instance_, path__str, static_cast<Discord_LoggingSeverity>(minSeverity));
11535 return returnValue__;
11536}
11537void Client::SetStatusChangedCallback(discordpp::Client::OnStatusChanged cb)
11538{
11539 assert(state_ == DiscordObjectState::Owned);
11540 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11541 auto cb__userData = new Tcb__UserData(cb);
11542 Discord_Client_OnStatusChanged cb__native =
11543 [](auto status, auto error, auto errorDetail, void* userData__) {
11544 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
11545 userData__typed->delegate(static_cast<discordpp::Client::Status>(status),
11546 static_cast<discordpp::Client::Error>(error),
11547 errorDetail);
11548 };
11549 Discord_Client_SetStatusChangedCallback(
11550 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11551}
11552void Client::SetVoiceLogDir(std::string const& path, discordpp::LoggingSeverity minSeverity)
11553{
11554 assert(state_ == DiscordObjectState::Owned);
11555 Discord_String path__str{(uint8_t*)(path.data()), path.size()};
11556 Discord_Client_SetVoiceLogDir(
11557 &instance_, path__str, static_cast<Discord_LoggingSeverity>(minSeverity));
11558}
11559void Client::CreateOrJoinLobby(std::string const& secret,
11561{
11562 assert(state_ == DiscordObjectState::Owned);
11563 Discord_String secret__str{(uint8_t*)(secret.data()), secret.size()};
11564 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
11565 auto callback__userData = new Tcallback__UserData(callback);
11566 Discord_Client_CreateOrJoinLobbyCallback callback__native =
11567 [](auto result, auto lobbyId, void* userData__) {
11568 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
11569 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11570 userData__typed->delegate(std::move(result__obj), lobbyId);
11571 };
11572 Discord_Client_CreateOrJoinLobby(
11573 &instance_, secret__str, callback__native, Tcallback__UserData::Free, callback__userData);
11574}
11575void Client::CreateOrJoinLobbyWithMetadata(
11576 std::string const& secret,
11577 std::unordered_map<std::string, std::string> const& lobbyMetadata,
11578 std::unordered_map<std::string, std::string> const& memberMetadata,
11580{
11581 assert(state_ == DiscordObjectState::Owned);
11582 Discord_String secret__str{(uint8_t*)(secret.data()), secret.size()};
11583 ConvertedProperties lobbyMetadata__convert(lobbyMetadata);
11584 ConvertedProperties memberMetadata__convert(memberMetadata);
11585 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
11586 auto callback__userData = new Tcallback__UserData(callback);
11587 Discord_Client_CreateOrJoinLobbyCallback callback__native =
11588 [](auto result, auto lobbyId, void* userData__) {
11589 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
11590 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11591 userData__typed->delegate(std::move(result__obj), lobbyId);
11592 };
11593 Discord_Client_CreateOrJoinLobbyWithMetadata(&instance_,
11594 secret__str,
11595 lobbyMetadata__convert.Properties,
11596 memberMetadata__convert.Properties,
11597 callback__native,
11598 Tcallback__UserData::Free,
11599 callback__userData);
11600}
11601void Client::GetGuildChannels(uint64_t guildId, discordpp::Client::GetGuildChannelsCallback cb)
11602{
11603 assert(state_ == DiscordObjectState::Owned);
11604 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11605 auto cb__userData = new Tcb__UserData(cb);
11606 Discord_Client_GetGuildChannelsCallback cb__native =
11607 [](auto result, auto guildChannels, void* userData__) {
11608 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
11609 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11610 std::vector<discordpp::GuildChannel> guildChannels__vec;
11611 guildChannels__vec.reserve(guildChannels.size);
11612 for (size_t i__ = 0; i__ < guildChannels.size; ++i__) {
11613 guildChannels__vec.emplace_back(guildChannels.ptr[i__], DiscordObjectState::Owned);
11614 }
11615 Discord_Free(guildChannels.ptr);
11616 userData__typed->delegate(std::move(result__obj), std::move(guildChannels__vec));
11617 };
11618 Discord_Client_GetGuildChannels(
11619 &instance_, guildId, cb__native, Tcb__UserData::Free, cb__userData);
11620}
11621std::optional<discordpp::LobbyHandle> Client::GetLobbyHandle(uint64_t lobbyId) const
11622{
11623 assert(state_ == DiscordObjectState::Owned);
11624 bool returnIsNonNull__;
11625 Discord_LobbyHandle returnValueNative__;
11626 returnIsNonNull__ = Discord_Client_GetLobbyHandle(&instance_, lobbyId, &returnValueNative__);
11627 if (!returnIsNonNull__) {
11628 return {};
11629 }
11630 discordpp::LobbyHandle returnValue__(returnValueNative__, DiscordObjectState::Owned);
11631 return returnValue__;
11632}
11633std::vector<uint64_t> Client::GetLobbyIds() const
11634{
11635 assert(state_ == DiscordObjectState::Owned);
11636 Discord_UInt64Span returnValueNative__;
11637 Discord_Client_GetLobbyIds(&instance_, &returnValueNative__);
11638 std::vector<uint64_t> returnValue__(returnValueNative__.ptr,
11639 returnValueNative__.ptr + returnValueNative__.size);
11640 Discord_Free(returnValueNative__.ptr);
11641 return returnValue__;
11642}
11643void Client::GetUserGuilds(discordpp::Client::GetUserGuildsCallback cb)
11644{
11645 assert(state_ == DiscordObjectState::Owned);
11646 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11647 auto cb__userData = new Tcb__UserData(cb);
11648 Discord_Client_GetUserGuildsCallback cb__native =
11649 [](auto result, auto guilds, void* userData__) {
11650 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
11651 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11652 std::vector<discordpp::GuildMinimal> guilds__vec;
11653 guilds__vec.reserve(guilds.size);
11654 for (size_t i__ = 0; i__ < guilds.size; ++i__) {
11655 guilds__vec.emplace_back(guilds.ptr[i__], DiscordObjectState::Owned);
11656 }
11657 Discord_Free(guilds.ptr);
11658 userData__typed->delegate(std::move(result__obj), std::move(guilds__vec));
11659 };
11660 Discord_Client_GetUserGuilds(&instance_, cb__native, Tcb__UserData::Free, cb__userData);
11661}
11662void Client::JoinLinkedLobbyGuild(
11663 uint64_t lobbyId,
11664 discordpp::Client::ProvisionalUserMergeRequiredCallback provisionalUserMergeRequiredCallback,
11666{
11667 assert(state_ == DiscordObjectState::Owned);
11668 using TprovisionalUserMergeRequiredCallback__UserData =
11669 TDelegateUserData<std::remove_reference_t<decltype(provisionalUserMergeRequiredCallback)>>;
11670 auto provisionalUserMergeRequiredCallback__userData =
11671 new TprovisionalUserMergeRequiredCallback__UserData(provisionalUserMergeRequiredCallback);
11672 Discord_Client_ProvisionalUserMergeRequiredCallback
11673 provisionalUserMergeRequiredCallback__native = [](void* userData__) {
11674 auto userData__typed =
11675 static_cast<TprovisionalUserMergeRequiredCallback__UserData*>(userData__);
11676 userData__typed->delegate();
11677 };
11678 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
11679 auto callback__userData = new Tcallback__UserData(callback);
11680 Discord_Client_JoinLinkedLobbyGuildCallback callback__native =
11681 [](auto result, auto inviteUrl, void* userData__) {
11682 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
11683 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11684 std::string inviteUrl__str(reinterpret_cast<char*>(inviteUrl.ptr), inviteUrl.size);
11685 userData__typed->delegate(std::move(result__obj), std::move(inviteUrl__str));
11686 Discord_Free(inviteUrl.ptr);
11687 };
11688 Discord_Client_JoinLinkedLobbyGuild(&instance_,
11689 lobbyId,
11690 provisionalUserMergeRequiredCallback__native,
11691 TprovisionalUserMergeRequiredCallback__UserData::Free,
11692 provisionalUserMergeRequiredCallback__userData,
11693 callback__native,
11694 Tcallback__UserData::Free,
11695 callback__userData);
11696}
11697void Client::LeaveLobby(uint64_t lobbyId, discordpp::Client::LeaveLobbyCallback callback)
11698{
11699 assert(state_ == DiscordObjectState::Owned);
11700 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
11701 auto callback__userData = new Tcallback__UserData(callback);
11702 Discord_Client_LeaveLobbyCallback callback__native = [](auto result, void* userData__) {
11703 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
11704 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11705 userData__typed->delegate(std::move(result__obj));
11706 };
11707 Discord_Client_LeaveLobby(
11708 &instance_, lobbyId, callback__native, Tcallback__UserData::Free, callback__userData);
11709}
11710void Client::LinkChannelToLobby(uint64_t lobbyId,
11711 uint64_t channelId,
11713{
11714 assert(state_ == DiscordObjectState::Owned);
11715 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
11716 auto callback__userData = new Tcallback__UserData(callback);
11717 Discord_Client_LinkOrUnlinkChannelCallback callback__native = [](auto result,
11718 void* userData__) {
11719 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
11720 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11721 userData__typed->delegate(std::move(result__obj));
11722 };
11723 Discord_Client_LinkChannelToLobby(&instance_,
11724 lobbyId,
11725 channelId,
11726 callback__native,
11727 Tcallback__UserData::Free,
11728 callback__userData);
11729}
11730void Client::SetLobbyCreatedCallback(discordpp::Client::LobbyCreatedCallback cb)
11731{
11732 assert(state_ == DiscordObjectState::Owned);
11733 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11734 auto cb__userData = new Tcb__UserData(cb);
11735 Discord_Client_LobbyCreatedCallback cb__native = [](auto lobbyId, void* userData__) {
11736 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
11737 userData__typed->delegate(lobbyId);
11738 };
11739 Discord_Client_SetLobbyCreatedCallback(
11740 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11741}
11742void Client::SetLobbyDeletedCallback(discordpp::Client::LobbyDeletedCallback cb)
11743{
11744 assert(state_ == DiscordObjectState::Owned);
11745 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11746 auto cb__userData = new Tcb__UserData(cb);
11747 Discord_Client_LobbyDeletedCallback cb__native = [](auto lobbyId, void* userData__) {
11748 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
11749 userData__typed->delegate(lobbyId);
11750 };
11751 Discord_Client_SetLobbyDeletedCallback(
11752 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11753}
11754void Client::SetLobbyMemberAddedCallback(discordpp::Client::LobbyMemberAddedCallback cb)
11755{
11756 assert(state_ == DiscordObjectState::Owned);
11757 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11758 auto cb__userData = new Tcb__UserData(cb);
11759 Discord_Client_LobbyMemberAddedCallback cb__native =
11760 [](auto lobbyId, auto memberId, void* userData__) {
11761 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
11762 userData__typed->delegate(lobbyId, memberId);
11763 };
11764 Discord_Client_SetLobbyMemberAddedCallback(
11765 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11766}
11767void Client::SetLobbyMemberRemovedCallback(discordpp::Client::LobbyMemberRemovedCallback cb)
11768{
11769 assert(state_ == DiscordObjectState::Owned);
11770 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11771 auto cb__userData = new Tcb__UserData(cb);
11772 Discord_Client_LobbyMemberRemovedCallback cb__native =
11773 [](auto lobbyId, auto memberId, void* userData__) {
11774 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
11775 userData__typed->delegate(lobbyId, memberId);
11776 };
11777 Discord_Client_SetLobbyMemberRemovedCallback(
11778 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11779}
11780void Client::SetLobbyMemberUpdatedCallback(discordpp::Client::LobbyMemberUpdatedCallback cb)
11781{
11782 assert(state_ == DiscordObjectState::Owned);
11783 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11784 auto cb__userData = new Tcb__UserData(cb);
11785 Discord_Client_LobbyMemberUpdatedCallback cb__native =
11786 [](auto lobbyId, auto memberId, void* userData__) {
11787 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
11788 userData__typed->delegate(lobbyId, memberId);
11789 };
11790 Discord_Client_SetLobbyMemberUpdatedCallback(
11791 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11792}
11793void Client::SetLobbyUpdatedCallback(discordpp::Client::LobbyUpdatedCallback cb)
11794{
11795 assert(state_ == DiscordObjectState::Owned);
11796 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11797 auto cb__userData = new Tcb__UserData(cb);
11798 Discord_Client_LobbyUpdatedCallback cb__native = [](auto lobbyId, void* userData__) {
11799 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
11800 userData__typed->delegate(lobbyId);
11801 };
11802 Discord_Client_SetLobbyUpdatedCallback(
11803 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11804}
11805void Client::UnlinkChannelFromLobby(uint64_t lobbyId,
11807{
11808 assert(state_ == DiscordObjectState::Owned);
11809 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
11810 auto callback__userData = new Tcallback__UserData(callback);
11811 Discord_Client_LinkOrUnlinkChannelCallback callback__native = [](auto result,
11812 void* userData__) {
11813 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
11814 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11815 userData__typed->delegate(std::move(result__obj));
11816 };
11817 Discord_Client_UnlinkChannelFromLobby(
11818 &instance_, lobbyId, callback__native, Tcallback__UserData::Free, callback__userData);
11819}
11820void Client::AcceptActivityInvite(discordpp::ActivityInvite invite,
11822{
11823 assert(state_ == DiscordObjectState::Owned);
11824 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11825 auto cb__userData = new Tcb__UserData(cb);
11826 Discord_Client_AcceptActivityInviteCallback cb__native =
11827 [](auto result, auto joinSecret, void* userData__) {
11828 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
11829 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11830 std::string joinSecret__str(reinterpret_cast<char*>(joinSecret.ptr), joinSecret.size);
11831 userData__typed->delegate(std::move(result__obj), std::move(joinSecret__str));
11832 Discord_Free(joinSecret.ptr);
11833 };
11834 Discord_Client_AcceptActivityInvite(
11835 &instance_, invite.instance(), cb__native, Tcb__UserData::Free, cb__userData);
11836}
11837void Client::ClearRichPresence()
11838{
11839 assert(state_ == DiscordObjectState::Owned);
11840 Discord_Client_ClearRichPresence(&instance_);
11841}
11842bool Client::RegisterLaunchCommand(uint64_t applicationId, std::string command)
11843{
11844 assert(state_ == DiscordObjectState::Owned);
11845 bool returnValue__;
11846 Discord_String command__str{(uint8_t*)(command.data()), command.size()};
11847 returnValue__ = Discord_Client_RegisterLaunchCommand(&instance_, applicationId, command__str);
11848 return returnValue__;
11849}
11850bool Client::RegisterLaunchSteamApplication(uint64_t applicationId, uint32_t steamAppId)
11851{
11852 assert(state_ == DiscordObjectState::Owned);
11853 bool returnValue__;
11854 returnValue__ =
11855 Discord_Client_RegisterLaunchSteamApplication(&instance_, applicationId, steamAppId);
11856 return returnValue__;
11857}
11858void Client::SendActivityInvite(uint64_t userId,
11859 std::string const& content,
11861{
11862 assert(state_ == DiscordObjectState::Owned);
11863 Discord_String content__str{(uint8_t*)(content.data()), content.size()};
11864 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11865 auto cb__userData = new Tcb__UserData(cb);
11866 Discord_Client_SendActivityInviteCallback cb__native = [](auto result, void* userData__) {
11867 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
11868 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11869 userData__typed->delegate(std::move(result__obj));
11870 };
11871 Discord_Client_SendActivityInvite(
11872 &instance_, userId, content__str, cb__native, Tcb__UserData::Free, cb__userData);
11873}
11874void Client::SendActivityJoinRequest(uint64_t userId,
11876{
11877 assert(state_ == DiscordObjectState::Owned);
11878 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11879 auto cb__userData = new Tcb__UserData(cb);
11880 Discord_Client_SendActivityInviteCallback cb__native = [](auto result, void* userData__) {
11881 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
11882 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11883 userData__typed->delegate(std::move(result__obj));
11884 };
11885 Discord_Client_SendActivityJoinRequest(
11886 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
11887}
11888void Client::SendActivityJoinRequestReply(discordpp::ActivityInvite invite,
11890{
11891 assert(state_ == DiscordObjectState::Owned);
11892 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11893 auto cb__userData = new Tcb__UserData(cb);
11894 Discord_Client_SendActivityInviteCallback cb__native = [](auto result, void* userData__) {
11895 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
11896 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11897 userData__typed->delegate(std::move(result__obj));
11898 };
11899 Discord_Client_SendActivityJoinRequestReply(
11900 &instance_, invite.instance(), cb__native, Tcb__UserData::Free, cb__userData);
11901}
11902void Client::SetActivityInviteCreatedCallback(discordpp::Client::ActivityInviteCallback cb)
11903{
11904 assert(state_ == DiscordObjectState::Owned);
11905 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11906 auto cb__userData = new Tcb__UserData(cb);
11907 Discord_Client_ActivityInviteCallback cb__native = [](auto invite, void* userData__) {
11908 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
11909 discordpp::ActivityInvite invite__obj(*invite, DiscordObjectState::Owned);
11910 userData__typed->delegate(std::move(invite__obj));
11911 };
11912 Discord_Client_SetActivityInviteCreatedCallback(
11913 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11914}
11915void Client::SetActivityInviteUpdatedCallback(discordpp::Client::ActivityInviteCallback cb)
11916{
11917 assert(state_ == DiscordObjectState::Owned);
11918 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11919 auto cb__userData = new Tcb__UserData(cb);
11920 Discord_Client_ActivityInviteCallback cb__native = [](auto invite, void* userData__) {
11921 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
11922 discordpp::ActivityInvite invite__obj(*invite, DiscordObjectState::Owned);
11923 userData__typed->delegate(std::move(invite__obj));
11924 };
11925 Discord_Client_SetActivityInviteUpdatedCallback(
11926 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11927}
11928void Client::SetActivityJoinCallback(discordpp::Client::ActivityJoinCallback cb)
11929{
11930 assert(state_ == DiscordObjectState::Owned);
11931 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11932 auto cb__userData = new Tcb__UserData(cb);
11933 Discord_Client_ActivityJoinCallback cb__native = [](auto joinSecret, void* userData__) {
11934 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
11935 std::string joinSecret__str(reinterpret_cast<char*>(joinSecret.ptr), joinSecret.size);
11936 userData__typed->delegate(std::move(joinSecret__str));
11937 Discord_Free(joinSecret.ptr);
11938 };
11939 Discord_Client_SetActivityJoinCallback(
11940 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11941}
11942void Client::SetActivityJoinWithApplicationCallback(
11944{
11945 assert(state_ == DiscordObjectState::Owned);
11946 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11947 auto cb__userData = new Tcb__UserData(cb);
11948 Discord_Client_ActivityJoinWithApplicationCallback cb__native =
11949 [](auto applicationId, auto joinSecret, void* userData__) {
11950 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
11951 std::string joinSecret__str(reinterpret_cast<char*>(joinSecret.ptr), joinSecret.size);
11952 userData__typed->delegate(applicationId, std::move(joinSecret__str));
11953 Discord_Free(joinSecret.ptr);
11954 };
11955 Discord_Client_SetActivityJoinWithApplicationCallback(
11956 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11957}
11958void Client::SetOnlineStatus(discordpp::StatusType status,
11960{
11961 assert(state_ == DiscordObjectState::Owned);
11962 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
11963 auto callback__userData = new Tcallback__UserData(callback);
11964 Discord_Client_UpdateStatusCallback callback__native = [](auto result, void* userData__) {
11965 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
11966 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11967 userData__typed->delegate(std::move(result__obj));
11968 };
11969 Discord_Client_SetOnlineStatus(&instance_,
11970 static_cast<Discord_StatusType>(status),
11971 callback__native,
11972 Tcallback__UserData::Free,
11973 callback__userData);
11974}
11975void Client::UpdateRichPresence(discordpp::Activity activity,
11977{
11978 assert(state_ == DiscordObjectState::Owned);
11979 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11980 auto cb__userData = new Tcb__UserData(cb);
11981 Discord_Client_UpdateRichPresenceCallback cb__native = [](auto result, void* userData__) {
11982 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
11983 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11984 userData__typed->delegate(std::move(result__obj));
11985 };
11986 Discord_Client_UpdateRichPresence(
11987 &instance_, activity.instance(), cb__native, Tcb__UserData::Free, cb__userData);
11988}
11989void Client::AcceptDiscordFriendRequest(uint64_t userId,
11991{
11992 assert(state_ == DiscordObjectState::Owned);
11993 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11994 auto cb__userData = new Tcb__UserData(cb);
11995 Discord_Client_UpdateRelationshipCallback cb__native = [](auto result, void* userData__) {
11996 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
11997 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11998 userData__typed->delegate(std::move(result__obj));
11999 };
12000 Discord_Client_AcceptDiscordFriendRequest(
12001 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
12002}
12003void Client::AcceptGameFriendRequest(uint64_t userId,
12005{
12006 assert(state_ == DiscordObjectState::Owned);
12007 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
12008 auto cb__userData = new Tcb__UserData(cb);
12009 Discord_Client_UpdateRelationshipCallback cb__native = [](auto result, void* userData__) {
12010 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
12011 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
12012 userData__typed->delegate(std::move(result__obj));
12013 };
12014 Discord_Client_AcceptGameFriendRequest(
12015 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
12016}
12017void Client::BlockUser(uint64_t userId, discordpp::Client::UpdateRelationshipCallback cb)
12018{
12019 assert(state_ == DiscordObjectState::Owned);
12020 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
12021 auto cb__userData = new Tcb__UserData(cb);
12022 Discord_Client_UpdateRelationshipCallback cb__native = [](auto result, void* userData__) {
12023 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
12024 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
12025 userData__typed->delegate(std::move(result__obj));
12026 };
12027 Discord_Client_BlockUser(&instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
12028}
12029void Client::CancelDiscordFriendRequest(uint64_t userId,
12031{
12032 assert(state_ == DiscordObjectState::Owned);
12033 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
12034 auto cb__userData = new Tcb__UserData(cb);
12035 Discord_Client_UpdateRelationshipCallback cb__native = [](auto result, void* userData__) {
12036 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
12037 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
12038 userData__typed->delegate(std::move(result__obj));
12039 };
12040 Discord_Client_CancelDiscordFriendRequest(
12041 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
12042}
12043void Client::CancelGameFriendRequest(uint64_t userId,
12045{
12046 assert(state_ == DiscordObjectState::Owned);
12047 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
12048 auto cb__userData = new Tcb__UserData(cb);
12049 Discord_Client_UpdateRelationshipCallback cb__native = [](auto result, void* userData__) {
12050 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
12051 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
12052 userData__typed->delegate(std::move(result__obj));
12053 };
12054 Discord_Client_CancelGameFriendRequest(
12055 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
12056}
12057discordpp::RelationshipHandle Client::GetRelationshipHandle(uint64_t userId) const
12058{
12059 assert(state_ == DiscordObjectState::Owned);
12060 Discord_RelationshipHandle returnValueNative__{};
12061 Discord_Client_GetRelationshipHandle(&instance_, userId, &returnValueNative__);
12062 discordpp::RelationshipHandle returnValue__(returnValueNative__, DiscordObjectState::Owned);
12063 return returnValue__;
12064}
12065std::vector<discordpp::RelationshipHandle> Client::GetRelationships() const
12066{
12067 assert(state_ == DiscordObjectState::Owned);
12068 Discord_RelationshipHandleSpan returnValueNative__;
12069 Discord_Client_GetRelationships(&instance_, &returnValueNative__);
12070 std::vector<discordpp::RelationshipHandle> returnValue__;
12071 returnValue__.reserve(returnValueNative__.size);
12072 for (size_t i__ = 0; i__ < returnValueNative__.size; ++i__) {
12073 returnValue__.emplace_back(returnValueNative__.ptr[i__], DiscordObjectState::Owned);
12074 }
12075 Discord_Free(returnValueNative__.ptr);
12076 return returnValue__;
12077}
12078std::vector<discordpp::RelationshipHandle> Client::GetRelationshipsByGroup(
12079 discordpp::RelationshipGroupType groupType) const
12080{
12081 assert(state_ == DiscordObjectState::Owned);
12082 Discord_RelationshipHandleSpan returnValueNative__;
12083 Discord_Client_GetRelationshipsByGroup(
12084 &instance_, static_cast<Discord_RelationshipGroupType>(groupType), &returnValueNative__);
12085 std::vector<discordpp::RelationshipHandle> returnValue__;
12086 returnValue__.reserve(returnValueNative__.size);
12087 for (size_t i__ = 0; i__ < returnValueNative__.size; ++i__) {
12088 returnValue__.emplace_back(returnValueNative__.ptr[i__], DiscordObjectState::Owned);
12089 }
12090 Discord_Free(returnValueNative__.ptr);
12091 return returnValue__;
12092}
12093void Client::RejectDiscordFriendRequest(uint64_t userId,
12095{
12096 assert(state_ == DiscordObjectState::Owned);
12097 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
12098 auto cb__userData = new Tcb__UserData(cb);
12099 Discord_Client_UpdateRelationshipCallback cb__native = [](auto result, void* userData__) {
12100 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
12101 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
12102 userData__typed->delegate(std::move(result__obj));
12103 };
12104 Discord_Client_RejectDiscordFriendRequest(
12105 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
12106}
12107void Client::RejectGameFriendRequest(uint64_t userId,
12109{
12110 assert(state_ == DiscordObjectState::Owned);
12111 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
12112 auto cb__userData = new Tcb__UserData(cb);
12113 Discord_Client_UpdateRelationshipCallback cb__native = [](auto result, void* userData__) {
12114 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
12115 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
12116 userData__typed->delegate(std::move(result__obj));
12117 };
12118 Discord_Client_RejectGameFriendRequest(
12119 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
12120}
12121void Client::RemoveDiscordAndGameFriend(uint64_t userId,
12123{
12124 assert(state_ == DiscordObjectState::Owned);
12125 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
12126 auto cb__userData = new Tcb__UserData(cb);
12127 Discord_Client_UpdateRelationshipCallback cb__native = [](auto result, void* userData__) {
12128 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
12129 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
12130 userData__typed->delegate(std::move(result__obj));
12131 };
12132 Discord_Client_RemoveDiscordAndGameFriend(
12133 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
12134}
12135void Client::RemoveGameFriend(uint64_t userId, discordpp::Client::UpdateRelationshipCallback cb)
12136{
12137 assert(state_ == DiscordObjectState::Owned);
12138 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
12139 auto cb__userData = new Tcb__UserData(cb);
12140 Discord_Client_UpdateRelationshipCallback cb__native = [](auto result, void* userData__) {
12141 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
12142 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
12143 userData__typed->delegate(std::move(result__obj));
12144 };
12145 Discord_Client_RemoveGameFriend(
12146 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
12147}
12148std::vector<discordpp::UserHandle> Client::SearchFriendsByUsername(std::string searchStr) const
12149{
12150 assert(state_ == DiscordObjectState::Owned);
12151 Discord_UserHandleSpan returnValueNative__;
12152 Discord_String searchStr__str{(uint8_t*)(searchStr.data()), searchStr.size()};
12153 Discord_Client_SearchFriendsByUsername(&instance_, searchStr__str, &returnValueNative__);
12154 std::vector<discordpp::UserHandle> returnValue__;
12155 returnValue__.reserve(returnValueNative__.size);
12156 for (size_t i__ = 0; i__ < returnValueNative__.size; ++i__) {
12157 returnValue__.emplace_back(returnValueNative__.ptr[i__], DiscordObjectState::Owned);
12158 }
12159 Discord_Free(returnValueNative__.ptr);
12160 return returnValue__;
12161}
12162void Client::SendDiscordFriendRequest(std::string const& username,
12164{
12165 assert(state_ == DiscordObjectState::Owned);
12166 Discord_String username__str{(uint8_t*)(username.data()), username.size()};
12167 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
12168 auto cb__userData = new Tcb__UserData(cb);
12169 Discord_Client_SendFriendRequestCallback cb__native = [](auto result, void* userData__) {
12170 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
12171 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
12172 userData__typed->delegate(std::move(result__obj));
12173 };
12174 Discord_Client_SendDiscordFriendRequest(
12175 &instance_, username__str, cb__native, Tcb__UserData::Free, cb__userData);
12176}
12177void Client::SendDiscordFriendRequestById(uint64_t userId,
12179{
12180 assert(state_ == DiscordObjectState::Owned);
12181 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
12182 auto cb__userData = new Tcb__UserData(cb);
12183 Discord_Client_UpdateRelationshipCallback cb__native = [](auto result, void* userData__) {
12184 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
12185 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
12186 userData__typed->delegate(std::move(result__obj));
12187 };
12188 Discord_Client_SendDiscordFriendRequestById(
12189 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
12190}
12191void Client::SendGameFriendRequest(std::string const& username,
12193{
12194 assert(state_ == DiscordObjectState::Owned);
12195 Discord_String username__str{(uint8_t*)(username.data()), username.size()};
12196 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
12197 auto cb__userData = new Tcb__UserData(cb);
12198 Discord_Client_SendFriendRequestCallback cb__native = [](auto result, void* userData__) {
12199 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
12200 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
12201 userData__typed->delegate(std::move(result__obj));
12202 };
12203 Discord_Client_SendGameFriendRequest(
12204 &instance_, username__str, cb__native, Tcb__UserData::Free, cb__userData);
12205}
12206void Client::SendGameFriendRequestById(uint64_t userId,
12208{
12209 assert(state_ == DiscordObjectState::Owned);
12210 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
12211 auto cb__userData = new Tcb__UserData(cb);
12212 Discord_Client_UpdateRelationshipCallback cb__native = [](auto result, void* userData__) {
12213 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
12214 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
12215 userData__typed->delegate(std::move(result__obj));
12216 };
12217 Discord_Client_SendGameFriendRequestById(
12218 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
12219}
12220void Client::SetRelationshipCreatedCallback(discordpp::Client::RelationshipCreatedCallback cb)
12221{
12222 assert(state_ == DiscordObjectState::Owned);
12223 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
12224 auto cb__userData = new Tcb__UserData(cb);
12225 Discord_Client_RelationshipCreatedCallback cb__native =
12226 [](auto userId, auto isDiscordRelationshipUpdate, void* userData__) {
12227 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
12228 userData__typed->delegate(userId, isDiscordRelationshipUpdate);
12229 };
12230 Discord_Client_SetRelationshipCreatedCallback(
12231 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
12232}
12233void Client::SetRelationshipDeletedCallback(discordpp::Client::RelationshipDeletedCallback cb)
12234{
12235 assert(state_ == DiscordObjectState::Owned);
12236 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
12237 auto cb__userData = new Tcb__UserData(cb);
12238 Discord_Client_RelationshipDeletedCallback cb__native =
12239 [](auto userId, auto isDiscordRelationshipUpdate, void* userData__) {
12240 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
12241 userData__typed->delegate(userId, isDiscordRelationshipUpdate);
12242 };
12243 Discord_Client_SetRelationshipDeletedCallback(
12244 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
12245}
12246void Client::UnblockUser(uint64_t userId, discordpp::Client::UpdateRelationshipCallback cb)
12247{
12248 assert(state_ == DiscordObjectState::Owned);
12249 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
12250 auto cb__userData = new Tcb__UserData(cb);
12251 Discord_Client_UpdateRelationshipCallback cb__native = [](auto result, void* userData__) {
12252 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
12253 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
12254 userData__typed->delegate(std::move(result__obj));
12255 };
12256 Discord_Client_UnblockUser(&instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
12257}
12258std::optional<discordpp::UserHandle> Client::GetCurrentUserV2() const
12259{
12260 assert(state_ == DiscordObjectState::Owned);
12261 bool returnIsNonNull__;
12262 Discord_UserHandle returnValueNative__;
12263 returnIsNonNull__ = Discord_Client_GetCurrentUserV2(&instance_, &returnValueNative__);
12264 if (!returnIsNonNull__) {
12265 return {};
12266 }
12267 discordpp::UserHandle returnValue__(returnValueNative__, DiscordObjectState::Owned);
12268 return returnValue__;
12269}
12270void Client::GetDiscordClientConnectedUser(
12271 uint64_t applicationId,
12273{
12274 assert(state_ == DiscordObjectState::Owned);
12275 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
12276 auto callback__userData = new Tcallback__UserData(callback);
12277 Discord_Client_GetDiscordClientConnectedUserCallback callback__native =
12278 [](auto result, auto user, void* userData__) {
12279 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
12280 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
12281 std::optional<discordpp::UserHandle> user__opt{};
12282 if (user) {
12283 user__opt = discordpp::UserHandle(*user, DiscordObjectState::Owned);
12284 }
12285 userData__typed->delegate(std::move(result__obj), std::move(user__opt));
12286 };
12287 Discord_Client_GetDiscordClientConnectedUser(
12288 &instance_, applicationId, callback__native, Tcallback__UserData::Free, callback__userData);
12289}
12290std::optional<discordpp::UserHandle> Client::GetUser(uint64_t userId) const
12291{
12292 assert(state_ == DiscordObjectState::Owned);
12293 bool returnIsNonNull__;
12294 Discord_UserHandle returnValueNative__;
12295 returnIsNonNull__ = Discord_Client_GetUser(&instance_, userId, &returnValueNative__);
12296 if (!returnIsNonNull__) {
12297 return {};
12298 }
12299 discordpp::UserHandle returnValue__(returnValueNative__, DiscordObjectState::Owned);
12300 return returnValue__;
12301}
12302void Client::SetRelationshipGroupsUpdatedCallback(
12304{
12305 assert(state_ == DiscordObjectState::Owned);
12306 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
12307 auto cb__userData = new Tcb__UserData(cb);
12308 Discord_Client_RelationshipGroupsUpdatedCallback cb__native = [](auto userId,
12309 void* userData__) {
12310 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
12311 userData__typed->delegate(userId);
12312 };
12313 Discord_Client_SetRelationshipGroupsUpdatedCallback(
12314 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
12315}
12316void Client::SetUserUpdatedCallback(discordpp::Client::UserUpdatedCallback cb)
12317{
12318 assert(state_ == DiscordObjectState::Owned);
12319 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
12320 auto cb__userData = new Tcb__UserData(cb);
12321 Discord_Client_UserUpdatedCallback cb__native = [](auto userId, void* userData__) {
12322 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
12323 userData__typed->delegate(userId);
12324 };
12325 Discord_Client_SetUserUpdatedCallback(
12326 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
12327}
12328const CallInfoHandle CallInfoHandle::nullobj{{}, DiscordObjectState::Invalid};
12329CallInfoHandle::~CallInfoHandle()
12330{
12331 if (state_ == DiscordObjectState::Owned) {
12332 Drop();
12333 state_ = DiscordObjectState::Invalid;
12334 }
12335}
12336CallInfoHandle::CallInfoHandle(CallInfoHandle&& other) noexcept
12337 : instance_(other.instance_)
12338 , state_(other.state_)
12339{
12340 other.state_ = DiscordObjectState::Invalid;
12341}
12342CallInfoHandle& CallInfoHandle::operator=(CallInfoHandle&& other) noexcept
12343{
12344 if (this != &other) {
12345 if (state_ == DiscordObjectState::Owned) {
12346 Drop();
12347 }
12348 instance_ = other.instance_;
12349 state_ = other.state_;
12350 other.state_ = DiscordObjectState::Invalid;
12351 }
12352 return *this;
12353}
12354CallInfoHandle::CallInfoHandle(const CallInfoHandle& other)
12355 : instance_{}
12356 , state_(DiscordObjectState::Invalid)
12357{
12358 if (other.state_ == DiscordObjectState::Owned) {
12359 Discord_CallInfoHandle_Clone(&instance_, other.instance());
12360
12361 state_ = DiscordObjectState::Owned;
12362 }
12363}
12364CallInfoHandle& CallInfoHandle::operator=(const CallInfoHandle& other)
12365{
12366 if (this != &other) {
12367 if (state_ == DiscordObjectState::Owned) {
12368 Drop();
12369 state_ = DiscordObjectState::Invalid;
12370 }
12371 if (other.state_ == DiscordObjectState::Owned) {
12372 Discord_CallInfoHandle_Clone(&instance_, other.instance());
12373
12374 state_ = DiscordObjectState::Owned;
12375 }
12376 }
12377 return *this;
12378}
12379CallInfoHandle::CallInfoHandle(Discord_CallInfoHandle instance, DiscordObjectState state)
12380 : instance_(instance)
12381 , state_(state)
12382{
12383}
12384void CallInfoHandle::Drop()
12385{
12386 if (state_ != DiscordObjectState::Owned) {
12387 return;
12388 }
12389 Discord_CallInfoHandle_Drop(&instance_);
12390 state_ = DiscordObjectState::Invalid;
12391}
12392uint64_t CallInfoHandle::ChannelId() const
12393{
12394 assert(state_ == DiscordObjectState::Owned);
12395 uint64_t returnValue__;
12396 returnValue__ = Discord_CallInfoHandle_ChannelId(&instance_);
12397 return returnValue__;
12398}
12399std::vector<uint64_t> CallInfoHandle::GetParticipants() const
12400{
12401 assert(state_ == DiscordObjectState::Owned);
12402 Discord_UInt64Span returnValueNative__;
12403 Discord_CallInfoHandle_GetParticipants(&instance_, &returnValueNative__);
12404 std::vector<uint64_t> returnValue__(returnValueNative__.ptr,
12405 returnValueNative__.ptr + returnValueNative__.size);
12406 Discord_Free(returnValueNative__.ptr);
12407 return returnValue__;
12408}
12409std::optional<discordpp::VoiceStateHandle> CallInfoHandle::GetVoiceStateHandle(
12410 uint64_t userId) const
12411{
12412 assert(state_ == DiscordObjectState::Owned);
12413 bool returnIsNonNull__;
12414 Discord_VoiceStateHandle returnValueNative__;
12415 returnIsNonNull__ =
12416 Discord_CallInfoHandle_GetVoiceStateHandle(&instance_, userId, &returnValueNative__);
12417 if (!returnIsNonNull__) {
12418 return {};
12419 }
12420 discordpp::VoiceStateHandle returnValue__(returnValueNative__, DiscordObjectState::Owned);
12421 return returnValue__;
12422}
12423uint64_t CallInfoHandle::GuildId() const
12424{
12425 assert(state_ == DiscordObjectState::Owned);
12426 uint64_t returnValue__;
12427 returnValue__ = Discord_CallInfoHandle_GuildId(&instance_);
12428 return returnValue__;
12429}
12430} // namespace discordpp
12431
12432#endif // DISCORDPP_IMPLEMENTATION
Struct which controls what your rich presence looks like in the Discord client. If you don't specify ...
Definition discordpp.h:816
std::optional< std::string > InviteCoverImage() const
The invite cover image identifier or URL, rendered as a banner image on activity invites.
void SetLargeImage(std::optional< std::string > LargeImage)
Setter for ActivityAssets::LargeImage.
std::optional< std::string > SmallText() const
A tooltip string that is shown when the user hovers over the small image.
void SetLargeText(std::optional< std::string > LargeText)
Setter for ActivityAssets::LargeText.
ActivityAssets(ActivityAssets &&other) noexcept
Move constructor for ActivityAssets.
std::optional< std::string > SmallImage() const
The secondary image, rendered as a small circle over the largeImage.
ActivityAssets(const ActivityAssets &arg0)
Copy constructor for ActivityAssets.
void SetLargeUrl(std::optional< std::string > LargeUrl)
Setter for ActivityAssets::LargeUrl.
std::optional< std::string > LargeText() const
A tooltip string that is shown when the user hovers over the large image.
void SetSmallImage(std::optional< std::string > SmallImage)
Setter for ActivityAssets::SmallImage.
std::optional< std::string > SmallUrl() const
A URL that opens when the user clicks/taps the small image.
ActivityAssets & operator=(const ActivityAssets &arg0)
Copy assignment operator for ActivityAssets.
static const ActivityAssets nullobj
Uninitialized instance of ActivityAssets.
Definition discordpp.h:835
std::optional< std::string > LargeImage() const
The primary image identifier or URL, rendered as a large square icon on a user's rich presence.
std::optional< std::string > LargeUrl() const
A URL that opens when the user clicks/taps the large image.
void SetSmallText(std::optional< std::string > SmallText)
Setter for ActivityAssets::SmallText.
void SetInviteCoverImage(std::optional< std::string > InviteCoverImage)
Setter for ActivityAssets::InviteCoverImage.
ActivityAssets & operator=(ActivityAssets &&other) noexcept
Move assignment operator for ActivityAssets.
void SetSmallUrl(std::optional< std::string > SmallUrl)
Setter for ActivityAssets::SmallUrl.
Definition discordpp.h:1063
ActivityButton(ActivityButton &&other) noexcept
Move constructor for ActivityButton.
static const ActivityButton nullobj
Uninitialized instance of ActivityButton.
Definition discordpp.h:1082
std::string Url() const
The url of the button.
ActivityButton & operator=(ActivityButton &&other) noexcept
Move assignment operator for ActivityButton.
void SetLabel(std::string Label)
Setter for ActivityButton::Label.
void SetUrl(std::string Url)
Setter for ActivityButton::Url.
ActivityButton & operator=(const ActivityButton &arg0)
Copy assignment operator for ActivityButton.
ActivityButton(const ActivityButton &arg0)
Copy constructor for ActivityButton.
std::string Label() const
The label of the button.
When one user invites another to join their game on Discord, it will send a message to that user....
Definition discordpp.h:718
static const ActivityInvite nullobj
Uninitialized instance of ActivityInvite.
Definition discordpp.h:737
std::string SessionId() const
The session id of the user who sent the invite.
void SetIsValid(bool IsValid)
Setter for ActivityInvite::IsValid.
void SetSessionId(std::string SessionId)
Setter for ActivityInvite::SessionId.
uint64_t ApplicationId() const
The target application of the invite.
uint64_t MessageId() const
The id of the Discord message that contains the invite.
uint64_t SenderId() const
The user id of the user who sent the invite.
void SetApplicationId(uint64_t ApplicationId)
Setter for ActivityInvite::ApplicationId.
void SetSenderId(uint64_t SenderId)
Setter for ActivityInvite::SenderId.
void SetParentApplicationId(uint64_t ParentApplicationId)
Setter for ActivityInvite::ParentApplicationId.
bool IsValid() const
Whether or not this invite is currently joinable. An invite becomes invalid if it was sent more than ...
void SetChannelId(uint64_t ChannelId)
Setter for ActivityInvite::ChannelId.
uint64_t ChannelId() const
The id of the Discord channel in which the invite was sent.
void SetMessageId(uint64_t MessageId)
Setter for ActivityInvite::MessageId.
std::string PartyId() const
The id of the party the invite was sent for.
ActivityInvite & operator=(ActivityInvite &&other) noexcept
Move assignment operator for ActivityInvite.
ActivityInvite(const ActivityInvite &rhs)
Copy constructor for ActivityInvite.
void SetType(discordpp::ActivityActionTypes Type)
Setter for ActivityInvite::Type.
uint64_t ParentApplicationId() const
The application id of the parent - this is only applicable if there is a parent for a publisher's sui...
void SetPartyId(std::string PartyId)
Setter for ActivityInvite::PartyId.
ActivityInvite & operator=(const ActivityInvite &rhs)
Copy assignment operator for ActivityInvite.
discordpp::ActivityActionTypes Type() const
The type of invite that was sent.
ActivityInvite(ActivityInvite &&other) noexcept
Move constructor for ActivityInvite.
Definition discordpp.h:957
void SetMaxSize(int32_t MaxSize)
Setter for ActivityParty::MaxSize.
ActivityParty(ActivityParty &&other) noexcept
Move constructor for ActivityParty.
void SetCurrentSize(int32_t CurrentSize)
Setter for ActivityParty::CurrentSize.
void SetId(std::string Id)
Setter for ActivityParty::Id.
int32_t CurrentSize() const
The number of people currently in the party, must be at least 1.
int32_t MaxSize() const
The maximum number of people that can be in the party, must be at least 0. When 0,...
ActivityParty(const ActivityParty &arg0)
Copy constructor for ActivityParty.
ActivityParty & operator=(ActivityParty &&other) noexcept
Move assignment operator for ActivityParty.
void SetPrivacy(discordpp::ActivityPartyPrivacy Privacy)
Setter for ActivityParty::Privacy.
discordpp::ActivityPartyPrivacy Privacy() const
The privacy of the party.
std::string Id() const
Specifies the id of the party. "Party" is used colloquially to refer to a group of players in a share...
static const ActivityParty nullobj
Uninitialized instance of ActivityParty.
Definition discordpp.h:976
ActivityParty & operator=(const ActivityParty &arg0)
Copy assignment operator for ActivityParty.
Definition discordpp.h:1019
ActivitySecrets & operator=(ActivitySecrets &&other) noexcept
Move assignment operator for ActivitySecrets.
std::string Join() const
A secret string that is shared with users who are accepted into the party so the game knows how to jo...
ActivitySecrets & operator=(const ActivitySecrets &arg0)
Copy assignment operator for ActivitySecrets.
ActivitySecrets(ActivitySecrets &&other) noexcept
Move constructor for ActivitySecrets.
ActivitySecrets(const ActivitySecrets &arg0)
Copy constructor for ActivitySecrets.
void SetJoin(std::string Join)
Setter for ActivitySecrets::Join.
static const ActivitySecrets nullobj
Uninitialized instance of ActivitySecrets.
Definition discordpp.h:1038
Definition discordpp.h:903
ActivityTimestamps(ActivityTimestamps &&other) noexcept
Move constructor for ActivityTimestamps.
ActivityTimestamps(const ActivityTimestamps &arg0)
Copy constructor for ActivityTimestamps.
uint64_t Start() const
The time the activity started, in milliseconds since Unix epoch.
void SetStart(uint64_t Start)
Setter for ActivityTimestamps::Start.
static const ActivityTimestamps nullobj
Uninitialized instance of ActivityTimestamps.
Definition discordpp.h:922
ActivityTimestamps & operator=(ActivityTimestamps &&other) noexcept
Move assignment operator for ActivityTimestamps.
void SetEnd(uint64_t End)
Setter for ActivityTimestamps::End.
uint64_t End() const
The time the activity will end at, in milliseconds since Unix epoch.
ActivityTimestamps & operator=(const ActivityTimestamps &arg0)
Copy assignment operator for ActivityTimestamps.
An Activity represents one "thing" a user is doing on Discord and is part of their rich presence.
Definition discordpp.h:1288
std::vector< discordpp::ActivityButton > GetButtons() const
Returns the custom buttons for the rich presence.
void SetDetailsUrl(std::optional< std::string > DetailsUrl)
Setter for Activity::DetailsUrl.
std::optional< uint64_t > ParentApplicationId() const
The application ID of the parent application that the activity is associated with if it exists....
static const Activity nullobj
Uninitialized instance of Activity.
Definition discordpp.h:1307
std::optional< uint64_t > ApplicationId() const
The application ID of the game that the activity is associated with.
std::string Name() const
The name of the game or application that the activity is associated with.
void SetStateUrl(std::optional< std::string > StateUrl)
Setter for Activity::StateUrl.
void SetDetails(std::optional< std::string > Details)
Setter for Activity::Details.
Activity & operator=(Activity &&other) noexcept
Move assignment operator for Activity.
void SetParentApplicationId(std::optional< uint64_t > ParentApplicationId)
Setter for Activity::ParentApplicationId.
void SetType(discordpp::ActivityTypes Type)
Setter for Activity::Type.
std::optional< discordpp::ActivityAssets > Assets() const
Images used to customize how the Activity is displayed in the Discord client.
void SetTimestamps(std::optional< discordpp::ActivityTimestamps > Timestamps)
Setter for Activity::Timestamps.
bool Equals(discordpp::Activity other) const
Compares each field of the Activity struct for equality.
void SetApplicationId(std::optional< uint64_t > ApplicationId)
Setter for Activity::ApplicationId.
void SetName(std::string Name)
Setter for Activity::Name.
void SetSecrets(std::optional< discordpp::ActivitySecrets > Secrets)
Setter for Activity::Secrets.
Activity(const Activity &arg0)
Copy constructor for Activity.
void SetAssets(std::optional< discordpp::ActivityAssets > Assets)
Setter for Activity::Assets.
std::optional< discordpp::StatusDisplayTypes > StatusDisplayType() const
Controls which field is used for the user's status message.
std::optional< discordpp::ActivityTimestamps > Timestamps() const
The timestamps struct can be used to render either:
void SetParty(std::optional< discordpp::ActivityParty > Party)
Setter for Activity::Party.
void SetStatusDisplayType(std::optional< discordpp::StatusDisplayTypes > StatusDisplayType)
Setter for Activity::StatusDisplayType.
Activity & operator=(const Activity &arg0)
Copy assignment operator for Activity.
std::optional< discordpp::ActivityParty > Party() const
The party struct is used to indicate the size and members of the people the current user is playing w...
void AddButton(discordpp::ActivityButton button)
Adds a custom button to the rich presence.
std::optional< std::string > DetailsUrl() const
A URL that opens when the user clicks/taps the details text.
void SetSupportedPlatforms(discordpp::ActivityGamePlatforms SupportedPlatforms)
Setter for Activity::SupportedPlatforms.
std::optional< std::string > Details() const
The state of the what the user is doing for this activity.
void SetState(std::optional< std::string > State)
Setter for Activity::State.
Activity(Activity &&other) noexcept
Move constructor for Activity.
discordpp::ActivityGamePlatforms SupportedPlatforms() const
If an activity is joinable, but only on certain platforms, this field can be used to indicate which p...
std::optional< std::string > StateUrl() const
A URL that opens when the user clicks/taps the state text.
std::optional< discordpp::ActivitySecrets > Secrets() const
The secrets struct is used in combination with the party struct to make an Activity joinable.
std::optional< std::string > State() const
The state of the party for this activity.
discordpp::ActivityTypes Type() const
The type of activity this is.
Contains information about non-text content in a message that likely cannot be rendered in game such ...
Definition discordpp.h:2893
static std::string TypeToString(discordpp::AdditionalContentType type)
Converts the AdditionalContentType enum to a string.
AdditionalContent & operator=(AdditionalContent &&other) noexcept
Move assignment operator for AdditionalContent.
void SetCount(uint8_t Count)
Setter for AdditionalContent::Count.
void SetType(discordpp::AdditionalContentType Type)
Setter for AdditionalContent::Type.
std::optional< std::string > Title() const
When the additional content is a poll or thread, this field will contain the name of the poll or thre...
discordpp::AdditionalContentType Type() const
Represents the type of additional content in the message.
uint8_t Count() const
Represents the number of pieces of additional content so you could for example renders "2 additional ...
bool Equals(discordpp::AdditionalContent rhs) const
Compares each field of the AdditionalContent struct for equality.
AdditionalContent(AdditionalContent &&other) noexcept
Move constructor for AdditionalContent.
AdditionalContent & operator=(const AdditionalContent &arg0)
Copy assignment operator for AdditionalContent.
AdditionalContent(const AdditionalContent &arg0)
Copy constructor for AdditionalContent.
void SetTitle(std::optional< std::string > Title)
Setter for AdditionalContent::Title.
static const AdditionalContent nullobj
Uninitialized instance of AdditionalContent.
Definition discordpp.h:2912
Represents a single input or output audio device available to the user.
Definition discordpp.h:3118
AudioDevice & operator=(const AudioDevice &arg0)
Copy assignment operator for AudioDevice.
bool Equals(discordpp::AudioDevice rhs)
Compares the ID of two AudioDevice objects for equality.
std::string Name() const
The display name of the audio device.
bool IsDefault() const
Whether the audio device is the system default device.
std::string Id() const
The ID of the audio device.
AudioDevice(AudioDevice &&other) noexcept
Move constructor for AudioDevice.
AudioDevice & operator=(AudioDevice &&other) noexcept
Move assignment operator for AudioDevice.
static const AudioDevice nullobj
Uninitialized instance of AudioDevice.
Definition discordpp.h:3137
void SetId(std::string Id)
Setter for AudioDevice::Id.
void SetIsDefault(bool IsDefault)
Setter for AudioDevice::IsDefault.
void SetName(std::string Name)
Setter for AudioDevice::Name.
AudioDevice(const AudioDevice &arg0)
Copy constructor for AudioDevice.
Arguments to the Client::Authorize function.
Definition discordpp.h:1629
void SetIntegrationType(std::optional< discordpp::IntegrationType > IntegrationType)
Setter for AuthorizationArgs::IntegrationType.
std::optional< std::string > State() const
See https://discord.com/developers/docs/topics/oauth2#state-and-security for details on this field.
AuthorizationArgs & operator=(AuthorizationArgs &&other) noexcept
Move assignment operator for AuthorizationArgs.
void SetCustomSchemeParam(std::optional< std::string > CustomSchemeParam)
Setter for AuthorizationArgs::CustomSchemeParam.
std::optional< std::string > Nonce() const
The nonce field is generally only useful for backend integrations using ID tokens.
std::optional< discordpp::AuthorizationCodeChallenge > CodeChallenge() const
If using the Client::GetToken flow, you will need to generate a code challenge and verifier.
uint64_t ClientId() const
Optional. The Discord application ID for your game. Defaults to the value set by Client::SetApplicati...
AuthorizationArgs(const AuthorizationArgs &arg0)
Copy constructor for AuthorizationArgs.
void SetScopes(std::string Scopes)
Setter for AuthorizationArgs::Scopes.
static const AuthorizationArgs nullobj
Uninitialized instance of AuthorizationArgs.
Definition discordpp.h:1648
void SetClientId(uint64_t ClientId)
Setter for AuthorizationArgs::ClientId.
std::optional< std::string > CustomSchemeParam() const
Custom URI scheme for mobile redirects.
std::optional< discordpp::IntegrationType > IntegrationType() const
The type of integration the app will be installed as.
void SetCodeChallenge(std::optional< discordpp::AuthorizationCodeChallenge > CodeChallenge)
Setter for AuthorizationArgs::CodeChallenge.
AuthorizationArgs(AuthorizationArgs &&other) noexcept
Move constructor for AuthorizationArgs.
AuthorizationArgs & operator=(const AuthorizationArgs &arg0)
Copy assignment operator for AuthorizationArgs.
std::string Scopes() const
Scopes is a space separated string of the oauth scopes your game is requesting.
void SetNonce(std::optional< std::string > Nonce)
Setter for AuthorizationArgs::Nonce.
void SetState(std::optional< std::string > State)
Setter for AuthorizationArgs::State.
Struct that encapsulates the challenge part of the code verification flow.
Definition discordpp.h:1537
discordpp::AuthenticationCodeChallengeMethod Method() const
The method used to generate the challenge. The only method used by the SDK is sha256.
AuthorizationCodeChallenge(const AuthorizationCodeChallenge &arg0)
Copy constructor for AuthorizationCodeChallenge.
std::string Challenge() const
The challenge value.
AuthorizationCodeChallenge & operator=(AuthorizationCodeChallenge &&other) noexcept
Move assignment operator for AuthorizationCodeChallenge.
void SetMethod(discordpp::AuthenticationCodeChallengeMethod Method)
Setter for AuthorizationCodeChallenge::Method.
static const AuthorizationCodeChallenge nullobj
Uninitialized instance of AuthorizationCodeChallenge.
Definition discordpp.h:1557
AuthorizationCodeChallenge & operator=(const AuthorizationCodeChallenge &arg0)
Copy assignment operator for AuthorizationCodeChallenge.
AuthorizationCodeChallenge(AuthorizationCodeChallenge &&other) noexcept
Move constructor for AuthorizationCodeChallenge.
void SetChallenge(std::string Challenge)
Setter for AuthorizationCodeChallenge::Challenge.
Struct that encapsulates both parts of the code verification flow.
Definition discordpp.h:1584
AuthorizationCodeVerifier(const AuthorizationCodeVerifier &arg0)
Copy constructor for AuthorizationCodeVerifier.
AuthorizationCodeVerifier & operator=(const AuthorizationCodeVerifier &arg0)
Copy assignment operator for AuthorizationCodeVerifier.
void SetVerifier(std::string Verifier)
Setter for AuthorizationCodeVerifier::Verifier.
AuthorizationCodeVerifier(AuthorizationCodeVerifier &&other) noexcept
Move constructor for AuthorizationCodeVerifier.
std::string Verifier() const
The verifier part of the code verification flow.
void SetChallenge(discordpp::AuthorizationCodeChallenge Challenge)
Setter for AuthorizationCodeVerifier::Challenge.
static const AuthorizationCodeVerifier nullobj
Uninitialized instance of AuthorizationCodeVerifier.
Definition discordpp.h:1604
discordpp::AuthorizationCodeChallenge Challenge() const
The challenge part of the code verification flow.
AuthorizationCodeVerifier & operator=(AuthorizationCodeVerifier &&other) noexcept
Move assignment operator for AuthorizationCodeVerifier.
Convenience class that represents the state of a single Discord call in a lobby.
Definition discordpp.h:5179
std::optional< discordpp::VoiceStateHandle > GetVoiceStateHandle(uint64_t userId) const
Accesses the voice state for a single user so you can know if they have muted or deafened themselves.
std::vector< uint64_t > GetParticipants() const
Returns a list of the user IDs of the participants in the call.
CallInfoHandle & operator=(const CallInfoHandle &other)
Copy assignment operator for CallInfoHandle.
CallInfoHandle(const CallInfoHandle &other)
Copy constructor for CallInfoHandle.
CallInfoHandle & operator=(CallInfoHandle &&other) noexcept
Move assignment operator for CallInfoHandle.
uint64_t GuildId() const
Returns the lobby ID of the call.
static const CallInfoHandle nullobj
Uninitialized instance of CallInfoHandle.
Definition discordpp.h:5198
CallInfoHandle(CallInfoHandle &&other) noexcept
Move constructor for CallInfoHandle.
uint64_t ChannelId() const
Returns the lobby ID of the call.
Class that manages an active voice session in a Lobby.
Definition discordpp.h:1889
static std::string ErrorToString(discordpp::Call::Error type)
Converts the Error enum to a string.
Call & operator=(const Call &other)
Copy assignment operator for Call.
void SetSelfDeaf(bool deaf)
Mutes all audio from the currently active call for the current user. They will not be able to hear an...
std::function< void(uint64_t userId, bool isPlayingSound)> OnSpeakingStatusChanged
Callback function for Call::SetSpeakingStatusChangedCallback.
Definition discordpp.h:1950
static const Call nullobj
Uninitialized instance of Call.
Definition discordpp.h:1967
Call(Call &&other) noexcept
Move constructor for Call.
void SetOnVoiceStateChangedCallback(discordpp::Call::OnVoiceStateChanged cb)
Sets a callback function to generally be invoked whenever a field on a VoiceStateHandle object for a ...
Call & operator=(Call &&other) noexcept
Move assignment operator for Call.
discordpp::AudioModeType GetAudioMode()
Returns whether the call is configured to use voice auto detection or push to talk for the current us...
bool GetPTTActive()
Returns whether push to talk is currently active, meaning the user is currently pressing their config...
discordpp::VADThresholdSettings GetVADThreshold() const
Returns the current configuration for void auto detection thresholds. See the description of the VADT...
std::optional< discordpp::VoiceStateHandle > GetVoiceStateHandle(uint64_t userId) const
Returns a reference to the VoiceStateHandle for the user ID of the given call participant.
static std::string StatusToString(discordpp::Call::Status type)
Converts the Status enum to a string.
void SetVADThreshold(bool automatic, float threshold)
Customizes the void auto detection thresholds for picking up activity from a user's mic.
bool GetSelfDeaf()
Returns whether the current user is deafened.
Error
Enum that represents any network errors with the Call.
Definition discordpp.h:1897
@ None
None.
Definition discordpp.h:1900
@ Forbidden
Forbidden.
Definition discordpp.h:1915
@ SignalingConnectionFailed
SignalingConnectionFailed.
Definition discordpp.h:1903
@ SignalingUnexpectedClose
SignalingUnexpectedClose.
Definition discordpp.h:1906
@ JoinTimeout
JoinTimeout.
Definition discordpp.h:1912
@ VoiceConnectionFailed
VoiceConnectionFailed.
Definition discordpp.h:1909
Status
Enum that respresents the state of the Call's network connection.
Definition discordpp.h:1919
@ Disconnecting
Disconnecting.
Definition discordpp.h:1940
@ Connected
Connected.
Definition discordpp.h:1934
@ Reconnecting
Reconnecting.
Definition discordpp.h:1937
@ Connecting
Connecting.
Definition discordpp.h:1928
@ SignalingConnected
SignalingConnected.
Definition discordpp.h:1931
@ Disconnected
Disconnected.
Definition discordpp.h:1922
@ Joining
Joining.
Definition discordpp.h:1925
void SetLocalMute(uint64_t userId, bool mute)
Locally mutes the given userId, so that the current user cannot hear them anymore.
void SetSpeakingStatusChangedCallback(discordpp::Call::OnSpeakingStatusChanged cb)
Sets a callback function to be invoked whenever a user starts or stops speaking and is passed in the ...
std::function< void(discordpp::Call::Status status, discordpp::Call::Error error, int32_t errorDetail)> OnStatusChanged
Callback function for Call::SetStatusChangedCallback.
Definition discordpp.h:1953
uint32_t GetPTTReleaseDelay()
Returns the time that PTT is active after the user releases the PTT key and SetPTTActive(false) is ca...
uint64_t GetGuildId() const
Returns the ID of the lobby with which this call is associated.
Call(const Call &other)
Copy constructor for Call.
void SetPTTActive(bool active)
When push to talk is enabled, this should be called whenever the user pushes or releases their config...
void SetParticipantChangedCallback(discordpp::Call::OnParticipantChanged cb)
Sets a callback function to be invoked whenever some joins or leaves a voice call.
std::vector< uint64_t > GetParticipants() const
Returns a list of all of the user IDs of the participants in the call.
bool GetSelfMute()
Returns whether the current user's microphone is muted.
void SetPTTReleaseDelay(uint32_t releaseDelayMs)
If set, extends the time that PTT is active after the user releases the PTT key and SetPTTActive(fals...
discordpp::Call::Status GetStatus() const
Returns the current call status.
std::function< void(uint64_t userId, bool added)> OnParticipantChanged
Callback function for Call::SetParticipantChangedCallback.
Definition discordpp.h:1947
void SetParticipantVolume(uint64_t userId, float volume)
Locally changes the playout volume of the given userId.
void SetStatusChangedCallback(discordpp::Call::OnStatusChanged cb)
Sets a callback function to be invoked when the call status changes, such as when it fully connects o...
void SetAudioMode(discordpp::AudioModeType audioMode)
Sets whether to use voice auto detection or push to talk for the current user on this call.
bool GetLocalMute(uint64_t userId)
Returns whether the current user has locally muted the given userId for themselves.
float GetParticipantVolume(uint64_t userId)
Returns the locally set playout volume of the given userId.
void SetSelfMute(bool mute)
Mutes the current user's microphone so that no other participant in their active calls can hear them.
std::function< void(uint64_t userId)> OnVoiceStateChanged
Callback function for Call::SetOnVoiceStateChangedCallback.
Definition discordpp.h:1944
uint64_t GetChannelId() const
Returns the ID of the lobby with which this call is associated.
All messages sent on Discord are done so in a Channel. MessageHandle::ChannelId will contain the ID o...
Definition discordpp.h:2116
ChannelHandle(const ChannelHandle &other)
Copy constructor for ChannelHandle.
ChannelHandle & operator=(const ChannelHandle &other)
Copy assignment operator for ChannelHandle.
static const ChannelHandle nullobj
Uninitialized instance of ChannelHandle.
Definition discordpp.h:2135
uint64_t Id() const
Returns the ID of the channel.
ChannelHandle & operator=(ChannelHandle &&other) noexcept
Move assignment operator for ChannelHandle.
ChannelHandle(ChannelHandle &&other) noexcept
Move constructor for ChannelHandle.
std::vector< uint64_t > Recipients() const
For DMs and GroupDMs, returns the user IDs of the members of the channel. For all other channels retu...
std::string Name() const
Returns the name of the channel.
discordpp::ChannelType Type() const
Returns the type of the channel.
Options for creating a new Client instance.
Definition discordpp.h:3212
void SetCpuAffinityMask(std::optional< uint64_t > CpuAffinityMask)
Setter for ClientCreateOptions::CpuAffinityMask.
discordpp::AudioSystem ExperimentalAudioSystem() const
The audio system to use. Defaults to AudioSystem::Standard.
static const ClientCreateOptions nullobj
Uninitialized instance of ClientCreateOptions.
Definition discordpp.h:3231
ClientCreateOptions & operator=(const ClientCreateOptions &arg0)
Copy assignment operator for ClientCreateOptions.
bool ExperimentalAndroidPreventCommsForBluetooth() const
Whether to prevent communications mode on Android when Bluetooth is connected.
std::string WebBase() const
The base URL for the Discord web application.
std::string ApiBase() const
The base URL for the Discord API.
void SetApiBase(std::string ApiBase)
Setter for ClientCreateOptions::ApiBase.
ClientCreateOptions(const ClientCreateOptions &arg0)
Copy constructor for ClientCreateOptions.
void SetExperimentalAudioSystem(discordpp::AudioSystem ExperimentalAudioSystem)
Setter for ClientCreateOptions::ExperimentalAudioSystem.
ClientCreateOptions(ClientCreateOptions &&other) noexcept
Move constructor for ClientCreateOptions.
std::optional< uint64_t > CpuAffinityMask() const
CPU affinity mask hint for certain platforms. Depending on platform support, may or may not be ignore...
void SetWebBase(std::string WebBase)
Setter for ClientCreateOptions::WebBase.
void SetExperimentalAndroidPreventCommsForBluetooth(bool ExperimentalAndroidPreventCommsForBluetooth)
Setter for ClientCreateOptions::ExperimentalAndroidPreventCommsForBluetooth.
ClientCreateOptions & operator=(ClientCreateOptions &&other) noexcept
Move assignment operator for ClientCreateOptions.
Struct that stores information about the result of an SDK function call.
Definition discordpp.h:1444
void SetRetryable(bool Retryable)
Setter for ClientResult::Retryable.
bool Retryable() const
Indicates if, although an API request failed, it is safe and recommended to retry it.
void SetErrorCode(int32_t ErrorCode)
Setter for ClientResult::ErrorCode.
ClientResult & operator=(const ClientResult &arg0)
Copy assignment operator for ClientResult.
void SetStatus(discordpp::HttpStatusCode Status)
Setter for ClientResult::Status.
std::string Error() const
A description of the error that occurred.
discordpp::ErrorType Type() const
The type of error that occurred. See ErrorType for more information.
void SetResponseBody(std::string ResponseBody)
Setter for ClientResult::ResponseBody.
ClientResult(ClientResult &&other) noexcept
Move constructor for ClientResult.
void SetSuccessful(bool Successful)
Setter for ClientResult::Successful.
std::string ToString() const
Returns the error message if any of the ClientResult.
static const ClientResult nullobj
Uninitialized instance of ClientResult.
Definition discordpp.h:1463
ClientResult & operator=(ClientResult &&other) noexcept
Move assignment operator for ClientResult.
int32_t ErrorCode() const
A more detailed error code for this failure. Currently the only use of this is when an API request is...
void SetRetryAfter(float RetryAfter)
Setter for ClientResult::RetryAfter.
float RetryAfter() const
When a user is being rate limited by Discord (and so status == 429), this field should be set and is ...
std::string ResponseBody() const
The full HTTP response body, which will usually be a JSON string.
discordpp::HttpStatusCode Status() const
The HTTP status code of the API call.
void SetError(std::string Error)
Setter for ClientResult::Error.
ClientResult(const ClientResult &arg0)
Copy constructor for ClientResult.
bool Successful() const
Equivalent to type == ErrorType::None.
void SetType(discordpp::ErrorType Type)
Setter for ClientResult::Type.
The Client class is the main entry point for the Discord SDK. All functionality is exposed through th...
Definition discordpp.h:3292
std::function< void(discordpp::ClientResult result)> UnmergeIntoProvisionalAccountCallback
Callback function for the Client::UnmergeIntoProvisionalAccount method.
Definition discordpp.h:3472
std::function< void(std::vector< discordpp::AudioDevice > devices)> GetOutputDevicesCallback
Callback function for Client::GetOutputDevices.
Definition discordpp.h:3389
std::function< void(discordpp::ClientResult result, std::string inviteUrl)> JoinLinkedLobbyGuildCallback
Callback function for Client::JoinLinkedLobbyGuild.
Definition discordpp.h:3554
bool RegisterLaunchCommand(uint64_t applicationId, std::string command)
When a user accepts an activity invite for your game within the Discord client, Discord needs to know...
void SetRelationshipCreatedCallback(discordpp::Client::RelationshipCreatedCallback cb)
Sets a callback to be invoked whenever a relationship for this user is established or changes type.
void GetUserMessagesWithLimit(uint64_t recipientId, int32_t limit, discordpp::Client::UserMessagesWithLimitCallback cb)
Retrieves messages from the DM conversation with the specified user.
void GetLobbyMessagesWithLimit(uint64_t lobbyId, int32_t limit, discordpp::Client::GetLobbyMessagesCallback cb)
Retrieves recent messages from the specified lobby.
std::function< void(uint64_t messageId)> MessageCreatedCallback
Callback function for Client::SetMessageCreatedCallback.
Definition discordpp.h:3517
discordpp::Call GetCall(uint64_t channelId)
Returns a reference to the currently active call, if any.
std::function< void(uint64_t userId)> RelationshipGroupsUpdatedCallback
Callback function for Client::SetRelationshipGroupsUpdatedCallback.
Definition discordpp.h:3634
std::function< void(discordpp::ClientResult result)> UpdateRelationshipCallback
Callback function for most other Relationship functions such as Client::SendDiscordFriendRequestById.
Definition discordpp.h:3608
void EndCalls(discordpp::Client::EndCallsCallback callback)
Ends any active call, if any. Any references you have to Call objects are invalid after they are ende...
static std::string StatusToString(discordpp::Client::Status type)
Converts the Status enum to a string.
void Disconnect()
Asynchronously disconnects the client.
void SendDiscordFriendRequest(std::string const &username, discordpp::Client::SendFriendRequestCallback cb)
Sends a Discord friend request to the target user.
void RefreshToken(uint64_t applicationId, std::string const &refreshToken, discordpp::Client::TokenExchangeCallback callback)
Generates a new access token for the current user from a refresh token.
void SendLobbyMessageWithMetadata(uint64_t lobbyId, std::string const &content, std::unordered_map< std::string, std::string > const &metadata, discordpp::Client::SendUserMessageCallback cb)
Variant of Client::SendLobbyMessage that also accepts metadata to be sent with the message.
void SetEchoCancellation(bool on)
Enables or disables the basic echo cancellation provided by the WebRTC library.
void GetInputDevices(discordpp::Client::GetInputDevicesCallback cb)
Asynchronously fetches the list of audio input devices available to the user.
void CancelGameFriendRequest(uint64_t userId, discordpp::Client::UpdateRelationshipCallback cb)
Cancels an outgoing game friend request to the target user.
void AbortGetTokenFromDevice()
This function is used to abort/cleanup the device authorization flow.
bool SetLogDir(std::string const &path, discordpp::LoggingSeverity minSeverity)
Causes logs generated by the SDK to be written to disk in the specified directory.
void OpenConnectedGamesSettingsInDiscord(discordpp::Client::OpenConnectedGamesSettingsInDiscordCallback callback)
Opens the Connected Games settings in the Discord client, which is where users can manage their setti...
void SetAuthorizeDeviceScreenClosedCallback(discordpp::Client::AuthorizeDeviceScreenClosedCallback cb)
Sets a callback function to be invoked when the device authorization screen is closed.
void SetMessageCreatedCallback(discordpp::Client::MessageCreatedCallback cb)
Sets a callback to be invoked whenever a new message is received in either a lobby or a DM.
std::function< void(discordpp::ClientResult result)> UpdateProvisionalAccountDisplayNameCallback
Callback function for Client::UpdateProvisionalAccountDisplayName.
Definition discordpp.h:3476
std::function< void(bool inputDetected)> NoAudioInputCallback
Callback function for Client::SetNoAudioInputCallback.
Definition discordpp.h:3401
void UnlinkChannelFromLobby(uint64_t lobbyId, discordpp::Client::LinkOrUnlinkChannelCallback callback)
Removes any existing channel link from the specified lobby.
std::function< void()> ProvisionalUserMergeRequiredCallback
Callback function for when Client::ProvisionalUserMergeCompleted completes.
Definition discordpp.h:3505
void SetMessageDeletedCallback(discordpp::Client::MessageDeletedCallback cb)
Sets a callback to be invoked whenever a message is deleted.
void DeleteUserMessage(uint64_t recipientId, uint64_t messageId, discordpp::Client::DeleteUserMessageCallback cb)
Deletes the specified message sent by the current user to the specified recipient.
void SetVoiceParticipantChangedCallback(discordpp::Client::VoiceParticipantChangedCallback cb)
Callback invoked whenever a user in a lobby joins or leaves a voice call.
void UnmergeIntoProvisionalAccount(uint64_t applicationId, discordpp::AuthenticationExternalAuthType externalAuthType, std::string const &externalAuthToken, discordpp::Client::UnmergeIntoProvisionalAccountCallback callback)
This function is used to unlink/unmerge a external identity from a Discord account....
std::function< void(discordpp::ClientResult result, std::vector< discordpp::GuildMinimal > guilds)> GetUserGuildsCallback
Callback function for Client::GetUserGuilds.
Definition discordpp.h:3550
Client(std::string apiBase, std::string webBase)
Creates a new instance of the Client but allows customizing the Discord URL to use.
void RevokeToken(uint64_t applicationId, std::string const &token, discordpp::Client::RevokeTokenCallback callback)
Revoke all application access/refresh tokens associated with a user with any valid access/refresh tok...
void LinkChannelToLobby(uint64_t lobbyId, uint64_t channelId, discordpp::Client::LinkOrUnlinkChannelCallback callback)
Links the specified channel on Discord to the specified in-game lobby.
std::function< void(uint64_t lobbyId)> LobbyDeletedCallback
Callback function for Client::SetLobbyDeletedCallback.
Definition discordpp.h:3567
std::function< void(std::string message, discordpp::LoggingSeverity severity)> LogCallback
Callback function invoked when a new log message is generated.
Definition discordpp.h:3526
void SetDeviceChangeCallback(discordpp::Client::DeviceChangeCallback callback)
Sets a callback function to be invoked when Discord detects a change in the available audio devices.
void GetUserMessageSummaries(discordpp::Client::UserMessageSummariesCallback cb)
Retrieves message conversation summaries for all users the current user has DM conversations with.
std::function< void(discordpp::ClientResult result)> LinkOrUnlinkChannelCallback
Callback function for Client::LinkChannelToLobby.
Definition discordpp.h:3561
std::function< void(discordpp::AudioDevice device)> GetCurrentOutputDeviceCallback
Callback function for Client::GetCurrentOutputDevice.
Definition discordpp.h:3382
std::vector< uint64_t > GetLobbyIds() const
Returns a list of all the lobbies that the user is a member of and the SDK has loaded.
void SetUserUpdatedCallback(discordpp::Client::UserUpdatedCallback cb)
The UserUpdatedCallback is invoked whenever any user the current session knows about changes,...
std::function< void()> TokenExpirationCallback
Callback function for Client::SetTokenExpirationCallback.
Definition discordpp.h:3469
std::function< void(discordpp::ClientResult result)> SetOutputDeviceCallback
Callback function for Client::SetOutputDevice.
Definition discordpp.h:3404
void SetAecDump(bool on)
Enables or disables AEC diagnostic recording.
std::function< void(discordpp::ClientResult result, std::optional< discordpp::UserHandle > user)> GetDiscordClientConnectedUserCallback
Callback function for when Client::GetDiscordClientConnectedUser completes.
Definition discordpp.h:3629
void SetActivityInviteCreatedCallback(discordpp::Client::ActivityInviteCallback cb)
Sets a callback function that is invoked when the current user receives an activity invite from anoth...
std::function< void(uint64_t lobbyId, uint64_t memberId)> LobbyMemberUpdatedCallback
Callback function for Client::SetLobbyMemberUpdatedCallback.
Definition discordpp.h:3576
void SendUserMessage(uint64_t recipientId, std::string const &content, discordpp::Client::SendUserMessageCallback cb)
Sends a direct message to the specified user.
Client & operator=(Client &&other) noexcept
Move assignment operator for Client.
void GetTokenFromProvisionalMerge(uint64_t applicationId, std::string const &code, std::string const &codeVerifier, std::string const &redirectUri, discordpp::AuthenticationExternalAuthType externalAuthType, std::string const &externalAuthToken, discordpp::Client::TokenExchangeCallback callback)
This function should be used with the Client::Authorize function whenever a user with a provisional a...
static std::string GetVersionHash()
Returns the git commit hash this version was built from.
bool RegisterLaunchSteamApplication(uint64_t applicationId, uint32_t steamAppId)
When a user accepts an activity invite for your game within the Discord client, Discord needs to know...
void FetchCurrentUser(discordpp::AuthorizationTokenType tokenType, std::string const &token, discordpp::Client::FetchCurrentUserCallback callback)
Fetches basic information about the user associated with the given auth token.
void SetNoAudioInputCallback(discordpp::Client::NoAudioInputCallback callback)
Callback function invoked when the above threshold is set and there is a change in whether audio is b...
std::vector< discordpp::UserHandle > SearchFriendsByUsername(std::string searchStr) const
Searches all of your friends by both username and display name, returning a list of all friends that ...
void SetVoiceLogDir(std::string const &path, discordpp::LoggingSeverity minSeverity)
Causes logs generated by the voice subsystem of the SDK to be written to disk in the specified direct...
std::function< void(uint64_t userId, int16_t *data, uint64_t samplesPerChannel, int32_t sampleRate, uint64_t channels, bool &outShouldMute)> UserAudioReceivedCallback
Callback function for Client::StartCallWithAudioCallbacks.
Definition discordpp.h:3413
std::function< void(discordpp::ClientResult result)> LeaveLobbyCallback
Callback function for Client::LeaveLobby.
Definition discordpp.h:3558
std::function< void(uint64_t lobbyId)> LobbyUpdatedCallback
Callback function for Client::SetLobbyUpdatedCallback.
Definition discordpp.h:3579
void GetTokenFromDevice(discordpp::DeviceAuthorizationArgs args, discordpp::Client::TokenExchangeCallback callback)
This function is a combination of Client::Authorize and Client::GetToken, but is used for the case wh...
void CloseAuthorizeDeviceScreen()
This function is used to hide the device authorization screen and is used for the case where the user...
void SetOpusHardwareCoding(bool encode, bool decode)
Enables or disables hardware encoding and decoding for audio, if it is available.
void JoinLinkedLobbyGuild(uint64_t lobbyId, discordpp::Client::ProvisionalUserMergeRequiredCallback provisionalUserMergeRequiredCallback, discordpp::Client::JoinLinkedLobbyGuildCallback callback)
Invites the current user to the Discord guild of the channel that is linked to the specified lobby....
bool ShowAudioRoutePicker()
On iOS devices, show the system audio route picker.
void SetActivityJoinCallback(discordpp::Client::ActivityJoinCallback cb)
Sets a callback function that is invoked when the current user also has Discord running on their comp...
void GetOutputDevices(discordpp::Client::GetOutputDevicesCallback cb)
Asynchronously fetches the list of audio output devices available to the user.
std::function< void()> AuthorizeDeviceScreenClosedCallback
Callback function for Client::SetAuthorizeDeviceScreenClosedCallback.
Definition discordpp.h:3466
void SetSelfDeafAll(bool deaf)
Mutes all audio from the currently active call for the current user in all calls. They will not be ab...
void ExchangeChildToken(std::string const &parentApplicationToken, uint64_t childApplicationId, discordpp::Client::ExchangeChildTokenCallback callback)
Exchanges a parent application token for a child application token.
std::function< void(discordpp::ClientResult result)> UpdateRichPresenceCallback
Callback function for when Client::UpdateRichPresence completes.
Definition discordpp.h:3604
std::function< void(discordpp::ClientResult result, std::vector< discordpp::MessageHandle > messages)> UserMessagesWithLimitCallback
Callback function for Client::GetUserMessagesWithLimit.
Definition discordpp.h:3500
void CreateOrJoinLobbyWithMetadata(std::string const &secret, std::unordered_map< std::string, std::string > const &lobbyMetadata, std::unordered_map< std::string, std::string > const &memberMetadata, discordpp::Client::CreateOrJoinLobbyCallback callback)
Variant of Client::CreateOrJoinLobby that also accepts developer-supplied metadata.
Client()
Creates a new instance of the Client.
std::function< void(discordpp::ClientResult result)> SendFriendRequestCallback
Callback function for Client::SendDiscordFriendRequest and Client::SendGameFriendRequest.
Definition discordpp.h:3612
std::function< void(discordpp::ClientResult result, std::vector< discordpp::MessageHandle > messages)> GetLobbyMessagesCallback
Callback function for Client::GetLobbyMessagesWithLimit.
Definition discordpp.h:3490
void RegisterAuthorizeRequestCallback(discordpp::Client::AuthorizeRequestCallback callback)
Registers a callback to be invoked when a user requests to initiate the authorization flow.
void UpdateToken(discordpp::AuthorizationTokenType tokenType, std::string token, discordpp::Client::UpdateTokenCallback callback)
Asynchronously sets a new auth token for this client to use.
std::function< void(discordpp::Client::Status status, discordpp::Client::Error error, int32_t errorDetail)> OnStatusChanged
Callback function for Client::SetStatusChangedCallback.
Definition discordpp.h:3537
std::function< void(uint64_t applicationId, std::string joinSecret)> ActivityJoinWithApplicationCallback
Callback function for Client::SetActivityJoinWithApplicationCallback.
Definition discordpp.h:3597
void SetOutputVolume(float outputVolume)
Sets the speaker volume for the current user.
std::function< void()> EndCallsCallback
Callback invoked when Client::EndCalls completes.
Definition discordpp.h:3376
void SendGameFriendRequestById(uint64_t userId, discordpp::Client::UpdateRelationshipCallback cb)
Sends (or accepts) a game friend request to the target user.
void OpenMessageInDiscord(uint64_t messageId, discordpp::Client::ProvisionalUserMergeRequiredCallback provisionalUserMergeRequiredCallback, discordpp::Client::OpenMessageInDiscordCallback callback)
Opens the given message in the Discord client.
void RemoveGameFriend(uint64_t userId, discordpp::Client::UpdateRelationshipCallback cb)
Removes any game friendship between the current user and the target user.
std::vector< discordpp::Call > GetCalls()
Returns a reference to all currently active calls, if any.
std::optional< discordpp::ChannelHandle > GetChannelHandle(uint64_t channelId) const
Returns a reference to the Discord channel object for the given ID.
std::function< void(discordpp::ClientResult result)> RevokeTokenCallback
Callback function for the Client::RevokeToken method.
Definition discordpp.h:3463
void SendActivityJoinRequest(uint64_t userId, discordpp::Client::SendActivityInviteCallback cb)
Requests to join the activity of the specified user.
std::function< void(discordpp::ClientResult result, std::string joinSecret)> AcceptActivityInviteCallback
Callback function for Client::AcceptActivityInvite.
Definition discordpp.h:3582
void RejectDiscordFriendRequest(uint64_t userId, discordpp::Client::UpdateRelationshipCallback cb)
Declines an incoming Discord friend request from the target user.
Status
This enum refers to the status of the internal websocket the SDK uses to communicate with Discord The...
Definition discordpp.h:3335
@ Disconnecting
Disconnecting.
Definition discordpp.h:3353
@ Connected
Connected.
Definition discordpp.h:3344
@ HttpWait
HttpWait.
Definition discordpp.h:3356
@ Reconnecting
Reconnecting.
Definition discordpp.h:3350
@ Connecting
Connecting.
Definition discordpp.h:3341
@ Ready
Ready.
Definition discordpp.h:3347
@ Disconnected
Disconnected.
Definition discordpp.h:3338
static std::string GetDefaultCommunicationScopes()
Returns the default set of OAuth2 scopes that should be used with the Discord SDK when making use of ...
void SetRelationshipDeletedCallback(discordpp::Client::RelationshipDeletedCallback cb)
Sets a callback to be invoked whenever a relationship for this user is removed, such as when the user...
void UpdateProvisionalAccountDisplayName(std::string const &name, discordpp::Client::UpdateProvisionalAccountDisplayNameCallback callback)
Updates the display name of a provisional account to the specified name.
static std::string GetDefaultPresenceScopes()
Returns the default set of OAuth2 scopes that should be used with the Discord SDK when leveraging bas...
void SendLobbyMessage(uint64_t lobbyId, std::string const &content, discordpp::Client::SendUserMessageCallback cb)
Sends a message in a lobby chat to all members of the lobby.
std::optional< discordpp::MessageHandle > GetMessageHandle(uint64_t messageId) const
Returns a reference to the Discord message object for the given ID.
float GetOutputVolume()
Returns the output volume for the current user.
std::function< void(discordpp::ClientResult result, std::string accessToken, std::string refreshToken, discordpp::AuthorizationTokenType tokenType, int32_t expiresIn, std::string scopes)> TokenExchangeCallback
Callback function for the token exchange APIs such as Client::GetToken.
Definition discordpp.h:3448
void SetThreadPriority(discordpp::Client::Thread thread, int32_t priority)
Allows setting the priority of various SDK threads.
discordpp::UserHandle GetCurrentUser() const
(deprecated)
std::function< void(discordpp::ClientResult result)> OpenMessageInDiscordCallback
Callback function for when Client::OpenMessageInDiscord completes.
Definition discordpp.h:3508
void GetProvisionalToken(uint64_t applicationId, discordpp::AuthenticationExternalAuthType externalAuthType, std::string const &externalAuthToken, discordpp::Client::TokenExchangeCallback callback)
Provisional accounts are a way for users that have not signed up for Discord to still access SDK func...
void GetCurrentInputDevice(discordpp::Client::GetCurrentInputDeviceCallback cb)
Asynchronously fetches the current audio input device in use by the client.
void SetAutomaticGainControl(bool on)
When enabled, automatically adjusts the microphone volume to keep it clear and consistent.
void EditUserMessage(uint64_t recipientId, uint64_t messageId, std::string const &content, discordpp::Client::EditUserMessageCallback cb)
Edits the specified message sent by the current user to the specified recipient.
std::function< void()> EndCallCallback
Callback invoked when Client::EndCall completes.
Definition discordpp.h:3373
std::function< void()> AuthorizeRequestCallback
Callback invoked when a user requests to initiate the authorization flow from the discord app.
Definition discordpp.h:3460
std::function< void(discordpp::ClientResult result)> EditUserMessageCallback
Callback function for Client::EditUserMessage.
Definition discordpp.h:3487
void Connect()
Asynchronously connects the client to Discord.
void SetLobbyDeletedCallback(discordpp::Client::LobbyDeletedCallback cb)
Sets a callback to be invoked when a lobby is no longer available.
void GetDiscordClientConnectedUser(uint64_t applicationId, discordpp::Client::GetDiscordClientConnectedUserCallback callback) const
If the Discord app is running on the user's computer and the SDK establishes a connection to it,...
static int32_t GetVersionPatch()
Returns the patch version of the Discord Social SDK.
void CreateOrJoinLobby(std::string const &secret, discordpp::Client::CreateOrJoinLobbyCallback callback)
Joins the user to the specified lobby, creating one if it does not exist.
void LeaveLobby(uint64_t lobbyId, discordpp::Client::LeaveLobbyCallback callback)
Removes the current user from the specified lobby.
float GetInputVolume()
Returns the input volume for the current user's microphone.
std::function< void(discordpp::ClientResult result)> SetInputDeviceCallback
Callback function for Client::SetInputDevice.
Definition discordpp.h:3398
void SetLobbyMemberRemovedCallback(discordpp::Client::LobbyMemberRemovedCallback cb)
Sets a callback function to be invoked whenever a member of a lobby is removed and can no longer conn...
Client(Client &&other) noexcept
Move constructor for Client.
static std::string GetDefaultAudioDeviceId()
Returns the ID of the system default audio device if the user has not explicitly chosen one.
void CancelDiscordFriendRequest(uint64_t userId, discordpp::Client::UpdateRelationshipCallback cb)
Cancels an outgoing Discord friend request to the target user.
std::function< void(uint64_t lobbyId, uint64_t memberId)> LobbyMemberAddedCallback
Callback function for Client::SetLobbyMemberAddedCallback.
Definition discordpp.h:3570
void SetOnlineStatus(discordpp::StatusType status, discordpp::Client::UpdateStatusCallback callback)
Sets whether a user is online/invisible/idle/dnd on Discord.
void ClearRichPresence()
Clears the right presence for the current user.
void SetSelfMuteAll(bool mute)
Mutes the current user's microphone so that no other participant in their active calls can hear them ...
void SetStatusChangedCallback(discordpp::Client::OnStatusChanged cb)
Sets a callback function to be invoked whenever the SDKs status changes.
std::function< void(discordpp::ActivityInvite invite)> ActivityInviteCallback
Callback function for Client::SetActivityInviteCreatedCallback and Client::SetActivityInviteUpdatedCa...
Definition discordpp.h:3591
std::vector< discordpp::RelationshipHandle > GetRelationshipsByGroup(discordpp::RelationshipGroupType groupType) const
Returns a list of relationships that belong to the specified relationship group type....
std::function< void(discordpp::ClientResult result)> UpdateTokenCallback
Callback invoked when Client::UpdateToken completes. Once this is done it is safe to call Client::Con...
Definition discordpp.h:3481
void SetMessageUpdatedCallback(discordpp::Client::MessageUpdatedCallback cb)
Sets a callback to be invoked whenever a message is edited.
void SetOutputDevice(std::string deviceId, discordpp::Client::SetOutputDeviceCallback cb)
Asynchronously changes the audio output device in use by the client to the specified device....
void SendUserMessageWithMetadata(uint64_t recipientId, std::string const &content, std::unordered_map< std::string, std::string > const &metadata, discordpp::Client::SendUserMessageCallback cb)
Variant of Client::SendUserMessage that also accepts metadata to be sent with the message.
std::function< void(uint64_t lobbyId)> LobbyCreatedCallback
Callback function for Client::SetLobbyCreatedCallback.
Definition discordpp.h:3564
void RemoveDiscordAndGameFriend(uint64_t userId, discordpp::Client::UpdateRelationshipCallback cb)
Removes any friendship between the current user and the target user. This function will remove BOTH a...
std::function< void(uint64_t lobbyId, uint64_t memberId)> LobbyMemberRemovedCallback
Callback function for Client::SetLobbyMemberRemovedCallback.
Definition discordpp.h:3573
void SetTokenExpirationCallback(discordpp::Client::TokenExpirationCallback callback)
Get a notification when the current token is about to expire or expired.
void GetUserGuilds(discordpp::Client::GetUserGuildsCallback cb)
Fetches all of the guilds (also known as Discord servers) that the current user is a member of.
void SetGameWindowPid(int32_t pid)
When users are linking their account with Discord, which involves an OAuth2 flow, the SDK can streaml...
void GetToken(uint64_t applicationId, std::string const &code, std::string const &codeVerifier, std::string const &redirectUri, discordpp::Client::TokenExchangeCallback callback)
Exchanges an authorization code that was returned from the Client::Authorize function for an access t...
std::function< void(discordpp::ClientResult result, std::string code, std::string redirectUri)> AuthorizationCallback
Callback invoked when the Authorize function completes.
Definition discordpp.h:3432
void SetActivityInviteUpdatedCallback(discordpp::Client::ActivityInviteCallback cb)
Sets a callback function that is invoked when an existing activity invite changes....
void SetNoAudioInputThreshold(float dBFSThreshold)
Threshold that can be set to indicate when no audio is being received by the user's mic.
std::function< void(std::string joinSecret)> ActivityJoinCallback
Callback function for Client::SetActivityJoinCallback.
Definition discordpp.h:3594
static std::string ErrorToString(discordpp::Client::Error type)
Converts the Error enum to a string.
std::optional< discordpp::UserHandle > GetUser(uint64_t userId) const
Returns the UserHandle associated with the given user ID.
void RemoveAuthorizeRequestCallback()
Stops listening for the AUTHORIZE_REQUEST event and removes the registered callback.
discordpp::RelationshipHandle GetRelationshipHandle(uint64_t userId) const
Returns the RelationshipHandle that corresponds to the relationship between the current user and the ...
std::function< void(discordpp::ClientResult result)> SendActivityInviteCallback
Callback function for Client::SendActivityInvite, Client::SendActivityJoinRequest,...
Definition discordpp.h:3587
discordpp::AuthorizationCodeVerifier CreateAuthorizationCodeVerifier()
Helper function that can create a code challenge and verifier for use in the Client::Authorize + Clie...
std::function< void(uint64_t lobbyId, uint64_t memberId, bool added)> VoiceParticipantChangedCallback
Callback function for Client::SetVoiceParticipantChangedCallback.
Definition discordpp.h:3407
discordpp::Call StartCallWithAudioCallbacks(uint64_t lobbyId, discordpp::Client::UserAudioReceivedCallback receivedCb, discordpp::Client::UserAudioCapturedCallback capturedCb)
Starts or joins a call in the specified lobby.
uint64_t GetApplicationId()
This function is used to get the application ID for the client. This is used to identify the applicat...
std::function< void(uint64_t userId, bool isDiscordRelationshipUpdate)> RelationshipDeletedCallback
Callback function for Client::SetRelationshipDeletedCallback.
Definition discordpp.h:3625
bool GetSelfDeafAll() const
Returns whether the current user is deafened in all calls.
bool SetSpeakerMode(bool speakerMode)
(deprecated) On mobile devices, enable speakerphone mode.
static int32_t GetVersionMinor()
Returns the minor version of the Discord Social SDK.
void AddVoiceLogCallback(discordpp::Client::LogCallback callback, discordpp::LoggingSeverity minSeverity)
Adds a callback function to be invoked for each new log message generated by the voice subsystem of t...
void AbortAuthorize()
This will abort the authorize flow if it is in progress and tear down any associated state.
Error
Represents an error state for the socket connection that the Discord SDK maintains with the Discord b...
Definition discordpp.h:3306
@ None
None.
Definition discordpp.h:3309
@ ConnectionCanceled
ConnectionCanceled.
Definition discordpp.h:3318
@ ConnectionFailed
ConnectionFailed.
Definition discordpp.h:3312
@ UnexpectedClose
UnexpectedClose.
Definition discordpp.h:3315
void UnblockUser(uint64_t userId, discordpp::Client::UpdateRelationshipCallback cb)
Unblocks the target user. Does not restore any old relationship between the users though.
void SetShowingChat(bool showingChat)
Sets whether chat messages are currently being shown in the game.
static int32_t GetVersionMajor()
Returns the major version of the Discord Social SDK.
std::function< void(discordpp::ClientResult result, uint64_t messageId)> SendUserMessageCallback
This is used for all kinds of 'send message' calls despite the name, to make sure engine bindings use...
Definition discordpp.h:3513
std::function< void(discordpp::AudioDevice device)> GetCurrentInputDeviceCallback
Callback function for Client::GetCurrentInputDevice.
Definition discordpp.h:3379
void SetLobbyCreatedCallback(discordpp::Client::LobbyCreatedCallback cb)
Sets a callback to be invoked when a lobby "becomes available" to the client.
void Authorize(discordpp::AuthorizationArgs args, discordpp::Client::AuthorizationCallback callback)
Initiates an OAuth2 flow for a user to "sign in with Discord". This flow is intended for desktop and ...
std::function< void(uint64_t userId)> UserUpdatedCallback
Callback function for Client::SetUserUpdatedCallback.
Definition discordpp.h:3637
void AcceptActivityInvite(discordpp::ActivityInvite invite, discordpp::Client::AcceptActivityInviteCallback cb)
Accepts an activity invite that the current user has received.
void SetInputDevice(std::string deviceId, discordpp::Client::SetInputDeviceCallback cb)
Asynchronously changes the audio input device in use by the client to the specified device....
void RejectGameFriendRequest(uint64_t userId, discordpp::Client::UpdateRelationshipCallback cb)
Declines an incoming game friend request from the target user.
void SetInputVolume(float inputVolume)
Sets the microphone volume for the current user.
void SetApplicationId(uint64_t applicationId)
This function is used to set the application ID for the client. This is used to identify the applicat...
std::vector< discordpp::RelationshipHandle > GetRelationships() const
Returns a list of all of the relationships the current user has with others, including all Discord re...
std::function< void(uint64_t messageId, uint64_t channelId)> MessageDeletedCallback
Callback function for Client::SetMessageDeletedCallback.
Definition discordpp.h:3520
void SetLobbyUpdatedCallback(discordpp::Client::LobbyUpdatedCallback cb)
Sets a callback to be invoked when a lobby is edited, for example if the lobby's metadata is changed.
std::function< void(discordpp::ClientResult result)> OpenConnectedGamesSettingsInDiscordCallback
Callback function for when Client::OpenConnectedGamesSettingsInDiscord completes.
Definition discordpp.h:3530
Thread
Represents the type of thread to control thread priority on.
Definition discordpp.h:3360
@ Client
Client.
Definition discordpp.h:3363
@ Voice
Voice.
Definition discordpp.h:3366
@ Network
Network.
Definition discordpp.h:3369
void SendActivityJoinRequestReply(discordpp::ActivityInvite invite, discordpp::Client::SendActivityInviteCallback cb)
When another user requests to join the current user's party, this function is called to to allow that...
void GetGuildChannels(uint64_t guildId, discordpp::Client::GetGuildChannelsCallback cb)
Fetches all of the channels that the current user can access in the given guild. Channels are sorted ...
static std::string ThreadToString(discordpp::Client::Thread type)
Converts the Thread enum to a string.
void BlockUser(uint64_t userId, discordpp::Client::UpdateRelationshipCallback cb)
Blocks the target user so that they cannot send the user friend or activity invites and cannot messag...
std::function< void(uint64_t messageId)> MessageUpdatedCallback
Callback function for Client::SetMessageUpdatedCallback.
Definition discordpp.h:3523
void SetEngineManagedAudioSession(bool isEngineManaged)
On mobile devices, set whether the audio environment is managed by the engine or the SDK....
void SetLobbyMemberUpdatedCallback(discordpp::Client::LobbyMemberUpdatedCallback cb)
Sets a callback function to be invoked whenever a member of a lobby is changed.
void SetActivityJoinWithApplicationCallback(discordpp::Client::ActivityJoinWithApplicationCallback cb)
Sets a callback function that is invoked when the current user also has Discord running on their comp...
bool GetSelfMuteAll() const
Returns whether the current user's microphone is muted in all calls.
std::function< void(uint64_t userId, bool isDiscordRelationshipUpdate)> RelationshipCreatedCallback
Callback function for Client::SetRelationshipCreatedCallback.
Definition discordpp.h:3618
std::function< void(discordpp::ClientResult result)> DeleteUserMessageCallback
Callback function for Client::DeleteUserMessage.
Definition discordpp.h:3484
std::function< void(discordpp::ClientResult result, std::string accessToken, discordpp::AuthorizationTokenType tokenType, int32_t expiresIn, std::string scopes)> ExchangeChildTokenCallback
Callback function for Client::ExchangeChildToken.
Definition discordpp.h:3436
bool CanOpenMessageInDiscord(uint64_t messageId)
Returns true if the given message is able to be viewed in a Discord client.
void SetNoiseSuppression(bool on)
Enables basic background noise suppression.
std::optional< discordpp::UserHandle > GetCurrentUserV2() const
Unlike GetCurrentUser(), this method returns std::nullopt instead of a dummy object when no user is a...
void SetLobbyMemberAddedCallback(discordpp::Client::LobbyMemberAddedCallback cb)
Sets a callback function to be invoked whenever a user is added to a lobby.
void GetCurrentOutputDevice(discordpp::Client::GetCurrentOutputDeviceCallback cb)
Asynchronously fetches the current audio output device in use by the client.
void SetHttpRequestTimeout(int32_t httpTimeoutInMilliseconds)
This function is used to override the default HTTP timeout for the websocket client.
void EndCall(uint64_t channelId, discordpp::Client::EndCallCallback callback)
Ends any active call, if any. Any references you have to Call objects are invalid after they are ende...
void AcceptGameFriendRequest(uint64_t userId, discordpp::Client::UpdateRelationshipCallback cb)
Accepts an incoming game friend request from the target user.
std::function< void(discordpp::ClientResult result, uint64_t id, std::string name)> FetchCurrentUserCallback
Callback function for Client::FetchCurrentUser.
Definition discordpp.h:3444
std::function< void(discordpp::ClientResult result, std::vector< discordpp::GuildChannel > guildChannels)> GetGuildChannelsCallback
Callback function for Client::GetGuildChannels.
Definition discordpp.h:3545
std::function< void(discordpp::ClientResult result)> UpdateStatusCallback
Callback function for when Client::SetOnlineStatus completes.
Definition discordpp.h:3601
std::optional< discordpp::LobbyHandle > GetLobbyHandle(uint64_t lobbyId) const
Returns a reference to the Discord lobby object for the given ID.
std::function< void(discordpp::ClientResult result, uint64_t lobbyId)> CreateOrJoinLobbyCallback
Callback function for Client::CreateOrJoinLobby.
Definition discordpp.h:3541
std::function< void(discordpp::ClientResult result, std::vector< discordpp::UserMessageSummary > summaries)> UserMessageSummariesCallback
Callback function for Client::GetUserMessageSummaries.
Definition discordpp.h:3495
discordpp::Call StartCall(uint64_t channelId)
Starts or joins a call in the lobby specified by channelId (For a lobby, simply pass in the lobbyId).
void UpdateRichPresence(discordpp::Activity activity, discordpp::Client::UpdateRichPresenceCallback cb)
Updates the rich presence for the current user.
void SetRelationshipGroupsUpdatedCallback(discordpp::Client::RelationshipGroupsUpdatedCallback cb)
The RelationshipGroupsUpdatedCallback is invoked whenever any user in the friends list changes....
Client(discordpp::ClientCreateOptions options)
Creates a new instance of the Client with custom options.
void OpenAuthorizeDeviceScreen(uint64_t clientId, std::string const &userCode)
This function is used to show the device authorization screen and is used for the case where the user...
std::function< void(int16_t *data, uint64_t samplesPerChannel, int32_t sampleRate, uint64_t channels)> UserAudioCapturedCallback
Callback function for Client::StartCallWithAudioCallbacks.
Definition discordpp.h:3423
std::function< void(std::vector< discordpp::AudioDevice > inputDevices, std::vector< discordpp::AudioDevice > outputDevices)> DeviceChangeCallback
Callback function for Client::SetDeviceChangeCallback.
Definition discordpp.h:3393
void AddLogCallback(discordpp::Client::LogCallback callback, discordpp::LoggingSeverity minSeverity)
Adds a callback function to be invoked for each new log message generated by the SDK.
void ProvisionalUserMergeCompleted(bool success)
Some functions don't work for provisional accounts, and require the user merge their account into a f...
void AcceptDiscordFriendRequest(uint64_t userId, discordpp::Client::UpdateRelationshipCallback cb)
Accepts an incoming Discord friend request from the target user.
void SendDiscordFriendRequestById(uint64_t userId, discordpp::Client::UpdateRelationshipCallback cb)
Sends a Discord friend request to the target user.
void SendGameFriendRequest(std::string const &username, discordpp::Client::SendFriendRequestCallback cb)
Sends (or accepts) a game friend request to the target user.
void SendActivityInvite(uint64_t userId, std::string const &content, discordpp::Client::SendActivityInviteCallback cb)
Sends a Discord activity invite to the specified user.
std::function< void(std::vector< discordpp::AudioDevice > devices)> GetInputDevicesCallback
Callback function for Client::GetInputDevices.
Definition discordpp.h:3385
void GetTokenFromDeviceProvisionalMerge(discordpp::DeviceAuthorizationArgs args, discordpp::AuthenticationExternalAuthType externalAuthType, std::string const &externalAuthToken, discordpp::Client::TokenExchangeCallback callback)
This function is a combination of Client::Authorize and Client::GetTokenFromProvisionalMerge,...
bool IsAuthenticated()
Returns true if the SDK has a non-empty OAuth2 token set, regardless of whether that token is valid o...
static const Client nullobj
Uninitialized instance of Client.
Definition discordpp.h:3650
discordpp::Client::Status GetStatus() const
Returns the current status of the client, see the Status enum for an explanation of the possible valu...
Arguments to the Client::GetTokenFromDevice function.
Definition discordpp.h:1735
DeviceAuthorizationArgs(DeviceAuthorizationArgs &&other) noexcept
Move constructor for DeviceAuthorizationArgs.
DeviceAuthorizationArgs(const DeviceAuthorizationArgs &arg0)
Copy constructor for DeviceAuthorizationArgs.
uint64_t ClientId() const
Optional. The Discord application ID for your game. Defaults to the value set by Client::SetApplicati...
static const DeviceAuthorizationArgs nullobj
Uninitialized instance of DeviceAuthorizationArgs.
Definition discordpp.h:1755
void SetClientId(uint64_t ClientId)
Setter for DeviceAuthorizationArgs::ClientId.
void SetScopes(std::string Scopes)
Setter for DeviceAuthorizationArgs::Scopes.
DeviceAuthorizationArgs & operator=(const DeviceAuthorizationArgs &arg0)
Copy assignment operator for DeviceAuthorizationArgs.
std::string Scopes() const
Scopes is a space separated string of the oauth scopes your game is requesting.
DeviceAuthorizationArgs & operator=(DeviceAuthorizationArgs &&other) noexcept
Move assignment operator for DeviceAuthorizationArgs.
void SetIsLinkable(bool IsLinkable)
Setter for GuildChannel::IsLinkable.
bool IsViewableAndWriteableByAllMembers() const
Whether the channel is "fully public" which means every member of the guild is able to view and send ...
std::optional< discordpp::LinkedLobby > LinkedLobby() const
Information about the currently linked lobby, if any. Currently Discord enforces that a channel can o...
uint64_t Id() const
The id of the channel.
void SetName(std::string Name)
Setter for GuildChannel::Name.
GuildChannel(const GuildChannel &arg0)
Copy constructor for GuildChannel.
void SetId(uint64_t Id)
Setter for GuildChannel::Id.
std::optional< uint64_t > ParentId() const
The id of the parent category channel, if any.
std::string Name() const
The name of the channel.
void SetType(discordpp::ChannelType Type)
Setter for GuildChannel::Type.
void SetPosition(int32_t Position)
Setter for GuildChannel::Position.
discordpp::ChannelType Type() const
The type of the channel.
GuildChannel & operator=(const GuildChannel &arg0)
Copy assignment operator for GuildChannel.
GuildChannel & operator=(GuildChannel &&other) noexcept
Move assignment operator for GuildChannel.
GuildChannel(GuildChannel &&other) noexcept
Move constructor for GuildChannel.
bool IsLinkable() const
Whether the current user is able to link this channel to a lobby.
int32_t Position() const
The position of the channel in the guild's channel list.
void SetLinkedLobby(std::optional< discordpp::LinkedLobby > LinkedLobby)
Setter for GuildChannel::LinkedLobby.
void SetIsViewableAndWriteableByAllMembers(bool IsViewableAndWriteableByAllMembers)
Setter for GuildChannel::IsViewableAndWriteableByAllMembers.
static const GuildChannel nullobj
Uninitialized instance of GuildChannel.
Definition discordpp.h:2231
void SetParentId(std::optional< uint64_t > ParentId)
Setter for GuildChannel::ParentId.
void SetName(std::string Name)
Setter for GuildMinimal::Name.
std::string Name() const
The name of the guild.
void SetId(uint64_t Id)
Setter for GuildMinimal::Id.
static const GuildMinimal nullobj
Uninitialized instance of GuildMinimal.
Definition discordpp.h:2186
GuildMinimal & operator=(GuildMinimal &&other) noexcept
Move assignment operator for GuildMinimal.
GuildMinimal & operator=(const GuildMinimal &arg0)
Copy assignment operator for GuildMinimal.
GuildMinimal(const GuildMinimal &arg0)
Copy constructor for GuildMinimal.
GuildMinimal(GuildMinimal &&other) noexcept
Move constructor for GuildMinimal.
uint64_t Id() const
The id of the guild.
Struct that stores information about the channel that a lobby is linked to.
Definition discordpp.h:2354
uint64_t GuildId() const
The id of the guild (aka server) that owns the linked channel.
void SetName(std::string Name)
Setter for LinkedChannel::Name.
LinkedChannel & operator=(LinkedChannel &&other) noexcept
Move assignment operator for LinkedChannel.
LinkedChannel & operator=(const LinkedChannel &arg0)
Copy assignment operator for LinkedChannel.
std::string Name() const
The name of the linked channel.
void SetGuildId(uint64_t GuildId)
Setter for LinkedChannel::GuildId.
static const LinkedChannel nullobj
Uninitialized instance of LinkedChannel.
Definition discordpp.h:2373
LinkedChannel(const LinkedChannel &arg0)
Copy constructor for LinkedChannel.
void SetId(uint64_t Id)
Setter for LinkedChannel::Id.
uint64_t Id() const
The id of the linked channel.
LinkedChannel(LinkedChannel &&other) noexcept
Move constructor for LinkedChannel.
Struct that stores information about the lobby linked to a channel.
Definition discordpp.h:2308
LinkedLobby & operator=(const LinkedLobby &arg0)
Copy assignment operator for LinkedLobby.
LinkedLobby(const LinkedLobby &arg0)
Copy constructor for LinkedLobby.
uint64_t ApplicationId() const
The ID of the application that owns the lobby.
void SetLobbyId(uint64_t LobbyId)
Setter for LinkedLobby::LobbyId.
static const LinkedLobby nullobj
Uninitialized instance of LinkedLobby.
Definition discordpp.h:2327
void SetApplicationId(uint64_t ApplicationId)
Setter for LinkedLobby::ApplicationId.
LinkedLobby & operator=(LinkedLobby &&other) noexcept
Move assignment operator for LinkedLobby.
uint64_t LobbyId() const
The ID of the lobby.
LinkedLobby(LinkedLobby &&other) noexcept
Move constructor for LinkedLobby.
A LobbyHandle represents a single lobby in the SDK. A lobby can be thought of as just an arbitrary,...
Definition discordpp.h:2829
LobbyHandle(LobbyHandle &&other) noexcept
Move constructor for LobbyHandle.
std::optional< discordpp::LinkedChannel > LinkedChannel() const
Returns information about the channel linked to this lobby, if any.
static const LobbyHandle nullobj
Uninitialized instance of LobbyHandle.
Definition discordpp.h:2848
LobbyHandle & operator=(const LobbyHandle &other)
Copy assignment operator for LobbyHandle.
std::optional< discordpp::CallInfoHandle > GetCallInfoHandle() const
Returns a reference to the CallInfoHandle if there is an active voice call in this lobby.
std::unordered_map< std::string, std::string > Metadata() const
Returns any developer supplied metadata for this lobby.
std::optional< discordpp::LobbyMemberHandle > GetLobbyMemberHandle(uint64_t memberId) const
Returns a reference to the LobbyMemberHandle for the given user ID, if they are a member of this lobb...
LobbyHandle(const LobbyHandle &other)
Copy constructor for LobbyHandle.
std::vector< discordpp::LobbyMemberHandle > LobbyMembers() const
Returns a list of the LobbyMemberHandle objects for each member of this lobby.
uint64_t Id() const
Returns the id of the lobby.
std::vector< uint64_t > LobbyMemberIds() const
Returns a list of the user IDs that are members of this lobby.
LobbyHandle & operator=(LobbyHandle &&other) noexcept
Move assignment operator for LobbyHandle.
A LobbyMemberHandle represents the state of a single user in a Lobby.
Definition discordpp.h:2686
LobbyMemberHandle & operator=(const LobbyMemberHandle &other)
Copy assignment operator for LobbyMemberHandle.
static const LobbyMemberHandle nullobj
Uninitialized instance of LobbyMemberHandle.
Definition discordpp.h:2705
uint64_t Id() const
The user id of the lobby member.
LobbyMemberHandle(const LobbyMemberHandle &other)
Copy constructor for LobbyMemberHandle.
bool Connected() const
Returns true if the user is currently connected to the lobby.
LobbyMemberHandle & operator=(LobbyMemberHandle &&other) noexcept
Move assignment operator for LobbyMemberHandle.
std::optional< discordpp::UserHandle > User() const
The UserHandle of the lobby member.
bool CanLinkLobby() const
Returns true if the user is allowed to link a channel to this lobby.
LobbyMemberHandle(LobbyMemberHandle &&other) noexcept
Move constructor for LobbyMemberHandle.
std::unordered_map< std::string, std::string > Metadata() const
Metadata is a set of string key/value pairs that the game developer can use.
A MessageHandle represents a single message received by the SDK.
Definition discordpp.h:3005
uint64_t AuthorId() const
Returns the user ID of the user who sent this message.
std::optional< discordpp::ChannelHandle > Channel() const
Returns the ChannelHandle for the channel this message was sent in.
static const MessageHandle nullobj
Uninitialized instance of MessageHandle.
Definition discordpp.h:3024
std::optional< discordpp::UserHandle > Recipient() const
Returns the UserHandle for the other participant in a DM, if this message was sent in a DM.
std::optional< uint64_t > ApplicationId() const
Returns the application ID associated with this message, if any. You can use this to identify if the ...
MessageHandle & operator=(const MessageHandle &other)
Copy assignment operator for MessageHandle.
uint64_t Id() const
Returns the ID of this message.
std::optional< discordpp::UserHandle > Author() const
Returns the UserHandle for the author of this message.
MessageHandle & operator=(MessageHandle &&other) noexcept
Move assignment operator for MessageHandle.
uint64_t EditedTimestamp() const
The timestamp in millis since the epoch when the message was most recently edited.
MessageHandle(const MessageHandle &other)
Copy constructor for MessageHandle.
std::string Content() const
Returns the content of this message, if any.
std::unordered_map< std::string, std::string > Metadata() const
Returns any metadata the developer included with this message.
std::string RawContent() const
Returns the content of this message, if any, but without replacing any markup from emojis and mention...
std::optional< discordpp::LobbyHandle > Lobby() const
Returns the LobbyHandle this message was sent in, if it was sent in a lobby.
uint64_t RecipientId() const
When this message was sent in a DM or Ephemeral DM, this method will return the ID of the other user ...
uint64_t SentTimestamp() const
The timestamp in millis since the epoch when the message was sent.
std::optional< discordpp::DisclosureTypes > DisclosureType() const
If this is an auto-generated message that is explaining some integration behavior to users,...
uint64_t ChannelId() const
Returns the channel ID this message was sent in.
MessageHandle(MessageHandle &&other) noexcept
Move constructor for MessageHandle.
bool SentFromGame() const
Returns true if this message was sent in-game, otherwise false (i.e. from Discord itself)....
std::optional< discordpp::AdditionalContent > AdditionalContent() const
If the message contains non-text content, such as images, videos, embeds, polls, etc,...
A RelationshipHandle represents the relationship between the current user and a target user on Discor...
Definition discordpp.h:2436
RelationshipHandle & operator=(const RelationshipHandle &other)
Copy assignment operator for RelationshipHandle.
RelationshipHandle(const RelationshipHandle &other)
Copy constructor for RelationshipHandle.
uint64_t Id() const
Returns the ID of the target user in this relationship.
discordpp::RelationshipType DiscordRelationshipType() const
Returns the type of the Discord relationship.
RelationshipHandle(RelationshipHandle &&other) noexcept
Move constructor for RelationshipHandle.
discordpp::RelationshipType GameRelationshipType() const
Returns the type of the Game relationship.
static const RelationshipHandle nullobj
Uninitialized instance of RelationshipHandle.
Definition discordpp.h:2455
bool IsSpamRequest() const
Returns whether this relationship is a spam request.
std::optional< discordpp::UserHandle > User() const
Returns a handle to the target user in this relationship, if one is available. This would be the user...
RelationshipHandle & operator=(RelationshipHandle &&other) noexcept
Move assignment operator for RelationshipHandle.
static const UserApplicationProfileHandle nullobj
Uninitialized instance of UserApplicationProfileHandle.
Definition discordpp.h:2514
std::string Username() const
Returns the user's in-game username.
std::string Metadata() const
Returns any metadata set by the developer.
UserApplicationProfileHandle(UserApplicationProfileHandle &&other) noexcept
Move constructor for UserApplicationProfileHandle.
UserApplicationProfileHandle & operator=(const UserApplicationProfileHandle &other)
Copy assignment operator for UserApplicationProfileHandle.
std::string ProviderIssuedUserId() const
Returns the user's external identity provider issued user ID.
UserApplicationProfileHandle & operator=(UserApplicationProfileHandle &&other) noexcept
Move assignment operator for UserApplicationProfileHandle.
UserApplicationProfileHandle(const UserApplicationProfileHandle &other)
Copy constructor for UserApplicationProfileHandle.
std::string AvatarHash() const
Returns the user's in-game avatar hash.
std::optional< std::string > ProviderId() const
Returns the user's external identity provider ID if it exists.
discordpp::ExternalIdentityProviderType ProviderType() const
Returns the type of the external identity provider.
A UserHandle represents a single user on Discord that the SDK knows about and contains basic account ...
Definition discordpp.h:2556
uint64_t Id() const
Returns the ID of this user.
UserHandle & operator=(UserHandle &&other) noexcept
Move assignment operator for UserHandle.
std::string Username() const
Returns the globally unique username of this user.
static const UserHandle nullobj
Uninitialized instance of UserHandle.
Definition discordpp.h:2590
std::optional< std::string > Avatar() const
Returns the hash of the user's Discord profile avatar, if one is set.
UserHandle(const UserHandle &arg0)
Copy constructor for UserHandle.
discordpp::StatusType Status() const
Returns the user's online/offline/idle status.
UserHandle(UserHandle &&other) noexcept
Move constructor for UserHandle.
std::vector< discordpp::UserApplicationProfileHandle > UserApplicationProfiles() const
Returns a list of UserApplicationProfileHandles for this user. Currently, a user can only have a sing...
std::string AvatarUrl(discordpp::UserHandle::AvatarType animatedType, discordpp::UserHandle::AvatarType staticType) const
Returns a CDN url to the user's Discord profile avatar.
AvatarType
The desired type of avatar url to generate for a User.
Definition discordpp.h:2564
@ Jpeg
Jpeg.
Definition discordpp.h:2576
@ Gif
Gif.
Definition discordpp.h:2567
@ Webp
Webp.
Definition discordpp.h:2570
@ Png
Png.
Definition discordpp.h:2573
bool IsProvisional() const
Returns true if this user is a provisional account.
std::optional< std::string > GlobalName() const
Returns the preferred display name of this user, if one is set.
std::optional< discordpp::Activity > GameActivity() const
Returns the user's rich presence activity that is associated with the current game,...
UserHandle & operator=(const UserHandle &arg0)
Copy assignment operator for UserHandle.
static std::string AvatarTypeToString(discordpp::UserHandle::AvatarType type)
Converts the AvatarType enum to a string.
std::string DisplayName() const
Returns the user's preferred name, if one is set, otherwise returns their unique username.
discordpp::RelationshipHandle Relationship() const
Returns a reference to the RelationshipHandle between the currently authenticated user and this user,...
UserMessageSummary & operator=(const UserMessageSummary &arg0)
Copy assignment operator for UserMessageSummary.
static const UserMessageSummary nullobj
Uninitialized instance of UserMessageSummary.
Definition discordpp.h:3189
UserMessageSummary(UserMessageSummary &&other) noexcept
Move constructor for UserMessageSummary.
uint64_t LastMessageId() const
Returns the ID of the last message sent in the DM conversation.
uint64_t UserId() const
Returns the ID of the other user in the DM conversation.
UserMessageSummary(const UserMessageSummary &arg0)
Copy constructor for UserMessageSummary.
UserMessageSummary & operator=(UserMessageSummary &&other) noexcept
Move assignment operator for UserMessageSummary.
Settings for the void auto detection threshold for picking up activity from a user's mic.
Definition discordpp.h:1845
VADThresholdSettings & operator=(VADThresholdSettings &&other) noexcept
Move assignment operator for VADThresholdSettings.
VADThresholdSettings(VADThresholdSettings &&other) noexcept
Move constructor for VADThresholdSettings.
static const VADThresholdSettings nullobj
Uninitialized instance of VADThresholdSettings.
Definition discordpp.h:1864
bool Automatic() const
Whether or not Discord is currently automatically setting and detecting the appropriate threshold to ...
float VadThreshold() const
The current void auto detection threshold value, has a range of -100, 0 and defaults to -60.
void SetAutomatic(bool Automatic)
Setter for VADThresholdSettings::Automatic.
void SetVadThreshold(float VadThreshold)
Setter for VADThresholdSettings::VadThreshold.
A VoiceStateHandle represents the state of a single participant in a Discord voice call.
Definition discordpp.h:1803
VoiceStateHandle & operator=(VoiceStateHandle &&other) noexcept
Move assignment operator for VoiceStateHandle.
bool SelfMute() const
Returns true if the given user has muted themselves so that no one else in the call can hear them.
static const VoiceStateHandle nullobj
Uninitialized instance of VoiceStateHandle.
Definition discordpp.h:1822
bool SelfDeaf() const
Returns true if the given user has deafened themselves so that no one else in the call can hear them ...
VoiceStateHandle(VoiceStateHandle &&other) noexcept
Move constructor for VoiceStateHandle.
VoiceStateHandle & operator=(const VoiceStateHandle &other)
Copy assignment operator for VoiceStateHandle.
VoiceStateHandle(const VoiceStateHandle &other)
Copy constructor for VoiceStateHandle.
The namespace for the generated Discord SDK bindings.
Definition discordpp.h:16
ActivityPartyPrivacy
Allows your game to control the privacy of the party the user is in.
Definition discordpp.h:54
@ Public
The party is public, which means that the user is in a party which could be joinable by either friend...
Definition discordpp.h:68
@ Private
The party is private (or unknown), which means that the user is in a party but it is not joinable wit...
Definition discordpp.h:62
DisclosureTypes
Enum that represents various informational disclosures that Discord may make to users,...
Definition discordpp.h:601
@ MessageDataVisibleOnDiscord
This disclosure type happens the first time a user sends a message in game, and that message will be ...
Definition discordpp.h:607
const char * EnumToString(discordpp::ActivityActionTypes value)
Converts a discordpp::ActivityActionTypes to a string.
Definition discordpp.h:5225
HttpStatusCode
Enum that represents the various HTTP status codes that can be returned.
Definition discordpp.h:207
@ RequestHeaderFieldsTooLarge
RequestHeaderFieldsTooLarge.
Definition discordpp.h:354
@ PayloadTooLarge
PayloadTooLarge.
Definition discordpp.h:315
@ MultiStatus
MultiStatus.
Definition discordpp.h:246
@ VariantAlsoNegotiates
VariantAlsoNegotiates.
Definition discordpp.h:375
@ Gone
Gone.
Definition discordpp.h:306
@ BadGateway
BadGateway.
Definition discordpp.h:363
@ Created
Created.
Definition discordpp.h:228
@ TemporaryRedirect
TemporaryRedirect.
Definition discordpp.h:270
@ ServiceUnavailable
ServiceUnavailable.
Definition discordpp.h:366
@ MovedPermanently
MovedPermanently.
Definition discordpp.h:258
@ PreconditionFailed
PreconditionFailed.
Definition discordpp.h:312
@ RequestTimeout
RequestTimeout.
Definition discordpp.h:300
@ Accepted
Accepted.
Definition discordpp.h:231
@ NonAuthoritativeInfo
NonAuthoritativeInfo.
Definition discordpp.h:234
@ NotFound
NotFound.
Definition discordpp.h:288
@ FailedDependency
FailedDependency.
Definition discordpp.h:339
@ PaymentRequired
PaymentRequired.
Definition discordpp.h:282
@ PreconditionRequired
PreconditionRequired.
Definition discordpp.h:348
@ ResetContent
ResetContent.
Definition discordpp.h:240
@ SwitchingProtocols
SwitchingProtocols.
Definition discordpp.h:216
@ HttpVersionNotSupported
HttpVersionNotSupported.
Definition discordpp.h:372
@ Found
Found.
Definition discordpp.h:261
@ Processing
Processing.
Definition discordpp.h:219
@ None
None.
Definition discordpp.h:210
@ ExpectationFailed
ExpectationFailed.
Definition discordpp.h:327
@ Forbidden
Forbidden.
Definition discordpp.h:285
@ PartialContent
PartialContent.
Definition discordpp.h:243
@ SeeOther
SeeOther.
Definition discordpp.h:264
@ EarlyHints
EarlyHints.
Definition discordpp.h:222
@ LengthRequired
LengthRequired.
Definition discordpp.h:309
@ MethodNotAllowed
MethodNotAllowed.
Definition discordpp.h:291
@ NotExtended
NotExtended.
Definition discordpp.h:384
@ RangeNotSatisfiable
RangeNotSatisfiable.
Definition discordpp.h:324
@ NotImplemented
NotImplemented.
Definition discordpp.h:360
@ BadRequest
BadRequest.
Definition discordpp.h:276
@ Continue
Continue.
Definition discordpp.h:213
@ LoopDetected
LoopDetected.
Definition discordpp.h:381
@ UnsupportedMediaType
UnsupportedMediaType.
Definition discordpp.h:321
@ NetworkAuthorizationRequired
NetworkAuthorizationRequired.
Definition discordpp.h:387
@ ImUsed
ImUsed.
Definition discordpp.h:252
@ MultipleChoices
MultipleChoices.
Definition discordpp.h:255
@ Ok
Ok.
Definition discordpp.h:225
@ TooManyRequests
TooManyRequests.
Definition discordpp.h:351
@ ProxyAuthRequired
ProxyAuthRequired.
Definition discordpp.h:297
@ UnprocessableEntity
UnprocessableEntity.
Definition discordpp.h:333
@ MisdirectedRequest
MisdirectedRequest.
Definition discordpp.h:330
@ PermanentRedirect
PermanentRedirect.
Definition discordpp.h:273
@ NotModified
NotModified.
Definition discordpp.h:267
@ AlreadyReported
AlreadyReported.
Definition discordpp.h:249
@ NoContent
NoContent.
Definition discordpp.h:237
@ Locked
Locked.
Definition discordpp.h:336
@ GatewayTimeout
GatewayTimeout.
Definition discordpp.h:369
@ Unauthorized
Unauthorized.
Definition discordpp.h:279
@ UpgradeRequired
UpgradeRequired.
Definition discordpp.h:345
@ InsufficientStorage
InsufficientStorage.
Definition discordpp.h:378
@ InternalServerError
InternalServerError.
Definition discordpp.h:357
@ TooEarly
TooEarly.
Definition discordpp.h:342
@ Conflict
Conflict.
Definition discordpp.h:303
@ UriTooLong
UriTooLong.
Definition discordpp.h:318
@ NotAcceptable
NotAcceptable.
Definition discordpp.h:294
AuthorizationTokenType
Represents the type of auth token used by the SDK, either the normal tokens produced by the Discord d...
Definition discordpp.h:612
@ Bearer
Bearer.
Definition discordpp.h:618
@ User
User.
Definition discordpp.h:615
ChannelType
Enum that represents the various channel types on Discord.
Definition discordpp.h:412
@ GuildForum
GuildForum.
Definition discordpp.h:451
@ Dm
Dm.
Definition discordpp.h:418
@ Lobby
Lobby.
Definition discordpp.h:457
@ GuildNews
GuildNews.
Definition discordpp.h:430
@ GuildVoice
GuildVoice.
Definition discordpp.h:421
@ GuildPublicThread
GuildPublicThread.
Definition discordpp.h:439
@ GuildNewsThread
GuildNewsThread.
Definition discordpp.h:436
@ GuildDirectory
GuildDirectory.
Definition discordpp.h:448
@ GuildCategory
GuildCategory.
Definition discordpp.h:427
@ GuildStageVoice
GuildStageVoice.
Definition discordpp.h:445
@ GuildMedia
GuildMedia.
Definition discordpp.h:454
@ GuildStore
GuildStore.
Definition discordpp.h:433
@ GuildText
GuildText.
Definition discordpp.h:415
@ GroupDm
GroupDm.
Definition discordpp.h:424
@ EphemeralDm
EphemeralDm.
Definition discordpp.h:460
@ GuildPrivateThread
GuildPrivateThread.
Definition discordpp.h:442
AuthenticationCodeChallengeMethod
Represents the crypto method used to generate a code challenge.
Definition discordpp.h:393
@ S256
S256.
Definition discordpp.h:396
RelationshipType
Enum that represents the possible types of relationships that can exist between two users.
Definition discordpp.h:512
@ PendingIncoming
The current user has received a friend request from the target user, but it is not yet accepted.
Definition discordpp.h:527
@ Implicit
The Implicit type is documented for visibility, but should be unused in the SDK.
Definition discordpp.h:534
@ Suggestion
The Suggestion type is documented for visibility, but should be unused in the SDK.
Definition discordpp.h:537
@ PendingOutgoing
The current user has sent a friend request to the target user, but it is not yet accepted.
Definition discordpp.h:531
@ Blocked
The current user has blocked the target user, and so certain actions such as sending messages between...
Definition discordpp.h:522
@ None
The user has no relationship with the other user.
Definition discordpp.h:515
@ Friend
The user is friends with the other user.
Definition discordpp.h:518
AuthenticationExternalAuthType
Represents the various identity providers that can be used to authenticate a provisional account user...
Definition discordpp.h:623
@ EpicOnlineServicesIdToken
EpicOnlineServicesIdToken.
Definition discordpp.h:632
@ DiscordBotIssuedAccessToken
DiscordBotIssuedAccessToken.
Definition discordpp.h:641
@ EpicOnlineServicesAccessToken
EpicOnlineServicesAccessToken.
Definition discordpp.h:629
@ SteamSessionTicket
SteamSessionTicket.
Definition discordpp.h:635
@ OIDC
OIDC.
Definition discordpp.h:626
@ UnityServicesIdToken
UnityServicesIdToken.
Definition discordpp.h:638
@ PlayStationNetworkIdToken
PlayStationNetworkIdToken.
Definition discordpp.h:647
@ AppleIdToken
AppleIdToken.
Definition discordpp.h:644
LoggingSeverity
Enum that represents the various log levels supported by the SDK.
Definition discordpp.h:651
@ Warning
Warning.
Definition discordpp.h:660
@ Info
Info.
Definition discordpp.h:657
@ None
None.
Definition discordpp.h:666
@ Error
Error.
Definition discordpp.h:663
@ Verbose
Verbose.
Definition discordpp.h:654
RelationshipGroupType
Enum that represents the logical groups of relationships based on online status and game activity.
Definition discordpp.h:671
@ OnlinePlayingGame
Users who are online and currently playing the game.
Definition discordpp.h:674
@ Offline
Users who are offline.
Definition discordpp.h:680
@ OnlineElsewhere
Users who are online but not playing the game.
Definition discordpp.h:677
IntegrationType
Represents the type of integration the app will be installed as.
Definition discordpp.h:400
@ GuildInstall
GuildInstall.
Definition discordpp.h:403
@ UserInstall
UserInstall.
Definition discordpp.h:406
AudioSystem
The Discord Voice audio system to use.
Definition discordpp.h:489
@ Game
Use the game audio system.
Definition discordpp.h:495
@ Standard
Use the standard audio system.
Definition discordpp.h:492
ActivityGamePlatforms
Represents the type of platforms that an activity invite can be accepted on.
Definition discordpp.h:117
@ Embedded
Embedded.
Definition discordpp.h:135
@ Xbox
Xbox.
Definition discordpp.h:123
@ Desktop
Desktop.
Definition discordpp.h:120
@ Samsung
Samsung.
Definition discordpp.h:126
@ PS5
PS5.
Definition discordpp.h:141
@ PS4
PS4.
Definition discordpp.h:138
@ IOS
IOS.
Definition discordpp.h:129
@ Android
Android.
Definition discordpp.h:132
ActivityTypes
Discord RichPresence supports multiple types of activities that a user can be doing.
Definition discordpp.h:77
@ Watching
Watching.
Definition discordpp.h:89
@ Competing
Competing.
Definition discordpp.h:95
@ HangStatus
HangStatus.
Definition discordpp.h:98
@ Listening
Listening.
Definition discordpp.h:86
@ Streaming
Streaming.
Definition discordpp.h:83
@ CustomStatus
CustomStatus.
Definition discordpp.h:92
@ Playing
Playing.
Definition discordpp.h:80
StatusType
Enum that specifies the various online statuses for a user.
Definition discordpp.h:569
@ Blocked
Blocked.
Definition discordpp.h:578
@ Online
The user is online and recently active.
Definition discordpp.h:572
@ Dnd
The user is online, but wishes to suppress notifications for the time being.
Definition discordpp.h:585
@ Unknown
Unknown.
Definition discordpp.h:594
@ Invisible
The user is online, but wishes to appear as if they are offline to other users.
Definition discordpp.h:588
@ Offline
The user is offline and not connected to Discord.
Definition discordpp.h:575
@ Streaming
The user is online and is actively streaming content.
Definition discordpp.h:591
@ Idle
The user is online, but has not been active for a while and may be away from their computer.
Definition discordpp.h:582
StatusDisplayTypes
Controls which Discord RichPresence field is displayed in the user's status.
Definition discordpp.h:104
@ Details
Details.
Definition discordpp.h:113
@ State
State.
Definition discordpp.h:110
@ Name
Name.
Definition discordpp.h:107
ExternalIdentityProviderType
The type of external identity provider.
Definition discordpp.h:541
@ EpicOnlineServices
EpicOnlineServices.
Definition discordpp.h:547
@ OIDC
OIDC.
Definition discordpp.h:544
@ Steam
Steam.
Definition discordpp.h:550
@ None
None.
Definition discordpp.h:559
@ Unity
Unity.
Definition discordpp.h:553
@ Unknown
Unknown.
Definition discordpp.h:562
@ DiscordBot
DiscordBot.
Definition discordpp.h:556
void RunCallbacks()
Definition discordpp.h:29
AudioModeType
Represents whether a voice call is using push to talk or auto voice detection.
Definition discordpp.h:499
@ MODE_PTT
MODE_PTT.
Definition discordpp.h:508
@ MODE_VAD
MODE_VAD.
Definition discordpp.h:505
@ MODE_UNINIT
MODE_UNINIT.
Definition discordpp.h:502
ErrorType
Enum representing various types of errors the SDK returns.
Definition discordpp.h:145
@ HTTPError
An HTTP call was made to Discord's servers but a non success HTTP status code was returned....
Definition discordpp.h:160
@ NetworkError
The user is offline or there was some network issue that prevented an underlying HTTP call from succe...
Definition discordpp.h:152
@ AuthorizationFailed
An authorization function failed, but not necessarily as the result of an HTTP call that returned an ...
Definition discordpp.h:194
@ ClientNotReady
An operation such as sending a friend request or joining a lobby was attempted but the Client is not ...
Definition discordpp.h:170
@ None
No error, the operation was successful.
Definition discordpp.h:148
@ Aborted
The user or developer aborted an operation, such as an authorization flow.
Definition discordpp.h:189
@ RPCError
An RPC call was made to Discord's desktop application, but it returned a non-success result....
Definition discordpp.h:199
@ ValidationError
Used when an SDK method is called but the inputs don't pass local validation. For example if one atte...
Definition discordpp.h:186
@ ClientDestroyed
The Client has been destroyed and so this operation cannot complete.
Definition discordpp.h:176
@ Disabled
An operation was temporarily disabled for stability reasons.
Definition discordpp.h:173
DiscordObjectState
Represents the memory state of a Discord object.
Definition discordpp.h:19
@ Invalid
The object has been freed.
Definition discordpp.h:21
@ Owned
The object is owned by the C++ wrapper and methods can be called on it.
Definition discordpp.h:23
AdditionalContentType
Represents the type of additional content contained in a message.
Definition discordpp.h:464
@ Sticker
Sticker.
Definition discordpp.h:485
@ VoiceMessage
VoiceMessage.
Definition discordpp.h:476
@ Other
Other.
Definition discordpp.h:467
@ Poll
Poll.
Definition discordpp.h:473
@ Thread
Thread.
Definition discordpp.h:479
@ Attachment
Attachment.
Definition discordpp.h:470
@ Embed
Embed.
Definition discordpp.h:482
ActivityActionTypes
ActivityActionTypes represents the type of invite being sent to a user.
Definition discordpp.h:41
@ Invalid
Invalid.
Definition discordpp.h:44
@ Join
Join.
Definition discordpp.h:47
@ JoinRequest
JoinRequest.
Definition discordpp.h:50