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