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
490
493
496};
497
499enum class AudioSystem {
500
503
505 Game = 1,
506};
507
509enum class AudioModeType {
510
513
516
519};
520
523
525 None = 0,
526
529
533
538
542
545
548};
549
552
554 OIDC = 0,
555
558
560 Steam = 2,
561
563 Unity = 3,
564
567
569 None = 5,
570
573};
574
579enum class StatusType {
580
583
586
589
592 Idle = 3,
593
595 Dnd = 4,
596
599
602
605};
606
619
623
625 User = 0,
626
629};
630
659
661enum class LoggingSeverity {
662
665
667 Info = 2,
668
671
673 Error = 4,
674
676 None = 5,
677};
678
692class ActivityInvite;
693class ActivityAssets;
694class ActivityTimestamps;
695class ActivityParty;
696class ActivitySecrets;
697class ActivityButton;
698class Activity;
699class ClientResult;
700class AuthorizationCodeChallenge;
701class AuthorizationCodeVerifier;
702class AuthorizationArgs;
703class DeviceAuthorizationArgs;
704class VoiceStateHandle;
705class VADThresholdSettings;
706class Call;
707class ChannelHandle;
708class GuildMinimal;
709class GuildChannel;
710class LinkedLobby;
711class LinkedChannel;
712class RelationshipHandle;
713class UserApplicationProfileHandle;
714class UserHandle;
715class LobbyMemberHandle;
716class LobbyHandle;
717class AdditionalContent;
718class MessageHandle;
719class AudioDevice;
720class VoiceSettings;
721class UserMessageSummary;
722class ClientCreateOptions;
723class Client;
724class CallInfoHandle;
725
731 mutable Discord_ActivityInvite instance_{};
734
735public:
737 Discord_ActivityInvite* instance() const { return &instance_; }
740 explicit ActivityInvite(Discord_ActivityInvite instance, DiscordObjectState state);
750 operator bool() const { return state_ != DiscordObjectState::Invalid; }
751
756
757 explicit ActivityInvite();
758
760 void Drop();
762
764 uint64_t SenderId() const;
766 void SetSenderId(uint64_t SenderId);
767
769 uint64_t ChannelId() const;
771 void SetChannelId(uint64_t ChannelId);
772
774 uint64_t MessageId() const;
776 void SetMessageId(uint64_t MessageId);
777
782
784 uint64_t ApplicationId() const;
787
790 uint64_t ParentApplicationId() const;
793
795 std::string PartyId() const;
797 void SetPartyId(std::string PartyId);
798
800 std::string SessionId() const;
802 void SetSessionId(std::string SessionId);
803
806 bool IsValid() const;
808 void SetIsValid(bool IsValid);
809};
810
829 mutable Discord_ActivityAssets instance_{};
832
833public:
835 Discord_ActivityAssets* instance() const { return &instance_; }
838 explicit ActivityAssets(Discord_ActivityAssets instance, DiscordObjectState state);
848 operator bool() const { return state_ != DiscordObjectState::Invalid; }
849
854
855 explicit ActivityAssets();
856
858 void Drop();
860
865 std::optional<std::string> LargeImage() const;
867 void SetLargeImage(std::optional<std::string> LargeImage);
868
872 std::optional<std::string> LargeText() const;
874 void SetLargeText(std::optional<std::string> LargeText);
875
879 std::optional<std::string> LargeUrl() const;
881 void SetLargeUrl(std::optional<std::string> LargeUrl);
882
886 std::optional<std::string> SmallImage() const;
888 void SetSmallImage(std::optional<std::string> SmallImage);
889
893 std::optional<std::string> SmallText() const;
895 void SetSmallText(std::optional<std::string> SmallText);
896
900 std::optional<std::string> SmallUrl() const;
902 void SetSmallUrl(std::optional<std::string> SmallUrl);
903
908 std::optional<std::string> InviteCoverImage() const;
910 void SetInviteCoverImage(std::optional<std::string> InviteCoverImage);
911};
912
916 mutable Discord_ActivityTimestamps instance_{};
919
920public:
922 Discord_ActivityTimestamps* instance() const { return &instance_; }
925 explicit ActivityTimestamps(Discord_ActivityTimestamps instance, DiscordObjectState state);
935 operator bool() const { return state_ != DiscordObjectState::Invalid; }
936
941
942 explicit ActivityTimestamps();
943
945 void Drop();
947
953 uint64_t Start() const;
955 void SetStart(uint64_t Start);
956
962 uint64_t End() const;
964 void SetEnd(uint64_t End);
965};
966
970 mutable Discord_ActivityParty instance_{};
973
974public:
976 Discord_ActivityParty* instance() const { return &instance_; }
979 explicit ActivityParty(Discord_ActivityParty instance, DiscordObjectState state);
983 ActivityParty(ActivityParty&& other) noexcept;
987 static const ActivityParty nullobj;
989 operator bool() const { return state_ != DiscordObjectState::Invalid; }
990
995
996 explicit ActivityParty();
997
999 void Drop();
1001
1008 std::string Id() const;
1010 void SetId(std::string Id);
1011
1013 int32_t CurrentSize() const;
1016
1019 int32_t MaxSize() const;
1021 void SetMaxSize(int32_t MaxSize);
1022
1027};
1028
1032 mutable Discord_ActivitySecrets instance_{};
1035
1036public:
1038 Discord_ActivitySecrets* instance() const { return &instance_; }
1041 explicit ActivitySecrets(Discord_ActivitySecrets instance, DiscordObjectState state);
1051 operator bool() const { return state_ != DiscordObjectState::Invalid; }
1052
1057
1058 explicit ActivitySecrets();
1059
1061 void Drop();
1063
1068 std::string Join() const;
1070 void SetJoin(std::string Join);
1071};
1072
1076 mutable Discord_ActivityButton instance_{};
1079
1080public:
1082 Discord_ActivityButton* instance() const { return &instance_; }
1085 explicit ActivityButton(Discord_ActivityButton instance, DiscordObjectState state);
1095 operator bool() const { return state_ != DiscordObjectState::Invalid; }
1096
1101
1102 explicit ActivityButton();
1103
1105 void Drop();
1107
1109 std::string Label() const;
1111 void SetLabel(std::string Label);
1112
1114 std::string Url() const;
1116 void SetUrl(std::string Url);
1117};
1118
1301 mutable Discord_Activity instance_{};
1304
1305public:
1307 Discord_Activity* instance() const { return &instance_; }
1310 explicit Activity(Discord_Activity instance, DiscordObjectState state);
1311 ~Activity();
1314 Activity(Activity&& other) noexcept;
1316 Activity& operator=(Activity&& other) noexcept;
1318 static const Activity nullobj;
1320 operator bool() const { return state_ != DiscordObjectState::Invalid; }
1321
1323 Activity(const Activity& arg0);
1326
1327 explicit Activity();
1328
1330 void Drop();
1332
1335
1337 bool Equals(discordpp::Activity other) const;
1338
1340 std::vector<discordpp::ActivityButton> GetButtons() const;
1341
1345 std::string Name() const;
1347 void SetName(std::string Name);
1348
1355
1359 std::optional<discordpp::StatusDisplayTypes> StatusDisplayType() const;
1361 void SetStatusDisplayType(std::optional<discordpp::StatusDisplayTypes> StatusDisplayType);
1362
1367 std::optional<std::string> State() const;
1369 void SetState(std::optional<std::string> State);
1370
1375 std::optional<std::string> StateUrl() const;
1377 void SetStateUrl(std::optional<std::string> StateUrl);
1378
1383 std::optional<std::string> Details() const;
1385 void SetDetails(std::optional<std::string> Details);
1386
1391 std::optional<std::string> DetailsUrl() const;
1393 void SetDetailsUrl(std::optional<std::string> DetailsUrl);
1394
1399 std::optional<uint64_t> ApplicationId() const;
1401 void SetApplicationId(std::optional<uint64_t> ApplicationId);
1402
1408 std::optional<uint64_t> ParentApplicationId() const;
1410 void SetParentApplicationId(std::optional<uint64_t> ParentApplicationId);
1411
1413 std::optional<discordpp::ActivityAssets> Assets() const;
1415 void SetAssets(std::optional<discordpp::ActivityAssets> Assets);
1416
1420 std::optional<discordpp::ActivityTimestamps> Timestamps() const;
1422 void SetTimestamps(std::optional<discordpp::ActivityTimestamps> Timestamps);
1423
1426 std::optional<discordpp::ActivityParty> Party() const;
1428 void SetParty(std::optional<discordpp::ActivityParty> Party);
1429
1432 std::optional<discordpp::ActivitySecrets> Secrets() const;
1434 void SetSecrets(std::optional<discordpp::ActivitySecrets> Secrets);
1435
1444};
1445
1457 mutable Discord_ClientResult instance_{};
1460
1461public:
1463 Discord_ClientResult* instance() const { return &instance_; }
1466 explicit ClientResult(Discord_ClientResult instance, DiscordObjectState state);
1467 ~ClientResult();
1470 ClientResult(ClientResult&& other) noexcept;
1474 static const ClientResult nullobj;
1476 operator bool() const { return state_ != DiscordObjectState::Invalid; }
1477
1482
1484 void Drop();
1486
1488 std::string ToString() const;
1489
1494
1496 std::string Error() const;
1498 void SetError(std::string Error);
1499
1508 int32_t ErrorCode() const;
1511
1518
1526 std::string ResponseBody() const;
1529
1531 bool Successful() const;
1534
1536 bool Retryable() const;
1539
1542 float RetryAfter() const;
1545};
1546
1550 mutable Discord_AuthorizationCodeChallenge instance_{};
1553
1554public:
1556 Discord_AuthorizationCodeChallenge* instance() const { return &instance_; }
1559 explicit AuthorizationCodeChallenge(Discord_AuthorizationCodeChallenge instance,
1560 DiscordObjectState state);
1570 operator bool() const { return state_ != DiscordObjectState::Invalid; }
1571
1576
1577 explicit AuthorizationCodeChallenge();
1578
1580 void Drop();
1582
1587
1589 std::string Challenge() const;
1591 void SetChallenge(std::string Challenge);
1592};
1593
1597 mutable Discord_AuthorizationCodeVerifier instance_{};
1600
1601public:
1603 Discord_AuthorizationCodeVerifier* instance() const { return &instance_; }
1606 explicit AuthorizationCodeVerifier(Discord_AuthorizationCodeVerifier instance,
1607 DiscordObjectState state);
1617 operator bool() const { return state_ != DiscordObjectState::Invalid; }
1618
1623
1625 void Drop();
1627
1632
1634 std::string Verifier() const;
1636 void SetVerifier(std::string Verifier);
1637};
1638
1642 mutable Discord_AuthorizationArgs instance_{};
1645
1646public:
1648 Discord_AuthorizationArgs* instance() const { return &instance_; }
1651 explicit AuthorizationArgs(Discord_AuthorizationArgs instance, DiscordObjectState state);
1661 operator bool() const { return state_ != DiscordObjectState::Invalid; }
1662
1667
1668 explicit AuthorizationArgs();
1669
1671 void Drop();
1673
1676 uint64_t ClientId() const;
1678 void SetClientId(uint64_t ClientId);
1679
1692 std::string Scopes() const;
1694 void SetScopes(std::string Scopes);
1695
1701 std::optional<std::string> State() const;
1703 void SetState(std::optional<std::string> State);
1704
1709 std::optional<std::string> Nonce() const;
1711 void SetNonce(std::optional<std::string> Nonce);
1712
1718 std::optional<discordpp::AuthorizationCodeChallenge> CodeChallenge() const;
1720 void SetCodeChallenge(std::optional<discordpp::AuthorizationCodeChallenge> CodeChallenge);
1721
1725 std::optional<discordpp::IntegrationType> IntegrationType() const;
1727 void SetIntegrationType(std::optional<discordpp::IntegrationType> IntegrationType);
1728
1740 std::optional<std::string> CustomSchemeParam() const;
1742 void SetCustomSchemeParam(std::optional<std::string> CustomSchemeParam);
1743};
1744
1748 mutable Discord_DeviceAuthorizationArgs instance_{};
1751
1752public:
1754 Discord_DeviceAuthorizationArgs* instance() const { return &instance_; }
1757 explicit DeviceAuthorizationArgs(Discord_DeviceAuthorizationArgs instance,
1758 DiscordObjectState state);
1768 operator bool() const { return state_ != DiscordObjectState::Invalid; }
1769
1774
1775 explicit DeviceAuthorizationArgs();
1776
1778 void Drop();
1780
1783 uint64_t ClientId() const;
1785 void SetClientId(uint64_t ClientId);
1786
1799 std::string Scopes() const;
1801 void SetScopes(std::string Scopes);
1802};
1803
1816 mutable Discord_VoiceStateHandle instance_{};
1819
1820public:
1822 Discord_VoiceStateHandle* instance() const { return &instance_; }
1825 explicit VoiceStateHandle(Discord_VoiceStateHandle instance, DiscordObjectState state);
1835 operator bool() const { return state_ != DiscordObjectState::Invalid; }
1836
1841
1843 void Drop();
1845
1848 bool SelfDeaf() const;
1849
1852 bool SelfMute() const;
1853};
1854
1858 mutable Discord_VADThresholdSettings instance_{};
1861
1862public:
1864 Discord_VADThresholdSettings* instance() const { return &instance_; }
1867 explicit VADThresholdSettings(Discord_VADThresholdSettings instance, DiscordObjectState state);
1877 operator bool() const { return state_ != DiscordObjectState::Invalid; }
1878
1881
1883 void Drop();
1885
1888 float VadThreshold() const;
1891
1894 bool Automatic() const;
1897};
1898
1900class Call {
1902 mutable Discord_Call instance_{};
1905
1906public:
1928
1930 enum class Status {
1931
1934
1937
1940
1943
1946
1949
1952 };
1953
1955 using OnVoiceStateChanged = std::function<void(uint64_t userId)>;
1956
1958 using OnParticipantChanged = std::function<void(uint64_t userId, bool added)>;
1959
1961 using OnSpeakingStatusChanged = std::function<void(uint64_t userId, bool isPlayingSound)>;
1962
1964 using OnStatusChanged = std::function<
1965 void(discordpp::Call::Status status, discordpp::Call::Error error, int32_t errorDetail)>;
1967 Discord_Call* instance() const { return &instance_; }
1970 explicit Call(Discord_Call instance, DiscordObjectState state);
1971 ~Call();
1974 Call(Call&& other) noexcept;
1976 Call& operator=(Call&& other) noexcept;
1978 static const Call nullobj;
1980 operator bool() const { return state_ != DiscordObjectState::Invalid; }
1981
1983 Call(const Call& other);
1985 Call& operator=(const Call& other);
1986
1988 void Drop();
1990
1992 static std::string ErrorToString(discordpp::Call::Error type);
1993
1997
1999 uint64_t GetChannelId() const;
2000
2002 uint64_t GetGuildId() const;
2003
2005 bool GetLocalMute(uint64_t userId);
2006
2008 std::vector<uint64_t> GetParticipants() const;
2009
2014 float GetParticipantVolume(uint64_t userId);
2015
2019
2023
2026
2029
2034
2038
2044 std::optional<discordpp::VoiceStateHandle> GetVoiceStateHandle(uint64_t userId) const;
2045
2052
2056 void SetLocalMute(uint64_t userId, bool mute);
2057
2065
2068
2073 void SetParticipantVolume(uint64_t userId, float volume);
2074
2078 void SetPTTActive(bool active);
2079
2084 void SetPTTReleaseDelay(uint32_t releaseDelayMs);
2085
2089 void SetSelfDeaf(bool deaf);
2090
2093 void SetSelfMute(bool mute);
2094
2101
2105
2112 void SetVADThreshold(bool automatic, float threshold);
2113
2115 static std::string StatusToString(discordpp::Call::Status type);
2116};
2117
2129 mutable Discord_ChannelHandle instance_{};
2132
2133public:
2135 Discord_ChannelHandle* instance() const { return &instance_; }
2138 explicit ChannelHandle(Discord_ChannelHandle instance, DiscordObjectState state);
2142 ChannelHandle(ChannelHandle&& other) noexcept;
2148 operator bool() const { return state_ != DiscordObjectState::Invalid; }
2149
2154
2156 void Drop();
2158
2160 uint64_t Id() const;
2161
2166 std::string Name() const;
2167
2170 std::vector<uint64_t> Recipients() const;
2171
2174};
2175
2180 mutable Discord_GuildMinimal instance_{};
2183
2184public:
2186 Discord_GuildMinimal* instance() const { return &instance_; }
2189 explicit GuildMinimal(Discord_GuildMinimal instance, DiscordObjectState state);
2190 ~GuildMinimal();
2193 GuildMinimal(GuildMinimal&& other) noexcept;
2197 static const GuildMinimal nullobj;
2199 operator bool() const { return state_ != DiscordObjectState::Invalid; }
2200
2205
2207 void Drop();
2209
2211 uint64_t Id() const;
2213 void SetId(uint64_t Id);
2214
2216 std::string Name() const;
2218 void SetName(std::string Name);
2219};
2220
2225 mutable Discord_GuildChannel instance_{};
2228
2229public:
2231 Discord_GuildChannel* instance() const { return &instance_; }
2234 explicit GuildChannel(Discord_GuildChannel instance, DiscordObjectState state);
2235 ~GuildChannel();
2238 GuildChannel(GuildChannel&& other) noexcept;
2242 static const GuildChannel nullobj;
2244 operator bool() const { return state_ != DiscordObjectState::Invalid; }
2245
2250
2252 void Drop();
2254
2256 uint64_t Id() const;
2258 void SetId(uint64_t Id);
2259
2261 std::string Name() const;
2263 void SetName(std::string Name);
2264
2269
2271 int32_t Position() const;
2273 void SetPosition(int32_t Position);
2274
2276 std::optional<uint64_t> ParentId() const;
2278 void SetParentId(std::optional<uint64_t> ParentId);
2279
2290 bool IsLinkable() const;
2293
2310
2313 std::optional<discordpp::LinkedLobby> LinkedLobby() const;
2315 void SetLinkedLobby(std::optional<discordpp::LinkedLobby> LinkedLobby);
2316};
2317
2321 mutable Discord_LinkedLobby instance_{};
2324
2325public:
2327 Discord_LinkedLobby* instance() const { return &instance_; }
2330 explicit LinkedLobby(Discord_LinkedLobby instance, DiscordObjectState state);
2331 ~LinkedLobby();
2334 LinkedLobby(LinkedLobby&& other) noexcept;
2338 static const LinkedLobby nullobj;
2340 operator bool() const { return state_ != DiscordObjectState::Invalid; }
2341
2346
2347 explicit LinkedLobby();
2348
2350 void Drop();
2352
2354 uint64_t ApplicationId() const;
2357
2359 uint64_t LobbyId() const;
2361 void SetLobbyId(uint64_t LobbyId);
2362};
2363
2367 mutable Discord_LinkedChannel instance_{};
2370
2371public:
2373 Discord_LinkedChannel* instance() const { return &instance_; }
2376 explicit LinkedChannel(Discord_LinkedChannel instance, DiscordObjectState state);
2380 LinkedChannel(LinkedChannel&& other) noexcept;
2386 operator bool() const { return state_ != DiscordObjectState::Invalid; }
2387
2392
2394 void Drop();
2396
2398 uint64_t Id() const;
2400 void SetId(uint64_t Id);
2401
2403 std::string Name() const;
2405 void SetName(std::string Name);
2406
2408 uint64_t GuildId() const;
2410 void SetGuildId(uint64_t GuildId);
2411};
2412
2449 mutable Discord_RelationshipHandle instance_{};
2452
2453public:
2455 Discord_RelationshipHandle* instance() const { return &instance_; }
2458 explicit RelationshipHandle(Discord_RelationshipHandle instance, DiscordObjectState state);
2468 operator bool() const { return state_ != DiscordObjectState::Invalid; }
2469
2474
2476 void Drop();
2478
2481
2484
2486 uint64_t Id() const;
2487
2489 bool IsSpamRequest() const;
2490
2493 std::optional<discordpp::UserHandle> User() const;
2494};
2495
2506 mutable Discord_UserApplicationProfileHandle instance_{};
2509
2510public:
2512 Discord_UserApplicationProfileHandle* instance() const { return &instance_; }
2515 explicit UserApplicationProfileHandle(Discord_UserApplicationProfileHandle instance,
2516 DiscordObjectState state);
2526 operator bool() const { return state_ != DiscordObjectState::Invalid; }
2527
2532
2534 void Drop();
2536
2538 std::string AvatarHash() const;
2539
2541 std::string Metadata() const;
2542
2544 std::optional<std::string> ProviderId() const;
2545
2547 std::string ProviderIssuedUserId() const;
2548
2551
2553 std::string Username() const;
2554};
2555
2568 mutable Discord_UserHandle instance_{};
2571
2572public:
2574 enum class AvatarType {
2575
2577 Gif = 0,
2578
2580 Webp = 1,
2581
2583 Png = 2,
2584
2586 Jpeg = 3,
2587 };
2588
2589 Discord_UserHandle* instance() const { return &instance_; }
2592 explicit UserHandle(Discord_UserHandle instance, DiscordObjectState state);
2593 ~UserHandle();
2596 UserHandle(UserHandle&& other) noexcept;
2598 UserHandle& operator=(UserHandle&& other) noexcept;
2600 static const UserHandle nullobj;
2602 operator bool() const { return state_ != DiscordObjectState::Invalid; }
2603
2608
2610 void Drop();
2612
2614 std::optional<std::string> Avatar() const;
2615
2618
2624 discordpp::UserHandle::AvatarType staticType) const;
2625
2628 std::string DisplayName() const;
2629
2639 std::optional<discordpp::Activity> GameActivity() const;
2640
2649 std::optional<std::string> GlobalName() const;
2650
2654 uint64_t Id() const;
2655
2657 bool IsProvisional() const;
2658
2662
2665
2669 std::vector<discordpp::UserApplicationProfileHandle> UserApplicationProfiles() const;
2670
2677 std::string Username() const;
2678};
2679
2698 mutable Discord_LobbyMemberHandle instance_{};
2701
2702public:
2704 Discord_LobbyMemberHandle* instance() const { return &instance_; }
2707 explicit LobbyMemberHandle(Discord_LobbyMemberHandle instance, DiscordObjectState state);
2717 operator bool() const { return state_ != DiscordObjectState::Invalid; }
2718
2723
2725 void Drop();
2727
2734 bool CanLinkLobby() const;
2735
2737 bool Connected() const;
2738
2740 uint64_t Id() const;
2741
2747 std::unordered_map<std::string, std::string> Metadata() const;
2748
2750 std::optional<discordpp::UserHandle> User() const;
2751};
2752
2843 mutable Discord_LobbyHandle instance_{};
2846
2847public:
2849 Discord_LobbyHandle* instance() const { return &instance_; }
2852 explicit LobbyHandle(Discord_LobbyHandle instance, DiscordObjectState state);
2853 ~LobbyHandle();
2856 LobbyHandle(LobbyHandle&& other) noexcept;
2860 static const LobbyHandle nullobj;
2862 operator bool() const { return state_ != DiscordObjectState::Invalid; }
2863
2868
2870 void Drop();
2872
2878 std::optional<discordpp::CallInfoHandle> GetCallInfoHandle() const;
2879
2882 std::optional<discordpp::LobbyMemberHandle> GetLobbyMemberHandle(uint64_t memberId) const;
2883
2885 uint64_t Id() const;
2886
2888 std::optional<discordpp::LinkedChannel> LinkedChannel() const;
2889
2891 std::vector<uint64_t> LobbyMemberIds() const;
2892
2894 std::vector<discordpp::LobbyMemberHandle> LobbyMembers() const;
2895
2900 std::unordered_map<std::string, std::string> Metadata() const;
2901};
2902
2907 mutable Discord_AdditionalContent instance_{};
2910
2911public:
2913 Discord_AdditionalContent* instance() const { return &instance_; }
2916 explicit AdditionalContent(Discord_AdditionalContent instance, DiscordObjectState state);
2926 operator bool() const { return state_ != DiscordObjectState::Invalid; }
2927
2932
2933 explicit AdditionalContent();
2934
2936 void Drop();
2938
2941
2944
2949
2952 std::optional<std::string> Title() const;
2954 void SetTitle(std::optional<std::string> Title);
2955
2958 uint8_t Count() const;
2960 void SetCount(uint8_t Count);
2961};
2962
3019 mutable Discord_MessageHandle instance_{};
3022
3023public:
3025 Discord_MessageHandle* instance() const { return &instance_; }
3028 explicit MessageHandle(Discord_MessageHandle instance, DiscordObjectState state);
3032 MessageHandle(MessageHandle&& other) noexcept;
3038 operator bool() const { return state_ != DiscordObjectState::Invalid; }
3039
3044
3046 void Drop();
3048
3051 std::optional<discordpp::AdditionalContent> AdditionalContent() const;
3052
3057 std::optional<std::string> AdditionalName() const;
3058
3065 std::optional<uint64_t> ApplicationId() const;
3066
3068 std::optional<discordpp::UserHandle> Author() const;
3069
3071 uint64_t AuthorId() const;
3072
3074 std::optional<discordpp::ChannelHandle> Channel() const;
3075
3077 uint64_t ChannelId() const;
3078
3084 std::string Content() const;
3085
3088 std::optional<discordpp::DisclosureTypes> DisclosureType() const;
3089
3093 uint64_t EditedTimestamp() const;
3094
3096 uint64_t Id() const;
3097
3099 std::optional<discordpp::LobbyHandle> Lobby() const;
3100
3106 std::unordered_map<std::string, std::string> Metadata() const;
3107
3114 std::unordered_map<std::string, std::string> ModerationMetadata() const;
3115
3121 std::string RawContent() const;
3122
3125 std::optional<discordpp::UserHandle> Recipient() const;
3126
3129 uint64_t RecipientId() const;
3130
3134 bool SentFromGame() const;
3135
3137 uint64_t SentTimestamp() const;
3138};
3139
3146 mutable Discord_AudioDevice instance_{};
3149
3150public:
3152 Discord_AudioDevice* instance() const { return &instance_; }
3155 explicit AudioDevice(Discord_AudioDevice instance, DiscordObjectState state);
3156 ~AudioDevice();
3159 AudioDevice(AudioDevice&& other) noexcept;
3163 static const AudioDevice nullobj;
3165 operator bool() const { return state_ != DiscordObjectState::Invalid; }
3166
3171
3173 void Drop();
3175
3178
3180 std::string Id() const;
3182 void SetId(std::string Id);
3183
3185 std::string Name() const;
3187 void SetName(std::string Name);
3188
3190 bool IsDefault() const;
3193};
3194
3201 mutable Discord_VoiceSettings instance_{};
3204
3205public:
3207 Discord_VoiceSettings* instance() const { return &instance_; }
3210 explicit VoiceSettings(Discord_VoiceSettings instance, DiscordObjectState state);
3214 VoiceSettings(VoiceSettings&& other) noexcept;
3220 operator bool() const { return state_ != DiscordObjectState::Invalid; }
3221
3226
3228 void Drop();
3230
3232 bool SelfMute() const;
3235
3237 bool SelfDeaf() const;
3240
3245
3248 std::string PttKey() const;
3250 void SetPttKey(std::string PttKey);
3251
3253 float InputVolume() const;
3256
3258 float OutputVolume() const;
3261
3266
3268 bool EchoCancellation() const;
3271
3273 bool NoiseSuppression() const;
3276
3278 bool NoiseCancellation() const;
3281};
3282
3286 mutable Discord_UserMessageSummary instance_{};
3289
3290public:
3292 Discord_UserMessageSummary* instance() const { return &instance_; }
3295 explicit UserMessageSummary(Discord_UserMessageSummary instance, DiscordObjectState state);
3305 operator bool() const { return state_ != DiscordObjectState::Invalid; }
3306
3311
3313 void Drop();
3315
3317 uint64_t LastMessageId() const;
3318
3320 uint64_t UserId() const;
3321};
3322
3328 mutable Discord_ClientCreateOptions instance_{};
3331
3332public:
3334 Discord_ClientCreateOptions* instance() const { return &instance_; }
3337 explicit ClientCreateOptions(Discord_ClientCreateOptions instance, DiscordObjectState state);
3347 operator bool() const { return state_ != DiscordObjectState::Invalid; }
3348
3353
3354 explicit ClientCreateOptions();
3355
3357 void Drop();
3359
3361 std::string WebBase() const;
3363 void SetWebBase(std::string WebBase);
3364
3366 std::string ApiBase() const;
3368 void SetApiBase(std::string ApiBase);
3369
3381
3394
3397 std::optional<uint64_t> CpuAffinityMask() const;
3399 void SetCpuAffinityMask(std::optional<uint64_t> CpuAffinityMask);
3400};
3401
3406class Client {
3408 mutable Discord_Client instance_{};
3411
3412public:
3420 enum class Error {
3421
3423 None = 0,
3424
3427
3430
3433 };
3434
3449 enum class Status {
3450
3453
3456
3459
3462
3465
3468
3471 };
3472
3474 enum class Thread {
3475
3478
3481
3484 };
3485
3487 using EndCallCallback = std::function<void()>;
3488
3490 using EndCallsCallback = std::function<void()>;
3491
3493 using GetCurrentInputDeviceCallback = std::function<void(discordpp::AudioDevice device)>;
3494
3496 using GetCurrentOutputDeviceCallback = std::function<void(discordpp::AudioDevice device)>;
3497
3500 std::function<void(std::vector<discordpp::AudioDevice> devices)>;
3501
3504 std::function<void(std::vector<discordpp::AudioDevice> devices)>;
3505
3508 std::function<void(discordpp::ClientResult result, discordpp::VoiceSettings settings)>;
3509
3512 std::function<void(std::vector<discordpp::AudioDevice> inputDevices,
3513 std::vector<discordpp::AudioDevice> outputDevices)>;
3514
3516 using SetInputDeviceCallback = std::function<void(discordpp::ClientResult result)>;
3517
3519 using NoAudioInputCallback = std::function<void(bool inputDetected)>;
3520
3522 using SetOutputDeviceCallback = std::function<void(discordpp::ClientResult result)>;
3523
3526 std::function<void(uint64_t lobbyId, uint64_t memberId, bool added)>;
3527
3529 using VoiceSettingsUpdatedCallback = std::function<void(discordpp::VoiceSettings settings)>;
3530
3534 using UserAudioReceivedCallback = std::function<void(uint64_t userId,
3535 int16_t* data,
3536 uint64_t samplesPerChannel,
3537 int32_t sampleRate,
3538 uint64_t channels,
3539 bool& outShouldMute)>;
3540
3544 using UserAudioCapturedCallback = std::function<
3545 void(int16_t* data, uint64_t samplesPerChannel, int32_t sampleRate, uint64_t channels)>;
3546
3553 using AuthorizationCallback = std::function<
3554 void(discordpp::ClientResult result, std::string code, std::string redirectUri)>;
3555
3558 std::function<void(discordpp::ClientResult result,
3559 std::string accessToken,
3561 int32_t expiresIn,
3562 std::string scopes)>;
3563
3566 std::function<void(discordpp::ClientResult result, uint64_t id, std::string name)>;
3567
3569 using TokenExchangeCallback = std::function<void(discordpp::ClientResult result,
3570 std::string accessToken,
3571 std::string refreshToken,
3573 int32_t expiresIn,
3574 std::string scopes)>;
3575
3581 using AuthorizeRequestCallback = std::function<void()>;
3582
3584 using RevokeTokenCallback = std::function<void(discordpp::ClientResult result)>;
3585
3587 using AuthorizeDeviceScreenClosedCallback = std::function<void()>;
3588
3590 using TokenExpirationCallback = std::function<void()>;
3591
3594 std::function<void(discordpp::ClientResult result)>;
3595
3598 std::function<void(discordpp::ClientResult result)>;
3599
3602 using UpdateTokenCallback = std::function<void(discordpp::ClientResult result)>;
3603
3605 using DeleteUserMessageCallback = std::function<void(discordpp::ClientResult result)>;
3606
3608 using EditUserMessageCallback = std::function<void(discordpp::ClientResult result)>;
3609
3612 std::function<void(discordpp::ClientResult result,
3613 std::vector<discordpp::MessageHandle> messages)>;
3614
3617 std::function<void(discordpp::ClientResult result,
3618 std::vector<discordpp::UserMessageSummary> summaries)>;
3619
3622 std::function<void(discordpp::ClientResult result,
3623 std::vector<discordpp::MessageHandle> messages)>;
3624
3626 using ProvisionalUserMergeRequiredCallback = std::function<void()>;
3627
3629 using OpenMessageInDiscordCallback = std::function<void(discordpp::ClientResult result)>;
3630
3635 std::function<void(discordpp::ClientResult result, uint64_t messageId)>;
3636
3638 using MessageCreatedCallback = std::function<void(uint64_t messageId)>;
3639
3641 using MessageDeletedCallback = std::function<void(uint64_t messageId, uint64_t channelId)>;
3642
3644 using MessageUpdatedCallback = std::function<void(uint64_t messageId)>;
3645
3648 std::function<void(std::string message, discordpp::LoggingSeverity severity)>;
3649
3652 std::function<void(discordpp::ClientResult result)>;
3653
3658 using OnStatusChanged = std::function<
3659 void(discordpp::Client::Status status, discordpp::Client::Error error, int32_t errorDetail)>;
3660
3663 std::function<void(discordpp::ClientResult result, uint64_t lobbyId)>;
3664
3667 std::function<void(discordpp::ClientResult result,
3668 std::vector<discordpp::GuildChannel> guildChannels)>;
3669
3671 using GetUserGuildsCallback = std::function<void(discordpp::ClientResult result,
3672 std::vector<discordpp::GuildMinimal> guilds)>;
3673
3676 std::function<void(discordpp::ClientResult result, std::string inviteUrl)>;
3677
3679 using LeaveLobbyCallback = std::function<void(discordpp::ClientResult result)>;
3680
3682 using LinkOrUnlinkChannelCallback = std::function<void(discordpp::ClientResult result)>;
3683
3685 using LobbyCreatedCallback = std::function<void(uint64_t lobbyId)>;
3686
3688 using LobbyDeletedCallback = std::function<void(uint64_t lobbyId)>;
3689
3691 using LobbyMemberAddedCallback = std::function<void(uint64_t lobbyId, uint64_t memberId)>;
3692
3694 using LobbyMemberRemovedCallback = std::function<void(uint64_t lobbyId, uint64_t memberId)>;
3695
3697 using LobbyMemberUpdatedCallback = std::function<void(uint64_t lobbyId, uint64_t memberId)>;
3698
3700 using LobbyUpdatedCallback = std::function<void(uint64_t lobbyId)>;
3701
3703 using IsDiscordAppInstalledCallback = std::function<void(bool installed)>;
3704
3707 std::function<void(discordpp::ClientResult result, std::string joinSecret)>;
3708
3711 using SendActivityInviteCallback = std::function<void(discordpp::ClientResult result)>;
3712
3715 using ActivityInviteCallback = std::function<void(discordpp::ActivityInvite invite)>;
3716
3718 using ActivityJoinCallback = std::function<void(std::string joinSecret)>;
3719
3722 std::function<void(uint64_t applicationId, std::string joinSecret)>;
3723
3725 using UpdateStatusCallback = std::function<void(discordpp::ClientResult result)>;
3726
3728 using UpdateRichPresenceCallback = std::function<void(discordpp::ClientResult result)>;
3729
3732 using UpdateRelationshipCallback = std::function<void(discordpp::ClientResult result)>;
3733
3736 using SendFriendRequestCallback = std::function<void(discordpp::ClientResult result)>;
3737
3743 std::function<void(uint64_t userId, bool isDiscordRelationshipUpdate)>;
3744
3750 std::function<void(uint64_t userId, bool isDiscordRelationshipUpdate)>;
3751
3754 std::function<void(discordpp::ClientResult result,
3755 std::optional<discordpp::UserHandle> user)>;
3756
3758 using RelationshipGroupsUpdatedCallback = std::function<void(uint64_t userId)>;
3759
3761 using UserUpdatedCallback = std::function<void(uint64_t userId)>;
3763 Discord_Client* instance() const { return &instance_; }
3766 explicit Client(Discord_Client instance, DiscordObjectState state);
3767 ~Client();
3770 Client(Client&& other) noexcept;
3772 Client& operator=(Client&& other) noexcept;
3774 static const Client nullobj;
3776 operator bool() const { return state_ != DiscordObjectState::Invalid; }
3777
3778 Client(const Client&) = delete;
3779 Client& operator=(const Client&) = delete;
3780
3782 explicit Client();
3783
3785 explicit Client(std::string apiBase, std::string webBase);
3786
3789
3791 void Drop();
3793
3795 static std::string ErrorToString(discordpp::Client::Error type);
3796
3802
3806 [[deprecated("Please use GetCurrentUserV2 instead. This will be removed in a future version.")]]
3808
3811 static std::string GetDefaultAudioDeviceId();
3812
3827 static std::string GetDefaultCommunicationScopes();
3828
3839 static std::string GetDefaultPresenceScopes();
3840
3842 static std::string GetVersionHash();
3843
3845 static int32_t GetVersionMajor();
3846
3848 static int32_t GetVersionMinor();
3849
3851 static int32_t GetVersionPatch();
3852
3854 void SetHttpRequestTimeout(int32_t httpTimeoutInMilliseconds);
3855
3858
3861
3864
3867 void EndCall(uint64_t channelId, discordpp::Client::EndCallCallback callback);
3868
3872
3874 discordpp::Call GetCall(uint64_t channelId);
3875
3877 std::vector<discordpp::Call> GetCalls();
3878
3881
3884
3887
3893
3896
3902
3904 bool GetSelfDeafAll() const;
3905
3907 bool GetSelfMuteAll() const;
3908
3914
3919 void SetAecDump(bool on);
3920
3929
3933
3940 void SetEchoCancellation(bool on);
3941
3952 void SetEngineManagedAudioSession(bool isEngineManaged);
3953
3958
3963 void SetInputVolume(float inputVolume);
3964
3968
3977 void SetNoAudioInputThreshold(float dBFSThreshold);
3978
3983
3990 void SetNoiseSuppression(bool on);
3991
3998 void SetOpusHardwareCoding(bool encode, bool decode);
3999
4004
4009 void SetOutputVolume(float outputVolume);
4010
4015 void SetSelfDeafAll(bool deaf);
4016
4019 void SetSelfMuteAll(bool mute);
4020
4024 [[deprecated("Calling Client::SetSpeakerMode is DEPRECATED.")]]
4025 bool SetSpeakerMode(bool speakerMode);
4026
4033 void SetThreadPriority(discordpp::Client::Thread thread, int32_t priority);
4034
4041
4048
4051
4062 discordpp::Call StartCall(uint64_t channelId);
4063
4083 uint64_t lobbyId,
4087
4090
4096
4099
4195
4202
4208
4224 void ExchangeChildToken(std::string const& parentApplicationToken,
4225 uint64_t childApplicationId,
4227
4234 std::string const& token,
4236
4270 void GetProvisionalToken(uint64_t applicationId,
4272 std::string const& externalAuthToken,
4274
4298 void GetToken(uint64_t applicationId,
4299 std::string const& code,
4300 std::string const& codeVerifier,
4301 std::string const& redirectUri,
4303
4331
4371 std::string const& externalAuthToken,
4373
4404 void GetTokenFromProvisionalMerge(uint64_t applicationId,
4405 std::string const& code,
4406 std::string const& codeVerifier,
4407 std::string const& redirectUri,
4409 std::string const& externalAuthToken,
4411
4415
4420 void OpenAuthorizeDeviceScreen(uint64_t clientId, std::string const& userCode);
4421
4429
4444 void RefreshToken(uint64_t applicationId,
4445 std::string const& refreshToken,
4447
4458
4465
4478 void RevokeToken(uint64_t applicationId,
4479 std::string const& token,
4481
4486
4492 void SetGameWindowPid(int32_t pid);
4493
4507
4525 uint64_t applicationId,
4527 std::string const& externalAuthToken,
4529
4536 std::string const& name,
4538
4546 std::string token,
4549
4552
4558 bool CanOpenMessageInDiscord(uint64_t messageId);
4559
4561 void DeleteUserMessage(uint64_t recipientId,
4562 uint64_t messageId,
4564
4568 void EditUserMessage(uint64_t recipientId,
4569 uint64_t messageId,
4570 std::string const& content,
4572
4579 std::optional<discordpp::ChannelHandle> GetChannelHandle(uint64_t channelId) const;
4580
4592 void GetLobbyMessagesWithLimit(uint64_t lobbyId,
4593 int32_t limit,
4595
4600 std::optional<discordpp::MessageHandle> GetMessageHandle(uint64_t messageId) const;
4601
4609
4624 void GetUserMessagesWithLimit(uint64_t recipientId,
4625 int32_t limit,
4627
4634 uint64_t messageId,
4635 discordpp::Client::ProvisionalUserMergeRequiredCallback provisionalUserMergeRequiredCallback,
4637
4648 void SendLobbyMessage(uint64_t lobbyId,
4649 std::string const& content,
4651
4658 void SendLobbyMessageWithMetadata(uint64_t lobbyId,
4659 std::string const& content,
4660 std::unordered_map<std::string, std::string> const& metadata,
4662
4675 void SendUserMessage(uint64_t recipientId,
4676 std::string const& content,
4678
4685 void SendUserMessageWithMetadata(uint64_t recipientId,
4686 std::string const& content,
4687 std::unordered_map<std::string, std::string> const& metadata,
4689
4702
4710
4718
4729 void SetShowingChat(bool showingChat);
4731
4734
4745 discordpp::LoggingSeverity minSeverity);
4746
4753 discordpp::LoggingSeverity minSeverity);
4754
4761 void Connect();
4762
4769
4773
4783
4788 void SetApplicationId(uint64_t applicationId);
4789
4804 bool SetLogDir(std::string const& path, discordpp::LoggingSeverity minSeverity);
4805
4808
4821 void SetVoiceLogDir(std::string const& path, discordpp::LoggingSeverity minSeverity);
4823
4826
4844 void CreateOrJoinLobby(std::string const& secret,
4846
4854 std::string const& secret,
4855 std::unordered_map<std::string, std::string> const& lobbyMetadata,
4856 std::unordered_map<std::string, std::string> const& memberMetadata,
4858
4867
4869 std::optional<discordpp::LobbyHandle> GetLobbyHandle(uint64_t lobbyId) const;
4870
4876 std::vector<uint64_t> GetLobbyIds() const;
4877
4885
4893 uint64_t lobbyId,
4894 discordpp::Client::ProvisionalUserMergeRequiredCallback provisionalUserMergeRequiredCallback,
4896
4903 void LeaveLobby(uint64_t lobbyId, discordpp::Client::LeaveLobbyCallback callback);
4904
4909 void LinkChannelToLobby(uint64_t lobbyId,
4910 uint64_t channelId,
4912
4925
4936
4945
4954
4961
4965
4971 void UnlinkChannelFromLobby(uint64_t lobbyId,
4974
4977
4993
4996
5004
5007
5027 bool RegisterLaunchCommand(uint64_t applicationId, std::string command);
5028
5035 bool RegisterLaunchSteamApplication(uint64_t applicationId, uint32_t steamAppId);
5036
5047 void SendActivityInvite(uint64_t userId,
5048 std::string const& content,
5050
5058
5064
5074
5081
5089
5098
5102
5122
5125
5131 void AcceptDiscordFriendRequest(uint64_t userId,
5133
5139
5147
5153 void CancelDiscordFriendRequest(uint64_t userId,
5155
5161
5165
5168 std::vector<discordpp::RelationshipHandle> GetRelationships() const;
5169
5177 std::vector<discordpp::RelationshipHandle> GetRelationshipsByGroup(
5178 discordpp::RelationshipGroupType groupType) const;
5179
5185 void RejectDiscordFriendRequest(uint64_t userId,
5187
5193
5198 void RemoveDiscordAndGameFriend(uint64_t userId,
5200
5205
5210 std::vector<discordpp::UserHandle> SearchFriendsByUsername(std::string searchStr) const;
5211
5227 void SendDiscordFriendRequest(std::string const& username,
5229
5245 void SendDiscordFriendRequestById(uint64_t userId,
5247
5263 void SendGameFriendRequest(std::string const& username,
5265
5281 void SendGameFriendRequestById(uint64_t userId,
5283
5290
5297
5304
5307
5311 std::optional<discordpp::UserHandle> GetCurrentUserV2() const;
5312
5317 uint64_t applicationId,
5319
5325 std::optional<discordpp::UserHandle> GetUser(uint64_t userId) const;
5326
5333
5340};
5341
5345 mutable Discord_CallInfoHandle instance_{};
5348
5349public:
5351 Discord_CallInfoHandle* instance() const { return &instance_; }
5354 explicit CallInfoHandle(Discord_CallInfoHandle instance, DiscordObjectState state);
5364 operator bool() const { return state_ != DiscordObjectState::Invalid; }
5365
5370
5372 void Drop();
5374
5376 uint64_t ChannelId() const;
5377
5379 std::vector<uint64_t> GetParticipants() const;
5380
5383 std::optional<discordpp::VoiceStateHandle> GetVoiceStateHandle(uint64_t userId) const;
5384
5386 uint64_t GuildId() const;
5387};
5388
5390{
5391 switch (value) {
5393 return "Invalid";
5395 return "Join";
5397 return "JoinRequest";
5398 default:
5399 return "unknown";
5400 }
5401}
5402
5404{
5405 switch (value) {
5407 return "Private";
5409 return "Public";
5410 default:
5411 return "unknown";
5412 }
5413}
5414
5416{
5417 switch (value) {
5419 return "Playing";
5421 return "Streaming";
5423 return "Listening";
5425 return "Watching";
5427 return "CustomStatus";
5429 return "Competing";
5431 return "HangStatus";
5432 default:
5433 return "unknown";
5434 }
5435}
5436
5438{
5439 switch (value) {
5441 return "Name";
5443 return "State";
5445 return "Details";
5446 default:
5447 return "unknown";
5448 }
5449}
5450
5452{
5453 switch (value) {
5455 return "Desktop";
5457 return "Xbox";
5459 return "Samsung";
5461 return "IOS";
5463 return "Android";
5465 return "Embedded";
5467 return "PS4";
5469 return "PS5";
5470 default:
5471 return "unknown";
5472 }
5473}
5474
5475inline const char* EnumToString(discordpp::ErrorType value)
5476{
5477 switch (value) {
5479 return "None";
5481 return "NetworkError";
5483 return "HTTPError";
5485 return "ClientNotReady";
5487 return "Disabled";
5489 return "ClientDestroyed";
5491 return "ValidationError";
5493 return "Aborted";
5495 return "AuthorizationFailed";
5497 return "RPCError";
5498 default:
5499 return "unknown";
5500 }
5501}
5502
5504{
5505 switch (value) {
5507 return "None";
5509 return "Continue";
5511 return "SwitchingProtocols";
5513 return "Processing";
5515 return "EarlyHints";
5517 return "Ok";
5519 return "Created";
5521 return "Accepted";
5523 return "NonAuthoritativeInfo";
5525 return "NoContent";
5527 return "ResetContent";
5529 return "PartialContent";
5531 return "MultiStatus";
5533 return "AlreadyReported";
5535 return "ImUsed";
5537 return "MultipleChoices";
5539 return "MovedPermanently";
5541 return "Found";
5543 return "SeeOther";
5545 return "NotModified";
5547 return "TemporaryRedirect";
5549 return "PermanentRedirect";
5551 return "BadRequest";
5553 return "Unauthorized";
5555 return "PaymentRequired";
5557 return "Forbidden";
5559 return "NotFound";
5561 return "MethodNotAllowed";
5563 return "NotAcceptable";
5565 return "ProxyAuthRequired";
5567 return "RequestTimeout";
5569 return "Conflict";
5571 return "Gone";
5573 return "LengthRequired";
5575 return "PreconditionFailed";
5577 return "PayloadTooLarge";
5579 return "UriTooLong";
5581 return "UnsupportedMediaType";
5583 return "RangeNotSatisfiable";
5585 return "ExpectationFailed";
5587 return "MisdirectedRequest";
5589 return "UnprocessableEntity";
5591 return "Locked";
5593 return "FailedDependency";
5595 return "TooEarly";
5597 return "UpgradeRequired";
5599 return "PreconditionRequired";
5601 return "TooManyRequests";
5603 return "RequestHeaderFieldsTooLarge";
5605 return "InternalServerError";
5607 return "NotImplemented";
5609 return "BadGateway";
5611 return "ServiceUnavailable";
5613 return "GatewayTimeout";
5615 return "HttpVersionNotSupported";
5617 return "VariantAlsoNegotiates";
5619 return "InsufficientStorage";
5621 return "LoopDetected";
5623 return "NotExtended";
5625 return "NetworkAuthorizationRequired";
5626 default:
5627 return "unknown";
5628 }
5629}
5630
5632{
5633 switch (value) {
5635 return "S256";
5636 default:
5637 return "unknown";
5638 }
5639}
5640
5642{
5643 switch (value) {
5645 return "GuildInstall";
5647 return "UserInstall";
5648 default:
5649 return "unknown";
5650 }
5651}
5652
5653inline const char* EnumToString(discordpp::ChannelType value)
5654{
5655 switch (value) {
5657 return "GuildText";
5659 return "Dm";
5661 return "GuildVoice";
5663 return "GroupDm";
5665 return "GuildCategory";
5667 return "GuildNews";
5669 return "GuildStore";
5671 return "GuildNewsThread";
5673 return "GuildPublicThread";
5675 return "GuildPrivateThread";
5677 return "GuildStageVoice";
5679 return "GuildDirectory";
5681 return "GuildForum";
5683 return "GuildMedia";
5685 return "Lobby";
5687 return "EphemeralDm";
5688 default:
5689 return "unknown";
5690 }
5691}
5692
5694{
5695 switch (value) {
5697 return "Other";
5699 return "Attachment";
5701 return "Poll";
5703 return "VoiceMessage";
5705 return "Thread";
5707 return "Embed";
5709 return "Sticker";
5710 default:
5711 return "unknown";
5712 }
5713}
5714
5716{
5717 switch (value) {
5719 return "VoiceActivity";
5721 return "PushToTalk";
5722 default:
5723 return "unknown";
5724 }
5725}
5726
5727inline const char* EnumToString(discordpp::AudioSystem value)
5728{
5729 switch (value) {
5731 return "Standard";
5733 return "Game";
5734 default:
5735 return "unknown";
5736 }
5737}
5738
5739inline const char* EnumToString(discordpp::Call::Error value)
5740{
5741 switch (value) {
5743 return "None";
5745 return "SignalingConnectionFailed";
5747 return "SignalingUnexpectedClose";
5749 return "VoiceConnectionFailed";
5751 return "JoinTimeout";
5753 return "Forbidden";
5754 default:
5755 return "unknown";
5756 }
5757}
5758
5760{
5761 switch (value) {
5763 return "MODE_UNINIT";
5765 return "MODE_VAD";
5767 return "MODE_PTT";
5768 default:
5769 return "unknown";
5770 }
5771}
5772
5773inline const char* EnumToString(discordpp::Call::Status value)
5774{
5775 switch (value) {
5777 return "Disconnected";
5779 return "Joining";
5781 return "Connecting";
5783 return "SignalingConnected";
5785 return "Connected";
5787 return "Reconnecting";
5789 return "Disconnecting";
5790 default:
5791 return "unknown";
5792 }
5793}
5794
5796{
5797 switch (value) {
5799 return "None";
5801 return "Friend";
5803 return "Blocked";
5805 return "PendingIncoming";
5807 return "PendingOutgoing";
5809 return "Implicit";
5811 return "Suggestion";
5812 default:
5813 return "unknown";
5814 }
5815}
5816
5818{
5819 switch (value) {
5821 return "OIDC";
5823 return "EpicOnlineServices";
5825 return "Steam";
5827 return "Unity";
5829 return "DiscordBot";
5831 return "None";
5833 return "Unknown";
5834 default:
5835 return "unknown";
5836 }
5837}
5838
5840{
5841 switch (value) {
5843 return "Gif";
5845 return "Webp";
5847 return "Png";
5849 return "Jpeg";
5850 default:
5851 return "unknown";
5852 }
5853}
5854
5855inline const char* EnumToString(discordpp::StatusType value)
5856{
5857 switch (value) {
5859 return "Online";
5861 return "Offline";
5863 return "Blocked";
5865 return "Idle";
5867 return "Dnd";
5869 return "Invisible";
5871 return "Streaming";
5873 return "Unknown";
5874 default:
5875 return "unknown";
5876 }
5877}
5878
5880{
5881 switch (value) {
5883 return "MessageDataVisibleOnDiscord";
5884 default:
5885 return "unknown";
5886 }
5887}
5888
5890{
5891 switch (value) {
5893 return "None";
5895 return "ConnectionFailed";
5897 return "UnexpectedClose";
5899 return "ConnectionCanceled";
5900 default:
5901 return "unknown";
5902 }
5903}
5904
5906{
5907 switch (value) {
5909 return "Disconnected";
5911 return "Connecting";
5913 return "Connected";
5915 return "Ready";
5917 return "Reconnecting";
5919 return "Disconnecting";
5921 return "HttpWait";
5922 default:
5923 return "unknown";
5924 }
5925}
5926
5928{
5929 switch (value) {
5931 return "Client";
5933 return "Voice";
5935 return "Network";
5936 default:
5937 return "unknown";
5938 }
5939}
5940
5942{
5943 switch (value) {
5945 return "User";
5947 return "Bearer";
5948 default:
5949 return "unknown";
5950 }
5951}
5952
5954{
5955 switch (value) {
5957 return "OIDC";
5959 return "EpicOnlineServicesAccessToken";
5961 return "EpicOnlineServicesIdToken";
5963 return "SteamSessionTicket";
5965 return "UnityServicesIdToken";
5967 return "DiscordBotIssuedAccessToken";
5969 return "AppleIdToken";
5971 return "PlayStationNetworkIdToken";
5972 default:
5973 return "unknown";
5974 }
5975}
5976
5978{
5979 switch (value) {
5981 return "Verbose";
5983 return "Info";
5985 return "Warning";
5987 return "Error";
5989 return "None";
5990 default:
5991 return "unknown";
5992 }
5993}
5994
5996{
5997 switch (value) {
5999 return "OnlinePlayingGame";
6001 return "OnlineElsewhere";
6003 return "Offline";
6004 default:
6005 return "unknown";
6006 }
6007}
6008} // namespace discordpp
6009#endif // DISCORD_HEADER_DISCORDPP_H_
6010#ifdef DISCORDPP_IMPLEMENTATION
6011#undef DISCORDPP_IMPLEMENTATION
6012#ifdef __clang__
6013#pragma clang diagnostic push
6014#pragma clang diagnostic ignored "-Wunused-parameter"
6015#endif
6016namespace discordpp {
6017std::function<void(std::function<void()>)> s_synchronizationContext;
6018
6019inline bool HasSynchronizationContext()
6020{
6021 return !!s_synchronizationContext;
6022}
6023
6024inline void PostTask(std::function<void()> task)
6025{
6026 assert(s_synchronizationContext);
6027 s_synchronizationContext(std::move(task));
6028}
6029
6030void SetSynchronizationContext(std::function<void(std::function<void()>)> executor)
6031{
6032 s_synchronizationContext = std::move(executor);
6033}
6034
6035template <typename T>
6036struct TDelegateUserData {
6037 T delegate;
6038 TDelegateUserData(T delegate)
6039 : delegate{delegate}
6040 {
6041 }
6042
6043 static void Free(void* ptr) { delete reinterpret_cast<TDelegateUserData*>(ptr); }
6044
6045 static T& Get(void* userData)
6046 {
6047 return reinterpret_cast<TDelegateUserData*>(userData)->delegate;
6048 }
6049};
6050
6051struct ConvertedProperties {
6052 ConvertedProperties(std::unordered_map<std::string, std::string> const& PropertyMap)
6053 {
6054 Properties.size = PropertyMap.size();
6055 Properties.keys = reinterpret_cast<Discord_String*>(
6056 Discord_Alloc(Properties.size * sizeof(Discord_String)));
6057 Properties.values = reinterpret_cast<Discord_String*>(
6058 Discord_Alloc(Properties.size * sizeof(Discord_String)));
6059 size_t i = 0;
6060 for (auto& pair : PropertyMap) {
6061 Properties.keys[i] = AllocateString(pair.first);
6062 Properties.values[i] = AllocateString(pair.second);
6063 ++i;
6064 }
6065 }
6066 ~ConvertedProperties() { Discord_FreeProperties(Properties); }
6067 Discord_Properties Properties{};
6068
6069private:
6070 Discord_String AllocateString(std::string const& str)
6071 {
6072 Discord_String result;
6073 result.ptr = reinterpret_cast<uint8_t*>(Discord_Alloc(str.size()));
6074 result.size = str.size();
6075 std::memcpy(result.ptr, str.data(), result.size);
6076 return result;
6077 }
6078};
6079
6080std::unordered_map<std::string, std::string> ConvertReturnedProperties(
6081 Discord_Properties const& Properties)
6082{
6083 std::unordered_map<std::string, std::string> result;
6084 for (size_t i = 0; i < Properties.size; ++i) {
6085 std::string key(reinterpret_cast<char*>(Properties.keys[i].ptr), Properties.keys[i].size);
6086 std::string value(reinterpret_cast<char*>(Properties.values[i].ptr),
6087 Properties.values[i].size);
6088 result.emplace(std::move(key), std::move(value));
6089 }
6090 return result;
6091}
6093ActivityInvite::~ActivityInvite()
6094{
6095 if (state_ == DiscordObjectState::Owned) {
6096 Drop();
6098 }
6099}
6101 : instance_(other.instance_)
6102 , state_(other.state_)
6103{
6104 other.state_ = DiscordObjectState::Invalid;
6105}
6107{
6108 if (this != &other) {
6109 if (state_ == DiscordObjectState::Owned) {
6110 Drop();
6111 }
6112 instance_ = other.instance_;
6113 state_ = other.state_;
6114 other.state_ = DiscordObjectState::Invalid;
6115 }
6116 return *this;
6117}
6119 : instance_{}
6120 , state_(DiscordObjectState::Invalid)
6121{
6122 if (rhs.state_ == DiscordObjectState::Owned) {
6123 Discord_ActivityInvite_Clone(&instance_, rhs.instance());
6124
6125 state_ = DiscordObjectState::Owned;
6126 }
6127}
6128ActivityInvite& ActivityInvite::operator=(const ActivityInvite& rhs)
6129{
6130 if (this != &rhs) {
6131 if (state_ == DiscordObjectState::Owned) {
6132 Drop();
6133 state_ = DiscordObjectState::Invalid;
6134 }
6135 if (rhs.state_ == DiscordObjectState::Owned) {
6136 Discord_ActivityInvite_Clone(&instance_, rhs.instance());
6137
6138 state_ = DiscordObjectState::Owned;
6139 }
6140 }
6141 return *this;
6142}
6143ActivityInvite::ActivityInvite(Discord_ActivityInvite instance, DiscordObjectState state)
6144 : instance_(instance)
6145 , state_(state)
6146{
6147}
6148ActivityInvite::ActivityInvite()
6149{
6150 assert(state_ == DiscordObjectState::Invalid);
6151 Discord_ActivityInvite_Init(&instance_);
6152 state_ = DiscordObjectState::Owned;
6153}
6154void ActivityInvite::Drop()
6155{
6156 if (state_ != DiscordObjectState::Owned) {
6157 return;
6158 }
6159 Discord_ActivityInvite_Drop(&instance_);
6160 state_ = DiscordObjectState::Invalid;
6161}
6162uint64_t ActivityInvite::SenderId() const
6163{
6164 assert(state_ == DiscordObjectState::Owned);
6165 uint64_t returnValue__;
6166 returnValue__ = Discord_ActivityInvite_SenderId(&instance_);
6167 return returnValue__;
6168}
6169void ActivityInvite::SetSenderId(uint64_t SenderId)
6170{
6171 assert(state_ == DiscordObjectState::Owned);
6172 Discord_ActivityInvite_SetSenderId(&instance_, SenderId);
6173}
6174uint64_t ActivityInvite::ChannelId() const
6175{
6176 assert(state_ == DiscordObjectState::Owned);
6177 uint64_t returnValue__;
6178 returnValue__ = Discord_ActivityInvite_ChannelId(&instance_);
6179 return returnValue__;
6180}
6181void ActivityInvite::SetChannelId(uint64_t ChannelId)
6182{
6183 assert(state_ == DiscordObjectState::Owned);
6184 Discord_ActivityInvite_SetChannelId(&instance_, ChannelId);
6185}
6186uint64_t ActivityInvite::MessageId() const
6187{
6188 assert(state_ == DiscordObjectState::Owned);
6189 uint64_t returnValue__;
6190 returnValue__ = Discord_ActivityInvite_MessageId(&instance_);
6191 return returnValue__;
6192}
6193void ActivityInvite::SetMessageId(uint64_t MessageId)
6194{
6195 assert(state_ == DiscordObjectState::Owned);
6196 Discord_ActivityInvite_SetMessageId(&instance_, MessageId);
6197}
6198discordpp::ActivityActionTypes ActivityInvite::Type() const
6199{
6200 assert(state_ == DiscordObjectState::Owned);
6201 Discord_ActivityActionTypes returnValue__;
6202 returnValue__ = Discord_ActivityInvite_Type(&instance_);
6203 return static_cast<discordpp::ActivityActionTypes>(returnValue__);
6204}
6205void ActivityInvite::SetType(discordpp::ActivityActionTypes Type)
6206{
6207 assert(state_ == DiscordObjectState::Owned);
6208 Discord_ActivityInvite_SetType(&instance_, static_cast<Discord_ActivityActionTypes>(Type));
6209}
6210uint64_t ActivityInvite::ApplicationId() const
6211{
6212 assert(state_ == DiscordObjectState::Owned);
6213 uint64_t returnValue__;
6214 returnValue__ = Discord_ActivityInvite_ApplicationId(&instance_);
6215 return returnValue__;
6216}
6217void ActivityInvite::SetApplicationId(uint64_t ApplicationId)
6218{
6219 assert(state_ == DiscordObjectState::Owned);
6220 Discord_ActivityInvite_SetApplicationId(&instance_, ApplicationId);
6221}
6222uint64_t ActivityInvite::ParentApplicationId() const
6223{
6224 assert(state_ == DiscordObjectState::Owned);
6225 uint64_t returnValue__;
6226 returnValue__ = Discord_ActivityInvite_ParentApplicationId(&instance_);
6227 return returnValue__;
6228}
6229void ActivityInvite::SetParentApplicationId(uint64_t ParentApplicationId)
6230{
6231 assert(state_ == DiscordObjectState::Owned);
6232 Discord_ActivityInvite_SetParentApplicationId(&instance_, ParentApplicationId);
6233}
6234std::string ActivityInvite::PartyId() const
6235{
6236 assert(state_ == DiscordObjectState::Owned);
6237 Discord_String returnValueNative__;
6238 Discord_ActivityInvite_PartyId(&instance_, &returnValueNative__);
6239 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
6240 returnValueNative__.size);
6241 Discord_Free(returnValueNative__.ptr);
6242 return returnValue__;
6243}
6244void ActivityInvite::SetPartyId(std::string PartyId)
6245{
6246 assert(state_ == DiscordObjectState::Owned);
6247 Discord_String PartyId__str{(uint8_t*)(PartyId.data()), PartyId.size()};
6248 Discord_ActivityInvite_SetPartyId(&instance_, PartyId__str);
6249}
6250std::string ActivityInvite::SessionId() const
6251{
6252 assert(state_ == DiscordObjectState::Owned);
6253 Discord_String returnValueNative__;
6254 Discord_ActivityInvite_SessionId(&instance_, &returnValueNative__);
6255 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
6256 returnValueNative__.size);
6257 Discord_Free(returnValueNative__.ptr);
6258 return returnValue__;
6259}
6260void ActivityInvite::SetSessionId(std::string SessionId)
6261{
6262 assert(state_ == DiscordObjectState::Owned);
6263 Discord_String SessionId__str{(uint8_t*)(SessionId.data()), SessionId.size()};
6264 Discord_ActivityInvite_SetSessionId(&instance_, SessionId__str);
6265}
6266bool ActivityInvite::IsValid() const
6267{
6268 assert(state_ == DiscordObjectState::Owned);
6269 bool returnValue__;
6270 returnValue__ = Discord_ActivityInvite_IsValid(&instance_);
6271 return returnValue__;
6272}
6273void ActivityInvite::SetIsValid(bool IsValid)
6274{
6275 assert(state_ == DiscordObjectState::Owned);
6276 Discord_ActivityInvite_SetIsValid(&instance_, IsValid);
6277}
6278const ActivityAssets ActivityAssets::nullobj{{}, DiscordObjectState::Invalid};
6279ActivityAssets::~ActivityAssets()
6280{
6281 if (state_ == DiscordObjectState::Owned) {
6282 Drop();
6283 state_ = DiscordObjectState::Invalid;
6284 }
6285}
6286ActivityAssets::ActivityAssets(ActivityAssets&& other) noexcept
6287 : instance_(other.instance_)
6288 , state_(other.state_)
6289{
6290 other.state_ = DiscordObjectState::Invalid;
6291}
6292ActivityAssets& ActivityAssets::operator=(ActivityAssets&& other) noexcept
6293{
6294 if (this != &other) {
6295 if (state_ == DiscordObjectState::Owned) {
6296 Drop();
6297 }
6298 instance_ = other.instance_;
6299 state_ = other.state_;
6300 other.state_ = DiscordObjectState::Invalid;
6301 }
6302 return *this;
6303}
6304ActivityAssets::ActivityAssets(const ActivityAssets& arg0)
6305 : instance_{}
6306 , state_(DiscordObjectState::Invalid)
6307{
6308 if (arg0.state_ == DiscordObjectState::Owned) {
6309 Discord_ActivityAssets_Clone(&instance_, arg0.instance());
6310
6311 state_ = DiscordObjectState::Owned;
6312 }
6313}
6314ActivityAssets& ActivityAssets::operator=(const ActivityAssets& arg0)
6315{
6316 if (this != &arg0) {
6317 if (state_ == DiscordObjectState::Owned) {
6318 Drop();
6319 state_ = DiscordObjectState::Invalid;
6320 }
6321 if (arg0.state_ == DiscordObjectState::Owned) {
6322 Discord_ActivityAssets_Clone(&instance_, arg0.instance());
6323
6324 state_ = DiscordObjectState::Owned;
6325 }
6326 }
6327 return *this;
6328}
6329ActivityAssets::ActivityAssets(Discord_ActivityAssets instance, DiscordObjectState state)
6330 : instance_(instance)
6331 , state_(state)
6332{
6333}
6334ActivityAssets::ActivityAssets()
6335{
6336 assert(state_ == DiscordObjectState::Invalid);
6337 Discord_ActivityAssets_Init(&instance_);
6338 state_ = DiscordObjectState::Owned;
6339}
6340void ActivityAssets::Drop()
6341{
6342 if (state_ != DiscordObjectState::Owned) {
6343 return;
6344 }
6345 Discord_ActivityAssets_Drop(&instance_);
6346 state_ = DiscordObjectState::Invalid;
6347}
6348std::optional<std::string> ActivityAssets::LargeImage() const
6349{
6350 assert(state_ == DiscordObjectState::Owned);
6351 bool returnIsNonNull__;
6352 Discord_String returnValueNative__;
6353 returnIsNonNull__ = Discord_ActivityAssets_LargeImage(&instance_, &returnValueNative__);
6354 if (!returnIsNonNull__) {
6355 return {};
6356 }
6357 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
6358 returnValueNative__.size);
6359 Discord_Free(returnValueNative__.ptr);
6360 return returnValue__;
6361}
6362void ActivityAssets::SetLargeImage(std::optional<std::string> LargeImage)
6363{
6364 assert(state_ == DiscordObjectState::Owned);
6365 Discord_String LargeImage__str{};
6366 if (LargeImage.has_value()) {
6367 LargeImage__str.ptr = reinterpret_cast<uint8_t*>(LargeImage->data());
6368 LargeImage__str.size = LargeImage->size();
6369 }
6370 Discord_ActivityAssets_SetLargeImage(&instance_,
6371 (LargeImage.has_value() ? &LargeImage__str : nullptr));
6372}
6373std::optional<std::string> ActivityAssets::LargeText() const
6374{
6375 assert(state_ == DiscordObjectState::Owned);
6376 bool returnIsNonNull__;
6377 Discord_String returnValueNative__;
6378 returnIsNonNull__ = Discord_ActivityAssets_LargeText(&instance_, &returnValueNative__);
6379 if (!returnIsNonNull__) {
6380 return {};
6381 }
6382 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
6383 returnValueNative__.size);
6384 Discord_Free(returnValueNative__.ptr);
6385 return returnValue__;
6386}
6387void ActivityAssets::SetLargeText(std::optional<std::string> LargeText)
6388{
6389 assert(state_ == DiscordObjectState::Owned);
6390 Discord_String LargeText__str{};
6391 if (LargeText.has_value()) {
6392 LargeText__str.ptr = reinterpret_cast<uint8_t*>(LargeText->data());
6393 LargeText__str.size = LargeText->size();
6394 }
6395 Discord_ActivityAssets_SetLargeText(&instance_,
6396 (LargeText.has_value() ? &LargeText__str : nullptr));
6397}
6398std::optional<std::string> ActivityAssets::LargeUrl() const
6399{
6400 assert(state_ == DiscordObjectState::Owned);
6401 bool returnIsNonNull__;
6402 Discord_String returnValueNative__;
6403 returnIsNonNull__ = Discord_ActivityAssets_LargeUrl(&instance_, &returnValueNative__);
6404 if (!returnIsNonNull__) {
6405 return {};
6406 }
6407 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
6408 returnValueNative__.size);
6409 Discord_Free(returnValueNative__.ptr);
6410 return returnValue__;
6411}
6412void ActivityAssets::SetLargeUrl(std::optional<std::string> LargeUrl)
6413{
6414 assert(state_ == DiscordObjectState::Owned);
6415 Discord_String LargeUrl__str{};
6416 if (LargeUrl.has_value()) {
6417 LargeUrl__str.ptr = reinterpret_cast<uint8_t*>(LargeUrl->data());
6418 LargeUrl__str.size = LargeUrl->size();
6419 }
6420 Discord_ActivityAssets_SetLargeUrl(&instance_,
6421 (LargeUrl.has_value() ? &LargeUrl__str : nullptr));
6422}
6423std::optional<std::string> ActivityAssets::SmallImage() const
6424{
6425 assert(state_ == DiscordObjectState::Owned);
6426 bool returnIsNonNull__;
6427 Discord_String returnValueNative__;
6428 returnIsNonNull__ = Discord_ActivityAssets_SmallImage(&instance_, &returnValueNative__);
6429 if (!returnIsNonNull__) {
6430 return {};
6431 }
6432 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
6433 returnValueNative__.size);
6434 Discord_Free(returnValueNative__.ptr);
6435 return returnValue__;
6436}
6437void ActivityAssets::SetSmallImage(std::optional<std::string> SmallImage)
6438{
6439 assert(state_ == DiscordObjectState::Owned);
6440 Discord_String SmallImage__str{};
6441 if (SmallImage.has_value()) {
6442 SmallImage__str.ptr = reinterpret_cast<uint8_t*>(SmallImage->data());
6443 SmallImage__str.size = SmallImage->size();
6444 }
6445 Discord_ActivityAssets_SetSmallImage(&instance_,
6446 (SmallImage.has_value() ? &SmallImage__str : nullptr));
6447}
6448std::optional<std::string> ActivityAssets::SmallText() const
6449{
6450 assert(state_ == DiscordObjectState::Owned);
6451 bool returnIsNonNull__;
6452 Discord_String returnValueNative__;
6453 returnIsNonNull__ = Discord_ActivityAssets_SmallText(&instance_, &returnValueNative__);
6454 if (!returnIsNonNull__) {
6455 return {};
6456 }
6457 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
6458 returnValueNative__.size);
6459 Discord_Free(returnValueNative__.ptr);
6460 return returnValue__;
6461}
6462void ActivityAssets::SetSmallText(std::optional<std::string> SmallText)
6463{
6464 assert(state_ == DiscordObjectState::Owned);
6465 Discord_String SmallText__str{};
6466 if (SmallText.has_value()) {
6467 SmallText__str.ptr = reinterpret_cast<uint8_t*>(SmallText->data());
6468 SmallText__str.size = SmallText->size();
6469 }
6470 Discord_ActivityAssets_SetSmallText(&instance_,
6471 (SmallText.has_value() ? &SmallText__str : nullptr));
6472}
6473std::optional<std::string> ActivityAssets::SmallUrl() const
6474{
6475 assert(state_ == DiscordObjectState::Owned);
6476 bool returnIsNonNull__;
6477 Discord_String returnValueNative__;
6478 returnIsNonNull__ = Discord_ActivityAssets_SmallUrl(&instance_, &returnValueNative__);
6479 if (!returnIsNonNull__) {
6480 return {};
6481 }
6482 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
6483 returnValueNative__.size);
6484 Discord_Free(returnValueNative__.ptr);
6485 return returnValue__;
6486}
6487void ActivityAssets::SetSmallUrl(std::optional<std::string> SmallUrl)
6488{
6489 assert(state_ == DiscordObjectState::Owned);
6490 Discord_String SmallUrl__str{};
6491 if (SmallUrl.has_value()) {
6492 SmallUrl__str.ptr = reinterpret_cast<uint8_t*>(SmallUrl->data());
6493 SmallUrl__str.size = SmallUrl->size();
6494 }
6495 Discord_ActivityAssets_SetSmallUrl(&instance_,
6496 (SmallUrl.has_value() ? &SmallUrl__str : nullptr));
6497}
6498std::optional<std::string> ActivityAssets::InviteCoverImage() const
6499{
6500 assert(state_ == DiscordObjectState::Owned);
6501 bool returnIsNonNull__;
6502 Discord_String returnValueNative__;
6503 returnIsNonNull__ = Discord_ActivityAssets_InviteCoverImage(&instance_, &returnValueNative__);
6504 if (!returnIsNonNull__) {
6505 return {};
6506 }
6507 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
6508 returnValueNative__.size);
6509 Discord_Free(returnValueNative__.ptr);
6510 return returnValue__;
6511}
6512void ActivityAssets::SetInviteCoverImage(std::optional<std::string> InviteCoverImage)
6513{
6514 assert(state_ == DiscordObjectState::Owned);
6515 Discord_String InviteCoverImage__str{};
6516 if (InviteCoverImage.has_value()) {
6517 InviteCoverImage__str.ptr = reinterpret_cast<uint8_t*>(InviteCoverImage->data());
6518 InviteCoverImage__str.size = InviteCoverImage->size();
6519 }
6520 Discord_ActivityAssets_SetInviteCoverImage(
6521 &instance_, (InviteCoverImage.has_value() ? &InviteCoverImage__str : nullptr));
6522}
6523const ActivityTimestamps ActivityTimestamps::nullobj{{}, DiscordObjectState::Invalid};
6524ActivityTimestamps::~ActivityTimestamps()
6525{
6526 if (state_ == DiscordObjectState::Owned) {
6527 Drop();
6528 state_ = DiscordObjectState::Invalid;
6529 }
6530}
6531ActivityTimestamps::ActivityTimestamps(ActivityTimestamps&& other) noexcept
6532 : instance_(other.instance_)
6533 , state_(other.state_)
6534{
6535 other.state_ = DiscordObjectState::Invalid;
6536}
6537ActivityTimestamps& ActivityTimestamps::operator=(ActivityTimestamps&& other) noexcept
6538{
6539 if (this != &other) {
6540 if (state_ == DiscordObjectState::Owned) {
6541 Drop();
6542 }
6543 instance_ = other.instance_;
6544 state_ = other.state_;
6545 other.state_ = DiscordObjectState::Invalid;
6546 }
6547 return *this;
6548}
6549ActivityTimestamps::ActivityTimestamps(const ActivityTimestamps& arg0)
6550 : instance_{}
6551 , state_(DiscordObjectState::Invalid)
6552{
6553 if (arg0.state_ == DiscordObjectState::Owned) {
6554 Discord_ActivityTimestamps_Clone(&instance_, arg0.instance());
6555
6556 state_ = DiscordObjectState::Owned;
6557 }
6558}
6559ActivityTimestamps& ActivityTimestamps::operator=(const ActivityTimestamps& arg0)
6560{
6561 if (this != &arg0) {
6562 if (state_ == DiscordObjectState::Owned) {
6563 Drop();
6564 state_ = DiscordObjectState::Invalid;
6565 }
6566 if (arg0.state_ == DiscordObjectState::Owned) {
6567 Discord_ActivityTimestamps_Clone(&instance_, arg0.instance());
6568
6569 state_ = DiscordObjectState::Owned;
6570 }
6571 }
6572 return *this;
6573}
6574ActivityTimestamps::ActivityTimestamps(Discord_ActivityTimestamps instance,
6575 DiscordObjectState state)
6576 : instance_(instance)
6577 , state_(state)
6578{
6579}
6580ActivityTimestamps::ActivityTimestamps()
6581{
6582 assert(state_ == DiscordObjectState::Invalid);
6583 Discord_ActivityTimestamps_Init(&instance_);
6584 state_ = DiscordObjectState::Owned;
6585}
6586void ActivityTimestamps::Drop()
6587{
6588 if (state_ != DiscordObjectState::Owned) {
6589 return;
6590 }
6591 Discord_ActivityTimestamps_Drop(&instance_);
6592 state_ = DiscordObjectState::Invalid;
6593}
6594uint64_t ActivityTimestamps::Start() const
6595{
6596 assert(state_ == DiscordObjectState::Owned);
6597 uint64_t returnValue__;
6598 returnValue__ = Discord_ActivityTimestamps_Start(&instance_);
6599 return returnValue__;
6600}
6601void ActivityTimestamps::SetStart(uint64_t Start)
6602{
6603 assert(state_ == DiscordObjectState::Owned);
6604 Discord_ActivityTimestamps_SetStart(&instance_, Start);
6605}
6606uint64_t ActivityTimestamps::End() const
6607{
6608 assert(state_ == DiscordObjectState::Owned);
6609 uint64_t returnValue__;
6610 returnValue__ = Discord_ActivityTimestamps_End(&instance_);
6611 return returnValue__;
6612}
6613void ActivityTimestamps::SetEnd(uint64_t End)
6614{
6615 assert(state_ == DiscordObjectState::Owned);
6616 Discord_ActivityTimestamps_SetEnd(&instance_, End);
6617}
6618const ActivityParty ActivityParty::nullobj{{}, DiscordObjectState::Invalid};
6619ActivityParty::~ActivityParty()
6620{
6621 if (state_ == DiscordObjectState::Owned) {
6622 Drop();
6623 state_ = DiscordObjectState::Invalid;
6624 }
6625}
6626ActivityParty::ActivityParty(ActivityParty&& other) noexcept
6627 : instance_(other.instance_)
6628 , state_(other.state_)
6629{
6630 other.state_ = DiscordObjectState::Invalid;
6631}
6632ActivityParty& ActivityParty::operator=(ActivityParty&& other) noexcept
6633{
6634 if (this != &other) {
6635 if (state_ == DiscordObjectState::Owned) {
6636 Drop();
6637 }
6638 instance_ = other.instance_;
6639 state_ = other.state_;
6640 other.state_ = DiscordObjectState::Invalid;
6641 }
6642 return *this;
6643}
6644ActivityParty::ActivityParty(const ActivityParty& arg0)
6645 : instance_{}
6646 , state_(DiscordObjectState::Invalid)
6647{
6648 if (arg0.state_ == DiscordObjectState::Owned) {
6649 Discord_ActivityParty_Clone(&instance_, arg0.instance());
6650
6651 state_ = DiscordObjectState::Owned;
6652 }
6653}
6654ActivityParty& ActivityParty::operator=(const ActivityParty& arg0)
6655{
6656 if (this != &arg0) {
6657 if (state_ == DiscordObjectState::Owned) {
6658 Drop();
6659 state_ = DiscordObjectState::Invalid;
6660 }
6661 if (arg0.state_ == DiscordObjectState::Owned) {
6662 Discord_ActivityParty_Clone(&instance_, arg0.instance());
6663
6664 state_ = DiscordObjectState::Owned;
6665 }
6666 }
6667 return *this;
6668}
6669ActivityParty::ActivityParty(Discord_ActivityParty instance, DiscordObjectState state)
6670 : instance_(instance)
6671 , state_(state)
6672{
6673}
6674ActivityParty::ActivityParty()
6675{
6676 assert(state_ == DiscordObjectState::Invalid);
6677 Discord_ActivityParty_Init(&instance_);
6678 state_ = DiscordObjectState::Owned;
6679}
6680void ActivityParty::Drop()
6681{
6682 if (state_ != DiscordObjectState::Owned) {
6683 return;
6684 }
6685 Discord_ActivityParty_Drop(&instance_);
6686 state_ = DiscordObjectState::Invalid;
6687}
6688std::string ActivityParty::Id() const
6689{
6690 assert(state_ == DiscordObjectState::Owned);
6691 Discord_String returnValueNative__;
6692 Discord_ActivityParty_Id(&instance_, &returnValueNative__);
6693 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
6694 returnValueNative__.size);
6695 Discord_Free(returnValueNative__.ptr);
6696 return returnValue__;
6697}
6698void ActivityParty::SetId(std::string Id)
6699{
6700 assert(state_ == DiscordObjectState::Owned);
6701 Discord_String Id__str{(uint8_t*)(Id.data()), Id.size()};
6702 Discord_ActivityParty_SetId(&instance_, Id__str);
6703}
6704int32_t ActivityParty::CurrentSize() const
6705{
6706 assert(state_ == DiscordObjectState::Owned);
6707 int32_t returnValue__;
6708 returnValue__ = Discord_ActivityParty_CurrentSize(&instance_);
6709 return returnValue__;
6710}
6711void ActivityParty::SetCurrentSize(int32_t CurrentSize)
6712{
6713 assert(state_ == DiscordObjectState::Owned);
6714 Discord_ActivityParty_SetCurrentSize(&instance_, CurrentSize);
6715}
6716int32_t ActivityParty::MaxSize() const
6717{
6718 assert(state_ == DiscordObjectState::Owned);
6719 int32_t returnValue__;
6720 returnValue__ = Discord_ActivityParty_MaxSize(&instance_);
6721 return returnValue__;
6722}
6723void ActivityParty::SetMaxSize(int32_t MaxSize)
6724{
6725 assert(state_ == DiscordObjectState::Owned);
6726 Discord_ActivityParty_SetMaxSize(&instance_, MaxSize);
6727}
6728discordpp::ActivityPartyPrivacy ActivityParty::Privacy() const
6729{
6730 assert(state_ == DiscordObjectState::Owned);
6731 Discord_ActivityPartyPrivacy returnValue__;
6732 returnValue__ = Discord_ActivityParty_Privacy(&instance_);
6733 return static_cast<discordpp::ActivityPartyPrivacy>(returnValue__);
6734}
6735void ActivityParty::SetPrivacy(discordpp::ActivityPartyPrivacy Privacy)
6736{
6737 assert(state_ == DiscordObjectState::Owned);
6738 Discord_ActivityParty_SetPrivacy(&instance_,
6739 static_cast<Discord_ActivityPartyPrivacy>(Privacy));
6740}
6741const ActivitySecrets ActivitySecrets::nullobj{{}, DiscordObjectState::Invalid};
6742ActivitySecrets::~ActivitySecrets()
6743{
6744 if (state_ == DiscordObjectState::Owned) {
6745 Drop();
6746 state_ = DiscordObjectState::Invalid;
6747 }
6748}
6749ActivitySecrets::ActivitySecrets(ActivitySecrets&& other) noexcept
6750 : instance_(other.instance_)
6751 , state_(other.state_)
6752{
6753 other.state_ = DiscordObjectState::Invalid;
6754}
6755ActivitySecrets& ActivitySecrets::operator=(ActivitySecrets&& other) noexcept
6756{
6757 if (this != &other) {
6758 if (state_ == DiscordObjectState::Owned) {
6759 Drop();
6760 }
6761 instance_ = other.instance_;
6762 state_ = other.state_;
6763 other.state_ = DiscordObjectState::Invalid;
6764 }
6765 return *this;
6766}
6767ActivitySecrets::ActivitySecrets(const ActivitySecrets& arg0)
6768 : instance_{}
6769 , state_(DiscordObjectState::Invalid)
6770{
6771 if (arg0.state_ == DiscordObjectState::Owned) {
6772 Discord_ActivitySecrets_Clone(&instance_, arg0.instance());
6773
6774 state_ = DiscordObjectState::Owned;
6775 }
6776}
6777ActivitySecrets& ActivitySecrets::operator=(const ActivitySecrets& arg0)
6778{
6779 if (this != &arg0) {
6780 if (state_ == DiscordObjectState::Owned) {
6781 Drop();
6782 state_ = DiscordObjectState::Invalid;
6783 }
6784 if (arg0.state_ == DiscordObjectState::Owned) {
6785 Discord_ActivitySecrets_Clone(&instance_, arg0.instance());
6786
6787 state_ = DiscordObjectState::Owned;
6788 }
6789 }
6790 return *this;
6791}
6792ActivitySecrets::ActivitySecrets(Discord_ActivitySecrets instance, DiscordObjectState state)
6793 : instance_(instance)
6794 , state_(state)
6795{
6796}
6797ActivitySecrets::ActivitySecrets()
6798{
6799 assert(state_ == DiscordObjectState::Invalid);
6800 Discord_ActivitySecrets_Init(&instance_);
6801 state_ = DiscordObjectState::Owned;
6802}
6803void ActivitySecrets::Drop()
6804{
6805 if (state_ != DiscordObjectState::Owned) {
6806 return;
6807 }
6808 Discord_ActivitySecrets_Drop(&instance_);
6809 state_ = DiscordObjectState::Invalid;
6810}
6811std::string ActivitySecrets::Join() const
6812{
6813 assert(state_ == DiscordObjectState::Owned);
6814 Discord_String returnValueNative__;
6815 Discord_ActivitySecrets_Join(&instance_, &returnValueNative__);
6816 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
6817 returnValueNative__.size);
6818 Discord_Free(returnValueNative__.ptr);
6819 return returnValue__;
6820}
6821void ActivitySecrets::SetJoin(std::string Join)
6822{
6823 assert(state_ == DiscordObjectState::Owned);
6824 Discord_String Join__str{(uint8_t*)(Join.data()), Join.size()};
6825 Discord_ActivitySecrets_SetJoin(&instance_, Join__str);
6826}
6827const ActivityButton ActivityButton::nullobj{{}, DiscordObjectState::Invalid};
6828ActivityButton::~ActivityButton()
6829{
6830 if (state_ == DiscordObjectState::Owned) {
6831 Drop();
6832 state_ = DiscordObjectState::Invalid;
6833 }
6834}
6835ActivityButton::ActivityButton(ActivityButton&& other) noexcept
6836 : instance_(other.instance_)
6837 , state_(other.state_)
6838{
6839 other.state_ = DiscordObjectState::Invalid;
6840}
6841ActivityButton& ActivityButton::operator=(ActivityButton&& other) noexcept
6842{
6843 if (this != &other) {
6844 if (state_ == DiscordObjectState::Owned) {
6845 Drop();
6846 }
6847 instance_ = other.instance_;
6848 state_ = other.state_;
6849 other.state_ = DiscordObjectState::Invalid;
6850 }
6851 return *this;
6852}
6853ActivityButton::ActivityButton(const ActivityButton& arg0)
6854 : instance_{}
6855 , state_(DiscordObjectState::Invalid)
6856{
6857 if (arg0.state_ == DiscordObjectState::Owned) {
6858 Discord_ActivityButton_Clone(&instance_, arg0.instance());
6859
6860 state_ = DiscordObjectState::Owned;
6861 }
6862}
6863ActivityButton& ActivityButton::operator=(const ActivityButton& arg0)
6864{
6865 if (this != &arg0) {
6866 if (state_ == DiscordObjectState::Owned) {
6867 Drop();
6868 state_ = DiscordObjectState::Invalid;
6869 }
6870 if (arg0.state_ == DiscordObjectState::Owned) {
6871 Discord_ActivityButton_Clone(&instance_, arg0.instance());
6872
6873 state_ = DiscordObjectState::Owned;
6874 }
6875 }
6876 return *this;
6877}
6878ActivityButton::ActivityButton(Discord_ActivityButton instance, DiscordObjectState state)
6879 : instance_(instance)
6880 , state_(state)
6881{
6882}
6883ActivityButton::ActivityButton()
6884{
6885 assert(state_ == DiscordObjectState::Invalid);
6886 Discord_ActivityButton_Init(&instance_);
6887 state_ = DiscordObjectState::Owned;
6888}
6889void ActivityButton::Drop()
6890{
6891 if (state_ != DiscordObjectState::Owned) {
6892 return;
6893 }
6894 Discord_ActivityButton_Drop(&instance_);
6895 state_ = DiscordObjectState::Invalid;
6896}
6897std::string ActivityButton::Label() const
6898{
6899 assert(state_ == DiscordObjectState::Owned);
6900 Discord_String returnValueNative__;
6901 Discord_ActivityButton_Label(&instance_, &returnValueNative__);
6902 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
6903 returnValueNative__.size);
6904 Discord_Free(returnValueNative__.ptr);
6905 return returnValue__;
6906}
6907void ActivityButton::SetLabel(std::string Label)
6908{
6909 assert(state_ == DiscordObjectState::Owned);
6910 Discord_String Label__str{(uint8_t*)(Label.data()), Label.size()};
6911 Discord_ActivityButton_SetLabel(&instance_, Label__str);
6912}
6913std::string ActivityButton::Url() const
6914{
6915 assert(state_ == DiscordObjectState::Owned);
6916 Discord_String returnValueNative__;
6917 Discord_ActivityButton_Url(&instance_, &returnValueNative__);
6918 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
6919 returnValueNative__.size);
6920 Discord_Free(returnValueNative__.ptr);
6921 return returnValue__;
6922}
6923void ActivityButton::SetUrl(std::string Url)
6924{
6925 assert(state_ == DiscordObjectState::Owned);
6926 Discord_String Url__str{(uint8_t*)(Url.data()), Url.size()};
6927 Discord_ActivityButton_SetUrl(&instance_, Url__str);
6928}
6929const Activity Activity::nullobj{{}, DiscordObjectState::Invalid};
6930Activity::~Activity()
6931{
6932 if (state_ == DiscordObjectState::Owned) {
6933 Drop();
6934 state_ = DiscordObjectState::Invalid;
6935 }
6936}
6937Activity::Activity(Activity&& other) noexcept
6938 : instance_(other.instance_)
6939 , state_(other.state_)
6940{
6941 other.state_ = DiscordObjectState::Invalid;
6942}
6943Activity& Activity::operator=(Activity&& other) noexcept
6944{
6945 if (this != &other) {
6946 if (state_ == DiscordObjectState::Owned) {
6947 Drop();
6948 }
6949 instance_ = other.instance_;
6950 state_ = other.state_;
6951 other.state_ = DiscordObjectState::Invalid;
6952 }
6953 return *this;
6954}
6955Activity::Activity(const Activity& arg0)
6956 : instance_{}
6957 , state_(DiscordObjectState::Invalid)
6958{
6959 if (arg0.state_ == DiscordObjectState::Owned) {
6960 Discord_Activity_Clone(&instance_, arg0.instance());
6961
6962 state_ = DiscordObjectState::Owned;
6963 }
6964}
6965Activity& Activity::operator=(const Activity& arg0)
6966{
6967 if (this != &arg0) {
6968 if (state_ == DiscordObjectState::Owned) {
6969 Drop();
6970 state_ = DiscordObjectState::Invalid;
6971 }
6972 if (arg0.state_ == DiscordObjectState::Owned) {
6973 Discord_Activity_Clone(&instance_, arg0.instance());
6974
6975 state_ = DiscordObjectState::Owned;
6976 }
6977 }
6978 return *this;
6979}
6980Activity::Activity(Discord_Activity instance, DiscordObjectState state)
6981 : instance_(instance)
6982 , state_(state)
6983{
6984}
6985Activity::Activity()
6986{
6987 assert(state_ == DiscordObjectState::Invalid);
6988 Discord_Activity_Init(&instance_);
6989 state_ = DiscordObjectState::Owned;
6990}
6991void Activity::Drop()
6992{
6993 if (state_ != DiscordObjectState::Owned) {
6994 return;
6995 }
6996 Discord_Activity_Drop(&instance_);
6997 state_ = DiscordObjectState::Invalid;
6998}
6999void Activity::AddButton(discordpp::ActivityButton button)
7000{
7001 assert(state_ == DiscordObjectState::Owned);
7002 Discord_Activity_AddButton(&instance_, button.instance());
7003}
7004bool Activity::Equals(discordpp::Activity other) const
7005{
7006 assert(state_ == DiscordObjectState::Owned);
7007 bool returnValue__;
7008 returnValue__ = Discord_Activity_Equals(&instance_, other.instance());
7009 return returnValue__;
7010}
7011std::vector<discordpp::ActivityButton> Activity::GetButtons() const
7012{
7013 assert(state_ == DiscordObjectState::Owned);
7014 Discord_ActivityButtonSpan returnValueNative__;
7015 Discord_Activity_GetButtons(&instance_, &returnValueNative__);
7016 std::vector<discordpp::ActivityButton> returnValue__;
7017 returnValue__.reserve(returnValueNative__.size);
7018 for (size_t i__ = 0; i__ < returnValueNative__.size; ++i__) {
7019 returnValue__.emplace_back(returnValueNative__.ptr[i__], DiscordObjectState::Owned);
7020 }
7021 Discord_Free(returnValueNative__.ptr);
7022 return returnValue__;
7023}
7024std::string Activity::Name() const
7025{
7026 assert(state_ == DiscordObjectState::Owned);
7027 Discord_String returnValueNative__;
7028 Discord_Activity_Name(&instance_, &returnValueNative__);
7029 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
7030 returnValueNative__.size);
7031 Discord_Free(returnValueNative__.ptr);
7032 return returnValue__;
7033}
7034void Activity::SetName(std::string Name)
7035{
7036 assert(state_ == DiscordObjectState::Owned);
7037 Discord_String Name__str{(uint8_t*)(Name.data()), Name.size()};
7038 Discord_Activity_SetName(&instance_, Name__str);
7039}
7040discordpp::ActivityTypes Activity::Type() const
7041{
7042 assert(state_ == DiscordObjectState::Owned);
7043 Discord_ActivityTypes returnValue__;
7044 returnValue__ = Discord_Activity_Type(&instance_);
7045 return static_cast<discordpp::ActivityTypes>(returnValue__);
7046}
7047void Activity::SetType(discordpp::ActivityTypes Type)
7048{
7049 assert(state_ == DiscordObjectState::Owned);
7050 Discord_Activity_SetType(&instance_, static_cast<Discord_ActivityTypes>(Type));
7051}
7052std::optional<discordpp::StatusDisplayTypes> Activity::StatusDisplayType() const
7053{
7054 assert(state_ == DiscordObjectState::Owned);
7055 bool returnIsNonNull__;
7056 Discord_StatusDisplayTypes returnValueNative__;
7057 returnIsNonNull__ = Discord_Activity_StatusDisplayType(&instance_, &returnValueNative__);
7058 if (!returnIsNonNull__) {
7059 return {};
7060 }
7061 auto returnValue__ = static_cast<discordpp::StatusDisplayTypes>(returnValueNative__);
7062 return returnValue__;
7063}
7064void Activity::SetStatusDisplayType(std::optional<discordpp::StatusDisplayTypes> StatusDisplayType)
7065{
7066 assert(state_ == DiscordObjectState::Owned);
7067 Discord_Activity_SetStatusDisplayType(
7068 &instance_,
7069 (StatusDisplayType.has_value()
7070 ? reinterpret_cast<Discord_StatusDisplayTypes*>(&*StatusDisplayType)
7071 : nullptr));
7072}
7073std::optional<std::string> Activity::State() const
7074{
7075 assert(state_ == DiscordObjectState::Owned);
7076 bool returnIsNonNull__;
7077 Discord_String returnValueNative__;
7078 returnIsNonNull__ = Discord_Activity_State(&instance_, &returnValueNative__);
7079 if (!returnIsNonNull__) {
7080 return {};
7081 }
7082 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
7083 returnValueNative__.size);
7084 Discord_Free(returnValueNative__.ptr);
7085 return returnValue__;
7086}
7087void Activity::SetState(std::optional<std::string> State)
7088{
7089 assert(state_ == DiscordObjectState::Owned);
7090 Discord_String State__str{};
7091 if (State.has_value()) {
7092 State__str.ptr = reinterpret_cast<uint8_t*>(State->data());
7093 State__str.size = State->size();
7094 }
7095 Discord_Activity_SetState(&instance_, (State.has_value() ? &State__str : nullptr));
7096}
7097std::optional<std::string> Activity::StateUrl() const
7098{
7099 assert(state_ == DiscordObjectState::Owned);
7100 bool returnIsNonNull__;
7101 Discord_String returnValueNative__;
7102 returnIsNonNull__ = Discord_Activity_StateUrl(&instance_, &returnValueNative__);
7103 if (!returnIsNonNull__) {
7104 return {};
7105 }
7106 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
7107 returnValueNative__.size);
7108 Discord_Free(returnValueNative__.ptr);
7109 return returnValue__;
7110}
7111void Activity::SetStateUrl(std::optional<std::string> StateUrl)
7112{
7113 assert(state_ == DiscordObjectState::Owned);
7114 Discord_String StateUrl__str{};
7115 if (StateUrl.has_value()) {
7116 StateUrl__str.ptr = reinterpret_cast<uint8_t*>(StateUrl->data());
7117 StateUrl__str.size = StateUrl->size();
7118 }
7119 Discord_Activity_SetStateUrl(&instance_, (StateUrl.has_value() ? &StateUrl__str : nullptr));
7120}
7121std::optional<std::string> Activity::Details() const
7122{
7123 assert(state_ == DiscordObjectState::Owned);
7124 bool returnIsNonNull__;
7125 Discord_String returnValueNative__;
7126 returnIsNonNull__ = Discord_Activity_Details(&instance_, &returnValueNative__);
7127 if (!returnIsNonNull__) {
7128 return {};
7129 }
7130 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
7131 returnValueNative__.size);
7132 Discord_Free(returnValueNative__.ptr);
7133 return returnValue__;
7134}
7135void Activity::SetDetails(std::optional<std::string> Details)
7136{
7137 assert(state_ == DiscordObjectState::Owned);
7138 Discord_String Details__str{};
7139 if (Details.has_value()) {
7140 Details__str.ptr = reinterpret_cast<uint8_t*>(Details->data());
7141 Details__str.size = Details->size();
7142 }
7143 Discord_Activity_SetDetails(&instance_, (Details.has_value() ? &Details__str : nullptr));
7144}
7145std::optional<std::string> Activity::DetailsUrl() const
7146{
7147 assert(state_ == DiscordObjectState::Owned);
7148 bool returnIsNonNull__;
7149 Discord_String returnValueNative__;
7150 returnIsNonNull__ = Discord_Activity_DetailsUrl(&instance_, &returnValueNative__);
7151 if (!returnIsNonNull__) {
7152 return {};
7153 }
7154 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
7155 returnValueNative__.size);
7156 Discord_Free(returnValueNative__.ptr);
7157 return returnValue__;
7158}
7159void Activity::SetDetailsUrl(std::optional<std::string> DetailsUrl)
7160{
7161 assert(state_ == DiscordObjectState::Owned);
7162 Discord_String DetailsUrl__str{};
7163 if (DetailsUrl.has_value()) {
7164 DetailsUrl__str.ptr = reinterpret_cast<uint8_t*>(DetailsUrl->data());
7165 DetailsUrl__str.size = DetailsUrl->size();
7166 }
7167 Discord_Activity_SetDetailsUrl(&instance_,
7168 (DetailsUrl.has_value() ? &DetailsUrl__str : nullptr));
7169}
7170std::optional<uint64_t> Activity::ApplicationId() const
7171{
7172 assert(state_ == DiscordObjectState::Owned);
7173 bool returnIsNonNull__;
7174 uint64_t returnValue__;
7175 returnIsNonNull__ = Discord_Activity_ApplicationId(&instance_, &returnValue__);
7176 if (!returnIsNonNull__) {
7177 return std::nullopt;
7178 }
7179 return returnValue__;
7180}
7181void Activity::SetApplicationId(std::optional<uint64_t> ApplicationId)
7182{
7183 assert(state_ == DiscordObjectState::Owned);
7184 Discord_Activity_SetApplicationId(&instance_,
7185 (ApplicationId.has_value() ? &*ApplicationId : nullptr));
7186}
7187std::optional<uint64_t> Activity::ParentApplicationId() const
7188{
7189 assert(state_ == DiscordObjectState::Owned);
7190 bool returnIsNonNull__;
7191 uint64_t returnValue__;
7192 returnIsNonNull__ = Discord_Activity_ParentApplicationId(&instance_, &returnValue__);
7193 if (!returnIsNonNull__) {
7194 return std::nullopt;
7195 }
7196 return returnValue__;
7197}
7198void Activity::SetParentApplicationId(std::optional<uint64_t> ParentApplicationId)
7199{
7200 assert(state_ == DiscordObjectState::Owned);
7201 Discord_Activity_SetParentApplicationId(
7202 &instance_, (ParentApplicationId.has_value() ? &*ParentApplicationId : nullptr));
7203}
7204std::optional<discordpp::ActivityAssets> Activity::Assets() const
7205{
7206 assert(state_ == DiscordObjectState::Owned);
7207 bool returnIsNonNull__;
7208 Discord_ActivityAssets returnValueNative__;
7209 returnIsNonNull__ = Discord_Activity_Assets(&instance_, &returnValueNative__);
7210 if (!returnIsNonNull__) {
7211 return {};
7212 }
7213 discordpp::ActivityAssets returnValue__(returnValueNative__, DiscordObjectState::Owned);
7214 return returnValue__;
7215}
7216void Activity::SetAssets(std::optional<discordpp::ActivityAssets> Assets)
7217{
7218 assert(state_ == DiscordObjectState::Owned);
7219 Discord_Activity_SetAssets(&instance_, (Assets.has_value() ? Assets->instance() : nullptr));
7220}
7221std::optional<discordpp::ActivityTimestamps> Activity::Timestamps() const
7222{
7223 assert(state_ == DiscordObjectState::Owned);
7224 bool returnIsNonNull__;
7225 Discord_ActivityTimestamps returnValueNative__;
7226 returnIsNonNull__ = Discord_Activity_Timestamps(&instance_, &returnValueNative__);
7227 if (!returnIsNonNull__) {
7228 return {};
7229 }
7230 discordpp::ActivityTimestamps returnValue__(returnValueNative__, DiscordObjectState::Owned);
7231 return returnValue__;
7232}
7233void Activity::SetTimestamps(std::optional<discordpp::ActivityTimestamps> Timestamps)
7234{
7235 assert(state_ == DiscordObjectState::Owned);
7236 Discord_Activity_SetTimestamps(&instance_,
7237 (Timestamps.has_value() ? Timestamps->instance() : nullptr));
7238}
7239std::optional<discordpp::ActivityParty> Activity::Party() const
7240{
7241 assert(state_ == DiscordObjectState::Owned);
7242 bool returnIsNonNull__;
7243 Discord_ActivityParty returnValueNative__;
7244 returnIsNonNull__ = Discord_Activity_Party(&instance_, &returnValueNative__);
7245 if (!returnIsNonNull__) {
7246 return {};
7247 }
7248 discordpp::ActivityParty returnValue__(returnValueNative__, DiscordObjectState::Owned);
7249 return returnValue__;
7250}
7251void Activity::SetParty(std::optional<discordpp::ActivityParty> Party)
7252{
7253 assert(state_ == DiscordObjectState::Owned);
7254 Discord_Activity_SetParty(&instance_, (Party.has_value() ? Party->instance() : nullptr));
7255}
7256std::optional<discordpp::ActivitySecrets> Activity::Secrets() const
7257{
7258 assert(state_ == DiscordObjectState::Owned);
7259 bool returnIsNonNull__;
7260 Discord_ActivitySecrets returnValueNative__;
7261 returnIsNonNull__ = Discord_Activity_Secrets(&instance_, &returnValueNative__);
7262 if (!returnIsNonNull__) {
7263 return {};
7264 }
7265 discordpp::ActivitySecrets returnValue__(returnValueNative__, DiscordObjectState::Owned);
7266 return returnValue__;
7267}
7268void Activity::SetSecrets(std::optional<discordpp::ActivitySecrets> Secrets)
7269{
7270 assert(state_ == DiscordObjectState::Owned);
7271 Discord_Activity_SetSecrets(&instance_, (Secrets.has_value() ? Secrets->instance() : nullptr));
7272}
7273discordpp::ActivityGamePlatforms Activity::SupportedPlatforms() const
7274{
7275 assert(state_ == DiscordObjectState::Owned);
7276 Discord_ActivityGamePlatforms returnValue__;
7277 returnValue__ = Discord_Activity_SupportedPlatforms(&instance_);
7278 return static_cast<discordpp::ActivityGamePlatforms>(returnValue__);
7279}
7280void Activity::SetSupportedPlatforms(discordpp::ActivityGamePlatforms SupportedPlatforms)
7281{
7282 assert(state_ == DiscordObjectState::Owned);
7283 Discord_Activity_SetSupportedPlatforms(
7284 &instance_, static_cast<Discord_ActivityGamePlatforms>(SupportedPlatforms));
7285}
7286const ClientResult ClientResult::nullobj{{}, DiscordObjectState::Invalid};
7287ClientResult::~ClientResult()
7288{
7289 if (state_ == DiscordObjectState::Owned) {
7290 Drop();
7291 state_ = DiscordObjectState::Invalid;
7292 }
7293}
7294ClientResult::ClientResult(ClientResult&& other) noexcept
7295 : instance_(other.instance_)
7296 , state_(other.state_)
7297{
7298 other.state_ = DiscordObjectState::Invalid;
7299}
7300ClientResult& ClientResult::operator=(ClientResult&& other) noexcept
7301{
7302 if (this != &other) {
7303 if (state_ == DiscordObjectState::Owned) {
7304 Drop();
7305 }
7306 instance_ = other.instance_;
7307 state_ = other.state_;
7308 other.state_ = DiscordObjectState::Invalid;
7309 }
7310 return *this;
7311}
7312ClientResult::ClientResult(const ClientResult& arg0)
7313 : instance_{}
7314 , state_(DiscordObjectState::Invalid)
7315{
7316 if (arg0.state_ == DiscordObjectState::Owned) {
7317 Discord_ClientResult_Clone(&instance_, arg0.instance());
7318
7319 state_ = DiscordObjectState::Owned;
7320 }
7321}
7322ClientResult& ClientResult::operator=(const ClientResult& arg0)
7323{
7324 if (this != &arg0) {
7325 if (state_ == DiscordObjectState::Owned) {
7326 Drop();
7327 state_ = DiscordObjectState::Invalid;
7328 }
7329 if (arg0.state_ == DiscordObjectState::Owned) {
7330 Discord_ClientResult_Clone(&instance_, arg0.instance());
7331
7332 state_ = DiscordObjectState::Owned;
7333 }
7334 }
7335 return *this;
7336}
7337ClientResult::ClientResult(Discord_ClientResult instance, DiscordObjectState state)
7338 : instance_(instance)
7339 , state_(state)
7340{
7341}
7342void ClientResult::Drop()
7343{
7344 if (state_ != DiscordObjectState::Owned) {
7345 return;
7346 }
7347 Discord_ClientResult_Drop(&instance_);
7348 state_ = DiscordObjectState::Invalid;
7349}
7350std::string ClientResult::ToString() const
7351{
7352 assert(state_ == DiscordObjectState::Owned);
7353 Discord_String returnValueNative__;
7354 Discord_ClientResult_ToString(&instance_, &returnValueNative__);
7355 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
7356 returnValueNative__.size);
7357 Discord_Free(returnValueNative__.ptr);
7358 return returnValue__;
7359}
7360discordpp::ErrorType ClientResult::Type() const
7361{
7362 assert(state_ == DiscordObjectState::Owned);
7363 Discord_ErrorType returnValue__;
7364 returnValue__ = Discord_ClientResult_Type(&instance_);
7365 return static_cast<discordpp::ErrorType>(returnValue__);
7366}
7367void ClientResult::SetType(discordpp::ErrorType Type)
7368{
7369 assert(state_ == DiscordObjectState::Owned);
7370 Discord_ClientResult_SetType(&instance_, static_cast<Discord_ErrorType>(Type));
7371}
7372std::string ClientResult::Error() const
7373{
7374 assert(state_ == DiscordObjectState::Owned);
7375 Discord_String returnValueNative__;
7376 Discord_ClientResult_Error(&instance_, &returnValueNative__);
7377 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
7378 returnValueNative__.size);
7379 Discord_Free(returnValueNative__.ptr);
7380 return returnValue__;
7381}
7382void ClientResult::SetError(std::string Error)
7383{
7384 assert(state_ == DiscordObjectState::Owned);
7385 Discord_String Error__str{(uint8_t*)(Error.data()), Error.size()};
7386 Discord_ClientResult_SetError(&instance_, Error__str);
7387}
7388int32_t ClientResult::ErrorCode() const
7389{
7390 assert(state_ == DiscordObjectState::Owned);
7391 int32_t returnValue__;
7392 returnValue__ = Discord_ClientResult_ErrorCode(&instance_);
7393 return returnValue__;
7394}
7395void ClientResult::SetErrorCode(int32_t ErrorCode)
7396{
7397 assert(state_ == DiscordObjectState::Owned);
7398 Discord_ClientResult_SetErrorCode(&instance_, ErrorCode);
7399}
7400discordpp::HttpStatusCode ClientResult::Status() const
7401{
7402 assert(state_ == DiscordObjectState::Owned);
7403 Discord_HttpStatusCode returnValue__;
7404 returnValue__ = Discord_ClientResult_Status(&instance_);
7405 return static_cast<discordpp::HttpStatusCode>(returnValue__);
7406}
7407void ClientResult::SetStatus(discordpp::HttpStatusCode Status)
7408{
7409 assert(state_ == DiscordObjectState::Owned);
7410 Discord_ClientResult_SetStatus(&instance_, static_cast<Discord_HttpStatusCode>(Status));
7411}
7412std::string ClientResult::ResponseBody() const
7413{
7414 assert(state_ == DiscordObjectState::Owned);
7415 Discord_String returnValueNative__;
7416 Discord_ClientResult_ResponseBody(&instance_, &returnValueNative__);
7417 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
7418 returnValueNative__.size);
7419 Discord_Free(returnValueNative__.ptr);
7420 return returnValue__;
7421}
7422void ClientResult::SetResponseBody(std::string ResponseBody)
7423{
7424 assert(state_ == DiscordObjectState::Owned);
7425 Discord_String ResponseBody__str{(uint8_t*)(ResponseBody.data()), ResponseBody.size()};
7426 Discord_ClientResult_SetResponseBody(&instance_, ResponseBody__str);
7427}
7428bool ClientResult::Successful() const
7429{
7430 assert(state_ == DiscordObjectState::Owned);
7431 bool returnValue__;
7432 returnValue__ = Discord_ClientResult_Successful(&instance_);
7433 return returnValue__;
7434}
7435void ClientResult::SetSuccessful(bool Successful)
7436{
7437 assert(state_ == DiscordObjectState::Owned);
7438 Discord_ClientResult_SetSuccessful(&instance_, Successful);
7439}
7440bool ClientResult::Retryable() const
7441{
7442 assert(state_ == DiscordObjectState::Owned);
7443 bool returnValue__;
7444 returnValue__ = Discord_ClientResult_Retryable(&instance_);
7445 return returnValue__;
7446}
7447void ClientResult::SetRetryable(bool Retryable)
7448{
7449 assert(state_ == DiscordObjectState::Owned);
7450 Discord_ClientResult_SetRetryable(&instance_, Retryable);
7451}
7452float ClientResult::RetryAfter() const
7453{
7454 assert(state_ == DiscordObjectState::Owned);
7455 float returnValue__;
7456 returnValue__ = Discord_ClientResult_RetryAfter(&instance_);
7457 return returnValue__;
7458}
7459void ClientResult::SetRetryAfter(float RetryAfter)
7460{
7461 assert(state_ == DiscordObjectState::Owned);
7462 Discord_ClientResult_SetRetryAfter(&instance_, RetryAfter);
7463}
7464const AuthorizationCodeChallenge AuthorizationCodeChallenge::nullobj{{},
7465 DiscordObjectState::Invalid};
7466AuthorizationCodeChallenge::~AuthorizationCodeChallenge()
7467{
7468 if (state_ == DiscordObjectState::Owned) {
7469 Drop();
7470 state_ = DiscordObjectState::Invalid;
7471 }
7472}
7473AuthorizationCodeChallenge::AuthorizationCodeChallenge(AuthorizationCodeChallenge&& other) noexcept
7474 : instance_(other.instance_)
7475 , state_(other.state_)
7476{
7477 other.state_ = DiscordObjectState::Invalid;
7478}
7479AuthorizationCodeChallenge& AuthorizationCodeChallenge::operator=(
7480 AuthorizationCodeChallenge&& other) noexcept
7481{
7482 if (this != &other) {
7483 if (state_ == DiscordObjectState::Owned) {
7484 Drop();
7485 }
7486 instance_ = other.instance_;
7487 state_ = other.state_;
7488 other.state_ = DiscordObjectState::Invalid;
7489 }
7490 return *this;
7491}
7492AuthorizationCodeChallenge::AuthorizationCodeChallenge(const AuthorizationCodeChallenge& arg0)
7493 : instance_{}
7494 , state_(DiscordObjectState::Invalid)
7495{
7496 if (arg0.state_ == DiscordObjectState::Owned) {
7497 Discord_AuthorizationCodeChallenge_Clone(&instance_, arg0.instance());
7498
7499 state_ = DiscordObjectState::Owned;
7500 }
7501}
7502AuthorizationCodeChallenge& AuthorizationCodeChallenge::operator=(
7503 const AuthorizationCodeChallenge& arg0)
7504{
7505 if (this != &arg0) {
7506 if (state_ == DiscordObjectState::Owned) {
7507 Drop();
7508 state_ = DiscordObjectState::Invalid;
7509 }
7510 if (arg0.state_ == DiscordObjectState::Owned) {
7511 Discord_AuthorizationCodeChallenge_Clone(&instance_, arg0.instance());
7512
7513 state_ = DiscordObjectState::Owned;
7514 }
7515 }
7516 return *this;
7517}
7518AuthorizationCodeChallenge::AuthorizationCodeChallenge(Discord_AuthorizationCodeChallenge instance,
7519 DiscordObjectState state)
7520 : instance_(instance)
7521 , state_(state)
7522{
7523}
7524AuthorizationCodeChallenge::AuthorizationCodeChallenge()
7525{
7526 assert(state_ == DiscordObjectState::Invalid);
7527 Discord_AuthorizationCodeChallenge_Init(&instance_);
7528 state_ = DiscordObjectState::Owned;
7529}
7530void AuthorizationCodeChallenge::Drop()
7531{
7532 if (state_ != DiscordObjectState::Owned) {
7533 return;
7534 }
7535 Discord_AuthorizationCodeChallenge_Drop(&instance_);
7536 state_ = DiscordObjectState::Invalid;
7537}
7538discordpp::AuthenticationCodeChallengeMethod AuthorizationCodeChallenge::Method() const
7539{
7540 assert(state_ == DiscordObjectState::Owned);
7541 Discord_AuthenticationCodeChallengeMethod returnValue__;
7542 returnValue__ = Discord_AuthorizationCodeChallenge_Method(&instance_);
7543 return static_cast<discordpp::AuthenticationCodeChallengeMethod>(returnValue__);
7544}
7545void AuthorizationCodeChallenge::SetMethod(discordpp::AuthenticationCodeChallengeMethod Method)
7546{
7547 assert(state_ == DiscordObjectState::Owned);
7548 Discord_AuthorizationCodeChallenge_SetMethod(
7549 &instance_, static_cast<Discord_AuthenticationCodeChallengeMethod>(Method));
7550}
7551std::string AuthorizationCodeChallenge::Challenge() const
7552{
7553 assert(state_ == DiscordObjectState::Owned);
7554 Discord_String returnValueNative__;
7555 Discord_AuthorizationCodeChallenge_Challenge(&instance_, &returnValueNative__);
7556 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
7557 returnValueNative__.size);
7558 Discord_Free(returnValueNative__.ptr);
7559 return returnValue__;
7560}
7561void AuthorizationCodeChallenge::SetChallenge(std::string Challenge)
7562{
7563 assert(state_ == DiscordObjectState::Owned);
7564 Discord_String Challenge__str{(uint8_t*)(Challenge.data()), Challenge.size()};
7565 Discord_AuthorizationCodeChallenge_SetChallenge(&instance_, Challenge__str);
7566}
7567const AuthorizationCodeVerifier AuthorizationCodeVerifier::nullobj{{}, DiscordObjectState::Invalid};
7568AuthorizationCodeVerifier::~AuthorizationCodeVerifier()
7569{
7570 if (state_ == DiscordObjectState::Owned) {
7571 Drop();
7572 state_ = DiscordObjectState::Invalid;
7573 }
7574}
7575AuthorizationCodeVerifier::AuthorizationCodeVerifier(AuthorizationCodeVerifier&& other) noexcept
7576 : instance_(other.instance_)
7577 , state_(other.state_)
7578{
7579 other.state_ = DiscordObjectState::Invalid;
7580}
7581AuthorizationCodeVerifier& AuthorizationCodeVerifier::operator=(
7582 AuthorizationCodeVerifier&& other) noexcept
7583{
7584 if (this != &other) {
7585 if (state_ == DiscordObjectState::Owned) {
7586 Drop();
7587 }
7588 instance_ = other.instance_;
7589 state_ = other.state_;
7590 other.state_ = DiscordObjectState::Invalid;
7591 }
7592 return *this;
7593}
7594AuthorizationCodeVerifier::AuthorizationCodeVerifier(const AuthorizationCodeVerifier& arg0)
7595 : instance_{}
7596 , state_(DiscordObjectState::Invalid)
7597{
7598 if (arg0.state_ == DiscordObjectState::Owned) {
7599 Discord_AuthorizationCodeVerifier_Clone(&instance_, arg0.instance());
7600
7601 state_ = DiscordObjectState::Owned;
7602 }
7603}
7604AuthorizationCodeVerifier& AuthorizationCodeVerifier::operator=(
7605 const AuthorizationCodeVerifier& arg0)
7606{
7607 if (this != &arg0) {
7608 if (state_ == DiscordObjectState::Owned) {
7609 Drop();
7610 state_ = DiscordObjectState::Invalid;
7611 }
7612 if (arg0.state_ == DiscordObjectState::Owned) {
7613 Discord_AuthorizationCodeVerifier_Clone(&instance_, arg0.instance());
7614
7615 state_ = DiscordObjectState::Owned;
7616 }
7617 }
7618 return *this;
7619}
7620AuthorizationCodeVerifier::AuthorizationCodeVerifier(Discord_AuthorizationCodeVerifier instance,
7621 DiscordObjectState state)
7622 : instance_(instance)
7623 , state_(state)
7624{
7625}
7626void AuthorizationCodeVerifier::Drop()
7627{
7628 if (state_ != DiscordObjectState::Owned) {
7629 return;
7630 }
7631 Discord_AuthorizationCodeVerifier_Drop(&instance_);
7632 state_ = DiscordObjectState::Invalid;
7633}
7634discordpp::AuthorizationCodeChallenge AuthorizationCodeVerifier::Challenge() const
7635{
7636 assert(state_ == DiscordObjectState::Owned);
7637 Discord_AuthorizationCodeChallenge returnValueNative__{};
7638 Discord_AuthorizationCodeVerifier_Challenge(&instance_, &returnValueNative__);
7639 discordpp::AuthorizationCodeChallenge returnValue__(returnValueNative__,
7640 DiscordObjectState::Owned);
7641 return returnValue__;
7642}
7643void AuthorizationCodeVerifier::SetChallenge(discordpp::AuthorizationCodeChallenge Challenge)
7644{
7645 assert(state_ == DiscordObjectState::Owned);
7646 Discord_AuthorizationCodeVerifier_SetChallenge(&instance_, Challenge.instance());
7647}
7648std::string AuthorizationCodeVerifier::Verifier() const
7649{
7650 assert(state_ == DiscordObjectState::Owned);
7651 Discord_String returnValueNative__;
7652 Discord_AuthorizationCodeVerifier_Verifier(&instance_, &returnValueNative__);
7653 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
7654 returnValueNative__.size);
7655 Discord_Free(returnValueNative__.ptr);
7656 return returnValue__;
7657}
7658void AuthorizationCodeVerifier::SetVerifier(std::string Verifier)
7659{
7660 assert(state_ == DiscordObjectState::Owned);
7661 Discord_String Verifier__str{(uint8_t*)(Verifier.data()), Verifier.size()};
7662 Discord_AuthorizationCodeVerifier_SetVerifier(&instance_, Verifier__str);
7663}
7664const AuthorizationArgs AuthorizationArgs::nullobj{{}, DiscordObjectState::Invalid};
7665AuthorizationArgs::~AuthorizationArgs()
7666{
7667 if (state_ == DiscordObjectState::Owned) {
7668 Drop();
7669 state_ = DiscordObjectState::Invalid;
7670 }
7671}
7672AuthorizationArgs::AuthorizationArgs(AuthorizationArgs&& other) noexcept
7673 : instance_(other.instance_)
7674 , state_(other.state_)
7675{
7676 other.state_ = DiscordObjectState::Invalid;
7677}
7678AuthorizationArgs& AuthorizationArgs::operator=(AuthorizationArgs&& other) noexcept
7679{
7680 if (this != &other) {
7681 if (state_ == DiscordObjectState::Owned) {
7682 Drop();
7683 }
7684 instance_ = other.instance_;
7685 state_ = other.state_;
7686 other.state_ = DiscordObjectState::Invalid;
7687 }
7688 return *this;
7689}
7690AuthorizationArgs::AuthorizationArgs(const AuthorizationArgs& arg0)
7691 : instance_{}
7692 , state_(DiscordObjectState::Invalid)
7693{
7694 if (arg0.state_ == DiscordObjectState::Owned) {
7695 Discord_AuthorizationArgs_Clone(&instance_, arg0.instance());
7696
7697 state_ = DiscordObjectState::Owned;
7698 }
7699}
7700AuthorizationArgs& AuthorizationArgs::operator=(const AuthorizationArgs& arg0)
7701{
7702 if (this != &arg0) {
7703 if (state_ == DiscordObjectState::Owned) {
7704 Drop();
7705 state_ = DiscordObjectState::Invalid;
7706 }
7707 if (arg0.state_ == DiscordObjectState::Owned) {
7708 Discord_AuthorizationArgs_Clone(&instance_, arg0.instance());
7709
7710 state_ = DiscordObjectState::Owned;
7711 }
7712 }
7713 return *this;
7714}
7715AuthorizationArgs::AuthorizationArgs(Discord_AuthorizationArgs instance, DiscordObjectState state)
7716 : instance_(instance)
7717 , state_(state)
7718{
7719}
7720AuthorizationArgs::AuthorizationArgs()
7721{
7722 assert(state_ == DiscordObjectState::Invalid);
7723 Discord_AuthorizationArgs_Init(&instance_);
7724 state_ = DiscordObjectState::Owned;
7725}
7726void AuthorizationArgs::Drop()
7727{
7728 if (state_ != DiscordObjectState::Owned) {
7729 return;
7730 }
7731 Discord_AuthorizationArgs_Drop(&instance_);
7732 state_ = DiscordObjectState::Invalid;
7733}
7734uint64_t AuthorizationArgs::ClientId() const
7735{
7736 assert(state_ == DiscordObjectState::Owned);
7737 uint64_t returnValue__;
7738 returnValue__ = Discord_AuthorizationArgs_ClientId(&instance_);
7739 return returnValue__;
7740}
7741void AuthorizationArgs::SetClientId(uint64_t ClientId)
7742{
7743 assert(state_ == DiscordObjectState::Owned);
7744 Discord_AuthorizationArgs_SetClientId(&instance_, ClientId);
7745}
7746std::string AuthorizationArgs::Scopes() const
7747{
7748 assert(state_ == DiscordObjectState::Owned);
7749 Discord_String returnValueNative__;
7750 Discord_AuthorizationArgs_Scopes(&instance_, &returnValueNative__);
7751 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
7752 returnValueNative__.size);
7753 Discord_Free(returnValueNative__.ptr);
7754 return returnValue__;
7755}
7756void AuthorizationArgs::SetScopes(std::string Scopes)
7757{
7758 assert(state_ == DiscordObjectState::Owned);
7759 Discord_String Scopes__str{(uint8_t*)(Scopes.data()), Scopes.size()};
7760 Discord_AuthorizationArgs_SetScopes(&instance_, Scopes__str);
7761}
7762std::optional<std::string> AuthorizationArgs::State() const
7763{
7764 assert(state_ == DiscordObjectState::Owned);
7765 bool returnIsNonNull__;
7766 Discord_String returnValueNative__;
7767 returnIsNonNull__ = Discord_AuthorizationArgs_State(&instance_, &returnValueNative__);
7768 if (!returnIsNonNull__) {
7769 return {};
7770 }
7771 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
7772 returnValueNative__.size);
7773 Discord_Free(returnValueNative__.ptr);
7774 return returnValue__;
7775}
7776void AuthorizationArgs::SetState(std::optional<std::string> State)
7777{
7778 assert(state_ == DiscordObjectState::Owned);
7779 Discord_String State__str{};
7780 if (State.has_value()) {
7781 State__str.ptr = reinterpret_cast<uint8_t*>(State->data());
7782 State__str.size = State->size();
7783 }
7784 Discord_AuthorizationArgs_SetState(&instance_, (State.has_value() ? &State__str : nullptr));
7785}
7786std::optional<std::string> AuthorizationArgs::Nonce() const
7787{
7788 assert(state_ == DiscordObjectState::Owned);
7789 bool returnIsNonNull__;
7790 Discord_String returnValueNative__;
7791 returnIsNonNull__ = Discord_AuthorizationArgs_Nonce(&instance_, &returnValueNative__);
7792 if (!returnIsNonNull__) {
7793 return {};
7794 }
7795 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
7796 returnValueNative__.size);
7797 Discord_Free(returnValueNative__.ptr);
7798 return returnValue__;
7799}
7800void AuthorizationArgs::SetNonce(std::optional<std::string> Nonce)
7801{
7802 assert(state_ == DiscordObjectState::Owned);
7803 Discord_String Nonce__str{};
7804 if (Nonce.has_value()) {
7805 Nonce__str.ptr = reinterpret_cast<uint8_t*>(Nonce->data());
7806 Nonce__str.size = Nonce->size();
7807 }
7808 Discord_AuthorizationArgs_SetNonce(&instance_, (Nonce.has_value() ? &Nonce__str : nullptr));
7809}
7810std::optional<discordpp::AuthorizationCodeChallenge> AuthorizationArgs::CodeChallenge() const
7811{
7812 assert(state_ == DiscordObjectState::Owned);
7813 bool returnIsNonNull__;
7814 Discord_AuthorizationCodeChallenge returnValueNative__;
7815 returnIsNonNull__ = Discord_AuthorizationArgs_CodeChallenge(&instance_, &returnValueNative__);
7816 if (!returnIsNonNull__) {
7817 return {};
7818 }
7819 discordpp::AuthorizationCodeChallenge returnValue__(returnValueNative__,
7820 DiscordObjectState::Owned);
7821 return returnValue__;
7822}
7823void AuthorizationArgs::SetCodeChallenge(
7824 std::optional<discordpp::AuthorizationCodeChallenge> CodeChallenge)
7825{
7826 assert(state_ == DiscordObjectState::Owned);
7827 Discord_AuthorizationArgs_SetCodeChallenge(
7828 &instance_, (CodeChallenge.has_value() ? CodeChallenge->instance() : nullptr));
7829}
7830std::optional<discordpp::IntegrationType> AuthorizationArgs::IntegrationType() const
7831{
7832 assert(state_ == DiscordObjectState::Owned);
7833 bool returnIsNonNull__;
7834 Discord_IntegrationType returnValueNative__;
7835 returnIsNonNull__ = Discord_AuthorizationArgs_IntegrationType(&instance_, &returnValueNative__);
7836 if (!returnIsNonNull__) {
7837 return {};
7838 }
7839 auto returnValue__ = static_cast<discordpp::IntegrationType>(returnValueNative__);
7840 return returnValue__;
7841}
7842void AuthorizationArgs::SetIntegrationType(
7843 std::optional<discordpp::IntegrationType> IntegrationType)
7844{
7845 assert(state_ == DiscordObjectState::Owned);
7846 Discord_AuthorizationArgs_SetIntegrationType(
7847 &instance_,
7848 (IntegrationType.has_value() ? reinterpret_cast<Discord_IntegrationType*>(&*IntegrationType)
7849 : nullptr));
7850}
7851std::optional<std::string> AuthorizationArgs::CustomSchemeParam() const
7852{
7853 assert(state_ == DiscordObjectState::Owned);
7854 bool returnIsNonNull__;
7855 Discord_String returnValueNative__;
7856 returnIsNonNull__ =
7857 Discord_AuthorizationArgs_CustomSchemeParam(&instance_, &returnValueNative__);
7858 if (!returnIsNonNull__) {
7859 return {};
7860 }
7861 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
7862 returnValueNative__.size);
7863 Discord_Free(returnValueNative__.ptr);
7864 return returnValue__;
7865}
7866void AuthorizationArgs::SetCustomSchemeParam(std::optional<std::string> CustomSchemeParam)
7867{
7868 assert(state_ == DiscordObjectState::Owned);
7869 Discord_String CustomSchemeParam__str{};
7870 if (CustomSchemeParam.has_value()) {
7871 CustomSchemeParam__str.ptr = reinterpret_cast<uint8_t*>(CustomSchemeParam->data());
7872 CustomSchemeParam__str.size = CustomSchemeParam->size();
7873 }
7874 Discord_AuthorizationArgs_SetCustomSchemeParam(
7875 &instance_, (CustomSchemeParam.has_value() ? &CustomSchemeParam__str : nullptr));
7876}
7877const DeviceAuthorizationArgs DeviceAuthorizationArgs::nullobj{{}, DiscordObjectState::Invalid};
7878DeviceAuthorizationArgs::~DeviceAuthorizationArgs()
7879{
7880 if (state_ == DiscordObjectState::Owned) {
7881 Drop();
7882 state_ = DiscordObjectState::Invalid;
7883 }
7884}
7885DeviceAuthorizationArgs::DeviceAuthorizationArgs(DeviceAuthorizationArgs&& other) noexcept
7886 : instance_(other.instance_)
7887 , state_(other.state_)
7888{
7889 other.state_ = DiscordObjectState::Invalid;
7890}
7891DeviceAuthorizationArgs& DeviceAuthorizationArgs::operator=(
7892 DeviceAuthorizationArgs&& other) noexcept
7893{
7894 if (this != &other) {
7895 if (state_ == DiscordObjectState::Owned) {
7896 Drop();
7897 }
7898 instance_ = other.instance_;
7899 state_ = other.state_;
7900 other.state_ = DiscordObjectState::Invalid;
7901 }
7902 return *this;
7903}
7904DeviceAuthorizationArgs::DeviceAuthorizationArgs(const DeviceAuthorizationArgs& arg0)
7905 : instance_{}
7906 , state_(DiscordObjectState::Invalid)
7907{
7908 if (arg0.state_ == DiscordObjectState::Owned) {
7909 Discord_DeviceAuthorizationArgs_Clone(&instance_, arg0.instance());
7910
7911 state_ = DiscordObjectState::Owned;
7912 }
7913}
7914DeviceAuthorizationArgs& DeviceAuthorizationArgs::operator=(const DeviceAuthorizationArgs& arg0)
7915{
7916 if (this != &arg0) {
7917 if (state_ == DiscordObjectState::Owned) {
7918 Drop();
7919 state_ = DiscordObjectState::Invalid;
7920 }
7921 if (arg0.state_ == DiscordObjectState::Owned) {
7922 Discord_DeviceAuthorizationArgs_Clone(&instance_, arg0.instance());
7923
7924 state_ = DiscordObjectState::Owned;
7925 }
7926 }
7927 return *this;
7928}
7929DeviceAuthorizationArgs::DeviceAuthorizationArgs(Discord_DeviceAuthorizationArgs instance,
7930 DiscordObjectState state)
7931 : instance_(instance)
7932 , state_(state)
7933{
7934}
7935DeviceAuthorizationArgs::DeviceAuthorizationArgs()
7936{
7937 assert(state_ == DiscordObjectState::Invalid);
7938 Discord_DeviceAuthorizationArgs_Init(&instance_);
7939 state_ = DiscordObjectState::Owned;
7940}
7941void DeviceAuthorizationArgs::Drop()
7942{
7943 if (state_ != DiscordObjectState::Owned) {
7944 return;
7945 }
7946 Discord_DeviceAuthorizationArgs_Drop(&instance_);
7947 state_ = DiscordObjectState::Invalid;
7948}
7949uint64_t DeviceAuthorizationArgs::ClientId() const
7950{
7951 assert(state_ == DiscordObjectState::Owned);
7952 uint64_t returnValue__;
7953 returnValue__ = Discord_DeviceAuthorizationArgs_ClientId(&instance_);
7954 return returnValue__;
7955}
7956void DeviceAuthorizationArgs::SetClientId(uint64_t ClientId)
7957{
7958 assert(state_ == DiscordObjectState::Owned);
7959 Discord_DeviceAuthorizationArgs_SetClientId(&instance_, ClientId);
7960}
7961std::string DeviceAuthorizationArgs::Scopes() const
7962{
7963 assert(state_ == DiscordObjectState::Owned);
7964 Discord_String returnValueNative__;
7965 Discord_DeviceAuthorizationArgs_Scopes(&instance_, &returnValueNative__);
7966 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
7967 returnValueNative__.size);
7968 Discord_Free(returnValueNative__.ptr);
7969 return returnValue__;
7970}
7971void DeviceAuthorizationArgs::SetScopes(std::string Scopes)
7972{
7973 assert(state_ == DiscordObjectState::Owned);
7974 Discord_String Scopes__str{(uint8_t*)(Scopes.data()), Scopes.size()};
7975 Discord_DeviceAuthorizationArgs_SetScopes(&instance_, Scopes__str);
7976}
7977const VoiceStateHandle VoiceStateHandle::nullobj{{}, DiscordObjectState::Invalid};
7978VoiceStateHandle::~VoiceStateHandle()
7979{
7980 if (state_ == DiscordObjectState::Owned) {
7981 Drop();
7982 state_ = DiscordObjectState::Invalid;
7983 }
7984}
7985VoiceStateHandle::VoiceStateHandle(VoiceStateHandle&& other) noexcept
7986 : instance_(other.instance_)
7987 , state_(other.state_)
7988{
7989 other.state_ = DiscordObjectState::Invalid;
7990}
7991VoiceStateHandle& VoiceStateHandle::operator=(VoiceStateHandle&& other) noexcept
7992{
7993 if (this != &other) {
7994 if (state_ == DiscordObjectState::Owned) {
7995 Drop();
7996 }
7997 instance_ = other.instance_;
7998 state_ = other.state_;
7999 other.state_ = DiscordObjectState::Invalid;
8000 }
8001 return *this;
8002}
8003VoiceStateHandle::VoiceStateHandle(const VoiceStateHandle& other)
8004 : instance_{}
8005 , state_(DiscordObjectState::Invalid)
8006{
8007 if (other.state_ == DiscordObjectState::Owned) {
8008 Discord_VoiceStateHandle_Clone(&instance_, other.instance());
8009
8010 state_ = DiscordObjectState::Owned;
8011 }
8012}
8013VoiceStateHandle& VoiceStateHandle::operator=(const VoiceStateHandle& other)
8014{
8015 if (this != &other) {
8016 if (state_ == DiscordObjectState::Owned) {
8017 Drop();
8018 state_ = DiscordObjectState::Invalid;
8019 }
8020 if (other.state_ == DiscordObjectState::Owned) {
8021 Discord_VoiceStateHandle_Clone(&instance_, other.instance());
8022
8023 state_ = DiscordObjectState::Owned;
8024 }
8025 }
8026 return *this;
8027}
8028VoiceStateHandle::VoiceStateHandle(Discord_VoiceStateHandle instance, DiscordObjectState state)
8029 : instance_(instance)
8030 , state_(state)
8031{
8032}
8033void VoiceStateHandle::Drop()
8034{
8035 if (state_ != DiscordObjectState::Owned) {
8036 return;
8037 }
8038 Discord_VoiceStateHandle_Drop(&instance_);
8039 state_ = DiscordObjectState::Invalid;
8040}
8041bool VoiceStateHandle::SelfDeaf() const
8042{
8043 assert(state_ == DiscordObjectState::Owned);
8044 bool returnValue__;
8045 returnValue__ = Discord_VoiceStateHandle_SelfDeaf(&instance_);
8046 return returnValue__;
8047}
8048bool VoiceStateHandle::SelfMute() const
8049{
8050 assert(state_ == DiscordObjectState::Owned);
8051 bool returnValue__;
8052 returnValue__ = Discord_VoiceStateHandle_SelfMute(&instance_);
8053 return returnValue__;
8054}
8055const VADThresholdSettings VADThresholdSettings::nullobj{{}, DiscordObjectState::Invalid};
8056VADThresholdSettings::~VADThresholdSettings()
8057{
8058 if (state_ == DiscordObjectState::Owned) {
8059 Drop();
8060 state_ = DiscordObjectState::Invalid;
8061 }
8062}
8063VADThresholdSettings::VADThresholdSettings(VADThresholdSettings&& other) noexcept
8064 : instance_(other.instance_)
8065 , state_(other.state_)
8066{
8067 other.state_ = DiscordObjectState::Invalid;
8068}
8069VADThresholdSettings& VADThresholdSettings::operator=(VADThresholdSettings&& other) noexcept
8070{
8071 if (this != &other) {
8072 if (state_ == DiscordObjectState::Owned) {
8073 Drop();
8074 }
8075 instance_ = other.instance_;
8076 state_ = other.state_;
8077 other.state_ = DiscordObjectState::Invalid;
8078 }
8079 return *this;
8080}
8081VADThresholdSettings::VADThresholdSettings(Discord_VADThresholdSettings instance,
8082 DiscordObjectState state)
8083 : instance_(instance)
8084 , state_(state)
8085{
8086}
8087void VADThresholdSettings::Drop()
8088{
8089 if (state_ != DiscordObjectState::Owned) {
8090 return;
8091 }
8092 Discord_VADThresholdSettings_Drop(&instance_);
8093 state_ = DiscordObjectState::Invalid;
8094}
8095float VADThresholdSettings::VadThreshold() const
8096{
8097 assert(state_ == DiscordObjectState::Owned);
8098 float returnValue__;
8099 returnValue__ = Discord_VADThresholdSettings_VadThreshold(&instance_);
8100 return returnValue__;
8101}
8102void VADThresholdSettings::SetVadThreshold(float VadThreshold)
8103{
8104 assert(state_ == DiscordObjectState::Owned);
8105 Discord_VADThresholdSettings_SetVadThreshold(&instance_, VadThreshold);
8106}
8107bool VADThresholdSettings::Automatic() const
8108{
8109 assert(state_ == DiscordObjectState::Owned);
8110 bool returnValue__;
8111 returnValue__ = Discord_VADThresholdSettings_Automatic(&instance_);
8112 return returnValue__;
8113}
8114void VADThresholdSettings::SetAutomatic(bool Automatic)
8115{
8116 assert(state_ == DiscordObjectState::Owned);
8117 Discord_VADThresholdSettings_SetAutomatic(&instance_, Automatic);
8118}
8119const Call Call::nullobj{{}, DiscordObjectState::Invalid};
8120Call::~Call()
8121{
8122 if (state_ == DiscordObjectState::Owned) {
8123 Drop();
8124 state_ = DiscordObjectState::Invalid;
8125 }
8126}
8127Call::Call(Call&& other) noexcept
8128 : instance_(other.instance_)
8129 , state_(other.state_)
8130{
8131 other.state_ = DiscordObjectState::Invalid;
8132}
8133Call& Call::operator=(Call&& other) noexcept
8134{
8135 if (this != &other) {
8136 if (state_ == DiscordObjectState::Owned) {
8137 Drop();
8138 }
8139 instance_ = other.instance_;
8140 state_ = other.state_;
8141 other.state_ = DiscordObjectState::Invalid;
8142 }
8143 return *this;
8144}
8145Call::Call(const Call& other)
8146 : instance_{}
8147 , state_(DiscordObjectState::Invalid)
8148{
8149 if (other.state_ == DiscordObjectState::Owned) {
8150 Discord_Call_Clone(&instance_, other.instance());
8151
8152 state_ = DiscordObjectState::Owned;
8153 }
8154}
8155Call& Call::operator=(const Call& other)
8156{
8157 if (this != &other) {
8158 if (state_ == DiscordObjectState::Owned) {
8159 Drop();
8160 state_ = DiscordObjectState::Invalid;
8161 }
8162 if (other.state_ == DiscordObjectState::Owned) {
8163 Discord_Call_Clone(&instance_, other.instance());
8164
8165 state_ = DiscordObjectState::Owned;
8166 }
8167 }
8168 return *this;
8169}
8170Call::Call(Discord_Call instance, DiscordObjectState state)
8171 : instance_(instance)
8172 , state_(state)
8173{
8174}
8175void Call::Drop()
8176{
8177 if (state_ != DiscordObjectState::Owned) {
8178 return;
8179 }
8180 Discord_Call_Drop(&instance_);
8181 state_ = DiscordObjectState::Invalid;
8182}
8183std::string Call::ErrorToString(discordpp::Call::Error type)
8184{
8185 Discord_String returnValueNative__;
8186 Discord_Call_ErrorToString(static_cast<Discord_Call_Error>(type), &returnValueNative__);
8187 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
8188 returnValueNative__.size);
8189 Discord_Free(returnValueNative__.ptr);
8190 return returnValue__;
8191}
8192discordpp::AudioModeType Call::GetAudioMode()
8193{
8194 assert(state_ == DiscordObjectState::Owned);
8195 Discord_AudioModeType returnValue__;
8196 returnValue__ = Discord_Call_GetAudioMode(&instance_);
8197 return static_cast<discordpp::AudioModeType>(returnValue__);
8198}
8199uint64_t Call::GetChannelId() const
8200{
8201 assert(state_ == DiscordObjectState::Owned);
8202 uint64_t returnValue__;
8203 returnValue__ = Discord_Call_GetChannelId(&instance_);
8204 return returnValue__;
8205}
8206uint64_t Call::GetGuildId() const
8207{
8208 assert(state_ == DiscordObjectState::Owned);
8209 uint64_t returnValue__;
8210 returnValue__ = Discord_Call_GetGuildId(&instance_);
8211 return returnValue__;
8212}
8213bool Call::GetLocalMute(uint64_t userId)
8214{
8215 assert(state_ == DiscordObjectState::Owned);
8216 bool returnValue__;
8217 returnValue__ = Discord_Call_GetLocalMute(&instance_, userId);
8218 return returnValue__;
8219}
8220std::vector<uint64_t> Call::GetParticipants() const
8221{
8222 assert(state_ == DiscordObjectState::Owned);
8223 Discord_UInt64Span returnValueNative__;
8224 Discord_Call_GetParticipants(&instance_, &returnValueNative__);
8225 std::vector<uint64_t> returnValue__(returnValueNative__.ptr,
8226 returnValueNative__.ptr + returnValueNative__.size);
8227 Discord_Free(returnValueNative__.ptr);
8228 return returnValue__;
8229}
8230float Call::GetParticipantVolume(uint64_t userId)
8231{
8232 assert(state_ == DiscordObjectState::Owned);
8233 float returnValue__;
8234 returnValue__ = Discord_Call_GetParticipantVolume(&instance_, userId);
8235 return returnValue__;
8236}
8237bool Call::GetPTTActive()
8238{
8239 assert(state_ == DiscordObjectState::Owned);
8240 bool returnValue__;
8241 returnValue__ = Discord_Call_GetPTTActive(&instance_);
8242 return returnValue__;
8243}
8244uint32_t Call::GetPTTReleaseDelay()
8245{
8246 assert(state_ == DiscordObjectState::Owned);
8247 uint32_t returnValue__;
8248 returnValue__ = Discord_Call_GetPTTReleaseDelay(&instance_);
8249 return returnValue__;
8250}
8251bool Call::GetSelfDeaf()
8252{
8253 assert(state_ == DiscordObjectState::Owned);
8254 bool returnValue__;
8255 returnValue__ = Discord_Call_GetSelfDeaf(&instance_);
8256 return returnValue__;
8257}
8258bool Call::GetSelfMute()
8259{
8260 assert(state_ == DiscordObjectState::Owned);
8261 bool returnValue__;
8262 returnValue__ = Discord_Call_GetSelfMute(&instance_);
8263 return returnValue__;
8264}
8265discordpp::Call::Status Call::GetStatus() const
8266{
8267 assert(state_ == DiscordObjectState::Owned);
8268 Discord_Call_Status returnValue__;
8269 returnValue__ = Discord_Call_GetStatus(&instance_);
8270 return static_cast<discordpp::Call::Status>(returnValue__);
8271}
8272discordpp::VADThresholdSettings Call::GetVADThreshold() const
8273{
8274 assert(state_ == DiscordObjectState::Owned);
8275 Discord_VADThresholdSettings returnValueNative__{};
8276 Discord_Call_GetVADThreshold(&instance_, &returnValueNative__);
8277 discordpp::VADThresholdSettings returnValue__(returnValueNative__, DiscordObjectState::Owned);
8278 return returnValue__;
8279}
8280std::optional<discordpp::VoiceStateHandle> Call::GetVoiceStateHandle(uint64_t userId) const
8281{
8282 assert(state_ == DiscordObjectState::Owned);
8283 bool returnIsNonNull__;
8284 Discord_VoiceStateHandle returnValueNative__;
8285 returnIsNonNull__ = Discord_Call_GetVoiceStateHandle(&instance_, userId, &returnValueNative__);
8286 if (!returnIsNonNull__) {
8287 return {};
8288 }
8289 discordpp::VoiceStateHandle returnValue__(returnValueNative__, DiscordObjectState::Owned);
8290 return returnValue__;
8291}
8292void Call::SetAudioMode(discordpp::AudioModeType audioMode)
8293{
8294 assert(state_ == DiscordObjectState::Owned);
8295 Discord_Call_SetAudioMode(&instance_, static_cast<Discord_AudioModeType>(audioMode));
8296}
8297void Call::SetLocalMute(uint64_t userId, bool mute)
8298{
8299 assert(state_ == DiscordObjectState::Owned);
8300 Discord_Call_SetLocalMute(&instance_, userId, mute);
8301}
8302void Call::SetOnVoiceStateChangedCallback(discordpp::Call::OnVoiceStateChanged cb)
8303{
8304 assert(state_ == DiscordObjectState::Owned);
8305 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
8306 auto cb__userData = new Tcb__UserData(cb);
8307 Discord_Call_OnVoiceStateChanged cb__native = [](auto userId, void* userData__) {
8308 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
8309 userData__typed->delegate(userId);
8310 };
8311 Discord_Call_SetOnVoiceStateChangedCallback(
8312 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
8313}
8314void Call::SetParticipantChangedCallback(discordpp::Call::OnParticipantChanged cb)
8315{
8316 assert(state_ == DiscordObjectState::Owned);
8317 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
8318 auto cb__userData = new Tcb__UserData(cb);
8319 Discord_Call_OnParticipantChanged cb__native = [](auto userId, auto added, void* userData__) {
8320 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
8321 userData__typed->delegate(userId, added);
8322 };
8323 Discord_Call_SetParticipantChangedCallback(
8324 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
8325}
8326void Call::SetParticipantVolume(uint64_t userId, float volume)
8327{
8328 assert(state_ == DiscordObjectState::Owned);
8329 Discord_Call_SetParticipantVolume(&instance_, userId, volume);
8330}
8331void Call::SetPTTActive(bool active)
8332{
8333 assert(state_ == DiscordObjectState::Owned);
8334 Discord_Call_SetPTTActive(&instance_, active);
8335}
8336void Call::SetPTTReleaseDelay(uint32_t releaseDelayMs)
8337{
8338 assert(state_ == DiscordObjectState::Owned);
8339 Discord_Call_SetPTTReleaseDelay(&instance_, releaseDelayMs);
8340}
8341void Call::SetSelfDeaf(bool deaf)
8342{
8343 assert(state_ == DiscordObjectState::Owned);
8344 Discord_Call_SetSelfDeaf(&instance_, deaf);
8345}
8346void Call::SetSelfMute(bool mute)
8347{
8348 assert(state_ == DiscordObjectState::Owned);
8349 Discord_Call_SetSelfMute(&instance_, mute);
8350}
8351void Call::SetSpeakingStatusChangedCallback(discordpp::Call::OnSpeakingStatusChanged cb)
8352{
8353 assert(state_ == DiscordObjectState::Owned);
8354 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
8355 auto cb__userData = new Tcb__UserData(cb);
8356 Discord_Call_OnSpeakingStatusChanged cb__native =
8357 [](auto userId, auto isPlayingSound, void* userData__) {
8358 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
8359 userData__typed->delegate(userId, isPlayingSound);
8360 };
8361 Discord_Call_SetSpeakingStatusChangedCallback(
8362 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
8363}
8364void Call::SetStatusChangedCallback(discordpp::Call::OnStatusChanged cb)
8365{
8366 assert(state_ == DiscordObjectState::Owned);
8367 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
8368 auto cb__userData = new Tcb__UserData(cb);
8369 Discord_Call_OnStatusChanged cb__native =
8370 [](auto status, auto error, auto errorDetail, void* userData__) {
8371 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
8372 userData__typed->delegate(static_cast<discordpp::Call::Status>(status),
8373 static_cast<discordpp::Call::Error>(error),
8374 errorDetail);
8375 };
8376 Discord_Call_SetStatusChangedCallback(
8377 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
8378}
8379void Call::SetVADThreshold(bool automatic, float threshold)
8380{
8381 assert(state_ == DiscordObjectState::Owned);
8382 Discord_Call_SetVADThreshold(&instance_, automatic, threshold);
8383}
8384std::string Call::StatusToString(discordpp::Call::Status type)
8385{
8386 Discord_String returnValueNative__;
8387 Discord_Call_StatusToString(static_cast<Discord_Call_Status>(type), &returnValueNative__);
8388 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
8389 returnValueNative__.size);
8390 Discord_Free(returnValueNative__.ptr);
8391 return returnValue__;
8392}
8393const ChannelHandle ChannelHandle::nullobj{{}, DiscordObjectState::Invalid};
8394ChannelHandle::~ChannelHandle()
8395{
8396 if (state_ == DiscordObjectState::Owned) {
8397 Drop();
8398 state_ = DiscordObjectState::Invalid;
8399 }
8400}
8401ChannelHandle::ChannelHandle(ChannelHandle&& other) noexcept
8402 : instance_(other.instance_)
8403 , state_(other.state_)
8404{
8405 other.state_ = DiscordObjectState::Invalid;
8406}
8407ChannelHandle& ChannelHandle::operator=(ChannelHandle&& other) noexcept
8408{
8409 if (this != &other) {
8410 if (state_ == DiscordObjectState::Owned) {
8411 Drop();
8412 }
8413 instance_ = other.instance_;
8414 state_ = other.state_;
8415 other.state_ = DiscordObjectState::Invalid;
8416 }
8417 return *this;
8418}
8419ChannelHandle::ChannelHandle(const ChannelHandle& other)
8420 : instance_{}
8421 , state_(DiscordObjectState::Invalid)
8422{
8423 if (other.state_ == DiscordObjectState::Owned) {
8424 Discord_ChannelHandle_Clone(&instance_, other.instance());
8425
8426 state_ = DiscordObjectState::Owned;
8427 }
8428}
8429ChannelHandle& ChannelHandle::operator=(const ChannelHandle& other)
8430{
8431 if (this != &other) {
8432 if (state_ == DiscordObjectState::Owned) {
8433 Drop();
8434 state_ = DiscordObjectState::Invalid;
8435 }
8436 if (other.state_ == DiscordObjectState::Owned) {
8437 Discord_ChannelHandle_Clone(&instance_, other.instance());
8438
8439 state_ = DiscordObjectState::Owned;
8440 }
8441 }
8442 return *this;
8443}
8444ChannelHandle::ChannelHandle(Discord_ChannelHandle instance, DiscordObjectState state)
8445 : instance_(instance)
8446 , state_(state)
8447{
8448}
8449void ChannelHandle::Drop()
8450{
8451 if (state_ != DiscordObjectState::Owned) {
8452 return;
8453 }
8454 Discord_ChannelHandle_Drop(&instance_);
8455 state_ = DiscordObjectState::Invalid;
8456}
8457uint64_t ChannelHandle::Id() const
8458{
8459 assert(state_ == DiscordObjectState::Owned);
8460 uint64_t returnValue__;
8461 returnValue__ = Discord_ChannelHandle_Id(&instance_);
8462 return returnValue__;
8463}
8464std::string ChannelHandle::Name() const
8465{
8466 assert(state_ == DiscordObjectState::Owned);
8467 Discord_String returnValueNative__;
8468 Discord_ChannelHandle_Name(&instance_, &returnValueNative__);
8469 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
8470 returnValueNative__.size);
8471 Discord_Free(returnValueNative__.ptr);
8472 return returnValue__;
8473}
8474std::vector<uint64_t> ChannelHandle::Recipients() const
8475{
8476 assert(state_ == DiscordObjectState::Owned);
8477 Discord_UInt64Span returnValueNative__;
8478 Discord_ChannelHandle_Recipients(&instance_, &returnValueNative__);
8479 std::vector<uint64_t> returnValue__(returnValueNative__.ptr,
8480 returnValueNative__.ptr + returnValueNative__.size);
8481 Discord_Free(returnValueNative__.ptr);
8482 return returnValue__;
8483}
8484discordpp::ChannelType ChannelHandle::Type() const
8485{
8486 assert(state_ == DiscordObjectState::Owned);
8487 Discord_ChannelType returnValue__;
8488 returnValue__ = Discord_ChannelHandle_Type(&instance_);
8489 return static_cast<discordpp::ChannelType>(returnValue__);
8490}
8491const GuildMinimal GuildMinimal::nullobj{{}, DiscordObjectState::Invalid};
8492GuildMinimal::~GuildMinimal()
8493{
8494 if (state_ == DiscordObjectState::Owned) {
8495 Drop();
8496 state_ = DiscordObjectState::Invalid;
8497 }
8498}
8499GuildMinimal::GuildMinimal(GuildMinimal&& other) noexcept
8500 : instance_(other.instance_)
8501 , state_(other.state_)
8502{
8503 other.state_ = DiscordObjectState::Invalid;
8504}
8505GuildMinimal& GuildMinimal::operator=(GuildMinimal&& other) noexcept
8506{
8507 if (this != &other) {
8508 if (state_ == DiscordObjectState::Owned) {
8509 Drop();
8510 }
8511 instance_ = other.instance_;
8512 state_ = other.state_;
8513 other.state_ = DiscordObjectState::Invalid;
8514 }
8515 return *this;
8516}
8517GuildMinimal::GuildMinimal(const GuildMinimal& arg0)
8518 : instance_{}
8519 , state_(DiscordObjectState::Invalid)
8520{
8521 if (arg0.state_ == DiscordObjectState::Owned) {
8522 Discord_GuildMinimal_Clone(&instance_, arg0.instance());
8523
8524 state_ = DiscordObjectState::Owned;
8525 }
8526}
8527GuildMinimal& GuildMinimal::operator=(const GuildMinimal& arg0)
8528{
8529 if (this != &arg0) {
8530 if (state_ == DiscordObjectState::Owned) {
8531 Drop();
8532 state_ = DiscordObjectState::Invalid;
8533 }
8534 if (arg0.state_ == DiscordObjectState::Owned) {
8535 Discord_GuildMinimal_Clone(&instance_, arg0.instance());
8536
8537 state_ = DiscordObjectState::Owned;
8538 }
8539 }
8540 return *this;
8541}
8542GuildMinimal::GuildMinimal(Discord_GuildMinimal instance, DiscordObjectState state)
8543 : instance_(instance)
8544 , state_(state)
8545{
8546}
8547void GuildMinimal::Drop()
8548{
8549 if (state_ != DiscordObjectState::Owned) {
8550 return;
8551 }
8552 Discord_GuildMinimal_Drop(&instance_);
8553 state_ = DiscordObjectState::Invalid;
8554}
8555uint64_t GuildMinimal::Id() const
8556{
8557 assert(state_ == DiscordObjectState::Owned);
8558 uint64_t returnValue__;
8559 returnValue__ = Discord_GuildMinimal_Id(&instance_);
8560 return returnValue__;
8561}
8562void GuildMinimal::SetId(uint64_t Id)
8563{
8564 assert(state_ == DiscordObjectState::Owned);
8565 Discord_GuildMinimal_SetId(&instance_, Id);
8566}
8567std::string GuildMinimal::Name() const
8568{
8569 assert(state_ == DiscordObjectState::Owned);
8570 Discord_String returnValueNative__;
8571 Discord_GuildMinimal_Name(&instance_, &returnValueNative__);
8572 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
8573 returnValueNative__.size);
8574 Discord_Free(returnValueNative__.ptr);
8575 return returnValue__;
8576}
8577void GuildMinimal::SetName(std::string Name)
8578{
8579 assert(state_ == DiscordObjectState::Owned);
8580 Discord_String Name__str{(uint8_t*)(Name.data()), Name.size()};
8581 Discord_GuildMinimal_SetName(&instance_, Name__str);
8582}
8583const GuildChannel GuildChannel::nullobj{{}, DiscordObjectState::Invalid};
8584GuildChannel::~GuildChannel()
8585{
8586 if (state_ == DiscordObjectState::Owned) {
8587 Drop();
8588 state_ = DiscordObjectState::Invalid;
8589 }
8590}
8591GuildChannel::GuildChannel(GuildChannel&& other) noexcept
8592 : instance_(other.instance_)
8593 , state_(other.state_)
8594{
8595 other.state_ = DiscordObjectState::Invalid;
8596}
8597GuildChannel& GuildChannel::operator=(GuildChannel&& other) noexcept
8598{
8599 if (this != &other) {
8600 if (state_ == DiscordObjectState::Owned) {
8601 Drop();
8602 }
8603 instance_ = other.instance_;
8604 state_ = other.state_;
8605 other.state_ = DiscordObjectState::Invalid;
8606 }
8607 return *this;
8608}
8609GuildChannel::GuildChannel(const GuildChannel& arg0)
8610 : instance_{}
8611 , state_(DiscordObjectState::Invalid)
8612{
8613 if (arg0.state_ == DiscordObjectState::Owned) {
8614 Discord_GuildChannel_Clone(&instance_, arg0.instance());
8615
8616 state_ = DiscordObjectState::Owned;
8617 }
8618}
8619GuildChannel& GuildChannel::operator=(const GuildChannel& arg0)
8620{
8621 if (this != &arg0) {
8622 if (state_ == DiscordObjectState::Owned) {
8623 Drop();
8624 state_ = DiscordObjectState::Invalid;
8625 }
8626 if (arg0.state_ == DiscordObjectState::Owned) {
8627 Discord_GuildChannel_Clone(&instance_, arg0.instance());
8628
8629 state_ = DiscordObjectState::Owned;
8630 }
8631 }
8632 return *this;
8633}
8634GuildChannel::GuildChannel(Discord_GuildChannel instance, DiscordObjectState state)
8635 : instance_(instance)
8636 , state_(state)
8637{
8638}
8639void GuildChannel::Drop()
8640{
8641 if (state_ != DiscordObjectState::Owned) {
8642 return;
8643 }
8644 Discord_GuildChannel_Drop(&instance_);
8645 state_ = DiscordObjectState::Invalid;
8646}
8647uint64_t GuildChannel::Id() const
8648{
8649 assert(state_ == DiscordObjectState::Owned);
8650 uint64_t returnValue__;
8651 returnValue__ = Discord_GuildChannel_Id(&instance_);
8652 return returnValue__;
8653}
8654void GuildChannel::SetId(uint64_t Id)
8655{
8656 assert(state_ == DiscordObjectState::Owned);
8657 Discord_GuildChannel_SetId(&instance_, Id);
8658}
8659std::string GuildChannel::Name() const
8660{
8661 assert(state_ == DiscordObjectState::Owned);
8662 Discord_String returnValueNative__;
8663 Discord_GuildChannel_Name(&instance_, &returnValueNative__);
8664 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
8665 returnValueNative__.size);
8666 Discord_Free(returnValueNative__.ptr);
8667 return returnValue__;
8668}
8669void GuildChannel::SetName(std::string Name)
8670{
8671 assert(state_ == DiscordObjectState::Owned);
8672 Discord_String Name__str{(uint8_t*)(Name.data()), Name.size()};
8673 Discord_GuildChannel_SetName(&instance_, Name__str);
8674}
8675discordpp::ChannelType GuildChannel::Type() const
8676{
8677 assert(state_ == DiscordObjectState::Owned);
8678 Discord_ChannelType returnValue__;
8679 returnValue__ = Discord_GuildChannel_Type(&instance_);
8680 return static_cast<discordpp::ChannelType>(returnValue__);
8681}
8682void GuildChannel::SetType(discordpp::ChannelType Type)
8683{
8684 assert(state_ == DiscordObjectState::Owned);
8685 Discord_GuildChannel_SetType(&instance_, static_cast<Discord_ChannelType>(Type));
8686}
8687int32_t GuildChannel::Position() const
8688{
8689 assert(state_ == DiscordObjectState::Owned);
8690 int32_t returnValue__;
8691 returnValue__ = Discord_GuildChannel_Position(&instance_);
8692 return returnValue__;
8693}
8694void GuildChannel::SetPosition(int32_t Position)
8695{
8696 assert(state_ == DiscordObjectState::Owned);
8697 Discord_GuildChannel_SetPosition(&instance_, Position);
8698}
8699std::optional<uint64_t> GuildChannel::ParentId() const
8700{
8701 assert(state_ == DiscordObjectState::Owned);
8702 bool returnIsNonNull__;
8703 uint64_t returnValue__;
8704 returnIsNonNull__ = Discord_GuildChannel_ParentId(&instance_, &returnValue__);
8705 if (!returnIsNonNull__) {
8706 return std::nullopt;
8707 }
8708 return returnValue__;
8709}
8710void GuildChannel::SetParentId(std::optional<uint64_t> ParentId)
8711{
8712 assert(state_ == DiscordObjectState::Owned);
8713 Discord_GuildChannel_SetParentId(&instance_, (ParentId.has_value() ? &*ParentId : nullptr));
8714}
8715bool GuildChannel::IsLinkable() const
8716{
8717 assert(state_ == DiscordObjectState::Owned);
8718 bool returnValue__;
8719 returnValue__ = Discord_GuildChannel_IsLinkable(&instance_);
8720 return returnValue__;
8721}
8722void GuildChannel::SetIsLinkable(bool IsLinkable)
8723{
8724 assert(state_ == DiscordObjectState::Owned);
8725 Discord_GuildChannel_SetIsLinkable(&instance_, IsLinkable);
8726}
8727bool GuildChannel::IsViewableAndWriteableByAllMembers() const
8728{
8729 assert(state_ == DiscordObjectState::Owned);
8730 bool returnValue__;
8731 returnValue__ = Discord_GuildChannel_IsViewableAndWriteableByAllMembers(&instance_);
8732 return returnValue__;
8733}
8734void GuildChannel::SetIsViewableAndWriteableByAllMembers(bool IsViewableAndWriteableByAllMembers)
8735{
8736 assert(state_ == DiscordObjectState::Owned);
8737 Discord_GuildChannel_SetIsViewableAndWriteableByAllMembers(&instance_,
8738 IsViewableAndWriteableByAllMembers);
8739}
8740std::optional<discordpp::LinkedLobby> GuildChannel::LinkedLobby() const
8741{
8742 assert(state_ == DiscordObjectState::Owned);
8743 bool returnIsNonNull__;
8744 Discord_LinkedLobby returnValueNative__;
8745 returnIsNonNull__ = Discord_GuildChannel_LinkedLobby(&instance_, &returnValueNative__);
8746 if (!returnIsNonNull__) {
8747 return {};
8748 }
8749 discordpp::LinkedLobby returnValue__(returnValueNative__, DiscordObjectState::Owned);
8750 return returnValue__;
8751}
8752void GuildChannel::SetLinkedLobby(std::optional<discordpp::LinkedLobby> LinkedLobby)
8753{
8754 assert(state_ == DiscordObjectState::Owned);
8755 Discord_GuildChannel_SetLinkedLobby(
8756 &instance_, (LinkedLobby.has_value() ? LinkedLobby->instance() : nullptr));
8757}
8758const LinkedLobby LinkedLobby::nullobj{{}, DiscordObjectState::Invalid};
8759LinkedLobby::~LinkedLobby()
8760{
8761 if (state_ == DiscordObjectState::Owned) {
8762 Drop();
8763 state_ = DiscordObjectState::Invalid;
8764 }
8765}
8766LinkedLobby::LinkedLobby(LinkedLobby&& other) noexcept
8767 : instance_(other.instance_)
8768 , state_(other.state_)
8769{
8770 other.state_ = DiscordObjectState::Invalid;
8771}
8772LinkedLobby& LinkedLobby::operator=(LinkedLobby&& other) noexcept
8773{
8774 if (this != &other) {
8775 if (state_ == DiscordObjectState::Owned) {
8776 Drop();
8777 }
8778 instance_ = other.instance_;
8779 state_ = other.state_;
8780 other.state_ = DiscordObjectState::Invalid;
8781 }
8782 return *this;
8783}
8784LinkedLobby::LinkedLobby(const LinkedLobby& arg0)
8785 : instance_{}
8786 , state_(DiscordObjectState::Invalid)
8787{
8788 if (arg0.state_ == DiscordObjectState::Owned) {
8789 Discord_LinkedLobby_Clone(&instance_, arg0.instance());
8790
8791 state_ = DiscordObjectState::Owned;
8792 }
8793}
8794LinkedLobby& LinkedLobby::operator=(const LinkedLobby& arg0)
8795{
8796 if (this != &arg0) {
8797 if (state_ == DiscordObjectState::Owned) {
8798 Drop();
8799 state_ = DiscordObjectState::Invalid;
8800 }
8801 if (arg0.state_ == DiscordObjectState::Owned) {
8802 Discord_LinkedLobby_Clone(&instance_, arg0.instance());
8803
8804 state_ = DiscordObjectState::Owned;
8805 }
8806 }
8807 return *this;
8808}
8809LinkedLobby::LinkedLobby(Discord_LinkedLobby instance, DiscordObjectState state)
8810 : instance_(instance)
8811 , state_(state)
8812{
8813}
8814LinkedLobby::LinkedLobby()
8815{
8816 assert(state_ == DiscordObjectState::Invalid);
8817 Discord_LinkedLobby_Init(&instance_);
8818 state_ = DiscordObjectState::Owned;
8819}
8820void LinkedLobby::Drop()
8821{
8822 if (state_ != DiscordObjectState::Owned) {
8823 return;
8824 }
8825 Discord_LinkedLobby_Drop(&instance_);
8826 state_ = DiscordObjectState::Invalid;
8827}
8828uint64_t LinkedLobby::ApplicationId() const
8829{
8830 assert(state_ == DiscordObjectState::Owned);
8831 uint64_t returnValue__;
8832 returnValue__ = Discord_LinkedLobby_ApplicationId(&instance_);
8833 return returnValue__;
8834}
8835void LinkedLobby::SetApplicationId(uint64_t ApplicationId)
8836{
8837 assert(state_ == DiscordObjectState::Owned);
8838 Discord_LinkedLobby_SetApplicationId(&instance_, ApplicationId);
8839}
8840uint64_t LinkedLobby::LobbyId() const
8841{
8842 assert(state_ == DiscordObjectState::Owned);
8843 uint64_t returnValue__;
8844 returnValue__ = Discord_LinkedLobby_LobbyId(&instance_);
8845 return returnValue__;
8846}
8847void LinkedLobby::SetLobbyId(uint64_t LobbyId)
8848{
8849 assert(state_ == DiscordObjectState::Owned);
8850 Discord_LinkedLobby_SetLobbyId(&instance_, LobbyId);
8851}
8852const LinkedChannel LinkedChannel::nullobj{{}, DiscordObjectState::Invalid};
8853LinkedChannel::~LinkedChannel()
8854{
8855 if (state_ == DiscordObjectState::Owned) {
8856 Drop();
8857 state_ = DiscordObjectState::Invalid;
8858 }
8859}
8860LinkedChannel::LinkedChannel(LinkedChannel&& other) noexcept
8861 : instance_(other.instance_)
8862 , state_(other.state_)
8863{
8864 other.state_ = DiscordObjectState::Invalid;
8865}
8866LinkedChannel& LinkedChannel::operator=(LinkedChannel&& other) noexcept
8867{
8868 if (this != &other) {
8869 if (state_ == DiscordObjectState::Owned) {
8870 Drop();
8871 }
8872 instance_ = other.instance_;
8873 state_ = other.state_;
8874 other.state_ = DiscordObjectState::Invalid;
8875 }
8876 return *this;
8877}
8878LinkedChannel::LinkedChannel(const LinkedChannel& arg0)
8879 : instance_{}
8880 , state_(DiscordObjectState::Invalid)
8881{
8882 if (arg0.state_ == DiscordObjectState::Owned) {
8883 Discord_LinkedChannel_Clone(&instance_, arg0.instance());
8884
8885 state_ = DiscordObjectState::Owned;
8886 }
8887}
8888LinkedChannel& LinkedChannel::operator=(const LinkedChannel& arg0)
8889{
8890 if (this != &arg0) {
8891 if (state_ == DiscordObjectState::Owned) {
8892 Drop();
8893 state_ = DiscordObjectState::Invalid;
8894 }
8895 if (arg0.state_ == DiscordObjectState::Owned) {
8896 Discord_LinkedChannel_Clone(&instance_, arg0.instance());
8897
8898 state_ = DiscordObjectState::Owned;
8899 }
8900 }
8901 return *this;
8902}
8903LinkedChannel::LinkedChannel(Discord_LinkedChannel instance, DiscordObjectState state)
8904 : instance_(instance)
8905 , state_(state)
8906{
8907}
8908void LinkedChannel::Drop()
8909{
8910 if (state_ != DiscordObjectState::Owned) {
8911 return;
8912 }
8913 Discord_LinkedChannel_Drop(&instance_);
8914 state_ = DiscordObjectState::Invalid;
8915}
8916uint64_t LinkedChannel::Id() const
8917{
8918 assert(state_ == DiscordObjectState::Owned);
8919 uint64_t returnValue__;
8920 returnValue__ = Discord_LinkedChannel_Id(&instance_);
8921 return returnValue__;
8922}
8923void LinkedChannel::SetId(uint64_t Id)
8924{
8925 assert(state_ == DiscordObjectState::Owned);
8926 Discord_LinkedChannel_SetId(&instance_, Id);
8927}
8928std::string LinkedChannel::Name() const
8929{
8930 assert(state_ == DiscordObjectState::Owned);
8931 Discord_String returnValueNative__;
8932 Discord_LinkedChannel_Name(&instance_, &returnValueNative__);
8933 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
8934 returnValueNative__.size);
8935 Discord_Free(returnValueNative__.ptr);
8936 return returnValue__;
8937}
8938void LinkedChannel::SetName(std::string Name)
8939{
8940 assert(state_ == DiscordObjectState::Owned);
8941 Discord_String Name__str{(uint8_t*)(Name.data()), Name.size()};
8942 Discord_LinkedChannel_SetName(&instance_, Name__str);
8943}
8944uint64_t LinkedChannel::GuildId() const
8945{
8946 assert(state_ == DiscordObjectState::Owned);
8947 uint64_t returnValue__;
8948 returnValue__ = Discord_LinkedChannel_GuildId(&instance_);
8949 return returnValue__;
8950}
8951void LinkedChannel::SetGuildId(uint64_t GuildId)
8952{
8953 assert(state_ == DiscordObjectState::Owned);
8954 Discord_LinkedChannel_SetGuildId(&instance_, GuildId);
8955}
8956const RelationshipHandle RelationshipHandle::nullobj{{}, DiscordObjectState::Invalid};
8957RelationshipHandle::~RelationshipHandle()
8958{
8959 if (state_ == DiscordObjectState::Owned) {
8960 Drop();
8961 state_ = DiscordObjectState::Invalid;
8962 }
8963}
8964RelationshipHandle::RelationshipHandle(RelationshipHandle&& other) noexcept
8965 : instance_(other.instance_)
8966 , state_(other.state_)
8967{
8968 other.state_ = DiscordObjectState::Invalid;
8969}
8970RelationshipHandle& RelationshipHandle::operator=(RelationshipHandle&& other) noexcept
8971{
8972 if (this != &other) {
8973 if (state_ == DiscordObjectState::Owned) {
8974 Drop();
8975 }
8976 instance_ = other.instance_;
8977 state_ = other.state_;
8978 other.state_ = DiscordObjectState::Invalid;
8979 }
8980 return *this;
8981}
8982RelationshipHandle::RelationshipHandle(const RelationshipHandle& other)
8983 : instance_{}
8984 , state_(DiscordObjectState::Invalid)
8985{
8986 if (other.state_ == DiscordObjectState::Owned) {
8987 Discord_RelationshipHandle_Clone(&instance_, other.instance());
8988
8989 state_ = DiscordObjectState::Owned;
8990 }
8991}
8992RelationshipHandle& RelationshipHandle::operator=(const RelationshipHandle& other)
8993{
8994 if (this != &other) {
8995 if (state_ == DiscordObjectState::Owned) {
8996 Drop();
8997 state_ = DiscordObjectState::Invalid;
8998 }
8999 if (other.state_ == DiscordObjectState::Owned) {
9000 Discord_RelationshipHandle_Clone(&instance_, other.instance());
9001
9002 state_ = DiscordObjectState::Owned;
9003 }
9004 }
9005 return *this;
9006}
9007RelationshipHandle::RelationshipHandle(Discord_RelationshipHandle instance,
9008 DiscordObjectState state)
9009 : instance_(instance)
9010 , state_(state)
9011{
9012}
9013void RelationshipHandle::Drop()
9014{
9015 if (state_ != DiscordObjectState::Owned) {
9016 return;
9017 }
9018 Discord_RelationshipHandle_Drop(&instance_);
9019 state_ = DiscordObjectState::Invalid;
9020}
9021discordpp::RelationshipType RelationshipHandle::DiscordRelationshipType() const
9022{
9023 assert(state_ == DiscordObjectState::Owned);
9024 Discord_RelationshipType returnValue__;
9025 returnValue__ = Discord_RelationshipHandle_DiscordRelationshipType(&instance_);
9026 return static_cast<discordpp::RelationshipType>(returnValue__);
9027}
9028discordpp::RelationshipType RelationshipHandle::GameRelationshipType() const
9029{
9030 assert(state_ == DiscordObjectState::Owned);
9031 Discord_RelationshipType returnValue__;
9032 returnValue__ = Discord_RelationshipHandle_GameRelationshipType(&instance_);
9033 return static_cast<discordpp::RelationshipType>(returnValue__);
9034}
9035uint64_t RelationshipHandle::Id() const
9036{
9037 assert(state_ == DiscordObjectState::Owned);
9038 uint64_t returnValue__;
9039 returnValue__ = Discord_RelationshipHandle_Id(&instance_);
9040 return returnValue__;
9041}
9042bool RelationshipHandle::IsSpamRequest() const
9043{
9044 assert(state_ == DiscordObjectState::Owned);
9045 bool returnValue__;
9046 returnValue__ = Discord_RelationshipHandle_IsSpamRequest(&instance_);
9047 return returnValue__;
9048}
9049std::optional<discordpp::UserHandle> RelationshipHandle::User() const
9050{
9051 assert(state_ == DiscordObjectState::Owned);
9052 bool returnIsNonNull__;
9053 Discord_UserHandle returnValueNative__;
9054 returnIsNonNull__ = Discord_RelationshipHandle_User(&instance_, &returnValueNative__);
9055 if (!returnIsNonNull__) {
9056 return {};
9057 }
9058 discordpp::UserHandle returnValue__(returnValueNative__, DiscordObjectState::Owned);
9059 return returnValue__;
9060}
9061const UserApplicationProfileHandle UserApplicationProfileHandle::nullobj{
9062 {},
9063 DiscordObjectState::Invalid};
9064UserApplicationProfileHandle::~UserApplicationProfileHandle()
9065{
9066 if (state_ == DiscordObjectState::Owned) {
9067 Drop();
9068 state_ = DiscordObjectState::Invalid;
9069 }
9070}
9071UserApplicationProfileHandle::UserApplicationProfileHandle(
9072 UserApplicationProfileHandle&& other) noexcept
9073 : instance_(other.instance_)
9074 , state_(other.state_)
9075{
9076 other.state_ = DiscordObjectState::Invalid;
9077}
9078UserApplicationProfileHandle& UserApplicationProfileHandle::operator=(
9079 UserApplicationProfileHandle&& other) noexcept
9080{
9081 if (this != &other) {
9082 if (state_ == DiscordObjectState::Owned) {
9083 Drop();
9084 }
9085 instance_ = other.instance_;
9086 state_ = other.state_;
9087 other.state_ = DiscordObjectState::Invalid;
9088 }
9089 return *this;
9090}
9091UserApplicationProfileHandle::UserApplicationProfileHandle(
9092 const UserApplicationProfileHandle& other)
9093 : instance_{}
9094 , state_(DiscordObjectState::Invalid)
9095{
9096 if (other.state_ == DiscordObjectState::Owned) {
9097 Discord_UserApplicationProfileHandle_Clone(&instance_, other.instance());
9098
9099 state_ = DiscordObjectState::Owned;
9100 }
9101}
9102UserApplicationProfileHandle& UserApplicationProfileHandle::operator=(
9103 const UserApplicationProfileHandle& other)
9104{
9105 if (this != &other) {
9106 if (state_ == DiscordObjectState::Owned) {
9107 Drop();
9108 state_ = DiscordObjectState::Invalid;
9109 }
9110 if (other.state_ == DiscordObjectState::Owned) {
9111 Discord_UserApplicationProfileHandle_Clone(&instance_, other.instance());
9112
9113 state_ = DiscordObjectState::Owned;
9114 }
9115 }
9116 return *this;
9117}
9118UserApplicationProfileHandle::UserApplicationProfileHandle(
9119 Discord_UserApplicationProfileHandle instance,
9120 DiscordObjectState state)
9121 : instance_(instance)
9122 , state_(state)
9123{
9124}
9125void UserApplicationProfileHandle::Drop()
9126{
9127 if (state_ != DiscordObjectState::Owned) {
9128 return;
9129 }
9130 Discord_UserApplicationProfileHandle_Drop(&instance_);
9131 state_ = DiscordObjectState::Invalid;
9132}
9133std::string UserApplicationProfileHandle::AvatarHash() const
9134{
9135 assert(state_ == DiscordObjectState::Owned);
9136 Discord_String returnValueNative__;
9137 Discord_UserApplicationProfileHandle_AvatarHash(&instance_, &returnValueNative__);
9138 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
9139 returnValueNative__.size);
9140 Discord_Free(returnValueNative__.ptr);
9141 return returnValue__;
9142}
9143std::string UserApplicationProfileHandle::Metadata() const
9144{
9145 assert(state_ == DiscordObjectState::Owned);
9146 Discord_String returnValueNative__;
9147 Discord_UserApplicationProfileHandle_Metadata(&instance_, &returnValueNative__);
9148 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
9149 returnValueNative__.size);
9150 Discord_Free(returnValueNative__.ptr);
9151 return returnValue__;
9152}
9153std::optional<std::string> UserApplicationProfileHandle::ProviderId() const
9154{
9155 assert(state_ == DiscordObjectState::Owned);
9156 bool returnIsNonNull__;
9157 Discord_String returnValueNative__;
9158 returnIsNonNull__ =
9159 Discord_UserApplicationProfileHandle_ProviderId(&instance_, &returnValueNative__);
9160 if (!returnIsNonNull__) {
9161 return {};
9162 }
9163 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
9164 returnValueNative__.size);
9165 Discord_Free(returnValueNative__.ptr);
9166 return returnValue__;
9167}
9168std::string UserApplicationProfileHandle::ProviderIssuedUserId() const
9169{
9170 assert(state_ == DiscordObjectState::Owned);
9171 Discord_String returnValueNative__;
9172 Discord_UserApplicationProfileHandle_ProviderIssuedUserId(&instance_, &returnValueNative__);
9173 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
9174 returnValueNative__.size);
9175 Discord_Free(returnValueNative__.ptr);
9176 return returnValue__;
9177}
9178discordpp::ExternalIdentityProviderType UserApplicationProfileHandle::ProviderType() const
9179{
9180 assert(state_ == DiscordObjectState::Owned);
9181 Discord_ExternalIdentityProviderType returnValue__;
9182 returnValue__ = Discord_UserApplicationProfileHandle_ProviderType(&instance_);
9183 return static_cast<discordpp::ExternalIdentityProviderType>(returnValue__);
9184}
9185std::string UserApplicationProfileHandle::Username() const
9186{
9187 assert(state_ == DiscordObjectState::Owned);
9188 Discord_String returnValueNative__;
9189 Discord_UserApplicationProfileHandle_Username(&instance_, &returnValueNative__);
9190 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
9191 returnValueNative__.size);
9192 Discord_Free(returnValueNative__.ptr);
9193 return returnValue__;
9194}
9195const UserHandle UserHandle::nullobj{{}, DiscordObjectState::Invalid};
9196UserHandle::~UserHandle()
9197{
9198 if (state_ == DiscordObjectState::Owned) {
9199 Drop();
9200 state_ = DiscordObjectState::Invalid;
9201 }
9202}
9203UserHandle::UserHandle(UserHandle&& other) noexcept
9204 : instance_(other.instance_)
9205 , state_(other.state_)
9206{
9207 other.state_ = DiscordObjectState::Invalid;
9208}
9209UserHandle& UserHandle::operator=(UserHandle&& other) noexcept
9210{
9211 if (this != &other) {
9212 if (state_ == DiscordObjectState::Owned) {
9213 Drop();
9214 }
9215 instance_ = other.instance_;
9216 state_ = other.state_;
9217 other.state_ = DiscordObjectState::Invalid;
9218 }
9219 return *this;
9220}
9221UserHandle::UserHandle(const UserHandle& arg0)
9222 : instance_{}
9223 , state_(DiscordObjectState::Invalid)
9224{
9225 if (arg0.state_ == DiscordObjectState::Owned) {
9226 Discord_UserHandle_Clone(&instance_, arg0.instance());
9227
9228 state_ = DiscordObjectState::Owned;
9229 }
9230}
9231UserHandle& UserHandle::operator=(const UserHandle& arg0)
9232{
9233 if (this != &arg0) {
9234 if (state_ == DiscordObjectState::Owned) {
9235 Drop();
9236 state_ = DiscordObjectState::Invalid;
9237 }
9238 if (arg0.state_ == DiscordObjectState::Owned) {
9239 Discord_UserHandle_Clone(&instance_, arg0.instance());
9240
9241 state_ = DiscordObjectState::Owned;
9242 }
9243 }
9244 return *this;
9245}
9246UserHandle::UserHandle(Discord_UserHandle instance, DiscordObjectState state)
9247 : instance_(instance)
9248 , state_(state)
9249{
9250}
9251void UserHandle::Drop()
9252{
9253 if (state_ != DiscordObjectState::Owned) {
9254 return;
9255 }
9256 Discord_UserHandle_Drop(&instance_);
9257 state_ = DiscordObjectState::Invalid;
9258}
9259std::optional<std::string> UserHandle::Avatar() const
9260{
9261 assert(state_ == DiscordObjectState::Owned);
9262 bool returnIsNonNull__;
9263 Discord_String returnValueNative__;
9264 returnIsNonNull__ = Discord_UserHandle_Avatar(&instance_, &returnValueNative__);
9265 if (!returnIsNonNull__) {
9266 return {};
9267 }
9268 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
9269 returnValueNative__.size);
9270 Discord_Free(returnValueNative__.ptr);
9271 return returnValue__;
9272}
9273std::string UserHandle::AvatarTypeToString(discordpp::UserHandle::AvatarType type)
9274{
9275 Discord_String returnValueNative__;
9276 Discord_UserHandle_AvatarTypeToString(static_cast<Discord_UserHandle_AvatarType>(type),
9277 &returnValueNative__);
9278 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
9279 returnValueNative__.size);
9280 Discord_Free(returnValueNative__.ptr);
9281 return returnValue__;
9282}
9283std::string UserHandle::AvatarUrl(discordpp::UserHandle::AvatarType animatedType,
9284 discordpp::UserHandle::AvatarType staticType) const
9285{
9286 assert(state_ == DiscordObjectState::Owned);
9287 Discord_String returnValueNative__;
9288 Discord_UserHandle_AvatarUrl(&instance_,
9289 static_cast<Discord_UserHandle_AvatarType>(animatedType),
9290 static_cast<Discord_UserHandle_AvatarType>(staticType),
9291 &returnValueNative__);
9292 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
9293 returnValueNative__.size);
9294 Discord_Free(returnValueNative__.ptr);
9295 return returnValue__;
9296}
9297std::string UserHandle::DisplayName() const
9298{
9299 assert(state_ == DiscordObjectState::Owned);
9300 Discord_String returnValueNative__;
9301 Discord_UserHandle_DisplayName(&instance_, &returnValueNative__);
9302 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
9303 returnValueNative__.size);
9304 Discord_Free(returnValueNative__.ptr);
9305 return returnValue__;
9306}
9307std::optional<discordpp::Activity> UserHandle::GameActivity() const
9308{
9309 assert(state_ == DiscordObjectState::Owned);
9310 bool returnIsNonNull__;
9311 Discord_Activity returnValueNative__;
9312 returnIsNonNull__ = Discord_UserHandle_GameActivity(&instance_, &returnValueNative__);
9313 if (!returnIsNonNull__) {
9314 return {};
9315 }
9316 discordpp::Activity returnValue__(returnValueNative__, DiscordObjectState::Owned);
9317 return returnValue__;
9318}
9319std::optional<std::string> UserHandle::GlobalName() const
9320{
9321 assert(state_ == DiscordObjectState::Owned);
9322 bool returnIsNonNull__;
9323 Discord_String returnValueNative__;
9324 returnIsNonNull__ = Discord_UserHandle_GlobalName(&instance_, &returnValueNative__);
9325 if (!returnIsNonNull__) {
9326 return {};
9327 }
9328 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
9329 returnValueNative__.size);
9330 Discord_Free(returnValueNative__.ptr);
9331 return returnValue__;
9332}
9333uint64_t UserHandle::Id() const
9334{
9335 assert(state_ == DiscordObjectState::Owned);
9336 uint64_t returnValue__;
9337 returnValue__ = Discord_UserHandle_Id(&instance_);
9338 return returnValue__;
9339}
9340bool UserHandle::IsProvisional() const
9341{
9342 assert(state_ == DiscordObjectState::Owned);
9343 bool returnValue__;
9344 returnValue__ = Discord_UserHandle_IsProvisional(&instance_);
9345 return returnValue__;
9346}
9347discordpp::RelationshipHandle UserHandle::Relationship() const
9348{
9349 assert(state_ == DiscordObjectState::Owned);
9350 Discord_RelationshipHandle returnValueNative__{};
9351 Discord_UserHandle_Relationship(&instance_, &returnValueNative__);
9352 discordpp::RelationshipHandle returnValue__(returnValueNative__, DiscordObjectState::Owned);
9353 return returnValue__;
9354}
9355discordpp::StatusType UserHandle::Status() const
9356{
9357 assert(state_ == DiscordObjectState::Owned);
9358 Discord_StatusType returnValue__;
9359 returnValue__ = Discord_UserHandle_Status(&instance_);
9360 return static_cast<discordpp::StatusType>(returnValue__);
9361}
9362std::vector<discordpp::UserApplicationProfileHandle> UserHandle::UserApplicationProfiles() const
9363{
9364 assert(state_ == DiscordObjectState::Owned);
9365 Discord_UserApplicationProfileHandleSpan returnValueNative__;
9366 Discord_UserHandle_UserApplicationProfiles(&instance_, &returnValueNative__);
9367 std::vector<discordpp::UserApplicationProfileHandle> returnValue__;
9368 returnValue__.reserve(returnValueNative__.size);
9369 for (size_t i__ = 0; i__ < returnValueNative__.size; ++i__) {
9370 returnValue__.emplace_back(returnValueNative__.ptr[i__], DiscordObjectState::Owned);
9371 }
9372 Discord_Free(returnValueNative__.ptr);
9373 return returnValue__;
9374}
9375std::string UserHandle::Username() const
9376{
9377 assert(state_ == DiscordObjectState::Owned);
9378 Discord_String returnValueNative__;
9379 Discord_UserHandle_Username(&instance_, &returnValueNative__);
9380 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
9381 returnValueNative__.size);
9382 Discord_Free(returnValueNative__.ptr);
9383 return returnValue__;
9384}
9385const LobbyMemberHandle LobbyMemberHandle::nullobj{{}, DiscordObjectState::Invalid};
9386LobbyMemberHandle::~LobbyMemberHandle()
9387{
9388 if (state_ == DiscordObjectState::Owned) {
9389 Drop();
9390 state_ = DiscordObjectState::Invalid;
9391 }
9392}
9393LobbyMemberHandle::LobbyMemberHandle(LobbyMemberHandle&& other) noexcept
9394 : instance_(other.instance_)
9395 , state_(other.state_)
9396{
9397 other.state_ = DiscordObjectState::Invalid;
9398}
9399LobbyMemberHandle& LobbyMemberHandle::operator=(LobbyMemberHandle&& other) noexcept
9400{
9401 if (this != &other) {
9402 if (state_ == DiscordObjectState::Owned) {
9403 Drop();
9404 }
9405 instance_ = other.instance_;
9406 state_ = other.state_;
9407 other.state_ = DiscordObjectState::Invalid;
9408 }
9409 return *this;
9410}
9411LobbyMemberHandle::LobbyMemberHandle(const LobbyMemberHandle& other)
9412 : instance_{}
9413 , state_(DiscordObjectState::Invalid)
9414{
9415 if (other.state_ == DiscordObjectState::Owned) {
9416 Discord_LobbyMemberHandle_Clone(&instance_, other.instance());
9417
9418 state_ = DiscordObjectState::Owned;
9419 }
9420}
9421LobbyMemberHandle& LobbyMemberHandle::operator=(const LobbyMemberHandle& other)
9422{
9423 if (this != &other) {
9424 if (state_ == DiscordObjectState::Owned) {
9425 Drop();
9426 state_ = DiscordObjectState::Invalid;
9427 }
9428 if (other.state_ == DiscordObjectState::Owned) {
9429 Discord_LobbyMemberHandle_Clone(&instance_, other.instance());
9430
9431 state_ = DiscordObjectState::Owned;
9432 }
9433 }
9434 return *this;
9435}
9436LobbyMemberHandle::LobbyMemberHandle(Discord_LobbyMemberHandle instance, DiscordObjectState state)
9437 : instance_(instance)
9438 , state_(state)
9439{
9440}
9441void LobbyMemberHandle::Drop()
9442{
9443 if (state_ != DiscordObjectState::Owned) {
9444 return;
9445 }
9446 Discord_LobbyMemberHandle_Drop(&instance_);
9447 state_ = DiscordObjectState::Invalid;
9448}
9449bool LobbyMemberHandle::CanLinkLobby() const
9450{
9451 assert(state_ == DiscordObjectState::Owned);
9452 bool returnValue__;
9453 returnValue__ = Discord_LobbyMemberHandle_CanLinkLobby(&instance_);
9454 return returnValue__;
9455}
9456bool LobbyMemberHandle::Connected() const
9457{
9458 assert(state_ == DiscordObjectState::Owned);
9459 bool returnValue__;
9460 returnValue__ = Discord_LobbyMemberHandle_Connected(&instance_);
9461 return returnValue__;
9462}
9463uint64_t LobbyMemberHandle::Id() const
9464{
9465 assert(state_ == DiscordObjectState::Owned);
9466 uint64_t returnValue__;
9467 returnValue__ = Discord_LobbyMemberHandle_Id(&instance_);
9468 return returnValue__;
9469}
9470std::unordered_map<std::string, std::string> LobbyMemberHandle::Metadata() const
9471{
9472 assert(state_ == DiscordObjectState::Owned);
9473 Discord_Properties returnValueNative__;
9474 Discord_LobbyMemberHandle_Metadata(&instance_, &returnValueNative__);
9475 std::unordered_map<std::string, std::string> returnValue__ =
9476 ConvertReturnedProperties(returnValueNative__);
9477 Discord_FreeProperties(returnValueNative__);
9478 return returnValue__;
9479}
9480std::optional<discordpp::UserHandle> LobbyMemberHandle::User() const
9481{
9482 assert(state_ == DiscordObjectState::Owned);
9483 bool returnIsNonNull__;
9484 Discord_UserHandle returnValueNative__;
9485 returnIsNonNull__ = Discord_LobbyMemberHandle_User(&instance_, &returnValueNative__);
9486 if (!returnIsNonNull__) {
9487 return {};
9488 }
9489 discordpp::UserHandle returnValue__(returnValueNative__, DiscordObjectState::Owned);
9490 return returnValue__;
9491}
9492const LobbyHandle LobbyHandle::nullobj{{}, DiscordObjectState::Invalid};
9493LobbyHandle::~LobbyHandle()
9494{
9495 if (state_ == DiscordObjectState::Owned) {
9496 Drop();
9497 state_ = DiscordObjectState::Invalid;
9498 }
9499}
9500LobbyHandle::LobbyHandle(LobbyHandle&& other) noexcept
9501 : instance_(other.instance_)
9502 , state_(other.state_)
9503{
9504 other.state_ = DiscordObjectState::Invalid;
9505}
9506LobbyHandle& LobbyHandle::operator=(LobbyHandle&& other) noexcept
9507{
9508 if (this != &other) {
9509 if (state_ == DiscordObjectState::Owned) {
9510 Drop();
9511 }
9512 instance_ = other.instance_;
9513 state_ = other.state_;
9514 other.state_ = DiscordObjectState::Invalid;
9515 }
9516 return *this;
9517}
9518LobbyHandle::LobbyHandle(const LobbyHandle& other)
9519 : instance_{}
9520 , state_(DiscordObjectState::Invalid)
9521{
9522 if (other.state_ == DiscordObjectState::Owned) {
9523 Discord_LobbyHandle_Clone(&instance_, other.instance());
9524
9525 state_ = DiscordObjectState::Owned;
9526 }
9527}
9528LobbyHandle& LobbyHandle::operator=(const LobbyHandle& other)
9529{
9530 if (this != &other) {
9531 if (state_ == DiscordObjectState::Owned) {
9532 Drop();
9533 state_ = DiscordObjectState::Invalid;
9534 }
9535 if (other.state_ == DiscordObjectState::Owned) {
9536 Discord_LobbyHandle_Clone(&instance_, other.instance());
9537
9538 state_ = DiscordObjectState::Owned;
9539 }
9540 }
9541 return *this;
9542}
9543LobbyHandle::LobbyHandle(Discord_LobbyHandle instance, DiscordObjectState state)
9544 : instance_(instance)
9545 , state_(state)
9546{
9547}
9548void LobbyHandle::Drop()
9549{
9550 if (state_ != DiscordObjectState::Owned) {
9551 return;
9552 }
9553 Discord_LobbyHandle_Drop(&instance_);
9554 state_ = DiscordObjectState::Invalid;
9555}
9556std::optional<discordpp::CallInfoHandle> LobbyHandle::GetCallInfoHandle() const
9557{
9558 assert(state_ == DiscordObjectState::Owned);
9559 bool returnIsNonNull__;
9560 Discord_CallInfoHandle returnValueNative__;
9561 returnIsNonNull__ = Discord_LobbyHandle_GetCallInfoHandle(&instance_, &returnValueNative__);
9562 if (!returnIsNonNull__) {
9563 return {};
9564 }
9565 discordpp::CallInfoHandle returnValue__(returnValueNative__, DiscordObjectState::Owned);
9566 return returnValue__;
9567}
9568std::optional<discordpp::LobbyMemberHandle> LobbyHandle::GetLobbyMemberHandle(
9569 uint64_t memberId) const
9570{
9571 assert(state_ == DiscordObjectState::Owned);
9572 bool returnIsNonNull__;
9573 Discord_LobbyMemberHandle returnValueNative__;
9574 returnIsNonNull__ =
9575 Discord_LobbyHandle_GetLobbyMemberHandle(&instance_, memberId, &returnValueNative__);
9576 if (!returnIsNonNull__) {
9577 return {};
9578 }
9579 discordpp::LobbyMemberHandle returnValue__(returnValueNative__, DiscordObjectState::Owned);
9580 return returnValue__;
9581}
9582uint64_t LobbyHandle::Id() const
9583{
9584 assert(state_ == DiscordObjectState::Owned);
9585 uint64_t returnValue__;
9586 returnValue__ = Discord_LobbyHandle_Id(&instance_);
9587 return returnValue__;
9588}
9589std::optional<discordpp::LinkedChannel> LobbyHandle::LinkedChannel() const
9590{
9591 assert(state_ == DiscordObjectState::Owned);
9592 bool returnIsNonNull__;
9593 Discord_LinkedChannel returnValueNative__;
9594 returnIsNonNull__ = Discord_LobbyHandle_LinkedChannel(&instance_, &returnValueNative__);
9595 if (!returnIsNonNull__) {
9596 return {};
9597 }
9598 discordpp::LinkedChannel returnValue__(returnValueNative__, DiscordObjectState::Owned);
9599 return returnValue__;
9600}
9601std::vector<uint64_t> LobbyHandle::LobbyMemberIds() const
9602{
9603 assert(state_ == DiscordObjectState::Owned);
9604 Discord_UInt64Span returnValueNative__;
9605 Discord_LobbyHandle_LobbyMemberIds(&instance_, &returnValueNative__);
9606 std::vector<uint64_t> returnValue__(returnValueNative__.ptr,
9607 returnValueNative__.ptr + returnValueNative__.size);
9608 Discord_Free(returnValueNative__.ptr);
9609 return returnValue__;
9610}
9611std::vector<discordpp::LobbyMemberHandle> LobbyHandle::LobbyMembers() const
9612{
9613 assert(state_ == DiscordObjectState::Owned);
9614 Discord_LobbyMemberHandleSpan returnValueNative__;
9615 Discord_LobbyHandle_LobbyMembers(&instance_, &returnValueNative__);
9616 std::vector<discordpp::LobbyMemberHandle> returnValue__;
9617 returnValue__.reserve(returnValueNative__.size);
9618 for (size_t i__ = 0; i__ < returnValueNative__.size; ++i__) {
9619 returnValue__.emplace_back(returnValueNative__.ptr[i__], DiscordObjectState::Owned);
9620 }
9621 Discord_Free(returnValueNative__.ptr);
9622 return returnValue__;
9623}
9624std::unordered_map<std::string, std::string> LobbyHandle::Metadata() const
9625{
9626 assert(state_ == DiscordObjectState::Owned);
9627 Discord_Properties returnValueNative__;
9628 Discord_LobbyHandle_Metadata(&instance_, &returnValueNative__);
9629 std::unordered_map<std::string, std::string> returnValue__ =
9630 ConvertReturnedProperties(returnValueNative__);
9631 Discord_FreeProperties(returnValueNative__);
9632 return returnValue__;
9633}
9634const AdditionalContent AdditionalContent::nullobj{{}, DiscordObjectState::Invalid};
9635AdditionalContent::~AdditionalContent()
9636{
9637 if (state_ == DiscordObjectState::Owned) {
9638 Drop();
9639 state_ = DiscordObjectState::Invalid;
9640 }
9641}
9642AdditionalContent::AdditionalContent(AdditionalContent&& other) noexcept
9643 : instance_(other.instance_)
9644 , state_(other.state_)
9645{
9646 other.state_ = DiscordObjectState::Invalid;
9647}
9648AdditionalContent& AdditionalContent::operator=(AdditionalContent&& other) noexcept
9649{
9650 if (this != &other) {
9651 if (state_ == DiscordObjectState::Owned) {
9652 Drop();
9653 }
9654 instance_ = other.instance_;
9655 state_ = other.state_;
9656 other.state_ = DiscordObjectState::Invalid;
9657 }
9658 return *this;
9659}
9660AdditionalContent::AdditionalContent(const AdditionalContent& arg0)
9661 : instance_{}
9662 , state_(DiscordObjectState::Invalid)
9663{
9664 if (arg0.state_ == DiscordObjectState::Owned) {
9665 Discord_AdditionalContent_Clone(&instance_, arg0.instance());
9666
9667 state_ = DiscordObjectState::Owned;
9668 }
9669}
9670AdditionalContent& AdditionalContent::operator=(const AdditionalContent& arg0)
9671{
9672 if (this != &arg0) {
9673 if (state_ == DiscordObjectState::Owned) {
9674 Drop();
9675 state_ = DiscordObjectState::Invalid;
9676 }
9677 if (arg0.state_ == DiscordObjectState::Owned) {
9678 Discord_AdditionalContent_Clone(&instance_, arg0.instance());
9679
9680 state_ = DiscordObjectState::Owned;
9681 }
9682 }
9683 return *this;
9684}
9685AdditionalContent::AdditionalContent(Discord_AdditionalContent instance, DiscordObjectState state)
9686 : instance_(instance)
9687 , state_(state)
9688{
9689}
9690AdditionalContent::AdditionalContent()
9691{
9692 assert(state_ == DiscordObjectState::Invalid);
9693 Discord_AdditionalContent_Init(&instance_);
9694 state_ = DiscordObjectState::Owned;
9695}
9696void AdditionalContent::Drop()
9697{
9698 if (state_ != DiscordObjectState::Owned) {
9699 return;
9700 }
9701 Discord_AdditionalContent_Drop(&instance_);
9702 state_ = DiscordObjectState::Invalid;
9703}
9704bool AdditionalContent::Equals(discordpp::AdditionalContent rhs) const
9705{
9706 assert(state_ == DiscordObjectState::Owned);
9707 bool returnValue__;
9708 returnValue__ = Discord_AdditionalContent_Equals(&instance_, rhs.instance());
9709 return returnValue__;
9710}
9711std::string AdditionalContent::TypeToString(discordpp::AdditionalContentType type)
9712{
9713 Discord_String returnValueNative__;
9714 Discord_AdditionalContent_TypeToString(static_cast<Discord_AdditionalContentType>(type),
9715 &returnValueNative__);
9716 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
9717 returnValueNative__.size);
9718 Discord_Free(returnValueNative__.ptr);
9719 return returnValue__;
9720}
9721discordpp::AdditionalContentType AdditionalContent::Type() const
9722{
9723 assert(state_ == DiscordObjectState::Owned);
9724 Discord_AdditionalContentType returnValue__;
9725 returnValue__ = Discord_AdditionalContent_Type(&instance_);
9726 return static_cast<discordpp::AdditionalContentType>(returnValue__);
9727}
9728void AdditionalContent::SetType(discordpp::AdditionalContentType Type)
9729{
9730 assert(state_ == DiscordObjectState::Owned);
9731 Discord_AdditionalContent_SetType(&instance_, static_cast<Discord_AdditionalContentType>(Type));
9732}
9733std::optional<std::string> AdditionalContent::Title() const
9734{
9735 assert(state_ == DiscordObjectState::Owned);
9736 bool returnIsNonNull__;
9737 Discord_String returnValueNative__;
9738 returnIsNonNull__ = Discord_AdditionalContent_Title(&instance_, &returnValueNative__);
9739 if (!returnIsNonNull__) {
9740 return {};
9741 }
9742 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
9743 returnValueNative__.size);
9744 Discord_Free(returnValueNative__.ptr);
9745 return returnValue__;
9746}
9747void AdditionalContent::SetTitle(std::optional<std::string> Title)
9748{
9749 assert(state_ == DiscordObjectState::Owned);
9750 Discord_String Title__str{};
9751 if (Title.has_value()) {
9752 Title__str.ptr = reinterpret_cast<uint8_t*>(Title->data());
9753 Title__str.size = Title->size();
9754 }
9755 Discord_AdditionalContent_SetTitle(&instance_, (Title.has_value() ? &Title__str : nullptr));
9756}
9757uint8_t AdditionalContent::Count() const
9758{
9759 assert(state_ == DiscordObjectState::Owned);
9760 uint8_t returnValue__;
9761 returnValue__ = Discord_AdditionalContent_Count(&instance_);
9762 return returnValue__;
9763}
9764void AdditionalContent::SetCount(uint8_t Count)
9765{
9766 assert(state_ == DiscordObjectState::Owned);
9767 Discord_AdditionalContent_SetCount(&instance_, Count);
9768}
9769const MessageHandle MessageHandle::nullobj{{}, DiscordObjectState::Invalid};
9770MessageHandle::~MessageHandle()
9771{
9772 if (state_ == DiscordObjectState::Owned) {
9773 Drop();
9774 state_ = DiscordObjectState::Invalid;
9775 }
9776}
9777MessageHandle::MessageHandle(MessageHandle&& other) noexcept
9778 : instance_(other.instance_)
9779 , state_(other.state_)
9780{
9781 other.state_ = DiscordObjectState::Invalid;
9782}
9783MessageHandle& MessageHandle::operator=(MessageHandle&& other) noexcept
9784{
9785 if (this != &other) {
9786 if (state_ == DiscordObjectState::Owned) {
9787 Drop();
9788 }
9789 instance_ = other.instance_;
9790 state_ = other.state_;
9791 other.state_ = DiscordObjectState::Invalid;
9792 }
9793 return *this;
9794}
9795MessageHandle::MessageHandle(const MessageHandle& other)
9796 : instance_{}
9797 , state_(DiscordObjectState::Invalid)
9798{
9799 if (other.state_ == DiscordObjectState::Owned) {
9800 Discord_MessageHandle_Clone(&instance_, other.instance());
9801
9802 state_ = DiscordObjectState::Owned;
9803 }
9804}
9805MessageHandle& MessageHandle::operator=(const MessageHandle& other)
9806{
9807 if (this != &other) {
9808 if (state_ == DiscordObjectState::Owned) {
9809 Drop();
9810 state_ = DiscordObjectState::Invalid;
9811 }
9812 if (other.state_ == DiscordObjectState::Owned) {
9813 Discord_MessageHandle_Clone(&instance_, other.instance());
9814
9815 state_ = DiscordObjectState::Owned;
9816 }
9817 }
9818 return *this;
9819}
9820MessageHandle::MessageHandle(Discord_MessageHandle instance, DiscordObjectState state)
9821 : instance_(instance)
9822 , state_(state)
9823{
9824}
9825void MessageHandle::Drop()
9826{
9827 if (state_ != DiscordObjectState::Owned) {
9828 return;
9829 }
9830 Discord_MessageHandle_Drop(&instance_);
9831 state_ = DiscordObjectState::Invalid;
9832}
9833std::optional<discordpp::AdditionalContent> MessageHandle::AdditionalContent() const
9834{
9835 assert(state_ == DiscordObjectState::Owned);
9836 bool returnIsNonNull__;
9837 Discord_AdditionalContent returnValueNative__;
9838 returnIsNonNull__ = Discord_MessageHandle_AdditionalContent(&instance_, &returnValueNative__);
9839 if (!returnIsNonNull__) {
9840 return {};
9841 }
9842 discordpp::AdditionalContent returnValue__(returnValueNative__, DiscordObjectState::Owned);
9843 return returnValue__;
9844}
9845std::optional<std::string> MessageHandle::AdditionalName() const
9846{
9847 assert(state_ == DiscordObjectState::Owned);
9848 bool returnIsNonNull__;
9849 Discord_String returnValueNative__;
9850 returnIsNonNull__ = Discord_MessageHandle_AdditionalName(&instance_, &returnValueNative__);
9851 if (!returnIsNonNull__) {
9852 return {};
9853 }
9854 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
9855 returnValueNative__.size);
9856 Discord_Free(returnValueNative__.ptr);
9857 return returnValue__;
9858}
9859std::optional<uint64_t> MessageHandle::ApplicationId() const
9860{
9861 assert(state_ == DiscordObjectState::Owned);
9862 bool returnIsNonNull__;
9863 uint64_t returnValue__;
9864 returnIsNonNull__ = Discord_MessageHandle_ApplicationId(&instance_, &returnValue__);
9865 if (!returnIsNonNull__) {
9866 return std::nullopt;
9867 }
9868 return returnValue__;
9869}
9870std::optional<discordpp::UserHandle> MessageHandle::Author() const
9871{
9872 assert(state_ == DiscordObjectState::Owned);
9873 bool returnIsNonNull__;
9874 Discord_UserHandle returnValueNative__;
9875 returnIsNonNull__ = Discord_MessageHandle_Author(&instance_, &returnValueNative__);
9876 if (!returnIsNonNull__) {
9877 return {};
9878 }
9879 discordpp::UserHandle returnValue__(returnValueNative__, DiscordObjectState::Owned);
9880 return returnValue__;
9881}
9882uint64_t MessageHandle::AuthorId() const
9883{
9884 assert(state_ == DiscordObjectState::Owned);
9885 uint64_t returnValue__;
9886 returnValue__ = Discord_MessageHandle_AuthorId(&instance_);
9887 return returnValue__;
9888}
9889std::optional<discordpp::ChannelHandle> MessageHandle::Channel() const
9890{
9891 assert(state_ == DiscordObjectState::Owned);
9892 bool returnIsNonNull__;
9893 Discord_ChannelHandle returnValueNative__;
9894 returnIsNonNull__ = Discord_MessageHandle_Channel(&instance_, &returnValueNative__);
9895 if (!returnIsNonNull__) {
9896 return {};
9897 }
9898 discordpp::ChannelHandle returnValue__(returnValueNative__, DiscordObjectState::Owned);
9899 return returnValue__;
9900}
9901uint64_t MessageHandle::ChannelId() const
9902{
9903 assert(state_ == DiscordObjectState::Owned);
9904 uint64_t returnValue__;
9905 returnValue__ = Discord_MessageHandle_ChannelId(&instance_);
9906 return returnValue__;
9907}
9908std::string MessageHandle::Content() const
9909{
9910 assert(state_ == DiscordObjectState::Owned);
9911 Discord_String returnValueNative__;
9912 Discord_MessageHandle_Content(&instance_, &returnValueNative__);
9913 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
9914 returnValueNative__.size);
9915 Discord_Free(returnValueNative__.ptr);
9916 return returnValue__;
9917}
9918std::optional<discordpp::DisclosureTypes> MessageHandle::DisclosureType() const
9919{
9920 assert(state_ == DiscordObjectState::Owned);
9921 bool returnIsNonNull__;
9922 Discord_DisclosureTypes returnValueNative__;
9923 returnIsNonNull__ = Discord_MessageHandle_DisclosureType(&instance_, &returnValueNative__);
9924 if (!returnIsNonNull__) {
9925 return {};
9926 }
9927 auto returnValue__ = static_cast<discordpp::DisclosureTypes>(returnValueNative__);
9928 return returnValue__;
9929}
9930uint64_t MessageHandle::EditedTimestamp() const
9931{
9932 assert(state_ == DiscordObjectState::Owned);
9933 uint64_t returnValue__;
9934 returnValue__ = Discord_MessageHandle_EditedTimestamp(&instance_);
9935 return returnValue__;
9936}
9937uint64_t MessageHandle::Id() const
9938{
9939 assert(state_ == DiscordObjectState::Owned);
9940 uint64_t returnValue__;
9941 returnValue__ = Discord_MessageHandle_Id(&instance_);
9942 return returnValue__;
9943}
9944std::optional<discordpp::LobbyHandle> MessageHandle::Lobby() const
9945{
9946 assert(state_ == DiscordObjectState::Owned);
9947 bool returnIsNonNull__;
9948 Discord_LobbyHandle returnValueNative__;
9949 returnIsNonNull__ = Discord_MessageHandle_Lobby(&instance_, &returnValueNative__);
9950 if (!returnIsNonNull__) {
9951 return {};
9952 }
9953 discordpp::LobbyHandle returnValue__(returnValueNative__, DiscordObjectState::Owned);
9954 return returnValue__;
9955}
9956std::unordered_map<std::string, std::string> MessageHandle::Metadata() const
9957{
9958 assert(state_ == DiscordObjectState::Owned);
9959 Discord_Properties returnValueNative__;
9960 Discord_MessageHandle_Metadata(&instance_, &returnValueNative__);
9961 std::unordered_map<std::string, std::string> returnValue__ =
9962 ConvertReturnedProperties(returnValueNative__);
9963 Discord_FreeProperties(returnValueNative__);
9964 return returnValue__;
9965}
9966std::unordered_map<std::string, std::string> MessageHandle::ModerationMetadata() const
9967{
9968 assert(state_ == DiscordObjectState::Owned);
9969 Discord_Properties returnValueNative__;
9970 Discord_MessageHandle_ModerationMetadata(&instance_, &returnValueNative__);
9971 std::unordered_map<std::string, std::string> returnValue__ =
9972 ConvertReturnedProperties(returnValueNative__);
9973 Discord_FreeProperties(returnValueNative__);
9974 return returnValue__;
9975}
9976std::string MessageHandle::RawContent() const
9977{
9978 assert(state_ == DiscordObjectState::Owned);
9979 Discord_String returnValueNative__;
9980 Discord_MessageHandle_RawContent(&instance_, &returnValueNative__);
9981 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
9982 returnValueNative__.size);
9983 Discord_Free(returnValueNative__.ptr);
9984 return returnValue__;
9985}
9986std::optional<discordpp::UserHandle> MessageHandle::Recipient() const
9987{
9988 assert(state_ == DiscordObjectState::Owned);
9989 bool returnIsNonNull__;
9990 Discord_UserHandle returnValueNative__;
9991 returnIsNonNull__ = Discord_MessageHandle_Recipient(&instance_, &returnValueNative__);
9992 if (!returnIsNonNull__) {
9993 return {};
9994 }
9995 discordpp::UserHandle returnValue__(returnValueNative__, DiscordObjectState::Owned);
9996 return returnValue__;
9997}
9998uint64_t MessageHandle::RecipientId() const
9999{
10000 assert(state_ == DiscordObjectState::Owned);
10001 uint64_t returnValue__;
10002 returnValue__ = Discord_MessageHandle_RecipientId(&instance_);
10003 return returnValue__;
10004}
10005bool MessageHandle::SentFromGame() const
10006{
10007 assert(state_ == DiscordObjectState::Owned);
10008 bool returnValue__;
10009 returnValue__ = Discord_MessageHandle_SentFromGame(&instance_);
10010 return returnValue__;
10011}
10012uint64_t MessageHandle::SentTimestamp() const
10013{
10014 assert(state_ == DiscordObjectState::Owned);
10015 uint64_t returnValue__;
10016 returnValue__ = Discord_MessageHandle_SentTimestamp(&instance_);
10017 return returnValue__;
10018}
10019const AudioDevice AudioDevice::nullobj{{}, DiscordObjectState::Invalid};
10020AudioDevice::~AudioDevice()
10021{
10022 if (state_ == DiscordObjectState::Owned) {
10023 Drop();
10024 state_ = DiscordObjectState::Invalid;
10025 }
10026}
10027AudioDevice::AudioDevice(AudioDevice&& other) noexcept
10028 : instance_(other.instance_)
10029 , state_(other.state_)
10030{
10031 other.state_ = DiscordObjectState::Invalid;
10032}
10033AudioDevice& AudioDevice::operator=(AudioDevice&& other) noexcept
10034{
10035 if (this != &other) {
10036 if (state_ == DiscordObjectState::Owned) {
10037 Drop();
10038 }
10039 instance_ = other.instance_;
10040 state_ = other.state_;
10041 other.state_ = DiscordObjectState::Invalid;
10042 }
10043 return *this;
10044}
10045AudioDevice::AudioDevice(const AudioDevice& arg0)
10046 : instance_{}
10047 , state_(DiscordObjectState::Invalid)
10048{
10049 if (arg0.state_ == DiscordObjectState::Owned) {
10050 Discord_AudioDevice_Clone(&instance_, arg0.instance());
10051
10052 state_ = DiscordObjectState::Owned;
10053 }
10054}
10055AudioDevice& AudioDevice::operator=(const AudioDevice& arg0)
10056{
10057 if (this != &arg0) {
10058 if (state_ == DiscordObjectState::Owned) {
10059 Drop();
10060 state_ = DiscordObjectState::Invalid;
10061 }
10062 if (arg0.state_ == DiscordObjectState::Owned) {
10063 Discord_AudioDevice_Clone(&instance_, arg0.instance());
10064
10065 state_ = DiscordObjectState::Owned;
10066 }
10067 }
10068 return *this;
10069}
10070AudioDevice::AudioDevice(Discord_AudioDevice instance, DiscordObjectState state)
10071 : instance_(instance)
10072 , state_(state)
10073{
10074}
10075void AudioDevice::Drop()
10076{
10077 if (state_ != DiscordObjectState::Owned) {
10078 return;
10079 }
10080 Discord_AudioDevice_Drop(&instance_);
10081 state_ = DiscordObjectState::Invalid;
10082}
10083bool AudioDevice::Equals(discordpp::AudioDevice rhs)
10084{
10085 assert(state_ == DiscordObjectState::Owned);
10086 bool returnValue__;
10087 returnValue__ = Discord_AudioDevice_Equals(&instance_, rhs.instance());
10088 return returnValue__;
10089}
10090std::string AudioDevice::Id() const
10091{
10092 assert(state_ == DiscordObjectState::Owned);
10093 Discord_String returnValueNative__;
10094 Discord_AudioDevice_Id(&instance_, &returnValueNative__);
10095 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
10096 returnValueNative__.size);
10097 Discord_Free(returnValueNative__.ptr);
10098 return returnValue__;
10099}
10100void AudioDevice::SetId(std::string Id)
10101{
10102 assert(state_ == DiscordObjectState::Owned);
10103 Discord_String Id__str{(uint8_t*)(Id.data()), Id.size()};
10104 Discord_AudioDevice_SetId(&instance_, Id__str);
10105}
10106std::string AudioDevice::Name() const
10107{
10108 assert(state_ == DiscordObjectState::Owned);
10109 Discord_String returnValueNative__;
10110 Discord_AudioDevice_Name(&instance_, &returnValueNative__);
10111 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
10112 returnValueNative__.size);
10113 Discord_Free(returnValueNative__.ptr);
10114 return returnValue__;
10115}
10116void AudioDevice::SetName(std::string Name)
10117{
10118 assert(state_ == DiscordObjectState::Owned);
10119 Discord_String Name__str{(uint8_t*)(Name.data()), Name.size()};
10120 Discord_AudioDevice_SetName(&instance_, Name__str);
10121}
10122bool AudioDevice::IsDefault() const
10123{
10124 assert(state_ == DiscordObjectState::Owned);
10125 bool returnValue__;
10126 returnValue__ = Discord_AudioDevice_IsDefault(&instance_);
10127 return returnValue__;
10128}
10129void AudioDevice::SetIsDefault(bool IsDefault)
10130{
10131 assert(state_ == DiscordObjectState::Owned);
10132 Discord_AudioDevice_SetIsDefault(&instance_, IsDefault);
10133}
10134const VoiceSettings VoiceSettings::nullobj{{}, DiscordObjectState::Invalid};
10135VoiceSettings::~VoiceSettings()
10136{
10137 if (state_ == DiscordObjectState::Owned) {
10138 Drop();
10139 state_ = DiscordObjectState::Invalid;
10140 }
10141}
10142VoiceSettings::VoiceSettings(VoiceSettings&& other) noexcept
10143 : instance_(other.instance_)
10144 , state_(other.state_)
10145{
10146 other.state_ = DiscordObjectState::Invalid;
10147}
10148VoiceSettings& VoiceSettings::operator=(VoiceSettings&& other) noexcept
10149{
10150 if (this != &other) {
10151 if (state_ == DiscordObjectState::Owned) {
10152 Drop();
10153 }
10154 instance_ = other.instance_;
10155 state_ = other.state_;
10156 other.state_ = DiscordObjectState::Invalid;
10157 }
10158 return *this;
10159}
10160VoiceSettings::VoiceSettings(const VoiceSettings& arg0)
10161 : instance_{}
10162 , state_(DiscordObjectState::Invalid)
10163{
10164 if (arg0.state_ == DiscordObjectState::Owned) {
10165 Discord_VoiceSettings_Clone(&instance_, arg0.instance());
10166
10167 state_ = DiscordObjectState::Owned;
10168 }
10169}
10170VoiceSettings& VoiceSettings::operator=(const VoiceSettings& arg0)
10171{
10172 if (this != &arg0) {
10173 if (state_ == DiscordObjectState::Owned) {
10174 Drop();
10175 state_ = DiscordObjectState::Invalid;
10176 }
10177 if (arg0.state_ == DiscordObjectState::Owned) {
10178 Discord_VoiceSettings_Clone(&instance_, arg0.instance());
10179
10180 state_ = DiscordObjectState::Owned;
10181 }
10182 }
10183 return *this;
10184}
10185VoiceSettings::VoiceSettings(Discord_VoiceSettings instance, DiscordObjectState state)
10186 : instance_(instance)
10187 , state_(state)
10188{
10189}
10190void VoiceSettings::Drop()
10191{
10192 if (state_ != DiscordObjectState::Owned) {
10193 return;
10194 }
10195 Discord_VoiceSettings_Drop(&instance_);
10196 state_ = DiscordObjectState::Invalid;
10197}
10198bool VoiceSettings::SelfMute() const
10199{
10200 assert(state_ == DiscordObjectState::Owned);
10201 bool returnValue__;
10202 returnValue__ = Discord_VoiceSettings_SelfMute(&instance_);
10203 return returnValue__;
10204}
10205void VoiceSettings::SetSelfMute(bool SelfMute)
10206{
10207 assert(state_ == DiscordObjectState::Owned);
10208 Discord_VoiceSettings_SetSelfMute(&instance_, SelfMute);
10209}
10210bool VoiceSettings::SelfDeaf() const
10211{
10212 assert(state_ == DiscordObjectState::Owned);
10213 bool returnValue__;
10214 returnValue__ = Discord_VoiceSettings_SelfDeaf(&instance_);
10215 return returnValue__;
10216}
10217void VoiceSettings::SetSelfDeaf(bool SelfDeaf)
10218{
10219 assert(state_ == DiscordObjectState::Owned);
10220 Discord_VoiceSettings_SetSelfDeaf(&instance_, SelfDeaf);
10221}
10222discordpp::VoiceInputModeType VoiceSettings::InputMode() const
10223{
10224 assert(state_ == DiscordObjectState::Owned);
10225 Discord_VoiceInputModeType returnValue__;
10226 returnValue__ = Discord_VoiceSettings_InputMode(&instance_);
10227 return static_cast<discordpp::VoiceInputModeType>(returnValue__);
10228}
10229void VoiceSettings::SetInputMode(discordpp::VoiceInputModeType InputMode)
10230{
10231 assert(state_ == DiscordObjectState::Owned);
10232 Discord_VoiceSettings_SetInputMode(&instance_,
10233 static_cast<Discord_VoiceInputModeType>(InputMode));
10234}
10235std::string VoiceSettings::PttKey() const
10236{
10237 assert(state_ == DiscordObjectState::Owned);
10238 Discord_String returnValueNative__;
10239 Discord_VoiceSettings_PttKey(&instance_, &returnValueNative__);
10240 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
10241 returnValueNative__.size);
10242 Discord_Free(returnValueNative__.ptr);
10243 return returnValue__;
10244}
10245void VoiceSettings::SetPttKey(std::string PttKey)
10246{
10247 assert(state_ == DiscordObjectState::Owned);
10248 Discord_String PttKey__str{(uint8_t*)(PttKey.data()), PttKey.size()};
10249 Discord_VoiceSettings_SetPttKey(&instance_, PttKey__str);
10250}
10251float VoiceSettings::InputVolume() const
10252{
10253 assert(state_ == DiscordObjectState::Owned);
10254 float returnValue__;
10255 returnValue__ = Discord_VoiceSettings_InputVolume(&instance_);
10256 return returnValue__;
10257}
10258void VoiceSettings::SetInputVolume(float InputVolume)
10259{
10260 assert(state_ == DiscordObjectState::Owned);
10261 Discord_VoiceSettings_SetInputVolume(&instance_, InputVolume);
10262}
10263float VoiceSettings::OutputVolume() const
10264{
10265 assert(state_ == DiscordObjectState::Owned);
10266 float returnValue__;
10267 returnValue__ = Discord_VoiceSettings_OutputVolume(&instance_);
10268 return returnValue__;
10269}
10270void VoiceSettings::SetOutputVolume(float OutputVolume)
10271{
10272 assert(state_ == DiscordObjectState::Owned);
10273 Discord_VoiceSettings_SetOutputVolume(&instance_, OutputVolume);
10274}
10275bool VoiceSettings::AutomaticGainControl() const
10276{
10277 assert(state_ == DiscordObjectState::Owned);
10278 bool returnValue__;
10279 returnValue__ = Discord_VoiceSettings_AutomaticGainControl(&instance_);
10280 return returnValue__;
10281}
10282void VoiceSettings::SetAutomaticGainControl(bool AutomaticGainControl)
10283{
10284 assert(state_ == DiscordObjectState::Owned);
10285 Discord_VoiceSettings_SetAutomaticGainControl(&instance_, AutomaticGainControl);
10286}
10287bool VoiceSettings::EchoCancellation() const
10288{
10289 assert(state_ == DiscordObjectState::Owned);
10290 bool returnValue__;
10291 returnValue__ = Discord_VoiceSettings_EchoCancellation(&instance_);
10292 return returnValue__;
10293}
10294void VoiceSettings::SetEchoCancellation(bool EchoCancellation)
10295{
10296 assert(state_ == DiscordObjectState::Owned);
10297 Discord_VoiceSettings_SetEchoCancellation(&instance_, EchoCancellation);
10298}
10299bool VoiceSettings::NoiseSuppression() const
10300{
10301 assert(state_ == DiscordObjectState::Owned);
10302 bool returnValue__;
10303 returnValue__ = Discord_VoiceSettings_NoiseSuppression(&instance_);
10304 return returnValue__;
10305}
10306void VoiceSettings::SetNoiseSuppression(bool NoiseSuppression)
10307{
10308 assert(state_ == DiscordObjectState::Owned);
10309 Discord_VoiceSettings_SetNoiseSuppression(&instance_, NoiseSuppression);
10310}
10311bool VoiceSettings::NoiseCancellation() const
10312{
10313 assert(state_ == DiscordObjectState::Owned);
10314 bool returnValue__;
10315 returnValue__ = Discord_VoiceSettings_NoiseCancellation(&instance_);
10316 return returnValue__;
10317}
10318void VoiceSettings::SetNoiseCancellation(bool NoiseCancellation)
10319{
10320 assert(state_ == DiscordObjectState::Owned);
10321 Discord_VoiceSettings_SetNoiseCancellation(&instance_, NoiseCancellation);
10322}
10323const UserMessageSummary UserMessageSummary::nullobj{{}, DiscordObjectState::Invalid};
10324UserMessageSummary::~UserMessageSummary()
10325{
10326 if (state_ == DiscordObjectState::Owned) {
10327 Drop();
10328 state_ = DiscordObjectState::Invalid;
10329 }
10330}
10331UserMessageSummary::UserMessageSummary(UserMessageSummary&& other) noexcept
10332 : instance_(other.instance_)
10333 , state_(other.state_)
10334{
10335 other.state_ = DiscordObjectState::Invalid;
10336}
10337UserMessageSummary& UserMessageSummary::operator=(UserMessageSummary&& other) noexcept
10338{
10339 if (this != &other) {
10340 if (state_ == DiscordObjectState::Owned) {
10341 Drop();
10342 }
10343 instance_ = other.instance_;
10344 state_ = other.state_;
10345 other.state_ = DiscordObjectState::Invalid;
10346 }
10347 return *this;
10348}
10349UserMessageSummary::UserMessageSummary(const UserMessageSummary& arg0)
10350 : instance_{}
10351 , state_(DiscordObjectState::Invalid)
10352{
10353 if (arg0.state_ == DiscordObjectState::Owned) {
10354 Discord_UserMessageSummary_Clone(&instance_, arg0.instance());
10355
10356 state_ = DiscordObjectState::Owned;
10357 }
10358}
10359UserMessageSummary& UserMessageSummary::operator=(const UserMessageSummary& arg0)
10360{
10361 if (this != &arg0) {
10362 if (state_ == DiscordObjectState::Owned) {
10363 Drop();
10364 state_ = DiscordObjectState::Invalid;
10365 }
10366 if (arg0.state_ == DiscordObjectState::Owned) {
10367 Discord_UserMessageSummary_Clone(&instance_, arg0.instance());
10368
10369 state_ = DiscordObjectState::Owned;
10370 }
10371 }
10372 return *this;
10373}
10374UserMessageSummary::UserMessageSummary(Discord_UserMessageSummary instance,
10375 DiscordObjectState state)
10376 : instance_(instance)
10377 , state_(state)
10378{
10379}
10380void UserMessageSummary::Drop()
10381{
10382 if (state_ != DiscordObjectState::Owned) {
10383 return;
10384 }
10385 Discord_UserMessageSummary_Drop(&instance_);
10386 state_ = DiscordObjectState::Invalid;
10387}
10388uint64_t UserMessageSummary::LastMessageId() const
10389{
10390 assert(state_ == DiscordObjectState::Owned);
10391 uint64_t returnValue__;
10392 returnValue__ = Discord_UserMessageSummary_LastMessageId(&instance_);
10393 return returnValue__;
10394}
10395uint64_t UserMessageSummary::UserId() const
10396{
10397 assert(state_ == DiscordObjectState::Owned);
10398 uint64_t returnValue__;
10399 returnValue__ = Discord_UserMessageSummary_UserId(&instance_);
10400 return returnValue__;
10401}
10402const ClientCreateOptions ClientCreateOptions::nullobj{{}, DiscordObjectState::Invalid};
10403ClientCreateOptions::~ClientCreateOptions()
10404{
10405 if (state_ == DiscordObjectState::Owned) {
10406 Drop();
10407 state_ = DiscordObjectState::Invalid;
10408 }
10409}
10410ClientCreateOptions::ClientCreateOptions(ClientCreateOptions&& other) noexcept
10411 : instance_(other.instance_)
10412 , state_(other.state_)
10413{
10414 other.state_ = DiscordObjectState::Invalid;
10415}
10416ClientCreateOptions& ClientCreateOptions::operator=(ClientCreateOptions&& other) noexcept
10417{
10418 if (this != &other) {
10419 if (state_ == DiscordObjectState::Owned) {
10420 Drop();
10421 }
10422 instance_ = other.instance_;
10423 state_ = other.state_;
10424 other.state_ = DiscordObjectState::Invalid;
10425 }
10426 return *this;
10427}
10428ClientCreateOptions::ClientCreateOptions(const ClientCreateOptions& arg0)
10429 : instance_{}
10430 , state_(DiscordObjectState::Invalid)
10431{
10432 if (arg0.state_ == DiscordObjectState::Owned) {
10433 Discord_ClientCreateOptions_Clone(&instance_, arg0.instance());
10434
10435 state_ = DiscordObjectState::Owned;
10436 }
10437}
10438ClientCreateOptions& ClientCreateOptions::operator=(const ClientCreateOptions& arg0)
10439{
10440 if (this != &arg0) {
10441 if (state_ == DiscordObjectState::Owned) {
10442 Drop();
10443 state_ = DiscordObjectState::Invalid;
10444 }
10445 if (arg0.state_ == DiscordObjectState::Owned) {
10446 Discord_ClientCreateOptions_Clone(&instance_, arg0.instance());
10447
10448 state_ = DiscordObjectState::Owned;
10449 }
10450 }
10451 return *this;
10452}
10453ClientCreateOptions::ClientCreateOptions(Discord_ClientCreateOptions instance,
10454 DiscordObjectState state)
10455 : instance_(instance)
10456 , state_(state)
10457{
10458}
10459ClientCreateOptions::ClientCreateOptions()
10460{
10461 assert(state_ == DiscordObjectState::Invalid);
10462 Discord_ClientCreateOptions_Init(&instance_);
10463 state_ = DiscordObjectState::Owned;
10464}
10465void ClientCreateOptions::Drop()
10466{
10467 if (state_ != DiscordObjectState::Owned) {
10468 return;
10469 }
10470 Discord_ClientCreateOptions_Drop(&instance_);
10471 state_ = DiscordObjectState::Invalid;
10472}
10473std::string ClientCreateOptions::WebBase() const
10474{
10475 assert(state_ == DiscordObjectState::Owned);
10476 Discord_String returnValueNative__;
10477 Discord_ClientCreateOptions_WebBase(&instance_, &returnValueNative__);
10478 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
10479 returnValueNative__.size);
10480 Discord_Free(returnValueNative__.ptr);
10481 return returnValue__;
10482}
10483void ClientCreateOptions::SetWebBase(std::string WebBase)
10484{
10485 assert(state_ == DiscordObjectState::Owned);
10486 Discord_String WebBase__str{(uint8_t*)(WebBase.data()), WebBase.size()};
10487 Discord_ClientCreateOptions_SetWebBase(&instance_, WebBase__str);
10488}
10489std::string ClientCreateOptions::ApiBase() const
10490{
10491 assert(state_ == DiscordObjectState::Owned);
10492 Discord_String returnValueNative__;
10493 Discord_ClientCreateOptions_ApiBase(&instance_, &returnValueNative__);
10494 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
10495 returnValueNative__.size);
10496 Discord_Free(returnValueNative__.ptr);
10497 return returnValue__;
10498}
10499void ClientCreateOptions::SetApiBase(std::string ApiBase)
10500{
10501 assert(state_ == DiscordObjectState::Owned);
10502 Discord_String ApiBase__str{(uint8_t*)(ApiBase.data()), ApiBase.size()};
10503 Discord_ClientCreateOptions_SetApiBase(&instance_, ApiBase__str);
10504}
10505discordpp::AudioSystem ClientCreateOptions::ExperimentalAudioSystem() const
10506{
10507 assert(state_ == DiscordObjectState::Owned);
10508 Discord_AudioSystem returnValue__;
10509 returnValue__ = Discord_ClientCreateOptions_ExperimentalAudioSystem(&instance_);
10510 return static_cast<discordpp::AudioSystem>(returnValue__);
10511}
10512void ClientCreateOptions::SetExperimentalAudioSystem(discordpp::AudioSystem ExperimentalAudioSystem)
10513{
10514 assert(state_ == DiscordObjectState::Owned);
10515 Discord_ClientCreateOptions_SetExperimentalAudioSystem(
10516 &instance_, static_cast<Discord_AudioSystem>(ExperimentalAudioSystem));
10517}
10518bool ClientCreateOptions::ExperimentalAndroidPreventCommsForBluetooth() const
10519{
10520 assert(state_ == DiscordObjectState::Owned);
10521 bool returnValue__;
10522 returnValue__ =
10523 Discord_ClientCreateOptions_ExperimentalAndroidPreventCommsForBluetooth(&instance_);
10524 return returnValue__;
10525}
10526void ClientCreateOptions::SetExperimentalAndroidPreventCommsForBluetooth(
10527 bool ExperimentalAndroidPreventCommsForBluetooth)
10528{
10529 assert(state_ == DiscordObjectState::Owned);
10530 Discord_ClientCreateOptions_SetExperimentalAndroidPreventCommsForBluetooth(
10531 &instance_, ExperimentalAndroidPreventCommsForBluetooth);
10532}
10533std::optional<uint64_t> ClientCreateOptions::CpuAffinityMask() const
10534{
10535 assert(state_ == DiscordObjectState::Owned);
10536 bool returnIsNonNull__;
10537 uint64_t returnValue__;
10538 returnIsNonNull__ = Discord_ClientCreateOptions_CpuAffinityMask(&instance_, &returnValue__);
10539 if (!returnIsNonNull__) {
10540 return std::nullopt;
10541 }
10542 return returnValue__;
10543}
10544void ClientCreateOptions::SetCpuAffinityMask(std::optional<uint64_t> CpuAffinityMask)
10545{
10546 assert(state_ == DiscordObjectState::Owned);
10547 Discord_ClientCreateOptions_SetCpuAffinityMask(
10548 &instance_, (CpuAffinityMask.has_value() ? &*CpuAffinityMask : nullptr));
10549}
10550const Client Client::nullobj{{}, DiscordObjectState::Invalid};
10551Client::~Client()
10552{
10553 if (state_ == DiscordObjectState::Owned) {
10554 Drop();
10555 state_ = DiscordObjectState::Invalid;
10556 }
10557}
10558Client::Client(Client&& other) noexcept
10559 : instance_(other.instance_)
10560 , state_(other.state_)
10561{
10562 other.state_ = DiscordObjectState::Invalid;
10563}
10564Client& Client::operator=(Client&& other) noexcept
10565{
10566 if (this != &other) {
10567 if (state_ == DiscordObjectState::Owned) {
10568 Drop();
10569 }
10570 instance_ = other.instance_;
10571 state_ = other.state_;
10572 other.state_ = DiscordObjectState::Invalid;
10573 }
10574 return *this;
10575}
10576Client::Client(Discord_Client instance, DiscordObjectState state)
10577 : instance_(instance)
10578 , state_(state)
10579{
10580}
10581Client::Client()
10582{
10583 assert(state_ == DiscordObjectState::Invalid);
10584 Discord_Client_Init(&instance_);
10585 state_ = DiscordObjectState::Owned;
10586}
10587Client::Client(std::string apiBase, std::string webBase)
10588{
10589 assert(state_ == DiscordObjectState::Invalid);
10590 Discord_String apiBase__str{(uint8_t*)(apiBase.data()), apiBase.size()};
10591 Discord_String webBase__str{(uint8_t*)(webBase.data()), webBase.size()};
10592 Discord_Client_InitWithBases(&instance_, apiBase__str, webBase__str);
10593 state_ = DiscordObjectState::Owned;
10594}
10595Client::Client(discordpp::ClientCreateOptions options)
10596{
10597 assert(state_ == DiscordObjectState::Invalid);
10598 Discord_Client_InitWithOptions(&instance_, options.instance());
10599 state_ = DiscordObjectState::Owned;
10600}
10601void Client::Drop()
10602{
10603 if (state_ != DiscordObjectState::Owned) {
10604 return;
10605 }
10606 Discord_Client_Drop(&instance_);
10607 state_ = DiscordObjectState::Invalid;
10608}
10609std::string Client::ErrorToString(discordpp::Client::Error type)
10610{
10611 Discord_String returnValueNative__;
10612 Discord_Client_ErrorToString(static_cast<Discord_Client_Error>(type), &returnValueNative__);
10613 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
10614 returnValueNative__.size);
10615 Discord_Free(returnValueNative__.ptr);
10616 return returnValue__;
10617}
10618uint64_t Client::GetApplicationId()
10619{
10620 assert(state_ == DiscordObjectState::Owned);
10621 uint64_t returnValue__;
10622 returnValue__ = Discord_Client_GetApplicationId(&instance_);
10623 return returnValue__;
10624}
10625discordpp::UserHandle Client::GetCurrentUser() const
10626{
10627 assert(state_ == DiscordObjectState::Owned);
10628 Discord_UserHandle returnValueNative__{};
10629 Discord_Client_GetCurrentUser(&instance_, &returnValueNative__);
10630 discordpp::UserHandle returnValue__(returnValueNative__, DiscordObjectState::Owned);
10631 return returnValue__;
10632}
10633std::string Client::GetDefaultAudioDeviceId()
10634{
10635 Discord_String returnValueNative__;
10636 Discord_Client_GetDefaultAudioDeviceId(&returnValueNative__);
10637 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
10638 returnValueNative__.size);
10639 Discord_Free(returnValueNative__.ptr);
10640 return returnValue__;
10641}
10642std::string Client::GetDefaultCommunicationScopes()
10643{
10644 Discord_String returnValueNative__;
10645 Discord_Client_GetDefaultCommunicationScopes(&returnValueNative__);
10646 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
10647 returnValueNative__.size);
10648 Discord_Free(returnValueNative__.ptr);
10649 return returnValue__;
10650}
10651std::string Client::GetDefaultPresenceScopes()
10652{
10653 Discord_String returnValueNative__;
10654 Discord_Client_GetDefaultPresenceScopes(&returnValueNative__);
10655 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
10656 returnValueNative__.size);
10657 Discord_Free(returnValueNative__.ptr);
10658 return returnValue__;
10659}
10660std::string Client::GetVersionHash()
10661{
10662 Discord_String returnValueNative__;
10663 Discord_Client_GetVersionHash(&returnValueNative__);
10664 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
10665 returnValueNative__.size);
10666 Discord_Free(returnValueNative__.ptr);
10667 return returnValue__;
10668}
10669int32_t Client::GetVersionMajor()
10670{
10671 int32_t returnValue__;
10672 returnValue__ = Discord_Client_GetVersionMajor();
10673 return returnValue__;
10674}
10675int32_t Client::GetVersionMinor()
10676{
10677 int32_t returnValue__;
10678 returnValue__ = Discord_Client_GetVersionMinor();
10679 return returnValue__;
10680}
10681int32_t Client::GetVersionPatch()
10682{
10683 int32_t returnValue__;
10684 returnValue__ = Discord_Client_GetVersionPatch();
10685 return returnValue__;
10686}
10687void Client::SetHttpRequestTimeout(int32_t httpTimeoutInMilliseconds)
10688{
10689 assert(state_ == DiscordObjectState::Owned);
10690 Discord_Client_SetHttpRequestTimeout(&instance_, httpTimeoutInMilliseconds);
10691}
10692std::string Client::StatusToString(discordpp::Client::Status type)
10693{
10694 Discord_String returnValueNative__;
10695 Discord_Client_StatusToString(static_cast<Discord_Client_Status>(type), &returnValueNative__);
10696 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
10697 returnValueNative__.size);
10698 Discord_Free(returnValueNative__.ptr);
10699 return returnValue__;
10700}
10701std::string Client::ThreadToString(discordpp::Client::Thread type)
10702{
10703 Discord_String returnValueNative__;
10704 Discord_Client_ThreadToString(static_cast<Discord_Client_Thread>(type), &returnValueNative__);
10705 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
10706 returnValueNative__.size);
10707 Discord_Free(returnValueNative__.ptr);
10708 return returnValue__;
10709}
10710void Client::EndCall(uint64_t channelId, discordpp::Client::EndCallCallback callback)
10711{
10712 assert(state_ == DiscordObjectState::Owned);
10713 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
10714 auto callback__userData = new Tcallback__UserData(callback);
10715 Discord_Client_EndCallCallback callback__native = [](void* userData__) {
10716 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
10717 userData__typed->delegate();
10718 };
10719 Discord_Client_EndCall(
10720 &instance_, channelId, callback__native, Tcallback__UserData::Free, callback__userData);
10721}
10722void Client::EndCalls(discordpp::Client::EndCallsCallback callback)
10723{
10724 assert(state_ == DiscordObjectState::Owned);
10725 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
10726 auto callback__userData = new Tcallback__UserData(callback);
10727 Discord_Client_EndCallsCallback callback__native = [](void* userData__) {
10728 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
10729 userData__typed->delegate();
10730 };
10731 Discord_Client_EndCalls(
10732 &instance_, callback__native, Tcallback__UserData::Free, callback__userData);
10733}
10734discordpp::Call Client::GetCall(uint64_t channelId)
10735{
10736 assert(state_ == DiscordObjectState::Owned);
10737 bool returnIsNonNull__;
10738 Discord_Call returnValueNative__{};
10739 returnIsNonNull__ = Discord_Client_GetCall(&instance_, channelId, &returnValueNative__);
10740 discordpp::Call returnValue__(
10741 returnValueNative__,
10742 returnIsNonNull__ ? DiscordObjectState::Owned : DiscordObjectState::Invalid);
10743 return returnValue__;
10744}
10745std::vector<discordpp::Call> Client::GetCalls()
10746{
10747 assert(state_ == DiscordObjectState::Owned);
10748 Discord_CallSpan returnValueNative__;
10749 Discord_Client_GetCalls(&instance_, &returnValueNative__);
10750 std::vector<discordpp::Call> returnValue__;
10751 returnValue__.reserve(returnValueNative__.size);
10752 for (size_t i__ = 0; i__ < returnValueNative__.size; ++i__) {
10753 returnValue__.emplace_back(returnValueNative__.ptr[i__], DiscordObjectState::Owned);
10754 }
10755 Discord_Free(returnValueNative__.ptr);
10756 return returnValue__;
10757}
10758void Client::GetCurrentInputDevice(discordpp::Client::GetCurrentInputDeviceCallback cb)
10759{
10760 assert(state_ == DiscordObjectState::Owned);
10761 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
10762 auto cb__userData = new Tcb__UserData(cb);
10763 Discord_Client_GetCurrentInputDeviceCallback cb__native = [](auto device, void* userData__) {
10764 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
10765 discordpp::AudioDevice device__obj(*device, DiscordObjectState::Owned);
10766 userData__typed->delegate(std::move(device__obj));
10767 };
10768 Discord_Client_GetCurrentInputDevice(&instance_, cb__native, Tcb__UserData::Free, cb__userData);
10769}
10770void Client::GetCurrentOutputDevice(discordpp::Client::GetCurrentOutputDeviceCallback cb)
10771{
10772 assert(state_ == DiscordObjectState::Owned);
10773 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
10774 auto cb__userData = new Tcb__UserData(cb);
10775 Discord_Client_GetCurrentOutputDeviceCallback cb__native = [](auto device, void* userData__) {
10776 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
10777 discordpp::AudioDevice device__obj(*device, DiscordObjectState::Owned);
10778 userData__typed->delegate(std::move(device__obj));
10779 };
10780 Discord_Client_GetCurrentOutputDevice(
10781 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
10782}
10783void Client::GetInputDevices(discordpp::Client::GetInputDevicesCallback cb)
10784{
10785 assert(state_ == DiscordObjectState::Owned);
10786 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
10787 auto cb__userData = new Tcb__UserData(cb);
10788 Discord_Client_GetInputDevicesCallback cb__native = [](auto devices, void* userData__) {
10789 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
10790 std::vector<discordpp::AudioDevice> devices__vec;
10791 devices__vec.reserve(devices.size);
10792 for (size_t i__ = 0; i__ < devices.size; ++i__) {
10793 devices__vec.emplace_back(devices.ptr[i__], DiscordObjectState::Owned);
10794 }
10795 Discord_Free(devices.ptr);
10796 userData__typed->delegate(std::move(devices__vec));
10797 };
10798 Discord_Client_GetInputDevices(&instance_, cb__native, Tcb__UserData::Free, cb__userData);
10799}
10800float Client::GetInputVolume()
10801{
10802 assert(state_ == DiscordObjectState::Owned);
10803 float returnValue__;
10804 returnValue__ = Discord_Client_GetInputVolume(&instance_);
10805 return returnValue__;
10806}
10807void Client::GetOutputDevices(discordpp::Client::GetOutputDevicesCallback cb)
10808{
10809 assert(state_ == DiscordObjectState::Owned);
10810 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
10811 auto cb__userData = new Tcb__UserData(cb);
10812 Discord_Client_GetOutputDevicesCallback cb__native = [](auto devices, void* userData__) {
10813 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
10814 std::vector<discordpp::AudioDevice> devices__vec;
10815 devices__vec.reserve(devices.size);
10816 for (size_t i__ = 0; i__ < devices.size; ++i__) {
10817 devices__vec.emplace_back(devices.ptr[i__], DiscordObjectState::Owned);
10818 }
10819 Discord_Free(devices.ptr);
10820 userData__typed->delegate(std::move(devices__vec));
10821 };
10822 Discord_Client_GetOutputDevices(&instance_, cb__native, Tcb__UserData::Free, cb__userData);
10823}
10824float Client::GetOutputVolume()
10825{
10826 assert(state_ == DiscordObjectState::Owned);
10827 float returnValue__;
10828 returnValue__ = Discord_Client_GetOutputVolume(&instance_);
10829 return returnValue__;
10830}
10831bool Client::GetSelfDeafAll() const
10832{
10833 assert(state_ == DiscordObjectState::Owned);
10834 bool returnValue__;
10835 returnValue__ = Discord_Client_GetSelfDeafAll(&instance_);
10836 return returnValue__;
10837}
10838bool Client::GetSelfMuteAll() const
10839{
10840 assert(state_ == DiscordObjectState::Owned);
10841 bool returnValue__;
10842 returnValue__ = Discord_Client_GetSelfMuteAll(&instance_);
10843 return returnValue__;
10844}
10845void Client::GetVoiceSettings(discordpp::Client::GetVoiceSettingsCallback cb)
10846{
10847 assert(state_ == DiscordObjectState::Owned);
10848 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
10849 auto cb__userData = new Tcb__UserData(cb);
10850 Discord_Client_GetVoiceSettingsCallback cb__native =
10851 [](auto result, auto settings, void* userData__) {
10852 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
10853 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
10854 discordpp::VoiceSettings settings__obj(*settings, DiscordObjectState::Owned);
10855 userData__typed->delegate(std::move(result__obj), std::move(settings__obj));
10856 };
10857 Discord_Client_GetVoiceSettings(&instance_, cb__native, Tcb__UserData::Free, cb__userData);
10858}
10859void Client::SetAecDump(bool on)
10860{
10861 assert(state_ == DiscordObjectState::Owned);
10862 Discord_Client_SetAecDump(&instance_, on);
10863}
10864void Client::SetAutomaticGainControl(bool on)
10865{
10866 assert(state_ == DiscordObjectState::Owned);
10867 Discord_Client_SetAutomaticGainControl(&instance_, on);
10868}
10869void Client::SetDeviceChangeCallback(discordpp::Client::DeviceChangeCallback callback)
10870{
10871 assert(state_ == DiscordObjectState::Owned);
10872 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
10873 auto callback__userData = new Tcallback__UserData(callback);
10874 Discord_Client_DeviceChangeCallback callback__native =
10875 [](auto inputDevices, auto outputDevices, void* userData__) {
10876 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
10877 std::vector<discordpp::AudioDevice> inputDevices__vec;
10878 inputDevices__vec.reserve(inputDevices.size);
10879 for (size_t i__ = 0; i__ < inputDevices.size; ++i__) {
10880 inputDevices__vec.emplace_back(inputDevices.ptr[i__], DiscordObjectState::Owned);
10881 }
10882 Discord_Free(inputDevices.ptr);
10883 std::vector<discordpp::AudioDevice> outputDevices__vec;
10884 outputDevices__vec.reserve(outputDevices.size);
10885 for (size_t i__ = 0; i__ < outputDevices.size; ++i__) {
10886 outputDevices__vec.emplace_back(outputDevices.ptr[i__], DiscordObjectState::Owned);
10887 }
10888 Discord_Free(outputDevices.ptr);
10889 userData__typed->delegate(std::move(inputDevices__vec), std::move(outputDevices__vec));
10890 };
10891 Discord_Client_SetDeviceChangeCallback(
10892 &instance_, callback__native, Tcallback__UserData::Free, callback__userData);
10893}
10894void Client::SetEchoCancellation(bool on)
10895{
10896 assert(state_ == DiscordObjectState::Owned);
10897 Discord_Client_SetEchoCancellation(&instance_, on);
10898}
10899void Client::SetEngineManagedAudioSession(bool isEngineManaged)
10900{
10901 assert(state_ == DiscordObjectState::Owned);
10902 Discord_Client_SetEngineManagedAudioSession(&instance_, isEngineManaged);
10903}
10904void Client::SetInputDevice(std::string deviceId, discordpp::Client::SetInputDeviceCallback cb)
10905{
10906 assert(state_ == DiscordObjectState::Owned);
10907 Discord_String deviceId__str{(uint8_t*)(deviceId.data()), deviceId.size()};
10908 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
10909 auto cb__userData = new Tcb__UserData(cb);
10910 Discord_Client_SetInputDeviceCallback cb__native = [](auto result, void* userData__) {
10911 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
10912 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
10913 userData__typed->delegate(std::move(result__obj));
10914 };
10915 Discord_Client_SetInputDevice(
10916 &instance_, deviceId__str, cb__native, Tcb__UserData::Free, cb__userData);
10917}
10918void Client::SetInputVolume(float inputVolume)
10919{
10920 assert(state_ == DiscordObjectState::Owned);
10921 Discord_Client_SetInputVolume(&instance_, inputVolume);
10922}
10923void Client::SetNoAudioInputCallback(discordpp::Client::NoAudioInputCallback callback)
10924{
10925 assert(state_ == DiscordObjectState::Owned);
10926 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
10927 auto callback__userData = new Tcallback__UserData(callback);
10928 Discord_Client_NoAudioInputCallback callback__native = [](auto inputDetected,
10929 void* userData__) {
10930 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
10931 userData__typed->delegate(inputDetected);
10932 };
10933 Discord_Client_SetNoAudioInputCallback(
10934 &instance_, callback__native, Tcallback__UserData::Free, callback__userData);
10935}
10936void Client::SetNoAudioInputThreshold(float dBFSThreshold)
10937{
10938 assert(state_ == DiscordObjectState::Owned);
10939 Discord_Client_SetNoAudioInputThreshold(&instance_, dBFSThreshold);
10940}
10941void Client::SetNoiseCancellation(bool on)
10942{
10943 assert(state_ == DiscordObjectState::Owned);
10944 Discord_Client_SetNoiseCancellation(&instance_, on);
10945}
10946void Client::SetNoiseSuppression(bool on)
10947{
10948 assert(state_ == DiscordObjectState::Owned);
10949 Discord_Client_SetNoiseSuppression(&instance_, on);
10950}
10951void Client::SetOpusHardwareCoding(bool encode, bool decode)
10952{
10953 assert(state_ == DiscordObjectState::Owned);
10954 Discord_Client_SetOpusHardwareCoding(&instance_, encode, decode);
10955}
10956void Client::SetOutputDevice(std::string deviceId, discordpp::Client::SetOutputDeviceCallback cb)
10957{
10958 assert(state_ == DiscordObjectState::Owned);
10959 Discord_String deviceId__str{(uint8_t*)(deviceId.data()), deviceId.size()};
10960 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
10961 auto cb__userData = new Tcb__UserData(cb);
10962 Discord_Client_SetOutputDeviceCallback cb__native = [](auto result, void* userData__) {
10963 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
10964 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
10965 userData__typed->delegate(std::move(result__obj));
10966 };
10967 Discord_Client_SetOutputDevice(
10968 &instance_, deviceId__str, cb__native, Tcb__UserData::Free, cb__userData);
10969}
10970void Client::SetOutputVolume(float outputVolume)
10971{
10972 assert(state_ == DiscordObjectState::Owned);
10973 Discord_Client_SetOutputVolume(&instance_, outputVolume);
10974}
10975void Client::SetSelfDeafAll(bool deaf)
10976{
10977 assert(state_ == DiscordObjectState::Owned);
10978 Discord_Client_SetSelfDeafAll(&instance_, deaf);
10979}
10980void Client::SetSelfMuteAll(bool mute)
10981{
10982 assert(state_ == DiscordObjectState::Owned);
10983 Discord_Client_SetSelfMuteAll(&instance_, mute);
10984}
10985bool Client::SetSpeakerMode(bool speakerMode)
10986{
10987 assert(state_ == DiscordObjectState::Owned);
10988 bool returnValue__;
10989 returnValue__ = Discord_Client_SetSpeakerMode(&instance_, speakerMode);
10990 return returnValue__;
10991}
10992void Client::SetThreadPriority(discordpp::Client::Thread thread, int32_t priority)
10993{
10994 assert(state_ == DiscordObjectState::Owned);
10995 Discord_Client_SetThreadPriority(
10996 &instance_, static_cast<Discord_Client_Thread>(thread), priority);
10997}
10998void Client::SetVoiceParticipantChangedCallback(
11000{
11001 assert(state_ == DiscordObjectState::Owned);
11002 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11003 auto cb__userData = new Tcb__UserData(cb);
11004 Discord_Client_VoiceParticipantChangedCallback cb__native =
11005 [](auto lobbyId, auto memberId, auto added, void* userData__) {
11006 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
11007 userData__typed->delegate(lobbyId, memberId, added);
11008 };
11009 Discord_Client_SetVoiceParticipantChangedCallback(
11010 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11011}
11012void Client::SetVoiceSettingsUpdatedCallback(
11014{
11015 assert(state_ == DiscordObjectState::Owned);
11016 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
11017 auto callback__userData = new Tcallback__UserData(callback);
11018 Discord_Client_VoiceSettingsUpdatedCallback callback__native = [](auto settings,
11019 void* userData__) {
11020 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
11021 discordpp::VoiceSettings settings__obj(*settings, DiscordObjectState::Owned);
11022 userData__typed->delegate(std::move(settings__obj));
11023 };
11024 Discord_Client_SetVoiceSettingsUpdatedCallback(
11025 &instance_, callback__native, Tcallback__UserData::Free, callback__userData);
11026}
11027bool Client::ShowAudioRoutePicker()
11028{
11029 assert(state_ == DiscordObjectState::Owned);
11030 bool returnValue__;
11031 returnValue__ = Discord_Client_ShowAudioRoutePicker(&instance_);
11032 return returnValue__;
11033}
11034discordpp::Call Client::StartCall(uint64_t channelId)
11035{
11036 assert(state_ == DiscordObjectState::Owned);
11037 bool returnIsNonNull__;
11038 Discord_Call returnValueNative__{};
11039 returnIsNonNull__ = Discord_Client_StartCall(&instance_, channelId, &returnValueNative__);
11040 discordpp::Call returnValue__(
11041 returnValueNative__,
11042 returnIsNonNull__ ? DiscordObjectState::Owned : DiscordObjectState::Invalid);
11043 return returnValue__;
11044}
11045discordpp::Call Client::StartCallWithAudioCallbacks(
11046 uint64_t lobbyId,
11049{
11050 assert(state_ == DiscordObjectState::Owned);
11051 bool returnIsNonNull__;
11052 Discord_Call returnValueNative__{};
11053 using TreceivedCb__UserData = TDelegateUserData<std::remove_reference_t<decltype(receivedCb)>>;
11054 auto receivedCb__userData = new TreceivedCb__UserData(receivedCb);
11055 Discord_Client_UserAudioReceivedCallback receivedCb__native = [](auto userId,
11056 auto data,
11057 auto samplesPerChannel,
11058 auto sampleRate,
11059 auto channels,
11060 auto outShouldMute,
11061 void* userData__) {
11062 auto userData__typed = static_cast<TreceivedCb__UserData*>(userData__);
11063 userData__typed->delegate(
11064 userId, data, samplesPerChannel, sampleRate, channels, *outShouldMute);
11065 };
11066 using TcapturedCb__UserData = TDelegateUserData<std::remove_reference_t<decltype(capturedCb)>>;
11067 auto capturedCb__userData = new TcapturedCb__UserData(capturedCb);
11068 Discord_Client_UserAudioCapturedCallback capturedCb__native =
11069 [](auto data, auto samplesPerChannel, auto sampleRate, auto channels, void* userData__) {
11070 auto userData__typed = static_cast<TcapturedCb__UserData*>(userData__);
11071 userData__typed->delegate(data, samplesPerChannel, sampleRate, channels);
11072 };
11073 returnIsNonNull__ = Discord_Client_StartCallWithAudioCallbacks(&instance_,
11074 lobbyId,
11075 receivedCb__native,
11076 TreceivedCb__UserData::Free,
11077 receivedCb__userData,
11078 capturedCb__native,
11079 TcapturedCb__UserData::Free,
11080 capturedCb__userData,
11081 &returnValueNative__);
11082 discordpp::Call returnValue__(
11083 returnValueNative__,
11084 returnIsNonNull__ ? DiscordObjectState::Owned : DiscordObjectState::Invalid);
11085 return returnValue__;
11086}
11087void Client::AbortAuthorize()
11088{
11089 assert(state_ == DiscordObjectState::Owned);
11090 Discord_Client_AbortAuthorize(&instance_);
11091}
11092void Client::AbortGetTokenFromDevice()
11093{
11094 assert(state_ == DiscordObjectState::Owned);
11095 Discord_Client_AbortGetTokenFromDevice(&instance_);
11096}
11097void Client::Authorize(discordpp::AuthorizationArgs args,
11099{
11100 assert(state_ == DiscordObjectState::Owned);
11101 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
11102 auto callback__userData = new Tcallback__UserData(callback);
11103 Discord_Client_AuthorizationCallback callback__native =
11104 [](auto result, auto code, auto redirectUri, void* userData__) {
11105 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
11106 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11107 std::string code__str(reinterpret_cast<char*>(code.ptr), code.size);
11108 std::string redirectUri__str(reinterpret_cast<char*>(redirectUri.ptr), redirectUri.size);
11109 userData__typed->delegate(
11110 std::move(result__obj), std::move(code__str), std::move(redirectUri__str));
11111 Discord_Free(redirectUri.ptr);
11112 Discord_Free(code.ptr);
11113 };
11114 Discord_Client_Authorize(
11115 &instance_, args.instance(), callback__native, Tcallback__UserData::Free, callback__userData);
11116}
11117void Client::CloseAuthorizeDeviceScreen()
11118{
11119 assert(state_ == DiscordObjectState::Owned);
11120 Discord_Client_CloseAuthorizeDeviceScreen(&instance_);
11121}
11122discordpp::AuthorizationCodeVerifier Client::CreateAuthorizationCodeVerifier()
11123{
11124 assert(state_ == DiscordObjectState::Owned);
11125 Discord_AuthorizationCodeVerifier returnValueNative__{};
11126 Discord_Client_CreateAuthorizationCodeVerifier(&instance_, &returnValueNative__);
11127 discordpp::AuthorizationCodeVerifier returnValue__(returnValueNative__,
11128 DiscordObjectState::Owned);
11129 return returnValue__;
11130}
11131void Client::ExchangeChildToken(std::string const& parentApplicationToken,
11132 uint64_t childApplicationId,
11134{
11135 assert(state_ == DiscordObjectState::Owned);
11136 Discord_String parentApplicationToken__str{(uint8_t*)(parentApplicationToken.data()),
11137 parentApplicationToken.size()};
11138 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
11139 auto callback__userData = new Tcallback__UserData(callback);
11140 Discord_Client_ExchangeChildTokenCallback callback__native = [](auto result,
11141 auto accessToken,
11142 auto tokenType,
11143 auto expiresIn,
11144 auto scopes,
11145 void* userData__) {
11146 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
11147 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11148 std::string accessToken__str(reinterpret_cast<char*>(accessToken.ptr), accessToken.size);
11149 std::string scopes__str(reinterpret_cast<char*>(scopes.ptr), scopes.size);
11150 userData__typed->delegate(std::move(result__obj),
11151 std::move(accessToken__str),
11152 static_cast<discordpp::AuthorizationTokenType>(tokenType),
11153 expiresIn,
11154 std::move(scopes__str));
11155 Discord_Free(scopes.ptr);
11156 Discord_Free(accessToken.ptr);
11157 };
11158 Discord_Client_ExchangeChildToken(&instance_,
11159 parentApplicationToken__str,
11160 childApplicationId,
11161 callback__native,
11162 Tcallback__UserData::Free,
11163 callback__userData);
11164}
11165void Client::FetchCurrentUser(discordpp::AuthorizationTokenType tokenType,
11166 std::string const& token,
11168{
11169 assert(state_ == DiscordObjectState::Owned);
11170 Discord_String token__str{(uint8_t*)(token.data()), token.size()};
11171 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
11172 auto callback__userData = new Tcallback__UserData(callback);
11173 Discord_Client_FetchCurrentUserCallback callback__native =
11174 [](auto result, auto id, auto name, void* userData__) {
11175 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
11176 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11177 std::string name__str(reinterpret_cast<char*>(name.ptr), name.size);
11178 userData__typed->delegate(std::move(result__obj), id, std::move(name__str));
11179 Discord_Free(name.ptr);
11180 };
11181 Discord_Client_FetchCurrentUser(&instance_,
11182 static_cast<Discord_AuthorizationTokenType>(tokenType),
11183 token__str,
11184 callback__native,
11185 Tcallback__UserData::Free,
11186 callback__userData);
11187}
11188void Client::GetProvisionalToken(uint64_t applicationId,
11190 std::string const& externalAuthToken,
11192{
11193 assert(state_ == DiscordObjectState::Owned);
11194 Discord_String externalAuthToken__str{(uint8_t*)(externalAuthToken.data()),
11195 externalAuthToken.size()};
11196 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
11197 auto callback__userData = new Tcallback__UserData(callback);
11198 Discord_Client_TokenExchangeCallback callback__native = [](auto result,
11199 auto accessToken,
11200 auto refreshToken,
11201 auto tokenType,
11202 auto expiresIn,
11203 auto scopes,
11204 void* userData__) {
11205 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
11206 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11207 std::string accessToken__str(reinterpret_cast<char*>(accessToken.ptr), accessToken.size);
11208 std::string refreshToken__str(reinterpret_cast<char*>(refreshToken.ptr), refreshToken.size);
11209 std::string scopes__str(reinterpret_cast<char*>(scopes.ptr), scopes.size);
11210 userData__typed->delegate(std::move(result__obj),
11211 std::move(accessToken__str),
11212 std::move(refreshToken__str),
11213 static_cast<discordpp::AuthorizationTokenType>(tokenType),
11214 expiresIn,
11215 std::move(scopes__str));
11216 Discord_Free(scopes.ptr);
11217 Discord_Free(refreshToken.ptr);
11218 Discord_Free(accessToken.ptr);
11219 };
11220 Discord_Client_GetProvisionalToken(
11221 &instance_,
11222 applicationId,
11223 static_cast<Discord_AuthenticationExternalAuthType>(externalAuthType),
11224 externalAuthToken__str,
11225 callback__native,
11226 Tcallback__UserData::Free,
11227 callback__userData);
11228}
11229void Client::GetToken(uint64_t applicationId,
11230 std::string const& code,
11231 std::string const& codeVerifier,
11232 std::string const& redirectUri,
11234{
11235 assert(state_ == DiscordObjectState::Owned);
11236 Discord_String code__str{(uint8_t*)(code.data()), code.size()};
11237 Discord_String codeVerifier__str{(uint8_t*)(codeVerifier.data()), codeVerifier.size()};
11238 Discord_String redirectUri__str{(uint8_t*)(redirectUri.data()), redirectUri.size()};
11239 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
11240 auto callback__userData = new Tcallback__UserData(callback);
11241 Discord_Client_TokenExchangeCallback callback__native = [](auto result,
11242 auto accessToken,
11243 auto refreshToken,
11244 auto tokenType,
11245 auto expiresIn,
11246 auto scopes,
11247 void* userData__) {
11248 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
11249 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11250 std::string accessToken__str(reinterpret_cast<char*>(accessToken.ptr), accessToken.size);
11251 std::string refreshToken__str(reinterpret_cast<char*>(refreshToken.ptr), refreshToken.size);
11252 std::string scopes__str(reinterpret_cast<char*>(scopes.ptr), scopes.size);
11253 userData__typed->delegate(std::move(result__obj),
11254 std::move(accessToken__str),
11255 std::move(refreshToken__str),
11256 static_cast<discordpp::AuthorizationTokenType>(tokenType),
11257 expiresIn,
11258 std::move(scopes__str));
11259 Discord_Free(scopes.ptr);
11260 Discord_Free(refreshToken.ptr);
11261 Discord_Free(accessToken.ptr);
11262 };
11263 Discord_Client_GetToken(&instance_,
11264 applicationId,
11265 code__str,
11266 codeVerifier__str,
11267 redirectUri__str,
11268 callback__native,
11269 Tcallback__UserData::Free,
11270 callback__userData);
11271}
11272void Client::GetTokenFromDevice(discordpp::DeviceAuthorizationArgs args,
11274{
11275 assert(state_ == DiscordObjectState::Owned);
11276 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
11277 auto callback__userData = new Tcallback__UserData(callback);
11278 Discord_Client_TokenExchangeCallback callback__native = [](auto result,
11279 auto accessToken,
11280 auto refreshToken,
11281 auto tokenType,
11282 auto expiresIn,
11283 auto scopes,
11284 void* userData__) {
11285 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
11286 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11287 std::string accessToken__str(reinterpret_cast<char*>(accessToken.ptr), accessToken.size);
11288 std::string refreshToken__str(reinterpret_cast<char*>(refreshToken.ptr), refreshToken.size);
11289 std::string scopes__str(reinterpret_cast<char*>(scopes.ptr), scopes.size);
11290 userData__typed->delegate(std::move(result__obj),
11291 std::move(accessToken__str),
11292 std::move(refreshToken__str),
11293 static_cast<discordpp::AuthorizationTokenType>(tokenType),
11294 expiresIn,
11295 std::move(scopes__str));
11296 Discord_Free(scopes.ptr);
11297 Discord_Free(refreshToken.ptr);
11298 Discord_Free(accessToken.ptr);
11299 };
11300 Discord_Client_GetTokenFromDevice(
11301 &instance_, args.instance(), callback__native, Tcallback__UserData::Free, callback__userData);
11302}
11303void Client::GetTokenFromDeviceProvisionalMerge(
11306 std::string const& externalAuthToken,
11308{
11309 assert(state_ == DiscordObjectState::Owned);
11310 Discord_String externalAuthToken__str{(uint8_t*)(externalAuthToken.data()),
11311 externalAuthToken.size()};
11312 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
11313 auto callback__userData = new Tcallback__UserData(callback);
11314 Discord_Client_TokenExchangeCallback callback__native = [](auto result,
11315 auto accessToken,
11316 auto refreshToken,
11317 auto tokenType,
11318 auto expiresIn,
11319 auto scopes,
11320 void* userData__) {
11321 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
11322 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11323 std::string accessToken__str(reinterpret_cast<char*>(accessToken.ptr), accessToken.size);
11324 std::string refreshToken__str(reinterpret_cast<char*>(refreshToken.ptr), refreshToken.size);
11325 std::string scopes__str(reinterpret_cast<char*>(scopes.ptr), scopes.size);
11326 userData__typed->delegate(std::move(result__obj),
11327 std::move(accessToken__str),
11328 std::move(refreshToken__str),
11329 static_cast<discordpp::AuthorizationTokenType>(tokenType),
11330 expiresIn,
11331 std::move(scopes__str));
11332 Discord_Free(scopes.ptr);
11333 Discord_Free(refreshToken.ptr);
11334 Discord_Free(accessToken.ptr);
11335 };
11336 Discord_Client_GetTokenFromDeviceProvisionalMerge(
11337 &instance_,
11338 args.instance(),
11339 static_cast<Discord_AuthenticationExternalAuthType>(externalAuthType),
11340 externalAuthToken__str,
11341 callback__native,
11342 Tcallback__UserData::Free,
11343 callback__userData);
11344}
11345void Client::GetTokenFromProvisionalMerge(
11346 uint64_t applicationId,
11347 std::string const& code,
11348 std::string const& codeVerifier,
11349 std::string const& redirectUri,
11351 std::string const& externalAuthToken,
11353{
11354 assert(state_ == DiscordObjectState::Owned);
11355 Discord_String code__str{(uint8_t*)(code.data()), code.size()};
11356 Discord_String codeVerifier__str{(uint8_t*)(codeVerifier.data()), codeVerifier.size()};
11357 Discord_String redirectUri__str{(uint8_t*)(redirectUri.data()), redirectUri.size()};
11358 Discord_String externalAuthToken__str{(uint8_t*)(externalAuthToken.data()),
11359 externalAuthToken.size()};
11360 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
11361 auto callback__userData = new Tcallback__UserData(callback);
11362 Discord_Client_TokenExchangeCallback callback__native = [](auto result,
11363 auto accessToken,
11364 auto refreshToken,
11365 auto tokenType,
11366 auto expiresIn,
11367 auto scopes,
11368 void* userData__) {
11369 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
11370 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11371 std::string accessToken__str(reinterpret_cast<char*>(accessToken.ptr), accessToken.size);
11372 std::string refreshToken__str(reinterpret_cast<char*>(refreshToken.ptr), refreshToken.size);
11373 std::string scopes__str(reinterpret_cast<char*>(scopes.ptr), scopes.size);
11374 userData__typed->delegate(std::move(result__obj),
11375 std::move(accessToken__str),
11376 std::move(refreshToken__str),
11377 static_cast<discordpp::AuthorizationTokenType>(tokenType),
11378 expiresIn,
11379 std::move(scopes__str));
11380 Discord_Free(scopes.ptr);
11381 Discord_Free(refreshToken.ptr);
11382 Discord_Free(accessToken.ptr);
11383 };
11384 Discord_Client_GetTokenFromProvisionalMerge(
11385 &instance_,
11386 applicationId,
11387 code__str,
11388 codeVerifier__str,
11389 redirectUri__str,
11390 static_cast<Discord_AuthenticationExternalAuthType>(externalAuthType),
11391 externalAuthToken__str,
11392 callback__native,
11393 Tcallback__UserData::Free,
11394 callback__userData);
11395}
11396bool Client::IsAuthenticated()
11397{
11398 assert(state_ == DiscordObjectState::Owned);
11399 bool returnValue__;
11400 returnValue__ = Discord_Client_IsAuthenticated(&instance_);
11401 return returnValue__;
11402}
11403void Client::OpenAuthorizeDeviceScreen(uint64_t clientId, std::string const& userCode)
11404{
11405 assert(state_ == DiscordObjectState::Owned);
11406 Discord_String userCode__str{(uint8_t*)(userCode.data()), userCode.size()};
11407 Discord_Client_OpenAuthorizeDeviceScreen(&instance_, clientId, userCode__str);
11408}
11409void Client::ProvisionalUserMergeCompleted(bool success)
11410{
11411 assert(state_ == DiscordObjectState::Owned);
11412 Discord_Client_ProvisionalUserMergeCompleted(&instance_, success);
11413}
11414void Client::RefreshToken(uint64_t applicationId,
11415 std::string const& refreshToken,
11417{
11418 assert(state_ == DiscordObjectState::Owned);
11419 Discord_String refreshToken__str{(uint8_t*)(refreshToken.data()), refreshToken.size()};
11420 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
11421 auto callback__userData = new Tcallback__UserData(callback);
11422 Discord_Client_TokenExchangeCallback callback__native = [](auto result,
11423 auto accessToken,
11424 auto refreshToken,
11425 auto tokenType,
11426 auto expiresIn,
11427 auto scopes,
11428 void* userData__) {
11429 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
11430 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11431 std::string accessToken__str(reinterpret_cast<char*>(accessToken.ptr), accessToken.size);
11432 std::string refreshToken__str(reinterpret_cast<char*>(refreshToken.ptr), refreshToken.size);
11433 std::string scopes__str(reinterpret_cast<char*>(scopes.ptr), scopes.size);
11434 userData__typed->delegate(std::move(result__obj),
11435 std::move(accessToken__str),
11436 std::move(refreshToken__str),
11437 static_cast<discordpp::AuthorizationTokenType>(tokenType),
11438 expiresIn,
11439 std::move(scopes__str));
11440 Discord_Free(scopes.ptr);
11441 Discord_Free(refreshToken.ptr);
11442 Discord_Free(accessToken.ptr);
11443 };
11444 Discord_Client_RefreshToken(&instance_,
11445 applicationId,
11446 refreshToken__str,
11447 callback__native,
11448 Tcallback__UserData::Free,
11449 callback__userData);
11450}
11451void Client::RegisterAuthorizeRequestCallback(discordpp::Client::AuthorizeRequestCallback callback)
11452{
11453 assert(state_ == DiscordObjectState::Owned);
11454 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
11455 auto callback__userData = new Tcallback__UserData(callback);
11456 Discord_Client_AuthorizeRequestCallback callback__native = [](void* userData__) {
11457 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
11458 userData__typed->delegate();
11459 };
11460 Discord_Client_RegisterAuthorizeRequestCallback(
11461 &instance_, callback__native, Tcallback__UserData::Free, callback__userData);
11462}
11463void Client::RemoveAuthorizeRequestCallback()
11464{
11465 assert(state_ == DiscordObjectState::Owned);
11466 Discord_Client_RemoveAuthorizeRequestCallback(&instance_);
11467}
11468void Client::RevokeToken(uint64_t applicationId,
11469 std::string const& token,
11471{
11472 assert(state_ == DiscordObjectState::Owned);
11473 Discord_String token__str{(uint8_t*)(token.data()), token.size()};
11474 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
11475 auto callback__userData = new Tcallback__UserData(callback);
11476 Discord_Client_RevokeTokenCallback callback__native = [](auto result, void* userData__) {
11477 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
11478 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11479 userData__typed->delegate(std::move(result__obj));
11480 };
11481 Discord_Client_RevokeToken(&instance_,
11482 applicationId,
11483 token__str,
11484 callback__native,
11485 Tcallback__UserData::Free,
11486 callback__userData);
11487}
11488void Client::SetAuthorizeDeviceScreenClosedCallback(
11490{
11491 assert(state_ == DiscordObjectState::Owned);
11492 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11493 auto cb__userData = new Tcb__UserData(cb);
11494 Discord_Client_AuthorizeDeviceScreenClosedCallback cb__native = [](void* userData__) {
11495 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
11496 userData__typed->delegate();
11497 };
11498 Discord_Client_SetAuthorizeDeviceScreenClosedCallback(
11499 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11500}
11501void Client::SetGameWindowPid(int32_t pid)
11502{
11503 assert(state_ == DiscordObjectState::Owned);
11504 Discord_Client_SetGameWindowPid(&instance_, pid);
11505}
11506void Client::SetTokenExpirationCallback(discordpp::Client::TokenExpirationCallback callback)
11507{
11508 assert(state_ == DiscordObjectState::Owned);
11509 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
11510 auto callback__userData = new Tcallback__UserData(callback);
11511 Discord_Client_TokenExpirationCallback callback__native = [](void* userData__) {
11512 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
11513 userData__typed->delegate();
11514 };
11515 Discord_Client_SetTokenExpirationCallback(
11516 &instance_, callback__native, Tcallback__UserData::Free, callback__userData);
11517}
11518void Client::UnmergeIntoProvisionalAccount(
11519 uint64_t applicationId,
11521 std::string const& externalAuthToken,
11523{
11524 assert(state_ == DiscordObjectState::Owned);
11525 Discord_String externalAuthToken__str{(uint8_t*)(externalAuthToken.data()),
11526 externalAuthToken.size()};
11527 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
11528 auto callback__userData = new Tcallback__UserData(callback);
11529 Discord_Client_UnmergeIntoProvisionalAccountCallback callback__native = [](auto result,
11530 void* userData__) {
11531 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
11532 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11533 userData__typed->delegate(std::move(result__obj));
11534 };
11535 Discord_Client_UnmergeIntoProvisionalAccount(
11536 &instance_,
11537 applicationId,
11538 static_cast<Discord_AuthenticationExternalAuthType>(externalAuthType),
11539 externalAuthToken__str,
11540 callback__native,
11541 Tcallback__UserData::Free,
11542 callback__userData);
11543}
11544void Client::UpdateProvisionalAccountDisplayName(
11545 std::string const& name,
11547{
11548 assert(state_ == DiscordObjectState::Owned);
11549 Discord_String name__str{(uint8_t*)(name.data()), name.size()};
11550 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
11551 auto callback__userData = new Tcallback__UserData(callback);
11552 Discord_Client_UpdateProvisionalAccountDisplayNameCallback callback__native =
11553 [](auto result, void* userData__) {
11554 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
11555 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11556 userData__typed->delegate(std::move(result__obj));
11557 };
11558 Discord_Client_UpdateProvisionalAccountDisplayName(
11559 &instance_, name__str, callback__native, Tcallback__UserData::Free, callback__userData);
11560}
11561void Client::UpdateToken(discordpp::AuthorizationTokenType tokenType,
11562 std::string token,
11564{
11565 assert(state_ == DiscordObjectState::Owned);
11566 Discord_String token__str{(uint8_t*)(token.data()), token.size()};
11567 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
11568 auto callback__userData = new Tcallback__UserData(callback);
11569 Discord_Client_UpdateTokenCallback callback__native = [](auto result, void* userData__) {
11570 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
11571 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11572 userData__typed->delegate(std::move(result__obj));
11573 };
11574 Discord_Client_UpdateToken(&instance_,
11575 static_cast<Discord_AuthorizationTokenType>(tokenType),
11576 token__str,
11577 callback__native,
11578 Tcallback__UserData::Free,
11579 callback__userData);
11580}
11581bool Client::CanOpenMessageInDiscord(uint64_t messageId)
11582{
11583 assert(state_ == DiscordObjectState::Owned);
11584 bool returnValue__;
11585 returnValue__ = Discord_Client_CanOpenMessageInDiscord(&instance_, messageId);
11586 return returnValue__;
11587}
11588void Client::DeleteUserMessage(uint64_t recipientId,
11589 uint64_t messageId,
11591{
11592 assert(state_ == DiscordObjectState::Owned);
11593 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11594 auto cb__userData = new Tcb__UserData(cb);
11595 Discord_Client_DeleteUserMessageCallback cb__native = [](auto result, void* userData__) {
11596 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
11597 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11598 userData__typed->delegate(std::move(result__obj));
11599 };
11600 Discord_Client_DeleteUserMessage(
11601 &instance_, recipientId, messageId, cb__native, Tcb__UserData::Free, cb__userData);
11602}
11603void Client::EditUserMessage(uint64_t recipientId,
11604 uint64_t messageId,
11605 std::string const& content,
11607{
11608 assert(state_ == DiscordObjectState::Owned);
11609 Discord_String content__str{(uint8_t*)(content.data()), content.size()};
11610 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11611 auto cb__userData = new Tcb__UserData(cb);
11612 Discord_Client_EditUserMessageCallback cb__native = [](auto result, void* userData__) {
11613 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
11614 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11615 userData__typed->delegate(std::move(result__obj));
11616 };
11617 Discord_Client_EditUserMessage(&instance_,
11618 recipientId,
11619 messageId,
11620 content__str,
11621 cb__native,
11622 Tcb__UserData::Free,
11623 cb__userData);
11624}
11625std::optional<discordpp::ChannelHandle> Client::GetChannelHandle(uint64_t channelId) const
11626{
11627 assert(state_ == DiscordObjectState::Owned);
11628 bool returnIsNonNull__;
11629 Discord_ChannelHandle returnValueNative__;
11630 returnIsNonNull__ =
11631 Discord_Client_GetChannelHandle(&instance_, channelId, &returnValueNative__);
11632 if (!returnIsNonNull__) {
11633 return {};
11634 }
11635 discordpp::ChannelHandle returnValue__(returnValueNative__, DiscordObjectState::Owned);
11636 return returnValue__;
11637}
11638void Client::GetLobbyMessagesWithLimit(uint64_t lobbyId,
11639 int32_t limit,
11641{
11642 assert(state_ == DiscordObjectState::Owned);
11643 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11644 auto cb__userData = new Tcb__UserData(cb);
11645 Discord_Client_GetLobbyMessagesCallback cb__native =
11646 [](auto result, auto messages, void* userData__) {
11647 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
11648 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11649 std::vector<discordpp::MessageHandle> messages__vec;
11650 messages__vec.reserve(messages.size);
11651 for (size_t i__ = 0; i__ < messages.size; ++i__) {
11652 messages__vec.emplace_back(messages.ptr[i__], DiscordObjectState::Owned);
11653 }
11654 Discord_Free(messages.ptr);
11655 userData__typed->delegate(std::move(result__obj), std::move(messages__vec));
11656 };
11657 Discord_Client_GetLobbyMessagesWithLimit(
11658 &instance_, lobbyId, limit, cb__native, Tcb__UserData::Free, cb__userData);
11659}
11660std::optional<discordpp::MessageHandle> Client::GetMessageHandle(uint64_t messageId) const
11661{
11662 assert(state_ == DiscordObjectState::Owned);
11663 bool returnIsNonNull__;
11664 Discord_MessageHandle returnValueNative__;
11665 returnIsNonNull__ =
11666 Discord_Client_GetMessageHandle(&instance_, messageId, &returnValueNative__);
11667 if (!returnIsNonNull__) {
11668 return {};
11669 }
11670 discordpp::MessageHandle returnValue__(returnValueNative__, DiscordObjectState::Owned);
11671 return returnValue__;
11672}
11673void Client::GetUserMessageSummaries(discordpp::Client::UserMessageSummariesCallback cb)
11674{
11675 assert(state_ == DiscordObjectState::Owned);
11676 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11677 auto cb__userData = new Tcb__UserData(cb);
11678 Discord_Client_UserMessageSummariesCallback cb__native =
11679 [](auto result, auto summaries, void* userData__) {
11680 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
11681 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11682 std::vector<discordpp::UserMessageSummary> summaries__vec;
11683 summaries__vec.reserve(summaries.size);
11684 for (size_t i__ = 0; i__ < summaries.size; ++i__) {
11685 summaries__vec.emplace_back(summaries.ptr[i__], DiscordObjectState::Owned);
11686 }
11687 Discord_Free(summaries.ptr);
11688 userData__typed->delegate(std::move(result__obj), std::move(summaries__vec));
11689 };
11690 Discord_Client_GetUserMessageSummaries(
11691 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11692}
11693void Client::GetUserMessagesWithLimit(uint64_t recipientId,
11694 int32_t limit,
11696{
11697 assert(state_ == DiscordObjectState::Owned);
11698 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11699 auto cb__userData = new Tcb__UserData(cb);
11700 Discord_Client_UserMessagesWithLimitCallback cb__native =
11701 [](auto result, auto messages, void* userData__) {
11702 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
11703 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11704 std::vector<discordpp::MessageHandle> messages__vec;
11705 messages__vec.reserve(messages.size);
11706 for (size_t i__ = 0; i__ < messages.size; ++i__) {
11707 messages__vec.emplace_back(messages.ptr[i__], DiscordObjectState::Owned);
11708 }
11709 Discord_Free(messages.ptr);
11710 userData__typed->delegate(std::move(result__obj), std::move(messages__vec));
11711 };
11712 Discord_Client_GetUserMessagesWithLimit(
11713 &instance_, recipientId, limit, cb__native, Tcb__UserData::Free, cb__userData);
11714}
11715void Client::OpenMessageInDiscord(
11716 uint64_t messageId,
11717 discordpp::Client::ProvisionalUserMergeRequiredCallback provisionalUserMergeRequiredCallback,
11719{
11720 assert(state_ == DiscordObjectState::Owned);
11721 using TprovisionalUserMergeRequiredCallback__UserData =
11722 TDelegateUserData<std::remove_reference_t<decltype(provisionalUserMergeRequiredCallback)>>;
11723 auto provisionalUserMergeRequiredCallback__userData =
11724 new TprovisionalUserMergeRequiredCallback__UserData(provisionalUserMergeRequiredCallback);
11725 Discord_Client_ProvisionalUserMergeRequiredCallback
11726 provisionalUserMergeRequiredCallback__native = [](void* userData__) {
11727 auto userData__typed =
11728 static_cast<TprovisionalUserMergeRequiredCallback__UserData*>(userData__);
11729 userData__typed->delegate();
11730 };
11731 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
11732 auto callback__userData = new Tcallback__UserData(callback);
11733 Discord_Client_OpenMessageInDiscordCallback callback__native = [](auto result,
11734 void* userData__) {
11735 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
11736 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11737 userData__typed->delegate(std::move(result__obj));
11738 };
11739 Discord_Client_OpenMessageInDiscord(&instance_,
11740 messageId,
11741 provisionalUserMergeRequiredCallback__native,
11742 TprovisionalUserMergeRequiredCallback__UserData::Free,
11743 provisionalUserMergeRequiredCallback__userData,
11744 callback__native,
11745 Tcallback__UserData::Free,
11746 callback__userData);
11747}
11748void Client::SendLobbyMessage(uint64_t lobbyId,
11749 std::string const& content,
11751{
11752 assert(state_ == DiscordObjectState::Owned);
11753 Discord_String content__str{(uint8_t*)(content.data()), content.size()};
11754 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11755 auto cb__userData = new Tcb__UserData(cb);
11756 Discord_Client_SendUserMessageCallback cb__native =
11757 [](auto result, auto messageId, void* userData__) {
11758 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
11759 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11760 userData__typed->delegate(std::move(result__obj), messageId);
11761 };
11762 Discord_Client_SendLobbyMessage(
11763 &instance_, lobbyId, content__str, cb__native, Tcb__UserData::Free, cb__userData);
11764}
11765void Client::SendLobbyMessageWithMetadata(
11766 uint64_t lobbyId,
11767 std::string const& content,
11768 std::unordered_map<std::string, std::string> const& metadata,
11770{
11771 assert(state_ == DiscordObjectState::Owned);
11772 Discord_String content__str{(uint8_t*)(content.data()), content.size()};
11773 ConvertedProperties metadata__convert(metadata);
11774 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11775 auto cb__userData = new Tcb__UserData(cb);
11776 Discord_Client_SendUserMessageCallback cb__native =
11777 [](auto result, auto messageId, void* userData__) {
11778 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
11779 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11780 userData__typed->delegate(std::move(result__obj), messageId);
11781 };
11782 Discord_Client_SendLobbyMessageWithMetadata(&instance_,
11783 lobbyId,
11784 content__str,
11785 metadata__convert.Properties,
11786 cb__native,
11787 Tcb__UserData::Free,
11788 cb__userData);
11789}
11790void Client::SendUserMessage(uint64_t recipientId,
11791 std::string const& content,
11793{
11794 assert(state_ == DiscordObjectState::Owned);
11795 Discord_String content__str{(uint8_t*)(content.data()), content.size()};
11796 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11797 auto cb__userData = new Tcb__UserData(cb);
11798 Discord_Client_SendUserMessageCallback cb__native =
11799 [](auto result, auto messageId, void* userData__) {
11800 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
11801 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11802 userData__typed->delegate(std::move(result__obj), messageId);
11803 };
11804 Discord_Client_SendUserMessage(
11805 &instance_, recipientId, content__str, cb__native, Tcb__UserData::Free, cb__userData);
11806}
11807void Client::SendUserMessageWithMetadata(
11808 uint64_t recipientId,
11809 std::string const& content,
11810 std::unordered_map<std::string, std::string> const& metadata,
11812{
11813 assert(state_ == DiscordObjectState::Owned);
11814 Discord_String content__str{(uint8_t*)(content.data()), content.size()};
11815 ConvertedProperties metadata__convert(metadata);
11816 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11817 auto cb__userData = new Tcb__UserData(cb);
11818 Discord_Client_SendUserMessageCallback cb__native =
11819 [](auto result, auto messageId, void* userData__) {
11820 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
11821 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11822 userData__typed->delegate(std::move(result__obj), messageId);
11823 };
11824 Discord_Client_SendUserMessageWithMetadata(&instance_,
11825 recipientId,
11826 content__str,
11827 metadata__convert.Properties,
11828 cb__native,
11829 Tcb__UserData::Free,
11830 cb__userData);
11831}
11832void Client::SetMessageCreatedCallback(discordpp::Client::MessageCreatedCallback cb)
11833{
11834 assert(state_ == DiscordObjectState::Owned);
11835 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11836 auto cb__userData = new Tcb__UserData(cb);
11837 Discord_Client_MessageCreatedCallback cb__native = [](auto messageId, void* userData__) {
11838 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
11839 userData__typed->delegate(messageId);
11840 };
11841 Discord_Client_SetMessageCreatedCallback(
11842 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11843}
11844void Client::SetMessageDeletedCallback(discordpp::Client::MessageDeletedCallback cb)
11845{
11846 assert(state_ == DiscordObjectState::Owned);
11847 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11848 auto cb__userData = new Tcb__UserData(cb);
11849 Discord_Client_MessageDeletedCallback cb__native =
11850 [](auto messageId, auto channelId, void* userData__) {
11851 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
11852 userData__typed->delegate(messageId, channelId);
11853 };
11854 Discord_Client_SetMessageDeletedCallback(
11855 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11856}
11857void Client::SetMessageUpdatedCallback(discordpp::Client::MessageUpdatedCallback cb)
11858{
11859 assert(state_ == DiscordObjectState::Owned);
11860 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11861 auto cb__userData = new Tcb__UserData(cb);
11862 Discord_Client_MessageUpdatedCallback cb__native = [](auto messageId, void* userData__) {
11863 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
11864 userData__typed->delegate(messageId);
11865 };
11866 Discord_Client_SetMessageUpdatedCallback(
11867 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11868}
11869void Client::SetShowingChat(bool showingChat)
11870{
11871 assert(state_ == DiscordObjectState::Owned);
11872 Discord_Client_SetShowingChat(&instance_, showingChat);
11873}
11874void Client::AddLogCallback(discordpp::Client::LogCallback callback,
11875 discordpp::LoggingSeverity minSeverity)
11876{
11877 assert(state_ == DiscordObjectState::Owned);
11878 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
11879 auto callback__userData = new Tcallback__UserData(callback);
11880 Discord_Client_LogCallback callback__native = [](
11881 auto message, auto severity, void* userData__) {
11882 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
11883 std::string message__str(reinterpret_cast<char*>(message.ptr), message.size);
11884 userData__typed->delegate(std::move(message__str),
11885 static_cast<discordpp::LoggingSeverity>(severity));
11886 Discord_Free(message.ptr);
11887 };
11888 Discord_Client_AddLogCallback(&instance_,
11889 callback__native,
11890 Tcallback__UserData::Free,
11891 callback__userData,
11892 static_cast<Discord_LoggingSeverity>(minSeverity));
11893}
11894void Client::AddVoiceLogCallback(discordpp::Client::LogCallback callback,
11895 discordpp::LoggingSeverity minSeverity)
11896{
11897 assert(state_ == DiscordObjectState::Owned);
11898 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
11899 auto callback__userData = new Tcallback__UserData(callback);
11900 Discord_Client_LogCallback callback__native = [](
11901 auto message, auto severity, void* userData__) {
11902 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
11903 std::string message__str(reinterpret_cast<char*>(message.ptr), message.size);
11904 userData__typed->delegate(std::move(message__str),
11905 static_cast<discordpp::LoggingSeverity>(severity));
11906 Discord_Free(message.ptr);
11907 };
11908 Discord_Client_AddVoiceLogCallback(&instance_,
11909 callback__native,
11910 Tcallback__UserData::Free,
11911 callback__userData,
11912 static_cast<Discord_LoggingSeverity>(minSeverity));
11913}
11914void Client::Connect()
11915{
11916 assert(state_ == DiscordObjectState::Owned);
11917 Discord_Client_Connect(&instance_);
11918}
11919void Client::Disconnect()
11920{
11921 assert(state_ == DiscordObjectState::Owned);
11922 Discord_Client_Disconnect(&instance_);
11923}
11924discordpp::Client::Status Client::GetStatus() const
11925{
11926 assert(state_ == DiscordObjectState::Owned);
11927 Discord_Client_Status returnValue__;
11928 returnValue__ = Discord_Client_GetStatus(&instance_);
11929 return static_cast<discordpp::Client::Status>(returnValue__);
11930}
11931void Client::OpenConnectedGamesSettingsInDiscord(
11933{
11934 assert(state_ == DiscordObjectState::Owned);
11935 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
11936 auto callback__userData = new Tcallback__UserData(callback);
11937 Discord_Client_OpenConnectedGamesSettingsInDiscordCallback callback__native =
11938 [](auto result, void* userData__) {
11939 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
11940 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11941 userData__typed->delegate(std::move(result__obj));
11942 };
11943 Discord_Client_OpenConnectedGamesSettingsInDiscord(
11944 &instance_, callback__native, Tcallback__UserData::Free, callback__userData);
11945}
11946void Client::SetApplicationId(uint64_t applicationId)
11947{
11948 assert(state_ == DiscordObjectState::Owned);
11949 Discord_Client_SetApplicationId(&instance_, applicationId);
11950}
11951bool Client::SetLogDir(std::string const& path, discordpp::LoggingSeverity minSeverity)
11952{
11953 assert(state_ == DiscordObjectState::Owned);
11954 bool returnValue__;
11955 Discord_String path__str{(uint8_t*)(path.data()), path.size()};
11956 returnValue__ = Discord_Client_SetLogDir(
11957 &instance_, path__str, static_cast<Discord_LoggingSeverity>(minSeverity));
11958 return returnValue__;
11959}
11960void Client::SetStatusChangedCallback(discordpp::Client::OnStatusChanged cb)
11961{
11962 assert(state_ == DiscordObjectState::Owned);
11963 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11964 auto cb__userData = new Tcb__UserData(cb);
11965 Discord_Client_OnStatusChanged cb__native =
11966 [](auto status, auto error, auto errorDetail, void* userData__) {
11967 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
11968 userData__typed->delegate(static_cast<discordpp::Client::Status>(status),
11969 static_cast<discordpp::Client::Error>(error),
11970 errorDetail);
11971 };
11972 Discord_Client_SetStatusChangedCallback(
11973 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11974}
11975void Client::SetVoiceLogDir(std::string const& path, discordpp::LoggingSeverity minSeverity)
11976{
11977 assert(state_ == DiscordObjectState::Owned);
11978 Discord_String path__str{(uint8_t*)(path.data()), path.size()};
11979 Discord_Client_SetVoiceLogDir(
11980 &instance_, path__str, static_cast<Discord_LoggingSeverity>(minSeverity));
11981}
11982void Client::CreateOrJoinLobby(std::string const& secret,
11984{
11985 assert(state_ == DiscordObjectState::Owned);
11986 Discord_String secret__str{(uint8_t*)(secret.data()), secret.size()};
11987 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
11988 auto callback__userData = new Tcallback__UserData(callback);
11989 Discord_Client_CreateOrJoinLobbyCallback callback__native =
11990 [](auto result, auto lobbyId, void* userData__) {
11991 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
11992 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11993 userData__typed->delegate(std::move(result__obj), lobbyId);
11994 };
11995 Discord_Client_CreateOrJoinLobby(
11996 &instance_, secret__str, callback__native, Tcallback__UserData::Free, callback__userData);
11997}
11998void Client::CreateOrJoinLobbyWithMetadata(
11999 std::string const& secret,
12000 std::unordered_map<std::string, std::string> const& lobbyMetadata,
12001 std::unordered_map<std::string, std::string> const& memberMetadata,
12003{
12004 assert(state_ == DiscordObjectState::Owned);
12005 Discord_String secret__str{(uint8_t*)(secret.data()), secret.size()};
12006 ConvertedProperties lobbyMetadata__convert(lobbyMetadata);
12007 ConvertedProperties memberMetadata__convert(memberMetadata);
12008 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
12009 auto callback__userData = new Tcallback__UserData(callback);
12010 Discord_Client_CreateOrJoinLobbyCallback callback__native =
12011 [](auto result, auto lobbyId, void* userData__) {
12012 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
12013 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
12014 userData__typed->delegate(std::move(result__obj), lobbyId);
12015 };
12016 Discord_Client_CreateOrJoinLobbyWithMetadata(&instance_,
12017 secret__str,
12018 lobbyMetadata__convert.Properties,
12019 memberMetadata__convert.Properties,
12020 callback__native,
12021 Tcallback__UserData::Free,
12022 callback__userData);
12023}
12024void Client::GetGuildChannels(uint64_t guildId, discordpp::Client::GetGuildChannelsCallback cb)
12025{
12026 assert(state_ == DiscordObjectState::Owned);
12027 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
12028 auto cb__userData = new Tcb__UserData(cb);
12029 Discord_Client_GetGuildChannelsCallback cb__native =
12030 [](auto result, auto guildChannels, void* userData__) {
12031 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
12032 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
12033 std::vector<discordpp::GuildChannel> guildChannels__vec;
12034 guildChannels__vec.reserve(guildChannels.size);
12035 for (size_t i__ = 0; i__ < guildChannels.size; ++i__) {
12036 guildChannels__vec.emplace_back(guildChannels.ptr[i__], DiscordObjectState::Owned);
12037 }
12038 Discord_Free(guildChannels.ptr);
12039 userData__typed->delegate(std::move(result__obj), std::move(guildChannels__vec));
12040 };
12041 Discord_Client_GetGuildChannels(
12042 &instance_, guildId, cb__native, Tcb__UserData::Free, cb__userData);
12043}
12044std::optional<discordpp::LobbyHandle> Client::GetLobbyHandle(uint64_t lobbyId) const
12045{
12046 assert(state_ == DiscordObjectState::Owned);
12047 bool returnIsNonNull__;
12048 Discord_LobbyHandle returnValueNative__;
12049 returnIsNonNull__ = Discord_Client_GetLobbyHandle(&instance_, lobbyId, &returnValueNative__);
12050 if (!returnIsNonNull__) {
12051 return {};
12052 }
12053 discordpp::LobbyHandle returnValue__(returnValueNative__, DiscordObjectState::Owned);
12054 return returnValue__;
12055}
12056std::vector<uint64_t> Client::GetLobbyIds() const
12057{
12058 assert(state_ == DiscordObjectState::Owned);
12059 Discord_UInt64Span returnValueNative__;
12060 Discord_Client_GetLobbyIds(&instance_, &returnValueNative__);
12061 std::vector<uint64_t> returnValue__(returnValueNative__.ptr,
12062 returnValueNative__.ptr + returnValueNative__.size);
12063 Discord_Free(returnValueNative__.ptr);
12064 return returnValue__;
12065}
12066void Client::GetUserGuilds(discordpp::Client::GetUserGuildsCallback cb)
12067{
12068 assert(state_ == DiscordObjectState::Owned);
12069 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
12070 auto cb__userData = new Tcb__UserData(cb);
12071 Discord_Client_GetUserGuildsCallback cb__native =
12072 [](auto result, auto guilds, void* userData__) {
12073 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
12074 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
12075 std::vector<discordpp::GuildMinimal> guilds__vec;
12076 guilds__vec.reserve(guilds.size);
12077 for (size_t i__ = 0; i__ < guilds.size; ++i__) {
12078 guilds__vec.emplace_back(guilds.ptr[i__], DiscordObjectState::Owned);
12079 }
12080 Discord_Free(guilds.ptr);
12081 userData__typed->delegate(std::move(result__obj), std::move(guilds__vec));
12082 };
12083 Discord_Client_GetUserGuilds(&instance_, cb__native, Tcb__UserData::Free, cb__userData);
12084}
12085void Client::JoinLinkedLobbyGuild(
12086 uint64_t lobbyId,
12087 discordpp::Client::ProvisionalUserMergeRequiredCallback provisionalUserMergeRequiredCallback,
12089{
12090 assert(state_ == DiscordObjectState::Owned);
12091 using TprovisionalUserMergeRequiredCallback__UserData =
12092 TDelegateUserData<std::remove_reference_t<decltype(provisionalUserMergeRequiredCallback)>>;
12093 auto provisionalUserMergeRequiredCallback__userData =
12094 new TprovisionalUserMergeRequiredCallback__UserData(provisionalUserMergeRequiredCallback);
12095 Discord_Client_ProvisionalUserMergeRequiredCallback
12096 provisionalUserMergeRequiredCallback__native = [](void* userData__) {
12097 auto userData__typed =
12098 static_cast<TprovisionalUserMergeRequiredCallback__UserData*>(userData__);
12099 userData__typed->delegate();
12100 };
12101 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
12102 auto callback__userData = new Tcallback__UserData(callback);
12103 Discord_Client_JoinLinkedLobbyGuildCallback callback__native =
12104 [](auto result, auto inviteUrl, void* userData__) {
12105 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
12106 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
12107 std::string inviteUrl__str(reinterpret_cast<char*>(inviteUrl.ptr), inviteUrl.size);
12108 userData__typed->delegate(std::move(result__obj), std::move(inviteUrl__str));
12109 Discord_Free(inviteUrl.ptr);
12110 };
12111 Discord_Client_JoinLinkedLobbyGuild(&instance_,
12112 lobbyId,
12113 provisionalUserMergeRequiredCallback__native,
12114 TprovisionalUserMergeRequiredCallback__UserData::Free,
12115 provisionalUserMergeRequiredCallback__userData,
12116 callback__native,
12117 Tcallback__UserData::Free,
12118 callback__userData);
12119}
12120void Client::LeaveLobby(uint64_t lobbyId, discordpp::Client::LeaveLobbyCallback callback)
12121{
12122 assert(state_ == DiscordObjectState::Owned);
12123 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
12124 auto callback__userData = new Tcallback__UserData(callback);
12125 Discord_Client_LeaveLobbyCallback callback__native = [](auto result, void* userData__) {
12126 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
12127 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
12128 userData__typed->delegate(std::move(result__obj));
12129 };
12130 Discord_Client_LeaveLobby(
12131 &instance_, lobbyId, callback__native, Tcallback__UserData::Free, callback__userData);
12132}
12133void Client::LinkChannelToLobby(uint64_t lobbyId,
12134 uint64_t channelId,
12136{
12137 assert(state_ == DiscordObjectState::Owned);
12138 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
12139 auto callback__userData = new Tcallback__UserData(callback);
12140 Discord_Client_LinkOrUnlinkChannelCallback callback__native = [](auto result,
12141 void* userData__) {
12142 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
12143 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
12144 userData__typed->delegate(std::move(result__obj));
12145 };
12146 Discord_Client_LinkChannelToLobby(&instance_,
12147 lobbyId,
12148 channelId,
12149 callback__native,
12150 Tcallback__UserData::Free,
12151 callback__userData);
12152}
12153void Client::SetLobbyCreatedCallback(discordpp::Client::LobbyCreatedCallback cb)
12154{
12155 assert(state_ == DiscordObjectState::Owned);
12156 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
12157 auto cb__userData = new Tcb__UserData(cb);
12158 Discord_Client_LobbyCreatedCallback cb__native = [](auto lobbyId, void* userData__) {
12159 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
12160 userData__typed->delegate(lobbyId);
12161 };
12162 Discord_Client_SetLobbyCreatedCallback(
12163 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
12164}
12165void Client::SetLobbyDeletedCallback(discordpp::Client::LobbyDeletedCallback cb)
12166{
12167 assert(state_ == DiscordObjectState::Owned);
12168 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
12169 auto cb__userData = new Tcb__UserData(cb);
12170 Discord_Client_LobbyDeletedCallback cb__native = [](auto lobbyId, void* userData__) {
12171 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
12172 userData__typed->delegate(lobbyId);
12173 };
12174 Discord_Client_SetLobbyDeletedCallback(
12175 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
12176}
12177void Client::SetLobbyMemberAddedCallback(discordpp::Client::LobbyMemberAddedCallback cb)
12178{
12179 assert(state_ == DiscordObjectState::Owned);
12180 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
12181 auto cb__userData = new Tcb__UserData(cb);
12182 Discord_Client_LobbyMemberAddedCallback cb__native =
12183 [](auto lobbyId, auto memberId, void* userData__) {
12184 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
12185 userData__typed->delegate(lobbyId, memberId);
12186 };
12187 Discord_Client_SetLobbyMemberAddedCallback(
12188 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
12189}
12190void Client::SetLobbyMemberRemovedCallback(discordpp::Client::LobbyMemberRemovedCallback cb)
12191{
12192 assert(state_ == DiscordObjectState::Owned);
12193 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
12194 auto cb__userData = new Tcb__UserData(cb);
12195 Discord_Client_LobbyMemberRemovedCallback cb__native =
12196 [](auto lobbyId, auto memberId, void* userData__) {
12197 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
12198 userData__typed->delegate(lobbyId, memberId);
12199 };
12200 Discord_Client_SetLobbyMemberRemovedCallback(
12201 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
12202}
12203void Client::SetLobbyMemberUpdatedCallback(discordpp::Client::LobbyMemberUpdatedCallback cb)
12204{
12205 assert(state_ == DiscordObjectState::Owned);
12206 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
12207 auto cb__userData = new Tcb__UserData(cb);
12208 Discord_Client_LobbyMemberUpdatedCallback cb__native =
12209 [](auto lobbyId, auto memberId, void* userData__) {
12210 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
12211 userData__typed->delegate(lobbyId, memberId);
12212 };
12213 Discord_Client_SetLobbyMemberUpdatedCallback(
12214 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
12215}
12216void Client::SetLobbyUpdatedCallback(discordpp::Client::LobbyUpdatedCallback cb)
12217{
12218 assert(state_ == DiscordObjectState::Owned);
12219 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
12220 auto cb__userData = new Tcb__UserData(cb);
12221 Discord_Client_LobbyUpdatedCallback cb__native = [](auto lobbyId, void* userData__) {
12222 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
12223 userData__typed->delegate(lobbyId);
12224 };
12225 Discord_Client_SetLobbyUpdatedCallback(
12226 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
12227}
12228void Client::UnlinkChannelFromLobby(uint64_t lobbyId,
12230{
12231 assert(state_ == DiscordObjectState::Owned);
12232 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
12233 auto callback__userData = new Tcallback__UserData(callback);
12234 Discord_Client_LinkOrUnlinkChannelCallback callback__native = [](auto result,
12235 void* userData__) {
12236 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
12237 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
12238 userData__typed->delegate(std::move(result__obj));
12239 };
12240 Discord_Client_UnlinkChannelFromLobby(
12241 &instance_, lobbyId, callback__native, Tcallback__UserData::Free, callback__userData);
12242}
12243void Client::IsDiscordAppInstalled(discordpp::Client::IsDiscordAppInstalledCallback callback)
12244{
12245 assert(state_ == DiscordObjectState::Owned);
12246 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
12247 auto callback__userData = new Tcallback__UserData(callback);
12248 Discord_Client_IsDiscordAppInstalledCallback callback__native = [](auto installed,
12249 void* userData__) {
12250 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
12251 userData__typed->delegate(installed);
12252 };
12253 Discord_Client_IsDiscordAppInstalled(
12254 &instance_, callback__native, Tcallback__UserData::Free, callback__userData);
12255}
12256void Client::AcceptActivityInvite(discordpp::ActivityInvite invite,
12258{
12259 assert(state_ == DiscordObjectState::Owned);
12260 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
12261 auto cb__userData = new Tcb__UserData(cb);
12262 Discord_Client_AcceptActivityInviteCallback cb__native =
12263 [](auto result, auto joinSecret, void* userData__) {
12264 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
12265 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
12266 std::string joinSecret__str(reinterpret_cast<char*>(joinSecret.ptr), joinSecret.size);
12267 userData__typed->delegate(std::move(result__obj), std::move(joinSecret__str));
12268 Discord_Free(joinSecret.ptr);
12269 };
12270 Discord_Client_AcceptActivityInvite(
12271 &instance_, invite.instance(), cb__native, Tcb__UserData::Free, cb__userData);
12272}
12273void Client::ClearRichPresence()
12274{
12275 assert(state_ == DiscordObjectState::Owned);
12276 Discord_Client_ClearRichPresence(&instance_);
12277}
12278bool Client::RegisterLaunchCommand(uint64_t applicationId, std::string command)
12279{
12280 assert(state_ == DiscordObjectState::Owned);
12281 bool returnValue__;
12282 Discord_String command__str{(uint8_t*)(command.data()), command.size()};
12283 returnValue__ = Discord_Client_RegisterLaunchCommand(&instance_, applicationId, command__str);
12284 return returnValue__;
12285}
12286bool Client::RegisterLaunchSteamApplication(uint64_t applicationId, uint32_t steamAppId)
12287{
12288 assert(state_ == DiscordObjectState::Owned);
12289 bool returnValue__;
12290 returnValue__ =
12291 Discord_Client_RegisterLaunchSteamApplication(&instance_, applicationId, steamAppId);
12292 return returnValue__;
12293}
12294void Client::SendActivityInvite(uint64_t userId,
12295 std::string const& content,
12297{
12298 assert(state_ == DiscordObjectState::Owned);
12299 Discord_String content__str{(uint8_t*)(content.data()), content.size()};
12300 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
12301 auto cb__userData = new Tcb__UserData(cb);
12302 Discord_Client_SendActivityInviteCallback cb__native = [](auto result, void* userData__) {
12303 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
12304 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
12305 userData__typed->delegate(std::move(result__obj));
12306 };
12307 Discord_Client_SendActivityInvite(
12308 &instance_, userId, content__str, cb__native, Tcb__UserData::Free, cb__userData);
12309}
12310void Client::SendActivityJoinRequest(uint64_t userId,
12312{
12313 assert(state_ == DiscordObjectState::Owned);
12314 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
12315 auto cb__userData = new Tcb__UserData(cb);
12316 Discord_Client_SendActivityInviteCallback cb__native = [](auto result, void* userData__) {
12317 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
12318 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
12319 userData__typed->delegate(std::move(result__obj));
12320 };
12321 Discord_Client_SendActivityJoinRequest(
12322 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
12323}
12324void Client::SendActivityJoinRequestReply(discordpp::ActivityInvite invite,
12326{
12327 assert(state_ == DiscordObjectState::Owned);
12328 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
12329 auto cb__userData = new Tcb__UserData(cb);
12330 Discord_Client_SendActivityInviteCallback cb__native = [](auto result, void* userData__) {
12331 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
12332 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
12333 userData__typed->delegate(std::move(result__obj));
12334 };
12335 Discord_Client_SendActivityJoinRequestReply(
12336 &instance_, invite.instance(), cb__native, Tcb__UserData::Free, cb__userData);
12337}
12338void Client::SetActivityInviteCreatedCallback(discordpp::Client::ActivityInviteCallback cb)
12339{
12340 assert(state_ == DiscordObjectState::Owned);
12341 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
12342 auto cb__userData = new Tcb__UserData(cb);
12343 Discord_Client_ActivityInviteCallback cb__native = [](auto invite, void* userData__) {
12344 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
12345 discordpp::ActivityInvite invite__obj(*invite, DiscordObjectState::Owned);
12346 userData__typed->delegate(std::move(invite__obj));
12347 };
12348 Discord_Client_SetActivityInviteCreatedCallback(
12349 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
12350}
12351void Client::SetActivityInviteUpdatedCallback(discordpp::Client::ActivityInviteCallback cb)
12352{
12353 assert(state_ == DiscordObjectState::Owned);
12354 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
12355 auto cb__userData = new Tcb__UserData(cb);
12356 Discord_Client_ActivityInviteCallback cb__native = [](auto invite, void* userData__) {
12357 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
12358 discordpp::ActivityInvite invite__obj(*invite, DiscordObjectState::Owned);
12359 userData__typed->delegate(std::move(invite__obj));
12360 };
12361 Discord_Client_SetActivityInviteUpdatedCallback(
12362 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
12363}
12364void Client::SetActivityJoinCallback(discordpp::Client::ActivityJoinCallback cb)
12365{
12366 assert(state_ == DiscordObjectState::Owned);
12367 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
12368 auto cb__userData = new Tcb__UserData(cb);
12369 Discord_Client_ActivityJoinCallback cb__native = [](auto joinSecret, void* userData__) {
12370 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
12371 std::string joinSecret__str(reinterpret_cast<char*>(joinSecret.ptr), joinSecret.size);
12372 userData__typed->delegate(std::move(joinSecret__str));
12373 Discord_Free(joinSecret.ptr);
12374 };
12375 Discord_Client_SetActivityJoinCallback(
12376 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
12377}
12378void Client::SetActivityJoinWithApplicationCallback(
12380{
12381 assert(state_ == DiscordObjectState::Owned);
12382 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
12383 auto cb__userData = new Tcb__UserData(cb);
12384 Discord_Client_ActivityJoinWithApplicationCallback cb__native =
12385 [](auto applicationId, auto joinSecret, void* userData__) {
12386 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
12387 std::string joinSecret__str(reinterpret_cast<char*>(joinSecret.ptr), joinSecret.size);
12388 userData__typed->delegate(applicationId, std::move(joinSecret__str));
12389 Discord_Free(joinSecret.ptr);
12390 };
12391 Discord_Client_SetActivityJoinWithApplicationCallback(
12392 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
12393}
12394void Client::SetOnlineStatus(discordpp::StatusType status,
12396{
12397 assert(state_ == DiscordObjectState::Owned);
12398 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
12399 auto callback__userData = new Tcallback__UserData(callback);
12400 Discord_Client_UpdateStatusCallback callback__native = [](auto result, void* userData__) {
12401 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
12402 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
12403 userData__typed->delegate(std::move(result__obj));
12404 };
12405 Discord_Client_SetOnlineStatus(&instance_,
12406 static_cast<Discord_StatusType>(status),
12407 callback__native,
12408 Tcallback__UserData::Free,
12409 callback__userData);
12410}
12411void Client::UpdateRichPresence(discordpp::Activity activity,
12413{
12414 assert(state_ == DiscordObjectState::Owned);
12415 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
12416 auto cb__userData = new Tcb__UserData(cb);
12417 Discord_Client_UpdateRichPresenceCallback cb__native = [](auto result, void* userData__) {
12418 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
12419 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
12420 userData__typed->delegate(std::move(result__obj));
12421 };
12422 Discord_Client_UpdateRichPresence(
12423 &instance_, activity.instance(), cb__native, Tcb__UserData::Free, cb__userData);
12424}
12425void Client::AcceptDiscordFriendRequest(uint64_t userId,
12427{
12428 assert(state_ == DiscordObjectState::Owned);
12429 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
12430 auto cb__userData = new Tcb__UserData(cb);
12431 Discord_Client_UpdateRelationshipCallback cb__native = [](auto result, void* userData__) {
12432 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
12433 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
12434 userData__typed->delegate(std::move(result__obj));
12435 };
12436 Discord_Client_AcceptDiscordFriendRequest(
12437 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
12438}
12439void Client::AcceptGameFriendRequest(uint64_t userId,
12441{
12442 assert(state_ == DiscordObjectState::Owned);
12443 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
12444 auto cb__userData = new Tcb__UserData(cb);
12445 Discord_Client_UpdateRelationshipCallback cb__native = [](auto result, void* userData__) {
12446 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
12447 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
12448 userData__typed->delegate(std::move(result__obj));
12449 };
12450 Discord_Client_AcceptGameFriendRequest(
12451 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
12452}
12453void Client::BlockUser(uint64_t userId, discordpp::Client::UpdateRelationshipCallback cb)
12454{
12455 assert(state_ == DiscordObjectState::Owned);
12456 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
12457 auto cb__userData = new Tcb__UserData(cb);
12458 Discord_Client_UpdateRelationshipCallback cb__native = [](auto result, void* userData__) {
12459 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
12460 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
12461 userData__typed->delegate(std::move(result__obj));
12462 };
12463 Discord_Client_BlockUser(&instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
12464}
12465void Client::CancelDiscordFriendRequest(uint64_t userId,
12467{
12468 assert(state_ == DiscordObjectState::Owned);
12469 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
12470 auto cb__userData = new Tcb__UserData(cb);
12471 Discord_Client_UpdateRelationshipCallback cb__native = [](auto result, void* userData__) {
12472 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
12473 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
12474 userData__typed->delegate(std::move(result__obj));
12475 };
12476 Discord_Client_CancelDiscordFriendRequest(
12477 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
12478}
12479void Client::CancelGameFriendRequest(uint64_t userId,
12481{
12482 assert(state_ == DiscordObjectState::Owned);
12483 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
12484 auto cb__userData = new Tcb__UserData(cb);
12485 Discord_Client_UpdateRelationshipCallback cb__native = [](auto result, void* userData__) {
12486 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
12487 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
12488 userData__typed->delegate(std::move(result__obj));
12489 };
12490 Discord_Client_CancelGameFriendRequest(
12491 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
12492}
12493discordpp::RelationshipHandle Client::GetRelationshipHandle(uint64_t userId) const
12494{
12495 assert(state_ == DiscordObjectState::Owned);
12496 Discord_RelationshipHandle returnValueNative__{};
12497 Discord_Client_GetRelationshipHandle(&instance_, userId, &returnValueNative__);
12498 discordpp::RelationshipHandle returnValue__(returnValueNative__, DiscordObjectState::Owned);
12499 return returnValue__;
12500}
12501std::vector<discordpp::RelationshipHandle> Client::GetRelationships() const
12502{
12503 assert(state_ == DiscordObjectState::Owned);
12504 Discord_RelationshipHandleSpan returnValueNative__;
12505 Discord_Client_GetRelationships(&instance_, &returnValueNative__);
12506 std::vector<discordpp::RelationshipHandle> returnValue__;
12507 returnValue__.reserve(returnValueNative__.size);
12508 for (size_t i__ = 0; i__ < returnValueNative__.size; ++i__) {
12509 returnValue__.emplace_back(returnValueNative__.ptr[i__], DiscordObjectState::Owned);
12510 }
12511 Discord_Free(returnValueNative__.ptr);
12512 return returnValue__;
12513}
12514std::vector<discordpp::RelationshipHandle> Client::GetRelationshipsByGroup(
12515 discordpp::RelationshipGroupType groupType) const
12516{
12517 assert(state_ == DiscordObjectState::Owned);
12518 Discord_RelationshipHandleSpan returnValueNative__;
12519 Discord_Client_GetRelationshipsByGroup(
12520 &instance_, static_cast<Discord_RelationshipGroupType>(groupType), &returnValueNative__);
12521 std::vector<discordpp::RelationshipHandle> returnValue__;
12522 returnValue__.reserve(returnValueNative__.size);
12523 for (size_t i__ = 0; i__ < returnValueNative__.size; ++i__) {
12524 returnValue__.emplace_back(returnValueNative__.ptr[i__], DiscordObjectState::Owned);
12525 }
12526 Discord_Free(returnValueNative__.ptr);
12527 return returnValue__;
12528}
12529void Client::RejectDiscordFriendRequest(uint64_t userId,
12531{
12532 assert(state_ == DiscordObjectState::Owned);
12533 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
12534 auto cb__userData = new Tcb__UserData(cb);
12535 Discord_Client_UpdateRelationshipCallback cb__native = [](auto result, void* userData__) {
12536 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
12537 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
12538 userData__typed->delegate(std::move(result__obj));
12539 };
12540 Discord_Client_RejectDiscordFriendRequest(
12541 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
12542}
12543void Client::RejectGameFriendRequest(uint64_t userId,
12545{
12546 assert(state_ == DiscordObjectState::Owned);
12547 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
12548 auto cb__userData = new Tcb__UserData(cb);
12549 Discord_Client_UpdateRelationshipCallback cb__native = [](auto result, void* userData__) {
12550 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
12551 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
12552 userData__typed->delegate(std::move(result__obj));
12553 };
12554 Discord_Client_RejectGameFriendRequest(
12555 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
12556}
12557void Client::RemoveDiscordAndGameFriend(uint64_t userId,
12559{
12560 assert(state_ == DiscordObjectState::Owned);
12561 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
12562 auto cb__userData = new Tcb__UserData(cb);
12563 Discord_Client_UpdateRelationshipCallback cb__native = [](auto result, void* userData__) {
12564 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
12565 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
12566 userData__typed->delegate(std::move(result__obj));
12567 };
12568 Discord_Client_RemoveDiscordAndGameFriend(
12569 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
12570}
12571void Client::RemoveGameFriend(uint64_t userId, discordpp::Client::UpdateRelationshipCallback cb)
12572{
12573 assert(state_ == DiscordObjectState::Owned);
12574 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
12575 auto cb__userData = new Tcb__UserData(cb);
12576 Discord_Client_UpdateRelationshipCallback cb__native = [](auto result, void* userData__) {
12577 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
12578 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
12579 userData__typed->delegate(std::move(result__obj));
12580 };
12581 Discord_Client_RemoveGameFriend(
12582 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
12583}
12584std::vector<discordpp::UserHandle> Client::SearchFriendsByUsername(std::string searchStr) const
12585{
12586 assert(state_ == DiscordObjectState::Owned);
12587 Discord_UserHandleSpan returnValueNative__;
12588 Discord_String searchStr__str{(uint8_t*)(searchStr.data()), searchStr.size()};
12589 Discord_Client_SearchFriendsByUsername(&instance_, searchStr__str, &returnValueNative__);
12590 std::vector<discordpp::UserHandle> returnValue__;
12591 returnValue__.reserve(returnValueNative__.size);
12592 for (size_t i__ = 0; i__ < returnValueNative__.size; ++i__) {
12593 returnValue__.emplace_back(returnValueNative__.ptr[i__], DiscordObjectState::Owned);
12594 }
12595 Discord_Free(returnValueNative__.ptr);
12596 return returnValue__;
12597}
12598void Client::SendDiscordFriendRequest(std::string const& username,
12600{
12601 assert(state_ == DiscordObjectState::Owned);
12602 Discord_String username__str{(uint8_t*)(username.data()), username.size()};
12603 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
12604 auto cb__userData = new Tcb__UserData(cb);
12605 Discord_Client_SendFriendRequestCallback cb__native = [](auto result, void* userData__) {
12606 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
12607 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
12608 userData__typed->delegate(std::move(result__obj));
12609 };
12610 Discord_Client_SendDiscordFriendRequest(
12611 &instance_, username__str, cb__native, Tcb__UserData::Free, cb__userData);
12612}
12613void Client::SendDiscordFriendRequestById(uint64_t userId,
12615{
12616 assert(state_ == DiscordObjectState::Owned);
12617 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
12618 auto cb__userData = new Tcb__UserData(cb);
12619 Discord_Client_UpdateRelationshipCallback cb__native = [](auto result, void* userData__) {
12620 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
12621 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
12622 userData__typed->delegate(std::move(result__obj));
12623 };
12624 Discord_Client_SendDiscordFriendRequestById(
12625 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
12626}
12627void Client::SendGameFriendRequest(std::string const& username,
12629{
12630 assert(state_ == DiscordObjectState::Owned);
12631 Discord_String username__str{(uint8_t*)(username.data()), username.size()};
12632 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
12633 auto cb__userData = new Tcb__UserData(cb);
12634 Discord_Client_SendFriendRequestCallback cb__native = [](auto result, void* userData__) {
12635 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
12636 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
12637 userData__typed->delegate(std::move(result__obj));
12638 };
12639 Discord_Client_SendGameFriendRequest(
12640 &instance_, username__str, cb__native, Tcb__UserData::Free, cb__userData);
12641}
12642void Client::SendGameFriendRequestById(uint64_t userId,
12644{
12645 assert(state_ == DiscordObjectState::Owned);
12646 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
12647 auto cb__userData = new Tcb__UserData(cb);
12648 Discord_Client_UpdateRelationshipCallback cb__native = [](auto result, void* userData__) {
12649 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
12650 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
12651 userData__typed->delegate(std::move(result__obj));
12652 };
12653 Discord_Client_SendGameFriendRequestById(
12654 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
12655}
12656void Client::SetRelationshipCreatedCallback(discordpp::Client::RelationshipCreatedCallback cb)
12657{
12658 assert(state_ == DiscordObjectState::Owned);
12659 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
12660 auto cb__userData = new Tcb__UserData(cb);
12661 Discord_Client_RelationshipCreatedCallback cb__native =
12662 [](auto userId, auto isDiscordRelationshipUpdate, void* userData__) {
12663 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
12664 userData__typed->delegate(userId, isDiscordRelationshipUpdate);
12665 };
12666 Discord_Client_SetRelationshipCreatedCallback(
12667 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
12668}
12669void Client::SetRelationshipDeletedCallback(discordpp::Client::RelationshipDeletedCallback cb)
12670{
12671 assert(state_ == DiscordObjectState::Owned);
12672 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
12673 auto cb__userData = new Tcb__UserData(cb);
12674 Discord_Client_RelationshipDeletedCallback cb__native =
12675 [](auto userId, auto isDiscordRelationshipUpdate, void* userData__) {
12676 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
12677 userData__typed->delegate(userId, isDiscordRelationshipUpdate);
12678 };
12679 Discord_Client_SetRelationshipDeletedCallback(
12680 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
12681}
12682void Client::UnblockUser(uint64_t userId, discordpp::Client::UpdateRelationshipCallback cb)
12683{
12684 assert(state_ == DiscordObjectState::Owned);
12685 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
12686 auto cb__userData = new Tcb__UserData(cb);
12687 Discord_Client_UpdateRelationshipCallback cb__native = [](auto result, void* userData__) {
12688 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
12689 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
12690 userData__typed->delegate(std::move(result__obj));
12691 };
12692 Discord_Client_UnblockUser(&instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
12693}
12694std::optional<discordpp::UserHandle> Client::GetCurrentUserV2() const
12695{
12696 assert(state_ == DiscordObjectState::Owned);
12697 bool returnIsNonNull__;
12698 Discord_UserHandle returnValueNative__;
12699 returnIsNonNull__ = Discord_Client_GetCurrentUserV2(&instance_, &returnValueNative__);
12700 if (!returnIsNonNull__) {
12701 return {};
12702 }
12703 discordpp::UserHandle returnValue__(returnValueNative__, DiscordObjectState::Owned);
12704 return returnValue__;
12705}
12706void Client::GetDiscordClientConnectedUser(
12707 uint64_t applicationId,
12709{
12710 assert(state_ == DiscordObjectState::Owned);
12711 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
12712 auto callback__userData = new Tcallback__UserData(callback);
12713 Discord_Client_GetDiscordClientConnectedUserCallback callback__native =
12714 [](auto result, auto user, void* userData__) {
12715 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
12716 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
12717 std::optional<discordpp::UserHandle> user__opt{};
12718 if (user) {
12719 user__opt = discordpp::UserHandle(*user, DiscordObjectState::Owned);
12720 }
12721 userData__typed->delegate(std::move(result__obj), std::move(user__opt));
12722 };
12723 Discord_Client_GetDiscordClientConnectedUser(
12724 &instance_, applicationId, callback__native, Tcallback__UserData::Free, callback__userData);
12725}
12726std::optional<discordpp::UserHandle> Client::GetUser(uint64_t userId) const
12727{
12728 assert(state_ == DiscordObjectState::Owned);
12729 bool returnIsNonNull__;
12730 Discord_UserHandle returnValueNative__;
12731 returnIsNonNull__ = Discord_Client_GetUser(&instance_, userId, &returnValueNative__);
12732 if (!returnIsNonNull__) {
12733 return {};
12734 }
12735 discordpp::UserHandle returnValue__(returnValueNative__, DiscordObjectState::Owned);
12736 return returnValue__;
12737}
12738void Client::SetRelationshipGroupsUpdatedCallback(
12740{
12741 assert(state_ == DiscordObjectState::Owned);
12742 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
12743 auto cb__userData = new Tcb__UserData(cb);
12744 Discord_Client_RelationshipGroupsUpdatedCallback cb__native = [](auto userId,
12745 void* userData__) {
12746 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
12747 userData__typed->delegate(userId);
12748 };
12749 Discord_Client_SetRelationshipGroupsUpdatedCallback(
12750 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
12751}
12752void Client::SetUserUpdatedCallback(discordpp::Client::UserUpdatedCallback cb)
12753{
12754 assert(state_ == DiscordObjectState::Owned);
12755 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
12756 auto cb__userData = new Tcb__UserData(cb);
12757 Discord_Client_UserUpdatedCallback cb__native = [](auto userId, void* userData__) {
12758 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
12759 userData__typed->delegate(userId);
12760 };
12761 Discord_Client_SetUserUpdatedCallback(
12762 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
12763}
12764const CallInfoHandle CallInfoHandle::nullobj{{}, DiscordObjectState::Invalid};
12765CallInfoHandle::~CallInfoHandle()
12766{
12767 if (state_ == DiscordObjectState::Owned) {
12768 Drop();
12769 state_ = DiscordObjectState::Invalid;
12770 }
12771}
12772CallInfoHandle::CallInfoHandle(CallInfoHandle&& other) noexcept
12773 : instance_(other.instance_)
12774 , state_(other.state_)
12775{
12776 other.state_ = DiscordObjectState::Invalid;
12777}
12778CallInfoHandle& CallInfoHandle::operator=(CallInfoHandle&& other) noexcept
12779{
12780 if (this != &other) {
12781 if (state_ == DiscordObjectState::Owned) {
12782 Drop();
12783 }
12784 instance_ = other.instance_;
12785 state_ = other.state_;
12786 other.state_ = DiscordObjectState::Invalid;
12787 }
12788 return *this;
12789}
12790CallInfoHandle::CallInfoHandle(const CallInfoHandle& other)
12791 : instance_{}
12792 , state_(DiscordObjectState::Invalid)
12793{
12794 if (other.state_ == DiscordObjectState::Owned) {
12795 Discord_CallInfoHandle_Clone(&instance_, other.instance());
12796
12797 state_ = DiscordObjectState::Owned;
12798 }
12799}
12800CallInfoHandle& CallInfoHandle::operator=(const CallInfoHandle& other)
12801{
12802 if (this != &other) {
12803 if (state_ == DiscordObjectState::Owned) {
12804 Drop();
12805 state_ = DiscordObjectState::Invalid;
12806 }
12807 if (other.state_ == DiscordObjectState::Owned) {
12808 Discord_CallInfoHandle_Clone(&instance_, other.instance());
12809
12810 state_ = DiscordObjectState::Owned;
12811 }
12812 }
12813 return *this;
12814}
12815CallInfoHandle::CallInfoHandle(Discord_CallInfoHandle instance, DiscordObjectState state)
12816 : instance_(instance)
12817 , state_(state)
12818{
12819}
12820void CallInfoHandle::Drop()
12821{
12822 if (state_ != DiscordObjectState::Owned) {
12823 return;
12824 }
12825 Discord_CallInfoHandle_Drop(&instance_);
12826 state_ = DiscordObjectState::Invalid;
12827}
12828uint64_t CallInfoHandle::ChannelId() const
12829{
12830 assert(state_ == DiscordObjectState::Owned);
12831 uint64_t returnValue__;
12832 returnValue__ = Discord_CallInfoHandle_ChannelId(&instance_);
12833 return returnValue__;
12834}
12835std::vector<uint64_t> CallInfoHandle::GetParticipants() const
12836{
12837 assert(state_ == DiscordObjectState::Owned);
12838 Discord_UInt64Span returnValueNative__;
12839 Discord_CallInfoHandle_GetParticipants(&instance_, &returnValueNative__);
12840 std::vector<uint64_t> returnValue__(returnValueNative__.ptr,
12841 returnValueNative__.ptr + returnValueNative__.size);
12842 Discord_Free(returnValueNative__.ptr);
12843 return returnValue__;
12844}
12845std::optional<discordpp::VoiceStateHandle> CallInfoHandle::GetVoiceStateHandle(
12846 uint64_t userId) const
12847{
12848 assert(state_ == DiscordObjectState::Owned);
12849 bool returnIsNonNull__;
12850 Discord_VoiceStateHandle returnValueNative__;
12851 returnIsNonNull__ =
12852 Discord_CallInfoHandle_GetVoiceStateHandle(&instance_, userId, &returnValueNative__);
12853 if (!returnIsNonNull__) {
12854 return {};
12855 }
12856 discordpp::VoiceStateHandle returnValue__(returnValueNative__, DiscordObjectState::Owned);
12857 return returnValue__;
12858}
12859uint64_t CallInfoHandle::GuildId() const
12860{
12861 assert(state_ == DiscordObjectState::Owned);
12862 uint64_t returnValue__;
12863 returnValue__ = Discord_CallInfoHandle_GuildId(&instance_);
12864 return returnValue__;
12865}
12866} // namespace discordpp
12867
12868#endif // DISCORDPP_IMPLEMENTATION
Struct which controls what your rich presence looks like in the Discord client. If you don't specify ...
Definition discordpp.h:827
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:846
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:1074
ActivityButton(ActivityButton &&other) noexcept
Move constructor for ActivityButton.
static const ActivityButton nullobj
Uninitialized instance of ActivityButton.
Definition discordpp.h:1093
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:729
static const ActivityInvite nullobj
Uninitialized instance of ActivityInvite.
Definition discordpp.h:748
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:968
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:987
ActivityParty & operator=(const ActivityParty &arg0)
Copy assignment operator for ActivityParty.
Definition discordpp.h:1030
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:1049
Definition discordpp.h:914
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:933
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:1299
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:1318
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:2905
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:2924
Represents a single input or output audio device available to the user.
Definition discordpp.h:3144
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:3163
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:1640
void SetIntegrationType(std::optional< discordpp::IntegrationType > IntegrationType)
Setter for AuthorizationArgs::IntegrationType.
std::optional< std::string > State() const
See https://entry.circularprotocol.live/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:1659
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:1548
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:1568
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:1595
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:1615
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:5343
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:5362
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:1900
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:1961
static const Call nullobj
Uninitialized instance of Call.
Definition discordpp.h:1978
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:1908
@ None
None.
Definition discordpp.h:1911
@ Forbidden
Forbidden.
Definition discordpp.h:1926
@ SignalingConnectionFailed
SignalingConnectionFailed.
Definition discordpp.h:1914
@ SignalingUnexpectedClose
SignalingUnexpectedClose.
Definition discordpp.h:1917
@ JoinTimeout
JoinTimeout.
Definition discordpp.h:1923
@ VoiceConnectionFailed
VoiceConnectionFailed.
Definition discordpp.h:1920
Status
Enum that respresents the state of the Call's network connection.
Definition discordpp.h:1930
@ Disconnecting
Disconnecting.
Definition discordpp.h:1951
@ Connected
Connected.
Definition discordpp.h:1945
@ Reconnecting
Reconnecting.
Definition discordpp.h:1948
@ Connecting
Connecting.
Definition discordpp.h:1939
@ SignalingConnected
SignalingConnected.
Definition discordpp.h:1942
@ Disconnected
Disconnected.
Definition discordpp.h:1933
@ Joining
Joining.
Definition discordpp.h:1936
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:1964
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:1958
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:1955
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:2127
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:2146
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:3326
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:3345
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:1455
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:1474
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:3406
std::function< void(discordpp::ClientResult result)> UnmergeIntoProvisionalAccountCallback
Callback function for the Client::UnmergeIntoProvisionalAccount method.
Definition discordpp.h:3593
std::function< void(std::vector< discordpp::AudioDevice > devices)> GetOutputDevicesCallback
Callback function for Client::GetOutputDevices.
Definition discordpp.h:3503
std::function< void(discordpp::ClientResult result, std::string inviteUrl)> JoinLinkedLobbyGuildCallback
Callback function for Client::JoinLinkedLobbyGuild.
Definition discordpp.h:3675
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:3638
std::function< void(discordpp::ClientResult result, discordpp::VoiceSettings settings)> GetVoiceSettingsCallback
Callback function for Client::GetVoiceSettings.
Definition discordpp.h:3507
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:3758
std::function< void(discordpp::ClientResult result)> UpdateRelationshipCallback
Callback function for most other Relationship functions such as Client::SendDiscordFriendRequestById.
Definition discordpp.h:3732
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 SetVoiceSettingsUpdatedCallback(discordpp::Client::VoiceSettingsUpdatedCallback callback)
Sets a callback to be invoked whenever the user's voice settings change in the connected Discord clie...
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:3597
std::function< void(bool inputDetected)> NoAudioInputCallback
Callback function for Client::SetNoAudioInputCallback.
Definition discordpp.h:3519
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:3626
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:3671
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:3688
std::function< void(std::string message, discordpp::LoggingSeverity severity)> LogCallback
Callback function invoked when a new log message is generated.
Definition discordpp.h:3647
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:3682
std::function< void(discordpp::AudioDevice device)> GetCurrentOutputDeviceCallback
Callback function for Client::GetCurrentOutputDevice.
Definition discordpp.h:3496
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:3590
std::function< void(discordpp::ClientResult result)> SetOutputDeviceCallback
Callback function for Client::SetOutputDevice.
Definition discordpp.h:3522
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:3753
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:3697
void GetVoiceSettings(discordpp::Client::GetVoiceSettingsCallback cb)
Asynchronously fetches the user's current voice settings from the connected Discord client.
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:3534
std::function< void(discordpp::ClientResult result)> LeaveLobbyCallback
Callback function for Client::LeaveLobby.
Definition discordpp.h:3679
std::function< void(uint64_t lobbyId)> LobbyUpdatedCallback
Callback function for Client::SetLobbyUpdatedCallback.
Definition discordpp.h:3700
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 SetNoiseCancellation(bool on)
Enables or disables Krisp noise cancellation.
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:3587
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(bool installed)> IsDiscordAppInstalledCallback
Callback invoked when the IsDiscordAppInstalled function completes.
Definition discordpp.h:3703
std::function< void(discordpp::ClientResult result)> UpdateRichPresenceCallback
Callback function for when Client::UpdateRichPresence completes.
Definition discordpp.h:3728
std::function< void(discordpp::ClientResult result, std::vector< discordpp::MessageHandle > messages)> UserMessagesWithLimitCallback
Callback function for Client::GetUserMessagesWithLimit.
Definition discordpp.h:3621
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:3736
std::function< void(discordpp::ClientResult result, std::vector< discordpp::MessageHandle > messages)> GetLobbyMessagesCallback
Callback function for Client::GetLobbyMessagesWithLimit.
Definition discordpp.h:3611
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:3658
std::function< void(uint64_t applicationId, std::string joinSecret)> ActivityJoinWithApplicationCallback
Callback function for Client::SetActivityJoinWithApplicationCallback.
Definition discordpp.h:3721
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:3490
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:3584
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:3706
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:3449
@ Disconnecting
Disconnecting.
Definition discordpp.h:3467
@ Connected
Connected.
Definition discordpp.h:3458
@ HttpWait
HttpWait.
Definition discordpp.h:3470
@ Reconnecting
Reconnecting.
Definition discordpp.h:3464
@ Connecting
Connecting.
Definition discordpp.h:3455
@ Ready
Ready.
Definition discordpp.h:3461
@ Disconnected
Disconnected.
Definition discordpp.h:3452
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:3569
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:3629
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:3487
std::function< void()> AuthorizeRequestCallback
Callback invoked when a user requests to initiate the authorization flow from the discord app.
Definition discordpp.h:3581
std::function< void(discordpp::ClientResult result)> EditUserMessageCallback
Callback function for Client::EditUserMessage.
Definition discordpp.h:3608
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:3516
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.
void IsDiscordAppInstalled(discordpp::Client::IsDiscordAppInstalledCallback callback)
Checks whether the Discord mobile app is installed on this device. On desktop platforms,...
std::function< void(uint64_t lobbyId, uint64_t memberId)> LobbyMemberAddedCallback
Callback function for Client::SetLobbyMemberAddedCallback.
Definition discordpp.h:3691
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:3715
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:3602
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:3685
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:3694
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:3553
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(discordpp::VoiceSettings settings)> VoiceSettingsUpdatedCallback
Callback function for Client::SetVoiceSettingsUpdatedCallback.
Definition discordpp.h:3529
std::function< void(std::string joinSecret)> ActivityJoinCallback
Callback function for Client::SetActivityJoinCallback.
Definition discordpp.h:3718
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:3711
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:3525
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:3749
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:3420
@ None
None.
Definition discordpp.h:3423
@ ConnectionCanceled
ConnectionCanceled.
Definition discordpp.h:3432
@ ConnectionFailed
ConnectionFailed.
Definition discordpp.h:3426
@ UnexpectedClose
UnexpectedClose.
Definition discordpp.h:3429
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:3634
std::function< void(discordpp::AudioDevice device)> GetCurrentInputDeviceCallback
Callback function for Client::GetCurrentInputDevice.
Definition discordpp.h:3493
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:3761
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:3641
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:3651
Thread
Represents the type of thread to control thread priority on.
Definition discordpp.h:3474
@ Client
Client.
Definition discordpp.h:3477
@ Voice
Voice.
Definition discordpp.h:3480
@ Network
Network.
Definition discordpp.h:3483
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:3644
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:3742
std::function< void(discordpp::ClientResult result)> DeleteUserMessageCallback
Callback function for Client::DeleteUserMessage.
Definition discordpp.h:3605
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:3557
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:3565
std::function< void(discordpp::ClientResult result, std::vector< discordpp::GuildChannel > guildChannels)> GetGuildChannelsCallback
Callback function for Client::GetGuildChannels.
Definition discordpp.h:3666
std::function< void(discordpp::ClientResult result)> UpdateStatusCallback
Callback function for when Client::SetOnlineStatus completes.
Definition discordpp.h:3725
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:3662
std::function< void(discordpp::ClientResult result, std::vector< discordpp::UserMessageSummary > summaries)> UserMessageSummariesCallback
Callback function for Client::GetUserMessageSummaries.
Definition discordpp.h:3616
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:3544
std::function< void(std::vector< discordpp::AudioDevice > inputDevices, std::vector< discordpp::AudioDevice > outputDevices)> DeviceChangeCallback
Callback function for Client::SetDeviceChangeCallback.
Definition discordpp.h:3511
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:3499
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:3774
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:1746
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:1766
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:2242
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:2197
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:2365
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:2384
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:2319
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:2338
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:2841
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:2860
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:2696
LobbyMemberHandle & operator=(const LobbyMemberHandle &other)
Copy assignment operator for LobbyMemberHandle.
static const LobbyMemberHandle nullobj
Uninitialized instance of LobbyMemberHandle.
Definition discordpp.h:2715
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:3017
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:3036
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< std::string > AdditionalName() const
Returns an additional display name for this message, if one was set.
std::optional< discordpp::AdditionalContent > AdditionalContent() const
If the message contains non-text content, such as images, videos, embeds, polls, etc,...
std::unordered_map< std::string, std::string > ModerationMetadata() const
Returns any moderation metadata the developer set on this message.
A RelationshipHandle represents the relationship between the current user and a target user on Discor...
Definition discordpp.h:2447
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:2466
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:2524
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:2566
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:2600
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:2574
@ Jpeg
Jpeg.
Definition discordpp.h:2586
@ Gif
Gif.
Definition discordpp.h:2577
@ Webp
Webp.
Definition discordpp.h:2580
@ Png
Png.
Definition discordpp.h:2583
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:3303
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:1856
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:1875
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 read-only snapshot of the user's voice settings in the connected Discord desktop client.
Definition discordpp.h:3199
VoiceSettings & operator=(const VoiceSettings &arg0)
Copy assignment operator for VoiceSettings.
float InputVolume() const
Microphone volume, ranging from 0 to 100.
void SetSelfMute(bool SelfMute)
Setter for VoiceSettings::SelfMute.
void SetPttKey(std::string PttKey)
Setter for VoiceSettings::PttKey.
float OutputVolume() const
Speaker volume, ranging from 0 to 200.
bool NoiseSuppression() const
Noise suppression state.
discordpp::VoiceInputModeType InputMode() const
When the client transmits microphone audio.
void SetNoiseSuppression(bool NoiseSuppression)
Setter for VoiceSettings::NoiseSuppression.
bool EchoCancellation() const
Echo cancellation state.
void SetOutputVolume(float OutputVolume)
Setter for VoiceSettings::OutputVolume.
VoiceSettings & operator=(VoiceSettings &&other) noexcept
Move assignment operator for VoiceSettings.
std::string PttKey() const
Display string for the push-to-talk key, such as "SHIFT + F". Empty when nothing is bound.
void SetInputMode(discordpp::VoiceInputModeType InputMode)
Setter for VoiceSettings::InputMode.
VoiceSettings(VoiceSettings &&other) noexcept
Move constructor for VoiceSettings.
static const VoiceSettings nullobj
Uninitialized instance of VoiceSettings.
Definition discordpp.h:3218
VoiceSettings(const VoiceSettings &arg0)
Copy constructor for VoiceSettings.
bool SelfMute() const
Self-mute state.
bool AutomaticGainControl() const
Automatic gain control state.
void SetEchoCancellation(bool EchoCancellation)
Setter for VoiceSettings::EchoCancellation.
bool SelfDeaf() const
Self-deafen state.
void SetInputVolume(float InputVolume)
Setter for VoiceSettings::InputVolume.
void SetSelfDeaf(bool SelfDeaf)
Setter for VoiceSettings::SelfDeaf.
void SetNoiseCancellation(bool NoiseCancellation)
Setter for VoiceSettings::NoiseCancellation.
bool NoiseCancellation() const
Noise cancellation state.
void SetAutomaticGainControl(bool AutomaticGainControl)
Setter for VoiceSettings::AutomaticGainControl.
A VoiceStateHandle represents the state of a single participant in a Discord voice call.
Definition discordpp.h:1814
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:1833
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:611
@ MessageDataVisibleOnDiscord
This disclosure type happens the first time a user sends a message in game, and that message will be ...
Definition discordpp.h:617
const char * EnumToString(discordpp::ActivityActionTypes value)
Converts a discordpp::ActivityActionTypes to a string.
Definition discordpp.h:5389
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:622
@ Bearer
Bearer.
Definition discordpp.h:628
@ User
User.
Definition discordpp.h:625
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:522
@ PendingIncoming
The current user has received a friend request from the target user, but it is not yet accepted.
Definition discordpp.h:537
@ Implicit
The Implicit type is documented for visibility, but should be unused in the SDK.
Definition discordpp.h:544
@ Suggestion
The Suggestion type is documented for visibility, but should be unused in the SDK.
Definition discordpp.h:547
@ PendingOutgoing
The current user has sent a friend request to the target user, but it is not yet accepted.
Definition discordpp.h:541
@ Blocked
The current user has blocked the target user, and so certain actions such as sending messages between...
Definition discordpp.h:532
@ None
The user has no relationship with the other user.
Definition discordpp.h:525
@ Friend
The user is friends with the other user.
Definition discordpp.h:528
AuthenticationExternalAuthType
Represents the various identity providers that can be used to authenticate a provisional account user...
Definition discordpp.h:633
@ EpicOnlineServicesIdToken
EpicOnlineServicesIdToken.
Definition discordpp.h:642
@ DiscordBotIssuedAccessToken
DiscordBotIssuedAccessToken.
Definition discordpp.h:651
@ EpicOnlineServicesAccessToken
EpicOnlineServicesAccessToken.
Definition discordpp.h:639
@ SteamSessionTicket
SteamSessionTicket.
Definition discordpp.h:645
@ OIDC
OIDC.
Definition discordpp.h:636
@ UnityServicesIdToken
UnityServicesIdToken.
Definition discordpp.h:648
@ PlayStationNetworkIdToken
PlayStationNetworkIdToken.
Definition discordpp.h:657
@ AppleIdToken
AppleIdToken.
Definition discordpp.h:654
LoggingSeverity
Enum that represents the various log levels supported by the SDK.
Definition discordpp.h:661
@ Warning
Warning.
Definition discordpp.h:670
@ Info
Info.
Definition discordpp.h:667
@ None
None.
Definition discordpp.h:676
@ Error
Error.
Definition discordpp.h:673
@ Verbose
Verbose.
Definition discordpp.h:664
RelationshipGroupType
Enum that represents the logical groups of relationships based on online status and game activity.
Definition discordpp.h:681
@ OnlinePlayingGame
Users who are online and currently playing the game.
Definition discordpp.h:684
@ Offline
Users who are offline.
Definition discordpp.h:690
@ OnlineElsewhere
Users who are online but not playing the game.
Definition discordpp.h:687
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:499
@ Game
Use the game audio system.
Definition discordpp.h:505
@ Standard
Use the standard audio system.
Definition discordpp.h:502
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
VoiceInputModeType
Describes how the Discord client decides when to transmit the user's microphone audio.
Definition discordpp.h:489
@ PushToTalk
Transmit while the push-to-talk shortcut is held.
Definition discordpp.h:495
@ VoiceActivity
Transmit when voice activity is detected.
Definition discordpp.h:492
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:579
@ Blocked
Blocked.
Definition discordpp.h:588
@ Online
The user is online and recently active.
Definition discordpp.h:582
@ Dnd
The user is online, but wishes to suppress notifications for the time being.
Definition discordpp.h:595
@ Unknown
Unknown.
Definition discordpp.h:604
@ Invisible
The user is online, but wishes to appear as if they are offline to other users.
Definition discordpp.h:598
@ Offline
The user is offline and not connected to Discord.
Definition discordpp.h:585
@ Streaming
The user is online and is actively streaming content.
Definition discordpp.h:601
@ Idle
The user is online, but has not been active for a while and may be away from their computer.
Definition discordpp.h:592
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:551
@ EpicOnlineServices
EpicOnlineServices.
Definition discordpp.h:557
@ OIDC
OIDC.
Definition discordpp.h:554
@ Steam
Steam.
Definition discordpp.h:560
@ None
None.
Definition discordpp.h:569
@ Unity
Unity.
Definition discordpp.h:563
@ Unknown
Unknown.
Definition discordpp.h:572
@ DiscordBot
DiscordBot.
Definition discordpp.h:566
void RunCallbacks()
Definition discordpp.h:29
AudioModeType
Represents whether a voice call is using push to talk or auto voice detection.
Definition discordpp.h:509
@ MODE_PTT
MODE_PTT.
Definition discordpp.h:518
@ MODE_VAD
MODE_VAD.
Definition discordpp.h:515
@ MODE_UNINIT
MODE_UNINIT.
Definition discordpp.h:512
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