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
3863
3870 void SetNoiseSuppression(bool on);
3871
3878 void SetOpusHardwareCoding(bool encode, bool decode);
3879
3884
3889 void SetOutputVolume(float outputVolume);
3890
3895 void SetSelfDeafAll(bool deaf);
3896
3899 void SetSelfMuteAll(bool mute);
3900
3904 [[deprecated("Calling Client::SetSpeakerMode is DEPRECATED.")]]
3905 bool SetSpeakerMode(bool speakerMode);
3906
3913 void SetThreadPriority(discordpp::Client::Thread thread, int32_t priority);
3914
3921
3924
3935 discordpp::Call StartCall(uint64_t channelId);
3936
3956 uint64_t lobbyId,
3960
3963
3969
3972
4068
4075
4081
4097 void ExchangeChildToken(std::string const& parentApplicationToken,
4098 uint64_t childApplicationId,
4100
4107 std::string const& token,
4109
4143 void GetProvisionalToken(uint64_t applicationId,
4145 std::string const& externalAuthToken,
4147
4171 void GetToken(uint64_t applicationId,
4172 std::string const& code,
4173 std::string const& codeVerifier,
4174 std::string const& redirectUri,
4176
4204
4244 std::string const& externalAuthToken,
4246
4277 void GetTokenFromProvisionalMerge(uint64_t applicationId,
4278 std::string const& code,
4279 std::string const& codeVerifier,
4280 std::string const& redirectUri,
4282 std::string const& externalAuthToken,
4284
4288
4293 void OpenAuthorizeDeviceScreen(uint64_t clientId, std::string const& userCode);
4294
4302
4317 void RefreshToken(uint64_t applicationId,
4318 std::string const& refreshToken,
4320
4331
4338
4351 void RevokeToken(uint64_t applicationId,
4352 std::string const& token,
4354
4359
4365 void SetGameWindowPid(int32_t pid);
4366
4380
4398 uint64_t applicationId,
4400 std::string const& externalAuthToken,
4402
4409 std::string const& name,
4411
4419 std::string token,
4422
4425
4431 bool CanOpenMessageInDiscord(uint64_t messageId);
4432
4434 void DeleteUserMessage(uint64_t recipientId,
4435 uint64_t messageId,
4437
4441 void EditUserMessage(uint64_t recipientId,
4442 uint64_t messageId,
4443 std::string const& content,
4445
4452 std::optional<discordpp::ChannelHandle> GetChannelHandle(uint64_t channelId) const;
4453
4465 void GetLobbyMessagesWithLimit(uint64_t lobbyId,
4466 int32_t limit,
4468
4473 std::optional<discordpp::MessageHandle> GetMessageHandle(uint64_t messageId) const;
4474
4482
4497 void GetUserMessagesWithLimit(uint64_t recipientId,
4498 int32_t limit,
4500
4507 uint64_t messageId,
4508 discordpp::Client::ProvisionalUserMergeRequiredCallback provisionalUserMergeRequiredCallback,
4510
4521 void SendLobbyMessage(uint64_t lobbyId,
4522 std::string const& content,
4524
4531 void SendLobbyMessageWithMetadata(uint64_t lobbyId,
4532 std::string const& content,
4533 std::unordered_map<std::string, std::string> const& metadata,
4535
4548 void SendUserMessage(uint64_t recipientId,
4549 std::string const& content,
4551
4558 void SendUserMessageWithMetadata(uint64_t recipientId,
4559 std::string const& content,
4560 std::unordered_map<std::string, std::string> const& metadata,
4562
4575
4583
4591
4602 void SetShowingChat(bool showingChat);
4604
4607
4618 discordpp::LoggingSeverity minSeverity);
4619
4626 discordpp::LoggingSeverity minSeverity);
4627
4634 void Connect();
4635
4642
4646
4656
4661 void SetApplicationId(uint64_t applicationId);
4662
4677 bool SetLogDir(std::string const& path, discordpp::LoggingSeverity minSeverity);
4678
4681
4694 void SetVoiceLogDir(std::string const& path, discordpp::LoggingSeverity minSeverity);
4696
4699
4717 void CreateOrJoinLobby(std::string const& secret,
4719
4727 std::string const& secret,
4728 std::unordered_map<std::string, std::string> const& lobbyMetadata,
4729 std::unordered_map<std::string, std::string> const& memberMetadata,
4731
4740
4742 std::optional<discordpp::LobbyHandle> GetLobbyHandle(uint64_t lobbyId) const;
4743
4749 std::vector<uint64_t> GetLobbyIds() const;
4750
4758
4766 uint64_t lobbyId,
4767 discordpp::Client::ProvisionalUserMergeRequiredCallback provisionalUserMergeRequiredCallback,
4769
4776 void LeaveLobby(uint64_t lobbyId, discordpp::Client::LeaveLobbyCallback callback);
4777
4782 void LinkChannelToLobby(uint64_t lobbyId,
4783 uint64_t channelId,
4785
4798
4809
4818
4827
4834
4838
4844 void UnlinkChannelFromLobby(uint64_t lobbyId,
4847
4850
4866
4869
4877
4880
4900 bool RegisterLaunchCommand(uint64_t applicationId, std::string command);
4901
4908 bool RegisterLaunchSteamApplication(uint64_t applicationId, uint32_t steamAppId);
4909
4920 void SendActivityInvite(uint64_t userId,
4921 std::string const& content,
4923
4931
4937
4947
4954
4962
4971
4975
4995
4998
5004 void AcceptDiscordFriendRequest(uint64_t userId,
5006
5012
5020
5026 void CancelDiscordFriendRequest(uint64_t userId,
5028
5034
5038
5041 std::vector<discordpp::RelationshipHandle> GetRelationships() const;
5042
5050 std::vector<discordpp::RelationshipHandle> GetRelationshipsByGroup(
5051 discordpp::RelationshipGroupType groupType) const;
5052
5058 void RejectDiscordFriendRequest(uint64_t userId,
5060
5066
5071 void RemoveDiscordAndGameFriend(uint64_t userId,
5073
5078
5083 std::vector<discordpp::UserHandle> SearchFriendsByUsername(std::string searchStr) const;
5084
5100 void SendDiscordFriendRequest(std::string const& username,
5102
5118 void SendDiscordFriendRequestById(uint64_t userId,
5120
5136 void SendGameFriendRequest(std::string const& username,
5138
5154 void SendGameFriendRequestById(uint64_t userId,
5156
5163
5170
5177
5180
5184 std::optional<discordpp::UserHandle> GetCurrentUserV2() const;
5185
5190 uint64_t applicationId,
5192
5198 std::optional<discordpp::UserHandle> GetUser(uint64_t userId) const;
5199
5206
5213};
5214
5218 mutable Discord_CallInfoHandle instance_{};
5221
5222public:
5224 Discord_CallInfoHandle* instance() const { return &instance_; }
5227 explicit CallInfoHandle(Discord_CallInfoHandle instance, DiscordObjectState state);
5237 operator bool() const { return state_ != DiscordObjectState::Invalid; }
5238
5243
5245 void Drop();
5247
5249 uint64_t ChannelId() const;
5250
5252 std::vector<uint64_t> GetParticipants() const;
5253
5256 std::optional<discordpp::VoiceStateHandle> GetVoiceStateHandle(uint64_t userId) const;
5257
5259 uint64_t GuildId() const;
5260};
5261
5263{
5264 switch (value) {
5266 return "Invalid";
5268 return "Join";
5270 return "JoinRequest";
5271 default:
5272 return "unknown";
5273 }
5274}
5275
5277{
5278 switch (value) {
5280 return "Private";
5282 return "Public";
5283 default:
5284 return "unknown";
5285 }
5286}
5287
5289{
5290 switch (value) {
5292 return "Playing";
5294 return "Streaming";
5296 return "Listening";
5298 return "Watching";
5300 return "CustomStatus";
5302 return "Competing";
5304 return "HangStatus";
5305 default:
5306 return "unknown";
5307 }
5308}
5309
5311{
5312 switch (value) {
5314 return "Name";
5316 return "State";
5318 return "Details";
5319 default:
5320 return "unknown";
5321 }
5322}
5323
5325{
5326 switch (value) {
5328 return "Desktop";
5330 return "Xbox";
5332 return "Samsung";
5334 return "IOS";
5336 return "Android";
5338 return "Embedded";
5340 return "PS4";
5342 return "PS5";
5343 default:
5344 return "unknown";
5345 }
5346}
5347
5348inline const char* EnumToString(discordpp::ErrorType value)
5349{
5350 switch (value) {
5352 return "None";
5354 return "NetworkError";
5356 return "HTTPError";
5358 return "ClientNotReady";
5360 return "Disabled";
5362 return "ClientDestroyed";
5364 return "ValidationError";
5366 return "Aborted";
5368 return "AuthorizationFailed";
5370 return "RPCError";
5371 default:
5372 return "unknown";
5373 }
5374}
5375
5377{
5378 switch (value) {
5380 return "None";
5382 return "Continue";
5384 return "SwitchingProtocols";
5386 return "Processing";
5388 return "EarlyHints";
5390 return "Ok";
5392 return "Created";
5394 return "Accepted";
5396 return "NonAuthoritativeInfo";
5398 return "NoContent";
5400 return "ResetContent";
5402 return "PartialContent";
5404 return "MultiStatus";
5406 return "AlreadyReported";
5408 return "ImUsed";
5410 return "MultipleChoices";
5412 return "MovedPermanently";
5414 return "Found";
5416 return "SeeOther";
5418 return "NotModified";
5420 return "TemporaryRedirect";
5422 return "PermanentRedirect";
5424 return "BadRequest";
5426 return "Unauthorized";
5428 return "PaymentRequired";
5430 return "Forbidden";
5432 return "NotFound";
5434 return "MethodNotAllowed";
5436 return "NotAcceptable";
5438 return "ProxyAuthRequired";
5440 return "RequestTimeout";
5442 return "Conflict";
5444 return "Gone";
5446 return "LengthRequired";
5448 return "PreconditionFailed";
5450 return "PayloadTooLarge";
5452 return "UriTooLong";
5454 return "UnsupportedMediaType";
5456 return "RangeNotSatisfiable";
5458 return "ExpectationFailed";
5460 return "MisdirectedRequest";
5462 return "UnprocessableEntity";
5464 return "Locked";
5466 return "FailedDependency";
5468 return "TooEarly";
5470 return "UpgradeRequired";
5472 return "PreconditionRequired";
5474 return "TooManyRequests";
5476 return "RequestHeaderFieldsTooLarge";
5478 return "InternalServerError";
5480 return "NotImplemented";
5482 return "BadGateway";
5484 return "ServiceUnavailable";
5486 return "GatewayTimeout";
5488 return "HttpVersionNotSupported";
5490 return "VariantAlsoNegotiates";
5492 return "InsufficientStorage";
5494 return "LoopDetected";
5496 return "NotExtended";
5498 return "NetworkAuthorizationRequired";
5499 default:
5500 return "unknown";
5501 }
5502}
5503
5505{
5506 switch (value) {
5508 return "S256";
5509 default:
5510 return "unknown";
5511 }
5512}
5513
5515{
5516 switch (value) {
5518 return "GuildInstall";
5520 return "UserInstall";
5521 default:
5522 return "unknown";
5523 }
5524}
5525
5526inline const char* EnumToString(discordpp::ChannelType value)
5527{
5528 switch (value) {
5530 return "GuildText";
5532 return "Dm";
5534 return "GuildVoice";
5536 return "GroupDm";
5538 return "GuildCategory";
5540 return "GuildNews";
5542 return "GuildStore";
5544 return "GuildNewsThread";
5546 return "GuildPublicThread";
5548 return "GuildPrivateThread";
5550 return "GuildStageVoice";
5552 return "GuildDirectory";
5554 return "GuildForum";
5556 return "GuildMedia";
5558 return "Lobby";
5560 return "EphemeralDm";
5561 default:
5562 return "unknown";
5563 }
5564}
5565
5567{
5568 switch (value) {
5570 return "Other";
5572 return "Attachment";
5574 return "Poll";
5576 return "VoiceMessage";
5578 return "Thread";
5580 return "Embed";
5582 return "Sticker";
5583 default:
5584 return "unknown";
5585 }
5586}
5587
5588inline const char* EnumToString(discordpp::AudioSystem value)
5589{
5590 switch (value) {
5592 return "Standard";
5594 return "Game";
5595 default:
5596 return "unknown";
5597 }
5598}
5599
5600inline const char* EnumToString(discordpp::Call::Error value)
5601{
5602 switch (value) {
5604 return "None";
5606 return "SignalingConnectionFailed";
5608 return "SignalingUnexpectedClose";
5610 return "VoiceConnectionFailed";
5612 return "JoinTimeout";
5614 return "Forbidden";
5615 default:
5616 return "unknown";
5617 }
5618}
5619
5621{
5622 switch (value) {
5624 return "MODE_UNINIT";
5626 return "MODE_VAD";
5628 return "MODE_PTT";
5629 default:
5630 return "unknown";
5631 }
5632}
5633
5634inline const char* EnumToString(discordpp::Call::Status value)
5635{
5636 switch (value) {
5638 return "Disconnected";
5640 return "Joining";
5642 return "Connecting";
5644 return "SignalingConnected";
5646 return "Connected";
5648 return "Reconnecting";
5650 return "Disconnecting";
5651 default:
5652 return "unknown";
5653 }
5654}
5655
5657{
5658 switch (value) {
5660 return "None";
5662 return "Friend";
5664 return "Blocked";
5666 return "PendingIncoming";
5668 return "PendingOutgoing";
5670 return "Implicit";
5672 return "Suggestion";
5673 default:
5674 return "unknown";
5675 }
5676}
5677
5679{
5680 switch (value) {
5682 return "OIDC";
5684 return "EpicOnlineServices";
5686 return "Steam";
5688 return "Unity";
5690 return "DiscordBot";
5692 return "None";
5694 return "Unknown";
5695 default:
5696 return "unknown";
5697 }
5698}
5699
5701{
5702 switch (value) {
5704 return "Gif";
5706 return "Webp";
5708 return "Png";
5710 return "Jpeg";
5711 default:
5712 return "unknown";
5713 }
5714}
5715
5716inline const char* EnumToString(discordpp::StatusType value)
5717{
5718 switch (value) {
5720 return "Online";
5722 return "Offline";
5724 return "Blocked";
5726 return "Idle";
5728 return "Dnd";
5730 return "Invisible";
5732 return "Streaming";
5734 return "Unknown";
5735 default:
5736 return "unknown";
5737 }
5738}
5739
5741{
5742 switch (value) {
5744 return "MessageDataVisibleOnDiscord";
5745 default:
5746 return "unknown";
5747 }
5748}
5749
5751{
5752 switch (value) {
5754 return "None";
5756 return "ConnectionFailed";
5758 return "UnexpectedClose";
5760 return "ConnectionCanceled";
5761 default:
5762 return "unknown";
5763 }
5764}
5765
5767{
5768 switch (value) {
5770 return "Disconnected";
5772 return "Connecting";
5774 return "Connected";
5776 return "Ready";
5778 return "Reconnecting";
5780 return "Disconnecting";
5782 return "HttpWait";
5783 default:
5784 return "unknown";
5785 }
5786}
5787
5789{
5790 switch (value) {
5792 return "Client";
5794 return "Voice";
5796 return "Network";
5797 default:
5798 return "unknown";
5799 }
5800}
5801
5803{
5804 switch (value) {
5806 return "User";
5808 return "Bearer";
5809 default:
5810 return "unknown";
5811 }
5812}
5813
5815{
5816 switch (value) {
5818 return "OIDC";
5820 return "EpicOnlineServicesAccessToken";
5822 return "EpicOnlineServicesIdToken";
5824 return "SteamSessionTicket";
5826 return "UnityServicesIdToken";
5828 return "DiscordBotIssuedAccessToken";
5830 return "AppleIdToken";
5832 return "PlayStationNetworkIdToken";
5833 default:
5834 return "unknown";
5835 }
5836}
5837
5839{
5840 switch (value) {
5842 return "Verbose";
5844 return "Info";
5846 return "Warning";
5848 return "Error";
5850 return "None";
5851 default:
5852 return "unknown";
5853 }
5854}
5855
5857{
5858 switch (value) {
5860 return "OnlinePlayingGame";
5862 return "OnlineElsewhere";
5864 return "Offline";
5865 default:
5866 return "unknown";
5867 }
5868}
5869} // namespace discordpp
5870#endif // DISCORD_HEADER_DISCORDPP_H_
5871#ifdef DISCORDPP_IMPLEMENTATION
5872#undef DISCORDPP_IMPLEMENTATION
5873#ifdef __clang__
5874#pragma clang diagnostic push
5875#pragma clang diagnostic ignored "-Wunused-parameter"
5876#endif
5877namespace discordpp {
5878std::function<void(std::function<void()>)> s_synchronizationContext;
5879
5880inline bool HasSynchronizationContext()
5881{
5882 return !!s_synchronizationContext;
5883}
5884
5885inline void PostTask(std::function<void()> task)
5886{
5887 assert(s_synchronizationContext);
5888 s_synchronizationContext(std::move(task));
5889}
5890
5891void SetSynchronizationContext(std::function<void(std::function<void()>)> executor)
5892{
5893 s_synchronizationContext = std::move(executor);
5894}
5895
5896template <typename T>
5897struct TDelegateUserData {
5898 T delegate;
5899 TDelegateUserData(T delegate)
5900 : delegate{delegate}
5901 {
5902 }
5903
5904 static void Free(void* ptr) { delete reinterpret_cast<TDelegateUserData*>(ptr); }
5905
5906 static T& Get(void* userData)
5907 {
5908 return reinterpret_cast<TDelegateUserData*>(userData)->delegate;
5909 }
5910};
5911
5912struct ConvertedProperties {
5913 ConvertedProperties(std::unordered_map<std::string, std::string> const& PropertyMap)
5914 {
5915 Properties.size = PropertyMap.size();
5916 Properties.keys = reinterpret_cast<Discord_String*>(
5917 Discord_Alloc(Properties.size * sizeof(Discord_String)));
5918 Properties.values = reinterpret_cast<Discord_String*>(
5919 Discord_Alloc(Properties.size * sizeof(Discord_String)));
5920 size_t i = 0;
5921 for (auto& pair : PropertyMap) {
5922 Properties.keys[i] = AllocateString(pair.first);
5923 Properties.values[i] = AllocateString(pair.second);
5924 ++i;
5925 }
5926 }
5927 ~ConvertedProperties() { Discord_FreeProperties(Properties); }
5928 Discord_Properties Properties{};
5929
5930private:
5931 Discord_String AllocateString(std::string const& str)
5932 {
5933 Discord_String result;
5934 result.ptr = reinterpret_cast<uint8_t*>(Discord_Alloc(str.size()));
5935 result.size = str.size();
5936 std::memcpy(result.ptr, str.data(), result.size);
5937 return result;
5938 }
5939};
5940
5941std::unordered_map<std::string, std::string> ConvertReturnedProperties(
5942 Discord_Properties const& Properties)
5943{
5944 std::unordered_map<std::string, std::string> result;
5945 for (size_t i = 0; i < Properties.size; ++i) {
5946 std::string key(reinterpret_cast<char*>(Properties.keys[i].ptr), Properties.keys[i].size);
5947 std::string value(reinterpret_cast<char*>(Properties.values[i].ptr),
5948 Properties.values[i].size);
5949 result.emplace(std::move(key), std::move(value));
5950 }
5951 return result;
5952}
5954ActivityInvite::~ActivityInvite()
5955{
5956 if (state_ == DiscordObjectState::Owned) {
5957 Drop();
5959 }
5960}
5962 : instance_(other.instance_)
5963 , state_(other.state_)
5964{
5965 other.state_ = DiscordObjectState::Invalid;
5966}
5968{
5969 if (this != &other) {
5970 if (state_ == DiscordObjectState::Owned) {
5971 Drop();
5972 }
5973 instance_ = other.instance_;
5974 state_ = other.state_;
5975 other.state_ = DiscordObjectState::Invalid;
5976 }
5977 return *this;
5978}
5980 : instance_{}
5981 , state_(DiscordObjectState::Invalid)
5982{
5983 if (rhs.state_ == DiscordObjectState::Owned) {
5984 Discord_ActivityInvite_Clone(&instance_, rhs.instance());
5985
5986 state_ = DiscordObjectState::Owned;
5987 }
5988}
5989ActivityInvite& ActivityInvite::operator=(const ActivityInvite& rhs)
5990{
5991 if (this != &rhs) {
5992 if (state_ == DiscordObjectState::Owned) {
5993 Drop();
5994 state_ = DiscordObjectState::Invalid;
5995 }
5996 if (rhs.state_ == DiscordObjectState::Owned) {
5997 Discord_ActivityInvite_Clone(&instance_, rhs.instance());
5998
5999 state_ = DiscordObjectState::Owned;
6000 }
6001 }
6002 return *this;
6003}
6004ActivityInvite::ActivityInvite(Discord_ActivityInvite instance, DiscordObjectState state)
6005 : instance_(instance)
6006 , state_(state)
6007{
6008}
6009ActivityInvite::ActivityInvite()
6010{
6011 assert(state_ == DiscordObjectState::Invalid);
6012 Discord_ActivityInvite_Init(&instance_);
6013 state_ = DiscordObjectState::Owned;
6014}
6015void ActivityInvite::Drop()
6016{
6017 if (state_ != DiscordObjectState::Owned) {
6018 return;
6019 }
6020 Discord_ActivityInvite_Drop(&instance_);
6021 state_ = DiscordObjectState::Invalid;
6022}
6023uint64_t ActivityInvite::SenderId() const
6024{
6025 assert(state_ == DiscordObjectState::Owned);
6026 uint64_t returnValue__;
6027 returnValue__ = Discord_ActivityInvite_SenderId(&instance_);
6028 return returnValue__;
6029}
6030void ActivityInvite::SetSenderId(uint64_t SenderId)
6031{
6032 assert(state_ == DiscordObjectState::Owned);
6033 Discord_ActivityInvite_SetSenderId(&instance_, SenderId);
6034}
6035uint64_t ActivityInvite::ChannelId() const
6036{
6037 assert(state_ == DiscordObjectState::Owned);
6038 uint64_t returnValue__;
6039 returnValue__ = Discord_ActivityInvite_ChannelId(&instance_);
6040 return returnValue__;
6041}
6042void ActivityInvite::SetChannelId(uint64_t ChannelId)
6043{
6044 assert(state_ == DiscordObjectState::Owned);
6045 Discord_ActivityInvite_SetChannelId(&instance_, ChannelId);
6046}
6047uint64_t ActivityInvite::MessageId() const
6048{
6049 assert(state_ == DiscordObjectState::Owned);
6050 uint64_t returnValue__;
6051 returnValue__ = Discord_ActivityInvite_MessageId(&instance_);
6052 return returnValue__;
6053}
6054void ActivityInvite::SetMessageId(uint64_t MessageId)
6055{
6056 assert(state_ == DiscordObjectState::Owned);
6057 Discord_ActivityInvite_SetMessageId(&instance_, MessageId);
6058}
6059discordpp::ActivityActionTypes ActivityInvite::Type() const
6060{
6061 assert(state_ == DiscordObjectState::Owned);
6062 Discord_ActivityActionTypes returnValue__;
6063 returnValue__ = Discord_ActivityInvite_Type(&instance_);
6064 return static_cast<discordpp::ActivityActionTypes>(returnValue__);
6065}
6066void ActivityInvite::SetType(discordpp::ActivityActionTypes Type)
6067{
6068 assert(state_ == DiscordObjectState::Owned);
6069 Discord_ActivityInvite_SetType(&instance_, static_cast<Discord_ActivityActionTypes>(Type));
6070}
6071uint64_t ActivityInvite::ApplicationId() const
6072{
6073 assert(state_ == DiscordObjectState::Owned);
6074 uint64_t returnValue__;
6075 returnValue__ = Discord_ActivityInvite_ApplicationId(&instance_);
6076 return returnValue__;
6077}
6078void ActivityInvite::SetApplicationId(uint64_t ApplicationId)
6079{
6080 assert(state_ == DiscordObjectState::Owned);
6081 Discord_ActivityInvite_SetApplicationId(&instance_, ApplicationId);
6082}
6083uint64_t ActivityInvite::ParentApplicationId() const
6084{
6085 assert(state_ == DiscordObjectState::Owned);
6086 uint64_t returnValue__;
6087 returnValue__ = Discord_ActivityInvite_ParentApplicationId(&instance_);
6088 return returnValue__;
6089}
6090void ActivityInvite::SetParentApplicationId(uint64_t ParentApplicationId)
6091{
6092 assert(state_ == DiscordObjectState::Owned);
6093 Discord_ActivityInvite_SetParentApplicationId(&instance_, ParentApplicationId);
6094}
6095std::string ActivityInvite::PartyId() const
6096{
6097 assert(state_ == DiscordObjectState::Owned);
6098 Discord_String returnValueNative__;
6099 Discord_ActivityInvite_PartyId(&instance_, &returnValueNative__);
6100 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
6101 returnValueNative__.size);
6102 Discord_Free(returnValueNative__.ptr);
6103 return returnValue__;
6104}
6105void ActivityInvite::SetPartyId(std::string PartyId)
6106{
6107 assert(state_ == DiscordObjectState::Owned);
6108 Discord_String PartyId__str{(uint8_t*)(PartyId.data()), PartyId.size()};
6109 Discord_ActivityInvite_SetPartyId(&instance_, PartyId__str);
6110}
6111std::string ActivityInvite::SessionId() const
6112{
6113 assert(state_ == DiscordObjectState::Owned);
6114 Discord_String returnValueNative__;
6115 Discord_ActivityInvite_SessionId(&instance_, &returnValueNative__);
6116 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
6117 returnValueNative__.size);
6118 Discord_Free(returnValueNative__.ptr);
6119 return returnValue__;
6120}
6121void ActivityInvite::SetSessionId(std::string SessionId)
6122{
6123 assert(state_ == DiscordObjectState::Owned);
6124 Discord_String SessionId__str{(uint8_t*)(SessionId.data()), SessionId.size()};
6125 Discord_ActivityInvite_SetSessionId(&instance_, SessionId__str);
6126}
6127bool ActivityInvite::IsValid() const
6128{
6129 assert(state_ == DiscordObjectState::Owned);
6130 bool returnValue__;
6131 returnValue__ = Discord_ActivityInvite_IsValid(&instance_);
6132 return returnValue__;
6133}
6134void ActivityInvite::SetIsValid(bool IsValid)
6135{
6136 assert(state_ == DiscordObjectState::Owned);
6137 Discord_ActivityInvite_SetIsValid(&instance_, IsValid);
6138}
6139const ActivityAssets ActivityAssets::nullobj{{}, DiscordObjectState::Invalid};
6140ActivityAssets::~ActivityAssets()
6141{
6142 if (state_ == DiscordObjectState::Owned) {
6143 Drop();
6144 state_ = DiscordObjectState::Invalid;
6145 }
6146}
6147ActivityAssets::ActivityAssets(ActivityAssets&& other) noexcept
6148 : instance_(other.instance_)
6149 , state_(other.state_)
6150{
6151 other.state_ = DiscordObjectState::Invalid;
6152}
6153ActivityAssets& ActivityAssets::operator=(ActivityAssets&& other) noexcept
6154{
6155 if (this != &other) {
6156 if (state_ == DiscordObjectState::Owned) {
6157 Drop();
6158 }
6159 instance_ = other.instance_;
6160 state_ = other.state_;
6161 other.state_ = DiscordObjectState::Invalid;
6162 }
6163 return *this;
6164}
6165ActivityAssets::ActivityAssets(const ActivityAssets& arg0)
6166 : instance_{}
6167 , state_(DiscordObjectState::Invalid)
6168{
6169 if (arg0.state_ == DiscordObjectState::Owned) {
6170 Discord_ActivityAssets_Clone(&instance_, arg0.instance());
6171
6172 state_ = DiscordObjectState::Owned;
6173 }
6174}
6175ActivityAssets& ActivityAssets::operator=(const ActivityAssets& arg0)
6176{
6177 if (this != &arg0) {
6178 if (state_ == DiscordObjectState::Owned) {
6179 Drop();
6180 state_ = DiscordObjectState::Invalid;
6181 }
6182 if (arg0.state_ == DiscordObjectState::Owned) {
6183 Discord_ActivityAssets_Clone(&instance_, arg0.instance());
6184
6185 state_ = DiscordObjectState::Owned;
6186 }
6187 }
6188 return *this;
6189}
6190ActivityAssets::ActivityAssets(Discord_ActivityAssets instance, DiscordObjectState state)
6191 : instance_(instance)
6192 , state_(state)
6193{
6194}
6195ActivityAssets::ActivityAssets()
6196{
6197 assert(state_ == DiscordObjectState::Invalid);
6198 Discord_ActivityAssets_Init(&instance_);
6199 state_ = DiscordObjectState::Owned;
6200}
6201void ActivityAssets::Drop()
6202{
6203 if (state_ != DiscordObjectState::Owned) {
6204 return;
6205 }
6206 Discord_ActivityAssets_Drop(&instance_);
6207 state_ = DiscordObjectState::Invalid;
6208}
6209std::optional<std::string> ActivityAssets::LargeImage() const
6210{
6211 assert(state_ == DiscordObjectState::Owned);
6212 bool returnIsNonNull__;
6213 Discord_String returnValueNative__;
6214 returnIsNonNull__ = Discord_ActivityAssets_LargeImage(&instance_, &returnValueNative__);
6215 if (!returnIsNonNull__) {
6216 return {};
6217 }
6218 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
6219 returnValueNative__.size);
6220 Discord_Free(returnValueNative__.ptr);
6221 return returnValue__;
6222}
6223void ActivityAssets::SetLargeImage(std::optional<std::string> LargeImage)
6224{
6225 assert(state_ == DiscordObjectState::Owned);
6226 Discord_String LargeImage__str{};
6227 if (LargeImage.has_value()) {
6228 LargeImage__str.ptr = reinterpret_cast<uint8_t*>(LargeImage->data());
6229 LargeImage__str.size = LargeImage->size();
6230 }
6231 Discord_ActivityAssets_SetLargeImage(&instance_,
6232 (LargeImage.has_value() ? &LargeImage__str : nullptr));
6233}
6234std::optional<std::string> ActivityAssets::LargeText() const
6235{
6236 assert(state_ == DiscordObjectState::Owned);
6237 bool returnIsNonNull__;
6238 Discord_String returnValueNative__;
6239 returnIsNonNull__ = Discord_ActivityAssets_LargeText(&instance_, &returnValueNative__);
6240 if (!returnIsNonNull__) {
6241 return {};
6242 }
6243 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
6244 returnValueNative__.size);
6245 Discord_Free(returnValueNative__.ptr);
6246 return returnValue__;
6247}
6248void ActivityAssets::SetLargeText(std::optional<std::string> LargeText)
6249{
6250 assert(state_ == DiscordObjectState::Owned);
6251 Discord_String LargeText__str{};
6252 if (LargeText.has_value()) {
6253 LargeText__str.ptr = reinterpret_cast<uint8_t*>(LargeText->data());
6254 LargeText__str.size = LargeText->size();
6255 }
6256 Discord_ActivityAssets_SetLargeText(&instance_,
6257 (LargeText.has_value() ? &LargeText__str : nullptr));
6258}
6259std::optional<std::string> ActivityAssets::LargeUrl() const
6260{
6261 assert(state_ == DiscordObjectState::Owned);
6262 bool returnIsNonNull__;
6263 Discord_String returnValueNative__;
6264 returnIsNonNull__ = Discord_ActivityAssets_LargeUrl(&instance_, &returnValueNative__);
6265 if (!returnIsNonNull__) {
6266 return {};
6267 }
6268 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
6269 returnValueNative__.size);
6270 Discord_Free(returnValueNative__.ptr);
6271 return returnValue__;
6272}
6273void ActivityAssets::SetLargeUrl(std::optional<std::string> LargeUrl)
6274{
6275 assert(state_ == DiscordObjectState::Owned);
6276 Discord_String LargeUrl__str{};
6277 if (LargeUrl.has_value()) {
6278 LargeUrl__str.ptr = reinterpret_cast<uint8_t*>(LargeUrl->data());
6279 LargeUrl__str.size = LargeUrl->size();
6280 }
6281 Discord_ActivityAssets_SetLargeUrl(&instance_,
6282 (LargeUrl.has_value() ? &LargeUrl__str : nullptr));
6283}
6284std::optional<std::string> ActivityAssets::SmallImage() const
6285{
6286 assert(state_ == DiscordObjectState::Owned);
6287 bool returnIsNonNull__;
6288 Discord_String returnValueNative__;
6289 returnIsNonNull__ = Discord_ActivityAssets_SmallImage(&instance_, &returnValueNative__);
6290 if (!returnIsNonNull__) {
6291 return {};
6292 }
6293 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
6294 returnValueNative__.size);
6295 Discord_Free(returnValueNative__.ptr);
6296 return returnValue__;
6297}
6298void ActivityAssets::SetSmallImage(std::optional<std::string> SmallImage)
6299{
6300 assert(state_ == DiscordObjectState::Owned);
6301 Discord_String SmallImage__str{};
6302 if (SmallImage.has_value()) {
6303 SmallImage__str.ptr = reinterpret_cast<uint8_t*>(SmallImage->data());
6304 SmallImage__str.size = SmallImage->size();
6305 }
6306 Discord_ActivityAssets_SetSmallImage(&instance_,
6307 (SmallImage.has_value() ? &SmallImage__str : nullptr));
6308}
6309std::optional<std::string> ActivityAssets::SmallText() const
6310{
6311 assert(state_ == DiscordObjectState::Owned);
6312 bool returnIsNonNull__;
6313 Discord_String returnValueNative__;
6314 returnIsNonNull__ = Discord_ActivityAssets_SmallText(&instance_, &returnValueNative__);
6315 if (!returnIsNonNull__) {
6316 return {};
6317 }
6318 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
6319 returnValueNative__.size);
6320 Discord_Free(returnValueNative__.ptr);
6321 return returnValue__;
6322}
6323void ActivityAssets::SetSmallText(std::optional<std::string> SmallText)
6324{
6325 assert(state_ == DiscordObjectState::Owned);
6326 Discord_String SmallText__str{};
6327 if (SmallText.has_value()) {
6328 SmallText__str.ptr = reinterpret_cast<uint8_t*>(SmallText->data());
6329 SmallText__str.size = SmallText->size();
6330 }
6331 Discord_ActivityAssets_SetSmallText(&instance_,
6332 (SmallText.has_value() ? &SmallText__str : nullptr));
6333}
6334std::optional<std::string> ActivityAssets::SmallUrl() const
6335{
6336 assert(state_ == DiscordObjectState::Owned);
6337 bool returnIsNonNull__;
6338 Discord_String returnValueNative__;
6339 returnIsNonNull__ = Discord_ActivityAssets_SmallUrl(&instance_, &returnValueNative__);
6340 if (!returnIsNonNull__) {
6341 return {};
6342 }
6343 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
6344 returnValueNative__.size);
6345 Discord_Free(returnValueNative__.ptr);
6346 return returnValue__;
6347}
6348void ActivityAssets::SetSmallUrl(std::optional<std::string> SmallUrl)
6349{
6350 assert(state_ == DiscordObjectState::Owned);
6351 Discord_String SmallUrl__str{};
6352 if (SmallUrl.has_value()) {
6353 SmallUrl__str.ptr = reinterpret_cast<uint8_t*>(SmallUrl->data());
6354 SmallUrl__str.size = SmallUrl->size();
6355 }
6356 Discord_ActivityAssets_SetSmallUrl(&instance_,
6357 (SmallUrl.has_value() ? &SmallUrl__str : nullptr));
6358}
6359std::optional<std::string> ActivityAssets::InviteCoverImage() const
6360{
6361 assert(state_ == DiscordObjectState::Owned);
6362 bool returnIsNonNull__;
6363 Discord_String returnValueNative__;
6364 returnIsNonNull__ = Discord_ActivityAssets_InviteCoverImage(&instance_, &returnValueNative__);
6365 if (!returnIsNonNull__) {
6366 return {};
6367 }
6368 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
6369 returnValueNative__.size);
6370 Discord_Free(returnValueNative__.ptr);
6371 return returnValue__;
6372}
6373void ActivityAssets::SetInviteCoverImage(std::optional<std::string> InviteCoverImage)
6374{
6375 assert(state_ == DiscordObjectState::Owned);
6376 Discord_String InviteCoverImage__str{};
6377 if (InviteCoverImage.has_value()) {
6378 InviteCoverImage__str.ptr = reinterpret_cast<uint8_t*>(InviteCoverImage->data());
6379 InviteCoverImage__str.size = InviteCoverImage->size();
6380 }
6381 Discord_ActivityAssets_SetInviteCoverImage(
6382 &instance_, (InviteCoverImage.has_value() ? &InviteCoverImage__str : nullptr));
6383}
6384const ActivityTimestamps ActivityTimestamps::nullobj{{}, DiscordObjectState::Invalid};
6385ActivityTimestamps::~ActivityTimestamps()
6386{
6387 if (state_ == DiscordObjectState::Owned) {
6388 Drop();
6389 state_ = DiscordObjectState::Invalid;
6390 }
6391}
6392ActivityTimestamps::ActivityTimestamps(ActivityTimestamps&& other) noexcept
6393 : instance_(other.instance_)
6394 , state_(other.state_)
6395{
6396 other.state_ = DiscordObjectState::Invalid;
6397}
6398ActivityTimestamps& ActivityTimestamps::operator=(ActivityTimestamps&& other) noexcept
6399{
6400 if (this != &other) {
6401 if (state_ == DiscordObjectState::Owned) {
6402 Drop();
6403 }
6404 instance_ = other.instance_;
6405 state_ = other.state_;
6406 other.state_ = DiscordObjectState::Invalid;
6407 }
6408 return *this;
6409}
6410ActivityTimestamps::ActivityTimestamps(const ActivityTimestamps& arg0)
6411 : instance_{}
6412 , state_(DiscordObjectState::Invalid)
6413{
6414 if (arg0.state_ == DiscordObjectState::Owned) {
6415 Discord_ActivityTimestamps_Clone(&instance_, arg0.instance());
6416
6417 state_ = DiscordObjectState::Owned;
6418 }
6419}
6420ActivityTimestamps& ActivityTimestamps::operator=(const ActivityTimestamps& arg0)
6421{
6422 if (this != &arg0) {
6423 if (state_ == DiscordObjectState::Owned) {
6424 Drop();
6425 state_ = DiscordObjectState::Invalid;
6426 }
6427 if (arg0.state_ == DiscordObjectState::Owned) {
6428 Discord_ActivityTimestamps_Clone(&instance_, arg0.instance());
6429
6430 state_ = DiscordObjectState::Owned;
6431 }
6432 }
6433 return *this;
6434}
6435ActivityTimestamps::ActivityTimestamps(Discord_ActivityTimestamps instance,
6436 DiscordObjectState state)
6437 : instance_(instance)
6438 , state_(state)
6439{
6440}
6441ActivityTimestamps::ActivityTimestamps()
6442{
6443 assert(state_ == DiscordObjectState::Invalid);
6444 Discord_ActivityTimestamps_Init(&instance_);
6445 state_ = DiscordObjectState::Owned;
6446}
6447void ActivityTimestamps::Drop()
6448{
6449 if (state_ != DiscordObjectState::Owned) {
6450 return;
6451 }
6452 Discord_ActivityTimestamps_Drop(&instance_);
6453 state_ = DiscordObjectState::Invalid;
6454}
6455uint64_t ActivityTimestamps::Start() const
6456{
6457 assert(state_ == DiscordObjectState::Owned);
6458 uint64_t returnValue__;
6459 returnValue__ = Discord_ActivityTimestamps_Start(&instance_);
6460 return returnValue__;
6461}
6462void ActivityTimestamps::SetStart(uint64_t Start)
6463{
6464 assert(state_ == DiscordObjectState::Owned);
6465 Discord_ActivityTimestamps_SetStart(&instance_, Start);
6466}
6467uint64_t ActivityTimestamps::End() const
6468{
6469 assert(state_ == DiscordObjectState::Owned);
6470 uint64_t returnValue__;
6471 returnValue__ = Discord_ActivityTimestamps_End(&instance_);
6472 return returnValue__;
6473}
6474void ActivityTimestamps::SetEnd(uint64_t End)
6475{
6476 assert(state_ == DiscordObjectState::Owned);
6477 Discord_ActivityTimestamps_SetEnd(&instance_, End);
6478}
6479const ActivityParty ActivityParty::nullobj{{}, DiscordObjectState::Invalid};
6480ActivityParty::~ActivityParty()
6481{
6482 if (state_ == DiscordObjectState::Owned) {
6483 Drop();
6484 state_ = DiscordObjectState::Invalid;
6485 }
6486}
6487ActivityParty::ActivityParty(ActivityParty&& other) noexcept
6488 : instance_(other.instance_)
6489 , state_(other.state_)
6490{
6491 other.state_ = DiscordObjectState::Invalid;
6492}
6493ActivityParty& ActivityParty::operator=(ActivityParty&& other) noexcept
6494{
6495 if (this != &other) {
6496 if (state_ == DiscordObjectState::Owned) {
6497 Drop();
6498 }
6499 instance_ = other.instance_;
6500 state_ = other.state_;
6501 other.state_ = DiscordObjectState::Invalid;
6502 }
6503 return *this;
6504}
6505ActivityParty::ActivityParty(const ActivityParty& arg0)
6506 : instance_{}
6507 , state_(DiscordObjectState::Invalid)
6508{
6509 if (arg0.state_ == DiscordObjectState::Owned) {
6510 Discord_ActivityParty_Clone(&instance_, arg0.instance());
6511
6512 state_ = DiscordObjectState::Owned;
6513 }
6514}
6515ActivityParty& ActivityParty::operator=(const ActivityParty& arg0)
6516{
6517 if (this != &arg0) {
6518 if (state_ == DiscordObjectState::Owned) {
6519 Drop();
6520 state_ = DiscordObjectState::Invalid;
6521 }
6522 if (arg0.state_ == DiscordObjectState::Owned) {
6523 Discord_ActivityParty_Clone(&instance_, arg0.instance());
6524
6525 state_ = DiscordObjectState::Owned;
6526 }
6527 }
6528 return *this;
6529}
6530ActivityParty::ActivityParty(Discord_ActivityParty instance, DiscordObjectState state)
6531 : instance_(instance)
6532 , state_(state)
6533{
6534}
6535ActivityParty::ActivityParty()
6536{
6537 assert(state_ == DiscordObjectState::Invalid);
6538 Discord_ActivityParty_Init(&instance_);
6539 state_ = DiscordObjectState::Owned;
6540}
6541void ActivityParty::Drop()
6542{
6543 if (state_ != DiscordObjectState::Owned) {
6544 return;
6545 }
6546 Discord_ActivityParty_Drop(&instance_);
6547 state_ = DiscordObjectState::Invalid;
6548}
6549std::string ActivityParty::Id() const
6550{
6551 assert(state_ == DiscordObjectState::Owned);
6552 Discord_String returnValueNative__;
6553 Discord_ActivityParty_Id(&instance_, &returnValueNative__);
6554 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
6555 returnValueNative__.size);
6556 Discord_Free(returnValueNative__.ptr);
6557 return returnValue__;
6558}
6559void ActivityParty::SetId(std::string Id)
6560{
6561 assert(state_ == DiscordObjectState::Owned);
6562 Discord_String Id__str{(uint8_t*)(Id.data()), Id.size()};
6563 Discord_ActivityParty_SetId(&instance_, Id__str);
6564}
6565int32_t ActivityParty::CurrentSize() const
6566{
6567 assert(state_ == DiscordObjectState::Owned);
6568 int32_t returnValue__;
6569 returnValue__ = Discord_ActivityParty_CurrentSize(&instance_);
6570 return returnValue__;
6571}
6572void ActivityParty::SetCurrentSize(int32_t CurrentSize)
6573{
6574 assert(state_ == DiscordObjectState::Owned);
6575 Discord_ActivityParty_SetCurrentSize(&instance_, CurrentSize);
6576}
6577int32_t ActivityParty::MaxSize() const
6578{
6579 assert(state_ == DiscordObjectState::Owned);
6580 int32_t returnValue__;
6581 returnValue__ = Discord_ActivityParty_MaxSize(&instance_);
6582 return returnValue__;
6583}
6584void ActivityParty::SetMaxSize(int32_t MaxSize)
6585{
6586 assert(state_ == DiscordObjectState::Owned);
6587 Discord_ActivityParty_SetMaxSize(&instance_, MaxSize);
6588}
6589discordpp::ActivityPartyPrivacy ActivityParty::Privacy() const
6590{
6591 assert(state_ == DiscordObjectState::Owned);
6592 Discord_ActivityPartyPrivacy returnValue__;
6593 returnValue__ = Discord_ActivityParty_Privacy(&instance_);
6594 return static_cast<discordpp::ActivityPartyPrivacy>(returnValue__);
6595}
6596void ActivityParty::SetPrivacy(discordpp::ActivityPartyPrivacy Privacy)
6597{
6598 assert(state_ == DiscordObjectState::Owned);
6599 Discord_ActivityParty_SetPrivacy(&instance_,
6600 static_cast<Discord_ActivityPartyPrivacy>(Privacy));
6601}
6602const ActivitySecrets ActivitySecrets::nullobj{{}, DiscordObjectState::Invalid};
6603ActivitySecrets::~ActivitySecrets()
6604{
6605 if (state_ == DiscordObjectState::Owned) {
6606 Drop();
6607 state_ = DiscordObjectState::Invalid;
6608 }
6609}
6610ActivitySecrets::ActivitySecrets(ActivitySecrets&& other) noexcept
6611 : instance_(other.instance_)
6612 , state_(other.state_)
6613{
6614 other.state_ = DiscordObjectState::Invalid;
6615}
6616ActivitySecrets& ActivitySecrets::operator=(ActivitySecrets&& other) noexcept
6617{
6618 if (this != &other) {
6619 if (state_ == DiscordObjectState::Owned) {
6620 Drop();
6621 }
6622 instance_ = other.instance_;
6623 state_ = other.state_;
6624 other.state_ = DiscordObjectState::Invalid;
6625 }
6626 return *this;
6627}
6628ActivitySecrets::ActivitySecrets(const ActivitySecrets& arg0)
6629 : instance_{}
6630 , state_(DiscordObjectState::Invalid)
6631{
6632 if (arg0.state_ == DiscordObjectState::Owned) {
6633 Discord_ActivitySecrets_Clone(&instance_, arg0.instance());
6634
6635 state_ = DiscordObjectState::Owned;
6636 }
6637}
6638ActivitySecrets& ActivitySecrets::operator=(const ActivitySecrets& arg0)
6639{
6640 if (this != &arg0) {
6641 if (state_ == DiscordObjectState::Owned) {
6642 Drop();
6643 state_ = DiscordObjectState::Invalid;
6644 }
6645 if (arg0.state_ == DiscordObjectState::Owned) {
6646 Discord_ActivitySecrets_Clone(&instance_, arg0.instance());
6647
6648 state_ = DiscordObjectState::Owned;
6649 }
6650 }
6651 return *this;
6652}
6653ActivitySecrets::ActivitySecrets(Discord_ActivitySecrets instance, DiscordObjectState state)
6654 : instance_(instance)
6655 , state_(state)
6656{
6657}
6658ActivitySecrets::ActivitySecrets()
6659{
6660 assert(state_ == DiscordObjectState::Invalid);
6661 Discord_ActivitySecrets_Init(&instance_);
6662 state_ = DiscordObjectState::Owned;
6663}
6664void ActivitySecrets::Drop()
6665{
6666 if (state_ != DiscordObjectState::Owned) {
6667 return;
6668 }
6669 Discord_ActivitySecrets_Drop(&instance_);
6670 state_ = DiscordObjectState::Invalid;
6671}
6672std::string ActivitySecrets::Join() const
6673{
6674 assert(state_ == DiscordObjectState::Owned);
6675 Discord_String returnValueNative__;
6676 Discord_ActivitySecrets_Join(&instance_, &returnValueNative__);
6677 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
6678 returnValueNative__.size);
6679 Discord_Free(returnValueNative__.ptr);
6680 return returnValue__;
6681}
6682void ActivitySecrets::SetJoin(std::string Join)
6683{
6684 assert(state_ == DiscordObjectState::Owned);
6685 Discord_String Join__str{(uint8_t*)(Join.data()), Join.size()};
6686 Discord_ActivitySecrets_SetJoin(&instance_, Join__str);
6687}
6688const ActivityButton ActivityButton::nullobj{{}, DiscordObjectState::Invalid};
6689ActivityButton::~ActivityButton()
6690{
6691 if (state_ == DiscordObjectState::Owned) {
6692 Drop();
6693 state_ = DiscordObjectState::Invalid;
6694 }
6695}
6696ActivityButton::ActivityButton(ActivityButton&& other) noexcept
6697 : instance_(other.instance_)
6698 , state_(other.state_)
6699{
6700 other.state_ = DiscordObjectState::Invalid;
6701}
6702ActivityButton& ActivityButton::operator=(ActivityButton&& other) noexcept
6703{
6704 if (this != &other) {
6705 if (state_ == DiscordObjectState::Owned) {
6706 Drop();
6707 }
6708 instance_ = other.instance_;
6709 state_ = other.state_;
6710 other.state_ = DiscordObjectState::Invalid;
6711 }
6712 return *this;
6713}
6714ActivityButton::ActivityButton(const ActivityButton& arg0)
6715 : instance_{}
6716 , state_(DiscordObjectState::Invalid)
6717{
6718 if (arg0.state_ == DiscordObjectState::Owned) {
6719 Discord_ActivityButton_Clone(&instance_, arg0.instance());
6720
6721 state_ = DiscordObjectState::Owned;
6722 }
6723}
6724ActivityButton& ActivityButton::operator=(const ActivityButton& arg0)
6725{
6726 if (this != &arg0) {
6727 if (state_ == DiscordObjectState::Owned) {
6728 Drop();
6729 state_ = DiscordObjectState::Invalid;
6730 }
6731 if (arg0.state_ == DiscordObjectState::Owned) {
6732 Discord_ActivityButton_Clone(&instance_, arg0.instance());
6733
6734 state_ = DiscordObjectState::Owned;
6735 }
6736 }
6737 return *this;
6738}
6739ActivityButton::ActivityButton(Discord_ActivityButton instance, DiscordObjectState state)
6740 : instance_(instance)
6741 , state_(state)
6742{
6743}
6744ActivityButton::ActivityButton()
6745{
6746 assert(state_ == DiscordObjectState::Invalid);
6747 Discord_ActivityButton_Init(&instance_);
6748 state_ = DiscordObjectState::Owned;
6749}
6750void ActivityButton::Drop()
6751{
6752 if (state_ != DiscordObjectState::Owned) {
6753 return;
6754 }
6755 Discord_ActivityButton_Drop(&instance_);
6756 state_ = DiscordObjectState::Invalid;
6757}
6758std::string ActivityButton::Label() const
6759{
6760 assert(state_ == DiscordObjectState::Owned);
6761 Discord_String returnValueNative__;
6762 Discord_ActivityButton_Label(&instance_, &returnValueNative__);
6763 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
6764 returnValueNative__.size);
6765 Discord_Free(returnValueNative__.ptr);
6766 return returnValue__;
6767}
6768void ActivityButton::SetLabel(std::string Label)
6769{
6770 assert(state_ == DiscordObjectState::Owned);
6771 Discord_String Label__str{(uint8_t*)(Label.data()), Label.size()};
6772 Discord_ActivityButton_SetLabel(&instance_, Label__str);
6773}
6774std::string ActivityButton::Url() const
6775{
6776 assert(state_ == DiscordObjectState::Owned);
6777 Discord_String returnValueNative__;
6778 Discord_ActivityButton_Url(&instance_, &returnValueNative__);
6779 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
6780 returnValueNative__.size);
6781 Discord_Free(returnValueNative__.ptr);
6782 return returnValue__;
6783}
6784void ActivityButton::SetUrl(std::string Url)
6785{
6786 assert(state_ == DiscordObjectState::Owned);
6787 Discord_String Url__str{(uint8_t*)(Url.data()), Url.size()};
6788 Discord_ActivityButton_SetUrl(&instance_, Url__str);
6789}
6790const Activity Activity::nullobj{{}, DiscordObjectState::Invalid};
6791Activity::~Activity()
6792{
6793 if (state_ == DiscordObjectState::Owned) {
6794 Drop();
6795 state_ = DiscordObjectState::Invalid;
6796 }
6797}
6798Activity::Activity(Activity&& other) noexcept
6799 : instance_(other.instance_)
6800 , state_(other.state_)
6801{
6802 other.state_ = DiscordObjectState::Invalid;
6803}
6804Activity& Activity::operator=(Activity&& other) noexcept
6805{
6806 if (this != &other) {
6807 if (state_ == DiscordObjectState::Owned) {
6808 Drop();
6809 }
6810 instance_ = other.instance_;
6811 state_ = other.state_;
6812 other.state_ = DiscordObjectState::Invalid;
6813 }
6814 return *this;
6815}
6816Activity::Activity(const Activity& arg0)
6817 : instance_{}
6818 , state_(DiscordObjectState::Invalid)
6819{
6820 if (arg0.state_ == DiscordObjectState::Owned) {
6821 Discord_Activity_Clone(&instance_, arg0.instance());
6822
6823 state_ = DiscordObjectState::Owned;
6824 }
6825}
6826Activity& Activity::operator=(const Activity& arg0)
6827{
6828 if (this != &arg0) {
6829 if (state_ == DiscordObjectState::Owned) {
6830 Drop();
6831 state_ = DiscordObjectState::Invalid;
6832 }
6833 if (arg0.state_ == DiscordObjectState::Owned) {
6834 Discord_Activity_Clone(&instance_, arg0.instance());
6835
6836 state_ = DiscordObjectState::Owned;
6837 }
6838 }
6839 return *this;
6840}
6841Activity::Activity(Discord_Activity instance, DiscordObjectState state)
6842 : instance_(instance)
6843 , state_(state)
6844{
6845}
6846Activity::Activity()
6847{
6848 assert(state_ == DiscordObjectState::Invalid);
6849 Discord_Activity_Init(&instance_);
6850 state_ = DiscordObjectState::Owned;
6851}
6852void Activity::Drop()
6853{
6854 if (state_ != DiscordObjectState::Owned) {
6855 return;
6856 }
6857 Discord_Activity_Drop(&instance_);
6858 state_ = DiscordObjectState::Invalid;
6859}
6860void Activity::AddButton(discordpp::ActivityButton button)
6861{
6862 assert(state_ == DiscordObjectState::Owned);
6863 Discord_Activity_AddButton(&instance_, button.instance());
6864}
6865bool Activity::Equals(discordpp::Activity other) const
6866{
6867 assert(state_ == DiscordObjectState::Owned);
6868 bool returnValue__;
6869 returnValue__ = Discord_Activity_Equals(&instance_, other.instance());
6870 return returnValue__;
6871}
6872std::vector<discordpp::ActivityButton> Activity::GetButtons() const
6873{
6874 assert(state_ == DiscordObjectState::Owned);
6875 Discord_ActivityButtonSpan returnValueNative__;
6876 Discord_Activity_GetButtons(&instance_, &returnValueNative__);
6877 std::vector<discordpp::ActivityButton> returnValue__;
6878 returnValue__.reserve(returnValueNative__.size);
6879 for (size_t i__ = 0; i__ < returnValueNative__.size; ++i__) {
6880 returnValue__.emplace_back(returnValueNative__.ptr[i__], DiscordObjectState::Owned);
6881 }
6882 Discord_Free(returnValueNative__.ptr);
6883 return returnValue__;
6884}
6885std::string Activity::Name() const
6886{
6887 assert(state_ == DiscordObjectState::Owned);
6888 Discord_String returnValueNative__;
6889 Discord_Activity_Name(&instance_, &returnValueNative__);
6890 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
6891 returnValueNative__.size);
6892 Discord_Free(returnValueNative__.ptr);
6893 return returnValue__;
6894}
6895void Activity::SetName(std::string Name)
6896{
6897 assert(state_ == DiscordObjectState::Owned);
6898 Discord_String Name__str{(uint8_t*)(Name.data()), Name.size()};
6899 Discord_Activity_SetName(&instance_, Name__str);
6900}
6901discordpp::ActivityTypes Activity::Type() const
6902{
6903 assert(state_ == DiscordObjectState::Owned);
6904 Discord_ActivityTypes returnValue__;
6905 returnValue__ = Discord_Activity_Type(&instance_);
6906 return static_cast<discordpp::ActivityTypes>(returnValue__);
6907}
6908void Activity::SetType(discordpp::ActivityTypes Type)
6909{
6910 assert(state_ == DiscordObjectState::Owned);
6911 Discord_Activity_SetType(&instance_, static_cast<Discord_ActivityTypes>(Type));
6912}
6913std::optional<discordpp::StatusDisplayTypes> Activity::StatusDisplayType() const
6914{
6915 assert(state_ == DiscordObjectState::Owned);
6916 bool returnIsNonNull__;
6917 Discord_StatusDisplayTypes returnValueNative__;
6918 returnIsNonNull__ = Discord_Activity_StatusDisplayType(&instance_, &returnValueNative__);
6919 if (!returnIsNonNull__) {
6920 return {};
6921 }
6922 auto returnValue__ = static_cast<discordpp::StatusDisplayTypes>(returnValueNative__);
6923 return returnValue__;
6924}
6925void Activity::SetStatusDisplayType(std::optional<discordpp::StatusDisplayTypes> StatusDisplayType)
6926{
6927 assert(state_ == DiscordObjectState::Owned);
6928 Discord_Activity_SetStatusDisplayType(
6929 &instance_,
6930 (StatusDisplayType.has_value()
6931 ? reinterpret_cast<Discord_StatusDisplayTypes*>(&*StatusDisplayType)
6932 : nullptr));
6933}
6934std::optional<std::string> Activity::State() const
6935{
6936 assert(state_ == DiscordObjectState::Owned);
6937 bool returnIsNonNull__;
6938 Discord_String returnValueNative__;
6939 returnIsNonNull__ = Discord_Activity_State(&instance_, &returnValueNative__);
6940 if (!returnIsNonNull__) {
6941 return {};
6942 }
6943 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
6944 returnValueNative__.size);
6945 Discord_Free(returnValueNative__.ptr);
6946 return returnValue__;
6947}
6948void Activity::SetState(std::optional<std::string> State)
6949{
6950 assert(state_ == DiscordObjectState::Owned);
6951 Discord_String State__str{};
6952 if (State.has_value()) {
6953 State__str.ptr = reinterpret_cast<uint8_t*>(State->data());
6954 State__str.size = State->size();
6955 }
6956 Discord_Activity_SetState(&instance_, (State.has_value() ? &State__str : nullptr));
6957}
6958std::optional<std::string> Activity::StateUrl() const
6959{
6960 assert(state_ == DiscordObjectState::Owned);
6961 bool returnIsNonNull__;
6962 Discord_String returnValueNative__;
6963 returnIsNonNull__ = Discord_Activity_StateUrl(&instance_, &returnValueNative__);
6964 if (!returnIsNonNull__) {
6965 return {};
6966 }
6967 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
6968 returnValueNative__.size);
6969 Discord_Free(returnValueNative__.ptr);
6970 return returnValue__;
6971}
6972void Activity::SetStateUrl(std::optional<std::string> StateUrl)
6973{
6974 assert(state_ == DiscordObjectState::Owned);
6975 Discord_String StateUrl__str{};
6976 if (StateUrl.has_value()) {
6977 StateUrl__str.ptr = reinterpret_cast<uint8_t*>(StateUrl->data());
6978 StateUrl__str.size = StateUrl->size();
6979 }
6980 Discord_Activity_SetStateUrl(&instance_, (StateUrl.has_value() ? &StateUrl__str : nullptr));
6981}
6982std::optional<std::string> Activity::Details() const
6983{
6984 assert(state_ == DiscordObjectState::Owned);
6985 bool returnIsNonNull__;
6986 Discord_String returnValueNative__;
6987 returnIsNonNull__ = Discord_Activity_Details(&instance_, &returnValueNative__);
6988 if (!returnIsNonNull__) {
6989 return {};
6990 }
6991 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
6992 returnValueNative__.size);
6993 Discord_Free(returnValueNative__.ptr);
6994 return returnValue__;
6995}
6996void Activity::SetDetails(std::optional<std::string> Details)
6997{
6998 assert(state_ == DiscordObjectState::Owned);
6999 Discord_String Details__str{};
7000 if (Details.has_value()) {
7001 Details__str.ptr = reinterpret_cast<uint8_t*>(Details->data());
7002 Details__str.size = Details->size();
7003 }
7004 Discord_Activity_SetDetails(&instance_, (Details.has_value() ? &Details__str : nullptr));
7005}
7006std::optional<std::string> Activity::DetailsUrl() const
7007{
7008 assert(state_ == DiscordObjectState::Owned);
7009 bool returnIsNonNull__;
7010 Discord_String returnValueNative__;
7011 returnIsNonNull__ = Discord_Activity_DetailsUrl(&instance_, &returnValueNative__);
7012 if (!returnIsNonNull__) {
7013 return {};
7014 }
7015 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
7016 returnValueNative__.size);
7017 Discord_Free(returnValueNative__.ptr);
7018 return returnValue__;
7019}
7020void Activity::SetDetailsUrl(std::optional<std::string> DetailsUrl)
7021{
7022 assert(state_ == DiscordObjectState::Owned);
7023 Discord_String DetailsUrl__str{};
7024 if (DetailsUrl.has_value()) {
7025 DetailsUrl__str.ptr = reinterpret_cast<uint8_t*>(DetailsUrl->data());
7026 DetailsUrl__str.size = DetailsUrl->size();
7027 }
7028 Discord_Activity_SetDetailsUrl(&instance_,
7029 (DetailsUrl.has_value() ? &DetailsUrl__str : nullptr));
7030}
7031std::optional<uint64_t> Activity::ApplicationId() const
7032{
7033 assert(state_ == DiscordObjectState::Owned);
7034 bool returnIsNonNull__;
7035 uint64_t returnValue__;
7036 returnIsNonNull__ = Discord_Activity_ApplicationId(&instance_, &returnValue__);
7037 if (!returnIsNonNull__) {
7038 return std::nullopt;
7039 }
7040 return returnValue__;
7041}
7042void Activity::SetApplicationId(std::optional<uint64_t> ApplicationId)
7043{
7044 assert(state_ == DiscordObjectState::Owned);
7045 Discord_Activity_SetApplicationId(&instance_,
7046 (ApplicationId.has_value() ? &*ApplicationId : nullptr));
7047}
7048std::optional<uint64_t> Activity::ParentApplicationId() const
7049{
7050 assert(state_ == DiscordObjectState::Owned);
7051 bool returnIsNonNull__;
7052 uint64_t returnValue__;
7053 returnIsNonNull__ = Discord_Activity_ParentApplicationId(&instance_, &returnValue__);
7054 if (!returnIsNonNull__) {
7055 return std::nullopt;
7056 }
7057 return returnValue__;
7058}
7059void Activity::SetParentApplicationId(std::optional<uint64_t> ParentApplicationId)
7060{
7061 assert(state_ == DiscordObjectState::Owned);
7062 Discord_Activity_SetParentApplicationId(
7063 &instance_, (ParentApplicationId.has_value() ? &*ParentApplicationId : nullptr));
7064}
7065std::optional<discordpp::ActivityAssets> Activity::Assets() const
7066{
7067 assert(state_ == DiscordObjectState::Owned);
7068 bool returnIsNonNull__;
7069 Discord_ActivityAssets returnValueNative__;
7070 returnIsNonNull__ = Discord_Activity_Assets(&instance_, &returnValueNative__);
7071 if (!returnIsNonNull__) {
7072 return {};
7073 }
7074 discordpp::ActivityAssets returnValue__(returnValueNative__, DiscordObjectState::Owned);
7075 return returnValue__;
7076}
7077void Activity::SetAssets(std::optional<discordpp::ActivityAssets> Assets)
7078{
7079 assert(state_ == DiscordObjectState::Owned);
7080 Discord_Activity_SetAssets(&instance_, (Assets.has_value() ? Assets->instance() : nullptr));
7081}
7082std::optional<discordpp::ActivityTimestamps> Activity::Timestamps() const
7083{
7084 assert(state_ == DiscordObjectState::Owned);
7085 bool returnIsNonNull__;
7086 Discord_ActivityTimestamps returnValueNative__;
7087 returnIsNonNull__ = Discord_Activity_Timestamps(&instance_, &returnValueNative__);
7088 if (!returnIsNonNull__) {
7089 return {};
7090 }
7091 discordpp::ActivityTimestamps returnValue__(returnValueNative__, DiscordObjectState::Owned);
7092 return returnValue__;
7093}
7094void Activity::SetTimestamps(std::optional<discordpp::ActivityTimestamps> Timestamps)
7095{
7096 assert(state_ == DiscordObjectState::Owned);
7097 Discord_Activity_SetTimestamps(&instance_,
7098 (Timestamps.has_value() ? Timestamps->instance() : nullptr));
7099}
7100std::optional<discordpp::ActivityParty> Activity::Party() const
7101{
7102 assert(state_ == DiscordObjectState::Owned);
7103 bool returnIsNonNull__;
7104 Discord_ActivityParty returnValueNative__;
7105 returnIsNonNull__ = Discord_Activity_Party(&instance_, &returnValueNative__);
7106 if (!returnIsNonNull__) {
7107 return {};
7108 }
7109 discordpp::ActivityParty returnValue__(returnValueNative__, DiscordObjectState::Owned);
7110 return returnValue__;
7111}
7112void Activity::SetParty(std::optional<discordpp::ActivityParty> Party)
7113{
7114 assert(state_ == DiscordObjectState::Owned);
7115 Discord_Activity_SetParty(&instance_, (Party.has_value() ? Party->instance() : nullptr));
7116}
7117std::optional<discordpp::ActivitySecrets> Activity::Secrets() const
7118{
7119 assert(state_ == DiscordObjectState::Owned);
7120 bool returnIsNonNull__;
7121 Discord_ActivitySecrets returnValueNative__;
7122 returnIsNonNull__ = Discord_Activity_Secrets(&instance_, &returnValueNative__);
7123 if (!returnIsNonNull__) {
7124 return {};
7125 }
7126 discordpp::ActivitySecrets returnValue__(returnValueNative__, DiscordObjectState::Owned);
7127 return returnValue__;
7128}
7129void Activity::SetSecrets(std::optional<discordpp::ActivitySecrets> Secrets)
7130{
7131 assert(state_ == DiscordObjectState::Owned);
7132 Discord_Activity_SetSecrets(&instance_, (Secrets.has_value() ? Secrets->instance() : nullptr));
7133}
7134discordpp::ActivityGamePlatforms Activity::SupportedPlatforms() const
7135{
7136 assert(state_ == DiscordObjectState::Owned);
7137 Discord_ActivityGamePlatforms returnValue__;
7138 returnValue__ = Discord_Activity_SupportedPlatforms(&instance_);
7139 return static_cast<discordpp::ActivityGamePlatforms>(returnValue__);
7140}
7141void Activity::SetSupportedPlatforms(discordpp::ActivityGamePlatforms SupportedPlatforms)
7142{
7143 assert(state_ == DiscordObjectState::Owned);
7144 Discord_Activity_SetSupportedPlatforms(
7145 &instance_, static_cast<Discord_ActivityGamePlatforms>(SupportedPlatforms));
7146}
7147const ClientResult ClientResult::nullobj{{}, DiscordObjectState::Invalid};
7148ClientResult::~ClientResult()
7149{
7150 if (state_ == DiscordObjectState::Owned) {
7151 Drop();
7152 state_ = DiscordObjectState::Invalid;
7153 }
7154}
7155ClientResult::ClientResult(ClientResult&& other) noexcept
7156 : instance_(other.instance_)
7157 , state_(other.state_)
7158{
7159 other.state_ = DiscordObjectState::Invalid;
7160}
7161ClientResult& ClientResult::operator=(ClientResult&& other) noexcept
7162{
7163 if (this != &other) {
7164 if (state_ == DiscordObjectState::Owned) {
7165 Drop();
7166 }
7167 instance_ = other.instance_;
7168 state_ = other.state_;
7169 other.state_ = DiscordObjectState::Invalid;
7170 }
7171 return *this;
7172}
7173ClientResult::ClientResult(const ClientResult& arg0)
7174 : instance_{}
7175 , state_(DiscordObjectState::Invalid)
7176{
7177 if (arg0.state_ == DiscordObjectState::Owned) {
7178 Discord_ClientResult_Clone(&instance_, arg0.instance());
7179
7180 state_ = DiscordObjectState::Owned;
7181 }
7182}
7183ClientResult& ClientResult::operator=(const ClientResult& arg0)
7184{
7185 if (this != &arg0) {
7186 if (state_ == DiscordObjectState::Owned) {
7187 Drop();
7188 state_ = DiscordObjectState::Invalid;
7189 }
7190 if (arg0.state_ == DiscordObjectState::Owned) {
7191 Discord_ClientResult_Clone(&instance_, arg0.instance());
7192
7193 state_ = DiscordObjectState::Owned;
7194 }
7195 }
7196 return *this;
7197}
7198ClientResult::ClientResult(Discord_ClientResult instance, DiscordObjectState state)
7199 : instance_(instance)
7200 , state_(state)
7201{
7202}
7203void ClientResult::Drop()
7204{
7205 if (state_ != DiscordObjectState::Owned) {
7206 return;
7207 }
7208 Discord_ClientResult_Drop(&instance_);
7209 state_ = DiscordObjectState::Invalid;
7210}
7211std::string ClientResult::ToString() const
7212{
7213 assert(state_ == DiscordObjectState::Owned);
7214 Discord_String returnValueNative__;
7215 Discord_ClientResult_ToString(&instance_, &returnValueNative__);
7216 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
7217 returnValueNative__.size);
7218 Discord_Free(returnValueNative__.ptr);
7219 return returnValue__;
7220}
7221discordpp::ErrorType ClientResult::Type() const
7222{
7223 assert(state_ == DiscordObjectState::Owned);
7224 Discord_ErrorType returnValue__;
7225 returnValue__ = Discord_ClientResult_Type(&instance_);
7226 return static_cast<discordpp::ErrorType>(returnValue__);
7227}
7228void ClientResult::SetType(discordpp::ErrorType Type)
7229{
7230 assert(state_ == DiscordObjectState::Owned);
7231 Discord_ClientResult_SetType(&instance_, static_cast<Discord_ErrorType>(Type));
7232}
7233std::string ClientResult::Error() const
7234{
7235 assert(state_ == DiscordObjectState::Owned);
7236 Discord_String returnValueNative__;
7237 Discord_ClientResult_Error(&instance_, &returnValueNative__);
7238 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
7239 returnValueNative__.size);
7240 Discord_Free(returnValueNative__.ptr);
7241 return returnValue__;
7242}
7243void ClientResult::SetError(std::string Error)
7244{
7245 assert(state_ == DiscordObjectState::Owned);
7246 Discord_String Error__str{(uint8_t*)(Error.data()), Error.size()};
7247 Discord_ClientResult_SetError(&instance_, Error__str);
7248}
7249int32_t ClientResult::ErrorCode() const
7250{
7251 assert(state_ == DiscordObjectState::Owned);
7252 int32_t returnValue__;
7253 returnValue__ = Discord_ClientResult_ErrorCode(&instance_);
7254 return returnValue__;
7255}
7256void ClientResult::SetErrorCode(int32_t ErrorCode)
7257{
7258 assert(state_ == DiscordObjectState::Owned);
7259 Discord_ClientResult_SetErrorCode(&instance_, ErrorCode);
7260}
7261discordpp::HttpStatusCode ClientResult::Status() const
7262{
7263 assert(state_ == DiscordObjectState::Owned);
7264 Discord_HttpStatusCode returnValue__;
7265 returnValue__ = Discord_ClientResult_Status(&instance_);
7266 return static_cast<discordpp::HttpStatusCode>(returnValue__);
7267}
7268void ClientResult::SetStatus(discordpp::HttpStatusCode Status)
7269{
7270 assert(state_ == DiscordObjectState::Owned);
7271 Discord_ClientResult_SetStatus(&instance_, static_cast<Discord_HttpStatusCode>(Status));
7272}
7273std::string ClientResult::ResponseBody() const
7274{
7275 assert(state_ == DiscordObjectState::Owned);
7276 Discord_String returnValueNative__;
7277 Discord_ClientResult_ResponseBody(&instance_, &returnValueNative__);
7278 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
7279 returnValueNative__.size);
7280 Discord_Free(returnValueNative__.ptr);
7281 return returnValue__;
7282}
7283void ClientResult::SetResponseBody(std::string ResponseBody)
7284{
7285 assert(state_ == DiscordObjectState::Owned);
7286 Discord_String ResponseBody__str{(uint8_t*)(ResponseBody.data()), ResponseBody.size()};
7287 Discord_ClientResult_SetResponseBody(&instance_, ResponseBody__str);
7288}
7289bool ClientResult::Successful() const
7290{
7291 assert(state_ == DiscordObjectState::Owned);
7292 bool returnValue__;
7293 returnValue__ = Discord_ClientResult_Successful(&instance_);
7294 return returnValue__;
7295}
7296void ClientResult::SetSuccessful(bool Successful)
7297{
7298 assert(state_ == DiscordObjectState::Owned);
7299 Discord_ClientResult_SetSuccessful(&instance_, Successful);
7300}
7301bool ClientResult::Retryable() const
7302{
7303 assert(state_ == DiscordObjectState::Owned);
7304 bool returnValue__;
7305 returnValue__ = Discord_ClientResult_Retryable(&instance_);
7306 return returnValue__;
7307}
7308void ClientResult::SetRetryable(bool Retryable)
7309{
7310 assert(state_ == DiscordObjectState::Owned);
7311 Discord_ClientResult_SetRetryable(&instance_, Retryable);
7312}
7313float ClientResult::RetryAfter() const
7314{
7315 assert(state_ == DiscordObjectState::Owned);
7316 float returnValue__;
7317 returnValue__ = Discord_ClientResult_RetryAfter(&instance_);
7318 return returnValue__;
7319}
7320void ClientResult::SetRetryAfter(float RetryAfter)
7321{
7322 assert(state_ == DiscordObjectState::Owned);
7323 Discord_ClientResult_SetRetryAfter(&instance_, RetryAfter);
7324}
7325const AuthorizationCodeChallenge AuthorizationCodeChallenge::nullobj{{},
7326 DiscordObjectState::Invalid};
7327AuthorizationCodeChallenge::~AuthorizationCodeChallenge()
7328{
7329 if (state_ == DiscordObjectState::Owned) {
7330 Drop();
7331 state_ = DiscordObjectState::Invalid;
7332 }
7333}
7334AuthorizationCodeChallenge::AuthorizationCodeChallenge(AuthorizationCodeChallenge&& other) noexcept
7335 : instance_(other.instance_)
7336 , state_(other.state_)
7337{
7338 other.state_ = DiscordObjectState::Invalid;
7339}
7340AuthorizationCodeChallenge& AuthorizationCodeChallenge::operator=(
7341 AuthorizationCodeChallenge&& other) noexcept
7342{
7343 if (this != &other) {
7344 if (state_ == DiscordObjectState::Owned) {
7345 Drop();
7346 }
7347 instance_ = other.instance_;
7348 state_ = other.state_;
7349 other.state_ = DiscordObjectState::Invalid;
7350 }
7351 return *this;
7352}
7353AuthorizationCodeChallenge::AuthorizationCodeChallenge(const AuthorizationCodeChallenge& arg0)
7354 : instance_{}
7355 , state_(DiscordObjectState::Invalid)
7356{
7357 if (arg0.state_ == DiscordObjectState::Owned) {
7358 Discord_AuthorizationCodeChallenge_Clone(&instance_, arg0.instance());
7359
7360 state_ = DiscordObjectState::Owned;
7361 }
7362}
7363AuthorizationCodeChallenge& AuthorizationCodeChallenge::operator=(
7364 const AuthorizationCodeChallenge& arg0)
7365{
7366 if (this != &arg0) {
7367 if (state_ == DiscordObjectState::Owned) {
7368 Drop();
7369 state_ = DiscordObjectState::Invalid;
7370 }
7371 if (arg0.state_ == DiscordObjectState::Owned) {
7372 Discord_AuthorizationCodeChallenge_Clone(&instance_, arg0.instance());
7373
7374 state_ = DiscordObjectState::Owned;
7375 }
7376 }
7377 return *this;
7378}
7379AuthorizationCodeChallenge::AuthorizationCodeChallenge(Discord_AuthorizationCodeChallenge instance,
7380 DiscordObjectState state)
7381 : instance_(instance)
7382 , state_(state)
7383{
7384}
7385AuthorizationCodeChallenge::AuthorizationCodeChallenge()
7386{
7387 assert(state_ == DiscordObjectState::Invalid);
7388 Discord_AuthorizationCodeChallenge_Init(&instance_);
7389 state_ = DiscordObjectState::Owned;
7390}
7391void AuthorizationCodeChallenge::Drop()
7392{
7393 if (state_ != DiscordObjectState::Owned) {
7394 return;
7395 }
7396 Discord_AuthorizationCodeChallenge_Drop(&instance_);
7397 state_ = DiscordObjectState::Invalid;
7398}
7399discordpp::AuthenticationCodeChallengeMethod AuthorizationCodeChallenge::Method() const
7400{
7401 assert(state_ == DiscordObjectState::Owned);
7402 Discord_AuthenticationCodeChallengeMethod returnValue__;
7403 returnValue__ = Discord_AuthorizationCodeChallenge_Method(&instance_);
7404 return static_cast<discordpp::AuthenticationCodeChallengeMethod>(returnValue__);
7405}
7406void AuthorizationCodeChallenge::SetMethod(discordpp::AuthenticationCodeChallengeMethod Method)
7407{
7408 assert(state_ == DiscordObjectState::Owned);
7409 Discord_AuthorizationCodeChallenge_SetMethod(
7410 &instance_, static_cast<Discord_AuthenticationCodeChallengeMethod>(Method));
7411}
7412std::string AuthorizationCodeChallenge::Challenge() const
7413{
7414 assert(state_ == DiscordObjectState::Owned);
7415 Discord_String returnValueNative__;
7416 Discord_AuthorizationCodeChallenge_Challenge(&instance_, &returnValueNative__);
7417 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
7418 returnValueNative__.size);
7419 Discord_Free(returnValueNative__.ptr);
7420 return returnValue__;
7421}
7422void AuthorizationCodeChallenge::SetChallenge(std::string Challenge)
7423{
7424 assert(state_ == DiscordObjectState::Owned);
7425 Discord_String Challenge__str{(uint8_t*)(Challenge.data()), Challenge.size()};
7426 Discord_AuthorizationCodeChallenge_SetChallenge(&instance_, Challenge__str);
7427}
7428const AuthorizationCodeVerifier AuthorizationCodeVerifier::nullobj{{}, DiscordObjectState::Invalid};
7429AuthorizationCodeVerifier::~AuthorizationCodeVerifier()
7430{
7431 if (state_ == DiscordObjectState::Owned) {
7432 Drop();
7433 state_ = DiscordObjectState::Invalid;
7434 }
7435}
7436AuthorizationCodeVerifier::AuthorizationCodeVerifier(AuthorizationCodeVerifier&& other) noexcept
7437 : instance_(other.instance_)
7438 , state_(other.state_)
7439{
7440 other.state_ = DiscordObjectState::Invalid;
7441}
7442AuthorizationCodeVerifier& AuthorizationCodeVerifier::operator=(
7443 AuthorizationCodeVerifier&& other) noexcept
7444{
7445 if (this != &other) {
7446 if (state_ == DiscordObjectState::Owned) {
7447 Drop();
7448 }
7449 instance_ = other.instance_;
7450 state_ = other.state_;
7451 other.state_ = DiscordObjectState::Invalid;
7452 }
7453 return *this;
7454}
7455AuthorizationCodeVerifier::AuthorizationCodeVerifier(const AuthorizationCodeVerifier& arg0)
7456 : instance_{}
7457 , state_(DiscordObjectState::Invalid)
7458{
7459 if (arg0.state_ == DiscordObjectState::Owned) {
7460 Discord_AuthorizationCodeVerifier_Clone(&instance_, arg0.instance());
7461
7462 state_ = DiscordObjectState::Owned;
7463 }
7464}
7465AuthorizationCodeVerifier& AuthorizationCodeVerifier::operator=(
7466 const AuthorizationCodeVerifier& arg0)
7467{
7468 if (this != &arg0) {
7469 if (state_ == DiscordObjectState::Owned) {
7470 Drop();
7471 state_ = DiscordObjectState::Invalid;
7472 }
7473 if (arg0.state_ == DiscordObjectState::Owned) {
7474 Discord_AuthorizationCodeVerifier_Clone(&instance_, arg0.instance());
7475
7476 state_ = DiscordObjectState::Owned;
7477 }
7478 }
7479 return *this;
7480}
7481AuthorizationCodeVerifier::AuthorizationCodeVerifier(Discord_AuthorizationCodeVerifier instance,
7482 DiscordObjectState state)
7483 : instance_(instance)
7484 , state_(state)
7485{
7486}
7487void AuthorizationCodeVerifier::Drop()
7488{
7489 if (state_ != DiscordObjectState::Owned) {
7490 return;
7491 }
7492 Discord_AuthorizationCodeVerifier_Drop(&instance_);
7493 state_ = DiscordObjectState::Invalid;
7494}
7495discordpp::AuthorizationCodeChallenge AuthorizationCodeVerifier::Challenge() const
7496{
7497 assert(state_ == DiscordObjectState::Owned);
7498 Discord_AuthorizationCodeChallenge returnValueNative__{};
7499 Discord_AuthorizationCodeVerifier_Challenge(&instance_, &returnValueNative__);
7500 discordpp::AuthorizationCodeChallenge returnValue__(returnValueNative__,
7501 DiscordObjectState::Owned);
7502 return returnValue__;
7503}
7504void AuthorizationCodeVerifier::SetChallenge(discordpp::AuthorizationCodeChallenge Challenge)
7505{
7506 assert(state_ == DiscordObjectState::Owned);
7507 Discord_AuthorizationCodeVerifier_SetChallenge(&instance_, Challenge.instance());
7508}
7509std::string AuthorizationCodeVerifier::Verifier() const
7510{
7511 assert(state_ == DiscordObjectState::Owned);
7512 Discord_String returnValueNative__;
7513 Discord_AuthorizationCodeVerifier_Verifier(&instance_, &returnValueNative__);
7514 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
7515 returnValueNative__.size);
7516 Discord_Free(returnValueNative__.ptr);
7517 return returnValue__;
7518}
7519void AuthorizationCodeVerifier::SetVerifier(std::string Verifier)
7520{
7521 assert(state_ == DiscordObjectState::Owned);
7522 Discord_String Verifier__str{(uint8_t*)(Verifier.data()), Verifier.size()};
7523 Discord_AuthorizationCodeVerifier_SetVerifier(&instance_, Verifier__str);
7524}
7525const AuthorizationArgs AuthorizationArgs::nullobj{{}, DiscordObjectState::Invalid};
7526AuthorizationArgs::~AuthorizationArgs()
7527{
7528 if (state_ == DiscordObjectState::Owned) {
7529 Drop();
7530 state_ = DiscordObjectState::Invalid;
7531 }
7532}
7533AuthorizationArgs::AuthorizationArgs(AuthorizationArgs&& other) noexcept
7534 : instance_(other.instance_)
7535 , state_(other.state_)
7536{
7537 other.state_ = DiscordObjectState::Invalid;
7538}
7539AuthorizationArgs& AuthorizationArgs::operator=(AuthorizationArgs&& other) noexcept
7540{
7541 if (this != &other) {
7542 if (state_ == DiscordObjectState::Owned) {
7543 Drop();
7544 }
7545 instance_ = other.instance_;
7546 state_ = other.state_;
7547 other.state_ = DiscordObjectState::Invalid;
7548 }
7549 return *this;
7550}
7551AuthorizationArgs::AuthorizationArgs(const AuthorizationArgs& arg0)
7552 : instance_{}
7553 , state_(DiscordObjectState::Invalid)
7554{
7555 if (arg0.state_ == DiscordObjectState::Owned) {
7556 Discord_AuthorizationArgs_Clone(&instance_, arg0.instance());
7557
7558 state_ = DiscordObjectState::Owned;
7559 }
7560}
7561AuthorizationArgs& AuthorizationArgs::operator=(const AuthorizationArgs& arg0)
7562{
7563 if (this != &arg0) {
7564 if (state_ == DiscordObjectState::Owned) {
7565 Drop();
7566 state_ = DiscordObjectState::Invalid;
7567 }
7568 if (arg0.state_ == DiscordObjectState::Owned) {
7569 Discord_AuthorizationArgs_Clone(&instance_, arg0.instance());
7570
7571 state_ = DiscordObjectState::Owned;
7572 }
7573 }
7574 return *this;
7575}
7576AuthorizationArgs::AuthorizationArgs(Discord_AuthorizationArgs instance, DiscordObjectState state)
7577 : instance_(instance)
7578 , state_(state)
7579{
7580}
7581AuthorizationArgs::AuthorizationArgs()
7582{
7583 assert(state_ == DiscordObjectState::Invalid);
7584 Discord_AuthorizationArgs_Init(&instance_);
7585 state_ = DiscordObjectState::Owned;
7586}
7587void AuthorizationArgs::Drop()
7588{
7589 if (state_ != DiscordObjectState::Owned) {
7590 return;
7591 }
7592 Discord_AuthorizationArgs_Drop(&instance_);
7593 state_ = DiscordObjectState::Invalid;
7594}
7595uint64_t AuthorizationArgs::ClientId() const
7596{
7597 assert(state_ == DiscordObjectState::Owned);
7598 uint64_t returnValue__;
7599 returnValue__ = Discord_AuthorizationArgs_ClientId(&instance_);
7600 return returnValue__;
7601}
7602void AuthorizationArgs::SetClientId(uint64_t ClientId)
7603{
7604 assert(state_ == DiscordObjectState::Owned);
7605 Discord_AuthorizationArgs_SetClientId(&instance_, ClientId);
7606}
7607std::string AuthorizationArgs::Scopes() const
7608{
7609 assert(state_ == DiscordObjectState::Owned);
7610 Discord_String returnValueNative__;
7611 Discord_AuthorizationArgs_Scopes(&instance_, &returnValueNative__);
7612 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
7613 returnValueNative__.size);
7614 Discord_Free(returnValueNative__.ptr);
7615 return returnValue__;
7616}
7617void AuthorizationArgs::SetScopes(std::string Scopes)
7618{
7619 assert(state_ == DiscordObjectState::Owned);
7620 Discord_String Scopes__str{(uint8_t*)(Scopes.data()), Scopes.size()};
7621 Discord_AuthorizationArgs_SetScopes(&instance_, Scopes__str);
7622}
7623std::optional<std::string> AuthorizationArgs::State() const
7624{
7625 assert(state_ == DiscordObjectState::Owned);
7626 bool returnIsNonNull__;
7627 Discord_String returnValueNative__;
7628 returnIsNonNull__ = Discord_AuthorizationArgs_State(&instance_, &returnValueNative__);
7629 if (!returnIsNonNull__) {
7630 return {};
7631 }
7632 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
7633 returnValueNative__.size);
7634 Discord_Free(returnValueNative__.ptr);
7635 return returnValue__;
7636}
7637void AuthorizationArgs::SetState(std::optional<std::string> State)
7638{
7639 assert(state_ == DiscordObjectState::Owned);
7640 Discord_String State__str{};
7641 if (State.has_value()) {
7642 State__str.ptr = reinterpret_cast<uint8_t*>(State->data());
7643 State__str.size = State->size();
7644 }
7645 Discord_AuthorizationArgs_SetState(&instance_, (State.has_value() ? &State__str : nullptr));
7646}
7647std::optional<std::string> AuthorizationArgs::Nonce() const
7648{
7649 assert(state_ == DiscordObjectState::Owned);
7650 bool returnIsNonNull__;
7651 Discord_String returnValueNative__;
7652 returnIsNonNull__ = Discord_AuthorizationArgs_Nonce(&instance_, &returnValueNative__);
7653 if (!returnIsNonNull__) {
7654 return {};
7655 }
7656 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
7657 returnValueNative__.size);
7658 Discord_Free(returnValueNative__.ptr);
7659 return returnValue__;
7660}
7661void AuthorizationArgs::SetNonce(std::optional<std::string> Nonce)
7662{
7663 assert(state_ == DiscordObjectState::Owned);
7664 Discord_String Nonce__str{};
7665 if (Nonce.has_value()) {
7666 Nonce__str.ptr = reinterpret_cast<uint8_t*>(Nonce->data());
7667 Nonce__str.size = Nonce->size();
7668 }
7669 Discord_AuthorizationArgs_SetNonce(&instance_, (Nonce.has_value() ? &Nonce__str : nullptr));
7670}
7671std::optional<discordpp::AuthorizationCodeChallenge> AuthorizationArgs::CodeChallenge() const
7672{
7673 assert(state_ == DiscordObjectState::Owned);
7674 bool returnIsNonNull__;
7675 Discord_AuthorizationCodeChallenge returnValueNative__;
7676 returnIsNonNull__ = Discord_AuthorizationArgs_CodeChallenge(&instance_, &returnValueNative__);
7677 if (!returnIsNonNull__) {
7678 return {};
7679 }
7680 discordpp::AuthorizationCodeChallenge returnValue__(returnValueNative__,
7681 DiscordObjectState::Owned);
7682 return returnValue__;
7683}
7684void AuthorizationArgs::SetCodeChallenge(
7685 std::optional<discordpp::AuthorizationCodeChallenge> CodeChallenge)
7686{
7687 assert(state_ == DiscordObjectState::Owned);
7688 Discord_AuthorizationArgs_SetCodeChallenge(
7689 &instance_, (CodeChallenge.has_value() ? CodeChallenge->instance() : nullptr));
7690}
7691std::optional<discordpp::IntegrationType> AuthorizationArgs::IntegrationType() const
7692{
7693 assert(state_ == DiscordObjectState::Owned);
7694 bool returnIsNonNull__;
7695 Discord_IntegrationType returnValueNative__;
7696 returnIsNonNull__ = Discord_AuthorizationArgs_IntegrationType(&instance_, &returnValueNative__);
7697 if (!returnIsNonNull__) {
7698 return {};
7699 }
7700 auto returnValue__ = static_cast<discordpp::IntegrationType>(returnValueNative__);
7701 return returnValue__;
7702}
7703void AuthorizationArgs::SetIntegrationType(
7704 std::optional<discordpp::IntegrationType> IntegrationType)
7705{
7706 assert(state_ == DiscordObjectState::Owned);
7707 Discord_AuthorizationArgs_SetIntegrationType(
7708 &instance_,
7709 (IntegrationType.has_value() ? reinterpret_cast<Discord_IntegrationType*>(&*IntegrationType)
7710 : nullptr));
7711}
7712std::optional<std::string> AuthorizationArgs::CustomSchemeParam() const
7713{
7714 assert(state_ == DiscordObjectState::Owned);
7715 bool returnIsNonNull__;
7716 Discord_String returnValueNative__;
7717 returnIsNonNull__ =
7718 Discord_AuthorizationArgs_CustomSchemeParam(&instance_, &returnValueNative__);
7719 if (!returnIsNonNull__) {
7720 return {};
7721 }
7722 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
7723 returnValueNative__.size);
7724 Discord_Free(returnValueNative__.ptr);
7725 return returnValue__;
7726}
7727void AuthorizationArgs::SetCustomSchemeParam(std::optional<std::string> CustomSchemeParam)
7728{
7729 assert(state_ == DiscordObjectState::Owned);
7730 Discord_String CustomSchemeParam__str{};
7731 if (CustomSchemeParam.has_value()) {
7732 CustomSchemeParam__str.ptr = reinterpret_cast<uint8_t*>(CustomSchemeParam->data());
7733 CustomSchemeParam__str.size = CustomSchemeParam->size();
7734 }
7735 Discord_AuthorizationArgs_SetCustomSchemeParam(
7736 &instance_, (CustomSchemeParam.has_value() ? &CustomSchemeParam__str : nullptr));
7737}
7738const DeviceAuthorizationArgs DeviceAuthorizationArgs::nullobj{{}, DiscordObjectState::Invalid};
7739DeviceAuthorizationArgs::~DeviceAuthorizationArgs()
7740{
7741 if (state_ == DiscordObjectState::Owned) {
7742 Drop();
7743 state_ = DiscordObjectState::Invalid;
7744 }
7745}
7746DeviceAuthorizationArgs::DeviceAuthorizationArgs(DeviceAuthorizationArgs&& other) noexcept
7747 : instance_(other.instance_)
7748 , state_(other.state_)
7749{
7750 other.state_ = DiscordObjectState::Invalid;
7751}
7752DeviceAuthorizationArgs& DeviceAuthorizationArgs::operator=(
7753 DeviceAuthorizationArgs&& other) noexcept
7754{
7755 if (this != &other) {
7756 if (state_ == DiscordObjectState::Owned) {
7757 Drop();
7758 }
7759 instance_ = other.instance_;
7760 state_ = other.state_;
7761 other.state_ = DiscordObjectState::Invalid;
7762 }
7763 return *this;
7764}
7765DeviceAuthorizationArgs::DeviceAuthorizationArgs(const DeviceAuthorizationArgs& arg0)
7766 : instance_{}
7767 , state_(DiscordObjectState::Invalid)
7768{
7769 if (arg0.state_ == DiscordObjectState::Owned) {
7770 Discord_DeviceAuthorizationArgs_Clone(&instance_, arg0.instance());
7771
7772 state_ = DiscordObjectState::Owned;
7773 }
7774}
7775DeviceAuthorizationArgs& DeviceAuthorizationArgs::operator=(const DeviceAuthorizationArgs& arg0)
7776{
7777 if (this != &arg0) {
7778 if (state_ == DiscordObjectState::Owned) {
7779 Drop();
7780 state_ = DiscordObjectState::Invalid;
7781 }
7782 if (arg0.state_ == DiscordObjectState::Owned) {
7783 Discord_DeviceAuthorizationArgs_Clone(&instance_, arg0.instance());
7784
7785 state_ = DiscordObjectState::Owned;
7786 }
7787 }
7788 return *this;
7789}
7790DeviceAuthorizationArgs::DeviceAuthorizationArgs(Discord_DeviceAuthorizationArgs instance,
7791 DiscordObjectState state)
7792 : instance_(instance)
7793 , state_(state)
7794{
7795}
7796DeviceAuthorizationArgs::DeviceAuthorizationArgs()
7797{
7798 assert(state_ == DiscordObjectState::Invalid);
7799 Discord_DeviceAuthorizationArgs_Init(&instance_);
7800 state_ = DiscordObjectState::Owned;
7801}
7802void DeviceAuthorizationArgs::Drop()
7803{
7804 if (state_ != DiscordObjectState::Owned) {
7805 return;
7806 }
7807 Discord_DeviceAuthorizationArgs_Drop(&instance_);
7808 state_ = DiscordObjectState::Invalid;
7809}
7810uint64_t DeviceAuthorizationArgs::ClientId() const
7811{
7812 assert(state_ == DiscordObjectState::Owned);
7813 uint64_t returnValue__;
7814 returnValue__ = Discord_DeviceAuthorizationArgs_ClientId(&instance_);
7815 return returnValue__;
7816}
7817void DeviceAuthorizationArgs::SetClientId(uint64_t ClientId)
7818{
7819 assert(state_ == DiscordObjectState::Owned);
7820 Discord_DeviceAuthorizationArgs_SetClientId(&instance_, ClientId);
7821}
7822std::string DeviceAuthorizationArgs::Scopes() const
7823{
7824 assert(state_ == DiscordObjectState::Owned);
7825 Discord_String returnValueNative__;
7826 Discord_DeviceAuthorizationArgs_Scopes(&instance_, &returnValueNative__);
7827 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
7828 returnValueNative__.size);
7829 Discord_Free(returnValueNative__.ptr);
7830 return returnValue__;
7831}
7832void DeviceAuthorizationArgs::SetScopes(std::string Scopes)
7833{
7834 assert(state_ == DiscordObjectState::Owned);
7835 Discord_String Scopes__str{(uint8_t*)(Scopes.data()), Scopes.size()};
7836 Discord_DeviceAuthorizationArgs_SetScopes(&instance_, Scopes__str);
7837}
7838const VoiceStateHandle VoiceStateHandle::nullobj{{}, DiscordObjectState::Invalid};
7839VoiceStateHandle::~VoiceStateHandle()
7840{
7841 if (state_ == DiscordObjectState::Owned) {
7842 Drop();
7843 state_ = DiscordObjectState::Invalid;
7844 }
7845}
7846VoiceStateHandle::VoiceStateHandle(VoiceStateHandle&& other) noexcept
7847 : instance_(other.instance_)
7848 , state_(other.state_)
7849{
7850 other.state_ = DiscordObjectState::Invalid;
7851}
7852VoiceStateHandle& VoiceStateHandle::operator=(VoiceStateHandle&& other) noexcept
7853{
7854 if (this != &other) {
7855 if (state_ == DiscordObjectState::Owned) {
7856 Drop();
7857 }
7858 instance_ = other.instance_;
7859 state_ = other.state_;
7860 other.state_ = DiscordObjectState::Invalid;
7861 }
7862 return *this;
7863}
7864VoiceStateHandle::VoiceStateHandle(const VoiceStateHandle& other)
7865 : instance_{}
7866 , state_(DiscordObjectState::Invalid)
7867{
7868 if (other.state_ == DiscordObjectState::Owned) {
7869 Discord_VoiceStateHandle_Clone(&instance_, other.instance());
7870
7871 state_ = DiscordObjectState::Owned;
7872 }
7873}
7874VoiceStateHandle& VoiceStateHandle::operator=(const VoiceStateHandle& other)
7875{
7876 if (this != &other) {
7877 if (state_ == DiscordObjectState::Owned) {
7878 Drop();
7879 state_ = DiscordObjectState::Invalid;
7880 }
7881 if (other.state_ == DiscordObjectState::Owned) {
7882 Discord_VoiceStateHandle_Clone(&instance_, other.instance());
7883
7884 state_ = DiscordObjectState::Owned;
7885 }
7886 }
7887 return *this;
7888}
7889VoiceStateHandle::VoiceStateHandle(Discord_VoiceStateHandle instance, DiscordObjectState state)
7890 : instance_(instance)
7891 , state_(state)
7892{
7893}
7894void VoiceStateHandle::Drop()
7895{
7896 if (state_ != DiscordObjectState::Owned) {
7897 return;
7898 }
7899 Discord_VoiceStateHandle_Drop(&instance_);
7900 state_ = DiscordObjectState::Invalid;
7901}
7902bool VoiceStateHandle::SelfDeaf() const
7903{
7904 assert(state_ == DiscordObjectState::Owned);
7905 bool returnValue__;
7906 returnValue__ = Discord_VoiceStateHandle_SelfDeaf(&instance_);
7907 return returnValue__;
7908}
7909bool VoiceStateHandle::SelfMute() const
7910{
7911 assert(state_ == DiscordObjectState::Owned);
7912 bool returnValue__;
7913 returnValue__ = Discord_VoiceStateHandle_SelfMute(&instance_);
7914 return returnValue__;
7915}
7916const VADThresholdSettings VADThresholdSettings::nullobj{{}, DiscordObjectState::Invalid};
7917VADThresholdSettings::~VADThresholdSettings()
7918{
7919 if (state_ == DiscordObjectState::Owned) {
7920 Drop();
7921 state_ = DiscordObjectState::Invalid;
7922 }
7923}
7924VADThresholdSettings::VADThresholdSettings(VADThresholdSettings&& other) noexcept
7925 : instance_(other.instance_)
7926 , state_(other.state_)
7927{
7928 other.state_ = DiscordObjectState::Invalid;
7929}
7930VADThresholdSettings& VADThresholdSettings::operator=(VADThresholdSettings&& other) noexcept
7931{
7932 if (this != &other) {
7933 if (state_ == DiscordObjectState::Owned) {
7934 Drop();
7935 }
7936 instance_ = other.instance_;
7937 state_ = other.state_;
7938 other.state_ = DiscordObjectState::Invalid;
7939 }
7940 return *this;
7941}
7942VADThresholdSettings::VADThresholdSettings(Discord_VADThresholdSettings instance,
7943 DiscordObjectState state)
7944 : instance_(instance)
7945 , state_(state)
7946{
7947}
7948void VADThresholdSettings::Drop()
7949{
7950 if (state_ != DiscordObjectState::Owned) {
7951 return;
7952 }
7953 Discord_VADThresholdSettings_Drop(&instance_);
7954 state_ = DiscordObjectState::Invalid;
7955}
7956float VADThresholdSettings::VadThreshold() const
7957{
7958 assert(state_ == DiscordObjectState::Owned);
7959 float returnValue__;
7960 returnValue__ = Discord_VADThresholdSettings_VadThreshold(&instance_);
7961 return returnValue__;
7962}
7963void VADThresholdSettings::SetVadThreshold(float VadThreshold)
7964{
7965 assert(state_ == DiscordObjectState::Owned);
7966 Discord_VADThresholdSettings_SetVadThreshold(&instance_, VadThreshold);
7967}
7968bool VADThresholdSettings::Automatic() const
7969{
7970 assert(state_ == DiscordObjectState::Owned);
7971 bool returnValue__;
7972 returnValue__ = Discord_VADThresholdSettings_Automatic(&instance_);
7973 return returnValue__;
7974}
7975void VADThresholdSettings::SetAutomatic(bool Automatic)
7976{
7977 assert(state_ == DiscordObjectState::Owned);
7978 Discord_VADThresholdSettings_SetAutomatic(&instance_, Automatic);
7979}
7980const Call Call::nullobj{{}, DiscordObjectState::Invalid};
7981Call::~Call()
7982{
7983 if (state_ == DiscordObjectState::Owned) {
7984 Drop();
7985 state_ = DiscordObjectState::Invalid;
7986 }
7987}
7988Call::Call(Call&& other) noexcept
7989 : instance_(other.instance_)
7990 , state_(other.state_)
7991{
7992 other.state_ = DiscordObjectState::Invalid;
7993}
7994Call& Call::operator=(Call&& other) noexcept
7995{
7996 if (this != &other) {
7997 if (state_ == DiscordObjectState::Owned) {
7998 Drop();
7999 }
8000 instance_ = other.instance_;
8001 state_ = other.state_;
8002 other.state_ = DiscordObjectState::Invalid;
8003 }
8004 return *this;
8005}
8006Call::Call(const Call& other)
8007 : instance_{}
8008 , state_(DiscordObjectState::Invalid)
8009{
8010 if (other.state_ == DiscordObjectState::Owned) {
8011 Discord_Call_Clone(&instance_, other.instance());
8012
8013 state_ = DiscordObjectState::Owned;
8014 }
8015}
8016Call& Call::operator=(const Call& other)
8017{
8018 if (this != &other) {
8019 if (state_ == DiscordObjectState::Owned) {
8020 Drop();
8021 state_ = DiscordObjectState::Invalid;
8022 }
8023 if (other.state_ == DiscordObjectState::Owned) {
8024 Discord_Call_Clone(&instance_, other.instance());
8025
8026 state_ = DiscordObjectState::Owned;
8027 }
8028 }
8029 return *this;
8030}
8031Call::Call(Discord_Call instance, DiscordObjectState state)
8032 : instance_(instance)
8033 , state_(state)
8034{
8035}
8036void Call::Drop()
8037{
8038 if (state_ != DiscordObjectState::Owned) {
8039 return;
8040 }
8041 Discord_Call_Drop(&instance_);
8042 state_ = DiscordObjectState::Invalid;
8043}
8044std::string Call::ErrorToString(discordpp::Call::Error type)
8045{
8046 Discord_String returnValueNative__;
8047 Discord_Call_ErrorToString(static_cast<Discord_Call_Error>(type), &returnValueNative__);
8048 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
8049 returnValueNative__.size);
8050 Discord_Free(returnValueNative__.ptr);
8051 return returnValue__;
8052}
8053discordpp::AudioModeType Call::GetAudioMode()
8054{
8055 assert(state_ == DiscordObjectState::Owned);
8056 Discord_AudioModeType returnValue__;
8057 returnValue__ = Discord_Call_GetAudioMode(&instance_);
8058 return static_cast<discordpp::AudioModeType>(returnValue__);
8059}
8060uint64_t Call::GetChannelId() const
8061{
8062 assert(state_ == DiscordObjectState::Owned);
8063 uint64_t returnValue__;
8064 returnValue__ = Discord_Call_GetChannelId(&instance_);
8065 return returnValue__;
8066}
8067uint64_t Call::GetGuildId() const
8068{
8069 assert(state_ == DiscordObjectState::Owned);
8070 uint64_t returnValue__;
8071 returnValue__ = Discord_Call_GetGuildId(&instance_);
8072 return returnValue__;
8073}
8074bool Call::GetLocalMute(uint64_t userId)
8075{
8076 assert(state_ == DiscordObjectState::Owned);
8077 bool returnValue__;
8078 returnValue__ = Discord_Call_GetLocalMute(&instance_, userId);
8079 return returnValue__;
8080}
8081std::vector<uint64_t> Call::GetParticipants() const
8082{
8083 assert(state_ == DiscordObjectState::Owned);
8084 Discord_UInt64Span returnValueNative__;
8085 Discord_Call_GetParticipants(&instance_, &returnValueNative__);
8086 std::vector<uint64_t> returnValue__(returnValueNative__.ptr,
8087 returnValueNative__.ptr + returnValueNative__.size);
8088 Discord_Free(returnValueNative__.ptr);
8089 return returnValue__;
8090}
8091float Call::GetParticipantVolume(uint64_t userId)
8092{
8093 assert(state_ == DiscordObjectState::Owned);
8094 float returnValue__;
8095 returnValue__ = Discord_Call_GetParticipantVolume(&instance_, userId);
8096 return returnValue__;
8097}
8098bool Call::GetPTTActive()
8099{
8100 assert(state_ == DiscordObjectState::Owned);
8101 bool returnValue__;
8102 returnValue__ = Discord_Call_GetPTTActive(&instance_);
8103 return returnValue__;
8104}
8105uint32_t Call::GetPTTReleaseDelay()
8106{
8107 assert(state_ == DiscordObjectState::Owned);
8108 uint32_t returnValue__;
8109 returnValue__ = Discord_Call_GetPTTReleaseDelay(&instance_);
8110 return returnValue__;
8111}
8112bool Call::GetSelfDeaf()
8113{
8114 assert(state_ == DiscordObjectState::Owned);
8115 bool returnValue__;
8116 returnValue__ = Discord_Call_GetSelfDeaf(&instance_);
8117 return returnValue__;
8118}
8119bool Call::GetSelfMute()
8120{
8121 assert(state_ == DiscordObjectState::Owned);
8122 bool returnValue__;
8123 returnValue__ = Discord_Call_GetSelfMute(&instance_);
8124 return returnValue__;
8125}
8126discordpp::Call::Status Call::GetStatus() const
8127{
8128 assert(state_ == DiscordObjectState::Owned);
8129 Discord_Call_Status returnValue__;
8130 returnValue__ = Discord_Call_GetStatus(&instance_);
8131 return static_cast<discordpp::Call::Status>(returnValue__);
8132}
8133discordpp::VADThresholdSettings Call::GetVADThreshold() const
8134{
8135 assert(state_ == DiscordObjectState::Owned);
8136 Discord_VADThresholdSettings returnValueNative__{};
8137 Discord_Call_GetVADThreshold(&instance_, &returnValueNative__);
8138 discordpp::VADThresholdSettings returnValue__(returnValueNative__, DiscordObjectState::Owned);
8139 return returnValue__;
8140}
8141std::optional<discordpp::VoiceStateHandle> Call::GetVoiceStateHandle(uint64_t userId) const
8142{
8143 assert(state_ == DiscordObjectState::Owned);
8144 bool returnIsNonNull__;
8145 Discord_VoiceStateHandle returnValueNative__;
8146 returnIsNonNull__ = Discord_Call_GetVoiceStateHandle(&instance_, userId, &returnValueNative__);
8147 if (!returnIsNonNull__) {
8148 return {};
8149 }
8150 discordpp::VoiceStateHandle returnValue__(returnValueNative__, DiscordObjectState::Owned);
8151 return returnValue__;
8152}
8153void Call::SetAudioMode(discordpp::AudioModeType audioMode)
8154{
8155 assert(state_ == DiscordObjectState::Owned);
8156 Discord_Call_SetAudioMode(&instance_, static_cast<Discord_AudioModeType>(audioMode));
8157}
8158void Call::SetLocalMute(uint64_t userId, bool mute)
8159{
8160 assert(state_ == DiscordObjectState::Owned);
8161 Discord_Call_SetLocalMute(&instance_, userId, mute);
8162}
8163void Call::SetOnVoiceStateChangedCallback(discordpp::Call::OnVoiceStateChanged cb)
8164{
8165 assert(state_ == DiscordObjectState::Owned);
8166 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
8167 auto cb__userData = new Tcb__UserData(cb);
8168 Discord_Call_OnVoiceStateChanged cb__native = [](auto userId, void* userData__) {
8169 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
8170 userData__typed->delegate(userId);
8171 };
8172 Discord_Call_SetOnVoiceStateChangedCallback(
8173 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
8174}
8175void Call::SetParticipantChangedCallback(discordpp::Call::OnParticipantChanged cb)
8176{
8177 assert(state_ == DiscordObjectState::Owned);
8178 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
8179 auto cb__userData = new Tcb__UserData(cb);
8180 Discord_Call_OnParticipantChanged cb__native = [](auto userId, auto added, void* userData__) {
8181 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
8182 userData__typed->delegate(userId, added);
8183 };
8184 Discord_Call_SetParticipantChangedCallback(
8185 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
8186}
8187void Call::SetParticipantVolume(uint64_t userId, float volume)
8188{
8189 assert(state_ == DiscordObjectState::Owned);
8190 Discord_Call_SetParticipantVolume(&instance_, userId, volume);
8191}
8192void Call::SetPTTActive(bool active)
8193{
8194 assert(state_ == DiscordObjectState::Owned);
8195 Discord_Call_SetPTTActive(&instance_, active);
8196}
8197void Call::SetPTTReleaseDelay(uint32_t releaseDelayMs)
8198{
8199 assert(state_ == DiscordObjectState::Owned);
8200 Discord_Call_SetPTTReleaseDelay(&instance_, releaseDelayMs);
8201}
8202void Call::SetSelfDeaf(bool deaf)
8203{
8204 assert(state_ == DiscordObjectState::Owned);
8205 Discord_Call_SetSelfDeaf(&instance_, deaf);
8206}
8207void Call::SetSelfMute(bool mute)
8208{
8209 assert(state_ == DiscordObjectState::Owned);
8210 Discord_Call_SetSelfMute(&instance_, mute);
8211}
8212void Call::SetSpeakingStatusChangedCallback(discordpp::Call::OnSpeakingStatusChanged cb)
8213{
8214 assert(state_ == DiscordObjectState::Owned);
8215 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
8216 auto cb__userData = new Tcb__UserData(cb);
8217 Discord_Call_OnSpeakingStatusChanged cb__native =
8218 [](auto userId, auto isPlayingSound, void* userData__) {
8219 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
8220 userData__typed->delegate(userId, isPlayingSound);
8221 };
8222 Discord_Call_SetSpeakingStatusChangedCallback(
8223 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
8224}
8225void Call::SetStatusChangedCallback(discordpp::Call::OnStatusChanged cb)
8226{
8227 assert(state_ == DiscordObjectState::Owned);
8228 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
8229 auto cb__userData = new Tcb__UserData(cb);
8230 Discord_Call_OnStatusChanged cb__native =
8231 [](auto status, auto error, auto errorDetail, void* userData__) {
8232 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
8233 userData__typed->delegate(static_cast<discordpp::Call::Status>(status),
8234 static_cast<discordpp::Call::Error>(error),
8235 errorDetail);
8236 };
8237 Discord_Call_SetStatusChangedCallback(
8238 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
8239}
8240void Call::SetVADThreshold(bool automatic, float threshold)
8241{
8242 assert(state_ == DiscordObjectState::Owned);
8243 Discord_Call_SetVADThreshold(&instance_, automatic, threshold);
8244}
8245std::string Call::StatusToString(discordpp::Call::Status type)
8246{
8247 Discord_String returnValueNative__;
8248 Discord_Call_StatusToString(static_cast<Discord_Call_Status>(type), &returnValueNative__);
8249 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
8250 returnValueNative__.size);
8251 Discord_Free(returnValueNative__.ptr);
8252 return returnValue__;
8253}
8254const ChannelHandle ChannelHandle::nullobj{{}, DiscordObjectState::Invalid};
8255ChannelHandle::~ChannelHandle()
8256{
8257 if (state_ == DiscordObjectState::Owned) {
8258 Drop();
8259 state_ = DiscordObjectState::Invalid;
8260 }
8261}
8262ChannelHandle::ChannelHandle(ChannelHandle&& other) noexcept
8263 : instance_(other.instance_)
8264 , state_(other.state_)
8265{
8266 other.state_ = DiscordObjectState::Invalid;
8267}
8268ChannelHandle& ChannelHandle::operator=(ChannelHandle&& other) noexcept
8269{
8270 if (this != &other) {
8271 if (state_ == DiscordObjectState::Owned) {
8272 Drop();
8273 }
8274 instance_ = other.instance_;
8275 state_ = other.state_;
8276 other.state_ = DiscordObjectState::Invalid;
8277 }
8278 return *this;
8279}
8280ChannelHandle::ChannelHandle(const ChannelHandle& other)
8281 : instance_{}
8282 , state_(DiscordObjectState::Invalid)
8283{
8284 if (other.state_ == DiscordObjectState::Owned) {
8285 Discord_ChannelHandle_Clone(&instance_, other.instance());
8286
8287 state_ = DiscordObjectState::Owned;
8288 }
8289}
8290ChannelHandle& ChannelHandle::operator=(const ChannelHandle& other)
8291{
8292 if (this != &other) {
8293 if (state_ == DiscordObjectState::Owned) {
8294 Drop();
8295 state_ = DiscordObjectState::Invalid;
8296 }
8297 if (other.state_ == DiscordObjectState::Owned) {
8298 Discord_ChannelHandle_Clone(&instance_, other.instance());
8299
8300 state_ = DiscordObjectState::Owned;
8301 }
8302 }
8303 return *this;
8304}
8305ChannelHandle::ChannelHandle(Discord_ChannelHandle instance, DiscordObjectState state)
8306 : instance_(instance)
8307 , state_(state)
8308{
8309}
8310void ChannelHandle::Drop()
8311{
8312 if (state_ != DiscordObjectState::Owned) {
8313 return;
8314 }
8315 Discord_ChannelHandle_Drop(&instance_);
8316 state_ = DiscordObjectState::Invalid;
8317}
8318uint64_t ChannelHandle::Id() const
8319{
8320 assert(state_ == DiscordObjectState::Owned);
8321 uint64_t returnValue__;
8322 returnValue__ = Discord_ChannelHandle_Id(&instance_);
8323 return returnValue__;
8324}
8325std::string ChannelHandle::Name() const
8326{
8327 assert(state_ == DiscordObjectState::Owned);
8328 Discord_String returnValueNative__;
8329 Discord_ChannelHandle_Name(&instance_, &returnValueNative__);
8330 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
8331 returnValueNative__.size);
8332 Discord_Free(returnValueNative__.ptr);
8333 return returnValue__;
8334}
8335std::vector<uint64_t> ChannelHandle::Recipients() const
8336{
8337 assert(state_ == DiscordObjectState::Owned);
8338 Discord_UInt64Span returnValueNative__;
8339 Discord_ChannelHandle_Recipients(&instance_, &returnValueNative__);
8340 std::vector<uint64_t> returnValue__(returnValueNative__.ptr,
8341 returnValueNative__.ptr + returnValueNative__.size);
8342 Discord_Free(returnValueNative__.ptr);
8343 return returnValue__;
8344}
8345discordpp::ChannelType ChannelHandle::Type() const
8346{
8347 assert(state_ == DiscordObjectState::Owned);
8348 Discord_ChannelType returnValue__;
8349 returnValue__ = Discord_ChannelHandle_Type(&instance_);
8350 return static_cast<discordpp::ChannelType>(returnValue__);
8351}
8352const GuildMinimal GuildMinimal::nullobj{{}, DiscordObjectState::Invalid};
8353GuildMinimal::~GuildMinimal()
8354{
8355 if (state_ == DiscordObjectState::Owned) {
8356 Drop();
8357 state_ = DiscordObjectState::Invalid;
8358 }
8359}
8360GuildMinimal::GuildMinimal(GuildMinimal&& other) noexcept
8361 : instance_(other.instance_)
8362 , state_(other.state_)
8363{
8364 other.state_ = DiscordObjectState::Invalid;
8365}
8366GuildMinimal& GuildMinimal::operator=(GuildMinimal&& other) noexcept
8367{
8368 if (this != &other) {
8369 if (state_ == DiscordObjectState::Owned) {
8370 Drop();
8371 }
8372 instance_ = other.instance_;
8373 state_ = other.state_;
8374 other.state_ = DiscordObjectState::Invalid;
8375 }
8376 return *this;
8377}
8378GuildMinimal::GuildMinimal(const GuildMinimal& arg0)
8379 : instance_{}
8380 , state_(DiscordObjectState::Invalid)
8381{
8382 if (arg0.state_ == DiscordObjectState::Owned) {
8383 Discord_GuildMinimal_Clone(&instance_, arg0.instance());
8384
8385 state_ = DiscordObjectState::Owned;
8386 }
8387}
8388GuildMinimal& GuildMinimal::operator=(const GuildMinimal& arg0)
8389{
8390 if (this != &arg0) {
8391 if (state_ == DiscordObjectState::Owned) {
8392 Drop();
8393 state_ = DiscordObjectState::Invalid;
8394 }
8395 if (arg0.state_ == DiscordObjectState::Owned) {
8396 Discord_GuildMinimal_Clone(&instance_, arg0.instance());
8397
8398 state_ = DiscordObjectState::Owned;
8399 }
8400 }
8401 return *this;
8402}
8403GuildMinimal::GuildMinimal(Discord_GuildMinimal instance, DiscordObjectState state)
8404 : instance_(instance)
8405 , state_(state)
8406{
8407}
8408void GuildMinimal::Drop()
8409{
8410 if (state_ != DiscordObjectState::Owned) {
8411 return;
8412 }
8413 Discord_GuildMinimal_Drop(&instance_);
8414 state_ = DiscordObjectState::Invalid;
8415}
8416uint64_t GuildMinimal::Id() const
8417{
8418 assert(state_ == DiscordObjectState::Owned);
8419 uint64_t returnValue__;
8420 returnValue__ = Discord_GuildMinimal_Id(&instance_);
8421 return returnValue__;
8422}
8423void GuildMinimal::SetId(uint64_t Id)
8424{
8425 assert(state_ == DiscordObjectState::Owned);
8426 Discord_GuildMinimal_SetId(&instance_, Id);
8427}
8428std::string GuildMinimal::Name() const
8429{
8430 assert(state_ == DiscordObjectState::Owned);
8431 Discord_String returnValueNative__;
8432 Discord_GuildMinimal_Name(&instance_, &returnValueNative__);
8433 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
8434 returnValueNative__.size);
8435 Discord_Free(returnValueNative__.ptr);
8436 return returnValue__;
8437}
8438void GuildMinimal::SetName(std::string Name)
8439{
8440 assert(state_ == DiscordObjectState::Owned);
8441 Discord_String Name__str{(uint8_t*)(Name.data()), Name.size()};
8442 Discord_GuildMinimal_SetName(&instance_, Name__str);
8443}
8444const GuildChannel GuildChannel::nullobj{{}, DiscordObjectState::Invalid};
8445GuildChannel::~GuildChannel()
8446{
8447 if (state_ == DiscordObjectState::Owned) {
8448 Drop();
8449 state_ = DiscordObjectState::Invalid;
8450 }
8451}
8452GuildChannel::GuildChannel(GuildChannel&& other) noexcept
8453 : instance_(other.instance_)
8454 , state_(other.state_)
8455{
8456 other.state_ = DiscordObjectState::Invalid;
8457}
8458GuildChannel& GuildChannel::operator=(GuildChannel&& other) noexcept
8459{
8460 if (this != &other) {
8461 if (state_ == DiscordObjectState::Owned) {
8462 Drop();
8463 }
8464 instance_ = other.instance_;
8465 state_ = other.state_;
8466 other.state_ = DiscordObjectState::Invalid;
8467 }
8468 return *this;
8469}
8470GuildChannel::GuildChannel(const GuildChannel& arg0)
8471 : instance_{}
8472 , state_(DiscordObjectState::Invalid)
8473{
8474 if (arg0.state_ == DiscordObjectState::Owned) {
8475 Discord_GuildChannel_Clone(&instance_, arg0.instance());
8476
8477 state_ = DiscordObjectState::Owned;
8478 }
8479}
8480GuildChannel& GuildChannel::operator=(const GuildChannel& arg0)
8481{
8482 if (this != &arg0) {
8483 if (state_ == DiscordObjectState::Owned) {
8484 Drop();
8485 state_ = DiscordObjectState::Invalid;
8486 }
8487 if (arg0.state_ == DiscordObjectState::Owned) {
8488 Discord_GuildChannel_Clone(&instance_, arg0.instance());
8489
8490 state_ = DiscordObjectState::Owned;
8491 }
8492 }
8493 return *this;
8494}
8495GuildChannel::GuildChannel(Discord_GuildChannel instance, DiscordObjectState state)
8496 : instance_(instance)
8497 , state_(state)
8498{
8499}
8500void GuildChannel::Drop()
8501{
8502 if (state_ != DiscordObjectState::Owned) {
8503 return;
8504 }
8505 Discord_GuildChannel_Drop(&instance_);
8506 state_ = DiscordObjectState::Invalid;
8507}
8508uint64_t GuildChannel::Id() const
8509{
8510 assert(state_ == DiscordObjectState::Owned);
8511 uint64_t returnValue__;
8512 returnValue__ = Discord_GuildChannel_Id(&instance_);
8513 return returnValue__;
8514}
8515void GuildChannel::SetId(uint64_t Id)
8516{
8517 assert(state_ == DiscordObjectState::Owned);
8518 Discord_GuildChannel_SetId(&instance_, Id);
8519}
8520std::string GuildChannel::Name() const
8521{
8522 assert(state_ == DiscordObjectState::Owned);
8523 Discord_String returnValueNative__;
8524 Discord_GuildChannel_Name(&instance_, &returnValueNative__);
8525 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
8526 returnValueNative__.size);
8527 Discord_Free(returnValueNative__.ptr);
8528 return returnValue__;
8529}
8530void GuildChannel::SetName(std::string Name)
8531{
8532 assert(state_ == DiscordObjectState::Owned);
8533 Discord_String Name__str{(uint8_t*)(Name.data()), Name.size()};
8534 Discord_GuildChannel_SetName(&instance_, Name__str);
8535}
8536discordpp::ChannelType GuildChannel::Type() const
8537{
8538 assert(state_ == DiscordObjectState::Owned);
8539 Discord_ChannelType returnValue__;
8540 returnValue__ = Discord_GuildChannel_Type(&instance_);
8541 return static_cast<discordpp::ChannelType>(returnValue__);
8542}
8543void GuildChannel::SetType(discordpp::ChannelType Type)
8544{
8545 assert(state_ == DiscordObjectState::Owned);
8546 Discord_GuildChannel_SetType(&instance_, static_cast<Discord_ChannelType>(Type));
8547}
8548int32_t GuildChannel::Position() const
8549{
8550 assert(state_ == DiscordObjectState::Owned);
8551 int32_t returnValue__;
8552 returnValue__ = Discord_GuildChannel_Position(&instance_);
8553 return returnValue__;
8554}
8555void GuildChannel::SetPosition(int32_t Position)
8556{
8557 assert(state_ == DiscordObjectState::Owned);
8558 Discord_GuildChannel_SetPosition(&instance_, Position);
8559}
8560std::optional<uint64_t> GuildChannel::ParentId() const
8561{
8562 assert(state_ == DiscordObjectState::Owned);
8563 bool returnIsNonNull__;
8564 uint64_t returnValue__;
8565 returnIsNonNull__ = Discord_GuildChannel_ParentId(&instance_, &returnValue__);
8566 if (!returnIsNonNull__) {
8567 return std::nullopt;
8568 }
8569 return returnValue__;
8570}
8571void GuildChannel::SetParentId(std::optional<uint64_t> ParentId)
8572{
8573 assert(state_ == DiscordObjectState::Owned);
8574 Discord_GuildChannel_SetParentId(&instance_, (ParentId.has_value() ? &*ParentId : nullptr));
8575}
8576bool GuildChannel::IsLinkable() const
8577{
8578 assert(state_ == DiscordObjectState::Owned);
8579 bool returnValue__;
8580 returnValue__ = Discord_GuildChannel_IsLinkable(&instance_);
8581 return returnValue__;
8582}
8583void GuildChannel::SetIsLinkable(bool IsLinkable)
8584{
8585 assert(state_ == DiscordObjectState::Owned);
8586 Discord_GuildChannel_SetIsLinkable(&instance_, IsLinkable);
8587}
8588bool GuildChannel::IsViewableAndWriteableByAllMembers() const
8589{
8590 assert(state_ == DiscordObjectState::Owned);
8591 bool returnValue__;
8592 returnValue__ = Discord_GuildChannel_IsViewableAndWriteableByAllMembers(&instance_);
8593 return returnValue__;
8594}
8595void GuildChannel::SetIsViewableAndWriteableByAllMembers(bool IsViewableAndWriteableByAllMembers)
8596{
8597 assert(state_ == DiscordObjectState::Owned);
8598 Discord_GuildChannel_SetIsViewableAndWriteableByAllMembers(&instance_,
8599 IsViewableAndWriteableByAllMembers);
8600}
8601std::optional<discordpp::LinkedLobby> GuildChannel::LinkedLobby() const
8602{
8603 assert(state_ == DiscordObjectState::Owned);
8604 bool returnIsNonNull__;
8605 Discord_LinkedLobby returnValueNative__;
8606 returnIsNonNull__ = Discord_GuildChannel_LinkedLobby(&instance_, &returnValueNative__);
8607 if (!returnIsNonNull__) {
8608 return {};
8609 }
8610 discordpp::LinkedLobby returnValue__(returnValueNative__, DiscordObjectState::Owned);
8611 return returnValue__;
8612}
8613void GuildChannel::SetLinkedLobby(std::optional<discordpp::LinkedLobby> LinkedLobby)
8614{
8615 assert(state_ == DiscordObjectState::Owned);
8616 Discord_GuildChannel_SetLinkedLobby(
8617 &instance_, (LinkedLobby.has_value() ? LinkedLobby->instance() : nullptr));
8618}
8619const LinkedLobby LinkedLobby::nullobj{{}, DiscordObjectState::Invalid};
8620LinkedLobby::~LinkedLobby()
8621{
8622 if (state_ == DiscordObjectState::Owned) {
8623 Drop();
8624 state_ = DiscordObjectState::Invalid;
8625 }
8626}
8627LinkedLobby::LinkedLobby(LinkedLobby&& other) noexcept
8628 : instance_(other.instance_)
8629 , state_(other.state_)
8630{
8631 other.state_ = DiscordObjectState::Invalid;
8632}
8633LinkedLobby& LinkedLobby::operator=(LinkedLobby&& other) noexcept
8634{
8635 if (this != &other) {
8636 if (state_ == DiscordObjectState::Owned) {
8637 Drop();
8638 }
8639 instance_ = other.instance_;
8640 state_ = other.state_;
8641 other.state_ = DiscordObjectState::Invalid;
8642 }
8643 return *this;
8644}
8645LinkedLobby::LinkedLobby(const LinkedLobby& arg0)
8646 : instance_{}
8647 , state_(DiscordObjectState::Invalid)
8648{
8649 if (arg0.state_ == DiscordObjectState::Owned) {
8650 Discord_LinkedLobby_Clone(&instance_, arg0.instance());
8651
8652 state_ = DiscordObjectState::Owned;
8653 }
8654}
8655LinkedLobby& LinkedLobby::operator=(const LinkedLobby& arg0)
8656{
8657 if (this != &arg0) {
8658 if (state_ == DiscordObjectState::Owned) {
8659 Drop();
8660 state_ = DiscordObjectState::Invalid;
8661 }
8662 if (arg0.state_ == DiscordObjectState::Owned) {
8663 Discord_LinkedLobby_Clone(&instance_, arg0.instance());
8664
8665 state_ = DiscordObjectState::Owned;
8666 }
8667 }
8668 return *this;
8669}
8670LinkedLobby::LinkedLobby(Discord_LinkedLobby instance, DiscordObjectState state)
8671 : instance_(instance)
8672 , state_(state)
8673{
8674}
8675LinkedLobby::LinkedLobby()
8676{
8677 assert(state_ == DiscordObjectState::Invalid);
8678 Discord_LinkedLobby_Init(&instance_);
8679 state_ = DiscordObjectState::Owned;
8680}
8681void LinkedLobby::Drop()
8682{
8683 if (state_ != DiscordObjectState::Owned) {
8684 return;
8685 }
8686 Discord_LinkedLobby_Drop(&instance_);
8687 state_ = DiscordObjectState::Invalid;
8688}
8689uint64_t LinkedLobby::ApplicationId() const
8690{
8691 assert(state_ == DiscordObjectState::Owned);
8692 uint64_t returnValue__;
8693 returnValue__ = Discord_LinkedLobby_ApplicationId(&instance_);
8694 return returnValue__;
8695}
8696void LinkedLobby::SetApplicationId(uint64_t ApplicationId)
8697{
8698 assert(state_ == DiscordObjectState::Owned);
8699 Discord_LinkedLobby_SetApplicationId(&instance_, ApplicationId);
8700}
8701uint64_t LinkedLobby::LobbyId() const
8702{
8703 assert(state_ == DiscordObjectState::Owned);
8704 uint64_t returnValue__;
8705 returnValue__ = Discord_LinkedLobby_LobbyId(&instance_);
8706 return returnValue__;
8707}
8708void LinkedLobby::SetLobbyId(uint64_t LobbyId)
8709{
8710 assert(state_ == DiscordObjectState::Owned);
8711 Discord_LinkedLobby_SetLobbyId(&instance_, LobbyId);
8712}
8713const LinkedChannel LinkedChannel::nullobj{{}, DiscordObjectState::Invalid};
8714LinkedChannel::~LinkedChannel()
8715{
8716 if (state_ == DiscordObjectState::Owned) {
8717 Drop();
8718 state_ = DiscordObjectState::Invalid;
8719 }
8720}
8721LinkedChannel::LinkedChannel(LinkedChannel&& other) noexcept
8722 : instance_(other.instance_)
8723 , state_(other.state_)
8724{
8725 other.state_ = DiscordObjectState::Invalid;
8726}
8727LinkedChannel& LinkedChannel::operator=(LinkedChannel&& other) noexcept
8728{
8729 if (this != &other) {
8730 if (state_ == DiscordObjectState::Owned) {
8731 Drop();
8732 }
8733 instance_ = other.instance_;
8734 state_ = other.state_;
8735 other.state_ = DiscordObjectState::Invalid;
8736 }
8737 return *this;
8738}
8739LinkedChannel::LinkedChannel(const LinkedChannel& arg0)
8740 : instance_{}
8741 , state_(DiscordObjectState::Invalid)
8742{
8743 if (arg0.state_ == DiscordObjectState::Owned) {
8744 Discord_LinkedChannel_Clone(&instance_, arg0.instance());
8745
8746 state_ = DiscordObjectState::Owned;
8747 }
8748}
8749LinkedChannel& LinkedChannel::operator=(const LinkedChannel& arg0)
8750{
8751 if (this != &arg0) {
8752 if (state_ == DiscordObjectState::Owned) {
8753 Drop();
8754 state_ = DiscordObjectState::Invalid;
8755 }
8756 if (arg0.state_ == DiscordObjectState::Owned) {
8757 Discord_LinkedChannel_Clone(&instance_, arg0.instance());
8758
8759 state_ = DiscordObjectState::Owned;
8760 }
8761 }
8762 return *this;
8763}
8764LinkedChannel::LinkedChannel(Discord_LinkedChannel instance, DiscordObjectState state)
8765 : instance_(instance)
8766 , state_(state)
8767{
8768}
8769void LinkedChannel::Drop()
8770{
8771 if (state_ != DiscordObjectState::Owned) {
8772 return;
8773 }
8774 Discord_LinkedChannel_Drop(&instance_);
8775 state_ = DiscordObjectState::Invalid;
8776}
8777uint64_t LinkedChannel::Id() const
8778{
8779 assert(state_ == DiscordObjectState::Owned);
8780 uint64_t returnValue__;
8781 returnValue__ = Discord_LinkedChannel_Id(&instance_);
8782 return returnValue__;
8783}
8784void LinkedChannel::SetId(uint64_t Id)
8785{
8786 assert(state_ == DiscordObjectState::Owned);
8787 Discord_LinkedChannel_SetId(&instance_, Id);
8788}
8789std::string LinkedChannel::Name() const
8790{
8791 assert(state_ == DiscordObjectState::Owned);
8792 Discord_String returnValueNative__;
8793 Discord_LinkedChannel_Name(&instance_, &returnValueNative__);
8794 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
8795 returnValueNative__.size);
8796 Discord_Free(returnValueNative__.ptr);
8797 return returnValue__;
8798}
8799void LinkedChannel::SetName(std::string Name)
8800{
8801 assert(state_ == DiscordObjectState::Owned);
8802 Discord_String Name__str{(uint8_t*)(Name.data()), Name.size()};
8803 Discord_LinkedChannel_SetName(&instance_, Name__str);
8804}
8805uint64_t LinkedChannel::GuildId() const
8806{
8807 assert(state_ == DiscordObjectState::Owned);
8808 uint64_t returnValue__;
8809 returnValue__ = Discord_LinkedChannel_GuildId(&instance_);
8810 return returnValue__;
8811}
8812void LinkedChannel::SetGuildId(uint64_t GuildId)
8813{
8814 assert(state_ == DiscordObjectState::Owned);
8815 Discord_LinkedChannel_SetGuildId(&instance_, GuildId);
8816}
8817const RelationshipHandle RelationshipHandle::nullobj{{}, DiscordObjectState::Invalid};
8818RelationshipHandle::~RelationshipHandle()
8819{
8820 if (state_ == DiscordObjectState::Owned) {
8821 Drop();
8822 state_ = DiscordObjectState::Invalid;
8823 }
8824}
8825RelationshipHandle::RelationshipHandle(RelationshipHandle&& other) noexcept
8826 : instance_(other.instance_)
8827 , state_(other.state_)
8828{
8829 other.state_ = DiscordObjectState::Invalid;
8830}
8831RelationshipHandle& RelationshipHandle::operator=(RelationshipHandle&& other) noexcept
8832{
8833 if (this != &other) {
8834 if (state_ == DiscordObjectState::Owned) {
8835 Drop();
8836 }
8837 instance_ = other.instance_;
8838 state_ = other.state_;
8839 other.state_ = DiscordObjectState::Invalid;
8840 }
8841 return *this;
8842}
8843RelationshipHandle::RelationshipHandle(const RelationshipHandle& other)
8844 : instance_{}
8845 , state_(DiscordObjectState::Invalid)
8846{
8847 if (other.state_ == DiscordObjectState::Owned) {
8848 Discord_RelationshipHandle_Clone(&instance_, other.instance());
8849
8850 state_ = DiscordObjectState::Owned;
8851 }
8852}
8853RelationshipHandle& RelationshipHandle::operator=(const RelationshipHandle& other)
8854{
8855 if (this != &other) {
8856 if (state_ == DiscordObjectState::Owned) {
8857 Drop();
8858 state_ = DiscordObjectState::Invalid;
8859 }
8860 if (other.state_ == DiscordObjectState::Owned) {
8861 Discord_RelationshipHandle_Clone(&instance_, other.instance());
8862
8863 state_ = DiscordObjectState::Owned;
8864 }
8865 }
8866 return *this;
8867}
8868RelationshipHandle::RelationshipHandle(Discord_RelationshipHandle instance,
8869 DiscordObjectState state)
8870 : instance_(instance)
8871 , state_(state)
8872{
8873}
8874void RelationshipHandle::Drop()
8875{
8876 if (state_ != DiscordObjectState::Owned) {
8877 return;
8878 }
8879 Discord_RelationshipHandle_Drop(&instance_);
8880 state_ = DiscordObjectState::Invalid;
8881}
8882discordpp::RelationshipType RelationshipHandle::DiscordRelationshipType() const
8883{
8884 assert(state_ == DiscordObjectState::Owned);
8885 Discord_RelationshipType returnValue__;
8886 returnValue__ = Discord_RelationshipHandle_DiscordRelationshipType(&instance_);
8887 return static_cast<discordpp::RelationshipType>(returnValue__);
8888}
8889discordpp::RelationshipType RelationshipHandle::GameRelationshipType() const
8890{
8891 assert(state_ == DiscordObjectState::Owned);
8892 Discord_RelationshipType returnValue__;
8893 returnValue__ = Discord_RelationshipHandle_GameRelationshipType(&instance_);
8894 return static_cast<discordpp::RelationshipType>(returnValue__);
8895}
8896uint64_t RelationshipHandle::Id() const
8897{
8898 assert(state_ == DiscordObjectState::Owned);
8899 uint64_t returnValue__;
8900 returnValue__ = Discord_RelationshipHandle_Id(&instance_);
8901 return returnValue__;
8902}
8903bool RelationshipHandle::IsSpamRequest() const
8904{
8905 assert(state_ == DiscordObjectState::Owned);
8906 bool returnValue__;
8907 returnValue__ = Discord_RelationshipHandle_IsSpamRequest(&instance_);
8908 return returnValue__;
8909}
8910std::optional<discordpp::UserHandle> RelationshipHandle::User() const
8911{
8912 assert(state_ == DiscordObjectState::Owned);
8913 bool returnIsNonNull__;
8914 Discord_UserHandle returnValueNative__;
8915 returnIsNonNull__ = Discord_RelationshipHandle_User(&instance_, &returnValueNative__);
8916 if (!returnIsNonNull__) {
8917 return {};
8918 }
8919 discordpp::UserHandle returnValue__(returnValueNative__, DiscordObjectState::Owned);
8920 return returnValue__;
8921}
8922const UserApplicationProfileHandle UserApplicationProfileHandle::nullobj{
8923 {},
8924 DiscordObjectState::Invalid};
8925UserApplicationProfileHandle::~UserApplicationProfileHandle()
8926{
8927 if (state_ == DiscordObjectState::Owned) {
8928 Drop();
8929 state_ = DiscordObjectState::Invalid;
8930 }
8931}
8932UserApplicationProfileHandle::UserApplicationProfileHandle(
8933 UserApplicationProfileHandle&& other) noexcept
8934 : instance_(other.instance_)
8935 , state_(other.state_)
8936{
8937 other.state_ = DiscordObjectState::Invalid;
8938}
8939UserApplicationProfileHandle& UserApplicationProfileHandle::operator=(
8940 UserApplicationProfileHandle&& other) noexcept
8941{
8942 if (this != &other) {
8943 if (state_ == DiscordObjectState::Owned) {
8944 Drop();
8945 }
8946 instance_ = other.instance_;
8947 state_ = other.state_;
8948 other.state_ = DiscordObjectState::Invalid;
8949 }
8950 return *this;
8951}
8952UserApplicationProfileHandle::UserApplicationProfileHandle(
8953 const UserApplicationProfileHandle& other)
8954 : instance_{}
8955 , state_(DiscordObjectState::Invalid)
8956{
8957 if (other.state_ == DiscordObjectState::Owned) {
8958 Discord_UserApplicationProfileHandle_Clone(&instance_, other.instance());
8959
8960 state_ = DiscordObjectState::Owned;
8961 }
8962}
8963UserApplicationProfileHandle& UserApplicationProfileHandle::operator=(
8964 const UserApplicationProfileHandle& other)
8965{
8966 if (this != &other) {
8967 if (state_ == DiscordObjectState::Owned) {
8968 Drop();
8969 state_ = DiscordObjectState::Invalid;
8970 }
8971 if (other.state_ == DiscordObjectState::Owned) {
8972 Discord_UserApplicationProfileHandle_Clone(&instance_, other.instance());
8973
8974 state_ = DiscordObjectState::Owned;
8975 }
8976 }
8977 return *this;
8978}
8979UserApplicationProfileHandle::UserApplicationProfileHandle(
8980 Discord_UserApplicationProfileHandle instance,
8981 DiscordObjectState state)
8982 : instance_(instance)
8983 , state_(state)
8984{
8985}
8986void UserApplicationProfileHandle::Drop()
8987{
8988 if (state_ != DiscordObjectState::Owned) {
8989 return;
8990 }
8991 Discord_UserApplicationProfileHandle_Drop(&instance_);
8992 state_ = DiscordObjectState::Invalid;
8993}
8994std::string UserApplicationProfileHandle::AvatarHash() const
8995{
8996 assert(state_ == DiscordObjectState::Owned);
8997 Discord_String returnValueNative__;
8998 Discord_UserApplicationProfileHandle_AvatarHash(&instance_, &returnValueNative__);
8999 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
9000 returnValueNative__.size);
9001 Discord_Free(returnValueNative__.ptr);
9002 return returnValue__;
9003}
9004std::string UserApplicationProfileHandle::Metadata() const
9005{
9006 assert(state_ == DiscordObjectState::Owned);
9007 Discord_String returnValueNative__;
9008 Discord_UserApplicationProfileHandle_Metadata(&instance_, &returnValueNative__);
9009 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
9010 returnValueNative__.size);
9011 Discord_Free(returnValueNative__.ptr);
9012 return returnValue__;
9013}
9014std::optional<std::string> UserApplicationProfileHandle::ProviderId() const
9015{
9016 assert(state_ == DiscordObjectState::Owned);
9017 bool returnIsNonNull__;
9018 Discord_String returnValueNative__;
9019 returnIsNonNull__ =
9020 Discord_UserApplicationProfileHandle_ProviderId(&instance_, &returnValueNative__);
9021 if (!returnIsNonNull__) {
9022 return {};
9023 }
9024 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
9025 returnValueNative__.size);
9026 Discord_Free(returnValueNative__.ptr);
9027 return returnValue__;
9028}
9029std::string UserApplicationProfileHandle::ProviderIssuedUserId() const
9030{
9031 assert(state_ == DiscordObjectState::Owned);
9032 Discord_String returnValueNative__;
9033 Discord_UserApplicationProfileHandle_ProviderIssuedUserId(&instance_, &returnValueNative__);
9034 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
9035 returnValueNative__.size);
9036 Discord_Free(returnValueNative__.ptr);
9037 return returnValue__;
9038}
9039discordpp::ExternalIdentityProviderType UserApplicationProfileHandle::ProviderType() const
9040{
9041 assert(state_ == DiscordObjectState::Owned);
9042 Discord_ExternalIdentityProviderType returnValue__;
9043 returnValue__ = Discord_UserApplicationProfileHandle_ProviderType(&instance_);
9044 return static_cast<discordpp::ExternalIdentityProviderType>(returnValue__);
9045}
9046std::string UserApplicationProfileHandle::Username() const
9047{
9048 assert(state_ == DiscordObjectState::Owned);
9049 Discord_String returnValueNative__;
9050 Discord_UserApplicationProfileHandle_Username(&instance_, &returnValueNative__);
9051 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
9052 returnValueNative__.size);
9053 Discord_Free(returnValueNative__.ptr);
9054 return returnValue__;
9055}
9056const UserHandle UserHandle::nullobj{{}, DiscordObjectState::Invalid};
9057UserHandle::~UserHandle()
9058{
9059 if (state_ == DiscordObjectState::Owned) {
9060 Drop();
9061 state_ = DiscordObjectState::Invalid;
9062 }
9063}
9064UserHandle::UserHandle(UserHandle&& other) noexcept
9065 : instance_(other.instance_)
9066 , state_(other.state_)
9067{
9068 other.state_ = DiscordObjectState::Invalid;
9069}
9070UserHandle& UserHandle::operator=(UserHandle&& other) noexcept
9071{
9072 if (this != &other) {
9073 if (state_ == DiscordObjectState::Owned) {
9074 Drop();
9075 }
9076 instance_ = other.instance_;
9077 state_ = other.state_;
9078 other.state_ = DiscordObjectState::Invalid;
9079 }
9080 return *this;
9081}
9082UserHandle::UserHandle(const UserHandle& arg0)
9083 : instance_{}
9084 , state_(DiscordObjectState::Invalid)
9085{
9086 if (arg0.state_ == DiscordObjectState::Owned) {
9087 Discord_UserHandle_Clone(&instance_, arg0.instance());
9088
9089 state_ = DiscordObjectState::Owned;
9090 }
9091}
9092UserHandle& UserHandle::operator=(const UserHandle& arg0)
9093{
9094 if (this != &arg0) {
9095 if (state_ == DiscordObjectState::Owned) {
9096 Drop();
9097 state_ = DiscordObjectState::Invalid;
9098 }
9099 if (arg0.state_ == DiscordObjectState::Owned) {
9100 Discord_UserHandle_Clone(&instance_, arg0.instance());
9101
9102 state_ = DiscordObjectState::Owned;
9103 }
9104 }
9105 return *this;
9106}
9107UserHandle::UserHandle(Discord_UserHandle instance, DiscordObjectState state)
9108 : instance_(instance)
9109 , state_(state)
9110{
9111}
9112void UserHandle::Drop()
9113{
9114 if (state_ != DiscordObjectState::Owned) {
9115 return;
9116 }
9117 Discord_UserHandle_Drop(&instance_);
9118 state_ = DiscordObjectState::Invalid;
9119}
9120std::optional<std::string> UserHandle::Avatar() const
9121{
9122 assert(state_ == DiscordObjectState::Owned);
9123 bool returnIsNonNull__;
9124 Discord_String returnValueNative__;
9125 returnIsNonNull__ = Discord_UserHandle_Avatar(&instance_, &returnValueNative__);
9126 if (!returnIsNonNull__) {
9127 return {};
9128 }
9129 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
9130 returnValueNative__.size);
9131 Discord_Free(returnValueNative__.ptr);
9132 return returnValue__;
9133}
9134std::string UserHandle::AvatarTypeToString(discordpp::UserHandle::AvatarType type)
9135{
9136 Discord_String returnValueNative__;
9137 Discord_UserHandle_AvatarTypeToString(static_cast<Discord_UserHandle_AvatarType>(type),
9138 &returnValueNative__);
9139 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
9140 returnValueNative__.size);
9141 Discord_Free(returnValueNative__.ptr);
9142 return returnValue__;
9143}
9144std::string UserHandle::AvatarUrl(discordpp::UserHandle::AvatarType animatedType,
9145 discordpp::UserHandle::AvatarType staticType) const
9146{
9147 assert(state_ == DiscordObjectState::Owned);
9148 Discord_String returnValueNative__;
9149 Discord_UserHandle_AvatarUrl(&instance_,
9150 static_cast<Discord_UserHandle_AvatarType>(animatedType),
9151 static_cast<Discord_UserHandle_AvatarType>(staticType),
9152 &returnValueNative__);
9153 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
9154 returnValueNative__.size);
9155 Discord_Free(returnValueNative__.ptr);
9156 return returnValue__;
9157}
9158std::string UserHandle::DisplayName() const
9159{
9160 assert(state_ == DiscordObjectState::Owned);
9161 Discord_String returnValueNative__;
9162 Discord_UserHandle_DisplayName(&instance_, &returnValueNative__);
9163 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
9164 returnValueNative__.size);
9165 Discord_Free(returnValueNative__.ptr);
9166 return returnValue__;
9167}
9168std::optional<discordpp::Activity> UserHandle::GameActivity() const
9169{
9170 assert(state_ == DiscordObjectState::Owned);
9171 bool returnIsNonNull__;
9172 Discord_Activity returnValueNative__;
9173 returnIsNonNull__ = Discord_UserHandle_GameActivity(&instance_, &returnValueNative__);
9174 if (!returnIsNonNull__) {
9175 return {};
9176 }
9177 discordpp::Activity returnValue__(returnValueNative__, DiscordObjectState::Owned);
9178 return returnValue__;
9179}
9180std::optional<std::string> UserHandle::GlobalName() const
9181{
9182 assert(state_ == DiscordObjectState::Owned);
9183 bool returnIsNonNull__;
9184 Discord_String returnValueNative__;
9185 returnIsNonNull__ = Discord_UserHandle_GlobalName(&instance_, &returnValueNative__);
9186 if (!returnIsNonNull__) {
9187 return {};
9188 }
9189 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
9190 returnValueNative__.size);
9191 Discord_Free(returnValueNative__.ptr);
9192 return returnValue__;
9193}
9194uint64_t UserHandle::Id() const
9195{
9196 assert(state_ == DiscordObjectState::Owned);
9197 uint64_t returnValue__;
9198 returnValue__ = Discord_UserHandle_Id(&instance_);
9199 return returnValue__;
9200}
9201bool UserHandle::IsProvisional() const
9202{
9203 assert(state_ == DiscordObjectState::Owned);
9204 bool returnValue__;
9205 returnValue__ = Discord_UserHandle_IsProvisional(&instance_);
9206 return returnValue__;
9207}
9208discordpp::RelationshipHandle UserHandle::Relationship() const
9209{
9210 assert(state_ == DiscordObjectState::Owned);
9211 Discord_RelationshipHandle returnValueNative__{};
9212 Discord_UserHandle_Relationship(&instance_, &returnValueNative__);
9213 discordpp::RelationshipHandle returnValue__(returnValueNative__, DiscordObjectState::Owned);
9214 return returnValue__;
9215}
9216discordpp::StatusType UserHandle::Status() const
9217{
9218 assert(state_ == DiscordObjectState::Owned);
9219 Discord_StatusType returnValue__;
9220 returnValue__ = Discord_UserHandle_Status(&instance_);
9221 return static_cast<discordpp::StatusType>(returnValue__);
9222}
9223std::vector<discordpp::UserApplicationProfileHandle> UserHandle::UserApplicationProfiles() const
9224{
9225 assert(state_ == DiscordObjectState::Owned);
9226 Discord_UserApplicationProfileHandleSpan returnValueNative__;
9227 Discord_UserHandle_UserApplicationProfiles(&instance_, &returnValueNative__);
9228 std::vector<discordpp::UserApplicationProfileHandle> returnValue__;
9229 returnValue__.reserve(returnValueNative__.size);
9230 for (size_t i__ = 0; i__ < returnValueNative__.size; ++i__) {
9231 returnValue__.emplace_back(returnValueNative__.ptr[i__], DiscordObjectState::Owned);
9232 }
9233 Discord_Free(returnValueNative__.ptr);
9234 return returnValue__;
9235}
9236std::string UserHandle::Username() const
9237{
9238 assert(state_ == DiscordObjectState::Owned);
9239 Discord_String returnValueNative__;
9240 Discord_UserHandle_Username(&instance_, &returnValueNative__);
9241 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
9242 returnValueNative__.size);
9243 Discord_Free(returnValueNative__.ptr);
9244 return returnValue__;
9245}
9246const LobbyMemberHandle LobbyMemberHandle::nullobj{{}, DiscordObjectState::Invalid};
9247LobbyMemberHandle::~LobbyMemberHandle()
9248{
9249 if (state_ == DiscordObjectState::Owned) {
9250 Drop();
9251 state_ = DiscordObjectState::Invalid;
9252 }
9253}
9254LobbyMemberHandle::LobbyMemberHandle(LobbyMemberHandle&& other) noexcept
9255 : instance_(other.instance_)
9256 , state_(other.state_)
9257{
9258 other.state_ = DiscordObjectState::Invalid;
9259}
9260LobbyMemberHandle& LobbyMemberHandle::operator=(LobbyMemberHandle&& other) noexcept
9261{
9262 if (this != &other) {
9263 if (state_ == DiscordObjectState::Owned) {
9264 Drop();
9265 }
9266 instance_ = other.instance_;
9267 state_ = other.state_;
9268 other.state_ = DiscordObjectState::Invalid;
9269 }
9270 return *this;
9271}
9272LobbyMemberHandle::LobbyMemberHandle(const LobbyMemberHandle& other)
9273 : instance_{}
9274 , state_(DiscordObjectState::Invalid)
9275{
9276 if (other.state_ == DiscordObjectState::Owned) {
9277 Discord_LobbyMemberHandle_Clone(&instance_, other.instance());
9278
9279 state_ = DiscordObjectState::Owned;
9280 }
9281}
9282LobbyMemberHandle& LobbyMemberHandle::operator=(const LobbyMemberHandle& other)
9283{
9284 if (this != &other) {
9285 if (state_ == DiscordObjectState::Owned) {
9286 Drop();
9287 state_ = DiscordObjectState::Invalid;
9288 }
9289 if (other.state_ == DiscordObjectState::Owned) {
9290 Discord_LobbyMemberHandle_Clone(&instance_, other.instance());
9291
9292 state_ = DiscordObjectState::Owned;
9293 }
9294 }
9295 return *this;
9296}
9297LobbyMemberHandle::LobbyMemberHandle(Discord_LobbyMemberHandle instance, DiscordObjectState state)
9298 : instance_(instance)
9299 , state_(state)
9300{
9301}
9302void LobbyMemberHandle::Drop()
9303{
9304 if (state_ != DiscordObjectState::Owned) {
9305 return;
9306 }
9307 Discord_LobbyMemberHandle_Drop(&instance_);
9308 state_ = DiscordObjectState::Invalid;
9309}
9310bool LobbyMemberHandle::CanLinkLobby() const
9311{
9312 assert(state_ == DiscordObjectState::Owned);
9313 bool returnValue__;
9314 returnValue__ = Discord_LobbyMemberHandle_CanLinkLobby(&instance_);
9315 return returnValue__;
9316}
9317bool LobbyMemberHandle::Connected() const
9318{
9319 assert(state_ == DiscordObjectState::Owned);
9320 bool returnValue__;
9321 returnValue__ = Discord_LobbyMemberHandle_Connected(&instance_);
9322 return returnValue__;
9323}
9324uint64_t LobbyMemberHandle::Id() const
9325{
9326 assert(state_ == DiscordObjectState::Owned);
9327 uint64_t returnValue__;
9328 returnValue__ = Discord_LobbyMemberHandle_Id(&instance_);
9329 return returnValue__;
9330}
9331std::unordered_map<std::string, std::string> LobbyMemberHandle::Metadata() const
9332{
9333 assert(state_ == DiscordObjectState::Owned);
9334 Discord_Properties returnValueNative__;
9335 Discord_LobbyMemberHandle_Metadata(&instance_, &returnValueNative__);
9336 std::unordered_map<std::string, std::string> returnValue__ =
9337 ConvertReturnedProperties(returnValueNative__);
9338 Discord_FreeProperties(returnValueNative__);
9339 return returnValue__;
9340}
9341std::optional<discordpp::UserHandle> LobbyMemberHandle::User() const
9342{
9343 assert(state_ == DiscordObjectState::Owned);
9344 bool returnIsNonNull__;
9345 Discord_UserHandle returnValueNative__;
9346 returnIsNonNull__ = Discord_LobbyMemberHandle_User(&instance_, &returnValueNative__);
9347 if (!returnIsNonNull__) {
9348 return {};
9349 }
9350 discordpp::UserHandle returnValue__(returnValueNative__, DiscordObjectState::Owned);
9351 return returnValue__;
9352}
9353const LobbyHandle LobbyHandle::nullobj{{}, DiscordObjectState::Invalid};
9354LobbyHandle::~LobbyHandle()
9355{
9356 if (state_ == DiscordObjectState::Owned) {
9357 Drop();
9358 state_ = DiscordObjectState::Invalid;
9359 }
9360}
9361LobbyHandle::LobbyHandle(LobbyHandle&& other) noexcept
9362 : instance_(other.instance_)
9363 , state_(other.state_)
9364{
9365 other.state_ = DiscordObjectState::Invalid;
9366}
9367LobbyHandle& LobbyHandle::operator=(LobbyHandle&& other) noexcept
9368{
9369 if (this != &other) {
9370 if (state_ == DiscordObjectState::Owned) {
9371 Drop();
9372 }
9373 instance_ = other.instance_;
9374 state_ = other.state_;
9375 other.state_ = DiscordObjectState::Invalid;
9376 }
9377 return *this;
9378}
9379LobbyHandle::LobbyHandle(const LobbyHandle& other)
9380 : instance_{}
9381 , state_(DiscordObjectState::Invalid)
9382{
9383 if (other.state_ == DiscordObjectState::Owned) {
9384 Discord_LobbyHandle_Clone(&instance_, other.instance());
9385
9386 state_ = DiscordObjectState::Owned;
9387 }
9388}
9389LobbyHandle& LobbyHandle::operator=(const LobbyHandle& other)
9390{
9391 if (this != &other) {
9392 if (state_ == DiscordObjectState::Owned) {
9393 Drop();
9394 state_ = DiscordObjectState::Invalid;
9395 }
9396 if (other.state_ == DiscordObjectState::Owned) {
9397 Discord_LobbyHandle_Clone(&instance_, other.instance());
9398
9399 state_ = DiscordObjectState::Owned;
9400 }
9401 }
9402 return *this;
9403}
9404LobbyHandle::LobbyHandle(Discord_LobbyHandle instance, DiscordObjectState state)
9405 : instance_(instance)
9406 , state_(state)
9407{
9408}
9409void LobbyHandle::Drop()
9410{
9411 if (state_ != DiscordObjectState::Owned) {
9412 return;
9413 }
9414 Discord_LobbyHandle_Drop(&instance_);
9415 state_ = DiscordObjectState::Invalid;
9416}
9417std::optional<discordpp::CallInfoHandle> LobbyHandle::GetCallInfoHandle() const
9418{
9419 assert(state_ == DiscordObjectState::Owned);
9420 bool returnIsNonNull__;
9421 Discord_CallInfoHandle returnValueNative__;
9422 returnIsNonNull__ = Discord_LobbyHandle_GetCallInfoHandle(&instance_, &returnValueNative__);
9423 if (!returnIsNonNull__) {
9424 return {};
9425 }
9426 discordpp::CallInfoHandle returnValue__(returnValueNative__, DiscordObjectState::Owned);
9427 return returnValue__;
9428}
9429std::optional<discordpp::LobbyMemberHandle> LobbyHandle::GetLobbyMemberHandle(
9430 uint64_t memberId) const
9431{
9432 assert(state_ == DiscordObjectState::Owned);
9433 bool returnIsNonNull__;
9434 Discord_LobbyMemberHandle returnValueNative__;
9435 returnIsNonNull__ =
9436 Discord_LobbyHandle_GetLobbyMemberHandle(&instance_, memberId, &returnValueNative__);
9437 if (!returnIsNonNull__) {
9438 return {};
9439 }
9440 discordpp::LobbyMemberHandle returnValue__(returnValueNative__, DiscordObjectState::Owned);
9441 return returnValue__;
9442}
9443uint64_t LobbyHandle::Id() const
9444{
9445 assert(state_ == DiscordObjectState::Owned);
9446 uint64_t returnValue__;
9447 returnValue__ = Discord_LobbyHandle_Id(&instance_);
9448 return returnValue__;
9449}
9450std::optional<discordpp::LinkedChannel> LobbyHandle::LinkedChannel() const
9451{
9452 assert(state_ == DiscordObjectState::Owned);
9453 bool returnIsNonNull__;
9454 Discord_LinkedChannel returnValueNative__;
9455 returnIsNonNull__ = Discord_LobbyHandle_LinkedChannel(&instance_, &returnValueNative__);
9456 if (!returnIsNonNull__) {
9457 return {};
9458 }
9459 discordpp::LinkedChannel returnValue__(returnValueNative__, DiscordObjectState::Owned);
9460 return returnValue__;
9461}
9462std::vector<uint64_t> LobbyHandle::LobbyMemberIds() const
9463{
9464 assert(state_ == DiscordObjectState::Owned);
9465 Discord_UInt64Span returnValueNative__;
9466 Discord_LobbyHandle_LobbyMemberIds(&instance_, &returnValueNative__);
9467 std::vector<uint64_t> returnValue__(returnValueNative__.ptr,
9468 returnValueNative__.ptr + returnValueNative__.size);
9469 Discord_Free(returnValueNative__.ptr);
9470 return returnValue__;
9471}
9472std::vector<discordpp::LobbyMemberHandle> LobbyHandle::LobbyMembers() const
9473{
9474 assert(state_ == DiscordObjectState::Owned);
9475 Discord_LobbyMemberHandleSpan returnValueNative__;
9476 Discord_LobbyHandle_LobbyMembers(&instance_, &returnValueNative__);
9477 std::vector<discordpp::LobbyMemberHandle> returnValue__;
9478 returnValue__.reserve(returnValueNative__.size);
9479 for (size_t i__ = 0; i__ < returnValueNative__.size; ++i__) {
9480 returnValue__.emplace_back(returnValueNative__.ptr[i__], DiscordObjectState::Owned);
9481 }
9482 Discord_Free(returnValueNative__.ptr);
9483 return returnValue__;
9484}
9485std::unordered_map<std::string, std::string> LobbyHandle::Metadata() const
9486{
9487 assert(state_ == DiscordObjectState::Owned);
9488 Discord_Properties returnValueNative__;
9489 Discord_LobbyHandle_Metadata(&instance_, &returnValueNative__);
9490 std::unordered_map<std::string, std::string> returnValue__ =
9491 ConvertReturnedProperties(returnValueNative__);
9492 Discord_FreeProperties(returnValueNative__);
9493 return returnValue__;
9494}
9495const AdditionalContent AdditionalContent::nullobj{{}, DiscordObjectState::Invalid};
9496AdditionalContent::~AdditionalContent()
9497{
9498 if (state_ == DiscordObjectState::Owned) {
9499 Drop();
9500 state_ = DiscordObjectState::Invalid;
9501 }
9502}
9503AdditionalContent::AdditionalContent(AdditionalContent&& other) noexcept
9504 : instance_(other.instance_)
9505 , state_(other.state_)
9506{
9507 other.state_ = DiscordObjectState::Invalid;
9508}
9509AdditionalContent& AdditionalContent::operator=(AdditionalContent&& other) noexcept
9510{
9511 if (this != &other) {
9512 if (state_ == DiscordObjectState::Owned) {
9513 Drop();
9514 }
9515 instance_ = other.instance_;
9516 state_ = other.state_;
9517 other.state_ = DiscordObjectState::Invalid;
9518 }
9519 return *this;
9520}
9521AdditionalContent::AdditionalContent(const AdditionalContent& arg0)
9522 : instance_{}
9523 , state_(DiscordObjectState::Invalid)
9524{
9525 if (arg0.state_ == DiscordObjectState::Owned) {
9526 Discord_AdditionalContent_Clone(&instance_, arg0.instance());
9527
9528 state_ = DiscordObjectState::Owned;
9529 }
9530}
9531AdditionalContent& AdditionalContent::operator=(const AdditionalContent& arg0)
9532{
9533 if (this != &arg0) {
9534 if (state_ == DiscordObjectState::Owned) {
9535 Drop();
9536 state_ = DiscordObjectState::Invalid;
9537 }
9538 if (arg0.state_ == DiscordObjectState::Owned) {
9539 Discord_AdditionalContent_Clone(&instance_, arg0.instance());
9540
9541 state_ = DiscordObjectState::Owned;
9542 }
9543 }
9544 return *this;
9545}
9546AdditionalContent::AdditionalContent(Discord_AdditionalContent instance, DiscordObjectState state)
9547 : instance_(instance)
9548 , state_(state)
9549{
9550}
9551AdditionalContent::AdditionalContent()
9552{
9553 assert(state_ == DiscordObjectState::Invalid);
9554 Discord_AdditionalContent_Init(&instance_);
9555 state_ = DiscordObjectState::Owned;
9556}
9557void AdditionalContent::Drop()
9558{
9559 if (state_ != DiscordObjectState::Owned) {
9560 return;
9561 }
9562 Discord_AdditionalContent_Drop(&instance_);
9563 state_ = DiscordObjectState::Invalid;
9564}
9565bool AdditionalContent::Equals(discordpp::AdditionalContent rhs) const
9566{
9567 assert(state_ == DiscordObjectState::Owned);
9568 bool returnValue__;
9569 returnValue__ = Discord_AdditionalContent_Equals(&instance_, rhs.instance());
9570 return returnValue__;
9571}
9572std::string AdditionalContent::TypeToString(discordpp::AdditionalContentType type)
9573{
9574 Discord_String returnValueNative__;
9575 Discord_AdditionalContent_TypeToString(static_cast<Discord_AdditionalContentType>(type),
9576 &returnValueNative__);
9577 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
9578 returnValueNative__.size);
9579 Discord_Free(returnValueNative__.ptr);
9580 return returnValue__;
9581}
9582discordpp::AdditionalContentType AdditionalContent::Type() const
9583{
9584 assert(state_ == DiscordObjectState::Owned);
9585 Discord_AdditionalContentType returnValue__;
9586 returnValue__ = Discord_AdditionalContent_Type(&instance_);
9587 return static_cast<discordpp::AdditionalContentType>(returnValue__);
9588}
9589void AdditionalContent::SetType(discordpp::AdditionalContentType Type)
9590{
9591 assert(state_ == DiscordObjectState::Owned);
9592 Discord_AdditionalContent_SetType(&instance_, static_cast<Discord_AdditionalContentType>(Type));
9593}
9594std::optional<std::string> AdditionalContent::Title() const
9595{
9596 assert(state_ == DiscordObjectState::Owned);
9597 bool returnIsNonNull__;
9598 Discord_String returnValueNative__;
9599 returnIsNonNull__ = Discord_AdditionalContent_Title(&instance_, &returnValueNative__);
9600 if (!returnIsNonNull__) {
9601 return {};
9602 }
9603 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
9604 returnValueNative__.size);
9605 Discord_Free(returnValueNative__.ptr);
9606 return returnValue__;
9607}
9608void AdditionalContent::SetTitle(std::optional<std::string> Title)
9609{
9610 assert(state_ == DiscordObjectState::Owned);
9611 Discord_String Title__str{};
9612 if (Title.has_value()) {
9613 Title__str.ptr = reinterpret_cast<uint8_t*>(Title->data());
9614 Title__str.size = Title->size();
9615 }
9616 Discord_AdditionalContent_SetTitle(&instance_, (Title.has_value() ? &Title__str : nullptr));
9617}
9618uint8_t AdditionalContent::Count() const
9619{
9620 assert(state_ == DiscordObjectState::Owned);
9621 uint8_t returnValue__;
9622 returnValue__ = Discord_AdditionalContent_Count(&instance_);
9623 return returnValue__;
9624}
9625void AdditionalContent::SetCount(uint8_t Count)
9626{
9627 assert(state_ == DiscordObjectState::Owned);
9628 Discord_AdditionalContent_SetCount(&instance_, Count);
9629}
9630const MessageHandle MessageHandle::nullobj{{}, DiscordObjectState::Invalid};
9631MessageHandle::~MessageHandle()
9632{
9633 if (state_ == DiscordObjectState::Owned) {
9634 Drop();
9635 state_ = DiscordObjectState::Invalid;
9636 }
9637}
9638MessageHandle::MessageHandle(MessageHandle&& other) noexcept
9639 : instance_(other.instance_)
9640 , state_(other.state_)
9641{
9642 other.state_ = DiscordObjectState::Invalid;
9643}
9644MessageHandle& MessageHandle::operator=(MessageHandle&& other) noexcept
9645{
9646 if (this != &other) {
9647 if (state_ == DiscordObjectState::Owned) {
9648 Drop();
9649 }
9650 instance_ = other.instance_;
9651 state_ = other.state_;
9652 other.state_ = DiscordObjectState::Invalid;
9653 }
9654 return *this;
9655}
9656MessageHandle::MessageHandle(const MessageHandle& other)
9657 : instance_{}
9658 , state_(DiscordObjectState::Invalid)
9659{
9660 if (other.state_ == DiscordObjectState::Owned) {
9661 Discord_MessageHandle_Clone(&instance_, other.instance());
9662
9663 state_ = DiscordObjectState::Owned;
9664 }
9665}
9666MessageHandle& MessageHandle::operator=(const MessageHandle& other)
9667{
9668 if (this != &other) {
9669 if (state_ == DiscordObjectState::Owned) {
9670 Drop();
9671 state_ = DiscordObjectState::Invalid;
9672 }
9673 if (other.state_ == DiscordObjectState::Owned) {
9674 Discord_MessageHandle_Clone(&instance_, other.instance());
9675
9676 state_ = DiscordObjectState::Owned;
9677 }
9678 }
9679 return *this;
9680}
9681MessageHandle::MessageHandle(Discord_MessageHandle instance, DiscordObjectState state)
9682 : instance_(instance)
9683 , state_(state)
9684{
9685}
9686void MessageHandle::Drop()
9687{
9688 if (state_ != DiscordObjectState::Owned) {
9689 return;
9690 }
9691 Discord_MessageHandle_Drop(&instance_);
9692 state_ = DiscordObjectState::Invalid;
9693}
9694std::optional<discordpp::AdditionalContent> MessageHandle::AdditionalContent() const
9695{
9696 assert(state_ == DiscordObjectState::Owned);
9697 bool returnIsNonNull__;
9698 Discord_AdditionalContent returnValueNative__;
9699 returnIsNonNull__ = Discord_MessageHandle_AdditionalContent(&instance_, &returnValueNative__);
9700 if (!returnIsNonNull__) {
9701 return {};
9702 }
9703 discordpp::AdditionalContent returnValue__(returnValueNative__, DiscordObjectState::Owned);
9704 return returnValue__;
9705}
9706std::optional<uint64_t> MessageHandle::ApplicationId() const
9707{
9708 assert(state_ == DiscordObjectState::Owned);
9709 bool returnIsNonNull__;
9710 uint64_t returnValue__;
9711 returnIsNonNull__ = Discord_MessageHandle_ApplicationId(&instance_, &returnValue__);
9712 if (!returnIsNonNull__) {
9713 return std::nullopt;
9714 }
9715 return returnValue__;
9716}
9717std::optional<discordpp::UserHandle> MessageHandle::Author() const
9718{
9719 assert(state_ == DiscordObjectState::Owned);
9720 bool returnIsNonNull__;
9721 Discord_UserHandle returnValueNative__;
9722 returnIsNonNull__ = Discord_MessageHandle_Author(&instance_, &returnValueNative__);
9723 if (!returnIsNonNull__) {
9724 return {};
9725 }
9726 discordpp::UserHandle returnValue__(returnValueNative__, DiscordObjectState::Owned);
9727 return returnValue__;
9728}
9729uint64_t MessageHandle::AuthorId() const
9730{
9731 assert(state_ == DiscordObjectState::Owned);
9732 uint64_t returnValue__;
9733 returnValue__ = Discord_MessageHandle_AuthorId(&instance_);
9734 return returnValue__;
9735}
9736std::optional<discordpp::ChannelHandle> MessageHandle::Channel() const
9737{
9738 assert(state_ == DiscordObjectState::Owned);
9739 bool returnIsNonNull__;
9740 Discord_ChannelHandle returnValueNative__;
9741 returnIsNonNull__ = Discord_MessageHandle_Channel(&instance_, &returnValueNative__);
9742 if (!returnIsNonNull__) {
9743 return {};
9744 }
9745 discordpp::ChannelHandle returnValue__(returnValueNative__, DiscordObjectState::Owned);
9746 return returnValue__;
9747}
9748uint64_t MessageHandle::ChannelId() const
9749{
9750 assert(state_ == DiscordObjectState::Owned);
9751 uint64_t returnValue__;
9752 returnValue__ = Discord_MessageHandle_ChannelId(&instance_);
9753 return returnValue__;
9754}
9755std::string MessageHandle::Content() const
9756{
9757 assert(state_ == DiscordObjectState::Owned);
9758 Discord_String returnValueNative__;
9759 Discord_MessageHandle_Content(&instance_, &returnValueNative__);
9760 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
9761 returnValueNative__.size);
9762 Discord_Free(returnValueNative__.ptr);
9763 return returnValue__;
9764}
9765std::optional<discordpp::DisclosureTypes> MessageHandle::DisclosureType() const
9766{
9767 assert(state_ == DiscordObjectState::Owned);
9768 bool returnIsNonNull__;
9769 Discord_DisclosureTypes returnValueNative__;
9770 returnIsNonNull__ = Discord_MessageHandle_DisclosureType(&instance_, &returnValueNative__);
9771 if (!returnIsNonNull__) {
9772 return {};
9773 }
9774 auto returnValue__ = static_cast<discordpp::DisclosureTypes>(returnValueNative__);
9775 return returnValue__;
9776}
9777uint64_t MessageHandle::EditedTimestamp() const
9778{
9779 assert(state_ == DiscordObjectState::Owned);
9780 uint64_t returnValue__;
9781 returnValue__ = Discord_MessageHandle_EditedTimestamp(&instance_);
9782 return returnValue__;
9783}
9784uint64_t MessageHandle::Id() const
9785{
9786 assert(state_ == DiscordObjectState::Owned);
9787 uint64_t returnValue__;
9788 returnValue__ = Discord_MessageHandle_Id(&instance_);
9789 return returnValue__;
9790}
9791std::optional<discordpp::LobbyHandle> MessageHandle::Lobby() const
9792{
9793 assert(state_ == DiscordObjectState::Owned);
9794 bool returnIsNonNull__;
9795 Discord_LobbyHandle returnValueNative__;
9796 returnIsNonNull__ = Discord_MessageHandle_Lobby(&instance_, &returnValueNative__);
9797 if (!returnIsNonNull__) {
9798 return {};
9799 }
9800 discordpp::LobbyHandle returnValue__(returnValueNative__, DiscordObjectState::Owned);
9801 return returnValue__;
9802}
9803std::unordered_map<std::string, std::string> MessageHandle::Metadata() const
9804{
9805 assert(state_ == DiscordObjectState::Owned);
9806 Discord_Properties returnValueNative__;
9807 Discord_MessageHandle_Metadata(&instance_, &returnValueNative__);
9808 std::unordered_map<std::string, std::string> returnValue__ =
9809 ConvertReturnedProperties(returnValueNative__);
9810 Discord_FreeProperties(returnValueNative__);
9811 return returnValue__;
9812}
9813std::unordered_map<std::string, std::string> MessageHandle::ModerationMetadata() const
9814{
9815 assert(state_ == DiscordObjectState::Owned);
9816 Discord_Properties returnValueNative__;
9817 Discord_MessageHandle_ModerationMetadata(&instance_, &returnValueNative__);
9818 std::unordered_map<std::string, std::string> returnValue__ =
9819 ConvertReturnedProperties(returnValueNative__);
9820 Discord_FreeProperties(returnValueNative__);
9821 return returnValue__;
9822}
9823std::string MessageHandle::RawContent() const
9824{
9825 assert(state_ == DiscordObjectState::Owned);
9826 Discord_String returnValueNative__;
9827 Discord_MessageHandle_RawContent(&instance_, &returnValueNative__);
9828 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
9829 returnValueNative__.size);
9830 Discord_Free(returnValueNative__.ptr);
9831 return returnValue__;
9832}
9833std::optional<discordpp::UserHandle> MessageHandle::Recipient() const
9834{
9835 assert(state_ == DiscordObjectState::Owned);
9836 bool returnIsNonNull__;
9837 Discord_UserHandle returnValueNative__;
9838 returnIsNonNull__ = Discord_MessageHandle_Recipient(&instance_, &returnValueNative__);
9839 if (!returnIsNonNull__) {
9840 return {};
9841 }
9842 discordpp::UserHandle returnValue__(returnValueNative__, DiscordObjectState::Owned);
9843 return returnValue__;
9844}
9845uint64_t MessageHandle::RecipientId() const
9846{
9847 assert(state_ == DiscordObjectState::Owned);
9848 uint64_t returnValue__;
9849 returnValue__ = Discord_MessageHandle_RecipientId(&instance_);
9850 return returnValue__;
9851}
9852bool MessageHandle::SentFromGame() const
9853{
9854 assert(state_ == DiscordObjectState::Owned);
9855 bool returnValue__;
9856 returnValue__ = Discord_MessageHandle_SentFromGame(&instance_);
9857 return returnValue__;
9858}
9859uint64_t MessageHandle::SentTimestamp() const
9860{
9861 assert(state_ == DiscordObjectState::Owned);
9862 uint64_t returnValue__;
9863 returnValue__ = Discord_MessageHandle_SentTimestamp(&instance_);
9864 return returnValue__;
9865}
9866const AudioDevice AudioDevice::nullobj{{}, DiscordObjectState::Invalid};
9867AudioDevice::~AudioDevice()
9868{
9869 if (state_ == DiscordObjectState::Owned) {
9870 Drop();
9871 state_ = DiscordObjectState::Invalid;
9872 }
9873}
9874AudioDevice::AudioDevice(AudioDevice&& other) noexcept
9875 : instance_(other.instance_)
9876 , state_(other.state_)
9877{
9878 other.state_ = DiscordObjectState::Invalid;
9879}
9880AudioDevice& AudioDevice::operator=(AudioDevice&& other) noexcept
9881{
9882 if (this != &other) {
9883 if (state_ == DiscordObjectState::Owned) {
9884 Drop();
9885 }
9886 instance_ = other.instance_;
9887 state_ = other.state_;
9888 other.state_ = DiscordObjectState::Invalid;
9889 }
9890 return *this;
9891}
9892AudioDevice::AudioDevice(const AudioDevice& arg0)
9893 : instance_{}
9894 , state_(DiscordObjectState::Invalid)
9895{
9896 if (arg0.state_ == DiscordObjectState::Owned) {
9897 Discord_AudioDevice_Clone(&instance_, arg0.instance());
9898
9899 state_ = DiscordObjectState::Owned;
9900 }
9901}
9902AudioDevice& AudioDevice::operator=(const AudioDevice& arg0)
9903{
9904 if (this != &arg0) {
9905 if (state_ == DiscordObjectState::Owned) {
9906 Drop();
9907 state_ = DiscordObjectState::Invalid;
9908 }
9909 if (arg0.state_ == DiscordObjectState::Owned) {
9910 Discord_AudioDevice_Clone(&instance_, arg0.instance());
9911
9912 state_ = DiscordObjectState::Owned;
9913 }
9914 }
9915 return *this;
9916}
9917AudioDevice::AudioDevice(Discord_AudioDevice instance, DiscordObjectState state)
9918 : instance_(instance)
9919 , state_(state)
9920{
9921}
9922void AudioDevice::Drop()
9923{
9924 if (state_ != DiscordObjectState::Owned) {
9925 return;
9926 }
9927 Discord_AudioDevice_Drop(&instance_);
9928 state_ = DiscordObjectState::Invalid;
9929}
9930bool AudioDevice::Equals(discordpp::AudioDevice rhs)
9931{
9932 assert(state_ == DiscordObjectState::Owned);
9933 bool returnValue__;
9934 returnValue__ = Discord_AudioDevice_Equals(&instance_, rhs.instance());
9935 return returnValue__;
9936}
9937std::string AudioDevice::Id() const
9938{
9939 assert(state_ == DiscordObjectState::Owned);
9940 Discord_String returnValueNative__;
9941 Discord_AudioDevice_Id(&instance_, &returnValueNative__);
9942 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
9943 returnValueNative__.size);
9944 Discord_Free(returnValueNative__.ptr);
9945 return returnValue__;
9946}
9947void AudioDevice::SetId(std::string Id)
9948{
9949 assert(state_ == DiscordObjectState::Owned);
9950 Discord_String Id__str{(uint8_t*)(Id.data()), Id.size()};
9951 Discord_AudioDevice_SetId(&instance_, Id__str);
9952}
9953std::string AudioDevice::Name() const
9954{
9955 assert(state_ == DiscordObjectState::Owned);
9956 Discord_String returnValueNative__;
9957 Discord_AudioDevice_Name(&instance_, &returnValueNative__);
9958 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
9959 returnValueNative__.size);
9960 Discord_Free(returnValueNative__.ptr);
9961 return returnValue__;
9962}
9963void AudioDevice::SetName(std::string Name)
9964{
9965 assert(state_ == DiscordObjectState::Owned);
9966 Discord_String Name__str{(uint8_t*)(Name.data()), Name.size()};
9967 Discord_AudioDevice_SetName(&instance_, Name__str);
9968}
9969bool AudioDevice::IsDefault() const
9970{
9971 assert(state_ == DiscordObjectState::Owned);
9972 bool returnValue__;
9973 returnValue__ = Discord_AudioDevice_IsDefault(&instance_);
9974 return returnValue__;
9975}
9976void AudioDevice::SetIsDefault(bool IsDefault)
9977{
9978 assert(state_ == DiscordObjectState::Owned);
9979 Discord_AudioDevice_SetIsDefault(&instance_, IsDefault);
9980}
9981const UserMessageSummary UserMessageSummary::nullobj{{}, DiscordObjectState::Invalid};
9982UserMessageSummary::~UserMessageSummary()
9983{
9984 if (state_ == DiscordObjectState::Owned) {
9985 Drop();
9986 state_ = DiscordObjectState::Invalid;
9987 }
9988}
9989UserMessageSummary::UserMessageSummary(UserMessageSummary&& other) noexcept
9990 : instance_(other.instance_)
9991 , state_(other.state_)
9992{
9993 other.state_ = DiscordObjectState::Invalid;
9994}
9995UserMessageSummary& UserMessageSummary::operator=(UserMessageSummary&& other) noexcept
9996{
9997 if (this != &other) {
9998 if (state_ == DiscordObjectState::Owned) {
9999 Drop();
10000 }
10001 instance_ = other.instance_;
10002 state_ = other.state_;
10003 other.state_ = DiscordObjectState::Invalid;
10004 }
10005 return *this;
10006}
10007UserMessageSummary::UserMessageSummary(const UserMessageSummary& arg0)
10008 : instance_{}
10009 , state_(DiscordObjectState::Invalid)
10010{
10011 if (arg0.state_ == DiscordObjectState::Owned) {
10012 Discord_UserMessageSummary_Clone(&instance_, arg0.instance());
10013
10014 state_ = DiscordObjectState::Owned;
10015 }
10016}
10017UserMessageSummary& UserMessageSummary::operator=(const UserMessageSummary& arg0)
10018{
10019 if (this != &arg0) {
10020 if (state_ == DiscordObjectState::Owned) {
10021 Drop();
10022 state_ = DiscordObjectState::Invalid;
10023 }
10024 if (arg0.state_ == DiscordObjectState::Owned) {
10025 Discord_UserMessageSummary_Clone(&instance_, arg0.instance());
10026
10027 state_ = DiscordObjectState::Owned;
10028 }
10029 }
10030 return *this;
10031}
10032UserMessageSummary::UserMessageSummary(Discord_UserMessageSummary instance,
10033 DiscordObjectState state)
10034 : instance_(instance)
10035 , state_(state)
10036{
10037}
10038void UserMessageSummary::Drop()
10039{
10040 if (state_ != DiscordObjectState::Owned) {
10041 return;
10042 }
10043 Discord_UserMessageSummary_Drop(&instance_);
10044 state_ = DiscordObjectState::Invalid;
10045}
10046uint64_t UserMessageSummary::LastMessageId() const
10047{
10048 assert(state_ == DiscordObjectState::Owned);
10049 uint64_t returnValue__;
10050 returnValue__ = Discord_UserMessageSummary_LastMessageId(&instance_);
10051 return returnValue__;
10052}
10053uint64_t UserMessageSummary::UserId() const
10054{
10055 assert(state_ == DiscordObjectState::Owned);
10056 uint64_t returnValue__;
10057 returnValue__ = Discord_UserMessageSummary_UserId(&instance_);
10058 return returnValue__;
10059}
10060const ClientCreateOptions ClientCreateOptions::nullobj{{}, DiscordObjectState::Invalid};
10061ClientCreateOptions::~ClientCreateOptions()
10062{
10063 if (state_ == DiscordObjectState::Owned) {
10064 Drop();
10065 state_ = DiscordObjectState::Invalid;
10066 }
10067}
10068ClientCreateOptions::ClientCreateOptions(ClientCreateOptions&& other) noexcept
10069 : instance_(other.instance_)
10070 , state_(other.state_)
10071{
10072 other.state_ = DiscordObjectState::Invalid;
10073}
10074ClientCreateOptions& ClientCreateOptions::operator=(ClientCreateOptions&& other) noexcept
10075{
10076 if (this != &other) {
10077 if (state_ == DiscordObjectState::Owned) {
10078 Drop();
10079 }
10080 instance_ = other.instance_;
10081 state_ = other.state_;
10082 other.state_ = DiscordObjectState::Invalid;
10083 }
10084 return *this;
10085}
10086ClientCreateOptions::ClientCreateOptions(const ClientCreateOptions& arg0)
10087 : instance_{}
10088 , state_(DiscordObjectState::Invalid)
10089{
10090 if (arg0.state_ == DiscordObjectState::Owned) {
10091 Discord_ClientCreateOptions_Clone(&instance_, arg0.instance());
10092
10093 state_ = DiscordObjectState::Owned;
10094 }
10095}
10096ClientCreateOptions& ClientCreateOptions::operator=(const ClientCreateOptions& arg0)
10097{
10098 if (this != &arg0) {
10099 if (state_ == DiscordObjectState::Owned) {
10100 Drop();
10101 state_ = DiscordObjectState::Invalid;
10102 }
10103 if (arg0.state_ == DiscordObjectState::Owned) {
10104 Discord_ClientCreateOptions_Clone(&instance_, arg0.instance());
10105
10106 state_ = DiscordObjectState::Owned;
10107 }
10108 }
10109 return *this;
10110}
10111ClientCreateOptions::ClientCreateOptions(Discord_ClientCreateOptions instance,
10112 DiscordObjectState state)
10113 : instance_(instance)
10114 , state_(state)
10115{
10116}
10117ClientCreateOptions::ClientCreateOptions()
10118{
10119 assert(state_ == DiscordObjectState::Invalid);
10120 Discord_ClientCreateOptions_Init(&instance_);
10121 state_ = DiscordObjectState::Owned;
10122}
10123void ClientCreateOptions::Drop()
10124{
10125 if (state_ != DiscordObjectState::Owned) {
10126 return;
10127 }
10128 Discord_ClientCreateOptions_Drop(&instance_);
10129 state_ = DiscordObjectState::Invalid;
10130}
10131std::string ClientCreateOptions::WebBase() const
10132{
10133 assert(state_ == DiscordObjectState::Owned);
10134 Discord_String returnValueNative__;
10135 Discord_ClientCreateOptions_WebBase(&instance_, &returnValueNative__);
10136 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
10137 returnValueNative__.size);
10138 Discord_Free(returnValueNative__.ptr);
10139 return returnValue__;
10140}
10141void ClientCreateOptions::SetWebBase(std::string WebBase)
10142{
10143 assert(state_ == DiscordObjectState::Owned);
10144 Discord_String WebBase__str{(uint8_t*)(WebBase.data()), WebBase.size()};
10145 Discord_ClientCreateOptions_SetWebBase(&instance_, WebBase__str);
10146}
10147std::string ClientCreateOptions::ApiBase() const
10148{
10149 assert(state_ == DiscordObjectState::Owned);
10150 Discord_String returnValueNative__;
10151 Discord_ClientCreateOptions_ApiBase(&instance_, &returnValueNative__);
10152 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
10153 returnValueNative__.size);
10154 Discord_Free(returnValueNative__.ptr);
10155 return returnValue__;
10156}
10157void ClientCreateOptions::SetApiBase(std::string ApiBase)
10158{
10159 assert(state_ == DiscordObjectState::Owned);
10160 Discord_String ApiBase__str{(uint8_t*)(ApiBase.data()), ApiBase.size()};
10161 Discord_ClientCreateOptions_SetApiBase(&instance_, ApiBase__str);
10162}
10163discordpp::AudioSystem ClientCreateOptions::ExperimentalAudioSystem() const
10164{
10165 assert(state_ == DiscordObjectState::Owned);
10166 Discord_AudioSystem returnValue__;
10167 returnValue__ = Discord_ClientCreateOptions_ExperimentalAudioSystem(&instance_);
10168 return static_cast<discordpp::AudioSystem>(returnValue__);
10169}
10170void ClientCreateOptions::SetExperimentalAudioSystem(discordpp::AudioSystem ExperimentalAudioSystem)
10171{
10172 assert(state_ == DiscordObjectState::Owned);
10173 Discord_ClientCreateOptions_SetExperimentalAudioSystem(
10174 &instance_, static_cast<Discord_AudioSystem>(ExperimentalAudioSystem));
10175}
10176bool ClientCreateOptions::ExperimentalAndroidPreventCommsForBluetooth() const
10177{
10178 assert(state_ == DiscordObjectState::Owned);
10179 bool returnValue__;
10180 returnValue__ =
10181 Discord_ClientCreateOptions_ExperimentalAndroidPreventCommsForBluetooth(&instance_);
10182 return returnValue__;
10183}
10184void ClientCreateOptions::SetExperimentalAndroidPreventCommsForBluetooth(
10185 bool ExperimentalAndroidPreventCommsForBluetooth)
10186{
10187 assert(state_ == DiscordObjectState::Owned);
10188 Discord_ClientCreateOptions_SetExperimentalAndroidPreventCommsForBluetooth(
10189 &instance_, ExperimentalAndroidPreventCommsForBluetooth);
10190}
10191std::optional<uint64_t> ClientCreateOptions::CpuAffinityMask() const
10192{
10193 assert(state_ == DiscordObjectState::Owned);
10194 bool returnIsNonNull__;
10195 uint64_t returnValue__;
10196 returnIsNonNull__ = Discord_ClientCreateOptions_CpuAffinityMask(&instance_, &returnValue__);
10197 if (!returnIsNonNull__) {
10198 return std::nullopt;
10199 }
10200 return returnValue__;
10201}
10202void ClientCreateOptions::SetCpuAffinityMask(std::optional<uint64_t> CpuAffinityMask)
10203{
10204 assert(state_ == DiscordObjectState::Owned);
10205 Discord_ClientCreateOptions_SetCpuAffinityMask(
10206 &instance_, (CpuAffinityMask.has_value() ? &*CpuAffinityMask : nullptr));
10207}
10208const Client Client::nullobj{{}, DiscordObjectState::Invalid};
10209Client::~Client()
10210{
10211 if (state_ == DiscordObjectState::Owned) {
10212 Drop();
10213 state_ = DiscordObjectState::Invalid;
10214 }
10215}
10216Client::Client(Client&& other) noexcept
10217 : instance_(other.instance_)
10218 , state_(other.state_)
10219{
10220 other.state_ = DiscordObjectState::Invalid;
10221}
10222Client& Client::operator=(Client&& other) noexcept
10223{
10224 if (this != &other) {
10225 if (state_ == DiscordObjectState::Owned) {
10226 Drop();
10227 }
10228 instance_ = other.instance_;
10229 state_ = other.state_;
10230 other.state_ = DiscordObjectState::Invalid;
10231 }
10232 return *this;
10233}
10234Client::Client(Discord_Client instance, DiscordObjectState state)
10235 : instance_(instance)
10236 , state_(state)
10237{
10238}
10239Client::Client()
10240{
10241 assert(state_ == DiscordObjectState::Invalid);
10242 Discord_Client_Init(&instance_);
10243 state_ = DiscordObjectState::Owned;
10244}
10245Client::Client(std::string apiBase, std::string webBase)
10246{
10247 assert(state_ == DiscordObjectState::Invalid);
10248 Discord_String apiBase__str{(uint8_t*)(apiBase.data()), apiBase.size()};
10249 Discord_String webBase__str{(uint8_t*)(webBase.data()), webBase.size()};
10250 Discord_Client_InitWithBases(&instance_, apiBase__str, webBase__str);
10251 state_ = DiscordObjectState::Owned;
10252}
10253Client::Client(discordpp::ClientCreateOptions options)
10254{
10255 assert(state_ == DiscordObjectState::Invalid);
10256 Discord_Client_InitWithOptions(&instance_, options.instance());
10257 state_ = DiscordObjectState::Owned;
10258}
10259void Client::Drop()
10260{
10261 if (state_ != DiscordObjectState::Owned) {
10262 return;
10263 }
10264 Discord_Client_Drop(&instance_);
10265 state_ = DiscordObjectState::Invalid;
10266}
10267std::string Client::ErrorToString(discordpp::Client::Error type)
10268{
10269 Discord_String returnValueNative__;
10270 Discord_Client_ErrorToString(static_cast<Discord_Client_Error>(type), &returnValueNative__);
10271 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
10272 returnValueNative__.size);
10273 Discord_Free(returnValueNative__.ptr);
10274 return returnValue__;
10275}
10276uint64_t Client::GetApplicationId()
10277{
10278 assert(state_ == DiscordObjectState::Owned);
10279 uint64_t returnValue__;
10280 returnValue__ = Discord_Client_GetApplicationId(&instance_);
10281 return returnValue__;
10282}
10283discordpp::UserHandle Client::GetCurrentUser() const
10284{
10285 assert(state_ == DiscordObjectState::Owned);
10286 Discord_UserHandle returnValueNative__{};
10287 Discord_Client_GetCurrentUser(&instance_, &returnValueNative__);
10288 discordpp::UserHandle returnValue__(returnValueNative__, DiscordObjectState::Owned);
10289 return returnValue__;
10290}
10291std::string Client::GetDefaultAudioDeviceId()
10292{
10293 Discord_String returnValueNative__;
10294 Discord_Client_GetDefaultAudioDeviceId(&returnValueNative__);
10295 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
10296 returnValueNative__.size);
10297 Discord_Free(returnValueNative__.ptr);
10298 return returnValue__;
10299}
10300std::string Client::GetDefaultCommunicationScopes()
10301{
10302 Discord_String returnValueNative__;
10303 Discord_Client_GetDefaultCommunicationScopes(&returnValueNative__);
10304 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
10305 returnValueNative__.size);
10306 Discord_Free(returnValueNative__.ptr);
10307 return returnValue__;
10308}
10309std::string Client::GetDefaultPresenceScopes()
10310{
10311 Discord_String returnValueNative__;
10312 Discord_Client_GetDefaultPresenceScopes(&returnValueNative__);
10313 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
10314 returnValueNative__.size);
10315 Discord_Free(returnValueNative__.ptr);
10316 return returnValue__;
10317}
10318std::string Client::GetVersionHash()
10319{
10320 Discord_String returnValueNative__;
10321 Discord_Client_GetVersionHash(&returnValueNative__);
10322 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
10323 returnValueNative__.size);
10324 Discord_Free(returnValueNative__.ptr);
10325 return returnValue__;
10326}
10327int32_t Client::GetVersionMajor()
10328{
10329 int32_t returnValue__;
10330 returnValue__ = Discord_Client_GetVersionMajor();
10331 return returnValue__;
10332}
10333int32_t Client::GetVersionMinor()
10334{
10335 int32_t returnValue__;
10336 returnValue__ = Discord_Client_GetVersionMinor();
10337 return returnValue__;
10338}
10339int32_t Client::GetVersionPatch()
10340{
10341 int32_t returnValue__;
10342 returnValue__ = Discord_Client_GetVersionPatch();
10343 return returnValue__;
10344}
10345void Client::SetHttpRequestTimeout(int32_t httpTimeoutInMilliseconds)
10346{
10347 assert(state_ == DiscordObjectState::Owned);
10348 Discord_Client_SetHttpRequestTimeout(&instance_, httpTimeoutInMilliseconds);
10349}
10350std::string Client::StatusToString(discordpp::Client::Status type)
10351{
10352 Discord_String returnValueNative__;
10353 Discord_Client_StatusToString(static_cast<Discord_Client_Status>(type), &returnValueNative__);
10354 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
10355 returnValueNative__.size);
10356 Discord_Free(returnValueNative__.ptr);
10357 return returnValue__;
10358}
10359std::string Client::ThreadToString(discordpp::Client::Thread type)
10360{
10361 Discord_String returnValueNative__;
10362 Discord_Client_ThreadToString(static_cast<Discord_Client_Thread>(type), &returnValueNative__);
10363 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
10364 returnValueNative__.size);
10365 Discord_Free(returnValueNative__.ptr);
10366 return returnValue__;
10367}
10368void Client::EndCall(uint64_t channelId, discordpp::Client::EndCallCallback callback)
10369{
10370 assert(state_ == DiscordObjectState::Owned);
10371 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
10372 auto callback__userData = new Tcallback__UserData(callback);
10373 Discord_Client_EndCallCallback callback__native = [](void* userData__) {
10374 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
10375 userData__typed->delegate();
10376 };
10377 Discord_Client_EndCall(
10378 &instance_, channelId, callback__native, Tcallback__UserData::Free, callback__userData);
10379}
10380void Client::EndCalls(discordpp::Client::EndCallsCallback callback)
10381{
10382 assert(state_ == DiscordObjectState::Owned);
10383 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
10384 auto callback__userData = new Tcallback__UserData(callback);
10385 Discord_Client_EndCallsCallback callback__native = [](void* userData__) {
10386 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
10387 userData__typed->delegate();
10388 };
10389 Discord_Client_EndCalls(
10390 &instance_, callback__native, Tcallback__UserData::Free, callback__userData);
10391}
10392discordpp::Call Client::GetCall(uint64_t channelId)
10393{
10394 assert(state_ == DiscordObjectState::Owned);
10395 bool returnIsNonNull__;
10396 Discord_Call returnValueNative__{};
10397 returnIsNonNull__ = Discord_Client_GetCall(&instance_, channelId, &returnValueNative__);
10398 discordpp::Call returnValue__(
10399 returnValueNative__,
10400 returnIsNonNull__ ? DiscordObjectState::Owned : DiscordObjectState::Invalid);
10401 return returnValue__;
10402}
10403std::vector<discordpp::Call> Client::GetCalls()
10404{
10405 assert(state_ == DiscordObjectState::Owned);
10406 Discord_CallSpan returnValueNative__;
10407 Discord_Client_GetCalls(&instance_, &returnValueNative__);
10408 std::vector<discordpp::Call> returnValue__;
10409 returnValue__.reserve(returnValueNative__.size);
10410 for (size_t i__ = 0; i__ < returnValueNative__.size; ++i__) {
10411 returnValue__.emplace_back(returnValueNative__.ptr[i__], DiscordObjectState::Owned);
10412 }
10413 Discord_Free(returnValueNative__.ptr);
10414 return returnValue__;
10415}
10416void Client::GetCurrentInputDevice(discordpp::Client::GetCurrentInputDeviceCallback cb)
10417{
10418 assert(state_ == DiscordObjectState::Owned);
10419 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
10420 auto cb__userData = new Tcb__UserData(cb);
10421 Discord_Client_GetCurrentInputDeviceCallback cb__native = [](auto device, void* userData__) {
10422 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
10423 discordpp::AudioDevice device__obj(*device, DiscordObjectState::Owned);
10424 userData__typed->delegate(std::move(device__obj));
10425 };
10426 Discord_Client_GetCurrentInputDevice(&instance_, cb__native, Tcb__UserData::Free, cb__userData);
10427}
10428void Client::GetCurrentOutputDevice(discordpp::Client::GetCurrentOutputDeviceCallback cb)
10429{
10430 assert(state_ == DiscordObjectState::Owned);
10431 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
10432 auto cb__userData = new Tcb__UserData(cb);
10433 Discord_Client_GetCurrentOutputDeviceCallback cb__native = [](auto device, void* userData__) {
10434 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
10435 discordpp::AudioDevice device__obj(*device, DiscordObjectState::Owned);
10436 userData__typed->delegate(std::move(device__obj));
10437 };
10438 Discord_Client_GetCurrentOutputDevice(
10439 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
10440}
10441void Client::GetInputDevices(discordpp::Client::GetInputDevicesCallback cb)
10442{
10443 assert(state_ == DiscordObjectState::Owned);
10444 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
10445 auto cb__userData = new Tcb__UserData(cb);
10446 Discord_Client_GetInputDevicesCallback cb__native = [](auto devices, void* userData__) {
10447 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
10448 std::vector<discordpp::AudioDevice> devices__vec;
10449 devices__vec.reserve(devices.size);
10450 for (size_t i__ = 0; i__ < devices.size; ++i__) {
10451 devices__vec.emplace_back(devices.ptr[i__], DiscordObjectState::Owned);
10452 }
10453 Discord_Free(devices.ptr);
10454 userData__typed->delegate(std::move(devices__vec));
10455 };
10456 Discord_Client_GetInputDevices(&instance_, cb__native, Tcb__UserData::Free, cb__userData);
10457}
10458float Client::GetInputVolume()
10459{
10460 assert(state_ == DiscordObjectState::Owned);
10461 float returnValue__;
10462 returnValue__ = Discord_Client_GetInputVolume(&instance_);
10463 return returnValue__;
10464}
10465void Client::GetOutputDevices(discordpp::Client::GetOutputDevicesCallback cb)
10466{
10467 assert(state_ == DiscordObjectState::Owned);
10468 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
10469 auto cb__userData = new Tcb__UserData(cb);
10470 Discord_Client_GetOutputDevicesCallback cb__native = [](auto devices, void* userData__) {
10471 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
10472 std::vector<discordpp::AudioDevice> devices__vec;
10473 devices__vec.reserve(devices.size);
10474 for (size_t i__ = 0; i__ < devices.size; ++i__) {
10475 devices__vec.emplace_back(devices.ptr[i__], DiscordObjectState::Owned);
10476 }
10477 Discord_Free(devices.ptr);
10478 userData__typed->delegate(std::move(devices__vec));
10479 };
10480 Discord_Client_GetOutputDevices(&instance_, cb__native, Tcb__UserData::Free, cb__userData);
10481}
10482float Client::GetOutputVolume()
10483{
10484 assert(state_ == DiscordObjectState::Owned);
10485 float returnValue__;
10486 returnValue__ = Discord_Client_GetOutputVolume(&instance_);
10487 return returnValue__;
10488}
10489bool Client::GetSelfDeafAll() const
10490{
10491 assert(state_ == DiscordObjectState::Owned);
10492 bool returnValue__;
10493 returnValue__ = Discord_Client_GetSelfDeafAll(&instance_);
10494 return returnValue__;
10495}
10496bool Client::GetSelfMuteAll() const
10497{
10498 assert(state_ == DiscordObjectState::Owned);
10499 bool returnValue__;
10500 returnValue__ = Discord_Client_GetSelfMuteAll(&instance_);
10501 return returnValue__;
10502}
10503void Client::SetAecDump(bool on)
10504{
10505 assert(state_ == DiscordObjectState::Owned);
10506 Discord_Client_SetAecDump(&instance_, on);
10507}
10508void Client::SetAutomaticGainControl(bool on)
10509{
10510 assert(state_ == DiscordObjectState::Owned);
10511 Discord_Client_SetAutomaticGainControl(&instance_, on);
10512}
10513void Client::SetDeviceChangeCallback(discordpp::Client::DeviceChangeCallback callback)
10514{
10515 assert(state_ == DiscordObjectState::Owned);
10516 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
10517 auto callback__userData = new Tcallback__UserData(callback);
10518 Discord_Client_DeviceChangeCallback callback__native =
10519 [](auto inputDevices, auto outputDevices, void* userData__) {
10520 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
10521 std::vector<discordpp::AudioDevice> inputDevices__vec;
10522 inputDevices__vec.reserve(inputDevices.size);
10523 for (size_t i__ = 0; i__ < inputDevices.size; ++i__) {
10524 inputDevices__vec.emplace_back(inputDevices.ptr[i__], DiscordObjectState::Owned);
10525 }
10526 Discord_Free(inputDevices.ptr);
10527 std::vector<discordpp::AudioDevice> outputDevices__vec;
10528 outputDevices__vec.reserve(outputDevices.size);
10529 for (size_t i__ = 0; i__ < outputDevices.size; ++i__) {
10530 outputDevices__vec.emplace_back(outputDevices.ptr[i__], DiscordObjectState::Owned);
10531 }
10532 Discord_Free(outputDevices.ptr);
10533 userData__typed->delegate(std::move(inputDevices__vec), std::move(outputDevices__vec));
10534 };
10535 Discord_Client_SetDeviceChangeCallback(
10536 &instance_, callback__native, Tcallback__UserData::Free, callback__userData);
10537}
10538void Client::SetEchoCancellation(bool on)
10539{
10540 assert(state_ == DiscordObjectState::Owned);
10541 Discord_Client_SetEchoCancellation(&instance_, on);
10542}
10543void Client::SetEngineManagedAudioSession(bool isEngineManaged)
10544{
10545 assert(state_ == DiscordObjectState::Owned);
10546 Discord_Client_SetEngineManagedAudioSession(&instance_, isEngineManaged);
10547}
10548void Client::SetInputDevice(std::string deviceId, discordpp::Client::SetInputDeviceCallback cb)
10549{
10550 assert(state_ == DiscordObjectState::Owned);
10551 Discord_String deviceId__str{(uint8_t*)(deviceId.data()), deviceId.size()};
10552 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
10553 auto cb__userData = new Tcb__UserData(cb);
10554 Discord_Client_SetInputDeviceCallback cb__native = [](auto result, void* userData__) {
10555 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
10556 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
10557 userData__typed->delegate(std::move(result__obj));
10558 };
10559 Discord_Client_SetInputDevice(
10560 &instance_, deviceId__str, cb__native, Tcb__UserData::Free, cb__userData);
10561}
10562void Client::SetInputVolume(float inputVolume)
10563{
10564 assert(state_ == DiscordObjectState::Owned);
10565 Discord_Client_SetInputVolume(&instance_, inputVolume);
10566}
10567void Client::SetNoAudioInputCallback(discordpp::Client::NoAudioInputCallback callback)
10568{
10569 assert(state_ == DiscordObjectState::Owned);
10570 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
10571 auto callback__userData = new Tcallback__UserData(callback);
10572 Discord_Client_NoAudioInputCallback callback__native = [](auto inputDetected,
10573 void* userData__) {
10574 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
10575 userData__typed->delegate(inputDetected);
10576 };
10577 Discord_Client_SetNoAudioInputCallback(
10578 &instance_, callback__native, Tcallback__UserData::Free, callback__userData);
10579}
10580void Client::SetNoAudioInputThreshold(float dBFSThreshold)
10581{
10582 assert(state_ == DiscordObjectState::Owned);
10583 Discord_Client_SetNoAudioInputThreshold(&instance_, dBFSThreshold);
10584}
10585void Client::SetNoiseCancellation(bool on)
10586{
10587 assert(state_ == DiscordObjectState::Owned);
10588 Discord_Client_SetNoiseCancellation(&instance_, on);
10589}
10590void Client::SetNoiseSuppression(bool on)
10591{
10592 assert(state_ == DiscordObjectState::Owned);
10593 Discord_Client_SetNoiseSuppression(&instance_, on);
10594}
10595void Client::SetOpusHardwareCoding(bool encode, bool decode)
10596{
10597 assert(state_ == DiscordObjectState::Owned);
10598 Discord_Client_SetOpusHardwareCoding(&instance_, encode, decode);
10599}
10600void Client::SetOutputDevice(std::string deviceId, discordpp::Client::SetOutputDeviceCallback cb)
10601{
10602 assert(state_ == DiscordObjectState::Owned);
10603 Discord_String deviceId__str{(uint8_t*)(deviceId.data()), deviceId.size()};
10604 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
10605 auto cb__userData = new Tcb__UserData(cb);
10606 Discord_Client_SetOutputDeviceCallback cb__native = [](auto result, void* userData__) {
10607 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
10608 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
10609 userData__typed->delegate(std::move(result__obj));
10610 };
10611 Discord_Client_SetOutputDevice(
10612 &instance_, deviceId__str, cb__native, Tcb__UserData::Free, cb__userData);
10613}
10614void Client::SetOutputVolume(float outputVolume)
10615{
10616 assert(state_ == DiscordObjectState::Owned);
10617 Discord_Client_SetOutputVolume(&instance_, outputVolume);
10618}
10619void Client::SetSelfDeafAll(bool deaf)
10620{
10621 assert(state_ == DiscordObjectState::Owned);
10622 Discord_Client_SetSelfDeafAll(&instance_, deaf);
10623}
10624void Client::SetSelfMuteAll(bool mute)
10625{
10626 assert(state_ == DiscordObjectState::Owned);
10627 Discord_Client_SetSelfMuteAll(&instance_, mute);
10628}
10629bool Client::SetSpeakerMode(bool speakerMode)
10630{
10631 assert(state_ == DiscordObjectState::Owned);
10632 bool returnValue__;
10633 returnValue__ = Discord_Client_SetSpeakerMode(&instance_, speakerMode);
10634 return returnValue__;
10635}
10636void Client::SetThreadPriority(discordpp::Client::Thread thread, int32_t priority)
10637{
10638 assert(state_ == DiscordObjectState::Owned);
10639 Discord_Client_SetThreadPriority(
10640 &instance_, static_cast<Discord_Client_Thread>(thread), priority);
10641}
10642void Client::SetVoiceParticipantChangedCallback(
10644{
10645 assert(state_ == DiscordObjectState::Owned);
10646 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
10647 auto cb__userData = new Tcb__UserData(cb);
10648 Discord_Client_VoiceParticipantChangedCallback cb__native =
10649 [](auto lobbyId, auto memberId, auto added, void* userData__) {
10650 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
10651 userData__typed->delegate(lobbyId, memberId, added);
10652 };
10653 Discord_Client_SetVoiceParticipantChangedCallback(
10654 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
10655}
10656bool Client::ShowAudioRoutePicker()
10657{
10658 assert(state_ == DiscordObjectState::Owned);
10659 bool returnValue__;
10660 returnValue__ = Discord_Client_ShowAudioRoutePicker(&instance_);
10661 return returnValue__;
10662}
10663discordpp::Call Client::StartCall(uint64_t channelId)
10664{
10665 assert(state_ == DiscordObjectState::Owned);
10666 bool returnIsNonNull__;
10667 Discord_Call returnValueNative__{};
10668 returnIsNonNull__ = Discord_Client_StartCall(&instance_, channelId, &returnValueNative__);
10669 discordpp::Call returnValue__(
10670 returnValueNative__,
10671 returnIsNonNull__ ? DiscordObjectState::Owned : DiscordObjectState::Invalid);
10672 return returnValue__;
10673}
10674discordpp::Call Client::StartCallWithAudioCallbacks(
10675 uint64_t lobbyId,
10678{
10679 assert(state_ == DiscordObjectState::Owned);
10680 bool returnIsNonNull__;
10681 Discord_Call returnValueNative__{};
10682 using TreceivedCb__UserData = TDelegateUserData<std::remove_reference_t<decltype(receivedCb)>>;
10683 auto receivedCb__userData = new TreceivedCb__UserData(receivedCb);
10684 Discord_Client_UserAudioReceivedCallback receivedCb__native = [](auto userId,
10685 auto data,
10686 auto samplesPerChannel,
10687 auto sampleRate,
10688 auto channels,
10689 auto outShouldMute,
10690 void* userData__) {
10691 auto userData__typed = static_cast<TreceivedCb__UserData*>(userData__);
10692 userData__typed->delegate(
10693 userId, data, samplesPerChannel, sampleRate, channels, *outShouldMute);
10694 };
10695 using TcapturedCb__UserData = TDelegateUserData<std::remove_reference_t<decltype(capturedCb)>>;
10696 auto capturedCb__userData = new TcapturedCb__UserData(capturedCb);
10697 Discord_Client_UserAudioCapturedCallback capturedCb__native =
10698 [](auto data, auto samplesPerChannel, auto sampleRate, auto channels, void* userData__) {
10699 auto userData__typed = static_cast<TcapturedCb__UserData*>(userData__);
10700 userData__typed->delegate(data, samplesPerChannel, sampleRate, channels);
10701 };
10702 returnIsNonNull__ = Discord_Client_StartCallWithAudioCallbacks(&instance_,
10703 lobbyId,
10704 receivedCb__native,
10705 TreceivedCb__UserData::Free,
10706 receivedCb__userData,
10707 capturedCb__native,
10708 TcapturedCb__UserData::Free,
10709 capturedCb__userData,
10710 &returnValueNative__);
10711 discordpp::Call returnValue__(
10712 returnValueNative__,
10713 returnIsNonNull__ ? DiscordObjectState::Owned : DiscordObjectState::Invalid);
10714 return returnValue__;
10715}
10716void Client::AbortAuthorize()
10717{
10718 assert(state_ == DiscordObjectState::Owned);
10719 Discord_Client_AbortAuthorize(&instance_);
10720}
10721void Client::AbortGetTokenFromDevice()
10722{
10723 assert(state_ == DiscordObjectState::Owned);
10724 Discord_Client_AbortGetTokenFromDevice(&instance_);
10725}
10726void Client::Authorize(discordpp::AuthorizationArgs args,
10728{
10729 assert(state_ == DiscordObjectState::Owned);
10730 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
10731 auto callback__userData = new Tcallback__UserData(callback);
10732 Discord_Client_AuthorizationCallback callback__native =
10733 [](auto result, auto code, auto redirectUri, void* userData__) {
10734 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
10735 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
10736 std::string code__str(reinterpret_cast<char*>(code.ptr), code.size);
10737 std::string redirectUri__str(reinterpret_cast<char*>(redirectUri.ptr), redirectUri.size);
10738 userData__typed->delegate(
10739 std::move(result__obj), std::move(code__str), std::move(redirectUri__str));
10740 Discord_Free(redirectUri.ptr);
10741 Discord_Free(code.ptr);
10742 };
10743 Discord_Client_Authorize(
10744 &instance_, args.instance(), callback__native, Tcallback__UserData::Free, callback__userData);
10745}
10746void Client::CloseAuthorizeDeviceScreen()
10747{
10748 assert(state_ == DiscordObjectState::Owned);
10749 Discord_Client_CloseAuthorizeDeviceScreen(&instance_);
10750}
10751discordpp::AuthorizationCodeVerifier Client::CreateAuthorizationCodeVerifier()
10752{
10753 assert(state_ == DiscordObjectState::Owned);
10754 Discord_AuthorizationCodeVerifier returnValueNative__{};
10755 Discord_Client_CreateAuthorizationCodeVerifier(&instance_, &returnValueNative__);
10756 discordpp::AuthorizationCodeVerifier returnValue__(returnValueNative__,
10757 DiscordObjectState::Owned);
10758 return returnValue__;
10759}
10760void Client::ExchangeChildToken(std::string const& parentApplicationToken,
10761 uint64_t childApplicationId,
10763{
10764 assert(state_ == DiscordObjectState::Owned);
10765 Discord_String parentApplicationToken__str{(uint8_t*)(parentApplicationToken.data()),
10766 parentApplicationToken.size()};
10767 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
10768 auto callback__userData = new Tcallback__UserData(callback);
10769 Discord_Client_ExchangeChildTokenCallback callback__native = [](auto result,
10770 auto accessToken,
10771 auto tokenType,
10772 auto expiresIn,
10773 auto scopes,
10774 void* userData__) {
10775 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
10776 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
10777 std::string accessToken__str(reinterpret_cast<char*>(accessToken.ptr), accessToken.size);
10778 std::string scopes__str(reinterpret_cast<char*>(scopes.ptr), scopes.size);
10779 userData__typed->delegate(std::move(result__obj),
10780 std::move(accessToken__str),
10781 static_cast<discordpp::AuthorizationTokenType>(tokenType),
10782 expiresIn,
10783 std::move(scopes__str));
10784 Discord_Free(scopes.ptr);
10785 Discord_Free(accessToken.ptr);
10786 };
10787 Discord_Client_ExchangeChildToken(&instance_,
10788 parentApplicationToken__str,
10789 childApplicationId,
10790 callback__native,
10791 Tcallback__UserData::Free,
10792 callback__userData);
10793}
10794void Client::FetchCurrentUser(discordpp::AuthorizationTokenType tokenType,
10795 std::string const& token,
10797{
10798 assert(state_ == DiscordObjectState::Owned);
10799 Discord_String token__str{(uint8_t*)(token.data()), token.size()};
10800 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
10801 auto callback__userData = new Tcallback__UserData(callback);
10802 Discord_Client_FetchCurrentUserCallback callback__native =
10803 [](auto result, auto id, auto name, void* userData__) {
10804 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
10805 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
10806 std::string name__str(reinterpret_cast<char*>(name.ptr), name.size);
10807 userData__typed->delegate(std::move(result__obj), id, std::move(name__str));
10808 Discord_Free(name.ptr);
10809 };
10810 Discord_Client_FetchCurrentUser(&instance_,
10811 static_cast<Discord_AuthorizationTokenType>(tokenType),
10812 token__str,
10813 callback__native,
10814 Tcallback__UserData::Free,
10815 callback__userData);
10816}
10817void Client::GetProvisionalToken(uint64_t applicationId,
10819 std::string const& externalAuthToken,
10821{
10822 assert(state_ == DiscordObjectState::Owned);
10823 Discord_String externalAuthToken__str{(uint8_t*)(externalAuthToken.data()),
10824 externalAuthToken.size()};
10825 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
10826 auto callback__userData = new Tcallback__UserData(callback);
10827 Discord_Client_TokenExchangeCallback callback__native = [](auto result,
10828 auto accessToken,
10829 auto refreshToken,
10830 auto tokenType,
10831 auto expiresIn,
10832 auto scopes,
10833 void* userData__) {
10834 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
10835 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
10836 std::string accessToken__str(reinterpret_cast<char*>(accessToken.ptr), accessToken.size);
10837 std::string refreshToken__str(reinterpret_cast<char*>(refreshToken.ptr), refreshToken.size);
10838 std::string scopes__str(reinterpret_cast<char*>(scopes.ptr), scopes.size);
10839 userData__typed->delegate(std::move(result__obj),
10840 std::move(accessToken__str),
10841 std::move(refreshToken__str),
10842 static_cast<discordpp::AuthorizationTokenType>(tokenType),
10843 expiresIn,
10844 std::move(scopes__str));
10845 Discord_Free(scopes.ptr);
10846 Discord_Free(refreshToken.ptr);
10847 Discord_Free(accessToken.ptr);
10848 };
10849 Discord_Client_GetProvisionalToken(
10850 &instance_,
10851 applicationId,
10852 static_cast<Discord_AuthenticationExternalAuthType>(externalAuthType),
10853 externalAuthToken__str,
10854 callback__native,
10855 Tcallback__UserData::Free,
10856 callback__userData);
10857}
10858void Client::GetToken(uint64_t applicationId,
10859 std::string const& code,
10860 std::string const& codeVerifier,
10861 std::string const& redirectUri,
10863{
10864 assert(state_ == DiscordObjectState::Owned);
10865 Discord_String code__str{(uint8_t*)(code.data()), code.size()};
10866 Discord_String codeVerifier__str{(uint8_t*)(codeVerifier.data()), codeVerifier.size()};
10867 Discord_String redirectUri__str{(uint8_t*)(redirectUri.data()), redirectUri.size()};
10868 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
10869 auto callback__userData = new Tcallback__UserData(callback);
10870 Discord_Client_TokenExchangeCallback callback__native = [](auto result,
10871 auto accessToken,
10872 auto refreshToken,
10873 auto tokenType,
10874 auto expiresIn,
10875 auto scopes,
10876 void* userData__) {
10877 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
10878 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
10879 std::string accessToken__str(reinterpret_cast<char*>(accessToken.ptr), accessToken.size);
10880 std::string refreshToken__str(reinterpret_cast<char*>(refreshToken.ptr), refreshToken.size);
10881 std::string scopes__str(reinterpret_cast<char*>(scopes.ptr), scopes.size);
10882 userData__typed->delegate(std::move(result__obj),
10883 std::move(accessToken__str),
10884 std::move(refreshToken__str),
10885 static_cast<discordpp::AuthorizationTokenType>(tokenType),
10886 expiresIn,
10887 std::move(scopes__str));
10888 Discord_Free(scopes.ptr);
10889 Discord_Free(refreshToken.ptr);
10890 Discord_Free(accessToken.ptr);
10891 };
10892 Discord_Client_GetToken(&instance_,
10893 applicationId,
10894 code__str,
10895 codeVerifier__str,
10896 redirectUri__str,
10897 callback__native,
10898 Tcallback__UserData::Free,
10899 callback__userData);
10900}
10901void Client::GetTokenFromDevice(discordpp::DeviceAuthorizationArgs args,
10903{
10904 assert(state_ == DiscordObjectState::Owned);
10905 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
10906 auto callback__userData = new Tcallback__UserData(callback);
10907 Discord_Client_TokenExchangeCallback callback__native = [](auto result,
10908 auto accessToken,
10909 auto refreshToken,
10910 auto tokenType,
10911 auto expiresIn,
10912 auto scopes,
10913 void* userData__) {
10914 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
10915 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
10916 std::string accessToken__str(reinterpret_cast<char*>(accessToken.ptr), accessToken.size);
10917 std::string refreshToken__str(reinterpret_cast<char*>(refreshToken.ptr), refreshToken.size);
10918 std::string scopes__str(reinterpret_cast<char*>(scopes.ptr), scopes.size);
10919 userData__typed->delegate(std::move(result__obj),
10920 std::move(accessToken__str),
10921 std::move(refreshToken__str),
10922 static_cast<discordpp::AuthorizationTokenType>(tokenType),
10923 expiresIn,
10924 std::move(scopes__str));
10925 Discord_Free(scopes.ptr);
10926 Discord_Free(refreshToken.ptr);
10927 Discord_Free(accessToken.ptr);
10928 };
10929 Discord_Client_GetTokenFromDevice(
10930 &instance_, args.instance(), callback__native, Tcallback__UserData::Free, callback__userData);
10931}
10932void Client::GetTokenFromDeviceProvisionalMerge(
10935 std::string const& externalAuthToken,
10937{
10938 assert(state_ == DiscordObjectState::Owned);
10939 Discord_String externalAuthToken__str{(uint8_t*)(externalAuthToken.data()),
10940 externalAuthToken.size()};
10941 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
10942 auto callback__userData = new Tcallback__UserData(callback);
10943 Discord_Client_TokenExchangeCallback callback__native = [](auto result,
10944 auto accessToken,
10945 auto refreshToken,
10946 auto tokenType,
10947 auto expiresIn,
10948 auto scopes,
10949 void* userData__) {
10950 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
10951 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
10952 std::string accessToken__str(reinterpret_cast<char*>(accessToken.ptr), accessToken.size);
10953 std::string refreshToken__str(reinterpret_cast<char*>(refreshToken.ptr), refreshToken.size);
10954 std::string scopes__str(reinterpret_cast<char*>(scopes.ptr), scopes.size);
10955 userData__typed->delegate(std::move(result__obj),
10956 std::move(accessToken__str),
10957 std::move(refreshToken__str),
10958 static_cast<discordpp::AuthorizationTokenType>(tokenType),
10959 expiresIn,
10960 std::move(scopes__str));
10961 Discord_Free(scopes.ptr);
10962 Discord_Free(refreshToken.ptr);
10963 Discord_Free(accessToken.ptr);
10964 };
10965 Discord_Client_GetTokenFromDeviceProvisionalMerge(
10966 &instance_,
10967 args.instance(),
10968 static_cast<Discord_AuthenticationExternalAuthType>(externalAuthType),
10969 externalAuthToken__str,
10970 callback__native,
10971 Tcallback__UserData::Free,
10972 callback__userData);
10973}
10974void Client::GetTokenFromProvisionalMerge(
10975 uint64_t applicationId,
10976 std::string const& code,
10977 std::string const& codeVerifier,
10978 std::string const& redirectUri,
10980 std::string const& externalAuthToken,
10982{
10983 assert(state_ == DiscordObjectState::Owned);
10984 Discord_String code__str{(uint8_t*)(code.data()), code.size()};
10985 Discord_String codeVerifier__str{(uint8_t*)(codeVerifier.data()), codeVerifier.size()};
10986 Discord_String redirectUri__str{(uint8_t*)(redirectUri.data()), redirectUri.size()};
10987 Discord_String externalAuthToken__str{(uint8_t*)(externalAuthToken.data()),
10988 externalAuthToken.size()};
10989 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
10990 auto callback__userData = new Tcallback__UserData(callback);
10991 Discord_Client_TokenExchangeCallback callback__native = [](auto result,
10992 auto accessToken,
10993 auto refreshToken,
10994 auto tokenType,
10995 auto expiresIn,
10996 auto scopes,
10997 void* userData__) {
10998 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
10999 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11000 std::string accessToken__str(reinterpret_cast<char*>(accessToken.ptr), accessToken.size);
11001 std::string refreshToken__str(reinterpret_cast<char*>(refreshToken.ptr), refreshToken.size);
11002 std::string scopes__str(reinterpret_cast<char*>(scopes.ptr), scopes.size);
11003 userData__typed->delegate(std::move(result__obj),
11004 std::move(accessToken__str),
11005 std::move(refreshToken__str),
11006 static_cast<discordpp::AuthorizationTokenType>(tokenType),
11007 expiresIn,
11008 std::move(scopes__str));
11009 Discord_Free(scopes.ptr);
11010 Discord_Free(refreshToken.ptr);
11011 Discord_Free(accessToken.ptr);
11012 };
11013 Discord_Client_GetTokenFromProvisionalMerge(
11014 &instance_,
11015 applicationId,
11016 code__str,
11017 codeVerifier__str,
11018 redirectUri__str,
11019 static_cast<Discord_AuthenticationExternalAuthType>(externalAuthType),
11020 externalAuthToken__str,
11021 callback__native,
11022 Tcallback__UserData::Free,
11023 callback__userData);
11024}
11025bool Client::IsAuthenticated()
11026{
11027 assert(state_ == DiscordObjectState::Owned);
11028 bool returnValue__;
11029 returnValue__ = Discord_Client_IsAuthenticated(&instance_);
11030 return returnValue__;
11031}
11032void Client::OpenAuthorizeDeviceScreen(uint64_t clientId, std::string const& userCode)
11033{
11034 assert(state_ == DiscordObjectState::Owned);
11035 Discord_String userCode__str{(uint8_t*)(userCode.data()), userCode.size()};
11036 Discord_Client_OpenAuthorizeDeviceScreen(&instance_, clientId, userCode__str);
11037}
11038void Client::ProvisionalUserMergeCompleted(bool success)
11039{
11040 assert(state_ == DiscordObjectState::Owned);
11041 Discord_Client_ProvisionalUserMergeCompleted(&instance_, success);
11042}
11043void Client::RefreshToken(uint64_t applicationId,
11044 std::string const& refreshToken,
11046{
11047 assert(state_ == DiscordObjectState::Owned);
11048 Discord_String refreshToken__str{(uint8_t*)(refreshToken.data()), refreshToken.size()};
11049 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
11050 auto callback__userData = new Tcallback__UserData(callback);
11051 Discord_Client_TokenExchangeCallback callback__native = [](auto result,
11052 auto accessToken,
11053 auto refreshToken,
11054 auto tokenType,
11055 auto expiresIn,
11056 auto scopes,
11057 void* userData__) {
11058 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
11059 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11060 std::string accessToken__str(reinterpret_cast<char*>(accessToken.ptr), accessToken.size);
11061 std::string refreshToken__str(reinterpret_cast<char*>(refreshToken.ptr), refreshToken.size);
11062 std::string scopes__str(reinterpret_cast<char*>(scopes.ptr), scopes.size);
11063 userData__typed->delegate(std::move(result__obj),
11064 std::move(accessToken__str),
11065 std::move(refreshToken__str),
11066 static_cast<discordpp::AuthorizationTokenType>(tokenType),
11067 expiresIn,
11068 std::move(scopes__str));
11069 Discord_Free(scopes.ptr);
11070 Discord_Free(refreshToken.ptr);
11071 Discord_Free(accessToken.ptr);
11072 };
11073 Discord_Client_RefreshToken(&instance_,
11074 applicationId,
11075 refreshToken__str,
11076 callback__native,
11077 Tcallback__UserData::Free,
11078 callback__userData);
11079}
11080void Client::RegisterAuthorizeRequestCallback(discordpp::Client::AuthorizeRequestCallback callback)
11081{
11082 assert(state_ == DiscordObjectState::Owned);
11083 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
11084 auto callback__userData = new Tcallback__UserData(callback);
11085 Discord_Client_AuthorizeRequestCallback callback__native = [](void* userData__) {
11086 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
11087 userData__typed->delegate();
11088 };
11089 Discord_Client_RegisterAuthorizeRequestCallback(
11090 &instance_, callback__native, Tcallback__UserData::Free, callback__userData);
11091}
11092void Client::RemoveAuthorizeRequestCallback()
11093{
11094 assert(state_ == DiscordObjectState::Owned);
11095 Discord_Client_RemoveAuthorizeRequestCallback(&instance_);
11096}
11097void Client::RevokeToken(uint64_t applicationId,
11098 std::string const& token,
11100{
11101 assert(state_ == DiscordObjectState::Owned);
11102 Discord_String token__str{(uint8_t*)(token.data()), token.size()};
11103 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
11104 auto callback__userData = new Tcallback__UserData(callback);
11105 Discord_Client_RevokeTokenCallback callback__native = [](auto result, void* userData__) {
11106 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
11107 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11108 userData__typed->delegate(std::move(result__obj));
11109 };
11110 Discord_Client_RevokeToken(&instance_,
11111 applicationId,
11112 token__str,
11113 callback__native,
11114 Tcallback__UserData::Free,
11115 callback__userData);
11116}
11117void Client::SetAuthorizeDeviceScreenClosedCallback(
11119{
11120 assert(state_ == DiscordObjectState::Owned);
11121 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11122 auto cb__userData = new Tcb__UserData(cb);
11123 Discord_Client_AuthorizeDeviceScreenClosedCallback cb__native = [](void* userData__) {
11124 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
11125 userData__typed->delegate();
11126 };
11127 Discord_Client_SetAuthorizeDeviceScreenClosedCallback(
11128 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11129}
11130void Client::SetGameWindowPid(int32_t pid)
11131{
11132 assert(state_ == DiscordObjectState::Owned);
11133 Discord_Client_SetGameWindowPid(&instance_, pid);
11134}
11135void Client::SetTokenExpirationCallback(discordpp::Client::TokenExpirationCallback callback)
11136{
11137 assert(state_ == DiscordObjectState::Owned);
11138 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
11139 auto callback__userData = new Tcallback__UserData(callback);
11140 Discord_Client_TokenExpirationCallback callback__native = [](void* userData__) {
11141 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
11142 userData__typed->delegate();
11143 };
11144 Discord_Client_SetTokenExpirationCallback(
11145 &instance_, callback__native, Tcallback__UserData::Free, callback__userData);
11146}
11147void Client::UnmergeIntoProvisionalAccount(
11148 uint64_t applicationId,
11150 std::string const& externalAuthToken,
11152{
11153 assert(state_ == DiscordObjectState::Owned);
11154 Discord_String externalAuthToken__str{(uint8_t*)(externalAuthToken.data()),
11155 externalAuthToken.size()};
11156 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
11157 auto callback__userData = new Tcallback__UserData(callback);
11158 Discord_Client_UnmergeIntoProvisionalAccountCallback callback__native = [](auto result,
11159 void* userData__) {
11160 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
11161 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11162 userData__typed->delegate(std::move(result__obj));
11163 };
11164 Discord_Client_UnmergeIntoProvisionalAccount(
11165 &instance_,
11166 applicationId,
11167 static_cast<Discord_AuthenticationExternalAuthType>(externalAuthType),
11168 externalAuthToken__str,
11169 callback__native,
11170 Tcallback__UserData::Free,
11171 callback__userData);
11172}
11173void Client::UpdateProvisionalAccountDisplayName(
11174 std::string const& name,
11176{
11177 assert(state_ == DiscordObjectState::Owned);
11178 Discord_String name__str{(uint8_t*)(name.data()), name.size()};
11179 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
11180 auto callback__userData = new Tcallback__UserData(callback);
11181 Discord_Client_UpdateProvisionalAccountDisplayNameCallback callback__native =
11182 [](auto result, void* userData__) {
11183 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
11184 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11185 userData__typed->delegate(std::move(result__obj));
11186 };
11187 Discord_Client_UpdateProvisionalAccountDisplayName(
11188 &instance_, name__str, callback__native, Tcallback__UserData::Free, callback__userData);
11189}
11190void Client::UpdateToken(discordpp::AuthorizationTokenType tokenType,
11191 std::string token,
11193{
11194 assert(state_ == DiscordObjectState::Owned);
11195 Discord_String token__str{(uint8_t*)(token.data()), token.size()};
11196 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
11197 auto callback__userData = new Tcallback__UserData(callback);
11198 Discord_Client_UpdateTokenCallback callback__native = [](auto result, void* userData__) {
11199 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
11200 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11201 userData__typed->delegate(std::move(result__obj));
11202 };
11203 Discord_Client_UpdateToken(&instance_,
11204 static_cast<Discord_AuthorizationTokenType>(tokenType),
11205 token__str,
11206 callback__native,
11207 Tcallback__UserData::Free,
11208 callback__userData);
11209}
11210bool Client::CanOpenMessageInDiscord(uint64_t messageId)
11211{
11212 assert(state_ == DiscordObjectState::Owned);
11213 bool returnValue__;
11214 returnValue__ = Discord_Client_CanOpenMessageInDiscord(&instance_, messageId);
11215 return returnValue__;
11216}
11217void Client::DeleteUserMessage(uint64_t recipientId,
11218 uint64_t messageId,
11220{
11221 assert(state_ == DiscordObjectState::Owned);
11222 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11223 auto cb__userData = new Tcb__UserData(cb);
11224 Discord_Client_DeleteUserMessageCallback cb__native = [](auto result, void* userData__) {
11225 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
11226 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11227 userData__typed->delegate(std::move(result__obj));
11228 };
11229 Discord_Client_DeleteUserMessage(
11230 &instance_, recipientId, messageId, cb__native, Tcb__UserData::Free, cb__userData);
11231}
11232void Client::EditUserMessage(uint64_t recipientId,
11233 uint64_t messageId,
11234 std::string const& content,
11236{
11237 assert(state_ == DiscordObjectState::Owned);
11238 Discord_String content__str{(uint8_t*)(content.data()), content.size()};
11239 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11240 auto cb__userData = new Tcb__UserData(cb);
11241 Discord_Client_EditUserMessageCallback cb__native = [](auto result, void* userData__) {
11242 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
11243 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11244 userData__typed->delegate(std::move(result__obj));
11245 };
11246 Discord_Client_EditUserMessage(&instance_,
11247 recipientId,
11248 messageId,
11249 content__str,
11250 cb__native,
11251 Tcb__UserData::Free,
11252 cb__userData);
11253}
11254std::optional<discordpp::ChannelHandle> Client::GetChannelHandle(uint64_t channelId) const
11255{
11256 assert(state_ == DiscordObjectState::Owned);
11257 bool returnIsNonNull__;
11258 Discord_ChannelHandle returnValueNative__;
11259 returnIsNonNull__ =
11260 Discord_Client_GetChannelHandle(&instance_, channelId, &returnValueNative__);
11261 if (!returnIsNonNull__) {
11262 return {};
11263 }
11264 discordpp::ChannelHandle returnValue__(returnValueNative__, DiscordObjectState::Owned);
11265 return returnValue__;
11266}
11267void Client::GetLobbyMessagesWithLimit(uint64_t lobbyId,
11268 int32_t limit,
11270{
11271 assert(state_ == DiscordObjectState::Owned);
11272 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11273 auto cb__userData = new Tcb__UserData(cb);
11274 Discord_Client_GetLobbyMessagesCallback cb__native =
11275 [](auto result, auto messages, void* userData__) {
11276 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
11277 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11278 std::vector<discordpp::MessageHandle> messages__vec;
11279 messages__vec.reserve(messages.size);
11280 for (size_t i__ = 0; i__ < messages.size; ++i__) {
11281 messages__vec.emplace_back(messages.ptr[i__], DiscordObjectState::Owned);
11282 }
11283 Discord_Free(messages.ptr);
11284 userData__typed->delegate(std::move(result__obj), std::move(messages__vec));
11285 };
11286 Discord_Client_GetLobbyMessagesWithLimit(
11287 &instance_, lobbyId, limit, cb__native, Tcb__UserData::Free, cb__userData);
11288}
11289std::optional<discordpp::MessageHandle> Client::GetMessageHandle(uint64_t messageId) const
11290{
11291 assert(state_ == DiscordObjectState::Owned);
11292 bool returnIsNonNull__;
11293 Discord_MessageHandle returnValueNative__;
11294 returnIsNonNull__ =
11295 Discord_Client_GetMessageHandle(&instance_, messageId, &returnValueNative__);
11296 if (!returnIsNonNull__) {
11297 return {};
11298 }
11299 discordpp::MessageHandle returnValue__(returnValueNative__, DiscordObjectState::Owned);
11300 return returnValue__;
11301}
11302void Client::GetUserMessageSummaries(discordpp::Client::UserMessageSummariesCallback cb)
11303{
11304 assert(state_ == DiscordObjectState::Owned);
11305 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11306 auto cb__userData = new Tcb__UserData(cb);
11307 Discord_Client_UserMessageSummariesCallback cb__native =
11308 [](auto result, auto summaries, void* userData__) {
11309 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
11310 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11311 std::vector<discordpp::UserMessageSummary> summaries__vec;
11312 summaries__vec.reserve(summaries.size);
11313 for (size_t i__ = 0; i__ < summaries.size; ++i__) {
11314 summaries__vec.emplace_back(summaries.ptr[i__], DiscordObjectState::Owned);
11315 }
11316 Discord_Free(summaries.ptr);
11317 userData__typed->delegate(std::move(result__obj), std::move(summaries__vec));
11318 };
11319 Discord_Client_GetUserMessageSummaries(
11320 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11321}
11322void Client::GetUserMessagesWithLimit(uint64_t recipientId,
11323 int32_t limit,
11325{
11326 assert(state_ == DiscordObjectState::Owned);
11327 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11328 auto cb__userData = new Tcb__UserData(cb);
11329 Discord_Client_UserMessagesWithLimitCallback cb__native =
11330 [](auto result, auto messages, void* userData__) {
11331 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
11332 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11333 std::vector<discordpp::MessageHandle> messages__vec;
11334 messages__vec.reserve(messages.size);
11335 for (size_t i__ = 0; i__ < messages.size; ++i__) {
11336 messages__vec.emplace_back(messages.ptr[i__], DiscordObjectState::Owned);
11337 }
11338 Discord_Free(messages.ptr);
11339 userData__typed->delegate(std::move(result__obj), std::move(messages__vec));
11340 };
11341 Discord_Client_GetUserMessagesWithLimit(
11342 &instance_, recipientId, limit, cb__native, Tcb__UserData::Free, cb__userData);
11343}
11344void Client::OpenMessageInDiscord(
11345 uint64_t messageId,
11346 discordpp::Client::ProvisionalUserMergeRequiredCallback provisionalUserMergeRequiredCallback,
11348{
11349 assert(state_ == DiscordObjectState::Owned);
11350 using TprovisionalUserMergeRequiredCallback__UserData =
11351 TDelegateUserData<std::remove_reference_t<decltype(provisionalUserMergeRequiredCallback)>>;
11352 auto provisionalUserMergeRequiredCallback__userData =
11353 new TprovisionalUserMergeRequiredCallback__UserData(provisionalUserMergeRequiredCallback);
11354 Discord_Client_ProvisionalUserMergeRequiredCallback
11355 provisionalUserMergeRequiredCallback__native = [](void* userData__) {
11356 auto userData__typed =
11357 static_cast<TprovisionalUserMergeRequiredCallback__UserData*>(userData__);
11358 userData__typed->delegate();
11359 };
11360 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
11361 auto callback__userData = new Tcallback__UserData(callback);
11362 Discord_Client_OpenMessageInDiscordCallback callback__native = [](auto result,
11363 void* userData__) {
11364 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
11365 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11366 userData__typed->delegate(std::move(result__obj));
11367 };
11368 Discord_Client_OpenMessageInDiscord(&instance_,
11369 messageId,
11370 provisionalUserMergeRequiredCallback__native,
11371 TprovisionalUserMergeRequiredCallback__UserData::Free,
11372 provisionalUserMergeRequiredCallback__userData,
11373 callback__native,
11374 Tcallback__UserData::Free,
11375 callback__userData);
11376}
11377void Client::SendLobbyMessage(uint64_t lobbyId,
11378 std::string const& content,
11380{
11381 assert(state_ == DiscordObjectState::Owned);
11382 Discord_String content__str{(uint8_t*)(content.data()), content.size()};
11383 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11384 auto cb__userData = new Tcb__UserData(cb);
11385 Discord_Client_SendUserMessageCallback cb__native =
11386 [](auto result, auto messageId, void* userData__) {
11387 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
11388 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11389 userData__typed->delegate(std::move(result__obj), messageId);
11390 };
11391 Discord_Client_SendLobbyMessage(
11392 &instance_, lobbyId, content__str, cb__native, Tcb__UserData::Free, cb__userData);
11393}
11394void Client::SendLobbyMessageWithMetadata(
11395 uint64_t lobbyId,
11396 std::string const& content,
11397 std::unordered_map<std::string, std::string> const& metadata,
11399{
11400 assert(state_ == DiscordObjectState::Owned);
11401 Discord_String content__str{(uint8_t*)(content.data()), content.size()};
11402 ConvertedProperties metadata__convert(metadata);
11403 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11404 auto cb__userData = new Tcb__UserData(cb);
11405 Discord_Client_SendUserMessageCallback cb__native =
11406 [](auto result, auto messageId, void* userData__) {
11407 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
11408 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11409 userData__typed->delegate(std::move(result__obj), messageId);
11410 };
11411 Discord_Client_SendLobbyMessageWithMetadata(&instance_,
11412 lobbyId,
11413 content__str,
11414 metadata__convert.Properties,
11415 cb__native,
11416 Tcb__UserData::Free,
11417 cb__userData);
11418}
11419void Client::SendUserMessage(uint64_t recipientId,
11420 std::string const& content,
11422{
11423 assert(state_ == DiscordObjectState::Owned);
11424 Discord_String content__str{(uint8_t*)(content.data()), content.size()};
11425 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11426 auto cb__userData = new Tcb__UserData(cb);
11427 Discord_Client_SendUserMessageCallback cb__native =
11428 [](auto result, auto messageId, void* userData__) {
11429 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
11430 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11431 userData__typed->delegate(std::move(result__obj), messageId);
11432 };
11433 Discord_Client_SendUserMessage(
11434 &instance_, recipientId, content__str, cb__native, Tcb__UserData::Free, cb__userData);
11435}
11436void Client::SendUserMessageWithMetadata(
11437 uint64_t recipientId,
11438 std::string const& content,
11439 std::unordered_map<std::string, std::string> const& metadata,
11441{
11442 assert(state_ == DiscordObjectState::Owned);
11443 Discord_String content__str{(uint8_t*)(content.data()), content.size()};
11444 ConvertedProperties metadata__convert(metadata);
11445 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11446 auto cb__userData = new Tcb__UserData(cb);
11447 Discord_Client_SendUserMessageCallback cb__native =
11448 [](auto result, auto messageId, void* userData__) {
11449 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
11450 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11451 userData__typed->delegate(std::move(result__obj), messageId);
11452 };
11453 Discord_Client_SendUserMessageWithMetadata(&instance_,
11454 recipientId,
11455 content__str,
11456 metadata__convert.Properties,
11457 cb__native,
11458 Tcb__UserData::Free,
11459 cb__userData);
11460}
11461void Client::SetMessageCreatedCallback(discordpp::Client::MessageCreatedCallback cb)
11462{
11463 assert(state_ == DiscordObjectState::Owned);
11464 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11465 auto cb__userData = new Tcb__UserData(cb);
11466 Discord_Client_MessageCreatedCallback cb__native = [](auto messageId, void* userData__) {
11467 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
11468 userData__typed->delegate(messageId);
11469 };
11470 Discord_Client_SetMessageCreatedCallback(
11471 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11472}
11473void Client::SetMessageDeletedCallback(discordpp::Client::MessageDeletedCallback cb)
11474{
11475 assert(state_ == DiscordObjectState::Owned);
11476 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11477 auto cb__userData = new Tcb__UserData(cb);
11478 Discord_Client_MessageDeletedCallback cb__native =
11479 [](auto messageId, auto channelId, void* userData__) {
11480 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
11481 userData__typed->delegate(messageId, channelId);
11482 };
11483 Discord_Client_SetMessageDeletedCallback(
11484 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11485}
11486void Client::SetMessageUpdatedCallback(discordpp::Client::MessageUpdatedCallback cb)
11487{
11488 assert(state_ == DiscordObjectState::Owned);
11489 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11490 auto cb__userData = new Tcb__UserData(cb);
11491 Discord_Client_MessageUpdatedCallback cb__native = [](auto messageId, void* userData__) {
11492 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
11493 userData__typed->delegate(messageId);
11494 };
11495 Discord_Client_SetMessageUpdatedCallback(
11496 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11497}
11498void Client::SetShowingChat(bool showingChat)
11499{
11500 assert(state_ == DiscordObjectState::Owned);
11501 Discord_Client_SetShowingChat(&instance_, showingChat);
11502}
11503void Client::AddLogCallback(discordpp::Client::LogCallback callback,
11504 discordpp::LoggingSeverity minSeverity)
11505{
11506 assert(state_ == DiscordObjectState::Owned);
11507 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
11508 auto callback__userData = new Tcallback__UserData(callback);
11509 Discord_Client_LogCallback callback__native = [](
11510 auto message, auto severity, void* userData__) {
11511 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
11512 std::string message__str(reinterpret_cast<char*>(message.ptr), message.size);
11513 userData__typed->delegate(std::move(message__str),
11514 static_cast<discordpp::LoggingSeverity>(severity));
11515 Discord_Free(message.ptr);
11516 };
11517 Discord_Client_AddLogCallback(&instance_,
11518 callback__native,
11519 Tcallback__UserData::Free,
11520 callback__userData,
11521 static_cast<Discord_LoggingSeverity>(minSeverity));
11522}
11523void Client::AddVoiceLogCallback(discordpp::Client::LogCallback callback,
11524 discordpp::LoggingSeverity minSeverity)
11525{
11526 assert(state_ == DiscordObjectState::Owned);
11527 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
11528 auto callback__userData = new Tcallback__UserData(callback);
11529 Discord_Client_LogCallback callback__native = [](
11530 auto message, auto severity, void* userData__) {
11531 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
11532 std::string message__str(reinterpret_cast<char*>(message.ptr), message.size);
11533 userData__typed->delegate(std::move(message__str),
11534 static_cast<discordpp::LoggingSeverity>(severity));
11535 Discord_Free(message.ptr);
11536 };
11537 Discord_Client_AddVoiceLogCallback(&instance_,
11538 callback__native,
11539 Tcallback__UserData::Free,
11540 callback__userData,
11541 static_cast<Discord_LoggingSeverity>(minSeverity));
11542}
11543void Client::Connect()
11544{
11545 assert(state_ == DiscordObjectState::Owned);
11546 Discord_Client_Connect(&instance_);
11547}
11548void Client::Disconnect()
11549{
11550 assert(state_ == DiscordObjectState::Owned);
11551 Discord_Client_Disconnect(&instance_);
11552}
11553discordpp::Client::Status Client::GetStatus() const
11554{
11555 assert(state_ == DiscordObjectState::Owned);
11556 Discord_Client_Status returnValue__;
11557 returnValue__ = Discord_Client_GetStatus(&instance_);
11558 return static_cast<discordpp::Client::Status>(returnValue__);
11559}
11560void Client::OpenConnectedGamesSettingsInDiscord(
11562{
11563 assert(state_ == DiscordObjectState::Owned);
11564 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
11565 auto callback__userData = new Tcallback__UserData(callback);
11566 Discord_Client_OpenConnectedGamesSettingsInDiscordCallback callback__native =
11567 [](auto result, void* userData__) {
11568 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
11569 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11570 userData__typed->delegate(std::move(result__obj));
11571 };
11572 Discord_Client_OpenConnectedGamesSettingsInDiscord(
11573 &instance_, callback__native, Tcallback__UserData::Free, callback__userData);
11574}
11575void Client::SetApplicationId(uint64_t applicationId)
11576{
11577 assert(state_ == DiscordObjectState::Owned);
11578 Discord_Client_SetApplicationId(&instance_, applicationId);
11579}
11580bool Client::SetLogDir(std::string const& path, discordpp::LoggingSeverity minSeverity)
11581{
11582 assert(state_ == DiscordObjectState::Owned);
11583 bool returnValue__;
11584 Discord_String path__str{(uint8_t*)(path.data()), path.size()};
11585 returnValue__ = Discord_Client_SetLogDir(
11586 &instance_, path__str, static_cast<Discord_LoggingSeverity>(minSeverity));
11587 return returnValue__;
11588}
11589void Client::SetStatusChangedCallback(discordpp::Client::OnStatusChanged cb)
11590{
11591 assert(state_ == DiscordObjectState::Owned);
11592 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11593 auto cb__userData = new Tcb__UserData(cb);
11594 Discord_Client_OnStatusChanged cb__native =
11595 [](auto status, auto error, auto errorDetail, void* userData__) {
11596 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
11597 userData__typed->delegate(static_cast<discordpp::Client::Status>(status),
11598 static_cast<discordpp::Client::Error>(error),
11599 errorDetail);
11600 };
11601 Discord_Client_SetStatusChangedCallback(
11602 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11603}
11604void Client::SetVoiceLogDir(std::string const& path, discordpp::LoggingSeverity minSeverity)
11605{
11606 assert(state_ == DiscordObjectState::Owned);
11607 Discord_String path__str{(uint8_t*)(path.data()), path.size()};
11608 Discord_Client_SetVoiceLogDir(
11609 &instance_, path__str, static_cast<Discord_LoggingSeverity>(minSeverity));
11610}
11611void Client::CreateOrJoinLobby(std::string const& secret,
11613{
11614 assert(state_ == DiscordObjectState::Owned);
11615 Discord_String secret__str{(uint8_t*)(secret.data()), secret.size()};
11616 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
11617 auto callback__userData = new Tcallback__UserData(callback);
11618 Discord_Client_CreateOrJoinLobbyCallback callback__native =
11619 [](auto result, auto lobbyId, void* userData__) {
11620 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
11621 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11622 userData__typed->delegate(std::move(result__obj), lobbyId);
11623 };
11624 Discord_Client_CreateOrJoinLobby(
11625 &instance_, secret__str, callback__native, Tcallback__UserData::Free, callback__userData);
11626}
11627void Client::CreateOrJoinLobbyWithMetadata(
11628 std::string const& secret,
11629 std::unordered_map<std::string, std::string> const& lobbyMetadata,
11630 std::unordered_map<std::string, std::string> const& memberMetadata,
11632{
11633 assert(state_ == DiscordObjectState::Owned);
11634 Discord_String secret__str{(uint8_t*)(secret.data()), secret.size()};
11635 ConvertedProperties lobbyMetadata__convert(lobbyMetadata);
11636 ConvertedProperties memberMetadata__convert(memberMetadata);
11637 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
11638 auto callback__userData = new Tcallback__UserData(callback);
11639 Discord_Client_CreateOrJoinLobbyCallback callback__native =
11640 [](auto result, auto lobbyId, void* userData__) {
11641 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
11642 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11643 userData__typed->delegate(std::move(result__obj), lobbyId);
11644 };
11645 Discord_Client_CreateOrJoinLobbyWithMetadata(&instance_,
11646 secret__str,
11647 lobbyMetadata__convert.Properties,
11648 memberMetadata__convert.Properties,
11649 callback__native,
11650 Tcallback__UserData::Free,
11651 callback__userData);
11652}
11653void Client::GetGuildChannels(uint64_t guildId, discordpp::Client::GetGuildChannelsCallback cb)
11654{
11655 assert(state_ == DiscordObjectState::Owned);
11656 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11657 auto cb__userData = new Tcb__UserData(cb);
11658 Discord_Client_GetGuildChannelsCallback cb__native =
11659 [](auto result, auto guildChannels, void* userData__) {
11660 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
11661 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11662 std::vector<discordpp::GuildChannel> guildChannels__vec;
11663 guildChannels__vec.reserve(guildChannels.size);
11664 for (size_t i__ = 0; i__ < guildChannels.size; ++i__) {
11665 guildChannels__vec.emplace_back(guildChannels.ptr[i__], DiscordObjectState::Owned);
11666 }
11667 Discord_Free(guildChannels.ptr);
11668 userData__typed->delegate(std::move(result__obj), std::move(guildChannels__vec));
11669 };
11670 Discord_Client_GetGuildChannels(
11671 &instance_, guildId, cb__native, Tcb__UserData::Free, cb__userData);
11672}
11673std::optional<discordpp::LobbyHandle> Client::GetLobbyHandle(uint64_t lobbyId) const
11674{
11675 assert(state_ == DiscordObjectState::Owned);
11676 bool returnIsNonNull__;
11677 Discord_LobbyHandle returnValueNative__;
11678 returnIsNonNull__ = Discord_Client_GetLobbyHandle(&instance_, lobbyId, &returnValueNative__);
11679 if (!returnIsNonNull__) {
11680 return {};
11681 }
11682 discordpp::LobbyHandle returnValue__(returnValueNative__, DiscordObjectState::Owned);
11683 return returnValue__;
11684}
11685std::vector<uint64_t> Client::GetLobbyIds() const
11686{
11687 assert(state_ == DiscordObjectState::Owned);
11688 Discord_UInt64Span returnValueNative__;
11689 Discord_Client_GetLobbyIds(&instance_, &returnValueNative__);
11690 std::vector<uint64_t> returnValue__(returnValueNative__.ptr,
11691 returnValueNative__.ptr + returnValueNative__.size);
11692 Discord_Free(returnValueNative__.ptr);
11693 return returnValue__;
11694}
11695void Client::GetUserGuilds(discordpp::Client::GetUserGuildsCallback cb)
11696{
11697 assert(state_ == DiscordObjectState::Owned);
11698 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11699 auto cb__userData = new Tcb__UserData(cb);
11700 Discord_Client_GetUserGuildsCallback cb__native =
11701 [](auto result, auto guilds, void* userData__) {
11702 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
11703 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11704 std::vector<discordpp::GuildMinimal> guilds__vec;
11705 guilds__vec.reserve(guilds.size);
11706 for (size_t i__ = 0; i__ < guilds.size; ++i__) {
11707 guilds__vec.emplace_back(guilds.ptr[i__], DiscordObjectState::Owned);
11708 }
11709 Discord_Free(guilds.ptr);
11710 userData__typed->delegate(std::move(result__obj), std::move(guilds__vec));
11711 };
11712 Discord_Client_GetUserGuilds(&instance_, cb__native, Tcb__UserData::Free, cb__userData);
11713}
11714void Client::JoinLinkedLobbyGuild(
11715 uint64_t lobbyId,
11716 discordpp::Client::ProvisionalUserMergeRequiredCallback provisionalUserMergeRequiredCallback,
11718{
11719 assert(state_ == DiscordObjectState::Owned);
11720 using TprovisionalUserMergeRequiredCallback__UserData =
11721 TDelegateUserData<std::remove_reference_t<decltype(provisionalUserMergeRequiredCallback)>>;
11722 auto provisionalUserMergeRequiredCallback__userData =
11723 new TprovisionalUserMergeRequiredCallback__UserData(provisionalUserMergeRequiredCallback);
11724 Discord_Client_ProvisionalUserMergeRequiredCallback
11725 provisionalUserMergeRequiredCallback__native = [](void* userData__) {
11726 auto userData__typed =
11727 static_cast<TprovisionalUserMergeRequiredCallback__UserData*>(userData__);
11728 userData__typed->delegate();
11729 };
11730 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
11731 auto callback__userData = new Tcallback__UserData(callback);
11732 Discord_Client_JoinLinkedLobbyGuildCallback callback__native =
11733 [](auto result, auto inviteUrl, void* userData__) {
11734 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
11735 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11736 std::string inviteUrl__str(reinterpret_cast<char*>(inviteUrl.ptr), inviteUrl.size);
11737 userData__typed->delegate(std::move(result__obj), std::move(inviteUrl__str));
11738 Discord_Free(inviteUrl.ptr);
11739 };
11740 Discord_Client_JoinLinkedLobbyGuild(&instance_,
11741 lobbyId,
11742 provisionalUserMergeRequiredCallback__native,
11743 TprovisionalUserMergeRequiredCallback__UserData::Free,
11744 provisionalUserMergeRequiredCallback__userData,
11745 callback__native,
11746 Tcallback__UserData::Free,
11747 callback__userData);
11748}
11749void Client::LeaveLobby(uint64_t lobbyId, discordpp::Client::LeaveLobbyCallback callback)
11750{
11751 assert(state_ == DiscordObjectState::Owned);
11752 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
11753 auto callback__userData = new Tcallback__UserData(callback);
11754 Discord_Client_LeaveLobbyCallback callback__native = [](auto result, void* userData__) {
11755 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
11756 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11757 userData__typed->delegate(std::move(result__obj));
11758 };
11759 Discord_Client_LeaveLobby(
11760 &instance_, lobbyId, callback__native, Tcallback__UserData::Free, callback__userData);
11761}
11762void Client::LinkChannelToLobby(uint64_t lobbyId,
11763 uint64_t channelId,
11765{
11766 assert(state_ == DiscordObjectState::Owned);
11767 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
11768 auto callback__userData = new Tcallback__UserData(callback);
11769 Discord_Client_LinkOrUnlinkChannelCallback callback__native = [](auto result,
11770 void* userData__) {
11771 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
11772 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11773 userData__typed->delegate(std::move(result__obj));
11774 };
11775 Discord_Client_LinkChannelToLobby(&instance_,
11776 lobbyId,
11777 channelId,
11778 callback__native,
11779 Tcallback__UserData::Free,
11780 callback__userData);
11781}
11782void Client::SetLobbyCreatedCallback(discordpp::Client::LobbyCreatedCallback cb)
11783{
11784 assert(state_ == DiscordObjectState::Owned);
11785 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11786 auto cb__userData = new Tcb__UserData(cb);
11787 Discord_Client_LobbyCreatedCallback cb__native = [](auto lobbyId, void* userData__) {
11788 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
11789 userData__typed->delegate(lobbyId);
11790 };
11791 Discord_Client_SetLobbyCreatedCallback(
11792 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11793}
11794void Client::SetLobbyDeletedCallback(discordpp::Client::LobbyDeletedCallback cb)
11795{
11796 assert(state_ == DiscordObjectState::Owned);
11797 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11798 auto cb__userData = new Tcb__UserData(cb);
11799 Discord_Client_LobbyDeletedCallback cb__native = [](auto lobbyId, void* userData__) {
11800 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
11801 userData__typed->delegate(lobbyId);
11802 };
11803 Discord_Client_SetLobbyDeletedCallback(
11804 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11805}
11806void Client::SetLobbyMemberAddedCallback(discordpp::Client::LobbyMemberAddedCallback cb)
11807{
11808 assert(state_ == DiscordObjectState::Owned);
11809 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11810 auto cb__userData = new Tcb__UserData(cb);
11811 Discord_Client_LobbyMemberAddedCallback cb__native =
11812 [](auto lobbyId, auto memberId, void* userData__) {
11813 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
11814 userData__typed->delegate(lobbyId, memberId);
11815 };
11816 Discord_Client_SetLobbyMemberAddedCallback(
11817 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11818}
11819void Client::SetLobbyMemberRemovedCallback(discordpp::Client::LobbyMemberRemovedCallback cb)
11820{
11821 assert(state_ == DiscordObjectState::Owned);
11822 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11823 auto cb__userData = new Tcb__UserData(cb);
11824 Discord_Client_LobbyMemberRemovedCallback cb__native =
11825 [](auto lobbyId, auto memberId, void* userData__) {
11826 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
11827 userData__typed->delegate(lobbyId, memberId);
11828 };
11829 Discord_Client_SetLobbyMemberRemovedCallback(
11830 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11831}
11832void Client::SetLobbyMemberUpdatedCallback(discordpp::Client::LobbyMemberUpdatedCallback cb)
11833{
11834 assert(state_ == DiscordObjectState::Owned);
11835 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11836 auto cb__userData = new Tcb__UserData(cb);
11837 Discord_Client_LobbyMemberUpdatedCallback cb__native =
11838 [](auto lobbyId, auto memberId, void* userData__) {
11839 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
11840 userData__typed->delegate(lobbyId, memberId);
11841 };
11842 Discord_Client_SetLobbyMemberUpdatedCallback(
11843 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11844}
11845void Client::SetLobbyUpdatedCallback(discordpp::Client::LobbyUpdatedCallback cb)
11846{
11847 assert(state_ == DiscordObjectState::Owned);
11848 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11849 auto cb__userData = new Tcb__UserData(cb);
11850 Discord_Client_LobbyUpdatedCallback cb__native = [](auto lobbyId, void* userData__) {
11851 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
11852 userData__typed->delegate(lobbyId);
11853 };
11854 Discord_Client_SetLobbyUpdatedCallback(
11855 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11856}
11857void Client::UnlinkChannelFromLobby(uint64_t lobbyId,
11859{
11860 assert(state_ == DiscordObjectState::Owned);
11861 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
11862 auto callback__userData = new Tcallback__UserData(callback);
11863 Discord_Client_LinkOrUnlinkChannelCallback callback__native = [](auto result,
11864 void* userData__) {
11865 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
11866 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11867 userData__typed->delegate(std::move(result__obj));
11868 };
11869 Discord_Client_UnlinkChannelFromLobby(
11870 &instance_, lobbyId, callback__native, Tcallback__UserData::Free, callback__userData);
11871}
11872void Client::IsDiscordAppInstalled(discordpp::Client::IsDiscordAppInstalledCallback callback)
11873{
11874 assert(state_ == DiscordObjectState::Owned);
11875 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
11876 auto callback__userData = new Tcallback__UserData(callback);
11877 Discord_Client_IsDiscordAppInstalledCallback callback__native = [](auto installed,
11878 void* userData__) {
11879 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
11880 userData__typed->delegate(installed);
11881 };
11882 Discord_Client_IsDiscordAppInstalled(
11883 &instance_, callback__native, Tcallback__UserData::Free, callback__userData);
11884}
11885void Client::AcceptActivityInvite(discordpp::ActivityInvite invite,
11887{
11888 assert(state_ == DiscordObjectState::Owned);
11889 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11890 auto cb__userData = new Tcb__UserData(cb);
11891 Discord_Client_AcceptActivityInviteCallback cb__native =
11892 [](auto result, auto joinSecret, void* userData__) {
11893 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
11894 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11895 std::string joinSecret__str(reinterpret_cast<char*>(joinSecret.ptr), joinSecret.size);
11896 userData__typed->delegate(std::move(result__obj), std::move(joinSecret__str));
11897 Discord_Free(joinSecret.ptr);
11898 };
11899 Discord_Client_AcceptActivityInvite(
11900 &instance_, invite.instance(), cb__native, Tcb__UserData::Free, cb__userData);
11901}
11902void Client::ClearRichPresence()
11903{
11904 assert(state_ == DiscordObjectState::Owned);
11905 Discord_Client_ClearRichPresence(&instance_);
11906}
11907bool Client::RegisterLaunchCommand(uint64_t applicationId, std::string command)
11908{
11909 assert(state_ == DiscordObjectState::Owned);
11910 bool returnValue__;
11911 Discord_String command__str{(uint8_t*)(command.data()), command.size()};
11912 returnValue__ = Discord_Client_RegisterLaunchCommand(&instance_, applicationId, command__str);
11913 return returnValue__;
11914}
11915bool Client::RegisterLaunchSteamApplication(uint64_t applicationId, uint32_t steamAppId)
11916{
11917 assert(state_ == DiscordObjectState::Owned);
11918 bool returnValue__;
11919 returnValue__ =
11920 Discord_Client_RegisterLaunchSteamApplication(&instance_, applicationId, steamAppId);
11921 return returnValue__;
11922}
11923void Client::SendActivityInvite(uint64_t userId,
11924 std::string const& content,
11926{
11927 assert(state_ == DiscordObjectState::Owned);
11928 Discord_String content__str{(uint8_t*)(content.data()), content.size()};
11929 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11930 auto cb__userData = new Tcb__UserData(cb);
11931 Discord_Client_SendActivityInviteCallback cb__native = [](auto result, void* userData__) {
11932 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
11933 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11934 userData__typed->delegate(std::move(result__obj));
11935 };
11936 Discord_Client_SendActivityInvite(
11937 &instance_, userId, content__str, cb__native, Tcb__UserData::Free, cb__userData);
11938}
11939void Client::SendActivityJoinRequest(uint64_t userId,
11941{
11942 assert(state_ == DiscordObjectState::Owned);
11943 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11944 auto cb__userData = new Tcb__UserData(cb);
11945 Discord_Client_SendActivityInviteCallback cb__native = [](auto result, void* userData__) {
11946 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
11947 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11948 userData__typed->delegate(std::move(result__obj));
11949 };
11950 Discord_Client_SendActivityJoinRequest(
11951 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
11952}
11953void Client::SendActivityJoinRequestReply(discordpp::ActivityInvite invite,
11955{
11956 assert(state_ == DiscordObjectState::Owned);
11957 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11958 auto cb__userData = new Tcb__UserData(cb);
11959 Discord_Client_SendActivityInviteCallback cb__native = [](auto result, void* userData__) {
11960 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
11961 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
11962 userData__typed->delegate(std::move(result__obj));
11963 };
11964 Discord_Client_SendActivityJoinRequestReply(
11965 &instance_, invite.instance(), cb__native, Tcb__UserData::Free, cb__userData);
11966}
11967void Client::SetActivityInviteCreatedCallback(discordpp::Client::ActivityInviteCallback cb)
11968{
11969 assert(state_ == DiscordObjectState::Owned);
11970 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11971 auto cb__userData = new Tcb__UserData(cb);
11972 Discord_Client_ActivityInviteCallback cb__native = [](auto invite, void* userData__) {
11973 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
11974 discordpp::ActivityInvite invite__obj(*invite, DiscordObjectState::Owned);
11975 userData__typed->delegate(std::move(invite__obj));
11976 };
11977 Discord_Client_SetActivityInviteCreatedCallback(
11978 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11979}
11980void Client::SetActivityInviteUpdatedCallback(discordpp::Client::ActivityInviteCallback cb)
11981{
11982 assert(state_ == DiscordObjectState::Owned);
11983 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11984 auto cb__userData = new Tcb__UserData(cb);
11985 Discord_Client_ActivityInviteCallback cb__native = [](auto invite, void* userData__) {
11986 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
11987 discordpp::ActivityInvite invite__obj(*invite, DiscordObjectState::Owned);
11988 userData__typed->delegate(std::move(invite__obj));
11989 };
11990 Discord_Client_SetActivityInviteUpdatedCallback(
11991 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11992}
11993void Client::SetActivityJoinCallback(discordpp::Client::ActivityJoinCallback cb)
11994{
11995 assert(state_ == DiscordObjectState::Owned);
11996 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
11997 auto cb__userData = new Tcb__UserData(cb);
11998 Discord_Client_ActivityJoinCallback cb__native = [](auto joinSecret, void* userData__) {
11999 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
12000 std::string joinSecret__str(reinterpret_cast<char*>(joinSecret.ptr), joinSecret.size);
12001 userData__typed->delegate(std::move(joinSecret__str));
12002 Discord_Free(joinSecret.ptr);
12003 };
12004 Discord_Client_SetActivityJoinCallback(
12005 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
12006}
12007void Client::SetActivityJoinWithApplicationCallback(
12009{
12010 assert(state_ == DiscordObjectState::Owned);
12011 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
12012 auto cb__userData = new Tcb__UserData(cb);
12013 Discord_Client_ActivityJoinWithApplicationCallback cb__native =
12014 [](auto applicationId, auto joinSecret, void* userData__) {
12015 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
12016 std::string joinSecret__str(reinterpret_cast<char*>(joinSecret.ptr), joinSecret.size);
12017 userData__typed->delegate(applicationId, std::move(joinSecret__str));
12018 Discord_Free(joinSecret.ptr);
12019 };
12020 Discord_Client_SetActivityJoinWithApplicationCallback(
12021 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
12022}
12023void Client::SetOnlineStatus(discordpp::StatusType status,
12025{
12026 assert(state_ == DiscordObjectState::Owned);
12027 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
12028 auto callback__userData = new Tcallback__UserData(callback);
12029 Discord_Client_UpdateStatusCallback callback__native = [](auto result, void* userData__) {
12030 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
12031 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
12032 userData__typed->delegate(std::move(result__obj));
12033 };
12034 Discord_Client_SetOnlineStatus(&instance_,
12035 static_cast<Discord_StatusType>(status),
12036 callback__native,
12037 Tcallback__UserData::Free,
12038 callback__userData);
12039}
12040void Client::UpdateRichPresence(discordpp::Activity activity,
12042{
12043 assert(state_ == DiscordObjectState::Owned);
12044 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
12045 auto cb__userData = new Tcb__UserData(cb);
12046 Discord_Client_UpdateRichPresenceCallback cb__native = [](auto result, void* userData__) {
12047 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
12048 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
12049 userData__typed->delegate(std::move(result__obj));
12050 };
12051 Discord_Client_UpdateRichPresence(
12052 &instance_, activity.instance(), cb__native, Tcb__UserData::Free, cb__userData);
12053}
12054void Client::AcceptDiscordFriendRequest(uint64_t userId,
12056{
12057 assert(state_ == DiscordObjectState::Owned);
12058 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
12059 auto cb__userData = new Tcb__UserData(cb);
12060 Discord_Client_UpdateRelationshipCallback cb__native = [](auto result, void* userData__) {
12061 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
12062 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
12063 userData__typed->delegate(std::move(result__obj));
12064 };
12065 Discord_Client_AcceptDiscordFriendRequest(
12066 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
12067}
12068void Client::AcceptGameFriendRequest(uint64_t userId,
12070{
12071 assert(state_ == DiscordObjectState::Owned);
12072 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
12073 auto cb__userData = new Tcb__UserData(cb);
12074 Discord_Client_UpdateRelationshipCallback cb__native = [](auto result, void* userData__) {
12075 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
12076 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
12077 userData__typed->delegate(std::move(result__obj));
12078 };
12079 Discord_Client_AcceptGameFriendRequest(
12080 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
12081}
12082void Client::BlockUser(uint64_t userId, discordpp::Client::UpdateRelationshipCallback cb)
12083{
12084 assert(state_ == DiscordObjectState::Owned);
12085 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
12086 auto cb__userData = new Tcb__UserData(cb);
12087 Discord_Client_UpdateRelationshipCallback cb__native = [](auto result, void* userData__) {
12088 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
12089 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
12090 userData__typed->delegate(std::move(result__obj));
12091 };
12092 Discord_Client_BlockUser(&instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
12093}
12094void Client::CancelDiscordFriendRequest(uint64_t userId,
12096{
12097 assert(state_ == DiscordObjectState::Owned);
12098 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
12099 auto cb__userData = new Tcb__UserData(cb);
12100 Discord_Client_UpdateRelationshipCallback cb__native = [](auto result, void* userData__) {
12101 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
12102 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
12103 userData__typed->delegate(std::move(result__obj));
12104 };
12105 Discord_Client_CancelDiscordFriendRequest(
12106 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
12107}
12108void Client::CancelGameFriendRequest(uint64_t userId,
12110{
12111 assert(state_ == DiscordObjectState::Owned);
12112 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
12113 auto cb__userData = new Tcb__UserData(cb);
12114 Discord_Client_UpdateRelationshipCallback cb__native = [](auto result, void* userData__) {
12115 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
12116 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
12117 userData__typed->delegate(std::move(result__obj));
12118 };
12119 Discord_Client_CancelGameFriendRequest(
12120 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
12121}
12122discordpp::RelationshipHandle Client::GetRelationshipHandle(uint64_t userId) const
12123{
12124 assert(state_ == DiscordObjectState::Owned);
12125 Discord_RelationshipHandle returnValueNative__{};
12126 Discord_Client_GetRelationshipHandle(&instance_, userId, &returnValueNative__);
12127 discordpp::RelationshipHandle returnValue__(returnValueNative__, DiscordObjectState::Owned);
12128 return returnValue__;
12129}
12130std::vector<discordpp::RelationshipHandle> Client::GetRelationships() const
12131{
12132 assert(state_ == DiscordObjectState::Owned);
12133 Discord_RelationshipHandleSpan returnValueNative__;
12134 Discord_Client_GetRelationships(&instance_, &returnValueNative__);
12135 std::vector<discordpp::RelationshipHandle> returnValue__;
12136 returnValue__.reserve(returnValueNative__.size);
12137 for (size_t i__ = 0; i__ < returnValueNative__.size; ++i__) {
12138 returnValue__.emplace_back(returnValueNative__.ptr[i__], DiscordObjectState::Owned);
12139 }
12140 Discord_Free(returnValueNative__.ptr);
12141 return returnValue__;
12142}
12143std::vector<discordpp::RelationshipHandle> Client::GetRelationshipsByGroup(
12144 discordpp::RelationshipGroupType groupType) const
12145{
12146 assert(state_ == DiscordObjectState::Owned);
12147 Discord_RelationshipHandleSpan returnValueNative__;
12148 Discord_Client_GetRelationshipsByGroup(
12149 &instance_, static_cast<Discord_RelationshipGroupType>(groupType), &returnValueNative__);
12150 std::vector<discordpp::RelationshipHandle> returnValue__;
12151 returnValue__.reserve(returnValueNative__.size);
12152 for (size_t i__ = 0; i__ < returnValueNative__.size; ++i__) {
12153 returnValue__.emplace_back(returnValueNative__.ptr[i__], DiscordObjectState::Owned);
12154 }
12155 Discord_Free(returnValueNative__.ptr);
12156 return returnValue__;
12157}
12158void Client::RejectDiscordFriendRequest(uint64_t userId,
12160{
12161 assert(state_ == DiscordObjectState::Owned);
12162 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
12163 auto cb__userData = new Tcb__UserData(cb);
12164 Discord_Client_UpdateRelationshipCallback cb__native = [](auto result, void* userData__) {
12165 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
12166 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
12167 userData__typed->delegate(std::move(result__obj));
12168 };
12169 Discord_Client_RejectDiscordFriendRequest(
12170 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
12171}
12172void Client::RejectGameFriendRequest(uint64_t userId,
12174{
12175 assert(state_ == DiscordObjectState::Owned);
12176 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
12177 auto cb__userData = new Tcb__UserData(cb);
12178 Discord_Client_UpdateRelationshipCallback cb__native = [](auto result, void* userData__) {
12179 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
12180 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
12181 userData__typed->delegate(std::move(result__obj));
12182 };
12183 Discord_Client_RejectGameFriendRequest(
12184 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
12185}
12186void Client::RemoveDiscordAndGameFriend(uint64_t userId,
12188{
12189 assert(state_ == DiscordObjectState::Owned);
12190 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
12191 auto cb__userData = new Tcb__UserData(cb);
12192 Discord_Client_UpdateRelationshipCallback cb__native = [](auto result, void* userData__) {
12193 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
12194 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
12195 userData__typed->delegate(std::move(result__obj));
12196 };
12197 Discord_Client_RemoveDiscordAndGameFriend(
12198 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
12199}
12200void Client::RemoveGameFriend(uint64_t userId, discordpp::Client::UpdateRelationshipCallback cb)
12201{
12202 assert(state_ == DiscordObjectState::Owned);
12203 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
12204 auto cb__userData = new Tcb__UserData(cb);
12205 Discord_Client_UpdateRelationshipCallback cb__native = [](auto result, void* userData__) {
12206 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
12207 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
12208 userData__typed->delegate(std::move(result__obj));
12209 };
12210 Discord_Client_RemoveGameFriend(
12211 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
12212}
12213std::vector<discordpp::UserHandle> Client::SearchFriendsByUsername(std::string searchStr) const
12214{
12215 assert(state_ == DiscordObjectState::Owned);
12216 Discord_UserHandleSpan returnValueNative__;
12217 Discord_String searchStr__str{(uint8_t*)(searchStr.data()), searchStr.size()};
12218 Discord_Client_SearchFriendsByUsername(&instance_, searchStr__str, &returnValueNative__);
12219 std::vector<discordpp::UserHandle> returnValue__;
12220 returnValue__.reserve(returnValueNative__.size);
12221 for (size_t i__ = 0; i__ < returnValueNative__.size; ++i__) {
12222 returnValue__.emplace_back(returnValueNative__.ptr[i__], DiscordObjectState::Owned);
12223 }
12224 Discord_Free(returnValueNative__.ptr);
12225 return returnValue__;
12226}
12227void Client::SendDiscordFriendRequest(std::string const& username,
12229{
12230 assert(state_ == DiscordObjectState::Owned);
12231 Discord_String username__str{(uint8_t*)(username.data()), username.size()};
12232 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
12233 auto cb__userData = new Tcb__UserData(cb);
12234 Discord_Client_SendFriendRequestCallback cb__native = [](auto result, void* userData__) {
12235 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
12236 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
12237 userData__typed->delegate(std::move(result__obj));
12238 };
12239 Discord_Client_SendDiscordFriendRequest(
12240 &instance_, username__str, cb__native, Tcb__UserData::Free, cb__userData);
12241}
12242void Client::SendDiscordFriendRequestById(uint64_t userId,
12244{
12245 assert(state_ == DiscordObjectState::Owned);
12246 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
12247 auto cb__userData = new Tcb__UserData(cb);
12248 Discord_Client_UpdateRelationshipCallback cb__native = [](auto result, void* userData__) {
12249 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
12250 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
12251 userData__typed->delegate(std::move(result__obj));
12252 };
12253 Discord_Client_SendDiscordFriendRequestById(
12254 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
12255}
12256void Client::SendGameFriendRequest(std::string const& username,
12258{
12259 assert(state_ == DiscordObjectState::Owned);
12260 Discord_String username__str{(uint8_t*)(username.data()), username.size()};
12261 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
12262 auto cb__userData = new Tcb__UserData(cb);
12263 Discord_Client_SendFriendRequestCallback cb__native = [](auto result, void* userData__) {
12264 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
12265 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
12266 userData__typed->delegate(std::move(result__obj));
12267 };
12268 Discord_Client_SendGameFriendRequest(
12269 &instance_, username__str, cb__native, Tcb__UserData::Free, cb__userData);
12270}
12271void Client::SendGameFriendRequestById(uint64_t userId,
12273{
12274 assert(state_ == DiscordObjectState::Owned);
12275 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
12276 auto cb__userData = new Tcb__UserData(cb);
12277 Discord_Client_UpdateRelationshipCallback cb__native = [](auto result, void* userData__) {
12278 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
12279 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
12280 userData__typed->delegate(std::move(result__obj));
12281 };
12282 Discord_Client_SendGameFriendRequestById(
12283 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
12284}
12285void Client::SetRelationshipCreatedCallback(discordpp::Client::RelationshipCreatedCallback cb)
12286{
12287 assert(state_ == DiscordObjectState::Owned);
12288 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
12289 auto cb__userData = new Tcb__UserData(cb);
12290 Discord_Client_RelationshipCreatedCallback cb__native =
12291 [](auto userId, auto isDiscordRelationshipUpdate, void* userData__) {
12292 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
12293 userData__typed->delegate(userId, isDiscordRelationshipUpdate);
12294 };
12295 Discord_Client_SetRelationshipCreatedCallback(
12296 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
12297}
12298void Client::SetRelationshipDeletedCallback(discordpp::Client::RelationshipDeletedCallback cb)
12299{
12300 assert(state_ == DiscordObjectState::Owned);
12301 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
12302 auto cb__userData = new Tcb__UserData(cb);
12303 Discord_Client_RelationshipDeletedCallback cb__native =
12304 [](auto userId, auto isDiscordRelationshipUpdate, void* userData__) {
12305 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
12306 userData__typed->delegate(userId, isDiscordRelationshipUpdate);
12307 };
12308 Discord_Client_SetRelationshipDeletedCallback(
12309 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
12310}
12311void Client::UnblockUser(uint64_t userId, discordpp::Client::UpdateRelationshipCallback cb)
12312{
12313 assert(state_ == DiscordObjectState::Owned);
12314 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
12315 auto cb__userData = new Tcb__UserData(cb);
12316 Discord_Client_UpdateRelationshipCallback cb__native = [](auto result, void* userData__) {
12317 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
12318 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
12319 userData__typed->delegate(std::move(result__obj));
12320 };
12321 Discord_Client_UnblockUser(&instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
12322}
12323std::optional<discordpp::UserHandle> Client::GetCurrentUserV2() const
12324{
12325 assert(state_ == DiscordObjectState::Owned);
12326 bool returnIsNonNull__;
12327 Discord_UserHandle returnValueNative__;
12328 returnIsNonNull__ = Discord_Client_GetCurrentUserV2(&instance_, &returnValueNative__);
12329 if (!returnIsNonNull__) {
12330 return {};
12331 }
12332 discordpp::UserHandle returnValue__(returnValueNative__, DiscordObjectState::Owned);
12333 return returnValue__;
12334}
12335void Client::GetDiscordClientConnectedUser(
12336 uint64_t applicationId,
12338{
12339 assert(state_ == DiscordObjectState::Owned);
12340 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
12341 auto callback__userData = new Tcallback__UserData(callback);
12342 Discord_Client_GetDiscordClientConnectedUserCallback callback__native =
12343 [](auto result, auto user, void* userData__) {
12344 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
12345 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
12346 std::optional<discordpp::UserHandle> user__opt{};
12347 if (user) {
12348 user__opt = discordpp::UserHandle(*user, DiscordObjectState::Owned);
12349 }
12350 userData__typed->delegate(std::move(result__obj), std::move(user__opt));
12351 };
12352 Discord_Client_GetDiscordClientConnectedUser(
12353 &instance_, applicationId, callback__native, Tcallback__UserData::Free, callback__userData);
12354}
12355std::optional<discordpp::UserHandle> Client::GetUser(uint64_t userId) const
12356{
12357 assert(state_ == DiscordObjectState::Owned);
12358 bool returnIsNonNull__;
12359 Discord_UserHandle returnValueNative__;
12360 returnIsNonNull__ = Discord_Client_GetUser(&instance_, userId, &returnValueNative__);
12361 if (!returnIsNonNull__) {
12362 return {};
12363 }
12364 discordpp::UserHandle returnValue__(returnValueNative__, DiscordObjectState::Owned);
12365 return returnValue__;
12366}
12367void Client::SetRelationshipGroupsUpdatedCallback(
12369{
12370 assert(state_ == DiscordObjectState::Owned);
12371 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
12372 auto cb__userData = new Tcb__UserData(cb);
12373 Discord_Client_RelationshipGroupsUpdatedCallback cb__native = [](auto userId,
12374 void* userData__) {
12375 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
12376 userData__typed->delegate(userId);
12377 };
12378 Discord_Client_SetRelationshipGroupsUpdatedCallback(
12379 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
12380}
12381void Client::SetUserUpdatedCallback(discordpp::Client::UserUpdatedCallback cb)
12382{
12383 assert(state_ == DiscordObjectState::Owned);
12384 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
12385 auto cb__userData = new Tcb__UserData(cb);
12386 Discord_Client_UserUpdatedCallback cb__native = [](auto userId, void* userData__) {
12387 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
12388 userData__typed->delegate(userId);
12389 };
12390 Discord_Client_SetUserUpdatedCallback(
12391 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
12392}
12393const CallInfoHandle CallInfoHandle::nullobj{{}, DiscordObjectState::Invalid};
12394CallInfoHandle::~CallInfoHandle()
12395{
12396 if (state_ == DiscordObjectState::Owned) {
12397 Drop();
12398 state_ = DiscordObjectState::Invalid;
12399 }
12400}
12401CallInfoHandle::CallInfoHandle(CallInfoHandle&& other) noexcept
12402 : instance_(other.instance_)
12403 , state_(other.state_)
12404{
12405 other.state_ = DiscordObjectState::Invalid;
12406}
12407CallInfoHandle& CallInfoHandle::operator=(CallInfoHandle&& other) noexcept
12408{
12409 if (this != &other) {
12410 if (state_ == DiscordObjectState::Owned) {
12411 Drop();
12412 }
12413 instance_ = other.instance_;
12414 state_ = other.state_;
12415 other.state_ = DiscordObjectState::Invalid;
12416 }
12417 return *this;
12418}
12419CallInfoHandle::CallInfoHandle(const CallInfoHandle& other)
12420 : instance_{}
12421 , state_(DiscordObjectState::Invalid)
12422{
12423 if (other.state_ == DiscordObjectState::Owned) {
12424 Discord_CallInfoHandle_Clone(&instance_, other.instance());
12425
12426 state_ = DiscordObjectState::Owned;
12427 }
12428}
12429CallInfoHandle& CallInfoHandle::operator=(const CallInfoHandle& other)
12430{
12431 if (this != &other) {
12432 if (state_ == DiscordObjectState::Owned) {
12433 Drop();
12434 state_ = DiscordObjectState::Invalid;
12435 }
12436 if (other.state_ == DiscordObjectState::Owned) {
12437 Discord_CallInfoHandle_Clone(&instance_, other.instance());
12438
12439 state_ = DiscordObjectState::Owned;
12440 }
12441 }
12442 return *this;
12443}
12444CallInfoHandle::CallInfoHandle(Discord_CallInfoHandle instance, DiscordObjectState state)
12445 : instance_(instance)
12446 , state_(state)
12447{
12448}
12449void CallInfoHandle::Drop()
12450{
12451 if (state_ != DiscordObjectState::Owned) {
12452 return;
12453 }
12454 Discord_CallInfoHandle_Drop(&instance_);
12455 state_ = DiscordObjectState::Invalid;
12456}
12457uint64_t CallInfoHandle::ChannelId() const
12458{
12459 assert(state_ == DiscordObjectState::Owned);
12460 uint64_t returnValue__;
12461 returnValue__ = Discord_CallInfoHandle_ChannelId(&instance_);
12462 return returnValue__;
12463}
12464std::vector<uint64_t> CallInfoHandle::GetParticipants() const
12465{
12466 assert(state_ == DiscordObjectState::Owned);
12467 Discord_UInt64Span returnValueNative__;
12468 Discord_CallInfoHandle_GetParticipants(&instance_, &returnValueNative__);
12469 std::vector<uint64_t> returnValue__(returnValueNative__.ptr,
12470 returnValueNative__.ptr + returnValueNative__.size);
12471 Discord_Free(returnValueNative__.ptr);
12472 return returnValue__;
12473}
12474std::optional<discordpp::VoiceStateHandle> CallInfoHandle::GetVoiceStateHandle(
12475 uint64_t userId) const
12476{
12477 assert(state_ == DiscordObjectState::Owned);
12478 bool returnIsNonNull__;
12479 Discord_VoiceStateHandle returnValueNative__;
12480 returnIsNonNull__ =
12481 Discord_CallInfoHandle_GetVoiceStateHandle(&instance_, userId, &returnValueNative__);
12482 if (!returnIsNonNull__) {
12483 return {};
12484 }
12485 discordpp::VoiceStateHandle returnValue__(returnValueNative__, DiscordObjectState::Owned);
12486 return returnValue__;
12487}
12488uint64_t CallInfoHandle::GuildId() const
12489{
12490 assert(state_ == DiscordObjectState::Owned);
12491 uint64_t returnValue__;
12492 returnValue__ = Discord_CallInfoHandle_GuildId(&instance_);
12493 return returnValue__;
12494}
12495} // namespace discordpp
12496
12497#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://dc.anonymice.info/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:5216
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:5235
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 SetNoiseCancellation(bool on)
Enables or disables Krisp noise cancellation.
void JoinLinkedLobbyGuild(uint64_t lobbyId, discordpp::Client::ProvisionalUserMergeRequiredCallback provisionalUserMergeRequiredCallback, discordpp::Client::JoinLinkedLobbyGuildCallback callback)
Invites the current user to the Discord guild of the channel that is linked to the specified lobby....
bool ShowAudioRoutePicker()
On iOS devices, show the system audio route picker.
void SetActivityJoinCallback(discordpp::Client::ActivityJoinCallback cb)
Sets a callback function that is invoked when the current user also has Discord running on their comp...
void GetOutputDevices(discordpp::Client::GetOutputDevicesCallback cb)
Asynchronously fetches the list of audio output devices available to the user.
std::function< void()> AuthorizeDeviceScreenClosedCallback
Callback function for Client::SetAuthorizeDeviceScreenClosedCallback.
Definition discordpp.h: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:5262
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