Discord Social SDK
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
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
44 Join = 1,
45
48};
49
52
60
65 Public = 1,
66};
67
74enum class ActivityTypes {
75
78
81
84
87
90
93
96};
97
100
103
105 Xbox = 2,
106
109
111 IOS = 8,
112
115
118
120 PS4 = 64,
121
123 PS5 = 128,
124};
125
127enum class ErrorType {
128
130 None = 0,
131
135
143
153
156
159
169
172
177
182};
183
189enum class HttpStatusCode {
190
192 None = 0,
193
195 Continue = 100,
196
199
202
205
207 Ok = 200,
208
210 Created = 201,
211
213 Accepted = 202,
214
217
220
223
226
229
232
234 ImUsed = 209,
235
238
241
243 Found = 302,
244
246 SeeOther = 303,
247
250
253
256
259
262
265
268
270 NotFound = 404,
271
274
277
280
283
285 Conflict = 409,
286
288 Gone = 410,
289
292
295
298
301
304
307
310
313
316
318 Locked = 423,
319
322
324 TooEarly = 425,
325
328
331
334
337
340
343
346
349
352
355
358
361
364
367
370};
371
376
378 S256 = 0,
379};
380
383
385 Other = 0,
386
389
391 Poll = 2,
392
395
398
400 Embed = 5,
401
404};
405
407enum class AudioModeType {
408
411
414
417};
418
422enum class ChannelType {
423
426
428 Dm = 1,
429
432
435
438
441
444
447
450
453
456
459
462
465
467 Lobby = 17,
468
471};
472
475
477 None = 0,
478
481
485
490
494
497
500};
501
506enum class StatusType {
507
510
513
516
519 Idle = 3,
520
522 Dnd = 4,
523
526
529
532};
533
546
550
552 User = 0,
553
556};
557
577
579enum class LoggingSeverity {
580
583
585 Info = 2,
586
589
591 Error = 4,
592
594 None = 5,
595};
596class ActivityInvite;
597class ActivityAssets;
598class ActivityTimestamps;
599class ActivityParty;
600class ActivitySecrets;
601class Activity;
602class ClientResult;
603class AuthorizationCodeChallenge;
604class AuthorizationCodeVerifier;
605class AuthorizationArgs;
606class DeviceAuthorizationArgs;
607class VoiceStateHandle;
608class VADThresholdSettings;
609class Call;
610class ChannelHandle;
611class GuildMinimal;
612class GuildChannel;
613class LinkedLobby;
614class LinkedChannel;
615class RelationshipHandle;
616class UserHandle;
617class LobbyMemberHandle;
618class LobbyHandle;
619class AdditionalContent;
620class MessageHandle;
621class AudioDevice;
622class Client;
623class CallInfoHandle;
624
630 mutable Discord_ActivityInvite instance_{};
633
634public:
636 Discord_ActivityInvite* instance() const { return &instance_; }
639 explicit ActivityInvite(Discord_ActivityInvite instance, DiscordObjectState state);
649 operator bool() const { return state_ != DiscordObjectState::Invalid; }
650
655
656 explicit ActivityInvite();
657
659 void Drop();
661
663 uint64_t SenderId() const;
665 void SetSenderId(uint64_t SenderId);
666
668 uint64_t ChannelId() const;
670 void SetChannelId(uint64_t ChannelId);
671
673 uint64_t MessageId() const;
675 void SetMessageId(uint64_t MessageId);
676
681
683 uint64_t ApplicationId() const;
686
688 std::string PartyId() const;
690 void SetPartyId(std::string PartyId);
691
693 std::string SessionId() const;
695 void SetSessionId(std::string SessionId);
696
699 bool IsValid() const;
701 void SetIsValid(bool IsValid);
702};
703
722 mutable Discord_ActivityAssets instance_{};
725
726public:
728 Discord_ActivityAssets* instance() const { return &instance_; }
731 explicit ActivityAssets(Discord_ActivityAssets instance, DiscordObjectState state);
741 operator bool() const { return state_ != DiscordObjectState::Invalid; }
742
747
748 explicit ActivityAssets();
749
751 void Drop();
753
758 std::optional<std::string> LargeImage() const;
760 void SetLargeImage(std::optional<std::string> LargeImage);
761
765 std::optional<std::string> LargeText() const;
767 void SetLargeText(std::optional<std::string> LargeText);
768
772 std::optional<std::string> SmallImage() const;
774 void SetSmallImage(std::optional<std::string> SmallImage);
775
779 std::optional<std::string> SmallText() const;
781 void SetSmallText(std::optional<std::string> SmallText);
782};
783
787 mutable Discord_ActivityTimestamps instance_{};
790
791public:
793 Discord_ActivityTimestamps* instance() const { return &instance_; }
796 explicit ActivityTimestamps(Discord_ActivityTimestamps instance, DiscordObjectState state);
806 operator bool() const { return state_ != DiscordObjectState::Invalid; }
807
812
813 explicit ActivityTimestamps();
814
816 void Drop();
818
824 uint64_t Start() const;
826 void SetStart(uint64_t Start);
827
833 uint64_t End() const;
835 void SetEnd(uint64_t End);
836};
837
841 mutable Discord_ActivityParty instance_{};
844
845public:
847 Discord_ActivityParty* instance() const { return &instance_; }
850 explicit ActivityParty(Discord_ActivityParty instance, DiscordObjectState state);
854 ActivityParty(ActivityParty&& other) noexcept;
858 static const ActivityParty nullobj;
860 operator bool() const { return state_ != DiscordObjectState::Invalid; }
861
866
867 explicit ActivityParty();
868
870 void Drop();
872
879 std::string Id() const;
881 void SetId(std::string Id);
882
884 int32_t CurrentSize() const;
887
890 int32_t MaxSize() const;
892 void SetMaxSize(int32_t MaxSize);
893
898};
899
903 mutable Discord_ActivitySecrets instance_{};
906
907public:
909 Discord_ActivitySecrets* instance() const { return &instance_; }
912 explicit ActivitySecrets(Discord_ActivitySecrets instance, DiscordObjectState state);
922 operator bool() const { return state_ != DiscordObjectState::Invalid; }
923
928
929 explicit ActivitySecrets();
930
932 void Drop();
934
939 std::string Join() const;
941 void SetJoin(std::string Join);
942};
943
1114 mutable Discord_Activity instance_{};
1117
1118public:
1120 Discord_Activity* instance() const { return &instance_; }
1123 explicit Activity(Discord_Activity instance, DiscordObjectState state);
1124 ~Activity();
1127 Activity(Activity&& other) noexcept;
1129 Activity& operator=(Activity&& other) noexcept;
1131 static const Activity nullobj;
1133 operator bool() const { return state_ != DiscordObjectState::Invalid; }
1134
1136 Activity(const Activity& arg0);
1139
1140 explicit Activity();
1141
1143 void Drop();
1145
1147 bool Equals(discordpp::Activity other) const;
1148
1152 std::string Name() const;
1154 void SetName(std::string Name);
1155
1162
1167 std::optional<std::string> State() const;
1169 void SetState(std::optional<std::string> State);
1170
1175 std::optional<std::string> Details() const;
1177 void SetDetails(std::optional<std::string> Details);
1178
1183 std::optional<uint64_t> ApplicationId() const;
1185 void SetApplicationId(std::optional<uint64_t> ApplicationId);
1186
1188 std::optional<discordpp::ActivityAssets> Assets() const;
1190 void SetAssets(std::optional<discordpp::ActivityAssets> Assets);
1191
1195 std::optional<discordpp::ActivityTimestamps> Timestamps() const;
1197 void SetTimestamps(std::optional<discordpp::ActivityTimestamps> Timestamps);
1198
1201 std::optional<discordpp::ActivityParty> Party() const;
1203 void SetParty(std::optional<discordpp::ActivityParty> Party);
1204
1207 std::optional<discordpp::ActivitySecrets> Secrets() const;
1209 void SetSecrets(std::optional<discordpp::ActivitySecrets> Secrets);
1210
1219};
1220
1232 mutable Discord_ClientResult instance_{};
1235
1236public:
1238 Discord_ClientResult* instance() const { return &instance_; }
1241 explicit ClientResult(Discord_ClientResult instance, DiscordObjectState state);
1242 ~ClientResult();
1245 ClientResult(ClientResult&& other) noexcept;
1249 static const ClientResult nullobj;
1251 operator bool() const { return state_ != DiscordObjectState::Invalid; }
1252
1257
1259 void Drop();
1261
1263 std::string ToString() const;
1264
1269
1271 std::string Error() const;
1273 void SetError(std::string Error);
1274
1283 int32_t ErrorCode() const;
1286
1293
1301 std::string ResponseBody() const;
1304
1306 bool Successful() const;
1309
1311 bool Retryable() const;
1314
1317 float RetryAfter() const;
1320};
1321
1325 mutable Discord_AuthorizationCodeChallenge instance_{};
1328
1329public:
1331 Discord_AuthorizationCodeChallenge* instance() const { return &instance_; }
1334 explicit AuthorizationCodeChallenge(Discord_AuthorizationCodeChallenge instance,
1335 DiscordObjectState state);
1345 operator bool() const { return state_ != DiscordObjectState::Invalid; }
1346
1351
1352 explicit AuthorizationCodeChallenge();
1353
1355 void Drop();
1357
1362
1364 std::string Challenge() const;
1366 void SetChallenge(std::string Challenge);
1367};
1368
1372 mutable Discord_AuthorizationCodeVerifier instance_{};
1375
1376public:
1378 Discord_AuthorizationCodeVerifier* instance() const { return &instance_; }
1381 explicit AuthorizationCodeVerifier(Discord_AuthorizationCodeVerifier instance,
1382 DiscordObjectState state);
1392 operator bool() const { return state_ != DiscordObjectState::Invalid; }
1393
1398
1400 void Drop();
1402
1407
1409 std::string Verifier() const;
1411 void SetVerifier(std::string Verifier);
1412};
1413
1417 mutable Discord_AuthorizationArgs instance_{};
1420
1421public:
1423 Discord_AuthorizationArgs* instance() const { return &instance_; }
1426 explicit AuthorizationArgs(Discord_AuthorizationArgs instance, DiscordObjectState state);
1436 operator bool() const { return state_ != DiscordObjectState::Invalid; }
1437
1442
1443 explicit AuthorizationArgs();
1444
1446 void Drop();
1448
1451 uint64_t ClientId() const;
1453 void SetClientId(uint64_t ClientId);
1454
1467 std::string Scopes() const;
1469 void SetScopes(std::string Scopes);
1470
1476 std::optional<std::string> State() const;
1478 void SetState(std::optional<std::string> State);
1479
1484 std::optional<std::string> Nonce() const;
1486 void SetNonce(std::optional<std::string> Nonce);
1487
1493 std::optional<discordpp::AuthorizationCodeChallenge> CodeChallenge() const;
1495 void SetCodeChallenge(std::optional<discordpp::AuthorizationCodeChallenge> CodeChallenge);
1496};
1497
1501 mutable Discord_DeviceAuthorizationArgs instance_{};
1504
1505public:
1507 Discord_DeviceAuthorizationArgs* instance() const { return &instance_; }
1510 explicit DeviceAuthorizationArgs(Discord_DeviceAuthorizationArgs instance,
1511 DiscordObjectState state);
1521 operator bool() const { return state_ != DiscordObjectState::Invalid; }
1522
1527
1528 explicit DeviceAuthorizationArgs();
1529
1531 void Drop();
1533
1536 uint64_t ClientId() const;
1538 void SetClientId(uint64_t ClientId);
1539
1552 std::string Scopes() const;
1554 void SetScopes(std::string Scopes);
1555};
1556
1569 mutable Discord_VoiceStateHandle instance_{};
1572
1573public:
1575 Discord_VoiceStateHandle* instance() const { return &instance_; }
1578 explicit VoiceStateHandle(Discord_VoiceStateHandle instance, DiscordObjectState state);
1588 operator bool() const { return state_ != DiscordObjectState::Invalid; }
1589
1594
1596 void Drop();
1598
1601 bool SelfDeaf() const;
1602
1605 bool SelfMute() const;
1606};
1607
1611 mutable Discord_VADThresholdSettings instance_{};
1614
1615public:
1617 Discord_VADThresholdSettings* instance() const { return &instance_; }
1620 explicit VADThresholdSettings(Discord_VADThresholdSettings instance, DiscordObjectState state);
1630 operator bool() const { return state_ != DiscordObjectState::Invalid; }
1631
1634
1636 void Drop();
1638
1641 float VadThreshold() const;
1644
1647 bool Automatic() const;
1650};
1651
1653class Call {
1655 mutable Discord_Call instance_{};
1658
1659public:
1681
1683 enum class Status {
1684
1687
1690
1693
1696
1699
1702
1705 };
1706
1708 using OnVoiceStateChanged = std::function<void(uint64_t userId)>;
1709
1711 using OnParticipantChanged = std::function<void(uint64_t userId, bool added)>;
1712
1714 using OnSpeakingStatusChanged = std::function<void(uint64_t userId, bool isPlayingSound)>;
1715
1717 using OnStatusChanged = std::function<
1718 void(discordpp::Call::Status status, discordpp::Call::Error error, int32_t errorDetail)>;
1720 Discord_Call* instance() const { return &instance_; }
1723 explicit Call(Discord_Call instance, DiscordObjectState state);
1724 ~Call();
1727 Call(Call&& other) noexcept;
1729 Call& operator=(Call&& other) noexcept;
1731 static const Call nullobj;
1733 operator bool() const { return state_ != DiscordObjectState::Invalid; }
1734
1736 Call(const Call& other);
1738 Call& operator=(const Call& other);
1739
1741 void Drop();
1743
1745 static std::string ErrorToString(discordpp::Call::Error type);
1746
1750
1752 uint64_t GetChannelId() const;
1753
1755 uint64_t GetGuildId() const;
1756
1758 bool GetLocalMute(uint64_t userId);
1759
1761 std::vector<uint64_t> GetParticipants() const;
1762
1767 float GetParticipantVolume(uint64_t userId);
1768
1772
1776
1779
1782
1787
1791
1797 std::optional<discordpp::VoiceStateHandle> GetVoiceStateHandle(uint64_t userId) const;
1798
1805
1809 void SetLocalMute(uint64_t userId, bool mute);
1810
1818
1821
1826 void SetParticipantVolume(uint64_t userId, float volume);
1827
1831 void SetPTTActive(bool active);
1832
1837 void SetPTTReleaseDelay(uint32_t releaseDelayMs);
1838
1842 void SetSelfDeaf(bool deaf);
1843
1846 void SetSelfMute(bool mute);
1847
1854
1858
1865 void SetVADThreshold(bool automatic, float threshold);
1866
1868 static std::string StatusToString(discordpp::Call::Status type);
1869};
1870
1882 mutable Discord_ChannelHandle instance_{};
1885
1886public:
1888 Discord_ChannelHandle* instance() const { return &instance_; }
1891 explicit ChannelHandle(Discord_ChannelHandle instance, DiscordObjectState state);
1895 ChannelHandle(ChannelHandle&& other) noexcept;
1901 operator bool() const { return state_ != DiscordObjectState::Invalid; }
1902
1907
1909 void Drop();
1911
1913 uint64_t Id() const;
1914
1919 std::string Name() const;
1920
1923 std::vector<uint64_t> Recipients() const;
1924
1927};
1928
1933 mutable Discord_GuildMinimal instance_{};
1936
1937public:
1939 Discord_GuildMinimal* instance() const { return &instance_; }
1942 explicit GuildMinimal(Discord_GuildMinimal instance, DiscordObjectState state);
1943 ~GuildMinimal();
1946 GuildMinimal(GuildMinimal&& other) noexcept;
1950 static const GuildMinimal nullobj;
1952 operator bool() const { return state_ != DiscordObjectState::Invalid; }
1953
1958
1960 void Drop();
1962
1964 uint64_t Id() const;
1966 void SetId(uint64_t Id);
1967
1969 std::string Name() const;
1971 void SetName(std::string Name);
1972};
1973
1978 mutable Discord_GuildChannel instance_{};
1981
1982public:
1984 Discord_GuildChannel* instance() const { return &instance_; }
1987 explicit GuildChannel(Discord_GuildChannel instance, DiscordObjectState state);
1988 ~GuildChannel();
1991 GuildChannel(GuildChannel&& other) noexcept;
1995 static const GuildChannel nullobj;
1997 operator bool() const { return state_ != DiscordObjectState::Invalid; }
1998
2003
2005 void Drop();
2007
2009 uint64_t Id() const;
2011 void SetId(uint64_t Id);
2012
2014 std::string Name() const;
2016 void SetName(std::string Name);
2017
2028 bool IsLinkable() const;
2031
2048
2051 std::optional<discordpp::LinkedLobby> LinkedLobby() const;
2053 void SetLinkedLobby(std::optional<discordpp::LinkedLobby> LinkedLobby);
2054};
2055
2059 mutable Discord_LinkedLobby instance_{};
2062
2063public:
2065 Discord_LinkedLobby* instance() const { return &instance_; }
2068 explicit LinkedLobby(Discord_LinkedLobby instance, DiscordObjectState state);
2069 ~LinkedLobby();
2072 LinkedLobby(LinkedLobby&& other) noexcept;
2076 static const LinkedLobby nullobj;
2078 operator bool() const { return state_ != DiscordObjectState::Invalid; }
2079
2084
2085 explicit LinkedLobby();
2086
2088 void Drop();
2090
2092 uint64_t ApplicationId() const;
2095
2097 uint64_t LobbyId() const;
2099 void SetLobbyId(uint64_t LobbyId);
2100};
2101
2105 mutable Discord_LinkedChannel instance_{};
2108
2109public:
2111 Discord_LinkedChannel* instance() const { return &instance_; }
2114 explicit LinkedChannel(Discord_LinkedChannel instance, DiscordObjectState state);
2118 LinkedChannel(LinkedChannel&& other) noexcept;
2124 operator bool() const { return state_ != DiscordObjectState::Invalid; }
2125
2130
2132 void Drop();
2134
2136 uint64_t Id() const;
2138 void SetId(uint64_t Id);
2139
2141 std::string Name() const;
2143 void SetName(std::string Name);
2144
2146 uint64_t GuildId() const;
2148 void SetGuildId(uint64_t GuildId);
2149};
2150
2187 mutable Discord_RelationshipHandle instance_{};
2190
2191public:
2193 Discord_RelationshipHandle* instance() const { return &instance_; }
2196 explicit RelationshipHandle(Discord_RelationshipHandle instance, DiscordObjectState state);
2206 operator bool() const { return state_ != DiscordObjectState::Invalid; }
2207
2212
2214 void Drop();
2216
2219
2222
2224 uint64_t Id() const;
2225
2228 std::optional<discordpp::UserHandle> User() const;
2229};
2230
2243 mutable Discord_UserHandle instance_{};
2246
2247public:
2249 enum class AvatarType {
2250
2252 Gif = 0,
2253
2255 Webp = 1,
2256
2258 Png = 2,
2259
2261 Jpeg = 3,
2262 };
2263
2264 Discord_UserHandle* instance() const { return &instance_; }
2267 explicit UserHandle(Discord_UserHandle instance, DiscordObjectState state);
2268 ~UserHandle();
2271 UserHandle(UserHandle&& other) noexcept;
2273 UserHandle& operator=(UserHandle&& other) noexcept;
2275 static const UserHandle nullobj;
2277 operator bool() const { return state_ != DiscordObjectState::Invalid; }
2278
2283
2285 void Drop();
2287
2289 std::optional<std::string> Avatar() const;
2290
2293
2299 discordpp::UserHandle::AvatarType staticType) const;
2300
2303 std::string DisplayName() const;
2304
2314 std::optional<discordpp::Activity> GameActivity() const;
2315
2324 std::optional<std::string> GlobalName() const;
2325
2329 uint64_t Id() const;
2330
2332 bool IsProvisional() const;
2333
2337
2340
2347 std::string Username() const;
2348};
2349
2368 mutable Discord_LobbyMemberHandle instance_{};
2371
2372public:
2374 Discord_LobbyMemberHandle* instance() const { return &instance_; }
2377 explicit LobbyMemberHandle(Discord_LobbyMemberHandle instance, DiscordObjectState state);
2387 operator bool() const { return state_ != DiscordObjectState::Invalid; }
2388
2393
2395 void Drop();
2397
2404 bool CanLinkLobby() const;
2405
2407 bool Connected() const;
2408
2410 uint64_t Id() const;
2411
2417 std::unordered_map<std::string, std::string> Metadata() const;
2418
2420 std::optional<discordpp::UserHandle> User() const;
2421};
2422
2511 mutable Discord_LobbyHandle instance_{};
2514
2515public:
2517 Discord_LobbyHandle* instance() const { return &instance_; }
2520 explicit LobbyHandle(Discord_LobbyHandle instance, DiscordObjectState state);
2521 ~LobbyHandle();
2524 LobbyHandle(LobbyHandle&& other) noexcept;
2528 static const LobbyHandle nullobj;
2530 operator bool() const { return state_ != DiscordObjectState::Invalid; }
2531
2536
2538 void Drop();
2540
2546 std::optional<discordpp::CallInfoHandle> GetCallInfoHandle() const;
2547
2550 std::optional<discordpp::LobbyMemberHandle> GetLobbyMemberHandle(uint64_t memberId) const;
2551
2553 uint64_t Id() const;
2554
2556 std::optional<discordpp::LinkedChannel> LinkedChannel() const;
2557
2559 std::vector<uint64_t> LobbyMemberIds() const;
2560
2562 std::vector<discordpp::LobbyMemberHandle> LobbyMembers() const;
2563
2568 std::unordered_map<std::string, std::string> Metadata() const;
2569};
2570
2575 mutable Discord_AdditionalContent instance_{};
2578
2579public:
2581 Discord_AdditionalContent* instance() const { return &instance_; }
2584 explicit AdditionalContent(Discord_AdditionalContent instance, DiscordObjectState state);
2594 operator bool() const { return state_ != DiscordObjectState::Invalid; }
2595
2600
2601 explicit AdditionalContent();
2602
2604 void Drop();
2606
2609
2612
2617
2620 std::optional<std::string> Title() const;
2622 void SetTitle(std::optional<std::string> Title);
2623
2626 uint8_t Count() const;
2628 void SetCount(uint8_t Count);
2629};
2630
2687 mutable Discord_MessageHandle instance_{};
2690
2691public:
2693 Discord_MessageHandle* instance() const { return &instance_; }
2696 explicit MessageHandle(Discord_MessageHandle instance, DiscordObjectState state);
2700 MessageHandle(MessageHandle&& other) noexcept;
2706 operator bool() const { return state_ != DiscordObjectState::Invalid; }
2707
2712
2714 void Drop();
2716
2719 std::optional<discordpp::AdditionalContent> AdditionalContent() const;
2720
2722 std::optional<discordpp::UserHandle> Author() const;
2723
2725 uint64_t AuthorId() const;
2726
2728 std::optional<discordpp::ChannelHandle> Channel() const;
2729
2731 uint64_t ChannelId() const;
2732
2738 std::string Content() const;
2739
2742 std::optional<discordpp::DisclosureTypes> DisclosureType() const;
2743
2747 uint64_t EditedTimestamp() const;
2748
2750 uint64_t Id() const;
2751
2753 std::optional<discordpp::LobbyHandle> Lobby() const;
2754
2760 std::unordered_map<std::string, std::string> Metadata() const;
2761
2767 std::string RawContent() const;
2768
2771 std::optional<discordpp::UserHandle> Recipient() const;
2772
2775 uint64_t RecipientId() const;
2776
2779 bool SentFromGame() const;
2780
2782 uint64_t SentTimestamp() const;
2783};
2784
2791 mutable Discord_AudioDevice instance_{};
2794
2795public:
2797 Discord_AudioDevice* instance() const { return &instance_; }
2800 explicit AudioDevice(Discord_AudioDevice instance, DiscordObjectState state);
2801 ~AudioDevice();
2804 AudioDevice(AudioDevice&& other) noexcept;
2808 static const AudioDevice nullobj;
2810 operator bool() const { return state_ != DiscordObjectState::Invalid; }
2811
2816
2818 void Drop();
2820
2823
2825 std::string Id() const;
2827 void SetId(std::string Id);
2828
2830 std::string Name() const;
2832 void SetName(std::string Name);
2833
2835 bool IsDefault() const;
2838};
2839
2844class Client {
2846 mutable Discord_Client instance_{};
2849
2850public:
2858 enum class Error {
2859
2861 None = 0,
2862
2865
2868
2871 };
2872
2887 enum class Status {
2888
2891
2894
2897
2900
2903
2906
2909 };
2910
2912 enum class Thread {
2913
2916
2919
2922 };
2923
2925 using EndCallCallback = std::function<void()>;
2926
2928 using EndCallsCallback = std::function<void()>;
2929
2931 using GetCurrentInputDeviceCallback = std::function<void(discordpp::AudioDevice device)>;
2932
2934 using GetCurrentOutputDeviceCallback = std::function<void(discordpp::AudioDevice device)>;
2935
2938 std::function<void(std::vector<discordpp::AudioDevice> devices)>;
2939
2942 std::function<void(std::vector<discordpp::AudioDevice> devices)>;
2943
2946 std::function<void(std::vector<discordpp::AudioDevice> inputDevices,
2947 std::vector<discordpp::AudioDevice> outputDevices)>;
2948
2950 using SetInputDeviceCallback = std::function<void(discordpp::ClientResult result)>;
2951
2953 using NoAudioInputCallback = std::function<void(bool inputDetected)>;
2954
2956 using SetOutputDeviceCallback = std::function<void(discordpp::ClientResult result)>;
2957
2960 std::function<void(uint64_t lobbyId, uint64_t memberId, bool added)>;
2961
2965 using UserAudioReceivedCallback = std::function<void(uint64_t userId,
2966 int16_t* data,
2967 uint64_t samplesPerChannel,
2968 int32_t sampleRate,
2969 uint64_t channels,
2970 bool& outShouldMute)>;
2971
2975 using UserAudioCapturedCallback = std::function<
2976 void(int16_t* data, uint64_t samplesPerChannel, int32_t sampleRate, uint64_t channels)>;
2977
2984 using AuthorizationCallback = std::function<
2985 void(discordpp::ClientResult result, std::string code, std::string redirectUri)>;
2986
2989 std::function<void(discordpp::ClientResult result, uint64_t id, std::string name)>;
2990
2992 using TokenExchangeCallback = std::function<void(discordpp::ClientResult result,
2993 std::string accessToken,
2994 std::string refreshToken,
2996 int32_t expiresIn,
2997 std::string scopes)>;
2998
3000 using AuthorizeDeviceScreenClosedCallback = std::function<void()>;
3001
3003 using TokenExpirationCallback = std::function<void()>;
3004
3007 std::function<void(discordpp::ClientResult result)>;
3008
3011 using UpdateTokenCallback = std::function<void(discordpp::ClientResult result)>;
3012
3014 using DeleteUserMessageCallback = std::function<void(discordpp::ClientResult result)>;
3015
3017 using EditUserMessageCallback = std::function<void(discordpp::ClientResult result)>;
3018
3020 using ProvisionalUserMergeRequiredCallback = std::function<void()>;
3021
3023 using OpenMessageInDiscordCallback = std::function<void(discordpp::ClientResult result)>;
3024
3029 std::function<void(discordpp::ClientResult result, uint64_t messageId)>;
3030
3032 using MessageCreatedCallback = std::function<void(uint64_t messageId)>;
3033
3035 using MessageDeletedCallback = std::function<void(uint64_t messageId, uint64_t channelId)>;
3036
3038 using MessageUpdatedCallback = std::function<void(uint64_t messageId)>;
3039
3042 std::function<void(std::string message, discordpp::LoggingSeverity severity)>;
3043
3048 using OnStatusChanged = std::function<
3049 void(discordpp::Client::Status status, discordpp::Client::Error error, int32_t errorDetail)>;
3050
3053 std::function<void(discordpp::ClientResult result, uint64_t lobbyId)>;
3054
3057 std::function<void(discordpp::ClientResult result,
3058 std::vector<discordpp::GuildChannel> guildChannels)>;
3059
3061 using GetUserGuildsCallback = std::function<void(discordpp::ClientResult result,
3062 std::vector<discordpp::GuildMinimal> guilds)>;
3063
3065 using LeaveLobbyCallback = std::function<void(discordpp::ClientResult result)>;
3066
3068 using LinkOrUnlinkChannelCallback = std::function<void(discordpp::ClientResult result)>;
3069
3071 using LobbyCreatedCallback = std::function<void(uint64_t lobbyId)>;
3072
3074 using LobbyDeletedCallback = std::function<void(uint64_t lobbyId)>;
3075
3077 using LobbyMemberAddedCallback = std::function<void(uint64_t lobbyId, uint64_t memberId)>;
3078
3080 using LobbyMemberRemovedCallback = std::function<void(uint64_t lobbyId, uint64_t memberId)>;
3081
3083 using LobbyMemberUpdatedCallback = std::function<void(uint64_t lobbyId, uint64_t memberId)>;
3084
3086 using LobbyUpdatedCallback = std::function<void(uint64_t lobbyId)>;
3087
3090 std::function<void(discordpp::ClientResult result, std::string joinSecret)>;
3091
3094 using SendActivityInviteCallback = std::function<void(discordpp::ClientResult result)>;
3095
3097 using ActivityInviteCallback = std::function<void(discordpp::ActivityInvite invite)>;
3098
3100 using ActivityJoinCallback = std::function<void(std::string joinSecret)>;
3101
3103 using UpdateStatusCallback = std::function<void(discordpp::ClientResult result)>;
3104
3106 using UpdateRichPresenceCallback = std::function<void(discordpp::ClientResult result)>;
3107
3110 using UpdateRelationshipCallback = std::function<void(discordpp::ClientResult result)>;
3111
3114 using SendFriendRequestCallback = std::function<void(discordpp::ClientResult result)>;
3115
3119 std::function<void(uint64_t userId, bool isDiscordRelationshipUpdate)>;
3120
3123 std::function<void(uint64_t userId, bool isDiscordRelationshipUpdate)>;
3124
3127 std::function<void(discordpp::ClientResult result,
3128 std::optional<discordpp::UserHandle> user)>;
3129
3131 using UserUpdatedCallback = std::function<void(uint64_t userId)>;
3133 Discord_Client* instance() const { return &instance_; }
3136 explicit Client(Discord_Client instance, DiscordObjectState state);
3137 ~Client();
3140 Client(Client&& other) noexcept;
3142 Client& operator=(Client&& other) noexcept;
3144 static const Client nullobj;
3146 operator bool() const { return state_ != DiscordObjectState::Invalid; }
3147
3148 Client(const Client&) = delete;
3149 Client& operator=(const Client&) = delete;
3150
3152 explicit Client();
3153
3155 explicit Client(std::string apiBase, std::string webBase);
3156
3158 void Drop();
3160
3162 static std::string ErrorToString(discordpp::Client::Error type);
3163
3169
3172 static std::string GetDefaultAudioDeviceId();
3173
3188 static std::string GetDefaultCommunicationScopes();
3189
3200 static std::string GetDefaultPresenceScopes();
3201
3203 static std::string GetVersionHash();
3204
3206 static int32_t GetVersionMajor();
3207
3209 static int32_t GetVersionMinor();
3210
3212 static int32_t GetVersionPatch();
3213
3216
3219
3222
3225 void EndCall(uint64_t channelId, discordpp::Client::EndCallCallback callback);
3226
3230
3232 discordpp::Call GetCall(uint64_t channelId);
3233
3235 std::vector<discordpp::Call> GetCalls();
3236
3239
3242
3245
3251
3254
3260
3262 bool GetSelfDeafAll() const;
3263
3265 bool GetSelfMuteAll() const;
3266
3275
3279
3286 void SetEchoCancellation(bool on);
3287
3292
3297 void SetInputVolume(float inputVolume);
3298
3302
3311 void SetNoAudioInputThreshold(float dBFSThreshold);
3312
3319 void SetNoiseSuppression(bool on);
3320
3327 void SetOpusHardwareCoding(bool encode, bool decode);
3328
3333
3338 void SetOutputVolume(float outputVolume);
3339
3344 void SetSelfDeafAll(bool deaf);
3345
3348 void SetSelfMuteAll(bool mute);
3349
3351 bool SetSpeakerMode(bool speakerMode);
3352
3359 void SetThreadPriority(discordpp::Client::Thread thread, int32_t priority);
3360
3367
3370
3381 discordpp::Call StartCall(uint64_t channelId);
3382
3402 uint64_t lobbyId,
3406
3409
3415
3418
3514
3521
3527
3534 std::string const& token,
3536
3570 void GetProvisionalToken(uint64_t applicationId,
3572 std::string const& externalAuthToken,
3574
3598 void GetToken(uint64_t applicationId,
3599 std::string const& code,
3600 std::string const& codeVerifier,
3601 std::string const& redirectUri,
3603
3631
3671 std::string const& externalAuthToken,
3673
3704 void GetTokenFromProvisionalMerge(uint64_t applicationId,
3705 std::string const& code,
3706 std::string const& codeVerifier,
3707 std::string const& redirectUri,
3709 std::string const& externalAuthToken,
3711
3715
3720 void OpenAuthorizeDeviceScreen(uint64_t clientId, std::string const& userCode);
3721
3729
3744 void RefreshToken(uint64_t applicationId,
3745 std::string const& refreshToken,
3747
3752
3758 void SetGameWindowPid(int32_t pid);
3759
3773
3780 std::string const& name,
3782
3790 std::string token,
3793
3796
3802 bool CanOpenMessageInDiscord(uint64_t messageId);
3803
3805 void DeleteUserMessage(uint64_t recipientId,
3806 uint64_t messageId,
3808
3812 void EditUserMessage(uint64_t recipientId,
3813 uint64_t messageId,
3814 std::string const& content,
3816
3823 std::optional<discordpp::ChannelHandle> GetChannelHandle(uint64_t channelId) const;
3824
3829 std::optional<discordpp::MessageHandle> GetMessageHandle(uint64_t messageId) const;
3830
3837 uint64_t messageId,
3838 discordpp::Client::ProvisionalUserMergeRequiredCallback provisionalUserMergeRequiredCallback,
3840
3851 void SendLobbyMessage(uint64_t lobbyId,
3852 std::string const& content,
3854
3861 void SendLobbyMessageWithMetadata(uint64_t lobbyId,
3862 std::string const& content,
3863 std::unordered_map<std::string, std::string> const& metadata,
3865
3878 void SendUserMessage(uint64_t recipientId,
3879 std::string const& content,
3881
3888 void SendUserMessageWithMetadata(uint64_t recipientId,
3889 std::string const& content,
3890 std::unordered_map<std::string, std::string> const& metadata,
3892
3905
3913
3921
3932 void SetShowingChat(bool showingChat);
3934
3937
3948 discordpp::LoggingSeverity minSeverity);
3949
3956 discordpp::LoggingSeverity minSeverity);
3957
3964 void Connect();
3965
3972
3976
3981 void SetApplicationId(uint64_t applicationId);
3982
3997 bool SetLogDir(std::string const& path, discordpp::LoggingSeverity minSeverity);
3998
4001
4014 void SetVoiceLogDir(std::string const& path, discordpp::LoggingSeverity minSeverity);
4016
4019
4037 void CreateOrJoinLobby(std::string const& secret,
4039
4047 std::string const& secret,
4048 std::unordered_map<std::string, std::string> const& lobbyMetadata,
4049 std::unordered_map<std::string, std::string> const& memberMetadata,
4051
4058
4060 std::optional<discordpp::LobbyHandle> GetLobbyHandle(uint64_t lobbyId) const;
4061
4067 std::vector<uint64_t> GetLobbyIds() const;
4068
4076
4083 void LeaveLobby(uint64_t lobbyId, discordpp::Client::LeaveLobbyCallback callback);
4084
4089 void LinkChannelToLobby(uint64_t lobbyId,
4090 uint64_t channelId,
4092
4105
4116
4125
4134
4141
4145
4151 void UnlinkChannelFromLobby(uint64_t lobbyId,
4154
4157
4165
4168
4188 bool RegisterLaunchCommand(uint64_t applicationId, std::string command);
4189
4196 bool RegisterLaunchSteamApplication(uint64_t applicationId, uint32_t steamAppId);
4197
4208 void SendActivityInvite(uint64_t userId,
4209 std::string const& content,
4211
4219
4225
4235
4242
4250
4254
4274
4277
4283 void AcceptDiscordFriendRequest(uint64_t userId,
4285
4291
4299
4305 void CancelDiscordFriendRequest(uint64_t userId,
4307
4313
4317
4320 std::vector<discordpp::RelationshipHandle> GetRelationships() const;
4321
4327 void RejectDiscordFriendRequest(uint64_t userId,
4329
4335
4340 void RemoveDiscordAndGameFriend(uint64_t userId,
4342
4347
4352 std::vector<discordpp::UserHandle> SearchFriendsByUsername(std::string searchStr) const;
4353
4369 void SendDiscordFriendRequest(std::string const& username,
4371
4387 void SendDiscordFriendRequestById(uint64_t userId,
4389
4405 void SendGameFriendRequest(std::string const& username,
4407
4423 void SendGameFriendRequestById(uint64_t userId,
4425
4432
4439
4446
4449
4457
4462 uint64_t applicationId,
4464
4470 std::optional<discordpp::UserHandle> GetUser(uint64_t userId) const;
4471
4478};
4479
4483 mutable Discord_CallInfoHandle instance_{};
4486
4487public:
4489 Discord_CallInfoHandle* instance() const { return &instance_; }
4492 explicit CallInfoHandle(Discord_CallInfoHandle instance, DiscordObjectState state);
4502 operator bool() const { return state_ != DiscordObjectState::Invalid; }
4503
4508
4510 void Drop();
4512
4514 uint64_t ChannelId() const;
4515
4517 std::vector<uint64_t> GetParticipants() const;
4518
4521 std::optional<discordpp::VoiceStateHandle> GetVoiceStateHandle(uint64_t userId) const;
4522
4524 uint64_t GuildId() const;
4525};
4526
4528{
4529 switch (value) {
4531 return "Join";
4533 return "JoinRequest";
4534 default:
4535 return "unknown";
4536 }
4537}
4538
4540{
4541 switch (value) {
4543 return "Private";
4545 return "Public";
4546 default:
4547 return "unknown";
4548 }
4549}
4550
4552{
4553 switch (value) {
4555 return "Playing";
4557 return "Streaming";
4559 return "Listening";
4561 return "Watching";
4563 return "CustomStatus";
4565 return "Competing";
4567 return "HangStatus";
4568 default:
4569 return "unknown";
4570 }
4571}
4572
4574{
4575 switch (value) {
4577 return "Desktop";
4579 return "Xbox";
4581 return "Samsung";
4583 return "IOS";
4585 return "Android";
4587 return "Embedded";
4589 return "PS4";
4591 return "PS5";
4592 default:
4593 return "unknown";
4594 }
4595}
4596
4597inline const char* EnumToString(discordpp::ErrorType value)
4598{
4599 switch (value) {
4601 return "None";
4603 return "NetworkError";
4605 return "HTTPError";
4607 return "ClientNotReady";
4609 return "Disabled";
4611 return "ClientDestroyed";
4613 return "ValidationError";
4615 return "Aborted";
4617 return "AuthorizationFailed";
4619 return "RPCError";
4620 default:
4621 return "unknown";
4622 }
4623}
4624
4626{
4627 switch (value) {
4629 return "None";
4631 return "Continue";
4633 return "SwitchingProtocols";
4635 return "Processing";
4637 return "EarlyHints";
4639 return "Ok";
4641 return "Created";
4643 return "Accepted";
4645 return "NonAuthoritativeInfo";
4647 return "NoContent";
4649 return "ResetContent";
4651 return "PartialContent";
4653 return "MultiStatus";
4655 return "AlreadyReported";
4657 return "ImUsed";
4659 return "MultipleChoices";
4661 return "MovedPermanently";
4663 return "Found";
4665 return "SeeOther";
4667 return "NotModified";
4669 return "TemporaryRedirect";
4671 return "PermanentRedirect";
4673 return "BadRequest";
4675 return "Unauthorized";
4677 return "PaymentRequired";
4679 return "Forbidden";
4681 return "NotFound";
4683 return "MethodNotAllowed";
4685 return "NotAcceptable";
4687 return "ProxyAuthRequired";
4689 return "RequestTimeout";
4691 return "Conflict";
4693 return "Gone";
4695 return "LengthRequired";
4697 return "PreconditionFailed";
4699 return "PayloadTooLarge";
4701 return "UriTooLong";
4703 return "UnsupportedMediaType";
4705 return "RangeNotSatisfiable";
4707 return "ExpectationFailed";
4709 return "MisdirectedRequest";
4711 return "UnprocessableEntity";
4713 return "Locked";
4715 return "FailedDependency";
4717 return "TooEarly";
4719 return "UpgradeRequired";
4721 return "PreconditionRequired";
4723 return "TooManyRequests";
4725 return "RequestHeaderFieldsTooLarge";
4727 return "InternalServerError";
4729 return "NotImplemented";
4731 return "BadGateway";
4733 return "ServiceUnavailable";
4735 return "GatewayTimeout";
4737 return "HttpVersionNotSupported";
4739 return "VariantAlsoNegotiates";
4741 return "InsufficientStorage";
4743 return "LoopDetected";
4745 return "NotExtended";
4747 return "NetworkAuthorizationRequired";
4748 default:
4749 return "unknown";
4750 }
4751}
4752
4754{
4755 switch (value) {
4757 return "S256";
4758 default:
4759 return "unknown";
4760 }
4761}
4762
4764{
4765 switch (value) {
4767 return "Other";
4769 return "Attachment";
4771 return "Poll";
4773 return "VoiceMessage";
4775 return "Thread";
4777 return "Embed";
4779 return "Sticker";
4780 default:
4781 return "unknown";
4782 }
4783}
4784
4785inline const char* EnumToString(discordpp::Call::Error value)
4786{
4787 switch (value) {
4789 return "None";
4791 return "SignalingConnectionFailed";
4793 return "SignalingUnexpectedClose";
4795 return "VoiceConnectionFailed";
4797 return "JoinTimeout";
4799 return "Forbidden";
4800 default:
4801 return "unknown";
4802 }
4803}
4804
4806{
4807 switch (value) {
4809 return "MODE_UNINIT";
4811 return "MODE_VAD";
4813 return "MODE_PTT";
4814 default:
4815 return "unknown";
4816 }
4817}
4818
4819inline const char* EnumToString(discordpp::Call::Status value)
4820{
4821 switch (value) {
4823 return "Disconnected";
4825 return "Joining";
4827 return "Connecting";
4829 return "SignalingConnected";
4831 return "Connected";
4833 return "Reconnecting";
4835 return "Disconnecting";
4836 default:
4837 return "unknown";
4838 }
4839}
4840
4841inline const char* EnumToString(discordpp::ChannelType value)
4842{
4843 switch (value) {
4845 return "GuildText";
4847 return "Dm";
4849 return "GuildVoice";
4851 return "GroupDm";
4853 return "GuildCategory";
4855 return "GuildNews";
4857 return "GuildStore";
4859 return "GuildNewsThread";
4861 return "GuildPublicThread";
4863 return "GuildPrivateThread";
4865 return "GuildStageVoice";
4867 return "GuildDirectory";
4869 return "GuildForum";
4871 return "GuildMedia";
4873 return "Lobby";
4875 return "EphemeralDm";
4876 default:
4877 return "unknown";
4878 }
4879}
4880
4882{
4883 switch (value) {
4885 return "None";
4887 return "Friend";
4889 return "Blocked";
4891 return "PendingIncoming";
4893 return "PendingOutgoing";
4895 return "Implicit";
4897 return "Suggestion";
4898 default:
4899 return "unknown";
4900 }
4901}
4902
4904{
4905 switch (value) {
4907 return "Gif";
4909 return "Webp";
4911 return "Png";
4913 return "Jpeg";
4914 default:
4915 return "unknown";
4916 }
4917}
4918
4919inline const char* EnumToString(discordpp::StatusType value)
4920{
4921 switch (value) {
4923 return "Online";
4925 return "Offline";
4927 return "Blocked";
4929 return "Idle";
4931 return "Dnd";
4933 return "Invisible";
4935 return "Streaming";
4937 return "Unknown";
4938 default:
4939 return "unknown";
4940 }
4941}
4942
4944{
4945 switch (value) {
4947 return "MessageDataVisibleOnDiscord";
4948 default:
4949 return "unknown";
4950 }
4951}
4952
4954{
4955 switch (value) {
4957 return "None";
4959 return "ConnectionFailed";
4961 return "UnexpectedClose";
4963 return "ConnectionCanceled";
4964 default:
4965 return "unknown";
4966 }
4967}
4968
4970{
4971 switch (value) {
4973 return "Disconnected";
4975 return "Connecting";
4977 return "Connected";
4979 return "Ready";
4981 return "Reconnecting";
4983 return "Disconnecting";
4985 return "HttpWait";
4986 default:
4987 return "unknown";
4988 }
4989}
4990
4992{
4993 switch (value) {
4995 return "Client";
4997 return "Voice";
4999 return "Network";
5000 default:
5001 return "unknown";
5002 }
5003}
5004
5006{
5007 switch (value) {
5009 return "User";
5011 return "Bearer";
5012 default:
5013 return "unknown";
5014 }
5015}
5016
5018{
5019 switch (value) {
5021 return "OIDC";
5023 return "EpicOnlineServicesAccessToken";
5025 return "EpicOnlineServicesIdToken";
5027 return "SteamSessionTicket";
5029 return "UnityServicesIdToken";
5030 default:
5031 return "unknown";
5032 }
5033}
5034
5036{
5037 switch (value) {
5039 return "Verbose";
5041 return "Info";
5043 return "Warning";
5045 return "Error";
5047 return "None";
5048 default:
5049 return "unknown";
5050 }
5051}
5052} // namespace discordpp
5053#endif // DISCORD_HEADER_DISCORDPP_H_
5054#ifdef DISCORDPP_IMPLEMENTATION
5055#undef DISCORDPP_IMPLEMENTATION
5056#ifdef __clang__
5057#pragma clang diagnostic push
5058#pragma clang diagnostic ignored "-Wunused-parameter"
5059#endif
5060namespace discordpp {
5061std::function<void(std::function<void()>)> s_synchronizationContext;
5062
5063inline bool HasSynchronizationContext()
5064{
5065 return !!s_synchronizationContext;
5066}
5067
5068inline void PostTask(std::function<void()> task)
5069{
5070 assert(s_synchronizationContext);
5071 s_synchronizationContext(std::move(task));
5072}
5073
5074void SetSynchronizationContext(std::function<void(std::function<void()>)> executor)
5075{
5076 s_synchronizationContext = std::move(executor);
5077}
5078
5079template <typename T>
5080struct TDelegateUserData {
5081 T delegate;
5082 TDelegateUserData(T delegate)
5083 : delegate{delegate}
5084 {
5085 }
5086
5087 static void Free(void* ptr) { delete reinterpret_cast<TDelegateUserData*>(ptr); }
5088
5089 static T& Get(void* userData)
5090 {
5091 return reinterpret_cast<TDelegateUserData*>(userData)->delegate;
5092 }
5093};
5094
5095struct ConvertedProperties {
5096 ConvertedProperties(std::unordered_map<std::string, std::string> const& PropertyMap)
5097 {
5098 Properties.size = PropertyMap.size();
5099 Properties.keys = reinterpret_cast<Discord_String*>(
5100 Discord_Alloc(Properties.size * sizeof(Discord_String)));
5101 Properties.values = reinterpret_cast<Discord_String*>(
5102 Discord_Alloc(Properties.size * sizeof(Discord_String)));
5103 size_t i = 0;
5104 for (auto& pair : PropertyMap) {
5105 Properties.keys[i] = AllocateString(pair.first);
5106 Properties.values[i] = AllocateString(pair.second);
5107 ++i;
5108 }
5109 }
5110 ~ConvertedProperties() { Discord_FreeProperties(Properties); }
5111 Discord_Properties Properties{};
5112
5113private:
5114 Discord_String AllocateString(std::string const& str)
5115 {
5116 Discord_String result;
5117 result.ptr = reinterpret_cast<uint8_t*>(Discord_Alloc(str.size()));
5118 result.size = str.size();
5119 std::memcpy(result.ptr, str.data(), result.size);
5120 return result;
5121 }
5122};
5123
5124std::unordered_map<std::string, std::string> ConvertReturnedProperties(
5125 Discord_Properties const& Properties)
5126{
5127 std::unordered_map<std::string, std::string> result;
5128 for (size_t i = 0; i < Properties.size; ++i) {
5129 std::string key(reinterpret_cast<char*>(Properties.keys[i].ptr), Properties.keys[i].size);
5130 std::string value(reinterpret_cast<char*>(Properties.values[i].ptr),
5131 Properties.values[i].size);
5132 result.emplace(std::move(key), std::move(value));
5133 }
5134 return result;
5135}
5137ActivityInvite::~ActivityInvite()
5138{
5139 if (state_ == DiscordObjectState::Owned) {
5140 Drop();
5142 }
5143}
5145 : instance_(other.instance_)
5146 , state_(other.state_)
5147{
5148 other.state_ = DiscordObjectState::Invalid;
5149}
5151{
5152 if (this != &other) {
5153 if (state_ == DiscordObjectState::Owned) {
5154 Drop();
5155 }
5156 instance_ = other.instance_;
5157 state_ = other.state_;
5158 other.state_ = DiscordObjectState::Invalid;
5159 }
5160 return *this;
5161}
5163 : instance_{}
5164 , state_(DiscordObjectState::Invalid)
5165{
5166 if (rhs.state_ == DiscordObjectState::Owned) {
5167 Discord_ActivityInvite_Clone(&instance_, rhs.instance());
5168
5169 state_ = DiscordObjectState::Owned;
5170 }
5171}
5172ActivityInvite& ActivityInvite::operator=(const ActivityInvite& rhs)
5173{
5174 if (this != &rhs) {
5175 if (state_ == DiscordObjectState::Owned) {
5176 Drop();
5177 state_ = DiscordObjectState::Invalid;
5178 }
5179 if (rhs.state_ == DiscordObjectState::Owned) {
5180 Discord_ActivityInvite_Clone(&instance_, rhs.instance());
5181
5182 state_ = DiscordObjectState::Owned;
5183 }
5184 }
5185 return *this;
5186}
5187ActivityInvite::ActivityInvite(Discord_ActivityInvite instance, DiscordObjectState state)
5188 : instance_(instance)
5189 , state_(state)
5190{
5191}
5192ActivityInvite::ActivityInvite()
5193{
5194 assert(state_ == DiscordObjectState::Invalid);
5195 Discord_ActivityInvite_Init(&instance_);
5196 state_ = DiscordObjectState::Owned;
5197}
5198void ActivityInvite::Drop()
5199{
5200 if (state_ != DiscordObjectState::Owned) {
5201 return;
5202 }
5203 Discord_ActivityInvite_Drop(&instance_);
5204 state_ = DiscordObjectState::Invalid;
5205}
5206uint64_t ActivityInvite::SenderId() const
5207{
5208 assert(state_ == DiscordObjectState::Owned);
5209 uint64_t returnValue__;
5210 returnValue__ = Discord_ActivityInvite_SenderId(&instance_);
5211 return returnValue__;
5212}
5213void ActivityInvite::SetSenderId(uint64_t SenderId)
5214{
5215 assert(state_ == DiscordObjectState::Owned);
5216 Discord_ActivityInvite_SetSenderId(&instance_, SenderId);
5217}
5218uint64_t ActivityInvite::ChannelId() const
5219{
5220 assert(state_ == DiscordObjectState::Owned);
5221 uint64_t returnValue__;
5222 returnValue__ = Discord_ActivityInvite_ChannelId(&instance_);
5223 return returnValue__;
5224}
5225void ActivityInvite::SetChannelId(uint64_t ChannelId)
5226{
5227 assert(state_ == DiscordObjectState::Owned);
5228 Discord_ActivityInvite_SetChannelId(&instance_, ChannelId);
5229}
5230uint64_t ActivityInvite::MessageId() const
5231{
5232 assert(state_ == DiscordObjectState::Owned);
5233 uint64_t returnValue__;
5234 returnValue__ = Discord_ActivityInvite_MessageId(&instance_);
5235 return returnValue__;
5236}
5237void ActivityInvite::SetMessageId(uint64_t MessageId)
5238{
5239 assert(state_ == DiscordObjectState::Owned);
5240 Discord_ActivityInvite_SetMessageId(&instance_, MessageId);
5241}
5242discordpp::ActivityActionTypes ActivityInvite::Type() const
5243{
5244 assert(state_ == DiscordObjectState::Owned);
5245 Discord_ActivityActionTypes returnValue__;
5246 returnValue__ = Discord_ActivityInvite_Type(&instance_);
5247 return static_cast<discordpp::ActivityActionTypes>(returnValue__);
5248}
5249void ActivityInvite::SetType(discordpp::ActivityActionTypes Type)
5250{
5251 assert(state_ == DiscordObjectState::Owned);
5252 Discord_ActivityInvite_SetType(&instance_, static_cast<Discord_ActivityActionTypes>(Type));
5253}
5254uint64_t ActivityInvite::ApplicationId() const
5255{
5256 assert(state_ == DiscordObjectState::Owned);
5257 uint64_t returnValue__;
5258 returnValue__ = Discord_ActivityInvite_ApplicationId(&instance_);
5259 return returnValue__;
5260}
5261void ActivityInvite::SetApplicationId(uint64_t ApplicationId)
5262{
5263 assert(state_ == DiscordObjectState::Owned);
5264 Discord_ActivityInvite_SetApplicationId(&instance_, ApplicationId);
5265}
5266std::string ActivityInvite::PartyId() const
5267{
5268 assert(state_ == DiscordObjectState::Owned);
5269 Discord_String returnValueNative__;
5270 Discord_ActivityInvite_PartyId(&instance_, &returnValueNative__);
5271 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
5272 returnValueNative__.size);
5273 Discord_Free(returnValueNative__.ptr);
5274 return returnValue__;
5275}
5276void ActivityInvite::SetPartyId(std::string PartyId)
5277{
5278 assert(state_ == DiscordObjectState::Owned);
5279 Discord_String PartyId__str{(uint8_t*)(PartyId.data()), PartyId.size()};
5280 Discord_ActivityInvite_SetPartyId(&instance_, PartyId__str);
5281}
5282std::string ActivityInvite::SessionId() const
5283{
5284 assert(state_ == DiscordObjectState::Owned);
5285 Discord_String returnValueNative__;
5286 Discord_ActivityInvite_SessionId(&instance_, &returnValueNative__);
5287 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
5288 returnValueNative__.size);
5289 Discord_Free(returnValueNative__.ptr);
5290 return returnValue__;
5291}
5292void ActivityInvite::SetSessionId(std::string SessionId)
5293{
5294 assert(state_ == DiscordObjectState::Owned);
5295 Discord_String SessionId__str{(uint8_t*)(SessionId.data()), SessionId.size()};
5296 Discord_ActivityInvite_SetSessionId(&instance_, SessionId__str);
5297}
5298bool ActivityInvite::IsValid() const
5299{
5300 assert(state_ == DiscordObjectState::Owned);
5301 bool returnValue__;
5302 returnValue__ = Discord_ActivityInvite_IsValid(&instance_);
5303 return returnValue__;
5304}
5305void ActivityInvite::SetIsValid(bool IsValid)
5306{
5307 assert(state_ == DiscordObjectState::Owned);
5308 Discord_ActivityInvite_SetIsValid(&instance_, IsValid);
5309}
5310const ActivityAssets ActivityAssets::nullobj{{}, DiscordObjectState::Invalid};
5311ActivityAssets::~ActivityAssets()
5312{
5313 if (state_ == DiscordObjectState::Owned) {
5314 Drop();
5315 state_ = DiscordObjectState::Invalid;
5316 }
5317}
5318ActivityAssets::ActivityAssets(ActivityAssets&& other) noexcept
5319 : instance_(other.instance_)
5320 , state_(other.state_)
5321{
5322 other.state_ = DiscordObjectState::Invalid;
5323}
5324ActivityAssets& ActivityAssets::operator=(ActivityAssets&& other) noexcept
5325{
5326 if (this != &other) {
5327 if (state_ == DiscordObjectState::Owned) {
5328 Drop();
5329 }
5330 instance_ = other.instance_;
5331 state_ = other.state_;
5332 other.state_ = DiscordObjectState::Invalid;
5333 }
5334 return *this;
5335}
5336ActivityAssets::ActivityAssets(const ActivityAssets& arg0)
5337 : instance_{}
5338 , state_(DiscordObjectState::Invalid)
5339{
5340 if (arg0.state_ == DiscordObjectState::Owned) {
5341 Discord_ActivityAssets_Clone(&instance_, arg0.instance());
5342
5343 state_ = DiscordObjectState::Owned;
5344 }
5345}
5346ActivityAssets& ActivityAssets::operator=(const ActivityAssets& arg0)
5347{
5348 if (this != &arg0) {
5349 if (state_ == DiscordObjectState::Owned) {
5350 Drop();
5351 state_ = DiscordObjectState::Invalid;
5352 }
5353 if (arg0.state_ == DiscordObjectState::Owned) {
5354 Discord_ActivityAssets_Clone(&instance_, arg0.instance());
5355
5356 state_ = DiscordObjectState::Owned;
5357 }
5358 }
5359 return *this;
5360}
5361ActivityAssets::ActivityAssets(Discord_ActivityAssets instance, DiscordObjectState state)
5362 : instance_(instance)
5363 , state_(state)
5364{
5365}
5366ActivityAssets::ActivityAssets()
5367{
5368 assert(state_ == DiscordObjectState::Invalid);
5369 Discord_ActivityAssets_Init(&instance_);
5370 state_ = DiscordObjectState::Owned;
5371}
5372void ActivityAssets::Drop()
5373{
5374 if (state_ != DiscordObjectState::Owned) {
5375 return;
5376 }
5377 Discord_ActivityAssets_Drop(&instance_);
5378 state_ = DiscordObjectState::Invalid;
5379}
5380std::optional<std::string> ActivityAssets::LargeImage() const
5381{
5382 assert(state_ == DiscordObjectState::Owned);
5383 bool returnIsNonNull__;
5384 Discord_String returnValueNative__;
5385 returnIsNonNull__ = Discord_ActivityAssets_LargeImage(&instance_, &returnValueNative__);
5386 if (!returnIsNonNull__) {
5387 return {};
5388 }
5389 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
5390 returnValueNative__.size);
5391 Discord_Free(returnValueNative__.ptr);
5392 return returnValue__;
5393}
5394void ActivityAssets::SetLargeImage(std::optional<std::string> LargeImage)
5395{
5396 assert(state_ == DiscordObjectState::Owned);
5397 Discord_String LargeImage__str{};
5398 if (LargeImage.has_value()) {
5399 LargeImage__str.ptr = reinterpret_cast<uint8_t*>(LargeImage->data());
5400 LargeImage__str.size = LargeImage->size();
5401 }
5402 Discord_ActivityAssets_SetLargeImage(&instance_,
5403 (LargeImage.has_value() ? &LargeImage__str : nullptr));
5404}
5405std::optional<std::string> ActivityAssets::LargeText() const
5406{
5407 assert(state_ == DiscordObjectState::Owned);
5408 bool returnIsNonNull__;
5409 Discord_String returnValueNative__;
5410 returnIsNonNull__ = Discord_ActivityAssets_LargeText(&instance_, &returnValueNative__);
5411 if (!returnIsNonNull__) {
5412 return {};
5413 }
5414 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
5415 returnValueNative__.size);
5416 Discord_Free(returnValueNative__.ptr);
5417 return returnValue__;
5418}
5419void ActivityAssets::SetLargeText(std::optional<std::string> LargeText)
5420{
5421 assert(state_ == DiscordObjectState::Owned);
5422 Discord_String LargeText__str{};
5423 if (LargeText.has_value()) {
5424 LargeText__str.ptr = reinterpret_cast<uint8_t*>(LargeText->data());
5425 LargeText__str.size = LargeText->size();
5426 }
5427 Discord_ActivityAssets_SetLargeText(&instance_,
5428 (LargeText.has_value() ? &LargeText__str : nullptr));
5429}
5430std::optional<std::string> ActivityAssets::SmallImage() const
5431{
5432 assert(state_ == DiscordObjectState::Owned);
5433 bool returnIsNonNull__;
5434 Discord_String returnValueNative__;
5435 returnIsNonNull__ = Discord_ActivityAssets_SmallImage(&instance_, &returnValueNative__);
5436 if (!returnIsNonNull__) {
5437 return {};
5438 }
5439 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
5440 returnValueNative__.size);
5441 Discord_Free(returnValueNative__.ptr);
5442 return returnValue__;
5443}
5444void ActivityAssets::SetSmallImage(std::optional<std::string> SmallImage)
5445{
5446 assert(state_ == DiscordObjectState::Owned);
5447 Discord_String SmallImage__str{};
5448 if (SmallImage.has_value()) {
5449 SmallImage__str.ptr = reinterpret_cast<uint8_t*>(SmallImage->data());
5450 SmallImage__str.size = SmallImage->size();
5451 }
5452 Discord_ActivityAssets_SetSmallImage(&instance_,
5453 (SmallImage.has_value() ? &SmallImage__str : nullptr));
5454}
5455std::optional<std::string> ActivityAssets::SmallText() const
5456{
5457 assert(state_ == DiscordObjectState::Owned);
5458 bool returnIsNonNull__;
5459 Discord_String returnValueNative__;
5460 returnIsNonNull__ = Discord_ActivityAssets_SmallText(&instance_, &returnValueNative__);
5461 if (!returnIsNonNull__) {
5462 return {};
5463 }
5464 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
5465 returnValueNative__.size);
5466 Discord_Free(returnValueNative__.ptr);
5467 return returnValue__;
5468}
5469void ActivityAssets::SetSmallText(std::optional<std::string> SmallText)
5470{
5471 assert(state_ == DiscordObjectState::Owned);
5472 Discord_String SmallText__str{};
5473 if (SmallText.has_value()) {
5474 SmallText__str.ptr = reinterpret_cast<uint8_t*>(SmallText->data());
5475 SmallText__str.size = SmallText->size();
5476 }
5477 Discord_ActivityAssets_SetSmallText(&instance_,
5478 (SmallText.has_value() ? &SmallText__str : nullptr));
5479}
5480const ActivityTimestamps ActivityTimestamps::nullobj{{}, DiscordObjectState::Invalid};
5481ActivityTimestamps::~ActivityTimestamps()
5482{
5483 if (state_ == DiscordObjectState::Owned) {
5484 Drop();
5485 state_ = DiscordObjectState::Invalid;
5486 }
5487}
5488ActivityTimestamps::ActivityTimestamps(ActivityTimestamps&& other) noexcept
5489 : instance_(other.instance_)
5490 , state_(other.state_)
5491{
5492 other.state_ = DiscordObjectState::Invalid;
5493}
5494ActivityTimestamps& ActivityTimestamps::operator=(ActivityTimestamps&& other) noexcept
5495{
5496 if (this != &other) {
5497 if (state_ == DiscordObjectState::Owned) {
5498 Drop();
5499 }
5500 instance_ = other.instance_;
5501 state_ = other.state_;
5502 other.state_ = DiscordObjectState::Invalid;
5503 }
5504 return *this;
5505}
5506ActivityTimestamps::ActivityTimestamps(const ActivityTimestamps& arg0)
5507 : instance_{}
5508 , state_(DiscordObjectState::Invalid)
5509{
5510 if (arg0.state_ == DiscordObjectState::Owned) {
5511 Discord_ActivityTimestamps_Clone(&instance_, arg0.instance());
5512
5513 state_ = DiscordObjectState::Owned;
5514 }
5515}
5516ActivityTimestamps& ActivityTimestamps::operator=(const ActivityTimestamps& arg0)
5517{
5518 if (this != &arg0) {
5519 if (state_ == DiscordObjectState::Owned) {
5520 Drop();
5521 state_ = DiscordObjectState::Invalid;
5522 }
5523 if (arg0.state_ == DiscordObjectState::Owned) {
5524 Discord_ActivityTimestamps_Clone(&instance_, arg0.instance());
5525
5526 state_ = DiscordObjectState::Owned;
5527 }
5528 }
5529 return *this;
5530}
5531ActivityTimestamps::ActivityTimestamps(Discord_ActivityTimestamps instance,
5532 DiscordObjectState state)
5533 : instance_(instance)
5534 , state_(state)
5535{
5536}
5537ActivityTimestamps::ActivityTimestamps()
5538{
5539 assert(state_ == DiscordObjectState::Invalid);
5540 Discord_ActivityTimestamps_Init(&instance_);
5541 state_ = DiscordObjectState::Owned;
5542}
5543void ActivityTimestamps::Drop()
5544{
5545 if (state_ != DiscordObjectState::Owned) {
5546 return;
5547 }
5548 Discord_ActivityTimestamps_Drop(&instance_);
5549 state_ = DiscordObjectState::Invalid;
5550}
5551uint64_t ActivityTimestamps::Start() const
5552{
5553 assert(state_ == DiscordObjectState::Owned);
5554 uint64_t returnValue__;
5555 returnValue__ = Discord_ActivityTimestamps_Start(&instance_);
5556 return returnValue__;
5557}
5558void ActivityTimestamps::SetStart(uint64_t Start)
5559{
5560 assert(state_ == DiscordObjectState::Owned);
5561 Discord_ActivityTimestamps_SetStart(&instance_, Start);
5562}
5563uint64_t ActivityTimestamps::End() const
5564{
5565 assert(state_ == DiscordObjectState::Owned);
5566 uint64_t returnValue__;
5567 returnValue__ = Discord_ActivityTimestamps_End(&instance_);
5568 return returnValue__;
5569}
5570void ActivityTimestamps::SetEnd(uint64_t End)
5571{
5572 assert(state_ == DiscordObjectState::Owned);
5573 Discord_ActivityTimestamps_SetEnd(&instance_, End);
5574}
5575const ActivityParty ActivityParty::nullobj{{}, DiscordObjectState::Invalid};
5576ActivityParty::~ActivityParty()
5577{
5578 if (state_ == DiscordObjectState::Owned) {
5579 Drop();
5580 state_ = DiscordObjectState::Invalid;
5581 }
5582}
5583ActivityParty::ActivityParty(ActivityParty&& other) noexcept
5584 : instance_(other.instance_)
5585 , state_(other.state_)
5586{
5587 other.state_ = DiscordObjectState::Invalid;
5588}
5589ActivityParty& ActivityParty::operator=(ActivityParty&& other) noexcept
5590{
5591 if (this != &other) {
5592 if (state_ == DiscordObjectState::Owned) {
5593 Drop();
5594 }
5595 instance_ = other.instance_;
5596 state_ = other.state_;
5597 other.state_ = DiscordObjectState::Invalid;
5598 }
5599 return *this;
5600}
5601ActivityParty::ActivityParty(const ActivityParty& arg0)
5602 : instance_{}
5603 , state_(DiscordObjectState::Invalid)
5604{
5605 if (arg0.state_ == DiscordObjectState::Owned) {
5606 Discord_ActivityParty_Clone(&instance_, arg0.instance());
5607
5608 state_ = DiscordObjectState::Owned;
5609 }
5610}
5611ActivityParty& ActivityParty::operator=(const ActivityParty& arg0)
5612{
5613 if (this != &arg0) {
5614 if (state_ == DiscordObjectState::Owned) {
5615 Drop();
5616 state_ = DiscordObjectState::Invalid;
5617 }
5618 if (arg0.state_ == DiscordObjectState::Owned) {
5619 Discord_ActivityParty_Clone(&instance_, arg0.instance());
5620
5621 state_ = DiscordObjectState::Owned;
5622 }
5623 }
5624 return *this;
5625}
5626ActivityParty::ActivityParty(Discord_ActivityParty instance, DiscordObjectState state)
5627 : instance_(instance)
5628 , state_(state)
5629{
5630}
5631ActivityParty::ActivityParty()
5632{
5633 assert(state_ == DiscordObjectState::Invalid);
5634 Discord_ActivityParty_Init(&instance_);
5635 state_ = DiscordObjectState::Owned;
5636}
5637void ActivityParty::Drop()
5638{
5639 if (state_ != DiscordObjectState::Owned) {
5640 return;
5641 }
5642 Discord_ActivityParty_Drop(&instance_);
5643 state_ = DiscordObjectState::Invalid;
5644}
5645std::string ActivityParty::Id() const
5646{
5647 assert(state_ == DiscordObjectState::Owned);
5648 Discord_String returnValueNative__;
5649 Discord_ActivityParty_Id(&instance_, &returnValueNative__);
5650 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
5651 returnValueNative__.size);
5652 Discord_Free(returnValueNative__.ptr);
5653 return returnValue__;
5654}
5655void ActivityParty::SetId(std::string Id)
5656{
5657 assert(state_ == DiscordObjectState::Owned);
5658 Discord_String Id__str{(uint8_t*)(Id.data()), Id.size()};
5659 Discord_ActivityParty_SetId(&instance_, Id__str);
5660}
5661int32_t ActivityParty::CurrentSize() const
5662{
5663 assert(state_ == DiscordObjectState::Owned);
5664 int32_t returnValue__;
5665 returnValue__ = Discord_ActivityParty_CurrentSize(&instance_);
5666 return returnValue__;
5667}
5668void ActivityParty::SetCurrentSize(int32_t CurrentSize)
5669{
5670 assert(state_ == DiscordObjectState::Owned);
5671 Discord_ActivityParty_SetCurrentSize(&instance_, CurrentSize);
5672}
5673int32_t ActivityParty::MaxSize() const
5674{
5675 assert(state_ == DiscordObjectState::Owned);
5676 int32_t returnValue__;
5677 returnValue__ = Discord_ActivityParty_MaxSize(&instance_);
5678 return returnValue__;
5679}
5680void ActivityParty::SetMaxSize(int32_t MaxSize)
5681{
5682 assert(state_ == DiscordObjectState::Owned);
5683 Discord_ActivityParty_SetMaxSize(&instance_, MaxSize);
5684}
5685discordpp::ActivityPartyPrivacy ActivityParty::Privacy() const
5686{
5687 assert(state_ == DiscordObjectState::Owned);
5688 Discord_ActivityPartyPrivacy returnValue__;
5689 returnValue__ = Discord_ActivityParty_Privacy(&instance_);
5690 return static_cast<discordpp::ActivityPartyPrivacy>(returnValue__);
5691}
5692void ActivityParty::SetPrivacy(discordpp::ActivityPartyPrivacy Privacy)
5693{
5694 assert(state_ == DiscordObjectState::Owned);
5695 Discord_ActivityParty_SetPrivacy(&instance_,
5696 static_cast<Discord_ActivityPartyPrivacy>(Privacy));
5697}
5698const ActivitySecrets ActivitySecrets::nullobj{{}, DiscordObjectState::Invalid};
5699ActivitySecrets::~ActivitySecrets()
5700{
5701 if (state_ == DiscordObjectState::Owned) {
5702 Drop();
5703 state_ = DiscordObjectState::Invalid;
5704 }
5705}
5706ActivitySecrets::ActivitySecrets(ActivitySecrets&& other) noexcept
5707 : instance_(other.instance_)
5708 , state_(other.state_)
5709{
5710 other.state_ = DiscordObjectState::Invalid;
5711}
5712ActivitySecrets& ActivitySecrets::operator=(ActivitySecrets&& other) noexcept
5713{
5714 if (this != &other) {
5715 if (state_ == DiscordObjectState::Owned) {
5716 Drop();
5717 }
5718 instance_ = other.instance_;
5719 state_ = other.state_;
5720 other.state_ = DiscordObjectState::Invalid;
5721 }
5722 return *this;
5723}
5724ActivitySecrets::ActivitySecrets(const ActivitySecrets& arg0)
5725 : instance_{}
5726 , state_(DiscordObjectState::Invalid)
5727{
5728 if (arg0.state_ == DiscordObjectState::Owned) {
5729 Discord_ActivitySecrets_Clone(&instance_, arg0.instance());
5730
5731 state_ = DiscordObjectState::Owned;
5732 }
5733}
5734ActivitySecrets& ActivitySecrets::operator=(const ActivitySecrets& arg0)
5735{
5736 if (this != &arg0) {
5737 if (state_ == DiscordObjectState::Owned) {
5738 Drop();
5739 state_ = DiscordObjectState::Invalid;
5740 }
5741 if (arg0.state_ == DiscordObjectState::Owned) {
5742 Discord_ActivitySecrets_Clone(&instance_, arg0.instance());
5743
5744 state_ = DiscordObjectState::Owned;
5745 }
5746 }
5747 return *this;
5748}
5749ActivitySecrets::ActivitySecrets(Discord_ActivitySecrets instance, DiscordObjectState state)
5750 : instance_(instance)
5751 , state_(state)
5752{
5753}
5754ActivitySecrets::ActivitySecrets()
5755{
5756 assert(state_ == DiscordObjectState::Invalid);
5757 Discord_ActivitySecrets_Init(&instance_);
5758 state_ = DiscordObjectState::Owned;
5759}
5760void ActivitySecrets::Drop()
5761{
5762 if (state_ != DiscordObjectState::Owned) {
5763 return;
5764 }
5765 Discord_ActivitySecrets_Drop(&instance_);
5766 state_ = DiscordObjectState::Invalid;
5767}
5768std::string ActivitySecrets::Join() const
5769{
5770 assert(state_ == DiscordObjectState::Owned);
5771 Discord_String returnValueNative__;
5772 Discord_ActivitySecrets_Join(&instance_, &returnValueNative__);
5773 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
5774 returnValueNative__.size);
5775 Discord_Free(returnValueNative__.ptr);
5776 return returnValue__;
5777}
5778void ActivitySecrets::SetJoin(std::string Join)
5779{
5780 assert(state_ == DiscordObjectState::Owned);
5781 Discord_String Join__str{(uint8_t*)(Join.data()), Join.size()};
5782 Discord_ActivitySecrets_SetJoin(&instance_, Join__str);
5783}
5784const Activity Activity::nullobj{{}, DiscordObjectState::Invalid};
5785Activity::~Activity()
5786{
5787 if (state_ == DiscordObjectState::Owned) {
5788 Drop();
5789 state_ = DiscordObjectState::Invalid;
5790 }
5791}
5792Activity::Activity(Activity&& other) noexcept
5793 : instance_(other.instance_)
5794 , state_(other.state_)
5795{
5796 other.state_ = DiscordObjectState::Invalid;
5797}
5798Activity& Activity::operator=(Activity&& other) noexcept
5799{
5800 if (this != &other) {
5801 if (state_ == DiscordObjectState::Owned) {
5802 Drop();
5803 }
5804 instance_ = other.instance_;
5805 state_ = other.state_;
5806 other.state_ = DiscordObjectState::Invalid;
5807 }
5808 return *this;
5809}
5810Activity::Activity(const Activity& arg0)
5811 : instance_{}
5812 , state_(DiscordObjectState::Invalid)
5813{
5814 if (arg0.state_ == DiscordObjectState::Owned) {
5815 Discord_Activity_Clone(&instance_, arg0.instance());
5816
5817 state_ = DiscordObjectState::Owned;
5818 }
5819}
5820Activity& Activity::operator=(const Activity& arg0)
5821{
5822 if (this != &arg0) {
5823 if (state_ == DiscordObjectState::Owned) {
5824 Drop();
5825 state_ = DiscordObjectState::Invalid;
5826 }
5827 if (arg0.state_ == DiscordObjectState::Owned) {
5828 Discord_Activity_Clone(&instance_, arg0.instance());
5829
5830 state_ = DiscordObjectState::Owned;
5831 }
5832 }
5833 return *this;
5834}
5835Activity::Activity(Discord_Activity instance, DiscordObjectState state)
5836 : instance_(instance)
5837 , state_(state)
5838{
5839}
5840Activity::Activity()
5841{
5842 assert(state_ == DiscordObjectState::Invalid);
5843 Discord_Activity_Init(&instance_);
5844 state_ = DiscordObjectState::Owned;
5845}
5846void Activity::Drop()
5847{
5848 if (state_ != DiscordObjectState::Owned) {
5849 return;
5850 }
5851 Discord_Activity_Drop(&instance_);
5852 state_ = DiscordObjectState::Invalid;
5853}
5854bool Activity::Equals(discordpp::Activity other) const
5855{
5856 assert(state_ == DiscordObjectState::Owned);
5857 bool returnValue__;
5858 returnValue__ = Discord_Activity_Equals(&instance_, other.instance());
5859 return returnValue__;
5860}
5861std::string Activity::Name() const
5862{
5863 assert(state_ == DiscordObjectState::Owned);
5864 Discord_String returnValueNative__;
5865 Discord_Activity_Name(&instance_, &returnValueNative__);
5866 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
5867 returnValueNative__.size);
5868 Discord_Free(returnValueNative__.ptr);
5869 return returnValue__;
5870}
5871void Activity::SetName(std::string Name)
5872{
5873 assert(state_ == DiscordObjectState::Owned);
5874 Discord_String Name__str{(uint8_t*)(Name.data()), Name.size()};
5875 Discord_Activity_SetName(&instance_, Name__str);
5876}
5877discordpp::ActivityTypes Activity::Type() const
5878{
5879 assert(state_ == DiscordObjectState::Owned);
5880 Discord_ActivityTypes returnValue__;
5881 returnValue__ = Discord_Activity_Type(&instance_);
5882 return static_cast<discordpp::ActivityTypes>(returnValue__);
5883}
5884void Activity::SetType(discordpp::ActivityTypes Type)
5885{
5886 assert(state_ == DiscordObjectState::Owned);
5887 Discord_Activity_SetType(&instance_, static_cast<Discord_ActivityTypes>(Type));
5888}
5889std::optional<std::string> Activity::State() const
5890{
5891 assert(state_ == DiscordObjectState::Owned);
5892 bool returnIsNonNull__;
5893 Discord_String returnValueNative__;
5894 returnIsNonNull__ = Discord_Activity_State(&instance_, &returnValueNative__);
5895 if (!returnIsNonNull__) {
5896 return {};
5897 }
5898 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
5899 returnValueNative__.size);
5900 Discord_Free(returnValueNative__.ptr);
5901 return returnValue__;
5902}
5903void Activity::SetState(std::optional<std::string> State)
5904{
5905 assert(state_ == DiscordObjectState::Owned);
5906 Discord_String State__str{};
5907 if (State.has_value()) {
5908 State__str.ptr = reinterpret_cast<uint8_t*>(State->data());
5909 State__str.size = State->size();
5910 }
5911 Discord_Activity_SetState(&instance_, (State.has_value() ? &State__str : nullptr));
5912}
5913std::optional<std::string> Activity::Details() const
5914{
5915 assert(state_ == DiscordObjectState::Owned);
5916 bool returnIsNonNull__;
5917 Discord_String returnValueNative__;
5918 returnIsNonNull__ = Discord_Activity_Details(&instance_, &returnValueNative__);
5919 if (!returnIsNonNull__) {
5920 return {};
5921 }
5922 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
5923 returnValueNative__.size);
5924 Discord_Free(returnValueNative__.ptr);
5925 return returnValue__;
5926}
5927void Activity::SetDetails(std::optional<std::string> Details)
5928{
5929 assert(state_ == DiscordObjectState::Owned);
5930 Discord_String Details__str{};
5931 if (Details.has_value()) {
5932 Details__str.ptr = reinterpret_cast<uint8_t*>(Details->data());
5933 Details__str.size = Details->size();
5934 }
5935 Discord_Activity_SetDetails(&instance_, (Details.has_value() ? &Details__str : nullptr));
5936}
5937std::optional<uint64_t> Activity::ApplicationId() const
5938{
5939 assert(state_ == DiscordObjectState::Owned);
5940 bool returnIsNonNull__;
5941 uint64_t returnValue__;
5942 returnIsNonNull__ = Discord_Activity_ApplicationId(&instance_, &returnValue__);
5943 if (!returnIsNonNull__) {
5944 return std::nullopt;
5945 }
5946 return returnValue__;
5947}
5948void Activity::SetApplicationId(std::optional<uint64_t> ApplicationId)
5949{
5950 assert(state_ == DiscordObjectState::Owned);
5951 Discord_Activity_SetApplicationId(&instance_,
5952 (ApplicationId.has_value() ? &*ApplicationId : nullptr));
5953}
5954std::optional<discordpp::ActivityAssets> Activity::Assets() const
5955{
5956 assert(state_ == DiscordObjectState::Owned);
5957 bool returnIsNonNull__;
5958 Discord_ActivityAssets returnValueNative__;
5959 returnIsNonNull__ = Discord_Activity_Assets(&instance_, &returnValueNative__);
5960 if (!returnIsNonNull__) {
5961 return {};
5962 }
5963 discordpp::ActivityAssets returnValue__(returnValueNative__, DiscordObjectState::Owned);
5964 return returnValue__;
5965}
5966void Activity::SetAssets(std::optional<discordpp::ActivityAssets> Assets)
5967{
5968 assert(state_ == DiscordObjectState::Owned);
5969 Discord_Activity_SetAssets(&instance_, (Assets.has_value() ? Assets->instance() : nullptr));
5970}
5971std::optional<discordpp::ActivityTimestamps> Activity::Timestamps() const
5972{
5973 assert(state_ == DiscordObjectState::Owned);
5974 bool returnIsNonNull__;
5975 Discord_ActivityTimestamps returnValueNative__;
5976 returnIsNonNull__ = Discord_Activity_Timestamps(&instance_, &returnValueNative__);
5977 if (!returnIsNonNull__) {
5978 return {};
5979 }
5980 discordpp::ActivityTimestamps returnValue__(returnValueNative__, DiscordObjectState::Owned);
5981 return returnValue__;
5982}
5983void Activity::SetTimestamps(std::optional<discordpp::ActivityTimestamps> Timestamps)
5984{
5985 assert(state_ == DiscordObjectState::Owned);
5986 Discord_Activity_SetTimestamps(&instance_,
5987 (Timestamps.has_value() ? Timestamps->instance() : nullptr));
5988}
5989std::optional<discordpp::ActivityParty> Activity::Party() const
5990{
5991 assert(state_ == DiscordObjectState::Owned);
5992 bool returnIsNonNull__;
5993 Discord_ActivityParty returnValueNative__;
5994 returnIsNonNull__ = Discord_Activity_Party(&instance_, &returnValueNative__);
5995 if (!returnIsNonNull__) {
5996 return {};
5997 }
5998 discordpp::ActivityParty returnValue__(returnValueNative__, DiscordObjectState::Owned);
5999 return returnValue__;
6000}
6001void Activity::SetParty(std::optional<discordpp::ActivityParty> Party)
6002{
6003 assert(state_ == DiscordObjectState::Owned);
6004 Discord_Activity_SetParty(&instance_, (Party.has_value() ? Party->instance() : nullptr));
6005}
6006std::optional<discordpp::ActivitySecrets> Activity::Secrets() const
6007{
6008 assert(state_ == DiscordObjectState::Owned);
6009 bool returnIsNonNull__;
6010 Discord_ActivitySecrets returnValueNative__;
6011 returnIsNonNull__ = Discord_Activity_Secrets(&instance_, &returnValueNative__);
6012 if (!returnIsNonNull__) {
6013 return {};
6014 }
6015 discordpp::ActivitySecrets returnValue__(returnValueNative__, DiscordObjectState::Owned);
6016 return returnValue__;
6017}
6018void Activity::SetSecrets(std::optional<discordpp::ActivitySecrets> Secrets)
6019{
6020 assert(state_ == DiscordObjectState::Owned);
6021 Discord_Activity_SetSecrets(&instance_, (Secrets.has_value() ? Secrets->instance() : nullptr));
6022}
6023discordpp::ActivityGamePlatforms Activity::SupportedPlatforms() const
6024{
6025 assert(state_ == DiscordObjectState::Owned);
6026 Discord_ActivityGamePlatforms returnValue__;
6027 returnValue__ = Discord_Activity_SupportedPlatforms(&instance_);
6028 return static_cast<discordpp::ActivityGamePlatforms>(returnValue__);
6029}
6030void Activity::SetSupportedPlatforms(discordpp::ActivityGamePlatforms SupportedPlatforms)
6031{
6032 assert(state_ == DiscordObjectState::Owned);
6033 Discord_Activity_SetSupportedPlatforms(
6034 &instance_, static_cast<Discord_ActivityGamePlatforms>(SupportedPlatforms));
6035}
6036const ClientResult ClientResult::nullobj{{}, DiscordObjectState::Invalid};
6037ClientResult::~ClientResult()
6038{
6039 if (state_ == DiscordObjectState::Owned) {
6040 Drop();
6041 state_ = DiscordObjectState::Invalid;
6042 }
6043}
6044ClientResult::ClientResult(ClientResult&& other) noexcept
6045 : instance_(other.instance_)
6046 , state_(other.state_)
6047{
6048 other.state_ = DiscordObjectState::Invalid;
6049}
6050ClientResult& ClientResult::operator=(ClientResult&& other) noexcept
6051{
6052 if (this != &other) {
6053 if (state_ == DiscordObjectState::Owned) {
6054 Drop();
6055 }
6056 instance_ = other.instance_;
6057 state_ = other.state_;
6058 other.state_ = DiscordObjectState::Invalid;
6059 }
6060 return *this;
6061}
6062ClientResult::ClientResult(const ClientResult& arg0)
6063 : instance_{}
6064 , state_(DiscordObjectState::Invalid)
6065{
6066 if (arg0.state_ == DiscordObjectState::Owned) {
6067 Discord_ClientResult_Clone(&instance_, arg0.instance());
6068
6069 state_ = DiscordObjectState::Owned;
6070 }
6071}
6072ClientResult& ClientResult::operator=(const ClientResult& arg0)
6073{
6074 if (this != &arg0) {
6075 if (state_ == DiscordObjectState::Owned) {
6076 Drop();
6077 state_ = DiscordObjectState::Invalid;
6078 }
6079 if (arg0.state_ == DiscordObjectState::Owned) {
6080 Discord_ClientResult_Clone(&instance_, arg0.instance());
6081
6082 state_ = DiscordObjectState::Owned;
6083 }
6084 }
6085 return *this;
6086}
6087ClientResult::ClientResult(Discord_ClientResult instance, DiscordObjectState state)
6088 : instance_(instance)
6089 , state_(state)
6090{
6091}
6092void ClientResult::Drop()
6093{
6094 if (state_ != DiscordObjectState::Owned) {
6095 return;
6096 }
6097 Discord_ClientResult_Drop(&instance_);
6098 state_ = DiscordObjectState::Invalid;
6099}
6100std::string ClientResult::ToString() const
6101{
6102 assert(state_ == DiscordObjectState::Owned);
6103 Discord_String returnValueNative__;
6104 Discord_ClientResult_ToString(&instance_, &returnValueNative__);
6105 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
6106 returnValueNative__.size);
6107 Discord_Free(returnValueNative__.ptr);
6108 return returnValue__;
6109}
6110discordpp::ErrorType ClientResult::Type() const
6111{
6112 assert(state_ == DiscordObjectState::Owned);
6113 Discord_ErrorType returnValue__;
6114 returnValue__ = Discord_ClientResult_Type(&instance_);
6115 return static_cast<discordpp::ErrorType>(returnValue__);
6116}
6117void ClientResult::SetType(discordpp::ErrorType Type)
6118{
6119 assert(state_ == DiscordObjectState::Owned);
6120 Discord_ClientResult_SetType(&instance_, static_cast<Discord_ErrorType>(Type));
6121}
6122std::string ClientResult::Error() const
6123{
6124 assert(state_ == DiscordObjectState::Owned);
6125 Discord_String returnValueNative__;
6126 Discord_ClientResult_Error(&instance_, &returnValueNative__);
6127 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
6128 returnValueNative__.size);
6129 Discord_Free(returnValueNative__.ptr);
6130 return returnValue__;
6131}
6132void ClientResult::SetError(std::string Error)
6133{
6134 assert(state_ == DiscordObjectState::Owned);
6135 Discord_String Error__str{(uint8_t*)(Error.data()), Error.size()};
6136 Discord_ClientResult_SetError(&instance_, Error__str);
6137}
6138int32_t ClientResult::ErrorCode() const
6139{
6140 assert(state_ == DiscordObjectState::Owned);
6141 int32_t returnValue__;
6142 returnValue__ = Discord_ClientResult_ErrorCode(&instance_);
6143 return returnValue__;
6144}
6145void ClientResult::SetErrorCode(int32_t ErrorCode)
6146{
6147 assert(state_ == DiscordObjectState::Owned);
6148 Discord_ClientResult_SetErrorCode(&instance_, ErrorCode);
6149}
6150discordpp::HttpStatusCode ClientResult::Status() const
6151{
6152 assert(state_ == DiscordObjectState::Owned);
6153 Discord_HttpStatusCode returnValue__;
6154 returnValue__ = Discord_ClientResult_Status(&instance_);
6155 return static_cast<discordpp::HttpStatusCode>(returnValue__);
6156}
6157void ClientResult::SetStatus(discordpp::HttpStatusCode Status)
6158{
6159 assert(state_ == DiscordObjectState::Owned);
6160 Discord_ClientResult_SetStatus(&instance_, static_cast<Discord_HttpStatusCode>(Status));
6161}
6162std::string ClientResult::ResponseBody() const
6163{
6164 assert(state_ == DiscordObjectState::Owned);
6165 Discord_String returnValueNative__;
6166 Discord_ClientResult_ResponseBody(&instance_, &returnValueNative__);
6167 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
6168 returnValueNative__.size);
6169 Discord_Free(returnValueNative__.ptr);
6170 return returnValue__;
6171}
6172void ClientResult::SetResponseBody(std::string ResponseBody)
6173{
6174 assert(state_ == DiscordObjectState::Owned);
6175 Discord_String ResponseBody__str{(uint8_t*)(ResponseBody.data()), ResponseBody.size()};
6176 Discord_ClientResult_SetResponseBody(&instance_, ResponseBody__str);
6177}
6178bool ClientResult::Successful() const
6179{
6180 assert(state_ == DiscordObjectState::Owned);
6181 bool returnValue__;
6182 returnValue__ = Discord_ClientResult_Successful(&instance_);
6183 return returnValue__;
6184}
6185void ClientResult::SetSuccessful(bool Successful)
6186{
6187 assert(state_ == DiscordObjectState::Owned);
6188 Discord_ClientResult_SetSuccessful(&instance_, Successful);
6189}
6190bool ClientResult::Retryable() const
6191{
6192 assert(state_ == DiscordObjectState::Owned);
6193 bool returnValue__;
6194 returnValue__ = Discord_ClientResult_Retryable(&instance_);
6195 return returnValue__;
6196}
6197void ClientResult::SetRetryable(bool Retryable)
6198{
6199 assert(state_ == DiscordObjectState::Owned);
6200 Discord_ClientResult_SetRetryable(&instance_, Retryable);
6201}
6202float ClientResult::RetryAfter() const
6203{
6204 assert(state_ == DiscordObjectState::Owned);
6205 float returnValue__;
6206 returnValue__ = Discord_ClientResult_RetryAfter(&instance_);
6207 return returnValue__;
6208}
6209void ClientResult::SetRetryAfter(float RetryAfter)
6210{
6211 assert(state_ == DiscordObjectState::Owned);
6212 Discord_ClientResult_SetRetryAfter(&instance_, RetryAfter);
6213}
6214const AuthorizationCodeChallenge AuthorizationCodeChallenge::nullobj{{},
6215 DiscordObjectState::Invalid};
6216AuthorizationCodeChallenge::~AuthorizationCodeChallenge()
6217{
6218 if (state_ == DiscordObjectState::Owned) {
6219 Drop();
6220 state_ = DiscordObjectState::Invalid;
6221 }
6222}
6223AuthorizationCodeChallenge::AuthorizationCodeChallenge(AuthorizationCodeChallenge&& other) noexcept
6224 : instance_(other.instance_)
6225 , state_(other.state_)
6226{
6227 other.state_ = DiscordObjectState::Invalid;
6228}
6229AuthorizationCodeChallenge& AuthorizationCodeChallenge::operator=(
6230 AuthorizationCodeChallenge&& other) noexcept
6231{
6232 if (this != &other) {
6233 if (state_ == DiscordObjectState::Owned) {
6234 Drop();
6235 }
6236 instance_ = other.instance_;
6237 state_ = other.state_;
6238 other.state_ = DiscordObjectState::Invalid;
6239 }
6240 return *this;
6241}
6242AuthorizationCodeChallenge::AuthorizationCodeChallenge(const AuthorizationCodeChallenge& arg0)
6243 : instance_{}
6244 , state_(DiscordObjectState::Invalid)
6245{
6246 if (arg0.state_ == DiscordObjectState::Owned) {
6247 Discord_AuthorizationCodeChallenge_Clone(&instance_, arg0.instance());
6248
6249 state_ = DiscordObjectState::Owned;
6250 }
6251}
6252AuthorizationCodeChallenge& AuthorizationCodeChallenge::operator=(
6253 const AuthorizationCodeChallenge& arg0)
6254{
6255 if (this != &arg0) {
6256 if (state_ == DiscordObjectState::Owned) {
6257 Drop();
6258 state_ = DiscordObjectState::Invalid;
6259 }
6260 if (arg0.state_ == DiscordObjectState::Owned) {
6261 Discord_AuthorizationCodeChallenge_Clone(&instance_, arg0.instance());
6262
6263 state_ = DiscordObjectState::Owned;
6264 }
6265 }
6266 return *this;
6267}
6268AuthorizationCodeChallenge::AuthorizationCodeChallenge(Discord_AuthorizationCodeChallenge instance,
6269 DiscordObjectState state)
6270 : instance_(instance)
6271 , state_(state)
6272{
6273}
6274AuthorizationCodeChallenge::AuthorizationCodeChallenge()
6275{
6276 assert(state_ == DiscordObjectState::Invalid);
6277 Discord_AuthorizationCodeChallenge_Init(&instance_);
6278 state_ = DiscordObjectState::Owned;
6279}
6280void AuthorizationCodeChallenge::Drop()
6281{
6282 if (state_ != DiscordObjectState::Owned) {
6283 return;
6284 }
6285 Discord_AuthorizationCodeChallenge_Drop(&instance_);
6286 state_ = DiscordObjectState::Invalid;
6287}
6288discordpp::AuthenticationCodeChallengeMethod AuthorizationCodeChallenge::Method() const
6289{
6290 assert(state_ == DiscordObjectState::Owned);
6291 Discord_AuthenticationCodeChallengeMethod returnValue__;
6292 returnValue__ = Discord_AuthorizationCodeChallenge_Method(&instance_);
6293 return static_cast<discordpp::AuthenticationCodeChallengeMethod>(returnValue__);
6294}
6295void AuthorizationCodeChallenge::SetMethod(discordpp::AuthenticationCodeChallengeMethod Method)
6296{
6297 assert(state_ == DiscordObjectState::Owned);
6298 Discord_AuthorizationCodeChallenge_SetMethod(
6299 &instance_, static_cast<Discord_AuthenticationCodeChallengeMethod>(Method));
6300}
6301std::string AuthorizationCodeChallenge::Challenge() const
6302{
6303 assert(state_ == DiscordObjectState::Owned);
6304 Discord_String returnValueNative__;
6305 Discord_AuthorizationCodeChallenge_Challenge(&instance_, &returnValueNative__);
6306 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
6307 returnValueNative__.size);
6308 Discord_Free(returnValueNative__.ptr);
6309 return returnValue__;
6310}
6311void AuthorizationCodeChallenge::SetChallenge(std::string Challenge)
6312{
6313 assert(state_ == DiscordObjectState::Owned);
6314 Discord_String Challenge__str{(uint8_t*)(Challenge.data()), Challenge.size()};
6315 Discord_AuthorizationCodeChallenge_SetChallenge(&instance_, Challenge__str);
6316}
6317const AuthorizationCodeVerifier AuthorizationCodeVerifier::nullobj{{}, DiscordObjectState::Invalid};
6318AuthorizationCodeVerifier::~AuthorizationCodeVerifier()
6319{
6320 if (state_ == DiscordObjectState::Owned) {
6321 Drop();
6322 state_ = DiscordObjectState::Invalid;
6323 }
6324}
6325AuthorizationCodeVerifier::AuthorizationCodeVerifier(AuthorizationCodeVerifier&& other) noexcept
6326 : instance_(other.instance_)
6327 , state_(other.state_)
6328{
6329 other.state_ = DiscordObjectState::Invalid;
6330}
6331AuthorizationCodeVerifier& AuthorizationCodeVerifier::operator=(
6332 AuthorizationCodeVerifier&& other) noexcept
6333{
6334 if (this != &other) {
6335 if (state_ == DiscordObjectState::Owned) {
6336 Drop();
6337 }
6338 instance_ = other.instance_;
6339 state_ = other.state_;
6340 other.state_ = DiscordObjectState::Invalid;
6341 }
6342 return *this;
6343}
6344AuthorizationCodeVerifier::AuthorizationCodeVerifier(const AuthorizationCodeVerifier& arg0)
6345 : instance_{}
6346 , state_(DiscordObjectState::Invalid)
6347{
6348 if (arg0.state_ == DiscordObjectState::Owned) {
6349 Discord_AuthorizationCodeVerifier_Clone(&instance_, arg0.instance());
6350
6351 state_ = DiscordObjectState::Owned;
6352 }
6353}
6354AuthorizationCodeVerifier& AuthorizationCodeVerifier::operator=(
6355 const AuthorizationCodeVerifier& arg0)
6356{
6357 if (this != &arg0) {
6358 if (state_ == DiscordObjectState::Owned) {
6359 Drop();
6360 state_ = DiscordObjectState::Invalid;
6361 }
6362 if (arg0.state_ == DiscordObjectState::Owned) {
6363 Discord_AuthorizationCodeVerifier_Clone(&instance_, arg0.instance());
6364
6365 state_ = DiscordObjectState::Owned;
6366 }
6367 }
6368 return *this;
6369}
6370AuthorizationCodeVerifier::AuthorizationCodeVerifier(Discord_AuthorizationCodeVerifier instance,
6371 DiscordObjectState state)
6372 : instance_(instance)
6373 , state_(state)
6374{
6375}
6376void AuthorizationCodeVerifier::Drop()
6377{
6378 if (state_ != DiscordObjectState::Owned) {
6379 return;
6380 }
6381 Discord_AuthorizationCodeVerifier_Drop(&instance_);
6382 state_ = DiscordObjectState::Invalid;
6383}
6384discordpp::AuthorizationCodeChallenge AuthorizationCodeVerifier::Challenge() const
6385{
6386 assert(state_ == DiscordObjectState::Owned);
6387 Discord_AuthorizationCodeChallenge returnValueNative__{};
6388 Discord_AuthorizationCodeVerifier_Challenge(&instance_, &returnValueNative__);
6389 discordpp::AuthorizationCodeChallenge returnValue__(returnValueNative__,
6390 DiscordObjectState::Owned);
6391 return returnValue__;
6392}
6393void AuthorizationCodeVerifier::SetChallenge(discordpp::AuthorizationCodeChallenge Challenge)
6394{
6395 assert(state_ == DiscordObjectState::Owned);
6396 Discord_AuthorizationCodeVerifier_SetChallenge(&instance_, Challenge.instance());
6397}
6398std::string AuthorizationCodeVerifier::Verifier() const
6399{
6400 assert(state_ == DiscordObjectState::Owned);
6401 Discord_String returnValueNative__;
6402 Discord_AuthorizationCodeVerifier_Verifier(&instance_, &returnValueNative__);
6403 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
6404 returnValueNative__.size);
6405 Discord_Free(returnValueNative__.ptr);
6406 return returnValue__;
6407}
6408void AuthorizationCodeVerifier::SetVerifier(std::string Verifier)
6409{
6410 assert(state_ == DiscordObjectState::Owned);
6411 Discord_String Verifier__str{(uint8_t*)(Verifier.data()), Verifier.size()};
6412 Discord_AuthorizationCodeVerifier_SetVerifier(&instance_, Verifier__str);
6413}
6414const AuthorizationArgs AuthorizationArgs::nullobj{{}, DiscordObjectState::Invalid};
6415AuthorizationArgs::~AuthorizationArgs()
6416{
6417 if (state_ == DiscordObjectState::Owned) {
6418 Drop();
6419 state_ = DiscordObjectState::Invalid;
6420 }
6421}
6422AuthorizationArgs::AuthorizationArgs(AuthorizationArgs&& other) noexcept
6423 : instance_(other.instance_)
6424 , state_(other.state_)
6425{
6426 other.state_ = DiscordObjectState::Invalid;
6427}
6428AuthorizationArgs& AuthorizationArgs::operator=(AuthorizationArgs&& other) noexcept
6429{
6430 if (this != &other) {
6431 if (state_ == DiscordObjectState::Owned) {
6432 Drop();
6433 }
6434 instance_ = other.instance_;
6435 state_ = other.state_;
6436 other.state_ = DiscordObjectState::Invalid;
6437 }
6438 return *this;
6439}
6440AuthorizationArgs::AuthorizationArgs(const AuthorizationArgs& arg0)
6441 : instance_{}
6442 , state_(DiscordObjectState::Invalid)
6443{
6444 if (arg0.state_ == DiscordObjectState::Owned) {
6445 Discord_AuthorizationArgs_Clone(&instance_, arg0.instance());
6446
6447 state_ = DiscordObjectState::Owned;
6448 }
6449}
6450AuthorizationArgs& AuthorizationArgs::operator=(const AuthorizationArgs& arg0)
6451{
6452 if (this != &arg0) {
6453 if (state_ == DiscordObjectState::Owned) {
6454 Drop();
6455 state_ = DiscordObjectState::Invalid;
6456 }
6457 if (arg0.state_ == DiscordObjectState::Owned) {
6458 Discord_AuthorizationArgs_Clone(&instance_, arg0.instance());
6459
6460 state_ = DiscordObjectState::Owned;
6461 }
6462 }
6463 return *this;
6464}
6465AuthorizationArgs::AuthorizationArgs(Discord_AuthorizationArgs instance, DiscordObjectState state)
6466 : instance_(instance)
6467 , state_(state)
6468{
6469}
6470AuthorizationArgs::AuthorizationArgs()
6471{
6472 assert(state_ == DiscordObjectState::Invalid);
6473 Discord_AuthorizationArgs_Init(&instance_);
6474 state_ = DiscordObjectState::Owned;
6475}
6476void AuthorizationArgs::Drop()
6477{
6478 if (state_ != DiscordObjectState::Owned) {
6479 return;
6480 }
6481 Discord_AuthorizationArgs_Drop(&instance_);
6482 state_ = DiscordObjectState::Invalid;
6483}
6484uint64_t AuthorizationArgs::ClientId() const
6485{
6486 assert(state_ == DiscordObjectState::Owned);
6487 uint64_t returnValue__;
6488 returnValue__ = Discord_AuthorizationArgs_ClientId(&instance_);
6489 return returnValue__;
6490}
6491void AuthorizationArgs::SetClientId(uint64_t ClientId)
6492{
6493 assert(state_ == DiscordObjectState::Owned);
6494 Discord_AuthorizationArgs_SetClientId(&instance_, ClientId);
6495}
6496std::string AuthorizationArgs::Scopes() const
6497{
6498 assert(state_ == DiscordObjectState::Owned);
6499 Discord_String returnValueNative__;
6500 Discord_AuthorizationArgs_Scopes(&instance_, &returnValueNative__);
6501 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
6502 returnValueNative__.size);
6503 Discord_Free(returnValueNative__.ptr);
6504 return returnValue__;
6505}
6506void AuthorizationArgs::SetScopes(std::string Scopes)
6507{
6508 assert(state_ == DiscordObjectState::Owned);
6509 Discord_String Scopes__str{(uint8_t*)(Scopes.data()), Scopes.size()};
6510 Discord_AuthorizationArgs_SetScopes(&instance_, Scopes__str);
6511}
6512std::optional<std::string> AuthorizationArgs::State() const
6513{
6514 assert(state_ == DiscordObjectState::Owned);
6515 bool returnIsNonNull__;
6516 Discord_String returnValueNative__;
6517 returnIsNonNull__ = Discord_AuthorizationArgs_State(&instance_, &returnValueNative__);
6518 if (!returnIsNonNull__) {
6519 return {};
6520 }
6521 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
6522 returnValueNative__.size);
6523 Discord_Free(returnValueNative__.ptr);
6524 return returnValue__;
6525}
6526void AuthorizationArgs::SetState(std::optional<std::string> State)
6527{
6528 assert(state_ == DiscordObjectState::Owned);
6529 Discord_String State__str{};
6530 if (State.has_value()) {
6531 State__str.ptr = reinterpret_cast<uint8_t*>(State->data());
6532 State__str.size = State->size();
6533 }
6534 Discord_AuthorizationArgs_SetState(&instance_, (State.has_value() ? &State__str : nullptr));
6535}
6536std::optional<std::string> AuthorizationArgs::Nonce() const
6537{
6538 assert(state_ == DiscordObjectState::Owned);
6539 bool returnIsNonNull__;
6540 Discord_String returnValueNative__;
6541 returnIsNonNull__ = Discord_AuthorizationArgs_Nonce(&instance_, &returnValueNative__);
6542 if (!returnIsNonNull__) {
6543 return {};
6544 }
6545 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
6546 returnValueNative__.size);
6547 Discord_Free(returnValueNative__.ptr);
6548 return returnValue__;
6549}
6550void AuthorizationArgs::SetNonce(std::optional<std::string> Nonce)
6551{
6552 assert(state_ == DiscordObjectState::Owned);
6553 Discord_String Nonce__str{};
6554 if (Nonce.has_value()) {
6555 Nonce__str.ptr = reinterpret_cast<uint8_t*>(Nonce->data());
6556 Nonce__str.size = Nonce->size();
6557 }
6558 Discord_AuthorizationArgs_SetNonce(&instance_, (Nonce.has_value() ? &Nonce__str : nullptr));
6559}
6560std::optional<discordpp::AuthorizationCodeChallenge> AuthorizationArgs::CodeChallenge() const
6561{
6562 assert(state_ == DiscordObjectState::Owned);
6563 bool returnIsNonNull__;
6564 Discord_AuthorizationCodeChallenge returnValueNative__;
6565 returnIsNonNull__ = Discord_AuthorizationArgs_CodeChallenge(&instance_, &returnValueNative__);
6566 if (!returnIsNonNull__) {
6567 return {};
6568 }
6569 discordpp::AuthorizationCodeChallenge returnValue__(returnValueNative__,
6570 DiscordObjectState::Owned);
6571 return returnValue__;
6572}
6573void AuthorizationArgs::SetCodeChallenge(
6574 std::optional<discordpp::AuthorizationCodeChallenge> CodeChallenge)
6575{
6576 assert(state_ == DiscordObjectState::Owned);
6577 Discord_AuthorizationArgs_SetCodeChallenge(
6578 &instance_, (CodeChallenge.has_value() ? CodeChallenge->instance() : nullptr));
6579}
6580const DeviceAuthorizationArgs DeviceAuthorizationArgs::nullobj{{}, DiscordObjectState::Invalid};
6581DeviceAuthorizationArgs::~DeviceAuthorizationArgs()
6582{
6583 if (state_ == DiscordObjectState::Owned) {
6584 Drop();
6585 state_ = DiscordObjectState::Invalid;
6586 }
6587}
6588DeviceAuthorizationArgs::DeviceAuthorizationArgs(DeviceAuthorizationArgs&& other) noexcept
6589 : instance_(other.instance_)
6590 , state_(other.state_)
6591{
6592 other.state_ = DiscordObjectState::Invalid;
6593}
6594DeviceAuthorizationArgs& DeviceAuthorizationArgs::operator=(
6595 DeviceAuthorizationArgs&& other) noexcept
6596{
6597 if (this != &other) {
6598 if (state_ == DiscordObjectState::Owned) {
6599 Drop();
6600 }
6601 instance_ = other.instance_;
6602 state_ = other.state_;
6603 other.state_ = DiscordObjectState::Invalid;
6604 }
6605 return *this;
6606}
6607DeviceAuthorizationArgs::DeviceAuthorizationArgs(const DeviceAuthorizationArgs& arg0)
6608 : instance_{}
6609 , state_(DiscordObjectState::Invalid)
6610{
6611 if (arg0.state_ == DiscordObjectState::Owned) {
6612 Discord_DeviceAuthorizationArgs_Clone(&instance_, arg0.instance());
6613
6614 state_ = DiscordObjectState::Owned;
6615 }
6616}
6617DeviceAuthorizationArgs& DeviceAuthorizationArgs::operator=(const DeviceAuthorizationArgs& arg0)
6618{
6619 if (this != &arg0) {
6620 if (state_ == DiscordObjectState::Owned) {
6621 Drop();
6622 state_ = DiscordObjectState::Invalid;
6623 }
6624 if (arg0.state_ == DiscordObjectState::Owned) {
6625 Discord_DeviceAuthorizationArgs_Clone(&instance_, arg0.instance());
6626
6627 state_ = DiscordObjectState::Owned;
6628 }
6629 }
6630 return *this;
6631}
6632DeviceAuthorizationArgs::DeviceAuthorizationArgs(Discord_DeviceAuthorizationArgs instance,
6633 DiscordObjectState state)
6634 : instance_(instance)
6635 , state_(state)
6636{
6637}
6638DeviceAuthorizationArgs::DeviceAuthorizationArgs()
6639{
6640 assert(state_ == DiscordObjectState::Invalid);
6641 Discord_DeviceAuthorizationArgs_Init(&instance_);
6642 state_ = DiscordObjectState::Owned;
6643}
6644void DeviceAuthorizationArgs::Drop()
6645{
6646 if (state_ != DiscordObjectState::Owned) {
6647 return;
6648 }
6649 Discord_DeviceAuthorizationArgs_Drop(&instance_);
6650 state_ = DiscordObjectState::Invalid;
6651}
6652uint64_t DeviceAuthorizationArgs::ClientId() const
6653{
6654 assert(state_ == DiscordObjectState::Owned);
6655 uint64_t returnValue__;
6656 returnValue__ = Discord_DeviceAuthorizationArgs_ClientId(&instance_);
6657 return returnValue__;
6658}
6659void DeviceAuthorizationArgs::SetClientId(uint64_t ClientId)
6660{
6661 assert(state_ == DiscordObjectState::Owned);
6662 Discord_DeviceAuthorizationArgs_SetClientId(&instance_, ClientId);
6663}
6664std::string DeviceAuthorizationArgs::Scopes() const
6665{
6666 assert(state_ == DiscordObjectState::Owned);
6667 Discord_String returnValueNative__;
6668 Discord_DeviceAuthorizationArgs_Scopes(&instance_, &returnValueNative__);
6669 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
6670 returnValueNative__.size);
6671 Discord_Free(returnValueNative__.ptr);
6672 return returnValue__;
6673}
6674void DeviceAuthorizationArgs::SetScopes(std::string Scopes)
6675{
6676 assert(state_ == DiscordObjectState::Owned);
6677 Discord_String Scopes__str{(uint8_t*)(Scopes.data()), Scopes.size()};
6678 Discord_DeviceAuthorizationArgs_SetScopes(&instance_, Scopes__str);
6679}
6680const VoiceStateHandle VoiceStateHandle::nullobj{{}, DiscordObjectState::Invalid};
6681VoiceStateHandle::~VoiceStateHandle()
6682{
6683 if (state_ == DiscordObjectState::Owned) {
6684 Drop();
6685 state_ = DiscordObjectState::Invalid;
6686 }
6687}
6688VoiceStateHandle::VoiceStateHandle(VoiceStateHandle&& other) noexcept
6689 : instance_(other.instance_)
6690 , state_(other.state_)
6691{
6692 other.state_ = DiscordObjectState::Invalid;
6693}
6694VoiceStateHandle& VoiceStateHandle::operator=(VoiceStateHandle&& other) noexcept
6695{
6696 if (this != &other) {
6697 if (state_ == DiscordObjectState::Owned) {
6698 Drop();
6699 }
6700 instance_ = other.instance_;
6701 state_ = other.state_;
6702 other.state_ = DiscordObjectState::Invalid;
6703 }
6704 return *this;
6705}
6706VoiceStateHandle::VoiceStateHandle(const VoiceStateHandle& other)
6707 : instance_{}
6708 , state_(DiscordObjectState::Invalid)
6709{
6710 if (other.state_ == DiscordObjectState::Owned) {
6711 Discord_VoiceStateHandle_Clone(&instance_, other.instance());
6712
6713 state_ = DiscordObjectState::Owned;
6714 }
6715}
6716VoiceStateHandle& VoiceStateHandle::operator=(const VoiceStateHandle& other)
6717{
6718 if (this != &other) {
6719 if (state_ == DiscordObjectState::Owned) {
6720 Drop();
6721 state_ = DiscordObjectState::Invalid;
6722 }
6723 if (other.state_ == DiscordObjectState::Owned) {
6724 Discord_VoiceStateHandle_Clone(&instance_, other.instance());
6725
6726 state_ = DiscordObjectState::Owned;
6727 }
6728 }
6729 return *this;
6730}
6731VoiceStateHandle::VoiceStateHandle(Discord_VoiceStateHandle instance, DiscordObjectState state)
6732 : instance_(instance)
6733 , state_(state)
6734{
6735}
6736void VoiceStateHandle::Drop()
6737{
6738 if (state_ != DiscordObjectState::Owned) {
6739 return;
6740 }
6741 Discord_VoiceStateHandle_Drop(&instance_);
6742 state_ = DiscordObjectState::Invalid;
6743}
6744bool VoiceStateHandle::SelfDeaf() const
6745{
6746 assert(state_ == DiscordObjectState::Owned);
6747 bool returnValue__;
6748 returnValue__ = Discord_VoiceStateHandle_SelfDeaf(&instance_);
6749 return returnValue__;
6750}
6751bool VoiceStateHandle::SelfMute() const
6752{
6753 assert(state_ == DiscordObjectState::Owned);
6754 bool returnValue__;
6755 returnValue__ = Discord_VoiceStateHandle_SelfMute(&instance_);
6756 return returnValue__;
6757}
6758const VADThresholdSettings VADThresholdSettings::nullobj{{}, DiscordObjectState::Invalid};
6759VADThresholdSettings::~VADThresholdSettings()
6760{
6761 if (state_ == DiscordObjectState::Owned) {
6762 Drop();
6763 state_ = DiscordObjectState::Invalid;
6764 }
6765}
6766VADThresholdSettings::VADThresholdSettings(VADThresholdSettings&& other) noexcept
6767 : instance_(other.instance_)
6768 , state_(other.state_)
6769{
6770 other.state_ = DiscordObjectState::Invalid;
6771}
6772VADThresholdSettings& VADThresholdSettings::operator=(VADThresholdSettings&& other) noexcept
6773{
6774 if (this != &other) {
6775 if (state_ == DiscordObjectState::Owned) {
6776 Drop();
6777 }
6778 instance_ = other.instance_;
6779 state_ = other.state_;
6780 other.state_ = DiscordObjectState::Invalid;
6781 }
6782 return *this;
6783}
6784VADThresholdSettings::VADThresholdSettings(Discord_VADThresholdSettings instance,
6785 DiscordObjectState state)
6786 : instance_(instance)
6787 , state_(state)
6788{
6789}
6790void VADThresholdSettings::Drop()
6791{
6792 if (state_ != DiscordObjectState::Owned) {
6793 return;
6794 }
6795 Discord_VADThresholdSettings_Drop(&instance_);
6796 state_ = DiscordObjectState::Invalid;
6797}
6798float VADThresholdSettings::VadThreshold() const
6799{
6800 assert(state_ == DiscordObjectState::Owned);
6801 float returnValue__;
6802 returnValue__ = Discord_VADThresholdSettings_VadThreshold(&instance_);
6803 return returnValue__;
6804}
6805void VADThresholdSettings::SetVadThreshold(float VadThreshold)
6806{
6807 assert(state_ == DiscordObjectState::Owned);
6808 Discord_VADThresholdSettings_SetVadThreshold(&instance_, VadThreshold);
6809}
6810bool VADThresholdSettings::Automatic() const
6811{
6812 assert(state_ == DiscordObjectState::Owned);
6813 bool returnValue__;
6814 returnValue__ = Discord_VADThresholdSettings_Automatic(&instance_);
6815 return returnValue__;
6816}
6817void VADThresholdSettings::SetAutomatic(bool Automatic)
6818{
6819 assert(state_ == DiscordObjectState::Owned);
6820 Discord_VADThresholdSettings_SetAutomatic(&instance_, Automatic);
6821}
6822const Call Call::nullobj{{}, DiscordObjectState::Invalid};
6823Call::~Call()
6824{
6825 if (state_ == DiscordObjectState::Owned) {
6826 Drop();
6827 state_ = DiscordObjectState::Invalid;
6828 }
6829}
6830Call::Call(Call&& other) noexcept
6831 : instance_(other.instance_)
6832 , state_(other.state_)
6833{
6834 other.state_ = DiscordObjectState::Invalid;
6835}
6836Call& Call::operator=(Call&& other) noexcept
6837{
6838 if (this != &other) {
6839 if (state_ == DiscordObjectState::Owned) {
6840 Drop();
6841 }
6842 instance_ = other.instance_;
6843 state_ = other.state_;
6844 other.state_ = DiscordObjectState::Invalid;
6845 }
6846 return *this;
6847}
6848Call::Call(const Call& other)
6849 : instance_{}
6850 , state_(DiscordObjectState::Invalid)
6851{
6852 if (other.state_ == DiscordObjectState::Owned) {
6853 Discord_Call_Clone(&instance_, other.instance());
6854
6855 state_ = DiscordObjectState::Owned;
6856 }
6857}
6858Call& Call::operator=(const Call& other)
6859{
6860 if (this != &other) {
6861 if (state_ == DiscordObjectState::Owned) {
6862 Drop();
6863 state_ = DiscordObjectState::Invalid;
6864 }
6865 if (other.state_ == DiscordObjectState::Owned) {
6866 Discord_Call_Clone(&instance_, other.instance());
6867
6868 state_ = DiscordObjectState::Owned;
6869 }
6870 }
6871 return *this;
6872}
6873Call::Call(Discord_Call instance, DiscordObjectState state)
6874 : instance_(instance)
6875 , state_(state)
6876{
6877}
6878void Call::Drop()
6879{
6880 if (state_ != DiscordObjectState::Owned) {
6881 return;
6882 }
6883 Discord_Call_Drop(&instance_);
6884 state_ = DiscordObjectState::Invalid;
6885}
6886std::string Call::ErrorToString(discordpp::Call::Error type)
6887{
6888 Discord_String returnValueNative__;
6889 Discord_Call_ErrorToString(static_cast<Discord_Call_Error>(type), &returnValueNative__);
6890 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
6891 returnValueNative__.size);
6892 Discord_Free(returnValueNative__.ptr);
6893 return returnValue__;
6894}
6895discordpp::AudioModeType Call::GetAudioMode()
6896{
6897 assert(state_ == DiscordObjectState::Owned);
6898 Discord_AudioModeType returnValue__;
6899 returnValue__ = Discord_Call_GetAudioMode(&instance_);
6900 return static_cast<discordpp::AudioModeType>(returnValue__);
6901}
6902uint64_t Call::GetChannelId() const
6903{
6904 assert(state_ == DiscordObjectState::Owned);
6905 uint64_t returnValue__;
6906 returnValue__ = Discord_Call_GetChannelId(&instance_);
6907 return returnValue__;
6908}
6909uint64_t Call::GetGuildId() const
6910{
6911 assert(state_ == DiscordObjectState::Owned);
6912 uint64_t returnValue__;
6913 returnValue__ = Discord_Call_GetGuildId(&instance_);
6914 return returnValue__;
6915}
6916bool Call::GetLocalMute(uint64_t userId)
6917{
6918 assert(state_ == DiscordObjectState::Owned);
6919 bool returnValue__;
6920 returnValue__ = Discord_Call_GetLocalMute(&instance_, userId);
6921 return returnValue__;
6922}
6923std::vector<uint64_t> Call::GetParticipants() const
6924{
6925 assert(state_ == DiscordObjectState::Owned);
6926 Discord_UInt64Span returnValueNative__;
6927 Discord_Call_GetParticipants(&instance_, &returnValueNative__);
6928 std::vector<uint64_t> returnValue__(returnValueNative__.ptr,
6929 returnValueNative__.ptr + returnValueNative__.size);
6930 Discord_Free(returnValueNative__.ptr);
6931 return returnValue__;
6932}
6933float Call::GetParticipantVolume(uint64_t userId)
6934{
6935 assert(state_ == DiscordObjectState::Owned);
6936 float returnValue__;
6937 returnValue__ = Discord_Call_GetParticipantVolume(&instance_, userId);
6938 return returnValue__;
6939}
6940bool Call::GetPTTActive()
6941{
6942 assert(state_ == DiscordObjectState::Owned);
6943 bool returnValue__;
6944 returnValue__ = Discord_Call_GetPTTActive(&instance_);
6945 return returnValue__;
6946}
6947uint32_t Call::GetPTTReleaseDelay()
6948{
6949 assert(state_ == DiscordObjectState::Owned);
6950 uint32_t returnValue__;
6951 returnValue__ = Discord_Call_GetPTTReleaseDelay(&instance_);
6952 return returnValue__;
6953}
6954bool Call::GetSelfDeaf()
6955{
6956 assert(state_ == DiscordObjectState::Owned);
6957 bool returnValue__;
6958 returnValue__ = Discord_Call_GetSelfDeaf(&instance_);
6959 return returnValue__;
6960}
6961bool Call::GetSelfMute()
6962{
6963 assert(state_ == DiscordObjectState::Owned);
6964 bool returnValue__;
6965 returnValue__ = Discord_Call_GetSelfMute(&instance_);
6966 return returnValue__;
6967}
6968discordpp::Call::Status Call::GetStatus() const
6969{
6970 assert(state_ == DiscordObjectState::Owned);
6971 Discord_Call_Status returnValue__;
6972 returnValue__ = Discord_Call_GetStatus(&instance_);
6973 return static_cast<discordpp::Call::Status>(returnValue__);
6974}
6975discordpp::VADThresholdSettings Call::GetVADThreshold() const
6976{
6977 assert(state_ == DiscordObjectState::Owned);
6978 Discord_VADThresholdSettings returnValueNative__{};
6979 Discord_Call_GetVADThreshold(&instance_, &returnValueNative__);
6980 discordpp::VADThresholdSettings returnValue__(returnValueNative__, DiscordObjectState::Owned);
6981 return returnValue__;
6982}
6983std::optional<discordpp::VoiceStateHandle> Call::GetVoiceStateHandle(uint64_t userId) const
6984{
6985 assert(state_ == DiscordObjectState::Owned);
6986 bool returnIsNonNull__;
6987 Discord_VoiceStateHandle returnValueNative__;
6988 returnIsNonNull__ = Discord_Call_GetVoiceStateHandle(&instance_, userId, &returnValueNative__);
6989 if (!returnIsNonNull__) {
6990 return {};
6991 }
6992 discordpp::VoiceStateHandle returnValue__(returnValueNative__, DiscordObjectState::Owned);
6993 return returnValue__;
6994}
6995void Call::SetAudioMode(discordpp::AudioModeType audioMode)
6996{
6997 assert(state_ == DiscordObjectState::Owned);
6998 Discord_Call_SetAudioMode(&instance_, static_cast<Discord_AudioModeType>(audioMode));
6999}
7000void Call::SetLocalMute(uint64_t userId, bool mute)
7001{
7002 assert(state_ == DiscordObjectState::Owned);
7003 Discord_Call_SetLocalMute(&instance_, userId, mute);
7004}
7005void Call::SetOnVoiceStateChangedCallback(discordpp::Call::OnVoiceStateChanged cb)
7006{
7007 assert(state_ == DiscordObjectState::Owned);
7008 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
7009 auto cb__userData = new Tcb__UserData(cb);
7010 Discord_Call_OnVoiceStateChanged cb__native = [](auto userId, void* userData__) {
7011 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
7012 userData__typed->delegate(userId);
7013 };
7014 Discord_Call_SetOnVoiceStateChangedCallback(
7015 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
7016}
7017void Call::SetParticipantChangedCallback(discordpp::Call::OnParticipantChanged cb)
7018{
7019 assert(state_ == DiscordObjectState::Owned);
7020 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
7021 auto cb__userData = new Tcb__UserData(cb);
7022 Discord_Call_OnParticipantChanged cb__native = [](auto userId, auto added, void* userData__) {
7023 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
7024 userData__typed->delegate(userId, added);
7025 };
7026 Discord_Call_SetParticipantChangedCallback(
7027 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
7028}
7029void Call::SetParticipantVolume(uint64_t userId, float volume)
7030{
7031 assert(state_ == DiscordObjectState::Owned);
7032 Discord_Call_SetParticipantVolume(&instance_, userId, volume);
7033}
7034void Call::SetPTTActive(bool active)
7035{
7036 assert(state_ == DiscordObjectState::Owned);
7037 Discord_Call_SetPTTActive(&instance_, active);
7038}
7039void Call::SetPTTReleaseDelay(uint32_t releaseDelayMs)
7040{
7041 assert(state_ == DiscordObjectState::Owned);
7042 Discord_Call_SetPTTReleaseDelay(&instance_, releaseDelayMs);
7043}
7044void Call::SetSelfDeaf(bool deaf)
7045{
7046 assert(state_ == DiscordObjectState::Owned);
7047 Discord_Call_SetSelfDeaf(&instance_, deaf);
7048}
7049void Call::SetSelfMute(bool mute)
7050{
7051 assert(state_ == DiscordObjectState::Owned);
7052 Discord_Call_SetSelfMute(&instance_, mute);
7053}
7054void Call::SetSpeakingStatusChangedCallback(discordpp::Call::OnSpeakingStatusChanged cb)
7055{
7056 assert(state_ == DiscordObjectState::Owned);
7057 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
7058 auto cb__userData = new Tcb__UserData(cb);
7059 Discord_Call_OnSpeakingStatusChanged cb__native =
7060 [](auto userId, auto isPlayingSound, void* userData__) {
7061 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
7062 userData__typed->delegate(userId, isPlayingSound);
7063 };
7064 Discord_Call_SetSpeakingStatusChangedCallback(
7065 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
7066}
7067void Call::SetStatusChangedCallback(discordpp::Call::OnStatusChanged cb)
7068{
7069 assert(state_ == DiscordObjectState::Owned);
7070 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
7071 auto cb__userData = new Tcb__UserData(cb);
7072 Discord_Call_OnStatusChanged cb__native =
7073 [](auto status, auto error, auto errorDetail, void* userData__) {
7074 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
7075 userData__typed->delegate(static_cast<discordpp::Call::Status>(status),
7076 static_cast<discordpp::Call::Error>(error),
7077 errorDetail);
7078 };
7079 Discord_Call_SetStatusChangedCallback(
7080 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
7081}
7082void Call::SetVADThreshold(bool automatic, float threshold)
7083{
7084 assert(state_ == DiscordObjectState::Owned);
7085 Discord_Call_SetVADThreshold(&instance_, automatic, threshold);
7086}
7087std::string Call::StatusToString(discordpp::Call::Status type)
7088{
7089 Discord_String returnValueNative__;
7090 Discord_Call_StatusToString(static_cast<Discord_Call_Status>(type), &returnValueNative__);
7091 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
7092 returnValueNative__.size);
7093 Discord_Free(returnValueNative__.ptr);
7094 return returnValue__;
7095}
7096const ChannelHandle ChannelHandle::nullobj{{}, DiscordObjectState::Invalid};
7097ChannelHandle::~ChannelHandle()
7098{
7099 if (state_ == DiscordObjectState::Owned) {
7100 Drop();
7101 state_ = DiscordObjectState::Invalid;
7102 }
7103}
7104ChannelHandle::ChannelHandle(ChannelHandle&& other) noexcept
7105 : instance_(other.instance_)
7106 , state_(other.state_)
7107{
7108 other.state_ = DiscordObjectState::Invalid;
7109}
7110ChannelHandle& ChannelHandle::operator=(ChannelHandle&& other) noexcept
7111{
7112 if (this != &other) {
7113 if (state_ == DiscordObjectState::Owned) {
7114 Drop();
7115 }
7116 instance_ = other.instance_;
7117 state_ = other.state_;
7118 other.state_ = DiscordObjectState::Invalid;
7119 }
7120 return *this;
7121}
7122ChannelHandle::ChannelHandle(const ChannelHandle& other)
7123 : instance_{}
7124 , state_(DiscordObjectState::Invalid)
7125{
7126 if (other.state_ == DiscordObjectState::Owned) {
7127 Discord_ChannelHandle_Clone(&instance_, other.instance());
7128
7129 state_ = DiscordObjectState::Owned;
7130 }
7131}
7132ChannelHandle& ChannelHandle::operator=(const ChannelHandle& other)
7133{
7134 if (this != &other) {
7135 if (state_ == DiscordObjectState::Owned) {
7136 Drop();
7137 state_ = DiscordObjectState::Invalid;
7138 }
7139 if (other.state_ == DiscordObjectState::Owned) {
7140 Discord_ChannelHandle_Clone(&instance_, other.instance());
7141
7142 state_ = DiscordObjectState::Owned;
7143 }
7144 }
7145 return *this;
7146}
7147ChannelHandle::ChannelHandle(Discord_ChannelHandle instance, DiscordObjectState state)
7148 : instance_(instance)
7149 , state_(state)
7150{
7151}
7152void ChannelHandle::Drop()
7153{
7154 if (state_ != DiscordObjectState::Owned) {
7155 return;
7156 }
7157 Discord_ChannelHandle_Drop(&instance_);
7158 state_ = DiscordObjectState::Invalid;
7159}
7160uint64_t ChannelHandle::Id() const
7161{
7162 assert(state_ == DiscordObjectState::Owned);
7163 uint64_t returnValue__;
7164 returnValue__ = Discord_ChannelHandle_Id(&instance_);
7165 return returnValue__;
7166}
7167std::string ChannelHandle::Name() const
7168{
7169 assert(state_ == DiscordObjectState::Owned);
7170 Discord_String returnValueNative__;
7171 Discord_ChannelHandle_Name(&instance_, &returnValueNative__);
7172 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
7173 returnValueNative__.size);
7174 Discord_Free(returnValueNative__.ptr);
7175 return returnValue__;
7176}
7177std::vector<uint64_t> ChannelHandle::Recipients() const
7178{
7179 assert(state_ == DiscordObjectState::Owned);
7180 Discord_UInt64Span returnValueNative__;
7181 Discord_ChannelHandle_Recipients(&instance_, &returnValueNative__);
7182 std::vector<uint64_t> returnValue__(returnValueNative__.ptr,
7183 returnValueNative__.ptr + returnValueNative__.size);
7184 Discord_Free(returnValueNative__.ptr);
7185 return returnValue__;
7186}
7187discordpp::ChannelType ChannelHandle::Type() const
7188{
7189 assert(state_ == DiscordObjectState::Owned);
7190 Discord_ChannelType returnValue__;
7191 returnValue__ = Discord_ChannelHandle_Type(&instance_);
7192 return static_cast<discordpp::ChannelType>(returnValue__);
7193}
7194const GuildMinimal GuildMinimal::nullobj{{}, DiscordObjectState::Invalid};
7195GuildMinimal::~GuildMinimal()
7196{
7197 if (state_ == DiscordObjectState::Owned) {
7198 Drop();
7199 state_ = DiscordObjectState::Invalid;
7200 }
7201}
7202GuildMinimal::GuildMinimal(GuildMinimal&& other) noexcept
7203 : instance_(other.instance_)
7204 , state_(other.state_)
7205{
7206 other.state_ = DiscordObjectState::Invalid;
7207}
7208GuildMinimal& GuildMinimal::operator=(GuildMinimal&& other) noexcept
7209{
7210 if (this != &other) {
7211 if (state_ == DiscordObjectState::Owned) {
7212 Drop();
7213 }
7214 instance_ = other.instance_;
7215 state_ = other.state_;
7216 other.state_ = DiscordObjectState::Invalid;
7217 }
7218 return *this;
7219}
7220GuildMinimal::GuildMinimal(const GuildMinimal& arg0)
7221 : instance_{}
7222 , state_(DiscordObjectState::Invalid)
7223{
7224 if (arg0.state_ == DiscordObjectState::Owned) {
7225 Discord_GuildMinimal_Clone(&instance_, arg0.instance());
7226
7227 state_ = DiscordObjectState::Owned;
7228 }
7229}
7230GuildMinimal& GuildMinimal::operator=(const GuildMinimal& arg0)
7231{
7232 if (this != &arg0) {
7233 if (state_ == DiscordObjectState::Owned) {
7234 Drop();
7235 state_ = DiscordObjectState::Invalid;
7236 }
7237 if (arg0.state_ == DiscordObjectState::Owned) {
7238 Discord_GuildMinimal_Clone(&instance_, arg0.instance());
7239
7240 state_ = DiscordObjectState::Owned;
7241 }
7242 }
7243 return *this;
7244}
7245GuildMinimal::GuildMinimal(Discord_GuildMinimal instance, DiscordObjectState state)
7246 : instance_(instance)
7247 , state_(state)
7248{
7249}
7250void GuildMinimal::Drop()
7251{
7252 if (state_ != DiscordObjectState::Owned) {
7253 return;
7254 }
7255 Discord_GuildMinimal_Drop(&instance_);
7256 state_ = DiscordObjectState::Invalid;
7257}
7258uint64_t GuildMinimal::Id() const
7259{
7260 assert(state_ == DiscordObjectState::Owned);
7261 uint64_t returnValue__;
7262 returnValue__ = Discord_GuildMinimal_Id(&instance_);
7263 return returnValue__;
7264}
7265void GuildMinimal::SetId(uint64_t Id)
7266{
7267 assert(state_ == DiscordObjectState::Owned);
7268 Discord_GuildMinimal_SetId(&instance_, Id);
7269}
7270std::string GuildMinimal::Name() const
7271{
7272 assert(state_ == DiscordObjectState::Owned);
7273 Discord_String returnValueNative__;
7274 Discord_GuildMinimal_Name(&instance_, &returnValueNative__);
7275 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
7276 returnValueNative__.size);
7277 Discord_Free(returnValueNative__.ptr);
7278 return returnValue__;
7279}
7280void GuildMinimal::SetName(std::string Name)
7281{
7282 assert(state_ == DiscordObjectState::Owned);
7283 Discord_String Name__str{(uint8_t*)(Name.data()), Name.size()};
7284 Discord_GuildMinimal_SetName(&instance_, Name__str);
7285}
7286const GuildChannel GuildChannel::nullobj{{}, DiscordObjectState::Invalid};
7287GuildChannel::~GuildChannel()
7288{
7289 if (state_ == DiscordObjectState::Owned) {
7290 Drop();
7291 state_ = DiscordObjectState::Invalid;
7292 }
7293}
7294GuildChannel::GuildChannel(GuildChannel&& other) noexcept
7295 : instance_(other.instance_)
7296 , state_(other.state_)
7297{
7298 other.state_ = DiscordObjectState::Invalid;
7299}
7300GuildChannel& GuildChannel::operator=(GuildChannel&& other) noexcept
7301{
7302 if (this != &other) {
7303 if (state_ == DiscordObjectState::Owned) {
7304 Drop();
7305 }
7306 instance_ = other.instance_;
7307 state_ = other.state_;
7308 other.state_ = DiscordObjectState::Invalid;
7309 }
7310 return *this;
7311}
7312GuildChannel::GuildChannel(const GuildChannel& arg0)
7313 : instance_{}
7314 , state_(DiscordObjectState::Invalid)
7315{
7316 if (arg0.state_ == DiscordObjectState::Owned) {
7317 Discord_GuildChannel_Clone(&instance_, arg0.instance());
7318
7319 state_ = DiscordObjectState::Owned;
7320 }
7321}
7322GuildChannel& GuildChannel::operator=(const GuildChannel& arg0)
7323{
7324 if (this != &arg0) {
7325 if (state_ == DiscordObjectState::Owned) {
7326 Drop();
7327 state_ = DiscordObjectState::Invalid;
7328 }
7329 if (arg0.state_ == DiscordObjectState::Owned) {
7330 Discord_GuildChannel_Clone(&instance_, arg0.instance());
7331
7332 state_ = DiscordObjectState::Owned;
7333 }
7334 }
7335 return *this;
7336}
7337GuildChannel::GuildChannel(Discord_GuildChannel instance, DiscordObjectState state)
7338 : instance_(instance)
7339 , state_(state)
7340{
7341}
7342void GuildChannel::Drop()
7343{
7344 if (state_ != DiscordObjectState::Owned) {
7345 return;
7346 }
7347 Discord_GuildChannel_Drop(&instance_);
7348 state_ = DiscordObjectState::Invalid;
7349}
7350uint64_t GuildChannel::Id() const
7351{
7352 assert(state_ == DiscordObjectState::Owned);
7353 uint64_t returnValue__;
7354 returnValue__ = Discord_GuildChannel_Id(&instance_);
7355 return returnValue__;
7356}
7357void GuildChannel::SetId(uint64_t Id)
7358{
7359 assert(state_ == DiscordObjectState::Owned);
7360 Discord_GuildChannel_SetId(&instance_, Id);
7361}
7362std::string GuildChannel::Name() const
7363{
7364 assert(state_ == DiscordObjectState::Owned);
7365 Discord_String returnValueNative__;
7366 Discord_GuildChannel_Name(&instance_, &returnValueNative__);
7367 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
7368 returnValueNative__.size);
7369 Discord_Free(returnValueNative__.ptr);
7370 return returnValue__;
7371}
7372void GuildChannel::SetName(std::string Name)
7373{
7374 assert(state_ == DiscordObjectState::Owned);
7375 Discord_String Name__str{(uint8_t*)(Name.data()), Name.size()};
7376 Discord_GuildChannel_SetName(&instance_, Name__str);
7377}
7378bool GuildChannel::IsLinkable() const
7379{
7380 assert(state_ == DiscordObjectState::Owned);
7381 bool returnValue__;
7382 returnValue__ = Discord_GuildChannel_IsLinkable(&instance_);
7383 return returnValue__;
7384}
7385void GuildChannel::SetIsLinkable(bool IsLinkable)
7386{
7387 assert(state_ == DiscordObjectState::Owned);
7388 Discord_GuildChannel_SetIsLinkable(&instance_, IsLinkable);
7389}
7390bool GuildChannel::IsViewableAndWriteableByAllMembers() const
7391{
7392 assert(state_ == DiscordObjectState::Owned);
7393 bool returnValue__;
7394 returnValue__ = Discord_GuildChannel_IsViewableAndWriteableByAllMembers(&instance_);
7395 return returnValue__;
7396}
7397void GuildChannel::SetIsViewableAndWriteableByAllMembers(bool IsViewableAndWriteableByAllMembers)
7398{
7399 assert(state_ == DiscordObjectState::Owned);
7400 Discord_GuildChannel_SetIsViewableAndWriteableByAllMembers(&instance_,
7401 IsViewableAndWriteableByAllMembers);
7402}
7403std::optional<discordpp::LinkedLobby> GuildChannel::LinkedLobby() const
7404{
7405 assert(state_ == DiscordObjectState::Owned);
7406 bool returnIsNonNull__;
7407 Discord_LinkedLobby returnValueNative__;
7408 returnIsNonNull__ = Discord_GuildChannel_LinkedLobby(&instance_, &returnValueNative__);
7409 if (!returnIsNonNull__) {
7410 return {};
7411 }
7412 discordpp::LinkedLobby returnValue__(returnValueNative__, DiscordObjectState::Owned);
7413 return returnValue__;
7414}
7415void GuildChannel::SetLinkedLobby(std::optional<discordpp::LinkedLobby> LinkedLobby)
7416{
7417 assert(state_ == DiscordObjectState::Owned);
7418 Discord_GuildChannel_SetLinkedLobby(
7419 &instance_, (LinkedLobby.has_value() ? LinkedLobby->instance() : nullptr));
7420}
7421const LinkedLobby LinkedLobby::nullobj{{}, DiscordObjectState::Invalid};
7422LinkedLobby::~LinkedLobby()
7423{
7424 if (state_ == DiscordObjectState::Owned) {
7425 Drop();
7426 state_ = DiscordObjectState::Invalid;
7427 }
7428}
7429LinkedLobby::LinkedLobby(LinkedLobby&& other) noexcept
7430 : instance_(other.instance_)
7431 , state_(other.state_)
7432{
7433 other.state_ = DiscordObjectState::Invalid;
7434}
7435LinkedLobby& LinkedLobby::operator=(LinkedLobby&& other) noexcept
7436{
7437 if (this != &other) {
7438 if (state_ == DiscordObjectState::Owned) {
7439 Drop();
7440 }
7441 instance_ = other.instance_;
7442 state_ = other.state_;
7443 other.state_ = DiscordObjectState::Invalid;
7444 }
7445 return *this;
7446}
7447LinkedLobby::LinkedLobby(const LinkedLobby& arg0)
7448 : instance_{}
7449 , state_(DiscordObjectState::Invalid)
7450{
7451 if (arg0.state_ == DiscordObjectState::Owned) {
7452 Discord_LinkedLobby_Clone(&instance_, arg0.instance());
7453
7454 state_ = DiscordObjectState::Owned;
7455 }
7456}
7457LinkedLobby& LinkedLobby::operator=(const LinkedLobby& arg0)
7458{
7459 if (this != &arg0) {
7460 if (state_ == DiscordObjectState::Owned) {
7461 Drop();
7462 state_ = DiscordObjectState::Invalid;
7463 }
7464 if (arg0.state_ == DiscordObjectState::Owned) {
7465 Discord_LinkedLobby_Clone(&instance_, arg0.instance());
7466
7467 state_ = DiscordObjectState::Owned;
7468 }
7469 }
7470 return *this;
7471}
7472LinkedLobby::LinkedLobby(Discord_LinkedLobby instance, DiscordObjectState state)
7473 : instance_(instance)
7474 , state_(state)
7475{
7476}
7477LinkedLobby::LinkedLobby()
7478{
7479 assert(state_ == DiscordObjectState::Invalid);
7480 Discord_LinkedLobby_Init(&instance_);
7481 state_ = DiscordObjectState::Owned;
7482}
7483void LinkedLobby::Drop()
7484{
7485 if (state_ != DiscordObjectState::Owned) {
7486 return;
7487 }
7488 Discord_LinkedLobby_Drop(&instance_);
7489 state_ = DiscordObjectState::Invalid;
7490}
7491uint64_t LinkedLobby::ApplicationId() const
7492{
7493 assert(state_ == DiscordObjectState::Owned);
7494 uint64_t returnValue__;
7495 returnValue__ = Discord_LinkedLobby_ApplicationId(&instance_);
7496 return returnValue__;
7497}
7498void LinkedLobby::SetApplicationId(uint64_t ApplicationId)
7499{
7500 assert(state_ == DiscordObjectState::Owned);
7501 Discord_LinkedLobby_SetApplicationId(&instance_, ApplicationId);
7502}
7503uint64_t LinkedLobby::LobbyId() const
7504{
7505 assert(state_ == DiscordObjectState::Owned);
7506 uint64_t returnValue__;
7507 returnValue__ = Discord_LinkedLobby_LobbyId(&instance_);
7508 return returnValue__;
7509}
7510void LinkedLobby::SetLobbyId(uint64_t LobbyId)
7511{
7512 assert(state_ == DiscordObjectState::Owned);
7513 Discord_LinkedLobby_SetLobbyId(&instance_, LobbyId);
7514}
7515const LinkedChannel LinkedChannel::nullobj{{}, DiscordObjectState::Invalid};
7516LinkedChannel::~LinkedChannel()
7517{
7518 if (state_ == DiscordObjectState::Owned) {
7519 Drop();
7520 state_ = DiscordObjectState::Invalid;
7521 }
7522}
7523LinkedChannel::LinkedChannel(LinkedChannel&& other) noexcept
7524 : instance_(other.instance_)
7525 , state_(other.state_)
7526{
7527 other.state_ = DiscordObjectState::Invalid;
7528}
7529LinkedChannel& LinkedChannel::operator=(LinkedChannel&& other) noexcept
7530{
7531 if (this != &other) {
7532 if (state_ == DiscordObjectState::Owned) {
7533 Drop();
7534 }
7535 instance_ = other.instance_;
7536 state_ = other.state_;
7537 other.state_ = DiscordObjectState::Invalid;
7538 }
7539 return *this;
7540}
7541LinkedChannel::LinkedChannel(const LinkedChannel& arg0)
7542 : instance_{}
7543 , state_(DiscordObjectState::Invalid)
7544{
7545 if (arg0.state_ == DiscordObjectState::Owned) {
7546 Discord_LinkedChannel_Clone(&instance_, arg0.instance());
7547
7548 state_ = DiscordObjectState::Owned;
7549 }
7550}
7551LinkedChannel& LinkedChannel::operator=(const LinkedChannel& arg0)
7552{
7553 if (this != &arg0) {
7554 if (state_ == DiscordObjectState::Owned) {
7555 Drop();
7556 state_ = DiscordObjectState::Invalid;
7557 }
7558 if (arg0.state_ == DiscordObjectState::Owned) {
7559 Discord_LinkedChannel_Clone(&instance_, arg0.instance());
7560
7561 state_ = DiscordObjectState::Owned;
7562 }
7563 }
7564 return *this;
7565}
7566LinkedChannel::LinkedChannel(Discord_LinkedChannel instance, DiscordObjectState state)
7567 : instance_(instance)
7568 , state_(state)
7569{
7570}
7571void LinkedChannel::Drop()
7572{
7573 if (state_ != DiscordObjectState::Owned) {
7574 return;
7575 }
7576 Discord_LinkedChannel_Drop(&instance_);
7577 state_ = DiscordObjectState::Invalid;
7578}
7579uint64_t LinkedChannel::Id() const
7580{
7581 assert(state_ == DiscordObjectState::Owned);
7582 uint64_t returnValue__;
7583 returnValue__ = Discord_LinkedChannel_Id(&instance_);
7584 return returnValue__;
7585}
7586void LinkedChannel::SetId(uint64_t Id)
7587{
7588 assert(state_ == DiscordObjectState::Owned);
7589 Discord_LinkedChannel_SetId(&instance_, Id);
7590}
7591std::string LinkedChannel::Name() const
7592{
7593 assert(state_ == DiscordObjectState::Owned);
7594 Discord_String returnValueNative__;
7595 Discord_LinkedChannel_Name(&instance_, &returnValueNative__);
7596 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
7597 returnValueNative__.size);
7598 Discord_Free(returnValueNative__.ptr);
7599 return returnValue__;
7600}
7601void LinkedChannel::SetName(std::string Name)
7602{
7603 assert(state_ == DiscordObjectState::Owned);
7604 Discord_String Name__str{(uint8_t*)(Name.data()), Name.size()};
7605 Discord_LinkedChannel_SetName(&instance_, Name__str);
7606}
7607uint64_t LinkedChannel::GuildId() const
7608{
7609 assert(state_ == DiscordObjectState::Owned);
7610 uint64_t returnValue__;
7611 returnValue__ = Discord_LinkedChannel_GuildId(&instance_);
7612 return returnValue__;
7613}
7614void LinkedChannel::SetGuildId(uint64_t GuildId)
7615{
7616 assert(state_ == DiscordObjectState::Owned);
7617 Discord_LinkedChannel_SetGuildId(&instance_, GuildId);
7618}
7619const RelationshipHandle RelationshipHandle::nullobj{{}, DiscordObjectState::Invalid};
7620RelationshipHandle::~RelationshipHandle()
7621{
7622 if (state_ == DiscordObjectState::Owned) {
7623 Drop();
7624 state_ = DiscordObjectState::Invalid;
7625 }
7626}
7627RelationshipHandle::RelationshipHandle(RelationshipHandle&& other) noexcept
7628 : instance_(other.instance_)
7629 , state_(other.state_)
7630{
7631 other.state_ = DiscordObjectState::Invalid;
7632}
7633RelationshipHandle& RelationshipHandle::operator=(RelationshipHandle&& other) noexcept
7634{
7635 if (this != &other) {
7636 if (state_ == DiscordObjectState::Owned) {
7637 Drop();
7638 }
7639 instance_ = other.instance_;
7640 state_ = other.state_;
7641 other.state_ = DiscordObjectState::Invalid;
7642 }
7643 return *this;
7644}
7645RelationshipHandle::RelationshipHandle(const RelationshipHandle& other)
7646 : instance_{}
7647 , state_(DiscordObjectState::Invalid)
7648{
7649 if (other.state_ == DiscordObjectState::Owned) {
7650 Discord_RelationshipHandle_Clone(&instance_, other.instance());
7651
7652 state_ = DiscordObjectState::Owned;
7653 }
7654}
7655RelationshipHandle& RelationshipHandle::operator=(const RelationshipHandle& other)
7656{
7657 if (this != &other) {
7658 if (state_ == DiscordObjectState::Owned) {
7659 Drop();
7660 state_ = DiscordObjectState::Invalid;
7661 }
7662 if (other.state_ == DiscordObjectState::Owned) {
7663 Discord_RelationshipHandle_Clone(&instance_, other.instance());
7664
7665 state_ = DiscordObjectState::Owned;
7666 }
7667 }
7668 return *this;
7669}
7670RelationshipHandle::RelationshipHandle(Discord_RelationshipHandle instance,
7671 DiscordObjectState state)
7672 : instance_(instance)
7673 , state_(state)
7674{
7675}
7676void RelationshipHandle::Drop()
7677{
7678 if (state_ != DiscordObjectState::Owned) {
7679 return;
7680 }
7681 Discord_RelationshipHandle_Drop(&instance_);
7682 state_ = DiscordObjectState::Invalid;
7683}
7684discordpp::RelationshipType RelationshipHandle::DiscordRelationshipType() const
7685{
7686 assert(state_ == DiscordObjectState::Owned);
7687 Discord_RelationshipType returnValue__;
7688 returnValue__ = Discord_RelationshipHandle_DiscordRelationshipType(&instance_);
7689 return static_cast<discordpp::RelationshipType>(returnValue__);
7690}
7691discordpp::RelationshipType RelationshipHandle::GameRelationshipType() const
7692{
7693 assert(state_ == DiscordObjectState::Owned);
7694 Discord_RelationshipType returnValue__;
7695 returnValue__ = Discord_RelationshipHandle_GameRelationshipType(&instance_);
7696 return static_cast<discordpp::RelationshipType>(returnValue__);
7697}
7698uint64_t RelationshipHandle::Id() const
7699{
7700 assert(state_ == DiscordObjectState::Owned);
7701 uint64_t returnValue__;
7702 returnValue__ = Discord_RelationshipHandle_Id(&instance_);
7703 return returnValue__;
7704}
7705std::optional<discordpp::UserHandle> RelationshipHandle::User() const
7706{
7707 assert(state_ == DiscordObjectState::Owned);
7708 bool returnIsNonNull__;
7709 Discord_UserHandle returnValueNative__;
7710 returnIsNonNull__ = Discord_RelationshipHandle_User(&instance_, &returnValueNative__);
7711 if (!returnIsNonNull__) {
7712 return {};
7713 }
7714 discordpp::UserHandle returnValue__(returnValueNative__, DiscordObjectState::Owned);
7715 return returnValue__;
7716}
7717const UserHandle UserHandle::nullobj{{}, DiscordObjectState::Invalid};
7718UserHandle::~UserHandle()
7719{
7720 if (state_ == DiscordObjectState::Owned) {
7721 Drop();
7722 state_ = DiscordObjectState::Invalid;
7723 }
7724}
7725UserHandle::UserHandle(UserHandle&& other) noexcept
7726 : instance_(other.instance_)
7727 , state_(other.state_)
7728{
7729 other.state_ = DiscordObjectState::Invalid;
7730}
7731UserHandle& UserHandle::operator=(UserHandle&& other) noexcept
7732{
7733 if (this != &other) {
7734 if (state_ == DiscordObjectState::Owned) {
7735 Drop();
7736 }
7737 instance_ = other.instance_;
7738 state_ = other.state_;
7739 other.state_ = DiscordObjectState::Invalid;
7740 }
7741 return *this;
7742}
7743UserHandle::UserHandle(const UserHandle& arg0)
7744 : instance_{}
7745 , state_(DiscordObjectState::Invalid)
7746{
7747 if (arg0.state_ == DiscordObjectState::Owned) {
7748 Discord_UserHandle_Clone(&instance_, arg0.instance());
7749
7750 state_ = DiscordObjectState::Owned;
7751 }
7752}
7753UserHandle& UserHandle::operator=(const UserHandle& arg0)
7754{
7755 if (this != &arg0) {
7756 if (state_ == DiscordObjectState::Owned) {
7757 Drop();
7758 state_ = DiscordObjectState::Invalid;
7759 }
7760 if (arg0.state_ == DiscordObjectState::Owned) {
7761 Discord_UserHandle_Clone(&instance_, arg0.instance());
7762
7763 state_ = DiscordObjectState::Owned;
7764 }
7765 }
7766 return *this;
7767}
7768UserHandle::UserHandle(Discord_UserHandle instance, DiscordObjectState state)
7769 : instance_(instance)
7770 , state_(state)
7771{
7772}
7773void UserHandle::Drop()
7774{
7775 if (state_ != DiscordObjectState::Owned) {
7776 return;
7777 }
7778 Discord_UserHandle_Drop(&instance_);
7779 state_ = DiscordObjectState::Invalid;
7780}
7781std::optional<std::string> UserHandle::Avatar() const
7782{
7783 assert(state_ == DiscordObjectState::Owned);
7784 bool returnIsNonNull__;
7785 Discord_String returnValueNative__;
7786 returnIsNonNull__ = Discord_UserHandle_Avatar(&instance_, &returnValueNative__);
7787 if (!returnIsNonNull__) {
7788 return {};
7789 }
7790 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
7791 returnValueNative__.size);
7792 Discord_Free(returnValueNative__.ptr);
7793 return returnValue__;
7794}
7795std::string UserHandle::AvatarTypeToString(discordpp::UserHandle::AvatarType type)
7796{
7797 Discord_String returnValueNative__;
7798 Discord_UserHandle_AvatarTypeToString(static_cast<Discord_UserHandle_AvatarType>(type),
7799 &returnValueNative__);
7800 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
7801 returnValueNative__.size);
7802 Discord_Free(returnValueNative__.ptr);
7803 return returnValue__;
7804}
7805std::string UserHandle::AvatarUrl(discordpp::UserHandle::AvatarType animatedType,
7806 discordpp::UserHandle::AvatarType staticType) const
7807{
7808 assert(state_ == DiscordObjectState::Owned);
7809 Discord_String returnValueNative__;
7810 Discord_UserHandle_AvatarUrl(&instance_,
7811 static_cast<Discord_UserHandle_AvatarType>(animatedType),
7812 static_cast<Discord_UserHandle_AvatarType>(staticType),
7813 &returnValueNative__);
7814 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
7815 returnValueNative__.size);
7816 Discord_Free(returnValueNative__.ptr);
7817 return returnValue__;
7818}
7819std::string UserHandle::DisplayName() const
7820{
7821 assert(state_ == DiscordObjectState::Owned);
7822 Discord_String returnValueNative__;
7823 Discord_UserHandle_DisplayName(&instance_, &returnValueNative__);
7824 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
7825 returnValueNative__.size);
7826 Discord_Free(returnValueNative__.ptr);
7827 return returnValue__;
7828}
7829std::optional<discordpp::Activity> UserHandle::GameActivity() const
7830{
7831 assert(state_ == DiscordObjectState::Owned);
7832 bool returnIsNonNull__;
7833 Discord_Activity returnValueNative__;
7834 returnIsNonNull__ = Discord_UserHandle_GameActivity(&instance_, &returnValueNative__);
7835 if (!returnIsNonNull__) {
7836 return {};
7837 }
7838 discordpp::Activity returnValue__(returnValueNative__, DiscordObjectState::Owned);
7839 return returnValue__;
7840}
7841std::optional<std::string> UserHandle::GlobalName() const
7842{
7843 assert(state_ == DiscordObjectState::Owned);
7844 bool returnIsNonNull__;
7845 Discord_String returnValueNative__;
7846 returnIsNonNull__ = Discord_UserHandle_GlobalName(&instance_, &returnValueNative__);
7847 if (!returnIsNonNull__) {
7848 return {};
7849 }
7850 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
7851 returnValueNative__.size);
7852 Discord_Free(returnValueNative__.ptr);
7853 return returnValue__;
7854}
7855uint64_t UserHandle::Id() const
7856{
7857 assert(state_ == DiscordObjectState::Owned);
7858 uint64_t returnValue__;
7859 returnValue__ = Discord_UserHandle_Id(&instance_);
7860 return returnValue__;
7861}
7862bool UserHandle::IsProvisional() const
7863{
7864 assert(state_ == DiscordObjectState::Owned);
7865 bool returnValue__;
7866 returnValue__ = Discord_UserHandle_IsProvisional(&instance_);
7867 return returnValue__;
7868}
7869discordpp::RelationshipHandle UserHandle::Relationship() const
7870{
7871 assert(state_ == DiscordObjectState::Owned);
7872 Discord_RelationshipHandle returnValueNative__{};
7873 Discord_UserHandle_Relationship(&instance_, &returnValueNative__);
7874 discordpp::RelationshipHandle returnValue__(returnValueNative__, DiscordObjectState::Owned);
7875 return returnValue__;
7876}
7877discordpp::StatusType UserHandle::Status() const
7878{
7879 assert(state_ == DiscordObjectState::Owned);
7880 Discord_StatusType returnValue__;
7881 returnValue__ = Discord_UserHandle_Status(&instance_);
7882 return static_cast<discordpp::StatusType>(returnValue__);
7883}
7884std::string UserHandle::Username() const
7885{
7886 assert(state_ == DiscordObjectState::Owned);
7887 Discord_String returnValueNative__;
7888 Discord_UserHandle_Username(&instance_, &returnValueNative__);
7889 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
7890 returnValueNative__.size);
7891 Discord_Free(returnValueNative__.ptr);
7892 return returnValue__;
7893}
7894const LobbyMemberHandle LobbyMemberHandle::nullobj{{}, DiscordObjectState::Invalid};
7895LobbyMemberHandle::~LobbyMemberHandle()
7896{
7897 if (state_ == DiscordObjectState::Owned) {
7898 Drop();
7899 state_ = DiscordObjectState::Invalid;
7900 }
7901}
7902LobbyMemberHandle::LobbyMemberHandle(LobbyMemberHandle&& other) noexcept
7903 : instance_(other.instance_)
7904 , state_(other.state_)
7905{
7906 other.state_ = DiscordObjectState::Invalid;
7907}
7908LobbyMemberHandle& LobbyMemberHandle::operator=(LobbyMemberHandle&& other) noexcept
7909{
7910 if (this != &other) {
7911 if (state_ == DiscordObjectState::Owned) {
7912 Drop();
7913 }
7914 instance_ = other.instance_;
7915 state_ = other.state_;
7916 other.state_ = DiscordObjectState::Invalid;
7917 }
7918 return *this;
7919}
7920LobbyMemberHandle::LobbyMemberHandle(const LobbyMemberHandle& other)
7921 : instance_{}
7922 , state_(DiscordObjectState::Invalid)
7923{
7924 if (other.state_ == DiscordObjectState::Owned) {
7925 Discord_LobbyMemberHandle_Clone(&instance_, other.instance());
7926
7927 state_ = DiscordObjectState::Owned;
7928 }
7929}
7930LobbyMemberHandle& LobbyMemberHandle::operator=(const LobbyMemberHandle& other)
7931{
7932 if (this != &other) {
7933 if (state_ == DiscordObjectState::Owned) {
7934 Drop();
7935 state_ = DiscordObjectState::Invalid;
7936 }
7937 if (other.state_ == DiscordObjectState::Owned) {
7938 Discord_LobbyMemberHandle_Clone(&instance_, other.instance());
7939
7940 state_ = DiscordObjectState::Owned;
7941 }
7942 }
7943 return *this;
7944}
7945LobbyMemberHandle::LobbyMemberHandle(Discord_LobbyMemberHandle instance, DiscordObjectState state)
7946 : instance_(instance)
7947 , state_(state)
7948{
7949}
7950void LobbyMemberHandle::Drop()
7951{
7952 if (state_ != DiscordObjectState::Owned) {
7953 return;
7954 }
7955 Discord_LobbyMemberHandle_Drop(&instance_);
7956 state_ = DiscordObjectState::Invalid;
7957}
7958bool LobbyMemberHandle::CanLinkLobby() const
7959{
7960 assert(state_ == DiscordObjectState::Owned);
7961 bool returnValue__;
7962 returnValue__ = Discord_LobbyMemberHandle_CanLinkLobby(&instance_);
7963 return returnValue__;
7964}
7965bool LobbyMemberHandle::Connected() const
7966{
7967 assert(state_ == DiscordObjectState::Owned);
7968 bool returnValue__;
7969 returnValue__ = Discord_LobbyMemberHandle_Connected(&instance_);
7970 return returnValue__;
7971}
7972uint64_t LobbyMemberHandle::Id() const
7973{
7974 assert(state_ == DiscordObjectState::Owned);
7975 uint64_t returnValue__;
7976 returnValue__ = Discord_LobbyMemberHandle_Id(&instance_);
7977 return returnValue__;
7978}
7979std::unordered_map<std::string, std::string> LobbyMemberHandle::Metadata() const
7980{
7981 assert(state_ == DiscordObjectState::Owned);
7982 Discord_Properties returnValueNative__;
7983 Discord_LobbyMemberHandle_Metadata(&instance_, &returnValueNative__);
7984 std::unordered_map<std::string, std::string> returnValue__ =
7985 ConvertReturnedProperties(returnValueNative__);
7986 Discord_FreeProperties(returnValueNative__);
7987 return returnValue__;
7988}
7989std::optional<discordpp::UserHandle> LobbyMemberHandle::User() const
7990{
7991 assert(state_ == DiscordObjectState::Owned);
7992 bool returnIsNonNull__;
7993 Discord_UserHandle returnValueNative__;
7994 returnIsNonNull__ = Discord_LobbyMemberHandle_User(&instance_, &returnValueNative__);
7995 if (!returnIsNonNull__) {
7996 return {};
7997 }
7998 discordpp::UserHandle returnValue__(returnValueNative__, DiscordObjectState::Owned);
7999 return returnValue__;
8000}
8001const LobbyHandle LobbyHandle::nullobj{{}, DiscordObjectState::Invalid};
8002LobbyHandle::~LobbyHandle()
8003{
8004 if (state_ == DiscordObjectState::Owned) {
8005 Drop();
8006 state_ = DiscordObjectState::Invalid;
8007 }
8008}
8009LobbyHandle::LobbyHandle(LobbyHandle&& other) noexcept
8010 : instance_(other.instance_)
8011 , state_(other.state_)
8012{
8013 other.state_ = DiscordObjectState::Invalid;
8014}
8015LobbyHandle& LobbyHandle::operator=(LobbyHandle&& other) noexcept
8016{
8017 if (this != &other) {
8018 if (state_ == DiscordObjectState::Owned) {
8019 Drop();
8020 }
8021 instance_ = other.instance_;
8022 state_ = other.state_;
8023 other.state_ = DiscordObjectState::Invalid;
8024 }
8025 return *this;
8026}
8027LobbyHandle::LobbyHandle(const LobbyHandle& other)
8028 : instance_{}
8029 , state_(DiscordObjectState::Invalid)
8030{
8031 if (other.state_ == DiscordObjectState::Owned) {
8032 Discord_LobbyHandle_Clone(&instance_, other.instance());
8033
8034 state_ = DiscordObjectState::Owned;
8035 }
8036}
8037LobbyHandle& LobbyHandle::operator=(const LobbyHandle& other)
8038{
8039 if (this != &other) {
8040 if (state_ == DiscordObjectState::Owned) {
8041 Drop();
8042 state_ = DiscordObjectState::Invalid;
8043 }
8044 if (other.state_ == DiscordObjectState::Owned) {
8045 Discord_LobbyHandle_Clone(&instance_, other.instance());
8046
8047 state_ = DiscordObjectState::Owned;
8048 }
8049 }
8050 return *this;
8051}
8052LobbyHandle::LobbyHandle(Discord_LobbyHandle instance, DiscordObjectState state)
8053 : instance_(instance)
8054 , state_(state)
8055{
8056}
8057void LobbyHandle::Drop()
8058{
8059 if (state_ != DiscordObjectState::Owned) {
8060 return;
8061 }
8062 Discord_LobbyHandle_Drop(&instance_);
8063 state_ = DiscordObjectState::Invalid;
8064}
8065std::optional<discordpp::CallInfoHandle> LobbyHandle::GetCallInfoHandle() const
8066{
8067 assert(state_ == DiscordObjectState::Owned);
8068 bool returnIsNonNull__;
8069 Discord_CallInfoHandle returnValueNative__;
8070 returnIsNonNull__ = Discord_LobbyHandle_GetCallInfoHandle(&instance_, &returnValueNative__);
8071 if (!returnIsNonNull__) {
8072 return {};
8073 }
8074 discordpp::CallInfoHandle returnValue__(returnValueNative__, DiscordObjectState::Owned);
8075 return returnValue__;
8076}
8077std::optional<discordpp::LobbyMemberHandle> LobbyHandle::GetLobbyMemberHandle(
8078 uint64_t memberId) const
8079{
8080 assert(state_ == DiscordObjectState::Owned);
8081 bool returnIsNonNull__;
8082 Discord_LobbyMemberHandle returnValueNative__;
8083 returnIsNonNull__ =
8084 Discord_LobbyHandle_GetLobbyMemberHandle(&instance_, memberId, &returnValueNative__);
8085 if (!returnIsNonNull__) {
8086 return {};
8087 }
8088 discordpp::LobbyMemberHandle returnValue__(returnValueNative__, DiscordObjectState::Owned);
8089 return returnValue__;
8090}
8091uint64_t LobbyHandle::Id() const
8092{
8093 assert(state_ == DiscordObjectState::Owned);
8094 uint64_t returnValue__;
8095 returnValue__ = Discord_LobbyHandle_Id(&instance_);
8096 return returnValue__;
8097}
8098std::optional<discordpp::LinkedChannel> LobbyHandle::LinkedChannel() const
8099{
8100 assert(state_ == DiscordObjectState::Owned);
8101 bool returnIsNonNull__;
8102 Discord_LinkedChannel returnValueNative__;
8103 returnIsNonNull__ = Discord_LobbyHandle_LinkedChannel(&instance_, &returnValueNative__);
8104 if (!returnIsNonNull__) {
8105 return {};
8106 }
8107 discordpp::LinkedChannel returnValue__(returnValueNative__, DiscordObjectState::Owned);
8108 return returnValue__;
8109}
8110std::vector<uint64_t> LobbyHandle::LobbyMemberIds() const
8111{
8112 assert(state_ == DiscordObjectState::Owned);
8113 Discord_UInt64Span returnValueNative__;
8114 Discord_LobbyHandle_LobbyMemberIds(&instance_, &returnValueNative__);
8115 std::vector<uint64_t> returnValue__(returnValueNative__.ptr,
8116 returnValueNative__.ptr + returnValueNative__.size);
8117 Discord_Free(returnValueNative__.ptr);
8118 return returnValue__;
8119}
8120std::vector<discordpp::LobbyMemberHandle> LobbyHandle::LobbyMembers() const
8121{
8122 assert(state_ == DiscordObjectState::Owned);
8123 Discord_LobbyMemberHandleSpan returnValueNative__;
8124 Discord_LobbyHandle_LobbyMembers(&instance_, &returnValueNative__);
8125 std::vector<discordpp::LobbyMemberHandle> returnValue__;
8126 returnValue__.reserve(returnValueNative__.size);
8127 for (size_t i__ = 0; i__ < returnValueNative__.size; ++i__) {
8128 returnValue__.emplace_back(returnValueNative__.ptr[i__], DiscordObjectState::Owned);
8129 }
8130 Discord_Free(returnValueNative__.ptr);
8131 return returnValue__;
8132}
8133std::unordered_map<std::string, std::string> LobbyHandle::Metadata() const
8134{
8135 assert(state_ == DiscordObjectState::Owned);
8136 Discord_Properties returnValueNative__;
8137 Discord_LobbyHandle_Metadata(&instance_, &returnValueNative__);
8138 std::unordered_map<std::string, std::string> returnValue__ =
8139 ConvertReturnedProperties(returnValueNative__);
8140 Discord_FreeProperties(returnValueNative__);
8141 return returnValue__;
8142}
8143const AdditionalContent AdditionalContent::nullobj{{}, DiscordObjectState::Invalid};
8144AdditionalContent::~AdditionalContent()
8145{
8146 if (state_ == DiscordObjectState::Owned) {
8147 Drop();
8148 state_ = DiscordObjectState::Invalid;
8149 }
8150}
8151AdditionalContent::AdditionalContent(AdditionalContent&& other) noexcept
8152 : instance_(other.instance_)
8153 , state_(other.state_)
8154{
8155 other.state_ = DiscordObjectState::Invalid;
8156}
8157AdditionalContent& AdditionalContent::operator=(AdditionalContent&& other) noexcept
8158{
8159 if (this != &other) {
8160 if (state_ == DiscordObjectState::Owned) {
8161 Drop();
8162 }
8163 instance_ = other.instance_;
8164 state_ = other.state_;
8165 other.state_ = DiscordObjectState::Invalid;
8166 }
8167 return *this;
8168}
8169AdditionalContent::AdditionalContent(const AdditionalContent& arg0)
8170 : instance_{}
8171 , state_(DiscordObjectState::Invalid)
8172{
8173 if (arg0.state_ == DiscordObjectState::Owned) {
8174 Discord_AdditionalContent_Clone(&instance_, arg0.instance());
8175
8176 state_ = DiscordObjectState::Owned;
8177 }
8178}
8179AdditionalContent& AdditionalContent::operator=(const AdditionalContent& arg0)
8180{
8181 if (this != &arg0) {
8182 if (state_ == DiscordObjectState::Owned) {
8183 Drop();
8184 state_ = DiscordObjectState::Invalid;
8185 }
8186 if (arg0.state_ == DiscordObjectState::Owned) {
8187 Discord_AdditionalContent_Clone(&instance_, arg0.instance());
8188
8189 state_ = DiscordObjectState::Owned;
8190 }
8191 }
8192 return *this;
8193}
8194AdditionalContent::AdditionalContent(Discord_AdditionalContent instance, DiscordObjectState state)
8195 : instance_(instance)
8196 , state_(state)
8197{
8198}
8199AdditionalContent::AdditionalContent()
8200{
8201 assert(state_ == DiscordObjectState::Invalid);
8202 Discord_AdditionalContent_Init(&instance_);
8203 state_ = DiscordObjectState::Owned;
8204}
8205void AdditionalContent::Drop()
8206{
8207 if (state_ != DiscordObjectState::Owned) {
8208 return;
8209 }
8210 Discord_AdditionalContent_Drop(&instance_);
8211 state_ = DiscordObjectState::Invalid;
8212}
8213bool AdditionalContent::Equals(discordpp::AdditionalContent rhs) const
8214{
8215 assert(state_ == DiscordObjectState::Owned);
8216 bool returnValue__;
8217 returnValue__ = Discord_AdditionalContent_Equals(&instance_, rhs.instance());
8218 return returnValue__;
8219}
8220std::string AdditionalContent::TypeToString(discordpp::AdditionalContentType type)
8221{
8222 Discord_String returnValueNative__;
8223 Discord_AdditionalContent_TypeToString(static_cast<Discord_AdditionalContentType>(type),
8224 &returnValueNative__);
8225 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
8226 returnValueNative__.size);
8227 Discord_Free(returnValueNative__.ptr);
8228 return returnValue__;
8229}
8230discordpp::AdditionalContentType AdditionalContent::Type() const
8231{
8232 assert(state_ == DiscordObjectState::Owned);
8233 Discord_AdditionalContentType returnValue__;
8234 returnValue__ = Discord_AdditionalContent_Type(&instance_);
8235 return static_cast<discordpp::AdditionalContentType>(returnValue__);
8236}
8237void AdditionalContent::SetType(discordpp::AdditionalContentType Type)
8238{
8239 assert(state_ == DiscordObjectState::Owned);
8240 Discord_AdditionalContent_SetType(&instance_, static_cast<Discord_AdditionalContentType>(Type));
8241}
8242std::optional<std::string> AdditionalContent::Title() const
8243{
8244 assert(state_ == DiscordObjectState::Owned);
8245 bool returnIsNonNull__;
8246 Discord_String returnValueNative__;
8247 returnIsNonNull__ = Discord_AdditionalContent_Title(&instance_, &returnValueNative__);
8248 if (!returnIsNonNull__) {
8249 return {};
8250 }
8251 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
8252 returnValueNative__.size);
8253 Discord_Free(returnValueNative__.ptr);
8254 return returnValue__;
8255}
8256void AdditionalContent::SetTitle(std::optional<std::string> Title)
8257{
8258 assert(state_ == DiscordObjectState::Owned);
8259 Discord_String Title__str{};
8260 if (Title.has_value()) {
8261 Title__str.ptr = reinterpret_cast<uint8_t*>(Title->data());
8262 Title__str.size = Title->size();
8263 }
8264 Discord_AdditionalContent_SetTitle(&instance_, (Title.has_value() ? &Title__str : nullptr));
8265}
8266uint8_t AdditionalContent::Count() const
8267{
8268 assert(state_ == DiscordObjectState::Owned);
8269 uint8_t returnValue__;
8270 returnValue__ = Discord_AdditionalContent_Count(&instance_);
8271 return returnValue__;
8272}
8273void AdditionalContent::SetCount(uint8_t Count)
8274{
8275 assert(state_ == DiscordObjectState::Owned);
8276 Discord_AdditionalContent_SetCount(&instance_, Count);
8277}
8278const MessageHandle MessageHandle::nullobj{{}, DiscordObjectState::Invalid};
8279MessageHandle::~MessageHandle()
8280{
8281 if (state_ == DiscordObjectState::Owned) {
8282 Drop();
8283 state_ = DiscordObjectState::Invalid;
8284 }
8285}
8286MessageHandle::MessageHandle(MessageHandle&& other) noexcept
8287 : instance_(other.instance_)
8288 , state_(other.state_)
8289{
8290 other.state_ = DiscordObjectState::Invalid;
8291}
8292MessageHandle& MessageHandle::operator=(MessageHandle&& other) noexcept
8293{
8294 if (this != &other) {
8295 if (state_ == DiscordObjectState::Owned) {
8296 Drop();
8297 }
8298 instance_ = other.instance_;
8299 state_ = other.state_;
8300 other.state_ = DiscordObjectState::Invalid;
8301 }
8302 return *this;
8303}
8304MessageHandle::MessageHandle(const MessageHandle& other)
8305 : instance_{}
8306 , state_(DiscordObjectState::Invalid)
8307{
8308 if (other.state_ == DiscordObjectState::Owned) {
8309 Discord_MessageHandle_Clone(&instance_, other.instance());
8310
8311 state_ = DiscordObjectState::Owned;
8312 }
8313}
8314MessageHandle& MessageHandle::operator=(const MessageHandle& other)
8315{
8316 if (this != &other) {
8317 if (state_ == DiscordObjectState::Owned) {
8318 Drop();
8319 state_ = DiscordObjectState::Invalid;
8320 }
8321 if (other.state_ == DiscordObjectState::Owned) {
8322 Discord_MessageHandle_Clone(&instance_, other.instance());
8323
8324 state_ = DiscordObjectState::Owned;
8325 }
8326 }
8327 return *this;
8328}
8329MessageHandle::MessageHandle(Discord_MessageHandle instance, DiscordObjectState state)
8330 : instance_(instance)
8331 , state_(state)
8332{
8333}
8334void MessageHandle::Drop()
8335{
8336 if (state_ != DiscordObjectState::Owned) {
8337 return;
8338 }
8339 Discord_MessageHandle_Drop(&instance_);
8340 state_ = DiscordObjectState::Invalid;
8341}
8342std::optional<discordpp::AdditionalContent> MessageHandle::AdditionalContent() const
8343{
8344 assert(state_ == DiscordObjectState::Owned);
8345 bool returnIsNonNull__;
8346 Discord_AdditionalContent returnValueNative__;
8347 returnIsNonNull__ = Discord_MessageHandle_AdditionalContent(&instance_, &returnValueNative__);
8348 if (!returnIsNonNull__) {
8349 return {};
8350 }
8351 discordpp::AdditionalContent returnValue__(returnValueNative__, DiscordObjectState::Owned);
8352 return returnValue__;
8353}
8354std::optional<discordpp::UserHandle> MessageHandle::Author() const
8355{
8356 assert(state_ == DiscordObjectState::Owned);
8357 bool returnIsNonNull__;
8358 Discord_UserHandle returnValueNative__;
8359 returnIsNonNull__ = Discord_MessageHandle_Author(&instance_, &returnValueNative__);
8360 if (!returnIsNonNull__) {
8361 return {};
8362 }
8363 discordpp::UserHandle returnValue__(returnValueNative__, DiscordObjectState::Owned);
8364 return returnValue__;
8365}
8366uint64_t MessageHandle::AuthorId() const
8367{
8368 assert(state_ == DiscordObjectState::Owned);
8369 uint64_t returnValue__;
8370 returnValue__ = Discord_MessageHandle_AuthorId(&instance_);
8371 return returnValue__;
8372}
8373std::optional<discordpp::ChannelHandle> MessageHandle::Channel() const
8374{
8375 assert(state_ == DiscordObjectState::Owned);
8376 bool returnIsNonNull__;
8377 Discord_ChannelHandle returnValueNative__;
8378 returnIsNonNull__ = Discord_MessageHandle_Channel(&instance_, &returnValueNative__);
8379 if (!returnIsNonNull__) {
8380 return {};
8381 }
8382 discordpp::ChannelHandle returnValue__(returnValueNative__, DiscordObjectState::Owned);
8383 return returnValue__;
8384}
8385uint64_t MessageHandle::ChannelId() const
8386{
8387 assert(state_ == DiscordObjectState::Owned);
8388 uint64_t returnValue__;
8389 returnValue__ = Discord_MessageHandle_ChannelId(&instance_);
8390 return returnValue__;
8391}
8392std::string MessageHandle::Content() const
8393{
8394 assert(state_ == DiscordObjectState::Owned);
8395 Discord_String returnValueNative__;
8396 Discord_MessageHandle_Content(&instance_, &returnValueNative__);
8397 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
8398 returnValueNative__.size);
8399 Discord_Free(returnValueNative__.ptr);
8400 return returnValue__;
8401}
8402std::optional<discordpp::DisclosureTypes> MessageHandle::DisclosureType() const
8403{
8404 assert(state_ == DiscordObjectState::Owned);
8405 bool returnIsNonNull__;
8406 Discord_DisclosureTypes returnValueNative__;
8407 returnIsNonNull__ = Discord_MessageHandle_DisclosureType(&instance_, &returnValueNative__);
8408 if (!returnIsNonNull__) {
8409 return {};
8410 }
8411 auto returnValue__ = static_cast<discordpp::DisclosureTypes>(returnValueNative__);
8412 return returnValue__;
8413}
8414uint64_t MessageHandle::EditedTimestamp() const
8415{
8416 assert(state_ == DiscordObjectState::Owned);
8417 uint64_t returnValue__;
8418 returnValue__ = Discord_MessageHandle_EditedTimestamp(&instance_);
8419 return returnValue__;
8420}
8421uint64_t MessageHandle::Id() const
8422{
8423 assert(state_ == DiscordObjectState::Owned);
8424 uint64_t returnValue__;
8425 returnValue__ = Discord_MessageHandle_Id(&instance_);
8426 return returnValue__;
8427}
8428std::optional<discordpp::LobbyHandle> MessageHandle::Lobby() const
8429{
8430 assert(state_ == DiscordObjectState::Owned);
8431 bool returnIsNonNull__;
8432 Discord_LobbyHandle returnValueNative__;
8433 returnIsNonNull__ = Discord_MessageHandle_Lobby(&instance_, &returnValueNative__);
8434 if (!returnIsNonNull__) {
8435 return {};
8436 }
8437 discordpp::LobbyHandle returnValue__(returnValueNative__, DiscordObjectState::Owned);
8438 return returnValue__;
8439}
8440std::unordered_map<std::string, std::string> MessageHandle::Metadata() const
8441{
8442 assert(state_ == DiscordObjectState::Owned);
8443 Discord_Properties returnValueNative__;
8444 Discord_MessageHandle_Metadata(&instance_, &returnValueNative__);
8445 std::unordered_map<std::string, std::string> returnValue__ =
8446 ConvertReturnedProperties(returnValueNative__);
8447 Discord_FreeProperties(returnValueNative__);
8448 return returnValue__;
8449}
8450std::string MessageHandle::RawContent() const
8451{
8452 assert(state_ == DiscordObjectState::Owned);
8453 Discord_String returnValueNative__;
8454 Discord_MessageHandle_RawContent(&instance_, &returnValueNative__);
8455 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
8456 returnValueNative__.size);
8457 Discord_Free(returnValueNative__.ptr);
8458 return returnValue__;
8459}
8460std::optional<discordpp::UserHandle> MessageHandle::Recipient() const
8461{
8462 assert(state_ == DiscordObjectState::Owned);
8463 bool returnIsNonNull__;
8464 Discord_UserHandle returnValueNative__;
8465 returnIsNonNull__ = Discord_MessageHandle_Recipient(&instance_, &returnValueNative__);
8466 if (!returnIsNonNull__) {
8467 return {};
8468 }
8469 discordpp::UserHandle returnValue__(returnValueNative__, DiscordObjectState::Owned);
8470 return returnValue__;
8471}
8472uint64_t MessageHandle::RecipientId() const
8473{
8474 assert(state_ == DiscordObjectState::Owned);
8475 uint64_t returnValue__;
8476 returnValue__ = Discord_MessageHandle_RecipientId(&instance_);
8477 return returnValue__;
8478}
8479bool MessageHandle::SentFromGame() const
8480{
8481 assert(state_ == DiscordObjectState::Owned);
8482 bool returnValue__;
8483 returnValue__ = Discord_MessageHandle_SentFromGame(&instance_);
8484 return returnValue__;
8485}
8486uint64_t MessageHandle::SentTimestamp() const
8487{
8488 assert(state_ == DiscordObjectState::Owned);
8489 uint64_t returnValue__;
8490 returnValue__ = Discord_MessageHandle_SentTimestamp(&instance_);
8491 return returnValue__;
8492}
8493const AudioDevice AudioDevice::nullobj{{}, DiscordObjectState::Invalid};
8494AudioDevice::~AudioDevice()
8495{
8496 if (state_ == DiscordObjectState::Owned) {
8497 Drop();
8498 state_ = DiscordObjectState::Invalid;
8499 }
8500}
8501AudioDevice::AudioDevice(AudioDevice&& other) noexcept
8502 : instance_(other.instance_)
8503 , state_(other.state_)
8504{
8505 other.state_ = DiscordObjectState::Invalid;
8506}
8507AudioDevice& AudioDevice::operator=(AudioDevice&& other) noexcept
8508{
8509 if (this != &other) {
8510 if (state_ == DiscordObjectState::Owned) {
8511 Drop();
8512 }
8513 instance_ = other.instance_;
8514 state_ = other.state_;
8515 other.state_ = DiscordObjectState::Invalid;
8516 }
8517 return *this;
8518}
8519AudioDevice::AudioDevice(const AudioDevice& arg0)
8520 : instance_{}
8521 , state_(DiscordObjectState::Invalid)
8522{
8523 if (arg0.state_ == DiscordObjectState::Owned) {
8524 Discord_AudioDevice_Clone(&instance_, arg0.instance());
8525
8526 state_ = DiscordObjectState::Owned;
8527 }
8528}
8529AudioDevice& AudioDevice::operator=(const AudioDevice& arg0)
8530{
8531 if (this != &arg0) {
8532 if (state_ == DiscordObjectState::Owned) {
8533 Drop();
8534 state_ = DiscordObjectState::Invalid;
8535 }
8536 if (arg0.state_ == DiscordObjectState::Owned) {
8537 Discord_AudioDevice_Clone(&instance_, arg0.instance());
8538
8539 state_ = DiscordObjectState::Owned;
8540 }
8541 }
8542 return *this;
8543}
8544AudioDevice::AudioDevice(Discord_AudioDevice instance, DiscordObjectState state)
8545 : instance_(instance)
8546 , state_(state)
8547{
8548}
8549void AudioDevice::Drop()
8550{
8551 if (state_ != DiscordObjectState::Owned) {
8552 return;
8553 }
8554 Discord_AudioDevice_Drop(&instance_);
8555 state_ = DiscordObjectState::Invalid;
8556}
8557bool AudioDevice::Equals(discordpp::AudioDevice rhs)
8558{
8559 assert(state_ == DiscordObjectState::Owned);
8560 bool returnValue__;
8561 returnValue__ = Discord_AudioDevice_Equals(&instance_, rhs.instance());
8562 return returnValue__;
8563}
8564std::string AudioDevice::Id() const
8565{
8566 assert(state_ == DiscordObjectState::Owned);
8567 Discord_String returnValueNative__;
8568 Discord_AudioDevice_Id(&instance_, &returnValueNative__);
8569 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
8570 returnValueNative__.size);
8571 Discord_Free(returnValueNative__.ptr);
8572 return returnValue__;
8573}
8574void AudioDevice::SetId(std::string Id)
8575{
8576 assert(state_ == DiscordObjectState::Owned);
8577 Discord_String Id__str{(uint8_t*)(Id.data()), Id.size()};
8578 Discord_AudioDevice_SetId(&instance_, Id__str);
8579}
8580std::string AudioDevice::Name() const
8581{
8582 assert(state_ == DiscordObjectState::Owned);
8583 Discord_String returnValueNative__;
8584 Discord_AudioDevice_Name(&instance_, &returnValueNative__);
8585 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
8586 returnValueNative__.size);
8587 Discord_Free(returnValueNative__.ptr);
8588 return returnValue__;
8589}
8590void AudioDevice::SetName(std::string Name)
8591{
8592 assert(state_ == DiscordObjectState::Owned);
8593 Discord_String Name__str{(uint8_t*)(Name.data()), Name.size()};
8594 Discord_AudioDevice_SetName(&instance_, Name__str);
8595}
8596bool AudioDevice::IsDefault() const
8597{
8598 assert(state_ == DiscordObjectState::Owned);
8599 bool returnValue__;
8600 returnValue__ = Discord_AudioDevice_IsDefault(&instance_);
8601 return returnValue__;
8602}
8603void AudioDevice::SetIsDefault(bool IsDefault)
8604{
8605 assert(state_ == DiscordObjectState::Owned);
8606 Discord_AudioDevice_SetIsDefault(&instance_, IsDefault);
8607}
8608const Client Client::nullobj{{}, DiscordObjectState::Invalid};
8609Client::~Client()
8610{
8611 if (state_ == DiscordObjectState::Owned) {
8612 Drop();
8613 state_ = DiscordObjectState::Invalid;
8614 }
8615}
8616Client::Client(Client&& other) noexcept
8617 : instance_(other.instance_)
8618 , state_(other.state_)
8619{
8620 other.state_ = DiscordObjectState::Invalid;
8621}
8622Client& Client::operator=(Client&& other) noexcept
8623{
8624 if (this != &other) {
8625 if (state_ == DiscordObjectState::Owned) {
8626 Drop();
8627 }
8628 instance_ = other.instance_;
8629 state_ = other.state_;
8630 other.state_ = DiscordObjectState::Invalid;
8631 }
8632 return *this;
8633}
8634Client::Client(Discord_Client instance, DiscordObjectState state)
8635 : instance_(instance)
8636 , state_(state)
8637{
8638}
8639Client::Client()
8640{
8641 assert(state_ == DiscordObjectState::Invalid);
8642 Discord_Client_Init(&instance_);
8643 state_ = DiscordObjectState::Owned;
8644}
8645Client::Client(std::string apiBase, std::string webBase)
8646{
8647 assert(state_ == DiscordObjectState::Invalid);
8648 Discord_String apiBase__str{(uint8_t*)(apiBase.data()), apiBase.size()};
8649 Discord_String webBase__str{(uint8_t*)(webBase.data()), webBase.size()};
8650 Discord_Client_InitWithBases(&instance_, apiBase__str, webBase__str);
8651 state_ = DiscordObjectState::Owned;
8652}
8653void Client::Drop()
8654{
8655 if (state_ != DiscordObjectState::Owned) {
8656 return;
8657 }
8658 Discord_Client_Drop(&instance_);
8659 state_ = DiscordObjectState::Invalid;
8660}
8661std::string Client::ErrorToString(discordpp::Client::Error type)
8662{
8663 Discord_String returnValueNative__;
8664 Discord_Client_ErrorToString(static_cast<Discord_Client_Error>(type), &returnValueNative__);
8665 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
8666 returnValueNative__.size);
8667 Discord_Free(returnValueNative__.ptr);
8668 return returnValue__;
8669}
8670uint64_t Client::GetApplicationId()
8671{
8672 assert(state_ == DiscordObjectState::Owned);
8673 uint64_t returnValue__;
8674 returnValue__ = Discord_Client_GetApplicationId(&instance_);
8675 return returnValue__;
8676}
8677std::string Client::GetDefaultAudioDeviceId()
8678{
8679 Discord_String returnValueNative__;
8680 Discord_Client_GetDefaultAudioDeviceId(&returnValueNative__);
8681 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
8682 returnValueNative__.size);
8683 Discord_Free(returnValueNative__.ptr);
8684 return returnValue__;
8685}
8686std::string Client::GetDefaultCommunicationScopes()
8687{
8688 Discord_String returnValueNative__;
8689 Discord_Client_GetDefaultCommunicationScopes(&returnValueNative__);
8690 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
8691 returnValueNative__.size);
8692 Discord_Free(returnValueNative__.ptr);
8693 return returnValue__;
8694}
8695std::string Client::GetDefaultPresenceScopes()
8696{
8697 Discord_String returnValueNative__;
8698 Discord_Client_GetDefaultPresenceScopes(&returnValueNative__);
8699 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
8700 returnValueNative__.size);
8701 Discord_Free(returnValueNative__.ptr);
8702 return returnValue__;
8703}
8704std::string Client::GetVersionHash()
8705{
8706 Discord_String returnValueNative__;
8707 Discord_Client_GetVersionHash(&returnValueNative__);
8708 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
8709 returnValueNative__.size);
8710 Discord_Free(returnValueNative__.ptr);
8711 return returnValue__;
8712}
8713int32_t Client::GetVersionMajor()
8714{
8715 int32_t returnValue__;
8716 returnValue__ = Discord_Client_GetVersionMajor();
8717 return returnValue__;
8718}
8719int32_t Client::GetVersionMinor()
8720{
8721 int32_t returnValue__;
8722 returnValue__ = Discord_Client_GetVersionMinor();
8723 return returnValue__;
8724}
8725int32_t Client::GetVersionPatch()
8726{
8727 int32_t returnValue__;
8728 returnValue__ = Discord_Client_GetVersionPatch();
8729 return returnValue__;
8730}
8731std::string Client::StatusToString(discordpp::Client::Status type)
8732{
8733 Discord_String returnValueNative__;
8734 Discord_Client_StatusToString(static_cast<Discord_Client_Status>(type), &returnValueNative__);
8735 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
8736 returnValueNative__.size);
8737 Discord_Free(returnValueNative__.ptr);
8738 return returnValue__;
8739}
8740std::string Client::ThreadToString(discordpp::Client::Thread type)
8741{
8742 Discord_String returnValueNative__;
8743 Discord_Client_ThreadToString(static_cast<Discord_Client_Thread>(type), &returnValueNative__);
8744 std::string returnValue__(reinterpret_cast<char*>(returnValueNative__.ptr),
8745 returnValueNative__.size);
8746 Discord_Free(returnValueNative__.ptr);
8747 return returnValue__;
8748}
8749void Client::EndCall(uint64_t channelId, discordpp::Client::EndCallCallback callback)
8750{
8751 assert(state_ == DiscordObjectState::Owned);
8752 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
8753 auto callback__userData = new Tcallback__UserData(callback);
8754 Discord_Client_EndCallCallback callback__native = [](void* userData__) {
8755 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
8756 userData__typed->delegate();
8757 };
8758 Discord_Client_EndCall(
8759 &instance_, channelId, callback__native, Tcallback__UserData::Free, callback__userData);
8760}
8761void Client::EndCalls(discordpp::Client::EndCallsCallback callback)
8762{
8763 assert(state_ == DiscordObjectState::Owned);
8764 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
8765 auto callback__userData = new Tcallback__UserData(callback);
8766 Discord_Client_EndCallsCallback callback__native = [](void* userData__) {
8767 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
8768 userData__typed->delegate();
8769 };
8770 Discord_Client_EndCalls(
8771 &instance_, callback__native, Tcallback__UserData::Free, callback__userData);
8772}
8773discordpp::Call Client::GetCall(uint64_t channelId)
8774{
8775 assert(state_ == DiscordObjectState::Owned);
8776 bool returnIsNonNull__;
8777 Discord_Call returnValueNative__{};
8778 returnIsNonNull__ = Discord_Client_GetCall(&instance_, channelId, &returnValueNative__);
8779 discordpp::Call returnValue__(
8780 returnValueNative__,
8781 returnIsNonNull__ ? DiscordObjectState::Owned : DiscordObjectState::Invalid);
8782 return returnValue__;
8783}
8784std::vector<discordpp::Call> Client::GetCalls()
8785{
8786 assert(state_ == DiscordObjectState::Owned);
8787 Discord_CallSpan returnValueNative__;
8788 Discord_Client_GetCalls(&instance_, &returnValueNative__);
8789 std::vector<discordpp::Call> returnValue__;
8790 returnValue__.reserve(returnValueNative__.size);
8791 for (size_t i__ = 0; i__ < returnValueNative__.size; ++i__) {
8792 returnValue__.emplace_back(returnValueNative__.ptr[i__], DiscordObjectState::Owned);
8793 }
8794 Discord_Free(returnValueNative__.ptr);
8795 return returnValue__;
8796}
8797void Client::GetCurrentInputDevice(discordpp::Client::GetCurrentInputDeviceCallback cb)
8798{
8799 assert(state_ == DiscordObjectState::Owned);
8800 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
8801 auto cb__userData = new Tcb__UserData(cb);
8802 Discord_Client_GetCurrentInputDeviceCallback cb__native = [](auto device, void* userData__) {
8803 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
8804 discordpp::AudioDevice device__obj(*device, DiscordObjectState::Owned);
8805 userData__typed->delegate(std::move(device__obj));
8806 };
8807 Discord_Client_GetCurrentInputDevice(&instance_, cb__native, Tcb__UserData::Free, cb__userData);
8808}
8809void Client::GetCurrentOutputDevice(discordpp::Client::GetCurrentOutputDeviceCallback cb)
8810{
8811 assert(state_ == DiscordObjectState::Owned);
8812 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
8813 auto cb__userData = new Tcb__UserData(cb);
8814 Discord_Client_GetCurrentOutputDeviceCallback cb__native = [](auto device, void* userData__) {
8815 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
8816 discordpp::AudioDevice device__obj(*device, DiscordObjectState::Owned);
8817 userData__typed->delegate(std::move(device__obj));
8818 };
8819 Discord_Client_GetCurrentOutputDevice(
8820 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
8821}
8822void Client::GetInputDevices(discordpp::Client::GetInputDevicesCallback cb)
8823{
8824 assert(state_ == DiscordObjectState::Owned);
8825 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
8826 auto cb__userData = new Tcb__UserData(cb);
8827 Discord_Client_GetInputDevicesCallback cb__native = [](auto devices, void* userData__) {
8828 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
8829 std::vector<discordpp::AudioDevice> devices__vec;
8830 devices__vec.reserve(devices.size);
8831 for (size_t i__ = 0; i__ < devices.size; ++i__) {
8832 devices__vec.emplace_back(devices.ptr[i__], DiscordObjectState::Owned);
8833 }
8834 Discord_Free(devices.ptr);
8835 userData__typed->delegate(std::move(devices__vec));
8836 };
8837 Discord_Client_GetInputDevices(&instance_, cb__native, Tcb__UserData::Free, cb__userData);
8838}
8839float Client::GetInputVolume()
8840{
8841 assert(state_ == DiscordObjectState::Owned);
8842 float returnValue__;
8843 returnValue__ = Discord_Client_GetInputVolume(&instance_);
8844 return returnValue__;
8845}
8846void Client::GetOutputDevices(discordpp::Client::GetOutputDevicesCallback cb)
8847{
8848 assert(state_ == DiscordObjectState::Owned);
8849 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
8850 auto cb__userData = new Tcb__UserData(cb);
8851 Discord_Client_GetOutputDevicesCallback cb__native = [](auto devices, void* userData__) {
8852 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
8853 std::vector<discordpp::AudioDevice> devices__vec;
8854 devices__vec.reserve(devices.size);
8855 for (size_t i__ = 0; i__ < devices.size; ++i__) {
8856 devices__vec.emplace_back(devices.ptr[i__], DiscordObjectState::Owned);
8857 }
8858 Discord_Free(devices.ptr);
8859 userData__typed->delegate(std::move(devices__vec));
8860 };
8861 Discord_Client_GetOutputDevices(&instance_, cb__native, Tcb__UserData::Free, cb__userData);
8862}
8863float Client::GetOutputVolume()
8864{
8865 assert(state_ == DiscordObjectState::Owned);
8866 float returnValue__;
8867 returnValue__ = Discord_Client_GetOutputVolume(&instance_);
8868 return returnValue__;
8869}
8870bool Client::GetSelfDeafAll() const
8871{
8872 assert(state_ == DiscordObjectState::Owned);
8873 bool returnValue__;
8874 returnValue__ = Discord_Client_GetSelfDeafAll(&instance_);
8875 return returnValue__;
8876}
8877bool Client::GetSelfMuteAll() const
8878{
8879 assert(state_ == DiscordObjectState::Owned);
8880 bool returnValue__;
8881 returnValue__ = Discord_Client_GetSelfMuteAll(&instance_);
8882 return returnValue__;
8883}
8884void Client::SetAutomaticGainControl(bool on)
8885{
8886 assert(state_ == DiscordObjectState::Owned);
8887 Discord_Client_SetAutomaticGainControl(&instance_, on);
8888}
8889void Client::SetDeviceChangeCallback(discordpp::Client::DeviceChangeCallback callback)
8890{
8891 assert(state_ == DiscordObjectState::Owned);
8892 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
8893 auto callback__userData = new Tcallback__UserData(callback);
8894 Discord_Client_DeviceChangeCallback callback__native =
8895 [](auto inputDevices, auto outputDevices, void* userData__) {
8896 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
8897 std::vector<discordpp::AudioDevice> inputDevices__vec;
8898 inputDevices__vec.reserve(inputDevices.size);
8899 for (size_t i__ = 0; i__ < inputDevices.size; ++i__) {
8900 inputDevices__vec.emplace_back(inputDevices.ptr[i__], DiscordObjectState::Owned);
8901 }
8902 Discord_Free(inputDevices.ptr);
8903 std::vector<discordpp::AudioDevice> outputDevices__vec;
8904 outputDevices__vec.reserve(outputDevices.size);
8905 for (size_t i__ = 0; i__ < outputDevices.size; ++i__) {
8906 outputDevices__vec.emplace_back(outputDevices.ptr[i__], DiscordObjectState::Owned);
8907 }
8908 Discord_Free(outputDevices.ptr);
8909 userData__typed->delegate(std::move(inputDevices__vec), std::move(outputDevices__vec));
8910 };
8911 Discord_Client_SetDeviceChangeCallback(
8912 &instance_, callback__native, Tcallback__UserData::Free, callback__userData);
8913}
8914void Client::SetEchoCancellation(bool on)
8915{
8916 assert(state_ == DiscordObjectState::Owned);
8917 Discord_Client_SetEchoCancellation(&instance_, on);
8918}
8919void Client::SetInputDevice(std::string deviceId, discordpp::Client::SetInputDeviceCallback cb)
8920{
8921 assert(state_ == DiscordObjectState::Owned);
8922 Discord_String deviceId__str{(uint8_t*)(deviceId.data()), deviceId.size()};
8923 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
8924 auto cb__userData = new Tcb__UserData(cb);
8925 Discord_Client_SetInputDeviceCallback cb__native = [](auto result, void* userData__) {
8926 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
8927 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
8928 userData__typed->delegate(std::move(result__obj));
8929 };
8930 Discord_Client_SetInputDevice(
8931 &instance_, deviceId__str, cb__native, Tcb__UserData::Free, cb__userData);
8932}
8933void Client::SetInputVolume(float inputVolume)
8934{
8935 assert(state_ == DiscordObjectState::Owned);
8936 Discord_Client_SetInputVolume(&instance_, inputVolume);
8937}
8938void Client::SetNoAudioInputCallback(discordpp::Client::NoAudioInputCallback callback)
8939{
8940 assert(state_ == DiscordObjectState::Owned);
8941 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
8942 auto callback__userData = new Tcallback__UserData(callback);
8943 Discord_Client_NoAudioInputCallback callback__native = [](auto inputDetected,
8944 void* userData__) {
8945 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
8946 userData__typed->delegate(inputDetected);
8947 };
8948 Discord_Client_SetNoAudioInputCallback(
8949 &instance_, callback__native, Tcallback__UserData::Free, callback__userData);
8950}
8951void Client::SetNoAudioInputThreshold(float dBFSThreshold)
8952{
8953 assert(state_ == DiscordObjectState::Owned);
8954 Discord_Client_SetNoAudioInputThreshold(&instance_, dBFSThreshold);
8955}
8956void Client::SetNoiseSuppression(bool on)
8957{
8958 assert(state_ == DiscordObjectState::Owned);
8959 Discord_Client_SetNoiseSuppression(&instance_, on);
8960}
8961void Client::SetOpusHardwareCoding(bool encode, bool decode)
8962{
8963 assert(state_ == DiscordObjectState::Owned);
8964 Discord_Client_SetOpusHardwareCoding(&instance_, encode, decode);
8965}
8966void Client::SetOutputDevice(std::string deviceId, discordpp::Client::SetOutputDeviceCallback cb)
8967{
8968 assert(state_ == DiscordObjectState::Owned);
8969 Discord_String deviceId__str{(uint8_t*)(deviceId.data()), deviceId.size()};
8970 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
8971 auto cb__userData = new Tcb__UserData(cb);
8972 Discord_Client_SetOutputDeviceCallback cb__native = [](auto result, void* userData__) {
8973 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
8974 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
8975 userData__typed->delegate(std::move(result__obj));
8976 };
8977 Discord_Client_SetOutputDevice(
8978 &instance_, deviceId__str, cb__native, Tcb__UserData::Free, cb__userData);
8979}
8980void Client::SetOutputVolume(float outputVolume)
8981{
8982 assert(state_ == DiscordObjectState::Owned);
8983 Discord_Client_SetOutputVolume(&instance_, outputVolume);
8984}
8985void Client::SetSelfDeafAll(bool deaf)
8986{
8987 assert(state_ == DiscordObjectState::Owned);
8988 Discord_Client_SetSelfDeafAll(&instance_, deaf);
8989}
8990void Client::SetSelfMuteAll(bool mute)
8991{
8992 assert(state_ == DiscordObjectState::Owned);
8993 Discord_Client_SetSelfMuteAll(&instance_, mute);
8994}
8995bool Client::SetSpeakerMode(bool speakerMode)
8996{
8997 assert(state_ == DiscordObjectState::Owned);
8998 bool returnValue__;
8999 returnValue__ = Discord_Client_SetSpeakerMode(&instance_, speakerMode);
9000 return returnValue__;
9001}
9002void Client::SetThreadPriority(discordpp::Client::Thread thread, int32_t priority)
9003{
9004 assert(state_ == DiscordObjectState::Owned);
9005 Discord_Client_SetThreadPriority(
9006 &instance_, static_cast<Discord_Client_Thread>(thread), priority);
9007}
9008void Client::SetVoiceParticipantChangedCallback(
9010{
9011 assert(state_ == DiscordObjectState::Owned);
9012 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
9013 auto cb__userData = new Tcb__UserData(cb);
9014 Discord_Client_VoiceParticipantChangedCallback cb__native =
9015 [](auto lobbyId, auto memberId, auto added, void* userData__) {
9016 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
9017 userData__typed->delegate(lobbyId, memberId, added);
9018 };
9019 Discord_Client_SetVoiceParticipantChangedCallback(
9020 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
9021}
9022bool Client::ShowAudioRoutePicker()
9023{
9024 assert(state_ == DiscordObjectState::Owned);
9025 bool returnValue__;
9026 returnValue__ = Discord_Client_ShowAudioRoutePicker(&instance_);
9027 return returnValue__;
9028}
9029discordpp::Call Client::StartCall(uint64_t channelId)
9030{
9031 assert(state_ == DiscordObjectState::Owned);
9032 bool returnIsNonNull__;
9033 Discord_Call returnValueNative__{};
9034 returnIsNonNull__ = Discord_Client_StartCall(&instance_, channelId, &returnValueNative__);
9035 discordpp::Call returnValue__(
9036 returnValueNative__,
9037 returnIsNonNull__ ? DiscordObjectState::Owned : DiscordObjectState::Invalid);
9038 return returnValue__;
9039}
9040discordpp::Call Client::StartCallWithAudioCallbacks(
9041 uint64_t lobbyId,
9044{
9045 assert(state_ == DiscordObjectState::Owned);
9046 bool returnIsNonNull__;
9047 Discord_Call returnValueNative__{};
9048 using TreceivedCb__UserData = TDelegateUserData<std::remove_reference_t<decltype(receivedCb)>>;
9049 auto receivedCb__userData = new TreceivedCb__UserData(receivedCb);
9050 Discord_Client_UserAudioReceivedCallback receivedCb__native = [](auto userId,
9051 auto data,
9052 auto samplesPerChannel,
9053 auto sampleRate,
9054 auto channels,
9055 auto outShouldMute,
9056 void* userData__) {
9057 auto userData__typed = static_cast<TreceivedCb__UserData*>(userData__);
9058 userData__typed->delegate(
9059 userId, data, samplesPerChannel, sampleRate, channels, *outShouldMute);
9060 };
9061 using TcapturedCb__UserData = TDelegateUserData<std::remove_reference_t<decltype(capturedCb)>>;
9062 auto capturedCb__userData = new TcapturedCb__UserData(capturedCb);
9063 Discord_Client_UserAudioCapturedCallback capturedCb__native =
9064 [](auto data, auto samplesPerChannel, auto sampleRate, auto channels, void* userData__) {
9065 auto userData__typed = static_cast<TcapturedCb__UserData*>(userData__);
9066 userData__typed->delegate(data, samplesPerChannel, sampleRate, channels);
9067 };
9068 returnIsNonNull__ = Discord_Client_StartCallWithAudioCallbacks(&instance_,
9069 lobbyId,
9070 receivedCb__native,
9071 TreceivedCb__UserData::Free,
9072 receivedCb__userData,
9073 capturedCb__native,
9074 TcapturedCb__UserData::Free,
9075 capturedCb__userData,
9076 &returnValueNative__);
9077 discordpp::Call returnValue__(
9078 returnValueNative__,
9079 returnIsNonNull__ ? DiscordObjectState::Owned : DiscordObjectState::Invalid);
9080 return returnValue__;
9081}
9082void Client::AbortAuthorize()
9083{
9084 assert(state_ == DiscordObjectState::Owned);
9085 Discord_Client_AbortAuthorize(&instance_);
9086}
9087void Client::AbortGetTokenFromDevice()
9088{
9089 assert(state_ == DiscordObjectState::Owned);
9090 Discord_Client_AbortGetTokenFromDevice(&instance_);
9091}
9092void Client::Authorize(discordpp::AuthorizationArgs args,
9094{
9095 assert(state_ == DiscordObjectState::Owned);
9096 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
9097 auto callback__userData = new Tcallback__UserData(callback);
9098 Discord_Client_AuthorizationCallback callback__native =
9099 [](auto result, auto code, auto redirectUri, void* userData__) {
9100 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
9101 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
9102 std::string code__str(reinterpret_cast<char*>(code.ptr), code.size);
9103 std::string redirectUri__str(reinterpret_cast<char*>(redirectUri.ptr), redirectUri.size);
9104 userData__typed->delegate(
9105 std::move(result__obj), std::move(code__str), std::move(redirectUri__str));
9106 Discord_Free(redirectUri.ptr);
9107 Discord_Free(code.ptr);
9108 };
9109 Discord_Client_Authorize(
9110 &instance_, args.instance(), callback__native, Tcallback__UserData::Free, callback__userData);
9111}
9112void Client::CloseAuthorizeDeviceScreen()
9113{
9114 assert(state_ == DiscordObjectState::Owned);
9115 Discord_Client_CloseAuthorizeDeviceScreen(&instance_);
9116}
9117discordpp::AuthorizationCodeVerifier Client::CreateAuthorizationCodeVerifier()
9118{
9119 assert(state_ == DiscordObjectState::Owned);
9120 Discord_AuthorizationCodeVerifier returnValueNative__{};
9121 Discord_Client_CreateAuthorizationCodeVerifier(&instance_, &returnValueNative__);
9122 discordpp::AuthorizationCodeVerifier returnValue__(returnValueNative__,
9123 DiscordObjectState::Owned);
9124 return returnValue__;
9125}
9126void Client::FetchCurrentUser(discordpp::AuthorizationTokenType tokenType,
9127 std::string const& token,
9129{
9130 assert(state_ == DiscordObjectState::Owned);
9131 Discord_String token__str{(uint8_t*)(token.data()), token.size()};
9132 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
9133 auto callback__userData = new Tcallback__UserData(callback);
9134 Discord_Client_FetchCurrentUserCallback callback__native =
9135 [](auto result, auto id, auto name, void* userData__) {
9136 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
9137 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
9138 std::string name__str(reinterpret_cast<char*>(name.ptr), name.size);
9139 userData__typed->delegate(std::move(result__obj), id, std::move(name__str));
9140 Discord_Free(name.ptr);
9141 };
9142 Discord_Client_FetchCurrentUser(&instance_,
9143 static_cast<Discord_AuthorizationTokenType>(tokenType),
9144 token__str,
9145 callback__native,
9146 Tcallback__UserData::Free,
9147 callback__userData);
9148}
9149void Client::GetProvisionalToken(uint64_t applicationId,
9151 std::string const& externalAuthToken,
9153{
9154 assert(state_ == DiscordObjectState::Owned);
9155 Discord_String externalAuthToken__str{(uint8_t*)(externalAuthToken.data()),
9156 externalAuthToken.size()};
9157 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
9158 auto callback__userData = new Tcallback__UserData(callback);
9159 Discord_Client_TokenExchangeCallback callback__native = [](auto result,
9160 auto accessToken,
9161 auto refreshToken,
9162 auto tokenType,
9163 auto expiresIn,
9164 auto scopes,
9165 void* userData__) {
9166 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
9167 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
9168 std::string accessToken__str(reinterpret_cast<char*>(accessToken.ptr), accessToken.size);
9169 std::string refreshToken__str(reinterpret_cast<char*>(refreshToken.ptr), refreshToken.size);
9170 std::string scopes__str(reinterpret_cast<char*>(scopes.ptr), scopes.size);
9171 userData__typed->delegate(std::move(result__obj),
9172 std::move(accessToken__str),
9173 std::move(refreshToken__str),
9174 static_cast<discordpp::AuthorizationTokenType>(tokenType),
9175 expiresIn,
9176 std::move(scopes__str));
9177 Discord_Free(scopes.ptr);
9178 Discord_Free(refreshToken.ptr);
9179 Discord_Free(accessToken.ptr);
9180 };
9181 Discord_Client_GetProvisionalToken(
9182 &instance_,
9183 applicationId,
9184 static_cast<Discord_AuthenticationExternalAuthType>(externalAuthType),
9185 externalAuthToken__str,
9186 callback__native,
9187 Tcallback__UserData::Free,
9188 callback__userData);
9189}
9190void Client::GetToken(uint64_t applicationId,
9191 std::string const& code,
9192 std::string const& codeVerifier,
9193 std::string const& redirectUri,
9195{
9196 assert(state_ == DiscordObjectState::Owned);
9197 Discord_String code__str{(uint8_t*)(code.data()), code.size()};
9198 Discord_String codeVerifier__str{(uint8_t*)(codeVerifier.data()), codeVerifier.size()};
9199 Discord_String redirectUri__str{(uint8_t*)(redirectUri.data()), redirectUri.size()};
9200 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
9201 auto callback__userData = new Tcallback__UserData(callback);
9202 Discord_Client_TokenExchangeCallback callback__native = [](auto result,
9203 auto accessToken,
9204 auto refreshToken,
9205 auto tokenType,
9206 auto expiresIn,
9207 auto scopes,
9208 void* userData__) {
9209 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
9210 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
9211 std::string accessToken__str(reinterpret_cast<char*>(accessToken.ptr), accessToken.size);
9212 std::string refreshToken__str(reinterpret_cast<char*>(refreshToken.ptr), refreshToken.size);
9213 std::string scopes__str(reinterpret_cast<char*>(scopes.ptr), scopes.size);
9214 userData__typed->delegate(std::move(result__obj),
9215 std::move(accessToken__str),
9216 std::move(refreshToken__str),
9217 static_cast<discordpp::AuthorizationTokenType>(tokenType),
9218 expiresIn,
9219 std::move(scopes__str));
9220 Discord_Free(scopes.ptr);
9221 Discord_Free(refreshToken.ptr);
9222 Discord_Free(accessToken.ptr);
9223 };
9224 Discord_Client_GetToken(&instance_,
9225 applicationId,
9226 code__str,
9227 codeVerifier__str,
9228 redirectUri__str,
9229 callback__native,
9230 Tcallback__UserData::Free,
9231 callback__userData);
9232}
9233void Client::GetTokenFromDevice(discordpp::DeviceAuthorizationArgs args,
9235{
9236 assert(state_ == DiscordObjectState::Owned);
9237 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
9238 auto callback__userData = new Tcallback__UserData(callback);
9239 Discord_Client_TokenExchangeCallback callback__native = [](auto result,
9240 auto accessToken,
9241 auto refreshToken,
9242 auto tokenType,
9243 auto expiresIn,
9244 auto scopes,
9245 void* userData__) {
9246 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
9247 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
9248 std::string accessToken__str(reinterpret_cast<char*>(accessToken.ptr), accessToken.size);
9249 std::string refreshToken__str(reinterpret_cast<char*>(refreshToken.ptr), refreshToken.size);
9250 std::string scopes__str(reinterpret_cast<char*>(scopes.ptr), scopes.size);
9251 userData__typed->delegate(std::move(result__obj),
9252 std::move(accessToken__str),
9253 std::move(refreshToken__str),
9254 static_cast<discordpp::AuthorizationTokenType>(tokenType),
9255 expiresIn,
9256 std::move(scopes__str));
9257 Discord_Free(scopes.ptr);
9258 Discord_Free(refreshToken.ptr);
9259 Discord_Free(accessToken.ptr);
9260 };
9261 Discord_Client_GetTokenFromDevice(
9262 &instance_, args.instance(), callback__native, Tcallback__UserData::Free, callback__userData);
9263}
9264void Client::GetTokenFromDeviceProvisionalMerge(
9267 std::string const& externalAuthToken,
9269{
9270 assert(state_ == DiscordObjectState::Owned);
9271 Discord_String externalAuthToken__str{(uint8_t*)(externalAuthToken.data()),
9272 externalAuthToken.size()};
9273 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
9274 auto callback__userData = new Tcallback__UserData(callback);
9275 Discord_Client_TokenExchangeCallback callback__native = [](auto result,
9276 auto accessToken,
9277 auto refreshToken,
9278 auto tokenType,
9279 auto expiresIn,
9280 auto scopes,
9281 void* userData__) {
9282 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
9283 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
9284 std::string accessToken__str(reinterpret_cast<char*>(accessToken.ptr), accessToken.size);
9285 std::string refreshToken__str(reinterpret_cast<char*>(refreshToken.ptr), refreshToken.size);
9286 std::string scopes__str(reinterpret_cast<char*>(scopes.ptr), scopes.size);
9287 userData__typed->delegate(std::move(result__obj),
9288 std::move(accessToken__str),
9289 std::move(refreshToken__str),
9290 static_cast<discordpp::AuthorizationTokenType>(tokenType),
9291 expiresIn,
9292 std::move(scopes__str));
9293 Discord_Free(scopes.ptr);
9294 Discord_Free(refreshToken.ptr);
9295 Discord_Free(accessToken.ptr);
9296 };
9297 Discord_Client_GetTokenFromDeviceProvisionalMerge(
9298 &instance_,
9299 args.instance(),
9300 static_cast<Discord_AuthenticationExternalAuthType>(externalAuthType),
9301 externalAuthToken__str,
9302 callback__native,
9303 Tcallback__UserData::Free,
9304 callback__userData);
9305}
9306void Client::GetTokenFromProvisionalMerge(
9307 uint64_t applicationId,
9308 std::string const& code,
9309 std::string const& codeVerifier,
9310 std::string const& redirectUri,
9312 std::string const& externalAuthToken,
9314{
9315 assert(state_ == DiscordObjectState::Owned);
9316 Discord_String code__str{(uint8_t*)(code.data()), code.size()};
9317 Discord_String codeVerifier__str{(uint8_t*)(codeVerifier.data()), codeVerifier.size()};
9318 Discord_String redirectUri__str{(uint8_t*)(redirectUri.data()), redirectUri.size()};
9319 Discord_String externalAuthToken__str{(uint8_t*)(externalAuthToken.data()),
9320 externalAuthToken.size()};
9321 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
9322 auto callback__userData = new Tcallback__UserData(callback);
9323 Discord_Client_TokenExchangeCallback callback__native = [](auto result,
9324 auto accessToken,
9325 auto refreshToken,
9326 auto tokenType,
9327 auto expiresIn,
9328 auto scopes,
9329 void* userData__) {
9330 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
9331 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
9332 std::string accessToken__str(reinterpret_cast<char*>(accessToken.ptr), accessToken.size);
9333 std::string refreshToken__str(reinterpret_cast<char*>(refreshToken.ptr), refreshToken.size);
9334 std::string scopes__str(reinterpret_cast<char*>(scopes.ptr), scopes.size);
9335 userData__typed->delegate(std::move(result__obj),
9336 std::move(accessToken__str),
9337 std::move(refreshToken__str),
9338 static_cast<discordpp::AuthorizationTokenType>(tokenType),
9339 expiresIn,
9340 std::move(scopes__str));
9341 Discord_Free(scopes.ptr);
9342 Discord_Free(refreshToken.ptr);
9343 Discord_Free(accessToken.ptr);
9344 };
9345 Discord_Client_GetTokenFromProvisionalMerge(
9346 &instance_,
9347 applicationId,
9348 code__str,
9349 codeVerifier__str,
9350 redirectUri__str,
9351 static_cast<Discord_AuthenticationExternalAuthType>(externalAuthType),
9352 externalAuthToken__str,
9353 callback__native,
9354 Tcallback__UserData::Free,
9355 callback__userData);
9356}
9357bool Client::IsAuthenticated()
9358{
9359 assert(state_ == DiscordObjectState::Owned);
9360 bool returnValue__;
9361 returnValue__ = Discord_Client_IsAuthenticated(&instance_);
9362 return returnValue__;
9363}
9364void Client::OpenAuthorizeDeviceScreen(uint64_t clientId, std::string const& userCode)
9365{
9366 assert(state_ == DiscordObjectState::Owned);
9367 Discord_String userCode__str{(uint8_t*)(userCode.data()), userCode.size()};
9368 Discord_Client_OpenAuthorizeDeviceScreen(&instance_, clientId, userCode__str);
9369}
9370void Client::ProvisionalUserMergeCompleted(bool success)
9371{
9372 assert(state_ == DiscordObjectState::Owned);
9373 Discord_Client_ProvisionalUserMergeCompleted(&instance_, success);
9374}
9375void Client::RefreshToken(uint64_t applicationId,
9376 std::string const& refreshToken,
9378{
9379 assert(state_ == DiscordObjectState::Owned);
9380 Discord_String refreshToken__str{(uint8_t*)(refreshToken.data()), refreshToken.size()};
9381 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
9382 auto callback__userData = new Tcallback__UserData(callback);
9383 Discord_Client_TokenExchangeCallback callback__native = [](auto result,
9384 auto accessToken,
9385 auto refreshToken,
9386 auto tokenType,
9387 auto expiresIn,
9388 auto scopes,
9389 void* userData__) {
9390 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
9391 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
9392 std::string accessToken__str(reinterpret_cast<char*>(accessToken.ptr), accessToken.size);
9393 std::string refreshToken__str(reinterpret_cast<char*>(refreshToken.ptr), refreshToken.size);
9394 std::string scopes__str(reinterpret_cast<char*>(scopes.ptr), scopes.size);
9395 userData__typed->delegate(std::move(result__obj),
9396 std::move(accessToken__str),
9397 std::move(refreshToken__str),
9398 static_cast<discordpp::AuthorizationTokenType>(tokenType),
9399 expiresIn,
9400 std::move(scopes__str));
9401 Discord_Free(scopes.ptr);
9402 Discord_Free(refreshToken.ptr);
9403 Discord_Free(accessToken.ptr);
9404 };
9405 Discord_Client_RefreshToken(&instance_,
9406 applicationId,
9407 refreshToken__str,
9408 callback__native,
9409 Tcallback__UserData::Free,
9410 callback__userData);
9411}
9412void Client::SetAuthorizeDeviceScreenClosedCallback(
9414{
9415 assert(state_ == DiscordObjectState::Owned);
9416 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
9417 auto cb__userData = new Tcb__UserData(cb);
9418 Discord_Client_AuthorizeDeviceScreenClosedCallback cb__native = [](void* userData__) {
9419 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
9420 userData__typed->delegate();
9421 };
9422 Discord_Client_SetAuthorizeDeviceScreenClosedCallback(
9423 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
9424}
9425void Client::SetGameWindowPid(int32_t pid)
9426{
9427 assert(state_ == DiscordObjectState::Owned);
9428 Discord_Client_SetGameWindowPid(&instance_, pid);
9429}
9430void Client::SetTokenExpirationCallback(discordpp::Client::TokenExpirationCallback callback)
9431{
9432 assert(state_ == DiscordObjectState::Owned);
9433 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
9434 auto callback__userData = new Tcallback__UserData(callback);
9435 Discord_Client_TokenExpirationCallback callback__native = [](void* userData__) {
9436 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
9437 userData__typed->delegate();
9438 };
9439 Discord_Client_SetTokenExpirationCallback(
9440 &instance_, callback__native, Tcallback__UserData::Free, callback__userData);
9441}
9442void Client::UpdateProvisionalAccountDisplayName(
9443 std::string const& name,
9445{
9446 assert(state_ == DiscordObjectState::Owned);
9447 Discord_String name__str{(uint8_t*)(name.data()), name.size()};
9448 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
9449 auto callback__userData = new Tcallback__UserData(callback);
9450 Discord_Client_UpdateProvisionalAccountDisplayNameCallback callback__native =
9451 [](auto result, void* userData__) {
9452 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
9453 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
9454 userData__typed->delegate(std::move(result__obj));
9455 };
9456 Discord_Client_UpdateProvisionalAccountDisplayName(
9457 &instance_, name__str, callback__native, Tcallback__UserData::Free, callback__userData);
9458}
9459void Client::UpdateToken(discordpp::AuthorizationTokenType tokenType,
9460 std::string token,
9462{
9463 assert(state_ == DiscordObjectState::Owned);
9464 Discord_String token__str{(uint8_t*)(token.data()), token.size()};
9465 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
9466 auto callback__userData = new Tcallback__UserData(callback);
9467 Discord_Client_UpdateTokenCallback callback__native = [](auto result, void* userData__) {
9468 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
9469 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
9470 userData__typed->delegate(std::move(result__obj));
9471 };
9472 Discord_Client_UpdateToken(&instance_,
9473 static_cast<Discord_AuthorizationTokenType>(tokenType),
9474 token__str,
9475 callback__native,
9476 Tcallback__UserData::Free,
9477 callback__userData);
9478}
9479bool Client::CanOpenMessageInDiscord(uint64_t messageId)
9480{
9481 assert(state_ == DiscordObjectState::Owned);
9482 bool returnValue__;
9483 returnValue__ = Discord_Client_CanOpenMessageInDiscord(&instance_, messageId);
9484 return returnValue__;
9485}
9486void Client::DeleteUserMessage(uint64_t recipientId,
9487 uint64_t messageId,
9489{
9490 assert(state_ == DiscordObjectState::Owned);
9491 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
9492 auto cb__userData = new Tcb__UserData(cb);
9493 Discord_Client_DeleteUserMessageCallback cb__native = [](auto result, void* userData__) {
9494 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
9495 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
9496 userData__typed->delegate(std::move(result__obj));
9497 };
9498 Discord_Client_DeleteUserMessage(
9499 &instance_, recipientId, messageId, cb__native, Tcb__UserData::Free, cb__userData);
9500}
9501void Client::EditUserMessage(uint64_t recipientId,
9502 uint64_t messageId,
9503 std::string const& content,
9505{
9506 assert(state_ == DiscordObjectState::Owned);
9507 Discord_String content__str{(uint8_t*)(content.data()), content.size()};
9508 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
9509 auto cb__userData = new Tcb__UserData(cb);
9510 Discord_Client_EditUserMessageCallback cb__native = [](auto result, void* userData__) {
9511 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
9512 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
9513 userData__typed->delegate(std::move(result__obj));
9514 };
9515 Discord_Client_EditUserMessage(&instance_,
9516 recipientId,
9517 messageId,
9518 content__str,
9519 cb__native,
9520 Tcb__UserData::Free,
9521 cb__userData);
9522}
9523std::optional<discordpp::ChannelHandle> Client::GetChannelHandle(uint64_t channelId) const
9524{
9525 assert(state_ == DiscordObjectState::Owned);
9526 bool returnIsNonNull__;
9527 Discord_ChannelHandle returnValueNative__;
9528 returnIsNonNull__ =
9529 Discord_Client_GetChannelHandle(&instance_, channelId, &returnValueNative__);
9530 if (!returnIsNonNull__) {
9531 return {};
9532 }
9533 discordpp::ChannelHandle returnValue__(returnValueNative__, DiscordObjectState::Owned);
9534 return returnValue__;
9535}
9536std::optional<discordpp::MessageHandle> Client::GetMessageHandle(uint64_t messageId) const
9537{
9538 assert(state_ == DiscordObjectState::Owned);
9539 bool returnIsNonNull__;
9540 Discord_MessageHandle returnValueNative__;
9541 returnIsNonNull__ =
9542 Discord_Client_GetMessageHandle(&instance_, messageId, &returnValueNative__);
9543 if (!returnIsNonNull__) {
9544 return {};
9545 }
9546 discordpp::MessageHandle returnValue__(returnValueNative__, DiscordObjectState::Owned);
9547 return returnValue__;
9548}
9549void Client::OpenMessageInDiscord(
9550 uint64_t messageId,
9551 discordpp::Client::ProvisionalUserMergeRequiredCallback provisionalUserMergeRequiredCallback,
9553{
9554 assert(state_ == DiscordObjectState::Owned);
9555 using TprovisionalUserMergeRequiredCallback__UserData =
9556 TDelegateUserData<std::remove_reference_t<decltype(provisionalUserMergeRequiredCallback)>>;
9557 auto provisionalUserMergeRequiredCallback__userData =
9558 new TprovisionalUserMergeRequiredCallback__UserData(provisionalUserMergeRequiredCallback);
9559 Discord_Client_ProvisionalUserMergeRequiredCallback
9560 provisionalUserMergeRequiredCallback__native = [](void* userData__) {
9561 auto userData__typed =
9562 static_cast<TprovisionalUserMergeRequiredCallback__UserData*>(userData__);
9563 userData__typed->delegate();
9564 };
9565 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
9566 auto callback__userData = new Tcallback__UserData(callback);
9567 Discord_Client_OpenMessageInDiscordCallback callback__native = [](auto result,
9568 void* userData__) {
9569 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
9570 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
9571 userData__typed->delegate(std::move(result__obj));
9572 };
9573 Discord_Client_OpenMessageInDiscord(&instance_,
9574 messageId,
9575 provisionalUserMergeRequiredCallback__native,
9576 TprovisionalUserMergeRequiredCallback__UserData::Free,
9577 provisionalUserMergeRequiredCallback__userData,
9578 callback__native,
9579 Tcallback__UserData::Free,
9580 callback__userData);
9581}
9582void Client::SendLobbyMessage(uint64_t lobbyId,
9583 std::string const& content,
9585{
9586 assert(state_ == DiscordObjectState::Owned);
9587 Discord_String content__str{(uint8_t*)(content.data()), content.size()};
9588 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
9589 auto cb__userData = new Tcb__UserData(cb);
9590 Discord_Client_SendUserMessageCallback cb__native =
9591 [](auto result, auto messageId, void* userData__) {
9592 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
9593 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
9594 userData__typed->delegate(std::move(result__obj), messageId);
9595 };
9596 Discord_Client_SendLobbyMessage(
9597 &instance_, lobbyId, content__str, cb__native, Tcb__UserData::Free, cb__userData);
9598}
9599void Client::SendLobbyMessageWithMetadata(
9600 uint64_t lobbyId,
9601 std::string const& content,
9602 std::unordered_map<std::string, std::string> const& metadata,
9604{
9605 assert(state_ == DiscordObjectState::Owned);
9606 Discord_String content__str{(uint8_t*)(content.data()), content.size()};
9607 ConvertedProperties metadata__convert(metadata);
9608 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
9609 auto cb__userData = new Tcb__UserData(cb);
9610 Discord_Client_SendUserMessageCallback cb__native =
9611 [](auto result, auto messageId, void* userData__) {
9612 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
9613 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
9614 userData__typed->delegate(std::move(result__obj), messageId);
9615 };
9616 Discord_Client_SendLobbyMessageWithMetadata(&instance_,
9617 lobbyId,
9618 content__str,
9619 metadata__convert.Properties,
9620 cb__native,
9621 Tcb__UserData::Free,
9622 cb__userData);
9623}
9624void Client::SendUserMessage(uint64_t recipientId,
9625 std::string const& content,
9627{
9628 assert(state_ == DiscordObjectState::Owned);
9629 Discord_String content__str{(uint8_t*)(content.data()), content.size()};
9630 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
9631 auto cb__userData = new Tcb__UserData(cb);
9632 Discord_Client_SendUserMessageCallback cb__native =
9633 [](auto result, auto messageId, void* userData__) {
9634 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
9635 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
9636 userData__typed->delegate(std::move(result__obj), messageId);
9637 };
9638 Discord_Client_SendUserMessage(
9639 &instance_, recipientId, content__str, cb__native, Tcb__UserData::Free, cb__userData);
9640}
9641void Client::SendUserMessageWithMetadata(
9642 uint64_t recipientId,
9643 std::string const& content,
9644 std::unordered_map<std::string, std::string> const& metadata,
9646{
9647 assert(state_ == DiscordObjectState::Owned);
9648 Discord_String content__str{(uint8_t*)(content.data()), content.size()};
9649 ConvertedProperties metadata__convert(metadata);
9650 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
9651 auto cb__userData = new Tcb__UserData(cb);
9652 Discord_Client_SendUserMessageCallback cb__native =
9653 [](auto result, auto messageId, void* userData__) {
9654 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
9655 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
9656 userData__typed->delegate(std::move(result__obj), messageId);
9657 };
9658 Discord_Client_SendUserMessageWithMetadata(&instance_,
9659 recipientId,
9660 content__str,
9661 metadata__convert.Properties,
9662 cb__native,
9663 Tcb__UserData::Free,
9664 cb__userData);
9665}
9666void Client::SetMessageCreatedCallback(discordpp::Client::MessageCreatedCallback cb)
9667{
9668 assert(state_ == DiscordObjectState::Owned);
9669 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
9670 auto cb__userData = new Tcb__UserData(cb);
9671 Discord_Client_MessageCreatedCallback cb__native = [](auto messageId, void* userData__) {
9672 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
9673 userData__typed->delegate(messageId);
9674 };
9675 Discord_Client_SetMessageCreatedCallback(
9676 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
9677}
9678void Client::SetMessageDeletedCallback(discordpp::Client::MessageDeletedCallback cb)
9679{
9680 assert(state_ == DiscordObjectState::Owned);
9681 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
9682 auto cb__userData = new Tcb__UserData(cb);
9683 Discord_Client_MessageDeletedCallback cb__native =
9684 [](auto messageId, auto channelId, void* userData__) {
9685 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
9686 userData__typed->delegate(messageId, channelId);
9687 };
9688 Discord_Client_SetMessageDeletedCallback(
9689 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
9690}
9691void Client::SetMessageUpdatedCallback(discordpp::Client::MessageUpdatedCallback cb)
9692{
9693 assert(state_ == DiscordObjectState::Owned);
9694 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
9695 auto cb__userData = new Tcb__UserData(cb);
9696 Discord_Client_MessageUpdatedCallback cb__native = [](auto messageId, void* userData__) {
9697 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
9698 userData__typed->delegate(messageId);
9699 };
9700 Discord_Client_SetMessageUpdatedCallback(
9701 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
9702}
9703void Client::SetShowingChat(bool showingChat)
9704{
9705 assert(state_ == DiscordObjectState::Owned);
9706 Discord_Client_SetShowingChat(&instance_, showingChat);
9707}
9708void Client::AddLogCallback(discordpp::Client::LogCallback callback,
9709 discordpp::LoggingSeverity minSeverity)
9710{
9711 assert(state_ == DiscordObjectState::Owned);
9712 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
9713 auto callback__userData = new Tcallback__UserData(callback);
9714 Discord_Client_LogCallback callback__native = [](
9715 auto message, auto severity, void* userData__) {
9716 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
9717 std::string message__str(reinterpret_cast<char*>(message.ptr), message.size);
9718 userData__typed->delegate(std::move(message__str),
9719 static_cast<discordpp::LoggingSeverity>(severity));
9720 Discord_Free(message.ptr);
9721 };
9722 Discord_Client_AddLogCallback(&instance_,
9723 callback__native,
9724 Tcallback__UserData::Free,
9725 callback__userData,
9726 static_cast<Discord_LoggingSeverity>(minSeverity));
9727}
9728void Client::AddVoiceLogCallback(discordpp::Client::LogCallback callback,
9729 discordpp::LoggingSeverity minSeverity)
9730{
9731 assert(state_ == DiscordObjectState::Owned);
9732 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
9733 auto callback__userData = new Tcallback__UserData(callback);
9734 Discord_Client_LogCallback callback__native = [](
9735 auto message, auto severity, void* userData__) {
9736 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
9737 std::string message__str(reinterpret_cast<char*>(message.ptr), message.size);
9738 userData__typed->delegate(std::move(message__str),
9739 static_cast<discordpp::LoggingSeverity>(severity));
9740 Discord_Free(message.ptr);
9741 };
9742 Discord_Client_AddVoiceLogCallback(&instance_,
9743 callback__native,
9744 Tcallback__UserData::Free,
9745 callback__userData,
9746 static_cast<Discord_LoggingSeverity>(minSeverity));
9747}
9748void Client::Connect()
9749{
9750 assert(state_ == DiscordObjectState::Owned);
9751 Discord_Client_Connect(&instance_);
9752}
9753void Client::Disconnect()
9754{
9755 assert(state_ == DiscordObjectState::Owned);
9756 Discord_Client_Disconnect(&instance_);
9757}
9758discordpp::Client::Status Client::GetStatus() const
9759{
9760 assert(state_ == DiscordObjectState::Owned);
9761 Discord_Client_Status returnValue__;
9762 returnValue__ = Discord_Client_GetStatus(&instance_);
9763 return static_cast<discordpp::Client::Status>(returnValue__);
9764}
9765void Client::SetApplicationId(uint64_t applicationId)
9766{
9767 assert(state_ == DiscordObjectState::Owned);
9768 Discord_Client_SetApplicationId(&instance_, applicationId);
9769}
9770bool Client::SetLogDir(std::string const& path, discordpp::LoggingSeverity minSeverity)
9771{
9772 assert(state_ == DiscordObjectState::Owned);
9773 bool returnValue__;
9774 Discord_String path__str{(uint8_t*)(path.data()), path.size()};
9775 returnValue__ = Discord_Client_SetLogDir(
9776 &instance_, path__str, static_cast<Discord_LoggingSeverity>(minSeverity));
9777 return returnValue__;
9778}
9779void Client::SetStatusChangedCallback(discordpp::Client::OnStatusChanged cb)
9780{
9781 assert(state_ == DiscordObjectState::Owned);
9782 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
9783 auto cb__userData = new Tcb__UserData(cb);
9784 Discord_Client_OnStatusChanged cb__native =
9785 [](auto status, auto error, auto errorDetail, void* userData__) {
9786 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
9787 userData__typed->delegate(static_cast<discordpp::Client::Status>(status),
9788 static_cast<discordpp::Client::Error>(error),
9789 errorDetail);
9790 };
9791 Discord_Client_SetStatusChangedCallback(
9792 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
9793}
9794void Client::SetVoiceLogDir(std::string const& path, discordpp::LoggingSeverity minSeverity)
9795{
9796 assert(state_ == DiscordObjectState::Owned);
9797 Discord_String path__str{(uint8_t*)(path.data()), path.size()};
9798 Discord_Client_SetVoiceLogDir(
9799 &instance_, path__str, static_cast<Discord_LoggingSeverity>(minSeverity));
9800}
9801void Client::CreateOrJoinLobby(std::string const& secret,
9803{
9804 assert(state_ == DiscordObjectState::Owned);
9805 Discord_String secret__str{(uint8_t*)(secret.data()), secret.size()};
9806 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
9807 auto callback__userData = new Tcallback__UserData(callback);
9808 Discord_Client_CreateOrJoinLobbyCallback callback__native =
9809 [](auto result, auto lobbyId, void* userData__) {
9810 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
9811 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
9812 userData__typed->delegate(std::move(result__obj), lobbyId);
9813 };
9814 Discord_Client_CreateOrJoinLobby(
9815 &instance_, secret__str, callback__native, Tcallback__UserData::Free, callback__userData);
9816}
9817void Client::CreateOrJoinLobbyWithMetadata(
9818 std::string const& secret,
9819 std::unordered_map<std::string, std::string> const& lobbyMetadata,
9820 std::unordered_map<std::string, std::string> const& memberMetadata,
9822{
9823 assert(state_ == DiscordObjectState::Owned);
9824 Discord_String secret__str{(uint8_t*)(secret.data()), secret.size()};
9825 ConvertedProperties lobbyMetadata__convert(lobbyMetadata);
9826 ConvertedProperties memberMetadata__convert(memberMetadata);
9827 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
9828 auto callback__userData = new Tcallback__UserData(callback);
9829 Discord_Client_CreateOrJoinLobbyCallback callback__native =
9830 [](auto result, auto lobbyId, void* userData__) {
9831 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
9832 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
9833 userData__typed->delegate(std::move(result__obj), lobbyId);
9834 };
9835 Discord_Client_CreateOrJoinLobbyWithMetadata(&instance_,
9836 secret__str,
9837 lobbyMetadata__convert.Properties,
9838 memberMetadata__convert.Properties,
9839 callback__native,
9840 Tcallback__UserData::Free,
9841 callback__userData);
9842}
9843void Client::GetGuildChannels(uint64_t guildId, discordpp::Client::GetGuildChannelsCallback cb)
9844{
9845 assert(state_ == DiscordObjectState::Owned);
9846 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
9847 auto cb__userData = new Tcb__UserData(cb);
9848 Discord_Client_GetGuildChannelsCallback cb__native =
9849 [](auto result, auto guildChannels, void* userData__) {
9850 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
9851 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
9852 std::vector<discordpp::GuildChannel> guildChannels__vec;
9853 guildChannels__vec.reserve(guildChannels.size);
9854 for (size_t i__ = 0; i__ < guildChannels.size; ++i__) {
9855 guildChannels__vec.emplace_back(guildChannels.ptr[i__], DiscordObjectState::Owned);
9856 }
9857 Discord_Free(guildChannels.ptr);
9858 userData__typed->delegate(std::move(result__obj), std::move(guildChannels__vec));
9859 };
9860 Discord_Client_GetGuildChannels(
9861 &instance_, guildId, cb__native, Tcb__UserData::Free, cb__userData);
9862}
9863std::optional<discordpp::LobbyHandle> Client::GetLobbyHandle(uint64_t lobbyId) const
9864{
9865 assert(state_ == DiscordObjectState::Owned);
9866 bool returnIsNonNull__;
9867 Discord_LobbyHandle returnValueNative__;
9868 returnIsNonNull__ = Discord_Client_GetLobbyHandle(&instance_, lobbyId, &returnValueNative__);
9869 if (!returnIsNonNull__) {
9870 return {};
9871 }
9872 discordpp::LobbyHandle returnValue__(returnValueNative__, DiscordObjectState::Owned);
9873 return returnValue__;
9874}
9875std::vector<uint64_t> Client::GetLobbyIds() const
9876{
9877 assert(state_ == DiscordObjectState::Owned);
9878 Discord_UInt64Span returnValueNative__;
9879 Discord_Client_GetLobbyIds(&instance_, &returnValueNative__);
9880 std::vector<uint64_t> returnValue__(returnValueNative__.ptr,
9881 returnValueNative__.ptr + returnValueNative__.size);
9882 Discord_Free(returnValueNative__.ptr);
9883 return returnValue__;
9884}
9885void Client::GetUserGuilds(discordpp::Client::GetUserGuildsCallback cb)
9886{
9887 assert(state_ == DiscordObjectState::Owned);
9888 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
9889 auto cb__userData = new Tcb__UserData(cb);
9890 Discord_Client_GetUserGuildsCallback cb__native =
9891 [](auto result, auto guilds, void* userData__) {
9892 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
9893 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
9894 std::vector<discordpp::GuildMinimal> guilds__vec;
9895 guilds__vec.reserve(guilds.size);
9896 for (size_t i__ = 0; i__ < guilds.size; ++i__) {
9897 guilds__vec.emplace_back(guilds.ptr[i__], DiscordObjectState::Owned);
9898 }
9899 Discord_Free(guilds.ptr);
9900 userData__typed->delegate(std::move(result__obj), std::move(guilds__vec));
9901 };
9902 Discord_Client_GetUserGuilds(&instance_, cb__native, Tcb__UserData::Free, cb__userData);
9903}
9904void Client::LeaveLobby(uint64_t lobbyId, discordpp::Client::LeaveLobbyCallback callback)
9905{
9906 assert(state_ == DiscordObjectState::Owned);
9907 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
9908 auto callback__userData = new Tcallback__UserData(callback);
9909 Discord_Client_LeaveLobbyCallback callback__native = [](auto result, void* userData__) {
9910 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
9911 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
9912 userData__typed->delegate(std::move(result__obj));
9913 };
9914 Discord_Client_LeaveLobby(
9915 &instance_, lobbyId, callback__native, Tcallback__UserData::Free, callback__userData);
9916}
9917void Client::LinkChannelToLobby(uint64_t lobbyId,
9918 uint64_t channelId,
9920{
9921 assert(state_ == DiscordObjectState::Owned);
9922 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
9923 auto callback__userData = new Tcallback__UserData(callback);
9924 Discord_Client_LinkOrUnlinkChannelCallback callback__native = [](auto result,
9925 void* userData__) {
9926 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
9927 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
9928 userData__typed->delegate(std::move(result__obj));
9929 };
9930 Discord_Client_LinkChannelToLobby(&instance_,
9931 lobbyId,
9932 channelId,
9933 callback__native,
9934 Tcallback__UserData::Free,
9935 callback__userData);
9936}
9937void Client::SetLobbyCreatedCallback(discordpp::Client::LobbyCreatedCallback cb)
9938{
9939 assert(state_ == DiscordObjectState::Owned);
9940 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
9941 auto cb__userData = new Tcb__UserData(cb);
9942 Discord_Client_LobbyCreatedCallback cb__native = [](auto lobbyId, void* userData__) {
9943 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
9944 userData__typed->delegate(lobbyId);
9945 };
9946 Discord_Client_SetLobbyCreatedCallback(
9947 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
9948}
9949void Client::SetLobbyDeletedCallback(discordpp::Client::LobbyDeletedCallback cb)
9950{
9951 assert(state_ == DiscordObjectState::Owned);
9952 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
9953 auto cb__userData = new Tcb__UserData(cb);
9954 Discord_Client_LobbyDeletedCallback cb__native = [](auto lobbyId, void* userData__) {
9955 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
9956 userData__typed->delegate(lobbyId);
9957 };
9958 Discord_Client_SetLobbyDeletedCallback(
9959 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
9960}
9961void Client::SetLobbyMemberAddedCallback(discordpp::Client::LobbyMemberAddedCallback cb)
9962{
9963 assert(state_ == DiscordObjectState::Owned);
9964 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
9965 auto cb__userData = new Tcb__UserData(cb);
9966 Discord_Client_LobbyMemberAddedCallback cb__native =
9967 [](auto lobbyId, auto memberId, void* userData__) {
9968 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
9969 userData__typed->delegate(lobbyId, memberId);
9970 };
9971 Discord_Client_SetLobbyMemberAddedCallback(
9972 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
9973}
9974void Client::SetLobbyMemberRemovedCallback(discordpp::Client::LobbyMemberRemovedCallback cb)
9975{
9976 assert(state_ == DiscordObjectState::Owned);
9977 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
9978 auto cb__userData = new Tcb__UserData(cb);
9979 Discord_Client_LobbyMemberRemovedCallback cb__native =
9980 [](auto lobbyId, auto memberId, void* userData__) {
9981 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
9982 userData__typed->delegate(lobbyId, memberId);
9983 };
9984 Discord_Client_SetLobbyMemberRemovedCallback(
9985 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
9986}
9987void Client::SetLobbyMemberUpdatedCallback(discordpp::Client::LobbyMemberUpdatedCallback cb)
9988{
9989 assert(state_ == DiscordObjectState::Owned);
9990 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
9991 auto cb__userData = new Tcb__UserData(cb);
9992 Discord_Client_LobbyMemberUpdatedCallback cb__native =
9993 [](auto lobbyId, auto memberId, void* userData__) {
9994 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
9995 userData__typed->delegate(lobbyId, memberId);
9996 };
9997 Discord_Client_SetLobbyMemberUpdatedCallback(
9998 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
9999}
10000void Client::SetLobbyUpdatedCallback(discordpp::Client::LobbyUpdatedCallback cb)
10001{
10002 assert(state_ == DiscordObjectState::Owned);
10003 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
10004 auto cb__userData = new Tcb__UserData(cb);
10005 Discord_Client_LobbyUpdatedCallback cb__native = [](auto lobbyId, void* userData__) {
10006 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
10007 userData__typed->delegate(lobbyId);
10008 };
10009 Discord_Client_SetLobbyUpdatedCallback(
10010 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
10011}
10012void Client::UnlinkChannelFromLobby(uint64_t lobbyId,
10014{
10015 assert(state_ == DiscordObjectState::Owned);
10016 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
10017 auto callback__userData = new Tcallback__UserData(callback);
10018 Discord_Client_LinkOrUnlinkChannelCallback callback__native = [](auto result,
10019 void* userData__) {
10020 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
10021 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
10022 userData__typed->delegate(std::move(result__obj));
10023 };
10024 Discord_Client_UnlinkChannelFromLobby(
10025 &instance_, lobbyId, callback__native, Tcallback__UserData::Free, callback__userData);
10026}
10027void Client::AcceptActivityInvite(discordpp::ActivityInvite invite,
10029{
10030 assert(state_ == DiscordObjectState::Owned);
10031 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
10032 auto cb__userData = new Tcb__UserData(cb);
10033 Discord_Client_AcceptActivityInviteCallback cb__native =
10034 [](auto result, auto joinSecret, void* userData__) {
10035 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
10036 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
10037 std::string joinSecret__str(reinterpret_cast<char*>(joinSecret.ptr), joinSecret.size);
10038 userData__typed->delegate(std::move(result__obj), std::move(joinSecret__str));
10039 Discord_Free(joinSecret.ptr);
10040 };
10041 Discord_Client_AcceptActivityInvite(
10042 &instance_, invite.instance(), cb__native, Tcb__UserData::Free, cb__userData);
10043}
10044void Client::ClearRichPresence()
10045{
10046 assert(state_ == DiscordObjectState::Owned);
10047 Discord_Client_ClearRichPresence(&instance_);
10048}
10049bool Client::RegisterLaunchCommand(uint64_t applicationId, std::string command)
10050{
10051 assert(state_ == DiscordObjectState::Owned);
10052 bool returnValue__;
10053 Discord_String command__str{(uint8_t*)(command.data()), command.size()};
10054 returnValue__ = Discord_Client_RegisterLaunchCommand(&instance_, applicationId, command__str);
10055 return returnValue__;
10056}
10057bool Client::RegisterLaunchSteamApplication(uint64_t applicationId, uint32_t steamAppId)
10058{
10059 assert(state_ == DiscordObjectState::Owned);
10060 bool returnValue__;
10061 returnValue__ =
10062 Discord_Client_RegisterLaunchSteamApplication(&instance_, applicationId, steamAppId);
10063 return returnValue__;
10064}
10065void Client::SendActivityInvite(uint64_t userId,
10066 std::string const& content,
10068{
10069 assert(state_ == DiscordObjectState::Owned);
10070 Discord_String content__str{(uint8_t*)(content.data()), content.size()};
10071 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
10072 auto cb__userData = new Tcb__UserData(cb);
10073 Discord_Client_SendActivityInviteCallback cb__native = [](auto result, void* userData__) {
10074 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
10075 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
10076 userData__typed->delegate(std::move(result__obj));
10077 };
10078 Discord_Client_SendActivityInvite(
10079 &instance_, userId, content__str, cb__native, Tcb__UserData::Free, cb__userData);
10080}
10081void Client::SendActivityJoinRequest(uint64_t userId,
10083{
10084 assert(state_ == DiscordObjectState::Owned);
10085 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
10086 auto cb__userData = new Tcb__UserData(cb);
10087 Discord_Client_SendActivityInviteCallback cb__native = [](auto result, void* userData__) {
10088 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
10089 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
10090 userData__typed->delegate(std::move(result__obj));
10091 };
10092 Discord_Client_SendActivityJoinRequest(
10093 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
10094}
10095void Client::SendActivityJoinRequestReply(discordpp::ActivityInvite invite,
10097{
10098 assert(state_ == DiscordObjectState::Owned);
10099 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
10100 auto cb__userData = new Tcb__UserData(cb);
10101 Discord_Client_SendActivityInviteCallback cb__native = [](auto result, void* userData__) {
10102 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
10103 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
10104 userData__typed->delegate(std::move(result__obj));
10105 };
10106 Discord_Client_SendActivityJoinRequestReply(
10107 &instance_, invite.instance(), cb__native, Tcb__UserData::Free, cb__userData);
10108}
10109void Client::SetActivityInviteCreatedCallback(discordpp::Client::ActivityInviteCallback cb)
10110{
10111 assert(state_ == DiscordObjectState::Owned);
10112 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
10113 auto cb__userData = new Tcb__UserData(cb);
10114 Discord_Client_ActivityInviteCallback cb__native = [](auto invite, void* userData__) {
10115 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
10116 discordpp::ActivityInvite invite__obj(*invite, DiscordObjectState::Owned);
10117 userData__typed->delegate(std::move(invite__obj));
10118 };
10119 Discord_Client_SetActivityInviteCreatedCallback(
10120 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
10121}
10122void Client::SetActivityInviteUpdatedCallback(discordpp::Client::ActivityInviteCallback cb)
10123{
10124 assert(state_ == DiscordObjectState::Owned);
10125 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
10126 auto cb__userData = new Tcb__UserData(cb);
10127 Discord_Client_ActivityInviteCallback cb__native = [](auto invite, void* userData__) {
10128 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
10129 discordpp::ActivityInvite invite__obj(*invite, DiscordObjectState::Owned);
10130 userData__typed->delegate(std::move(invite__obj));
10131 };
10132 Discord_Client_SetActivityInviteUpdatedCallback(
10133 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
10134}
10135void Client::SetActivityJoinCallback(discordpp::Client::ActivityJoinCallback cb)
10136{
10137 assert(state_ == DiscordObjectState::Owned);
10138 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
10139 auto cb__userData = new Tcb__UserData(cb);
10140 Discord_Client_ActivityJoinCallback cb__native = [](auto joinSecret, void* userData__) {
10141 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
10142 std::string joinSecret__str(reinterpret_cast<char*>(joinSecret.ptr), joinSecret.size);
10143 userData__typed->delegate(std::move(joinSecret__str));
10144 Discord_Free(joinSecret.ptr);
10145 };
10146 Discord_Client_SetActivityJoinCallback(
10147 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
10148}
10149void Client::SetOnlineStatus(discordpp::StatusType status,
10151{
10152 assert(state_ == DiscordObjectState::Owned);
10153 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
10154 auto callback__userData = new Tcallback__UserData(callback);
10155 Discord_Client_UpdateStatusCallback callback__native = [](auto result, void* userData__) {
10156 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
10157 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
10158 userData__typed->delegate(std::move(result__obj));
10159 };
10160 Discord_Client_SetOnlineStatus(&instance_,
10161 static_cast<Discord_StatusType>(status),
10162 callback__native,
10163 Tcallback__UserData::Free,
10164 callback__userData);
10165}
10166void Client::UpdateRichPresence(discordpp::Activity activity,
10168{
10169 assert(state_ == DiscordObjectState::Owned);
10170 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
10171 auto cb__userData = new Tcb__UserData(cb);
10172 Discord_Client_UpdateRichPresenceCallback cb__native = [](auto result, void* userData__) {
10173 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
10174 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
10175 userData__typed->delegate(std::move(result__obj));
10176 };
10177 Discord_Client_UpdateRichPresence(
10178 &instance_, activity.instance(), cb__native, Tcb__UserData::Free, cb__userData);
10179}
10180void Client::AcceptDiscordFriendRequest(uint64_t userId,
10182{
10183 assert(state_ == DiscordObjectState::Owned);
10184 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
10185 auto cb__userData = new Tcb__UserData(cb);
10186 Discord_Client_UpdateRelationshipCallback cb__native = [](auto result, void* userData__) {
10187 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
10188 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
10189 userData__typed->delegate(std::move(result__obj));
10190 };
10191 Discord_Client_AcceptDiscordFriendRequest(
10192 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
10193}
10194void Client::AcceptGameFriendRequest(uint64_t userId,
10196{
10197 assert(state_ == DiscordObjectState::Owned);
10198 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
10199 auto cb__userData = new Tcb__UserData(cb);
10200 Discord_Client_UpdateRelationshipCallback cb__native = [](auto result, void* userData__) {
10201 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
10202 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
10203 userData__typed->delegate(std::move(result__obj));
10204 };
10205 Discord_Client_AcceptGameFriendRequest(
10206 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
10207}
10208void Client::BlockUser(uint64_t userId, discordpp::Client::UpdateRelationshipCallback cb)
10209{
10210 assert(state_ == DiscordObjectState::Owned);
10211 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
10212 auto cb__userData = new Tcb__UserData(cb);
10213 Discord_Client_UpdateRelationshipCallback cb__native = [](auto result, void* userData__) {
10214 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
10215 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
10216 userData__typed->delegate(std::move(result__obj));
10217 };
10218 Discord_Client_BlockUser(&instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
10219}
10220void Client::CancelDiscordFriendRequest(uint64_t userId,
10222{
10223 assert(state_ == DiscordObjectState::Owned);
10224 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
10225 auto cb__userData = new Tcb__UserData(cb);
10226 Discord_Client_UpdateRelationshipCallback cb__native = [](auto result, void* userData__) {
10227 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
10228 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
10229 userData__typed->delegate(std::move(result__obj));
10230 };
10231 Discord_Client_CancelDiscordFriendRequest(
10232 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
10233}
10234void Client::CancelGameFriendRequest(uint64_t userId,
10236{
10237 assert(state_ == DiscordObjectState::Owned);
10238 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
10239 auto cb__userData = new Tcb__UserData(cb);
10240 Discord_Client_UpdateRelationshipCallback cb__native = [](auto result, void* userData__) {
10241 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
10242 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
10243 userData__typed->delegate(std::move(result__obj));
10244 };
10245 Discord_Client_CancelGameFriendRequest(
10246 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
10247}
10248discordpp::RelationshipHandle Client::GetRelationshipHandle(uint64_t userId) const
10249{
10250 assert(state_ == DiscordObjectState::Owned);
10251 Discord_RelationshipHandle returnValueNative__{};
10252 Discord_Client_GetRelationshipHandle(&instance_, userId, &returnValueNative__);
10253 discordpp::RelationshipHandle returnValue__(returnValueNative__, DiscordObjectState::Owned);
10254 return returnValue__;
10255}
10256std::vector<discordpp::RelationshipHandle> Client::GetRelationships() const
10257{
10258 assert(state_ == DiscordObjectState::Owned);
10259 Discord_RelationshipHandleSpan returnValueNative__;
10260 Discord_Client_GetRelationships(&instance_, &returnValueNative__);
10261 std::vector<discordpp::RelationshipHandle> returnValue__;
10262 returnValue__.reserve(returnValueNative__.size);
10263 for (size_t i__ = 0; i__ < returnValueNative__.size; ++i__) {
10264 returnValue__.emplace_back(returnValueNative__.ptr[i__], DiscordObjectState::Owned);
10265 }
10266 Discord_Free(returnValueNative__.ptr);
10267 return returnValue__;
10268}
10269void Client::RejectDiscordFriendRequest(uint64_t userId,
10271{
10272 assert(state_ == DiscordObjectState::Owned);
10273 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
10274 auto cb__userData = new Tcb__UserData(cb);
10275 Discord_Client_UpdateRelationshipCallback cb__native = [](auto result, void* userData__) {
10276 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
10277 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
10278 userData__typed->delegate(std::move(result__obj));
10279 };
10280 Discord_Client_RejectDiscordFriendRequest(
10281 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
10282}
10283void Client::RejectGameFriendRequest(uint64_t userId,
10285{
10286 assert(state_ == DiscordObjectState::Owned);
10287 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
10288 auto cb__userData = new Tcb__UserData(cb);
10289 Discord_Client_UpdateRelationshipCallback cb__native = [](auto result, void* userData__) {
10290 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
10291 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
10292 userData__typed->delegate(std::move(result__obj));
10293 };
10294 Discord_Client_RejectGameFriendRequest(
10295 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
10296}
10297void Client::RemoveDiscordAndGameFriend(uint64_t userId,
10299{
10300 assert(state_ == DiscordObjectState::Owned);
10301 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
10302 auto cb__userData = new Tcb__UserData(cb);
10303 Discord_Client_UpdateRelationshipCallback cb__native = [](auto result, void* userData__) {
10304 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
10305 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
10306 userData__typed->delegate(std::move(result__obj));
10307 };
10308 Discord_Client_RemoveDiscordAndGameFriend(
10309 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
10310}
10311void Client::RemoveGameFriend(uint64_t userId, discordpp::Client::UpdateRelationshipCallback cb)
10312{
10313 assert(state_ == DiscordObjectState::Owned);
10314 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
10315 auto cb__userData = new Tcb__UserData(cb);
10316 Discord_Client_UpdateRelationshipCallback cb__native = [](auto result, void* userData__) {
10317 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
10318 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
10319 userData__typed->delegate(std::move(result__obj));
10320 };
10321 Discord_Client_RemoveGameFriend(
10322 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
10323}
10324std::vector<discordpp::UserHandle> Client::SearchFriendsByUsername(std::string searchStr) const
10325{
10326 assert(state_ == DiscordObjectState::Owned);
10327 Discord_UserHandleSpan returnValueNative__;
10328 Discord_String searchStr__str{(uint8_t*)(searchStr.data()), searchStr.size()};
10329 Discord_Client_SearchFriendsByUsername(&instance_, searchStr__str, &returnValueNative__);
10330 std::vector<discordpp::UserHandle> returnValue__;
10331 returnValue__.reserve(returnValueNative__.size);
10332 for (size_t i__ = 0; i__ < returnValueNative__.size; ++i__) {
10333 returnValue__.emplace_back(returnValueNative__.ptr[i__], DiscordObjectState::Owned);
10334 }
10335 Discord_Free(returnValueNative__.ptr);
10336 return returnValue__;
10337}
10338void Client::SendDiscordFriendRequest(std::string const& username,
10340{
10341 assert(state_ == DiscordObjectState::Owned);
10342 Discord_String username__str{(uint8_t*)(username.data()), username.size()};
10343 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
10344 auto cb__userData = new Tcb__UserData(cb);
10345 Discord_Client_SendFriendRequestCallback cb__native = [](auto result, void* userData__) {
10346 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
10347 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
10348 userData__typed->delegate(std::move(result__obj));
10349 };
10350 Discord_Client_SendDiscordFriendRequest(
10351 &instance_, username__str, cb__native, Tcb__UserData::Free, cb__userData);
10352}
10353void Client::SendDiscordFriendRequestById(uint64_t userId,
10355{
10356 assert(state_ == DiscordObjectState::Owned);
10357 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
10358 auto cb__userData = new Tcb__UserData(cb);
10359 Discord_Client_UpdateRelationshipCallback cb__native = [](auto result, void* userData__) {
10360 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
10361 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
10362 userData__typed->delegate(std::move(result__obj));
10363 };
10364 Discord_Client_SendDiscordFriendRequestById(
10365 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
10366}
10367void Client::SendGameFriendRequest(std::string const& username,
10369{
10370 assert(state_ == DiscordObjectState::Owned);
10371 Discord_String username__str{(uint8_t*)(username.data()), username.size()};
10372 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
10373 auto cb__userData = new Tcb__UserData(cb);
10374 Discord_Client_SendFriendRequestCallback cb__native = [](auto result, void* userData__) {
10375 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
10376 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
10377 userData__typed->delegate(std::move(result__obj));
10378 };
10379 Discord_Client_SendGameFriendRequest(
10380 &instance_, username__str, cb__native, Tcb__UserData::Free, cb__userData);
10381}
10382void Client::SendGameFriendRequestById(uint64_t userId,
10384{
10385 assert(state_ == DiscordObjectState::Owned);
10386 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
10387 auto cb__userData = new Tcb__UserData(cb);
10388 Discord_Client_UpdateRelationshipCallback cb__native = [](auto result, void* userData__) {
10389 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
10390 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
10391 userData__typed->delegate(std::move(result__obj));
10392 };
10393 Discord_Client_SendGameFriendRequestById(
10394 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
10395}
10396void Client::SetRelationshipCreatedCallback(discordpp::Client::RelationshipCreatedCallback cb)
10397{
10398 assert(state_ == DiscordObjectState::Owned);
10399 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
10400 auto cb__userData = new Tcb__UserData(cb);
10401 Discord_Client_RelationshipCreatedCallback cb__native =
10402 [](auto userId, auto isDiscordRelationshipUpdate, void* userData__) {
10403 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
10404 userData__typed->delegate(userId, isDiscordRelationshipUpdate);
10405 };
10406 Discord_Client_SetRelationshipCreatedCallback(
10407 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
10408}
10409void Client::SetRelationshipDeletedCallback(discordpp::Client::RelationshipDeletedCallback cb)
10410{
10411 assert(state_ == DiscordObjectState::Owned);
10412 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
10413 auto cb__userData = new Tcb__UserData(cb);
10414 Discord_Client_RelationshipDeletedCallback cb__native =
10415 [](auto userId, auto isDiscordRelationshipUpdate, void* userData__) {
10416 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
10417 userData__typed->delegate(userId, isDiscordRelationshipUpdate);
10418 };
10419 Discord_Client_SetRelationshipDeletedCallback(
10420 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
10421}
10422void Client::UnblockUser(uint64_t userId, discordpp::Client::UpdateRelationshipCallback cb)
10423{
10424 assert(state_ == DiscordObjectState::Owned);
10425 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
10426 auto cb__userData = new Tcb__UserData(cb);
10427 Discord_Client_UpdateRelationshipCallback cb__native = [](auto result, void* userData__) {
10428 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
10429 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
10430 userData__typed->delegate(std::move(result__obj));
10431 };
10432 Discord_Client_UnblockUser(&instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
10433}
10434discordpp::UserHandle Client::GetCurrentUser() const
10435{
10436 assert(state_ == DiscordObjectState::Owned);
10437 Discord_UserHandle returnValueNative__{};
10438 Discord_Client_GetCurrentUser(&instance_, &returnValueNative__);
10439 discordpp::UserHandle returnValue__(returnValueNative__, DiscordObjectState::Owned);
10440 return returnValue__;
10441}
10442void Client::GetDiscordClientConnectedUser(
10443 uint64_t applicationId,
10445{
10446 assert(state_ == DiscordObjectState::Owned);
10447 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<decltype(callback)>>;
10448 auto callback__userData = new Tcallback__UserData(callback);
10449 Discord_Client_GetDiscordClientConnectedUserCallback callback__native =
10450 [](auto result, auto user, void* userData__) {
10451 auto userData__typed = static_cast<Tcallback__UserData*>(userData__);
10452 discordpp::ClientResult result__obj(*result, DiscordObjectState::Owned);
10453 std::optional<discordpp::UserHandle> user__opt{};
10454 if (user) {
10455 user__opt = discordpp::UserHandle(*user, DiscordObjectState::Owned);
10456 }
10457 userData__typed->delegate(std::move(result__obj), std::move(user__opt));
10458 };
10459 Discord_Client_GetDiscordClientConnectedUser(
10460 &instance_, applicationId, callback__native, Tcallback__UserData::Free, callback__userData);
10461}
10462std::optional<discordpp::UserHandle> Client::GetUser(uint64_t userId) const
10463{
10464 assert(state_ == DiscordObjectState::Owned);
10465 bool returnIsNonNull__;
10466 Discord_UserHandle returnValueNative__;
10467 returnIsNonNull__ = Discord_Client_GetUser(&instance_, userId, &returnValueNative__);
10468 if (!returnIsNonNull__) {
10469 return {};
10470 }
10471 discordpp::UserHandle returnValue__(returnValueNative__, DiscordObjectState::Owned);
10472 return returnValue__;
10473}
10474void Client::SetUserUpdatedCallback(discordpp::Client::UserUpdatedCallback cb)
10475{
10476 assert(state_ == DiscordObjectState::Owned);
10477 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<decltype(cb)>>;
10478 auto cb__userData = new Tcb__UserData(cb);
10479 Discord_Client_UserUpdatedCallback cb__native = [](auto userId, void* userData__) {
10480 auto userData__typed = static_cast<Tcb__UserData*>(userData__);
10481 userData__typed->delegate(userId);
10482 };
10483 Discord_Client_SetUserUpdatedCallback(
10484 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
10485}
10486const CallInfoHandle CallInfoHandle::nullobj{{}, DiscordObjectState::Invalid};
10487CallInfoHandle::~CallInfoHandle()
10488{
10489 if (state_ == DiscordObjectState::Owned) {
10490 Drop();
10491 state_ = DiscordObjectState::Invalid;
10492 }
10493}
10494CallInfoHandle::CallInfoHandle(CallInfoHandle&& other) noexcept
10495 : instance_(other.instance_)
10496 , state_(other.state_)
10497{
10498 other.state_ = DiscordObjectState::Invalid;
10499}
10500CallInfoHandle& CallInfoHandle::operator=(CallInfoHandle&& other) noexcept
10501{
10502 if (this != &other) {
10503 if (state_ == DiscordObjectState::Owned) {
10504 Drop();
10505 }
10506 instance_ = other.instance_;
10507 state_ = other.state_;
10508 other.state_ = DiscordObjectState::Invalid;
10509 }
10510 return *this;
10511}
10512CallInfoHandle::CallInfoHandle(const CallInfoHandle& other)
10513 : instance_{}
10514 , state_(DiscordObjectState::Invalid)
10515{
10516 if (other.state_ == DiscordObjectState::Owned) {
10517 Discord_CallInfoHandle_Clone(&instance_, other.instance());
10518
10519 state_ = DiscordObjectState::Owned;
10520 }
10521}
10522CallInfoHandle& CallInfoHandle::operator=(const CallInfoHandle& other)
10523{
10524 if (this != &other) {
10525 if (state_ == DiscordObjectState::Owned) {
10526 Drop();
10527 state_ = DiscordObjectState::Invalid;
10528 }
10529 if (other.state_ == DiscordObjectState::Owned) {
10530 Discord_CallInfoHandle_Clone(&instance_, other.instance());
10531
10532 state_ = DiscordObjectState::Owned;
10533 }
10534 }
10535 return *this;
10536}
10537CallInfoHandle::CallInfoHandle(Discord_CallInfoHandle instance, DiscordObjectState state)
10538 : instance_(instance)
10539 , state_(state)
10540{
10541}
10542void CallInfoHandle::Drop()
10543{
10544 if (state_ != DiscordObjectState::Owned) {
10545 return;
10546 }
10547 Discord_CallInfoHandle_Drop(&instance_);
10548 state_ = DiscordObjectState::Invalid;
10549}
10550uint64_t CallInfoHandle::ChannelId() const
10551{
10552 assert(state_ == DiscordObjectState::Owned);
10553 uint64_t returnValue__;
10554 returnValue__ = Discord_CallInfoHandle_ChannelId(&instance_);
10555 return returnValue__;
10556}
10557std::vector<uint64_t> CallInfoHandle::GetParticipants() const
10558{
10559 assert(state_ == DiscordObjectState::Owned);
10560 Discord_UInt64Span returnValueNative__;
10561 Discord_CallInfoHandle_GetParticipants(&instance_, &returnValueNative__);
10562 std::vector<uint64_t> returnValue__(returnValueNative__.ptr,
10563 returnValueNative__.ptr + returnValueNative__.size);
10564 Discord_Free(returnValueNative__.ptr);
10565 return returnValue__;
10566}
10567std::optional<discordpp::VoiceStateHandle> CallInfoHandle::GetVoiceStateHandle(
10568 uint64_t userId) const
10569{
10570 assert(state_ == DiscordObjectState::Owned);
10571 bool returnIsNonNull__;
10572 Discord_VoiceStateHandle returnValueNative__;
10573 returnIsNonNull__ =
10574 Discord_CallInfoHandle_GetVoiceStateHandle(&instance_, userId, &returnValueNative__);
10575 if (!returnIsNonNull__) {
10576 return {};
10577 }
10578 discordpp::VoiceStateHandle returnValue__(returnValueNative__, DiscordObjectState::Owned);
10579 return returnValue__;
10580}
10581uint64_t CallInfoHandle::GuildId() const
10582{
10583 assert(state_ == DiscordObjectState::Owned);
10584 uint64_t returnValue__;
10585 returnValue__ = Discord_CallInfoHandle_GuildId(&instance_);
10586 return returnValue__;
10587}
10588} // namespace discordpp
10589
10590#endif // DISCORDPP_IMPLEMENTATION
Struct which controls what your rich presence looks like in the Discord client. If you don't specify ...
Definition discordpp.h:720
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.
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.
ActivityAssets & operator=(const ActivityAssets &arg0)
Copy assignment operator for ActivityAssets.
static const ActivityAssets nullobj
Uninitialized instance of ActivityAssets.
Definition discordpp.h:739
std::optional< std::string > LargeImage() const
The primary image identifier or URL, rendered as a large square icon on a user's rich presence.
void SetSmallText(std::optional< std::string > SmallText)
Setter for ActivityAssets::SmallText.
ActivityAssets & operator=(ActivityAssets &&other) noexcept
Move assignment operator for ActivityAssets.
When one user invites another to join their game on Discord, it will send a message to that user....
Definition discordpp.h:628
static const ActivityInvite nullobj
Uninitialized instance of ActivityInvite.
Definition discordpp.h:647
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.
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.
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:839
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:858
ActivityParty & operator=(const ActivityParty &arg0)
Copy assignment operator for ActivityParty.
Definition discordpp.h:901
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:920
Definition discordpp.h:785
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:804
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:1112
static const Activity nullobj
Uninitialized instance of Activity.
Definition discordpp.h:1131
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 SetDetails(std::optional< std::string > Details)
Setter for Activity::Details.
Activity & operator=(Activity &&other) noexcept
Move assignment operator for Activity.
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::ActivityTimestamps > Timestamps() const
The timestamps struct can be used to render either:
void SetParty(std::optional< discordpp::ActivityParty > Party)
Setter for Activity::Party.
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 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< 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:2573
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:2592
Represents a single input or output audio device available to the user.
Definition discordpp.h:2789
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:2808
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:1415
std::optional< std::string > State() const
See https://discord.com/developers/docs/topics/oauth2#state-and-security for details on this field.
AuthorizationArgs & operator=(AuthorizationArgs &&other) noexcept
Move assignment operator for AuthorizationArgs.
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:1434
void SetClientId(uint64_t ClientId)
Setter for AuthorizationArgs::ClientId.
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:1323
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:1343
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:1370
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:1390
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:4481
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:4500
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:1653
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:1714
static const Call nullobj
Uninitialized instance of Call.
Definition discordpp.h:1731
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:1661
@ None
None.
Definition discordpp.h:1664
@ Forbidden
Forbidden.
Definition discordpp.h:1679
@ SignalingConnectionFailed
SignalingConnectionFailed.
Definition discordpp.h:1667
@ SignalingUnexpectedClose
SignalingUnexpectedClose.
Definition discordpp.h:1670
@ JoinTimeout
JoinTimeout.
Definition discordpp.h:1676
@ VoiceConnectionFailed
VoiceConnectionFailed.
Definition discordpp.h:1673
Status
Enum that respresents the state of the Call's network connection.
Definition discordpp.h:1683
@ Disconnecting
Disconnecting.
Definition discordpp.h:1704
@ Connected
Connected.
Definition discordpp.h:1698
@ Reconnecting
Reconnecting.
Definition discordpp.h:1701
@ Connecting
Connecting.
Definition discordpp.h:1692
@ SignalingConnected
SignalingConnected.
Definition discordpp.h:1695
@ Disconnected
Disconnected.
Definition discordpp.h:1686
@ Joining
Joining.
Definition discordpp.h:1689
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:1717
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:1711
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:1708
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:1880
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:1899
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.
Struct that stores information about the result of an SDK function call.
Definition discordpp.h:1230
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:1249
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:2844
std::function< void(std::vector< discordpp::AudioDevice > devices)> GetOutputDevicesCallback
Callback function for Client::GetOutputDevices.
Definition discordpp.h:2941
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.
std::function< void(uint64_t messageId)> MessageCreatedCallback
Callback function for Client::SetMessageCreatedCallback.
Definition discordpp.h:3032
discordpp::Call GetCall(uint64_t channelId)
Returns a reference to the currently active call, if any.
std::function< void(discordpp::ClientResult result)> UpdateRelationshipCallback
Callback function for most other Relationship functions such as Client::SendDiscordFriendRequestById.
Definition discordpp.h:3110
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 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:3006
std::function< void(bool inputDetected)> NoAudioInputCallback
Callback function for Client::SetNoAudioInputCallback.
Definition discordpp.h:2953
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:3020
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.
std::function< void(discordpp::ClientResult result, std::vector< discordpp::GuildMinimal > guilds)> GetUserGuildsCallback
Callback function for Client::GetUserGuilds.
Definition discordpp.h:3061
Client(std::string apiBase, std::string webBase)
Creates a new instance of the Client but allows customizing the Discord URL to use.
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:3074
std::function< void(std::string message, discordpp::LoggingSeverity severity)> LogCallback
Callback function invoked when a new log message is generated.
Definition discordpp.h:3041
void SetDeviceChangeCallback(discordpp::Client::DeviceChangeCallback callback)
Sets a callback function to be invoked when Discord detects a change in the available audio devices.
std::function< void(discordpp::ClientResult result)> LinkOrUnlinkChannelCallback
Callback function for Client::LinkChannelToLobby.
Definition discordpp.h:3068
std::function< void(discordpp::AudioDevice device)> GetCurrentOutputDeviceCallback
Callback function for Client::GetCurrentOutputDevice.
Definition discordpp.h:2934
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:3003
std::function< void(discordpp::ClientResult result)> SetOutputDeviceCallback
Callback function for Client::SetOutputDevice.
Definition discordpp.h:2956
std::function< void(discordpp::ClientResult result, std::optional< discordpp::UserHandle > user)> GetDiscordClientConnectedUserCallback
Callback function for when Client::GetDiscordClientConnectedUser completes.
Definition discordpp.h:3126
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:3083
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:2965
std::function< void(discordpp::ClientResult result)> LeaveLobbyCallback
Callback function for Client::LeaveLobby.
Definition discordpp.h:3065
std::function< void(uint64_t lobbyId)> LobbyUpdatedCallback
Callback function for Client::SetLobbyUpdatedCallback.
Definition discordpp.h:3086
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.
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:3000
void SetSelfDeafAll(bool deaf)
Mutes all audio from the currently active call for the current user in all calls. They will not be ab...
std::function< void(discordpp::ClientResult result)> UpdateRichPresenceCallback
Callback function for when Client::UpdateRichPresence completes.
Definition discordpp.h:3106
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:3114
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:3048
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:2928
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.
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:3089
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:2887
@ Disconnecting
Disconnecting.
Definition discordpp.h:2905
@ Connected
Connected.
Definition discordpp.h:2896
@ HttpWait
HttpWait.
Definition discordpp.h:2908
@ Reconnecting
Reconnecting.
Definition discordpp.h:2902
@ Connecting
Connecting.
Definition discordpp.h:2893
@ Ready
Ready.
Definition discordpp.h:2899
@ Disconnected
Disconnected.
Definition discordpp.h:2890
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:2992
void SetThreadPriority(discordpp::Client::Thread thread, int32_t priority)
Allows setting the priority of various SDK threads.
discordpp::UserHandle GetCurrentUser() const
Returns the user associated with the current client.
std::function< void(discordpp::ClientResult result)> OpenMessageInDiscordCallback
Callback function for when Client::OpenMessageInDiscord completes.
Definition discordpp.h:3023
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:2925
std::function< void(discordpp::ClientResult result)> EditUserMessageCallback
Callback function for Client::EditUserMessage.
Definition discordpp.h:3017
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:2950
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.
std::function< void(uint64_t lobbyId, uint64_t memberId)> LobbyMemberAddedCallback
Callback function for Client::SetLobbyMemberAddedCallback.
Definition discordpp.h:3077
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::SetActivityInviteCallback.
Definition discordpp.h:3097
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:3011
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:3071
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:3080
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:2984
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:3100
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.
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:3094
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:2959
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:3122
bool GetSelfDeafAll() const
Returns whether the current user is deafened in all calls.
bool SetSpeakerMode(bool speakerMode)
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:2858
@ None
None.
Definition discordpp.h:2861
@ ConnectionCanceled
ConnectionCanceled.
Definition discordpp.h:2870
@ ConnectionFailed
ConnectionFailed.
Definition discordpp.h:2864
@ UnexpectedClose
UnexpectedClose.
Definition discordpp.h:2867
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:3028
std::function< void(discordpp::AudioDevice device)> GetCurrentInputDeviceCallback
Callback function for Client::GetCurrentInputDevice.
Definition discordpp.h:2931
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:3131
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:3035
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.
Thread
Represents the type of thread to control thread priority on.
Definition discordpp.h:2912
@ Client
Client.
Definition discordpp.h:2915
@ Voice
Voice.
Definition discordpp.h:2918
@ Network
Network.
Definition discordpp.h:2921
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.
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:3038
void SetLobbyMemberUpdatedCallback(discordpp::Client::LobbyMemberUpdatedCallback cb)
Sets a callback function to be invoked whenever a member of a lobby is changed.
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, and Client::SetRelationshipDeletedCallb...
Definition discordpp.h:3118
std::function< void(discordpp::ClientResult result)> DeleteUserMessageCallback
Callback function for Client::DeleteUserMessage.
Definition discordpp.h:3014
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.
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 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:2988
std::function< void(discordpp::ClientResult result, std::vector< discordpp::GuildChannel > guildChannels)> GetGuildChannelsCallback
Callback function for Client::GetGuildChannels.
Definition discordpp.h:3056
std::function< void(discordpp::ClientResult result)> UpdateStatusCallback
Callback function for when Client::SetOnlineStatus completes.
Definition discordpp.h:3103
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:3052
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 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:2975
std::function< void(std::vector< discordpp::AudioDevice > inputDevices, std::vector< discordpp::AudioDevice > outputDevices)> DeviceChangeCallback
Callback function for Client::SetDeviceChangeCallback.
Definition discordpp.h:2945
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:2937
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:3144
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:1499
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:1519
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::string Name() const
The name 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.
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:1995
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:1950
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:2103
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:2122
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:2057
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:2076
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:2509
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:2528
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:2366
LobbyMemberHandle & operator=(const LobbyMemberHandle &other)
Copy assignment operator for LobbyMemberHandle.
static const LobbyMemberHandle nullobj
Uninitialized instance of LobbyMemberHandle.
Definition discordpp.h:2385
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:2685
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:2704
std::optional< discordpp::UserHandle > Recipient() const
Returns the UserHandle for the other participant in a DM, if this message was sent in a DM.
MessageHandle & operator=(const MessageHandle &other)
Copy assignment operator for MessageHandle.
uint64_t Id() const
Returns the ID of this message.
std::optional< discordpp::UserHandle > Author() const
Returns the UserHandle for the author of this message.
MessageHandle & operator=(MessageHandle &&other) noexcept
Move assignment operator for MessageHandle.
uint64_t EditedTimestamp() const
The timestamp in millis since the epoch when the message was most recently edited.
MessageHandle(const MessageHandle &other)
Copy constructor for MessageHandle.
std::string Content() const
Returns the content of this message, if any.
std::unordered_map< std::string, std::string > Metadata() const
Returns any metadata the developer included with this message.
std::string RawContent() const
Returns the content of this message, if any, but without replacing any markup from emojis and mention...
std::optional< discordpp::LobbyHandle > Lobby() const
Returns the LobbyHandle this message was sent in, if it was sent in a lobby.
uint64_t RecipientId() const
When this message was sent in a DM or Ephemeral DM, this method will return the ID of the other user ...
uint64_t SentTimestamp() const
The timestamp in millis since the epoch when the message was sent.
std::optional< discordpp::DisclosureTypes > DisclosureType() const
If this is an auto-generated message that is explaining some integration behavior to users,...
uint64_t ChannelId() const
Returns the channel ID this message was sent in.
MessageHandle(MessageHandle &&other) noexcept
Move constructor for MessageHandle.
bool SentFromGame() const
Returns true if this message was sent in-game, otherwise false (i.e. from Discord itself).
std::optional< discordpp::AdditionalContent > AdditionalContent() const
If the message contains non-text content, such as images, videos, embeds, polls, etc,...
A RelationshipHandle represents the relationship between the current user and a target user on Discor...
Definition discordpp.h:2185
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:2204
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.
A UserHandle represents a single user on Discord that the SDK knows about and contains basic account ...
Definition discordpp.h:2241
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:2275
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::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:2249
@ Jpeg
Jpeg.
Definition discordpp.h:2261
@ Gif
Gif.
Definition discordpp.h:2252
@ Webp
Webp.
Definition discordpp.h:2255
@ Png
Png.
Definition discordpp.h:2258
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,...
Settings for the void auto detection threshold for picking up activity from a user's mic.
Definition discordpp.h:1609
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:1628
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:1567
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:1586
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:51
@ Public
The party is public, which means that the user is in a party which could be joinable by either friend...
Definition discordpp.h:65
@ 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:59
DisclosureTypes
Enum that represents various informational disclosures that Discord may make to users,...
Definition discordpp.h:538
@ MessageDataVisibleOnDiscord
This disclosure type happens the first time a user sends a message in game, and that message will be ...
Definition discordpp.h:544
const char * EnumToString(discordpp::ActivityActionTypes value)
Converts a discordpp::ActivityActionTypes to a string.
Definition discordpp.h:4527
HttpStatusCode
Enum that represents the various HTTP status codes that can be returned.
Definition discordpp.h:189
@ RequestHeaderFieldsTooLarge
RequestHeaderFieldsTooLarge.
Definition discordpp.h:336
@ PayloadTooLarge
PayloadTooLarge.
Definition discordpp.h:297
@ MultiStatus
MultiStatus.
Definition discordpp.h:228
@ VariantAlsoNegotiates
VariantAlsoNegotiates.
Definition discordpp.h:357
@ Gone
Gone.
Definition discordpp.h:288
@ BadGateway
BadGateway.
Definition discordpp.h:345
@ Created
Created.
Definition discordpp.h:210
@ TemporaryRedirect
TemporaryRedirect.
Definition discordpp.h:252
@ ServiceUnavailable
ServiceUnavailable.
Definition discordpp.h:348
@ MovedPermanently
MovedPermanently.
Definition discordpp.h:240
@ PreconditionFailed
PreconditionFailed.
Definition discordpp.h:294
@ RequestTimeout
RequestTimeout.
Definition discordpp.h:282
@ Accepted
Accepted.
Definition discordpp.h:213
@ NonAuthoritativeInfo
NonAuthoritativeInfo.
Definition discordpp.h:216
@ NotFound
NotFound.
Definition discordpp.h:270
@ FailedDependency
FailedDependency.
Definition discordpp.h:321
@ PaymentRequired
PaymentRequired.
Definition discordpp.h:264
@ PreconditionRequired
PreconditionRequired.
Definition discordpp.h:330
@ ResetContent
ResetContent.
Definition discordpp.h:222
@ SwitchingProtocols
SwitchingProtocols.
Definition discordpp.h:198
@ HttpVersionNotSupported
HttpVersionNotSupported.
Definition discordpp.h:354
@ Found
Found.
Definition discordpp.h:243
@ Processing
Processing.
Definition discordpp.h:201
@ None
None.
Definition discordpp.h:192
@ ExpectationFailed
ExpectationFailed.
Definition discordpp.h:309
@ Forbidden
Forbidden.
Definition discordpp.h:267
@ PartialContent
PartialContent.
Definition discordpp.h:225
@ SeeOther
SeeOther.
Definition discordpp.h:246
@ EarlyHints
EarlyHints.
Definition discordpp.h:204
@ LengthRequired
LengthRequired.
Definition discordpp.h:291
@ MethodNotAllowed
MethodNotAllowed.
Definition discordpp.h:273
@ NotExtended
NotExtended.
Definition discordpp.h:366
@ RangeNotSatisfiable
RangeNotSatisfiable.
Definition discordpp.h:306
@ NotImplemented
NotImplemented.
Definition discordpp.h:342
@ BadRequest
BadRequest.
Definition discordpp.h:258
@ Continue
Continue.
Definition discordpp.h:195
@ LoopDetected
LoopDetected.
Definition discordpp.h:363
@ UnsupportedMediaType
UnsupportedMediaType.
Definition discordpp.h:303
@ NetworkAuthorizationRequired
NetworkAuthorizationRequired.
Definition discordpp.h:369
@ ImUsed
ImUsed.
Definition discordpp.h:234
@ MultipleChoices
MultipleChoices.
Definition discordpp.h:237
@ Ok
Ok.
Definition discordpp.h:207
@ TooManyRequests
TooManyRequests.
Definition discordpp.h:333
@ ProxyAuthRequired
ProxyAuthRequired.
Definition discordpp.h:279
@ UnprocessableEntity
UnprocessableEntity.
Definition discordpp.h:315
@ MisdirectedRequest
MisdirectedRequest.
Definition discordpp.h:312
@ PermanentRedirect
PermanentRedirect.
Definition discordpp.h:255
@ NotModified
NotModified.
Definition discordpp.h:249
@ AlreadyReported
AlreadyReported.
Definition discordpp.h:231
@ NoContent
NoContent.
Definition discordpp.h:219
@ Locked
Locked.
Definition discordpp.h:318
@ GatewayTimeout
GatewayTimeout.
Definition discordpp.h:351
@ Unauthorized
Unauthorized.
Definition discordpp.h:261
@ UpgradeRequired
UpgradeRequired.
Definition discordpp.h:327
@ InsufficientStorage
InsufficientStorage.
Definition discordpp.h:360
@ InternalServerError
InternalServerError.
Definition discordpp.h:339
@ TooEarly
TooEarly.
Definition discordpp.h:324
@ Conflict
Conflict.
Definition discordpp.h:285
@ UriTooLong
UriTooLong.
Definition discordpp.h:300
@ NotAcceptable
NotAcceptable.
Definition discordpp.h:276
AuthorizationTokenType
Represents the type of auth token used by the SDK, either the normal tokens produced by the Discord d...
Definition discordpp.h:549
@ Bearer
Bearer.
Definition discordpp.h:555
@ User
User.
Definition discordpp.h:552
ChannelType
Enum that represents the various channel types on Discord.
Definition discordpp.h:422
@ GuildForum
GuildForum.
Definition discordpp.h:461
@ Dm
Dm.
Definition discordpp.h:428
@ Lobby
Lobby.
Definition discordpp.h:467
@ GuildNews
GuildNews.
Definition discordpp.h:440
@ GuildVoice
GuildVoice.
Definition discordpp.h:431
@ GuildPublicThread
GuildPublicThread.
Definition discordpp.h:449
@ GuildNewsThread
GuildNewsThread.
Definition discordpp.h:446
@ GuildDirectory
GuildDirectory.
Definition discordpp.h:458
@ GuildCategory
GuildCategory.
Definition discordpp.h:437
@ GuildStageVoice
GuildStageVoice.
Definition discordpp.h:455
@ GuildMedia
GuildMedia.
Definition discordpp.h:464
@ GuildStore
GuildStore.
Definition discordpp.h:443
@ GuildText
GuildText.
Definition discordpp.h:425
@ GroupDm
GroupDm.
Definition discordpp.h:434
@ EphemeralDm
EphemeralDm.
Definition discordpp.h:470
@ GuildPrivateThread
GuildPrivateThread.
Definition discordpp.h:452
AuthenticationCodeChallengeMethod
Represents the crypto method used to generate a code challenge.
Definition discordpp.h:375
@ S256
S256.
Definition discordpp.h:378
RelationshipType
Enum that represents the possible types of relationships that can exist between two users.
Definition discordpp.h:474
@ PendingIncoming
The current user has received a friend request from the target user, but it is not yet accepted.
Definition discordpp.h:489
@ Implicit
The Implicit type is documented for visibility, but should be unused in the SDK.
Definition discordpp.h:496
@ Suggestion
The Suggestion type is documented for visibility, but should be unused in the SDK.
Definition discordpp.h:499
@ PendingOutgoing
The current user has sent a friend request to the target user, but it is not yet accepted.
Definition discordpp.h:493
@ Blocked
The current user has blocked the target user, and so certain actions such as sending messages between...
Definition discordpp.h:484
@ None
The user has no relationship with the other user.
Definition discordpp.h:477
@ Friend
The user is friends with the other user.
Definition discordpp.h:480
AuthenticationExternalAuthType
Represents the various identity providers that can be used to authenticate a provisional account user...
Definition discordpp.h:560
@ EpicOnlineServicesIdToken
EpicOnlineServicesIdToken.
Definition discordpp.h:569
@ EpicOnlineServicesAccessToken
EpicOnlineServicesAccessToken.
Definition discordpp.h:566
@ SteamSessionTicket
SteamSessionTicket.
Definition discordpp.h:572
@ OIDC
OIDC.
Definition discordpp.h:563
@ UnityServicesIdToken
UnityServicesIdToken.
Definition discordpp.h:575
LoggingSeverity
Enum that represents the various log levels supported by the SDK.
Definition discordpp.h:579
@ Warning
Warning.
Definition discordpp.h:588
@ Info
Info.
Definition discordpp.h:585
@ None
None.
Definition discordpp.h:594
@ Error
Error.
Definition discordpp.h:591
@ Verbose
Verbose.
Definition discordpp.h:582
ActivityGamePlatforms
Represents the type of platforms that an activity invite can be accepted on.
Definition discordpp.h:99
@ Embedded
Embedded.
Definition discordpp.h:117
@ Xbox
Xbox.
Definition discordpp.h:105
@ Desktop
Desktop.
Definition discordpp.h:102
@ Samsung
Samsung.
Definition discordpp.h:108
@ PS5
PS5.
Definition discordpp.h:123
@ PS4
PS4.
Definition discordpp.h:120
@ IOS
IOS.
Definition discordpp.h:111
@ Android
Android.
Definition discordpp.h:114
ActivityTypes
Discord RichPresence supports multiple types of activities that a user can be doing.
Definition discordpp.h:74
@ Watching
Watching.
Definition discordpp.h:86
@ Competing
Competing.
Definition discordpp.h:92
@ HangStatus
HangStatus.
Definition discordpp.h:95
@ Listening
Listening.
Definition discordpp.h:83
@ Streaming
Streaming.
Definition discordpp.h:80
@ CustomStatus
CustomStatus.
Definition discordpp.h:89
@ Playing
Playing.
Definition discordpp.h:77
StatusType
Enum that specifies the various online statuses for a user.
Definition discordpp.h:506
@ Blocked
Blocked.
Definition discordpp.h:515
@ Online
The user is online and recently active.
Definition discordpp.h:509
@ Dnd
The user is online, but wishes to suppress notifications for the time being.
Definition discordpp.h:522
@ Unknown
Unknown.
Definition discordpp.h:531
@ Invisible
The user is online, but wishes to appear as if they are offline to other users.
Definition discordpp.h:525
@ Offline
The user is offline and not connected to Discord.
Definition discordpp.h:512
@ Streaming
The user is online and is actively streaming content.
Definition discordpp.h:528
@ Idle
The user is online, but has not been active for a while and may be away from their computer.
Definition discordpp.h:519
void RunCallbacks()
Definition discordpp.h:29
AudioModeType
Represents whether a voice call is using push to talk or auto voice detection.
Definition discordpp.h:407
@ MODE_PTT
MODE_PTT.
Definition discordpp.h:416
@ MODE_VAD
MODE_VAD.
Definition discordpp.h:413
@ MODE_UNINIT
MODE_UNINIT.
Definition discordpp.h:410
ErrorType
Enum representing various types of errors the SDK returns.
Definition discordpp.h:127
@ HTTPError
An HTTP call was made to Discord's servers but a non success HTTP status code was returned....
Definition discordpp.h:142
@ NetworkError
The user is offline or there was some network issue that prevented an underlying HTTP call from succe...
Definition discordpp.h:134
@ AuthorizationFailed
An authorization function failed, but not necessarily as the result of an HTTP call that returned an ...
Definition discordpp.h:176
@ ClientNotReady
An operation such as sending a friend request or joining a lobby was attempted but the Client is not ...
Definition discordpp.h:152
@ None
No error, the operation was successful.
Definition discordpp.h:130
@ Aborted
The user or developer aborted an operation, such as an authorization flow.
Definition discordpp.h:171
@ RPCError
An RPC call was made to Discord's desktop application, but it returned a non-success result....
Definition discordpp.h:181
@ ValidationError
Used when an SDK method is called but the inputs don't pass local validation. For example if one atte...
Definition discordpp.h:168
@ ClientDestroyed
The Client has been destroyed and so this operation cannot complete.
Definition discordpp.h:158
@ Disabled
An operation was temporarily disabled for stability reasons.
Definition discordpp.h:155
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:382
@ Sticker
Sticker.
Definition discordpp.h:403
@ VoiceMessage
VoiceMessage.
Definition discordpp.h:394
@ Other
Other.
Definition discordpp.h:385
@ Poll
Poll.
Definition discordpp.h:391
@ Thread
Thread.
Definition discordpp.h:397
@ Attachment
Attachment.
Definition discordpp.h:388
@ Embed
Embed.
Definition discordpp.h:400
ActivityActionTypes
ActivityActionTypes represents the type of invite being sent to a user.
Definition discordpp.h:41
@ Join
Join.
Definition discordpp.h:44
@ JoinRequest
JoinRequest.
Definition discordpp.h:47