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