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