2#ifndef DISCORD_HEADER_DISCORDPP_H_
3#define DISCORD_HEADER_DISCORDPP_H_
12#include <unordered_map>
31 Discord_RunCallbacks();
684class ActivityTimestamps;
686class ActivitySecrets;
690class AuthorizationCodeChallenge;
691class AuthorizationCodeVerifier;
692class AuthorizationArgs;
693class DeviceAuthorizationArgs;
694class VoiceStateHandle;
695class VADThresholdSettings;
702class RelationshipHandle;
703class UserApplicationProfileHandle;
705class LobbyMemberHandle;
707class AdditionalContent;
710class UserMessageSummary;
711class ClientCreateOptions;
720 mutable Discord_ActivityInvite instance_{};
726 Discord_ActivityInvite* instance()
const {
return &instance_; }
818 mutable Discord_ActivityAssets instance_{};
824 Discord_ActivityAssets* instance()
const {
return &instance_; }
905 mutable Discord_ActivityTimestamps instance_{};
911 Discord_ActivityTimestamps* instance()
const {
return &instance_; }
959 mutable Discord_ActivityParty instance_{};
965 Discord_ActivityParty* instance()
const {
return &instance_; }
997 std::string
Id()
const;
1021 mutable Discord_ActivitySecrets instance_{};
1027 Discord_ActivitySecrets* instance()
const {
return &instance_; }
1065 mutable Discord_ActivityButton instance_{};
1071 Discord_ActivityButton* instance()
const {
return &instance_; }
1290 mutable Discord_Activity instance_{};
1296 Discord_Activity* instance()
const {
return &instance_; }
1356 std::optional<std::string>
State()
const;
1402 std::optional<discordpp::ActivityAssets>
Assets()
const;
1415 std::optional<discordpp::ActivityParty>
Party()
const;
1421 std::optional<discordpp::ActivitySecrets>
Secrets()
const;
1446 mutable Discord_ClientResult instance_{};
1452 Discord_ClientResult* instance()
const {
return &instance_; }
1539 mutable Discord_AuthorizationCodeChallenge instance_{};
1545 Discord_AuthorizationCodeChallenge* instance()
const {
return &instance_; }
1586 mutable Discord_AuthorizationCodeVerifier instance_{};
1592 Discord_AuthorizationCodeVerifier* instance()
const {
return &instance_; }
1631 mutable Discord_AuthorizationArgs instance_{};
1637 Discord_AuthorizationArgs* instance()
const {
return &instance_; }
1690 std::optional<std::string>
State()
const;
1698 std::optional<std::string>
Nonce()
const;
1737 mutable Discord_DeviceAuthorizationArgs instance_{};
1743 Discord_DeviceAuthorizationArgs* instance()
const {
return &instance_; }
1805 mutable Discord_VoiceStateHandle instance_{};
1811 Discord_VoiceStateHandle* instance()
const {
return &instance_; }
1847 mutable Discord_VADThresholdSettings instance_{};
1853 Discord_VADThresholdSettings* instance()
const {
return &instance_; }
1891 mutable Discord_Call instance_{};
1956 Discord_Call* instance()
const {
return &instance_; }
2118 mutable Discord_ChannelHandle instance_{};
2124 Discord_ChannelHandle* instance()
const {
return &instance_; }
2169 mutable Discord_GuildMinimal instance_{};
2175 Discord_GuildMinimal* instance()
const {
return &instance_; }
2214 mutable Discord_GuildChannel instance_{};
2220 Discord_GuildChannel* instance()
const {
return &instance_; }
2310 mutable Discord_LinkedLobby instance_{};
2316 Discord_LinkedLobby* instance()
const {
return &instance_; }
2356 mutable Discord_LinkedChannel instance_{};
2362 Discord_LinkedChannel* instance()
const {
return &instance_; }
2438 mutable Discord_RelationshipHandle instance_{};
2444 Discord_RelationshipHandle* instance()
const {
return &instance_; }
2482 std::optional<discordpp::UserHandle>
User()
const;
2495 mutable Discord_UserApplicationProfileHandle instance_{};
2501 Discord_UserApplicationProfileHandle* instance()
const {
return &instance_; }
2557 mutable Discord_UserHandle instance_{};
2578 Discord_UserHandle* instance()
const {
return &instance_; }
2687 mutable Discord_LobbyMemberHandle instance_{};
2693 Discord_LobbyMemberHandle* instance()
const {
return &instance_; }
2736 std::unordered_map<std::string, std::string>
Metadata()
const;
2739 std::optional<discordpp::UserHandle>
User()
const;
2830 mutable Discord_LobbyHandle instance_{};
2836 Discord_LobbyHandle* instance()
const {
return &instance_; }
2887 std::unordered_map<std::string, std::string>
Metadata()
const;
2894 mutable Discord_AdditionalContent instance_{};
2900 Discord_AdditionalContent* instance()
const {
return &instance_; }
2939 std::optional<std::string>
Title()
const;
3006 mutable Discord_MessageHandle instance_{};
3012 Discord_MessageHandle* instance()
const {
return &instance_; }
3049 std::optional<discordpp::UserHandle>
Author()
const;
3055 std::optional<discordpp::ChannelHandle>
Channel()
const;
3080 std::optional<discordpp::LobbyHandle>
Lobby()
const;
3087 std::unordered_map<std::string, std::string>
Metadata()
const;
3127 mutable Discord_AudioDevice instance_{};
3133 Discord_AudioDevice* instance()
const {
return &instance_; }
3179 mutable Discord_UserMessageSummary instance_{};
3185 Discord_UserMessageSummary* instance()
const {
return &instance_; }
3221 mutable Discord_ClientCreateOptions instance_{};
3227 Discord_ClientCreateOptions* instance()
const {
return &instance_; }
3301 mutable Discord_Client instance_{};
3393 std::function<void(std::vector<discordpp::AudioDevice> devices)>;
3397 std::function<void(std::vector<discordpp::AudioDevice> devices)>;
3401 std::function<void(std::vector<discordpp::AudioDevice> inputDevices,
3402 std::vector<discordpp::AudioDevice> outputDevices)>;
3415 std::function<void(uint64_t lobbyId, uint64_t memberId,
bool added)>;
3422 uint64_t samplesPerChannel,
3425 bool& outShouldMute)>;
3431 void(int16_t* data, uint64_t samplesPerChannel, int32_t sampleRate, uint64_t channels)>;
3445 std::string accessToken,
3448 std::string scopes)>;
3456 std::string accessToken,
3457 std::string refreshToken,
3460 std::string scopes)>;
3499 std::vector<discordpp::MessageHandle> messages)>;
3504 std::vector<discordpp::UserMessageSummary> summaries)>;
3509 std::vector<discordpp::MessageHandle> messages)>;
3554 std::vector<discordpp::GuildChannel> guildChannels)>;
3558 std::vector<discordpp::GuildMinimal> guilds)>;
3608 std::function<void(uint64_t applicationId, std::string joinSecret)>;
3629 std::function<void(uint64_t userId,
bool isDiscordRelationshipUpdate)>;
3636 std::function<void(uint64_t userId,
bool isDiscordRelationshipUpdate)>;
3641 std::optional<discordpp::UserHandle> user)>;
3649 Discord_Client* instance()
const {
return &instance_; }
3671 explicit Client(std::string apiBase, std::string webBase);
3692 [[deprecated(
"Please use GetCurrentUserV2 instead. This will be removed in a future version.")]]
3899 [[deprecated(
"Calling Client::SetSpeakerMode is DEPRECATED.")]]
4093 uint64_t childApplicationId,
4102 std::string
const& token,
4140 std::string
const& externalAuthToken,
4167 std::string
const& code,
4168 std::string
const& codeVerifier,
4169 std::string
const& redirectUri,
4239 std::string
const& externalAuthToken,
4273 std::string
const& code,
4274 std::string
const& codeVerifier,
4275 std::string
const& redirectUri,
4277 std::string
const& externalAuthToken,
4313 std::string
const& refreshToken,
4347 std::string
const& token,
4393 uint64_t applicationId,
4395 std::string
const& externalAuthToken,
4404 std::string
const& name,
4438 std::string
const& content,
4517 std::string
const& content,
4527 std::string
const& content,
4528 std::unordered_map<std::string, std::string>
const& metadata,
4544 std::string
const& content,
4554 std::string
const& content,
4555 std::unordered_map<std::string, std::string>
const& metadata,
4722 std::string
const& secret,
4723 std::unordered_map<std::string, std::string>
const& lobbyMetadata,
4724 std::unordered_map<std::string, std::string>
const& memberMetadata,
4916 std::string
const& content,
5185 uint64_t applicationId,
5193 std::optional<discordpp::UserHandle>
GetUser(uint64_t userId)
const;
5213 mutable Discord_CallInfoHandle instance_{};
5219 Discord_CallInfoHandle* instance()
const {
return &instance_; }
5265 return "JoinRequest";
5295 return "CustomStatus";
5299 return "HangStatus";
5349 return "NetworkError";
5353 return "ClientNotReady";
5357 return "ClientDestroyed";
5359 return "ValidationError";
5363 return "AuthorizationFailed";
5379 return "SwitchingProtocols";
5381 return "Processing";
5383 return "EarlyHints";
5391 return "NonAuthoritativeInfo";
5395 return "ResetContent";
5397 return "PartialContent";
5399 return "MultiStatus";
5401 return "AlreadyReported";
5405 return "MultipleChoices";
5407 return "MovedPermanently";
5413 return "NotModified";
5415 return "TemporaryRedirect";
5417 return "PermanentRedirect";
5419 return "BadRequest";
5421 return "Unauthorized";
5423 return "PaymentRequired";
5429 return "MethodNotAllowed";
5431 return "NotAcceptable";
5433 return "ProxyAuthRequired";
5435 return "RequestTimeout";
5441 return "LengthRequired";
5443 return "PreconditionFailed";
5445 return "PayloadTooLarge";
5447 return "UriTooLong";
5449 return "UnsupportedMediaType";
5451 return "RangeNotSatisfiable";
5453 return "ExpectationFailed";
5455 return "MisdirectedRequest";
5457 return "UnprocessableEntity";
5461 return "FailedDependency";
5465 return "UpgradeRequired";
5467 return "PreconditionRequired";
5469 return "TooManyRequests";
5471 return "RequestHeaderFieldsTooLarge";
5473 return "InternalServerError";
5475 return "NotImplemented";
5477 return "BadGateway";
5479 return "ServiceUnavailable";
5481 return "GatewayTimeout";
5483 return "HttpVersionNotSupported";
5485 return "VariantAlsoNegotiates";
5487 return "InsufficientStorage";
5489 return "LoopDetected";
5491 return "NotExtended";
5493 return "NetworkAuthorizationRequired";
5513 return "GuildInstall";
5515 return "UserInstall";
5529 return "GuildVoice";
5533 return "GuildCategory";
5537 return "GuildStore";
5539 return "GuildNewsThread";
5541 return "GuildPublicThread";
5543 return "GuildPrivateThread";
5545 return "GuildStageVoice";
5547 return "GuildDirectory";
5549 return "GuildForum";
5551 return "GuildMedia";
5555 return "EphemeralDm";
5567 return "Attachment";
5571 return "VoiceMessage";
5601 return "SignalingConnectionFailed";
5603 return "SignalingUnexpectedClose";
5605 return "VoiceConnectionFailed";
5607 return "JoinTimeout";
5619 return "MODE_UNINIT";
5633 return "Disconnected";
5637 return "Connecting";
5639 return "SignalingConnected";
5643 return "Reconnecting";
5645 return "Disconnecting";
5661 return "PendingIncoming";
5663 return "PendingOutgoing";
5667 return "Suggestion";
5679 return "EpicOnlineServices";
5685 return "DiscordBot";
5739 return "MessageDataVisibleOnDiscord";
5751 return "ConnectionFailed";
5753 return "UnexpectedClose";
5755 return "ConnectionCanceled";
5765 return "Disconnected";
5767 return "Connecting";
5773 return "Reconnecting";
5775 return "Disconnecting";
5815 return "EpicOnlineServicesAccessToken";
5817 return "EpicOnlineServicesIdToken";
5819 return "SteamSessionTicket";
5821 return "UnityServicesIdToken";
5823 return "DiscordBotIssuedAccessToken";
5825 return "AppleIdToken";
5827 return "PlayStationNetworkIdToken";
5855 return "OnlinePlayingGame";
5857 return "OnlineElsewhere";
5866#ifdef DISCORDPP_IMPLEMENTATION
5867#undef DISCORDPP_IMPLEMENTATION
5869#pragma clang diagnostic push
5870#pragma clang diagnostic ignored "-Wunused-parameter"
5873std::function<void(std::function<
void()>)> s_synchronizationContext;
5875inline bool HasSynchronizationContext()
5877 return !!s_synchronizationContext;
5880inline void PostTask(std::function<
void()> task)
5882 assert(s_synchronizationContext);
5883 s_synchronizationContext(std::move(task));
5886void SetSynchronizationContext(std::function<
void(std::function<
void()>)> executor)
5888 s_synchronizationContext = std::move(executor);
5891template <
typename T>
5892struct TDelegateUserData {
5894 TDelegateUserData(T delegate)
5895 : delegate{delegate}
5899 static void Free(
void* ptr) {
delete reinterpret_cast<TDelegateUserData*
>(ptr); }
5901 static T& Get(
void* userData)
5903 return reinterpret_cast<TDelegateUserData*
>(userData)->delegate;
5907struct ConvertedProperties {
5908 ConvertedProperties(std::unordered_map<std::string, std::string>
const& PropertyMap)
5910 Properties.size = PropertyMap.size();
5911 Properties.keys =
reinterpret_cast<Discord_String*
>(
5912 Discord_Alloc(Properties.size *
sizeof(Discord_String)));
5913 Properties.values =
reinterpret_cast<Discord_String*
>(
5914 Discord_Alloc(Properties.size *
sizeof(Discord_String)));
5916 for (
auto& pair : PropertyMap) {
5917 Properties.keys[i] = AllocateString(pair.first);
5918 Properties.values[i] = AllocateString(pair.second);
5922 ~ConvertedProperties() { Discord_FreeProperties(Properties); }
5923 Discord_Properties Properties{};
5926 Discord_String AllocateString(std::string
const& str)
5928 Discord_String result;
5929 result.ptr =
reinterpret_cast<uint8_t*
>(Discord_Alloc(str.size()));
5930 result.size = str.size();
5931 std::memcpy(result.ptr, str.data(), result.size);
5936std::unordered_map<std::string, std::string> ConvertReturnedProperties(
5937 Discord_Properties
const& Properties)
5939 std::unordered_map<std::string, std::string> result;
5940 for (
size_t i = 0; i < Properties.size; ++i) {
5941 std::string key(
reinterpret_cast<char*
>(Properties.keys[i].ptr), Properties.keys[i].size);
5942 std::string value(
reinterpret_cast<char*
>(Properties.values[i].ptr),
5943 Properties.values[i].size);
5944 result.emplace(std::move(key), std::move(value));
5949ActivityInvite::~ActivityInvite()
5957 : instance_(other.instance_)
5958 , state_(other.state_)
5964 if (
this != &other) {
5968 instance_ = other.instance_;
5969 state_ = other.state_;
5979 Discord_ActivityInvite_Clone(&instance_, rhs.instance());
5981 state_ = DiscordObjectState::Owned;
5984ActivityInvite& ActivityInvite::operator=(
const ActivityInvite& rhs)
5987 if (state_ == DiscordObjectState::Owned) {
5989 state_ = DiscordObjectState::Invalid;
5991 if (rhs.state_ == DiscordObjectState::Owned) {
5992 Discord_ActivityInvite_Clone(&instance_, rhs.instance());
5994 state_ = DiscordObjectState::Owned;
5999ActivityInvite::ActivityInvite(Discord_ActivityInvite instance, DiscordObjectState state)
6000 : instance_(instance)
6004ActivityInvite::ActivityInvite()
6006 assert(state_ == DiscordObjectState::Invalid);
6007 Discord_ActivityInvite_Init(&instance_);
6008 state_ = DiscordObjectState::Owned;
6010void ActivityInvite::Drop()
6012 if (state_ != DiscordObjectState::Owned) {
6015 Discord_ActivityInvite_Drop(&instance_);
6016 state_ = DiscordObjectState::Invalid;
6018uint64_t ActivityInvite::SenderId()
const
6020 assert(state_ == DiscordObjectState::Owned);
6021 uint64_t returnValue__;
6022 returnValue__ = Discord_ActivityInvite_SenderId(&instance_);
6023 return returnValue__;
6025void ActivityInvite::SetSenderId(uint64_t SenderId)
6027 assert(state_ == DiscordObjectState::Owned);
6028 Discord_ActivityInvite_SetSenderId(&instance_, SenderId);
6030uint64_t ActivityInvite::ChannelId()
const
6032 assert(state_ == DiscordObjectState::Owned);
6033 uint64_t returnValue__;
6034 returnValue__ = Discord_ActivityInvite_ChannelId(&instance_);
6035 return returnValue__;
6037void ActivityInvite::SetChannelId(uint64_t ChannelId)
6039 assert(state_ == DiscordObjectState::Owned);
6040 Discord_ActivityInvite_SetChannelId(&instance_, ChannelId);
6042uint64_t ActivityInvite::MessageId()
const
6044 assert(state_ == DiscordObjectState::Owned);
6045 uint64_t returnValue__;
6046 returnValue__ = Discord_ActivityInvite_MessageId(&instance_);
6047 return returnValue__;
6049void ActivityInvite::SetMessageId(uint64_t MessageId)
6051 assert(state_ == DiscordObjectState::Owned);
6052 Discord_ActivityInvite_SetMessageId(&instance_, MessageId);
6056 assert(state_ == DiscordObjectState::Owned);
6057 Discord_ActivityActionTypes returnValue__;
6058 returnValue__ = Discord_ActivityInvite_Type(&instance_);
6063 assert(state_ == DiscordObjectState::Owned);
6064 Discord_ActivityInvite_SetType(&instance_,
static_cast<Discord_ActivityActionTypes
>(Type));
6066uint64_t ActivityInvite::ApplicationId()
const
6068 assert(state_ == DiscordObjectState::Owned);
6069 uint64_t returnValue__;
6070 returnValue__ = Discord_ActivityInvite_ApplicationId(&instance_);
6071 return returnValue__;
6073void ActivityInvite::SetApplicationId(uint64_t ApplicationId)
6075 assert(state_ == DiscordObjectState::Owned);
6076 Discord_ActivityInvite_SetApplicationId(&instance_, ApplicationId);
6078uint64_t ActivityInvite::ParentApplicationId()
const
6080 assert(state_ == DiscordObjectState::Owned);
6081 uint64_t returnValue__;
6082 returnValue__ = Discord_ActivityInvite_ParentApplicationId(&instance_);
6083 return returnValue__;
6085void ActivityInvite::SetParentApplicationId(uint64_t ParentApplicationId)
6087 assert(state_ == DiscordObjectState::Owned);
6088 Discord_ActivityInvite_SetParentApplicationId(&instance_, ParentApplicationId);
6090std::string ActivityInvite::PartyId()
const
6092 assert(state_ == DiscordObjectState::Owned);
6093 Discord_String returnValueNative__;
6094 Discord_ActivityInvite_PartyId(&instance_, &returnValueNative__);
6095 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6096 returnValueNative__.size);
6097 Discord_Free(returnValueNative__.ptr);
6098 return returnValue__;
6100void ActivityInvite::SetPartyId(std::string PartyId)
6102 assert(state_ == DiscordObjectState::Owned);
6103 Discord_String PartyId__str{(uint8_t*)(PartyId.data()), PartyId.size()};
6104 Discord_ActivityInvite_SetPartyId(&instance_, PartyId__str);
6106std::string ActivityInvite::SessionId()
const
6108 assert(state_ == DiscordObjectState::Owned);
6109 Discord_String returnValueNative__;
6110 Discord_ActivityInvite_SessionId(&instance_, &returnValueNative__);
6111 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6112 returnValueNative__.size);
6113 Discord_Free(returnValueNative__.ptr);
6114 return returnValue__;
6116void ActivityInvite::SetSessionId(std::string SessionId)
6118 assert(state_ == DiscordObjectState::Owned);
6119 Discord_String SessionId__str{(uint8_t*)(SessionId.data()), SessionId.size()};
6120 Discord_ActivityInvite_SetSessionId(&instance_, SessionId__str);
6122bool ActivityInvite::IsValid()
const
6124 assert(state_ == DiscordObjectState::Owned);
6126 returnValue__ = Discord_ActivityInvite_IsValid(&instance_);
6127 return returnValue__;
6129void ActivityInvite::SetIsValid(
bool IsValid)
6131 assert(state_ == DiscordObjectState::Owned);
6132 Discord_ActivityInvite_SetIsValid(&instance_, IsValid);
6134const ActivityAssets ActivityAssets::nullobj{{}, DiscordObjectState::Invalid};
6135ActivityAssets::~ActivityAssets()
6137 if (state_ == DiscordObjectState::Owned) {
6139 state_ = DiscordObjectState::Invalid;
6142ActivityAssets::ActivityAssets(ActivityAssets&& other) noexcept
6143 : instance_(other.instance_)
6144 , state_(other.state_)
6146 other.state_ = DiscordObjectState::Invalid;
6148ActivityAssets& ActivityAssets::operator=(ActivityAssets&& other)
noexcept
6150 if (
this != &other) {
6151 if (state_ == DiscordObjectState::Owned) {
6154 instance_ = other.instance_;
6155 state_ = other.state_;
6156 other.state_ = DiscordObjectState::Invalid;
6160ActivityAssets::ActivityAssets(
const ActivityAssets& arg0)
6165 Discord_ActivityAssets_Clone(&instance_, arg0.instance());
6167 state_ = DiscordObjectState::Owned;
6170ActivityAssets& ActivityAssets::operator=(
const ActivityAssets& arg0)
6172 if (
this != &arg0) {
6173 if (state_ == DiscordObjectState::Owned) {
6175 state_ = DiscordObjectState::Invalid;
6177 if (arg0.state_ == DiscordObjectState::Owned) {
6178 Discord_ActivityAssets_Clone(&instance_, arg0.instance());
6180 state_ = DiscordObjectState::Owned;
6185ActivityAssets::ActivityAssets(Discord_ActivityAssets instance, DiscordObjectState state)
6186 : instance_(instance)
6190ActivityAssets::ActivityAssets()
6192 assert(state_ == DiscordObjectState::Invalid);
6193 Discord_ActivityAssets_Init(&instance_);
6194 state_ = DiscordObjectState::Owned;
6196void ActivityAssets::Drop()
6198 if (state_ != DiscordObjectState::Owned) {
6201 Discord_ActivityAssets_Drop(&instance_);
6202 state_ = DiscordObjectState::Invalid;
6204std::optional<std::string> ActivityAssets::LargeImage()
const
6206 assert(state_ == DiscordObjectState::Owned);
6207 bool returnIsNonNull__;
6208 Discord_String returnValueNative__;
6209 returnIsNonNull__ = Discord_ActivityAssets_LargeImage(&instance_, &returnValueNative__);
6210 if (!returnIsNonNull__) {
6213 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6214 returnValueNative__.size);
6215 Discord_Free(returnValueNative__.ptr);
6216 return returnValue__;
6218void ActivityAssets::SetLargeImage(std::optional<std::string> LargeImage)
6220 assert(state_ == DiscordObjectState::Owned);
6221 Discord_String LargeImage__str{};
6222 if (LargeImage.has_value()) {
6223 LargeImage__str.ptr =
reinterpret_cast<uint8_t*
>(LargeImage->data());
6224 LargeImage__str.size = LargeImage->size();
6226 Discord_ActivityAssets_SetLargeImage(&instance_,
6227 (LargeImage.has_value() ? &LargeImage__str :
nullptr));
6229std::optional<std::string> ActivityAssets::LargeText()
const
6231 assert(state_ == DiscordObjectState::Owned);
6232 bool returnIsNonNull__;
6233 Discord_String returnValueNative__;
6234 returnIsNonNull__ = Discord_ActivityAssets_LargeText(&instance_, &returnValueNative__);
6235 if (!returnIsNonNull__) {
6238 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6239 returnValueNative__.size);
6240 Discord_Free(returnValueNative__.ptr);
6241 return returnValue__;
6243void ActivityAssets::SetLargeText(std::optional<std::string> LargeText)
6245 assert(state_ == DiscordObjectState::Owned);
6246 Discord_String LargeText__str{};
6247 if (LargeText.has_value()) {
6248 LargeText__str.ptr =
reinterpret_cast<uint8_t*
>(LargeText->data());
6249 LargeText__str.size = LargeText->size();
6251 Discord_ActivityAssets_SetLargeText(&instance_,
6252 (LargeText.has_value() ? &LargeText__str :
nullptr));
6254std::optional<std::string> ActivityAssets::LargeUrl()
const
6256 assert(state_ == DiscordObjectState::Owned);
6257 bool returnIsNonNull__;
6258 Discord_String returnValueNative__;
6259 returnIsNonNull__ = Discord_ActivityAssets_LargeUrl(&instance_, &returnValueNative__);
6260 if (!returnIsNonNull__) {
6263 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6264 returnValueNative__.size);
6265 Discord_Free(returnValueNative__.ptr);
6266 return returnValue__;
6268void ActivityAssets::SetLargeUrl(std::optional<std::string> LargeUrl)
6270 assert(state_ == DiscordObjectState::Owned);
6271 Discord_String LargeUrl__str{};
6272 if (LargeUrl.has_value()) {
6273 LargeUrl__str.ptr =
reinterpret_cast<uint8_t*
>(LargeUrl->data());
6274 LargeUrl__str.size = LargeUrl->size();
6276 Discord_ActivityAssets_SetLargeUrl(&instance_,
6277 (LargeUrl.has_value() ? &LargeUrl__str :
nullptr));
6279std::optional<std::string> ActivityAssets::SmallImage()
const
6281 assert(state_ == DiscordObjectState::Owned);
6282 bool returnIsNonNull__;
6283 Discord_String returnValueNative__;
6284 returnIsNonNull__ = Discord_ActivityAssets_SmallImage(&instance_, &returnValueNative__);
6285 if (!returnIsNonNull__) {
6288 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6289 returnValueNative__.size);
6290 Discord_Free(returnValueNative__.ptr);
6291 return returnValue__;
6293void ActivityAssets::SetSmallImage(std::optional<std::string> SmallImage)
6295 assert(state_ == DiscordObjectState::Owned);
6296 Discord_String SmallImage__str{};
6297 if (SmallImage.has_value()) {
6298 SmallImage__str.ptr =
reinterpret_cast<uint8_t*
>(SmallImage->data());
6299 SmallImage__str.size = SmallImage->size();
6301 Discord_ActivityAssets_SetSmallImage(&instance_,
6302 (SmallImage.has_value() ? &SmallImage__str :
nullptr));
6304std::optional<std::string> ActivityAssets::SmallText()
const
6306 assert(state_ == DiscordObjectState::Owned);
6307 bool returnIsNonNull__;
6308 Discord_String returnValueNative__;
6309 returnIsNonNull__ = Discord_ActivityAssets_SmallText(&instance_, &returnValueNative__);
6310 if (!returnIsNonNull__) {
6313 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6314 returnValueNative__.size);
6315 Discord_Free(returnValueNative__.ptr);
6316 return returnValue__;
6318void ActivityAssets::SetSmallText(std::optional<std::string> SmallText)
6320 assert(state_ == DiscordObjectState::Owned);
6321 Discord_String SmallText__str{};
6322 if (SmallText.has_value()) {
6323 SmallText__str.ptr =
reinterpret_cast<uint8_t*
>(SmallText->data());
6324 SmallText__str.size = SmallText->size();
6326 Discord_ActivityAssets_SetSmallText(&instance_,
6327 (SmallText.has_value() ? &SmallText__str :
nullptr));
6329std::optional<std::string> ActivityAssets::SmallUrl()
const
6331 assert(state_ == DiscordObjectState::Owned);
6332 bool returnIsNonNull__;
6333 Discord_String returnValueNative__;
6334 returnIsNonNull__ = Discord_ActivityAssets_SmallUrl(&instance_, &returnValueNative__);
6335 if (!returnIsNonNull__) {
6338 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6339 returnValueNative__.size);
6340 Discord_Free(returnValueNative__.ptr);
6341 return returnValue__;
6343void ActivityAssets::SetSmallUrl(std::optional<std::string> SmallUrl)
6345 assert(state_ == DiscordObjectState::Owned);
6346 Discord_String SmallUrl__str{};
6347 if (SmallUrl.has_value()) {
6348 SmallUrl__str.ptr =
reinterpret_cast<uint8_t*
>(SmallUrl->data());
6349 SmallUrl__str.size = SmallUrl->size();
6351 Discord_ActivityAssets_SetSmallUrl(&instance_,
6352 (SmallUrl.has_value() ? &SmallUrl__str :
nullptr));
6354std::optional<std::string> ActivityAssets::InviteCoverImage()
const
6356 assert(state_ == DiscordObjectState::Owned);
6357 bool returnIsNonNull__;
6358 Discord_String returnValueNative__;
6359 returnIsNonNull__ = Discord_ActivityAssets_InviteCoverImage(&instance_, &returnValueNative__);
6360 if (!returnIsNonNull__) {
6363 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6364 returnValueNative__.size);
6365 Discord_Free(returnValueNative__.ptr);
6366 return returnValue__;
6368void ActivityAssets::SetInviteCoverImage(std::optional<std::string> InviteCoverImage)
6370 assert(state_ == DiscordObjectState::Owned);
6371 Discord_String InviteCoverImage__str{};
6372 if (InviteCoverImage.has_value()) {
6373 InviteCoverImage__str.ptr =
reinterpret_cast<uint8_t*
>(InviteCoverImage->data());
6374 InviteCoverImage__str.size = InviteCoverImage->size();
6376 Discord_ActivityAssets_SetInviteCoverImage(
6377 &instance_, (InviteCoverImage.has_value() ? &InviteCoverImage__str :
nullptr));
6379const ActivityTimestamps ActivityTimestamps::nullobj{{}, DiscordObjectState::Invalid};
6380ActivityTimestamps::~ActivityTimestamps()
6382 if (state_ == DiscordObjectState::Owned) {
6384 state_ = DiscordObjectState::Invalid;
6387ActivityTimestamps::ActivityTimestamps(ActivityTimestamps&& other) noexcept
6388 : instance_(other.instance_)
6389 , state_(other.state_)
6391 other.state_ = DiscordObjectState::Invalid;
6393ActivityTimestamps& ActivityTimestamps::operator=(ActivityTimestamps&& other)
noexcept
6395 if (
this != &other) {
6396 if (state_ == DiscordObjectState::Owned) {
6399 instance_ = other.instance_;
6400 state_ = other.state_;
6401 other.state_ = DiscordObjectState::Invalid;
6405ActivityTimestamps::ActivityTimestamps(
const ActivityTimestamps& arg0)
6410 Discord_ActivityTimestamps_Clone(&instance_, arg0.instance());
6412 state_ = DiscordObjectState::Owned;
6415ActivityTimestamps& ActivityTimestamps::operator=(
const ActivityTimestamps& arg0)
6417 if (
this != &arg0) {
6418 if (state_ == DiscordObjectState::Owned) {
6420 state_ = DiscordObjectState::Invalid;
6422 if (arg0.state_ == DiscordObjectState::Owned) {
6423 Discord_ActivityTimestamps_Clone(&instance_, arg0.instance());
6425 state_ = DiscordObjectState::Owned;
6430ActivityTimestamps::ActivityTimestamps(Discord_ActivityTimestamps instance,
6431 DiscordObjectState state)
6432 : instance_(instance)
6436ActivityTimestamps::ActivityTimestamps()
6438 assert(state_ == DiscordObjectState::Invalid);
6439 Discord_ActivityTimestamps_Init(&instance_);
6440 state_ = DiscordObjectState::Owned;
6442void ActivityTimestamps::Drop()
6444 if (state_ != DiscordObjectState::Owned) {
6447 Discord_ActivityTimestamps_Drop(&instance_);
6448 state_ = DiscordObjectState::Invalid;
6450uint64_t ActivityTimestamps::Start()
const
6452 assert(state_ == DiscordObjectState::Owned);
6453 uint64_t returnValue__;
6454 returnValue__ = Discord_ActivityTimestamps_Start(&instance_);
6455 return returnValue__;
6457void ActivityTimestamps::SetStart(uint64_t Start)
6459 assert(state_ == DiscordObjectState::Owned);
6460 Discord_ActivityTimestamps_SetStart(&instance_, Start);
6462uint64_t ActivityTimestamps::End()
const
6464 assert(state_ == DiscordObjectState::Owned);
6465 uint64_t returnValue__;
6466 returnValue__ = Discord_ActivityTimestamps_End(&instance_);
6467 return returnValue__;
6469void ActivityTimestamps::SetEnd(uint64_t End)
6471 assert(state_ == DiscordObjectState::Owned);
6472 Discord_ActivityTimestamps_SetEnd(&instance_, End);
6474const ActivityParty ActivityParty::nullobj{{}, DiscordObjectState::Invalid};
6475ActivityParty::~ActivityParty()
6477 if (state_ == DiscordObjectState::Owned) {
6479 state_ = DiscordObjectState::Invalid;
6482ActivityParty::ActivityParty(ActivityParty&& other) noexcept
6483 : instance_(other.instance_)
6484 , state_(other.state_)
6486 other.state_ = DiscordObjectState::Invalid;
6488ActivityParty& ActivityParty::operator=(ActivityParty&& other)
noexcept
6490 if (
this != &other) {
6491 if (state_ == DiscordObjectState::Owned) {
6494 instance_ = other.instance_;
6495 state_ = other.state_;
6496 other.state_ = DiscordObjectState::Invalid;
6500ActivityParty::ActivityParty(
const ActivityParty& arg0)
6505 Discord_ActivityParty_Clone(&instance_, arg0.instance());
6507 state_ = DiscordObjectState::Owned;
6510ActivityParty& ActivityParty::operator=(
const ActivityParty& arg0)
6512 if (
this != &arg0) {
6513 if (state_ == DiscordObjectState::Owned) {
6515 state_ = DiscordObjectState::Invalid;
6517 if (arg0.state_ == DiscordObjectState::Owned) {
6518 Discord_ActivityParty_Clone(&instance_, arg0.instance());
6520 state_ = DiscordObjectState::Owned;
6525ActivityParty::ActivityParty(Discord_ActivityParty instance, DiscordObjectState state)
6526 : instance_(instance)
6530ActivityParty::ActivityParty()
6532 assert(state_ == DiscordObjectState::Invalid);
6533 Discord_ActivityParty_Init(&instance_);
6534 state_ = DiscordObjectState::Owned;
6536void ActivityParty::Drop()
6538 if (state_ != DiscordObjectState::Owned) {
6541 Discord_ActivityParty_Drop(&instance_);
6542 state_ = DiscordObjectState::Invalid;
6544std::string ActivityParty::Id()
const
6546 assert(state_ == DiscordObjectState::Owned);
6547 Discord_String returnValueNative__;
6548 Discord_ActivityParty_Id(&instance_, &returnValueNative__);
6549 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6550 returnValueNative__.size);
6551 Discord_Free(returnValueNative__.ptr);
6552 return returnValue__;
6554void ActivityParty::SetId(std::string Id)
6556 assert(state_ == DiscordObjectState::Owned);
6557 Discord_String Id__str{(uint8_t*)(Id.data()), Id.size()};
6558 Discord_ActivityParty_SetId(&instance_, Id__str);
6560int32_t ActivityParty::CurrentSize()
const
6562 assert(state_ == DiscordObjectState::Owned);
6563 int32_t returnValue__;
6564 returnValue__ = Discord_ActivityParty_CurrentSize(&instance_);
6565 return returnValue__;
6567void ActivityParty::SetCurrentSize(int32_t CurrentSize)
6569 assert(state_ == DiscordObjectState::Owned);
6570 Discord_ActivityParty_SetCurrentSize(&instance_, CurrentSize);
6572int32_t ActivityParty::MaxSize()
const
6574 assert(state_ == DiscordObjectState::Owned);
6575 int32_t returnValue__;
6576 returnValue__ = Discord_ActivityParty_MaxSize(&instance_);
6577 return returnValue__;
6579void ActivityParty::SetMaxSize(int32_t MaxSize)
6581 assert(state_ == DiscordObjectState::Owned);
6582 Discord_ActivityParty_SetMaxSize(&instance_, MaxSize);
6586 assert(state_ == DiscordObjectState::Owned);
6587 Discord_ActivityPartyPrivacy returnValue__;
6588 returnValue__ = Discord_ActivityParty_Privacy(&instance_);
6593 assert(state_ == DiscordObjectState::Owned);
6594 Discord_ActivityParty_SetPrivacy(&instance_,
6595 static_cast<Discord_ActivityPartyPrivacy
>(Privacy));
6597const ActivitySecrets ActivitySecrets::nullobj{{}, DiscordObjectState::Invalid};
6598ActivitySecrets::~ActivitySecrets()
6600 if (state_ == DiscordObjectState::Owned) {
6602 state_ = DiscordObjectState::Invalid;
6605ActivitySecrets::ActivitySecrets(ActivitySecrets&& other) noexcept
6606 : instance_(other.instance_)
6607 , state_(other.state_)
6609 other.state_ = DiscordObjectState::Invalid;
6611ActivitySecrets& ActivitySecrets::operator=(ActivitySecrets&& other)
noexcept
6613 if (
this != &other) {
6614 if (state_ == DiscordObjectState::Owned) {
6617 instance_ = other.instance_;
6618 state_ = other.state_;
6619 other.state_ = DiscordObjectState::Invalid;
6623ActivitySecrets::ActivitySecrets(
const ActivitySecrets& arg0)
6628 Discord_ActivitySecrets_Clone(&instance_, arg0.instance());
6630 state_ = DiscordObjectState::Owned;
6633ActivitySecrets& ActivitySecrets::operator=(
const ActivitySecrets& arg0)
6635 if (
this != &arg0) {
6636 if (state_ == DiscordObjectState::Owned) {
6638 state_ = DiscordObjectState::Invalid;
6640 if (arg0.state_ == DiscordObjectState::Owned) {
6641 Discord_ActivitySecrets_Clone(&instance_, arg0.instance());
6643 state_ = DiscordObjectState::Owned;
6648ActivitySecrets::ActivitySecrets(Discord_ActivitySecrets instance, DiscordObjectState state)
6649 : instance_(instance)
6653ActivitySecrets::ActivitySecrets()
6655 assert(state_ == DiscordObjectState::Invalid);
6656 Discord_ActivitySecrets_Init(&instance_);
6657 state_ = DiscordObjectState::Owned;
6659void ActivitySecrets::Drop()
6661 if (state_ != DiscordObjectState::Owned) {
6664 Discord_ActivitySecrets_Drop(&instance_);
6665 state_ = DiscordObjectState::Invalid;
6667std::string ActivitySecrets::Join()
const
6669 assert(state_ == DiscordObjectState::Owned);
6670 Discord_String returnValueNative__;
6671 Discord_ActivitySecrets_Join(&instance_, &returnValueNative__);
6672 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6673 returnValueNative__.size);
6674 Discord_Free(returnValueNative__.ptr);
6675 return returnValue__;
6677void ActivitySecrets::SetJoin(std::string Join)
6679 assert(state_ == DiscordObjectState::Owned);
6680 Discord_String Join__str{(uint8_t*)(
Join.data()),
Join.size()};
6681 Discord_ActivitySecrets_SetJoin(&instance_, Join__str);
6683const ActivityButton ActivityButton::nullobj{{}, DiscordObjectState::Invalid};
6684ActivityButton::~ActivityButton()
6686 if (state_ == DiscordObjectState::Owned) {
6688 state_ = DiscordObjectState::Invalid;
6691ActivityButton::ActivityButton(ActivityButton&& other) noexcept
6692 : instance_(other.instance_)
6693 , state_(other.state_)
6695 other.state_ = DiscordObjectState::Invalid;
6697ActivityButton& ActivityButton::operator=(ActivityButton&& other)
noexcept
6699 if (
this != &other) {
6700 if (state_ == DiscordObjectState::Owned) {
6703 instance_ = other.instance_;
6704 state_ = other.state_;
6705 other.state_ = DiscordObjectState::Invalid;
6709ActivityButton::ActivityButton(
const ActivityButton& arg0)
6714 Discord_ActivityButton_Clone(&instance_, arg0.instance());
6716 state_ = DiscordObjectState::Owned;
6719ActivityButton& ActivityButton::operator=(
const ActivityButton& arg0)
6721 if (
this != &arg0) {
6722 if (state_ == DiscordObjectState::Owned) {
6724 state_ = DiscordObjectState::Invalid;
6726 if (arg0.state_ == DiscordObjectState::Owned) {
6727 Discord_ActivityButton_Clone(&instance_, arg0.instance());
6729 state_ = DiscordObjectState::Owned;
6734ActivityButton::ActivityButton(Discord_ActivityButton instance, DiscordObjectState state)
6735 : instance_(instance)
6739ActivityButton::ActivityButton()
6741 assert(state_ == DiscordObjectState::Invalid);
6742 Discord_ActivityButton_Init(&instance_);
6743 state_ = DiscordObjectState::Owned;
6745void ActivityButton::Drop()
6747 if (state_ != DiscordObjectState::Owned) {
6750 Discord_ActivityButton_Drop(&instance_);
6751 state_ = DiscordObjectState::Invalid;
6753std::string ActivityButton::Label()
const
6755 assert(state_ == DiscordObjectState::Owned);
6756 Discord_String returnValueNative__;
6757 Discord_ActivityButton_Label(&instance_, &returnValueNative__);
6758 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6759 returnValueNative__.size);
6760 Discord_Free(returnValueNative__.ptr);
6761 return returnValue__;
6763void ActivityButton::SetLabel(std::string Label)
6765 assert(state_ == DiscordObjectState::Owned);
6766 Discord_String Label__str{(uint8_t*)(Label.data()), Label.size()};
6767 Discord_ActivityButton_SetLabel(&instance_, Label__str);
6769std::string ActivityButton::Url()
const
6771 assert(state_ == DiscordObjectState::Owned);
6772 Discord_String returnValueNative__;
6773 Discord_ActivityButton_Url(&instance_, &returnValueNative__);
6774 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6775 returnValueNative__.size);
6776 Discord_Free(returnValueNative__.ptr);
6777 return returnValue__;
6779void ActivityButton::SetUrl(std::string Url)
6781 assert(state_ == DiscordObjectState::Owned);
6782 Discord_String Url__str{(uint8_t*)(Url.data()), Url.size()};
6783 Discord_ActivityButton_SetUrl(&instance_, Url__str);
6785const Activity Activity::nullobj{{}, DiscordObjectState::Invalid};
6786Activity::~Activity()
6788 if (state_ == DiscordObjectState::Owned) {
6790 state_ = DiscordObjectState::Invalid;
6793Activity::Activity(Activity&& other) noexcept
6794 : instance_(other.instance_)
6795 , state_(other.state_)
6797 other.state_ = DiscordObjectState::Invalid;
6799Activity& Activity::operator=(Activity&& other)
noexcept
6801 if (
this != &other) {
6802 if (state_ == DiscordObjectState::Owned) {
6805 instance_ = other.instance_;
6806 state_ = other.state_;
6807 other.state_ = DiscordObjectState::Invalid;
6811Activity::Activity(
const Activity& arg0)
6816 Discord_Activity_Clone(&instance_, arg0.instance());
6818 state_ = DiscordObjectState::Owned;
6821Activity& Activity::operator=(
const Activity& arg0)
6823 if (
this != &arg0) {
6824 if (state_ == DiscordObjectState::Owned) {
6826 state_ = DiscordObjectState::Invalid;
6828 if (arg0.state_ == DiscordObjectState::Owned) {
6829 Discord_Activity_Clone(&instance_, arg0.instance());
6831 state_ = DiscordObjectState::Owned;
6836Activity::Activity(Discord_Activity instance, DiscordObjectState state)
6837 : instance_(instance)
6843 assert(state_ == DiscordObjectState::Invalid);
6844 Discord_Activity_Init(&instance_);
6845 state_ = DiscordObjectState::Owned;
6847void Activity::Drop()
6849 if (state_ != DiscordObjectState::Owned) {
6852 Discord_Activity_Drop(&instance_);
6853 state_ = DiscordObjectState::Invalid;
6857 assert(state_ == DiscordObjectState::Owned);
6858 Discord_Activity_AddButton(&instance_, button.instance());
6862 assert(state_ == DiscordObjectState::Owned);
6864 returnValue__ = Discord_Activity_Equals(&instance_, other.instance());
6865 return returnValue__;
6867std::vector<discordpp::ActivityButton> Activity::GetButtons()
const
6869 assert(state_ == DiscordObjectState::Owned);
6870 Discord_ActivityButtonSpan returnValueNative__;
6871 Discord_Activity_GetButtons(&instance_, &returnValueNative__);
6872 std::vector<discordpp::ActivityButton> returnValue__;
6873 returnValue__.reserve(returnValueNative__.size);
6874 for (
size_t i__ = 0; i__ < returnValueNative__.size; ++i__) {
6875 returnValue__.emplace_back(returnValueNative__.ptr[i__], DiscordObjectState::Owned);
6877 Discord_Free(returnValueNative__.ptr);
6878 return returnValue__;
6880std::string Activity::Name()
const
6882 assert(state_ == DiscordObjectState::Owned);
6883 Discord_String returnValueNative__;
6884 Discord_Activity_Name(&instance_, &returnValueNative__);
6885 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6886 returnValueNative__.size);
6887 Discord_Free(returnValueNative__.ptr);
6888 return returnValue__;
6890void Activity::SetName(std::string Name)
6892 assert(state_ == DiscordObjectState::Owned);
6893 Discord_String Name__str{(uint8_t*)(
Name.data()),
Name.size()};
6894 Discord_Activity_SetName(&instance_, Name__str);
6898 assert(state_ == DiscordObjectState::Owned);
6899 Discord_ActivityTypes returnValue__;
6900 returnValue__ = Discord_Activity_Type(&instance_);
6905 assert(state_ == DiscordObjectState::Owned);
6906 Discord_Activity_SetType(&instance_,
static_cast<Discord_ActivityTypes
>(Type));
6908std::optional<discordpp::StatusDisplayTypes> Activity::StatusDisplayType()
const
6910 assert(state_ == DiscordObjectState::Owned);
6911 bool returnIsNonNull__;
6912 Discord_StatusDisplayTypes returnValueNative__;
6913 returnIsNonNull__ = Discord_Activity_StatusDisplayType(&instance_, &returnValueNative__);
6914 if (!returnIsNonNull__) {
6918 return returnValue__;
6920void Activity::SetStatusDisplayType(std::optional<discordpp::StatusDisplayTypes> StatusDisplayType)
6922 assert(state_ == DiscordObjectState::Owned);
6923 Discord_Activity_SetStatusDisplayType(
6925 (StatusDisplayType.has_value()
6926 ?
reinterpret_cast<Discord_StatusDisplayTypes*
>(&*StatusDisplayType)
6929std::optional<std::string> Activity::State()
const
6931 assert(state_ == DiscordObjectState::Owned);
6932 bool returnIsNonNull__;
6933 Discord_String returnValueNative__;
6934 returnIsNonNull__ = Discord_Activity_State(&instance_, &returnValueNative__);
6935 if (!returnIsNonNull__) {
6938 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6939 returnValueNative__.size);
6940 Discord_Free(returnValueNative__.ptr);
6941 return returnValue__;
6943void Activity::SetState(std::optional<std::string> State)
6945 assert(state_ == DiscordObjectState::Owned);
6946 Discord_String State__str{};
6947 if (
State.has_value()) {
6948 State__str.ptr =
reinterpret_cast<uint8_t*
>(
State->data());
6949 State__str.size =
State->size();
6951 Discord_Activity_SetState(&instance_, (
State.has_value() ? &State__str :
nullptr));
6953std::optional<std::string> Activity::StateUrl()
const
6955 assert(state_ == DiscordObjectState::Owned);
6956 bool returnIsNonNull__;
6957 Discord_String returnValueNative__;
6958 returnIsNonNull__ = Discord_Activity_StateUrl(&instance_, &returnValueNative__);
6959 if (!returnIsNonNull__) {
6962 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6963 returnValueNative__.size);
6964 Discord_Free(returnValueNative__.ptr);
6965 return returnValue__;
6967void Activity::SetStateUrl(std::optional<std::string> StateUrl)
6969 assert(state_ == DiscordObjectState::Owned);
6970 Discord_String StateUrl__str{};
6971 if (StateUrl.has_value()) {
6972 StateUrl__str.ptr =
reinterpret_cast<uint8_t*
>(StateUrl->data());
6973 StateUrl__str.size = StateUrl->size();
6975 Discord_Activity_SetStateUrl(&instance_, (StateUrl.has_value() ? &StateUrl__str :
nullptr));
6977std::optional<std::string> Activity::Details()
const
6979 assert(state_ == DiscordObjectState::Owned);
6980 bool returnIsNonNull__;
6981 Discord_String returnValueNative__;
6982 returnIsNonNull__ = Discord_Activity_Details(&instance_, &returnValueNative__);
6983 if (!returnIsNonNull__) {
6986 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6987 returnValueNative__.size);
6988 Discord_Free(returnValueNative__.ptr);
6989 return returnValue__;
6991void Activity::SetDetails(std::optional<std::string> Details)
6993 assert(state_ == DiscordObjectState::Owned);
6994 Discord_String Details__str{};
6996 Details__str.ptr =
reinterpret_cast<uint8_t*
>(
Details->data());
6997 Details__str.size =
Details->size();
6999 Discord_Activity_SetDetails(&instance_, (
Details.has_value() ? &Details__str :
nullptr));
7001std::optional<std::string> Activity::DetailsUrl()
const
7003 assert(state_ == DiscordObjectState::Owned);
7004 bool returnIsNonNull__;
7005 Discord_String returnValueNative__;
7006 returnIsNonNull__ = Discord_Activity_DetailsUrl(&instance_, &returnValueNative__);
7007 if (!returnIsNonNull__) {
7010 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7011 returnValueNative__.size);
7012 Discord_Free(returnValueNative__.ptr);
7013 return returnValue__;
7015void Activity::SetDetailsUrl(std::optional<std::string> DetailsUrl)
7017 assert(state_ == DiscordObjectState::Owned);
7018 Discord_String DetailsUrl__str{};
7019 if (DetailsUrl.has_value()) {
7020 DetailsUrl__str.ptr =
reinterpret_cast<uint8_t*
>(DetailsUrl->data());
7021 DetailsUrl__str.size = DetailsUrl->size();
7023 Discord_Activity_SetDetailsUrl(&instance_,
7024 (DetailsUrl.has_value() ? &DetailsUrl__str :
nullptr));
7026std::optional<uint64_t> Activity::ApplicationId()
const
7028 assert(state_ == DiscordObjectState::Owned);
7029 bool returnIsNonNull__;
7030 uint64_t returnValue__;
7031 returnIsNonNull__ = Discord_Activity_ApplicationId(&instance_, &returnValue__);
7032 if (!returnIsNonNull__) {
7033 return std::nullopt;
7035 return returnValue__;
7037void Activity::SetApplicationId(std::optional<uint64_t> ApplicationId)
7039 assert(state_ == DiscordObjectState::Owned);
7040 Discord_Activity_SetApplicationId(&instance_,
7041 (ApplicationId.has_value() ? &*ApplicationId :
nullptr));
7043std::optional<uint64_t> Activity::ParentApplicationId()
const
7045 assert(state_ == DiscordObjectState::Owned);
7046 bool returnIsNonNull__;
7047 uint64_t returnValue__;
7048 returnIsNonNull__ = Discord_Activity_ParentApplicationId(&instance_, &returnValue__);
7049 if (!returnIsNonNull__) {
7050 return std::nullopt;
7052 return returnValue__;
7054void Activity::SetParentApplicationId(std::optional<uint64_t> ParentApplicationId)
7056 assert(state_ == DiscordObjectState::Owned);
7057 Discord_Activity_SetParentApplicationId(
7058 &instance_, (ParentApplicationId.has_value() ? &*ParentApplicationId :
nullptr));
7060std::optional<discordpp::ActivityAssets> Activity::Assets()
const
7062 assert(state_ == DiscordObjectState::Owned);
7063 bool returnIsNonNull__;
7064 Discord_ActivityAssets returnValueNative__;
7065 returnIsNonNull__ = Discord_Activity_Assets(&instance_, &returnValueNative__);
7066 if (!returnIsNonNull__) {
7070 return returnValue__;
7072void Activity::SetAssets(std::optional<discordpp::ActivityAssets> Assets)
7074 assert(state_ == DiscordObjectState::Owned);
7075 Discord_Activity_SetAssets(&instance_, (Assets.has_value() ? Assets->instance() :
nullptr));
7077std::optional<discordpp::ActivityTimestamps> Activity::Timestamps()
const
7079 assert(state_ == DiscordObjectState::Owned);
7080 bool returnIsNonNull__;
7081 Discord_ActivityTimestamps returnValueNative__;
7082 returnIsNonNull__ = Discord_Activity_Timestamps(&instance_, &returnValueNative__);
7083 if (!returnIsNonNull__) {
7087 return returnValue__;
7089void Activity::SetTimestamps(std::optional<discordpp::ActivityTimestamps> Timestamps)
7091 assert(state_ == DiscordObjectState::Owned);
7092 Discord_Activity_SetTimestamps(&instance_,
7093 (Timestamps.has_value() ? Timestamps->instance() :
nullptr));
7095std::optional<discordpp::ActivityParty> Activity::Party()
const
7097 assert(state_ == DiscordObjectState::Owned);
7098 bool returnIsNonNull__;
7099 Discord_ActivityParty returnValueNative__;
7100 returnIsNonNull__ = Discord_Activity_Party(&instance_, &returnValueNative__);
7101 if (!returnIsNonNull__) {
7105 return returnValue__;
7107void Activity::SetParty(std::optional<discordpp::ActivityParty> Party)
7109 assert(state_ == DiscordObjectState::Owned);
7110 Discord_Activity_SetParty(&instance_, (Party.has_value() ? Party->instance() :
nullptr));
7112std::optional<discordpp::ActivitySecrets> Activity::Secrets()
const
7114 assert(state_ == DiscordObjectState::Owned);
7115 bool returnIsNonNull__;
7116 Discord_ActivitySecrets returnValueNative__;
7117 returnIsNonNull__ = Discord_Activity_Secrets(&instance_, &returnValueNative__);
7118 if (!returnIsNonNull__) {
7122 return returnValue__;
7124void Activity::SetSecrets(std::optional<discordpp::ActivitySecrets> Secrets)
7126 assert(state_ == DiscordObjectState::Owned);
7127 Discord_Activity_SetSecrets(&instance_, (Secrets.has_value() ? Secrets->instance() :
nullptr));
7131 assert(state_ == DiscordObjectState::Owned);
7132 Discord_ActivityGamePlatforms returnValue__;
7133 returnValue__ = Discord_Activity_SupportedPlatforms(&instance_);
7138 assert(state_ == DiscordObjectState::Owned);
7139 Discord_Activity_SetSupportedPlatforms(
7140 &instance_,
static_cast<Discord_ActivityGamePlatforms
>(SupportedPlatforms));
7142const ClientResult ClientResult::nullobj{{}, DiscordObjectState::Invalid};
7143ClientResult::~ClientResult()
7145 if (state_ == DiscordObjectState::Owned) {
7147 state_ = DiscordObjectState::Invalid;
7150ClientResult::ClientResult(ClientResult&& other) noexcept
7151 : instance_(other.instance_)
7152 , state_(other.state_)
7154 other.state_ = DiscordObjectState::Invalid;
7156ClientResult& ClientResult::operator=(ClientResult&& other)
noexcept
7158 if (
this != &other) {
7159 if (state_ == DiscordObjectState::Owned) {
7162 instance_ = other.instance_;
7163 state_ = other.state_;
7164 other.state_ = DiscordObjectState::Invalid;
7168ClientResult::ClientResult(
const ClientResult& arg0)
7173 Discord_ClientResult_Clone(&instance_, arg0.instance());
7175 state_ = DiscordObjectState::Owned;
7178ClientResult& ClientResult::operator=(
const ClientResult& arg0)
7180 if (
this != &arg0) {
7181 if (state_ == DiscordObjectState::Owned) {
7183 state_ = DiscordObjectState::Invalid;
7185 if (arg0.state_ == DiscordObjectState::Owned) {
7186 Discord_ClientResult_Clone(&instance_, arg0.instance());
7188 state_ = DiscordObjectState::Owned;
7193ClientResult::ClientResult(Discord_ClientResult instance, DiscordObjectState state)
7194 : instance_(instance)
7198void ClientResult::Drop()
7200 if (state_ != DiscordObjectState::Owned) {
7203 Discord_ClientResult_Drop(&instance_);
7204 state_ = DiscordObjectState::Invalid;
7206std::string ClientResult::ToString()
const
7208 assert(state_ == DiscordObjectState::Owned);
7209 Discord_String returnValueNative__;
7210 Discord_ClientResult_ToString(&instance_, &returnValueNative__);
7211 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7212 returnValueNative__.size);
7213 Discord_Free(returnValueNative__.ptr);
7214 return returnValue__;
7218 assert(state_ == DiscordObjectState::Owned);
7219 Discord_ErrorType returnValue__;
7220 returnValue__ = Discord_ClientResult_Type(&instance_);
7225 assert(state_ == DiscordObjectState::Owned);
7226 Discord_ClientResult_SetType(&instance_,
static_cast<Discord_ErrorType
>(Type));
7228std::string ClientResult::Error()
const
7230 assert(state_ == DiscordObjectState::Owned);
7231 Discord_String returnValueNative__;
7232 Discord_ClientResult_Error(&instance_, &returnValueNative__);
7233 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7234 returnValueNative__.size);
7235 Discord_Free(returnValueNative__.ptr);
7236 return returnValue__;
7238void ClientResult::SetError(std::string Error)
7240 assert(state_ == DiscordObjectState::Owned);
7241 Discord_String Error__str{(uint8_t*)(
Error.data()),
Error.size()};
7242 Discord_ClientResult_SetError(&instance_, Error__str);
7244int32_t ClientResult::ErrorCode()
const
7246 assert(state_ == DiscordObjectState::Owned);
7247 int32_t returnValue__;
7248 returnValue__ = Discord_ClientResult_ErrorCode(&instance_);
7249 return returnValue__;
7251void ClientResult::SetErrorCode(int32_t ErrorCode)
7253 assert(state_ == DiscordObjectState::Owned);
7254 Discord_ClientResult_SetErrorCode(&instance_, ErrorCode);
7258 assert(state_ == DiscordObjectState::Owned);
7259 Discord_HttpStatusCode returnValue__;
7260 returnValue__ = Discord_ClientResult_Status(&instance_);
7265 assert(state_ == DiscordObjectState::Owned);
7266 Discord_ClientResult_SetStatus(&instance_,
static_cast<Discord_HttpStatusCode
>(Status));
7268std::string ClientResult::ResponseBody()
const
7270 assert(state_ == DiscordObjectState::Owned);
7271 Discord_String returnValueNative__;
7272 Discord_ClientResult_ResponseBody(&instance_, &returnValueNative__);
7273 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7274 returnValueNative__.size);
7275 Discord_Free(returnValueNative__.ptr);
7276 return returnValue__;
7278void ClientResult::SetResponseBody(std::string ResponseBody)
7280 assert(state_ == DiscordObjectState::Owned);
7281 Discord_String ResponseBody__str{(uint8_t*)(ResponseBody.data()), ResponseBody.size()};
7282 Discord_ClientResult_SetResponseBody(&instance_, ResponseBody__str);
7284bool ClientResult::Successful()
const
7286 assert(state_ == DiscordObjectState::Owned);
7288 returnValue__ = Discord_ClientResult_Successful(&instance_);
7289 return returnValue__;
7291void ClientResult::SetSuccessful(
bool Successful)
7293 assert(state_ == DiscordObjectState::Owned);
7294 Discord_ClientResult_SetSuccessful(&instance_, Successful);
7296bool ClientResult::Retryable()
const
7298 assert(state_ == DiscordObjectState::Owned);
7300 returnValue__ = Discord_ClientResult_Retryable(&instance_);
7301 return returnValue__;
7303void ClientResult::SetRetryable(
bool Retryable)
7305 assert(state_ == DiscordObjectState::Owned);
7306 Discord_ClientResult_SetRetryable(&instance_, Retryable);
7308float ClientResult::RetryAfter()
const
7310 assert(state_ == DiscordObjectState::Owned);
7311 float returnValue__;
7312 returnValue__ = Discord_ClientResult_RetryAfter(&instance_);
7313 return returnValue__;
7315void ClientResult::SetRetryAfter(
float RetryAfter)
7317 assert(state_ == DiscordObjectState::Owned);
7318 Discord_ClientResult_SetRetryAfter(&instance_, RetryAfter);
7320const AuthorizationCodeChallenge AuthorizationCodeChallenge::nullobj{{},
7321 DiscordObjectState::Invalid};
7322AuthorizationCodeChallenge::~AuthorizationCodeChallenge()
7324 if (state_ == DiscordObjectState::Owned) {
7326 state_ = DiscordObjectState::Invalid;
7329AuthorizationCodeChallenge::AuthorizationCodeChallenge(AuthorizationCodeChallenge&& other) noexcept
7330 : instance_(other.instance_)
7331 , state_(other.state_)
7333 other.state_ = DiscordObjectState::Invalid;
7335AuthorizationCodeChallenge& AuthorizationCodeChallenge::operator=(
7336 AuthorizationCodeChallenge&& other)
noexcept
7338 if (
this != &other) {
7339 if (state_ == DiscordObjectState::Owned) {
7342 instance_ = other.instance_;
7343 state_ = other.state_;
7344 other.state_ = DiscordObjectState::Invalid;
7348AuthorizationCodeChallenge::AuthorizationCodeChallenge(
const AuthorizationCodeChallenge& arg0)
7353 Discord_AuthorizationCodeChallenge_Clone(&instance_, arg0.instance());
7355 state_ = DiscordObjectState::Owned;
7358AuthorizationCodeChallenge& AuthorizationCodeChallenge::operator=(
7359 const AuthorizationCodeChallenge& arg0)
7361 if (
this != &arg0) {
7362 if (state_ == DiscordObjectState::Owned) {
7364 state_ = DiscordObjectState::Invalid;
7366 if (arg0.state_ == DiscordObjectState::Owned) {
7367 Discord_AuthorizationCodeChallenge_Clone(&instance_, arg0.instance());
7369 state_ = DiscordObjectState::Owned;
7374AuthorizationCodeChallenge::AuthorizationCodeChallenge(Discord_AuthorizationCodeChallenge instance,
7375 DiscordObjectState state)
7376 : instance_(instance)
7380AuthorizationCodeChallenge::AuthorizationCodeChallenge()
7382 assert(state_ == DiscordObjectState::Invalid);
7383 Discord_AuthorizationCodeChallenge_Init(&instance_);
7384 state_ = DiscordObjectState::Owned;
7386void AuthorizationCodeChallenge::Drop()
7388 if (state_ != DiscordObjectState::Owned) {
7391 Discord_AuthorizationCodeChallenge_Drop(&instance_);
7392 state_ = DiscordObjectState::Invalid;
7396 assert(state_ == DiscordObjectState::Owned);
7397 Discord_AuthenticationCodeChallengeMethod returnValue__;
7398 returnValue__ = Discord_AuthorizationCodeChallenge_Method(&instance_);
7403 assert(state_ == DiscordObjectState::Owned);
7404 Discord_AuthorizationCodeChallenge_SetMethod(
7405 &instance_,
static_cast<Discord_AuthenticationCodeChallengeMethod
>(Method));
7407std::string AuthorizationCodeChallenge::Challenge()
const
7409 assert(state_ == DiscordObjectState::Owned);
7410 Discord_String returnValueNative__;
7411 Discord_AuthorizationCodeChallenge_Challenge(&instance_, &returnValueNative__);
7412 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7413 returnValueNative__.size);
7414 Discord_Free(returnValueNative__.ptr);
7415 return returnValue__;
7417void AuthorizationCodeChallenge::SetChallenge(std::string Challenge)
7419 assert(state_ == DiscordObjectState::Owned);
7420 Discord_String Challenge__str{(uint8_t*)(Challenge.data()), Challenge.size()};
7421 Discord_AuthorizationCodeChallenge_SetChallenge(&instance_, Challenge__str);
7423const AuthorizationCodeVerifier AuthorizationCodeVerifier::nullobj{{}, DiscordObjectState::Invalid};
7424AuthorizationCodeVerifier::~AuthorizationCodeVerifier()
7426 if (state_ == DiscordObjectState::Owned) {
7428 state_ = DiscordObjectState::Invalid;
7431AuthorizationCodeVerifier::AuthorizationCodeVerifier(AuthorizationCodeVerifier&& other) noexcept
7432 : instance_(other.instance_)
7433 , state_(other.state_)
7435 other.state_ = DiscordObjectState::Invalid;
7437AuthorizationCodeVerifier& AuthorizationCodeVerifier::operator=(
7438 AuthorizationCodeVerifier&& other)
noexcept
7440 if (
this != &other) {
7441 if (state_ == DiscordObjectState::Owned) {
7444 instance_ = other.instance_;
7445 state_ = other.state_;
7446 other.state_ = DiscordObjectState::Invalid;
7450AuthorizationCodeVerifier::AuthorizationCodeVerifier(
const AuthorizationCodeVerifier& arg0)
7455 Discord_AuthorizationCodeVerifier_Clone(&instance_, arg0.instance());
7457 state_ = DiscordObjectState::Owned;
7460AuthorizationCodeVerifier& AuthorizationCodeVerifier::operator=(
7461 const AuthorizationCodeVerifier& arg0)
7463 if (
this != &arg0) {
7464 if (state_ == DiscordObjectState::Owned) {
7466 state_ = DiscordObjectState::Invalid;
7468 if (arg0.state_ == DiscordObjectState::Owned) {
7469 Discord_AuthorizationCodeVerifier_Clone(&instance_, arg0.instance());
7471 state_ = DiscordObjectState::Owned;
7476AuthorizationCodeVerifier::AuthorizationCodeVerifier(Discord_AuthorizationCodeVerifier instance,
7477 DiscordObjectState state)
7478 : instance_(instance)
7482void AuthorizationCodeVerifier::Drop()
7484 if (state_ != DiscordObjectState::Owned) {
7487 Discord_AuthorizationCodeVerifier_Drop(&instance_);
7488 state_ = DiscordObjectState::Invalid;
7492 assert(state_ == DiscordObjectState::Owned);
7493 Discord_AuthorizationCodeChallenge returnValueNative__{};
7494 Discord_AuthorizationCodeVerifier_Challenge(&instance_, &returnValueNative__);
7496 DiscordObjectState::Owned);
7497 return returnValue__;
7501 assert(state_ == DiscordObjectState::Owned);
7502 Discord_AuthorizationCodeVerifier_SetChallenge(&instance_, Challenge.instance());
7504std::string AuthorizationCodeVerifier::Verifier()
const
7506 assert(state_ == DiscordObjectState::Owned);
7507 Discord_String returnValueNative__;
7508 Discord_AuthorizationCodeVerifier_Verifier(&instance_, &returnValueNative__);
7509 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7510 returnValueNative__.size);
7511 Discord_Free(returnValueNative__.ptr);
7512 return returnValue__;
7514void AuthorizationCodeVerifier::SetVerifier(std::string Verifier)
7516 assert(state_ == DiscordObjectState::Owned);
7517 Discord_String Verifier__str{(uint8_t*)(Verifier.data()), Verifier.size()};
7518 Discord_AuthorizationCodeVerifier_SetVerifier(&instance_, Verifier__str);
7520const AuthorizationArgs AuthorizationArgs::nullobj{{}, DiscordObjectState::Invalid};
7521AuthorizationArgs::~AuthorizationArgs()
7523 if (state_ == DiscordObjectState::Owned) {
7525 state_ = DiscordObjectState::Invalid;
7528AuthorizationArgs::AuthorizationArgs(AuthorizationArgs&& other) noexcept
7529 : instance_(other.instance_)
7530 , state_(other.state_)
7532 other.state_ = DiscordObjectState::Invalid;
7534AuthorizationArgs& AuthorizationArgs::operator=(AuthorizationArgs&& other)
noexcept
7536 if (
this != &other) {
7537 if (state_ == DiscordObjectState::Owned) {
7540 instance_ = other.instance_;
7541 state_ = other.state_;
7542 other.state_ = DiscordObjectState::Invalid;
7546AuthorizationArgs::AuthorizationArgs(
const AuthorizationArgs& arg0)
7551 Discord_AuthorizationArgs_Clone(&instance_, arg0.instance());
7553 state_ = DiscordObjectState::Owned;
7556AuthorizationArgs& AuthorizationArgs::operator=(
const AuthorizationArgs& arg0)
7558 if (
this != &arg0) {
7559 if (state_ == DiscordObjectState::Owned) {
7561 state_ = DiscordObjectState::Invalid;
7563 if (arg0.state_ == DiscordObjectState::Owned) {
7564 Discord_AuthorizationArgs_Clone(&instance_, arg0.instance());
7566 state_ = DiscordObjectState::Owned;
7571AuthorizationArgs::AuthorizationArgs(Discord_AuthorizationArgs instance, DiscordObjectState state)
7572 : instance_(instance)
7576AuthorizationArgs::AuthorizationArgs()
7578 assert(state_ == DiscordObjectState::Invalid);
7579 Discord_AuthorizationArgs_Init(&instance_);
7580 state_ = DiscordObjectState::Owned;
7582void AuthorizationArgs::Drop()
7584 if (state_ != DiscordObjectState::Owned) {
7587 Discord_AuthorizationArgs_Drop(&instance_);
7588 state_ = DiscordObjectState::Invalid;
7590uint64_t AuthorizationArgs::ClientId()
const
7592 assert(state_ == DiscordObjectState::Owned);
7593 uint64_t returnValue__;
7594 returnValue__ = Discord_AuthorizationArgs_ClientId(&instance_);
7595 return returnValue__;
7597void AuthorizationArgs::SetClientId(uint64_t ClientId)
7599 assert(state_ == DiscordObjectState::Owned);
7600 Discord_AuthorizationArgs_SetClientId(&instance_, ClientId);
7602std::string AuthorizationArgs::Scopes()
const
7604 assert(state_ == DiscordObjectState::Owned);
7605 Discord_String returnValueNative__;
7606 Discord_AuthorizationArgs_Scopes(&instance_, &returnValueNative__);
7607 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7608 returnValueNative__.size);
7609 Discord_Free(returnValueNative__.ptr);
7610 return returnValue__;
7612void AuthorizationArgs::SetScopes(std::string Scopes)
7614 assert(state_ == DiscordObjectState::Owned);
7615 Discord_String Scopes__str{(uint8_t*)(Scopes.data()), Scopes.size()};
7616 Discord_AuthorizationArgs_SetScopes(&instance_, Scopes__str);
7618std::optional<std::string> AuthorizationArgs::State()
const
7620 assert(state_ == DiscordObjectState::Owned);
7621 bool returnIsNonNull__;
7622 Discord_String returnValueNative__;
7623 returnIsNonNull__ = Discord_AuthorizationArgs_State(&instance_, &returnValueNative__);
7624 if (!returnIsNonNull__) {
7627 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7628 returnValueNative__.size);
7629 Discord_Free(returnValueNative__.ptr);
7630 return returnValue__;
7632void AuthorizationArgs::SetState(std::optional<std::string> State)
7634 assert(state_ == DiscordObjectState::Owned);
7635 Discord_String State__str{};
7636 if (
State.has_value()) {
7637 State__str.ptr =
reinterpret_cast<uint8_t*
>(
State->data());
7638 State__str.size =
State->size();
7640 Discord_AuthorizationArgs_SetState(&instance_, (
State.has_value() ? &State__str :
nullptr));
7642std::optional<std::string> AuthorizationArgs::Nonce()
const
7644 assert(state_ == DiscordObjectState::Owned);
7645 bool returnIsNonNull__;
7646 Discord_String returnValueNative__;
7647 returnIsNonNull__ = Discord_AuthorizationArgs_Nonce(&instance_, &returnValueNative__);
7648 if (!returnIsNonNull__) {
7651 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7652 returnValueNative__.size);
7653 Discord_Free(returnValueNative__.ptr);
7654 return returnValue__;
7656void AuthorizationArgs::SetNonce(std::optional<std::string> Nonce)
7658 assert(state_ == DiscordObjectState::Owned);
7659 Discord_String Nonce__str{};
7660 if (Nonce.has_value()) {
7661 Nonce__str.ptr =
reinterpret_cast<uint8_t*
>(Nonce->data());
7662 Nonce__str.size = Nonce->size();
7664 Discord_AuthorizationArgs_SetNonce(&instance_, (Nonce.has_value() ? &Nonce__str :
nullptr));
7666std::optional<discordpp::AuthorizationCodeChallenge> AuthorizationArgs::CodeChallenge()
const
7668 assert(state_ == DiscordObjectState::Owned);
7669 bool returnIsNonNull__;
7670 Discord_AuthorizationCodeChallenge returnValueNative__;
7671 returnIsNonNull__ = Discord_AuthorizationArgs_CodeChallenge(&instance_, &returnValueNative__);
7672 if (!returnIsNonNull__) {
7676 DiscordObjectState::Owned);
7677 return returnValue__;
7679void AuthorizationArgs::SetCodeChallenge(
7680 std::optional<discordpp::AuthorizationCodeChallenge> CodeChallenge)
7682 assert(state_ == DiscordObjectState::Owned);
7683 Discord_AuthorizationArgs_SetCodeChallenge(
7684 &instance_, (CodeChallenge.has_value() ? CodeChallenge->instance() :
nullptr));
7686std::optional<discordpp::IntegrationType> AuthorizationArgs::IntegrationType()
const
7688 assert(state_ == DiscordObjectState::Owned);
7689 bool returnIsNonNull__;
7690 Discord_IntegrationType returnValueNative__;
7691 returnIsNonNull__ = Discord_AuthorizationArgs_IntegrationType(&instance_, &returnValueNative__);
7692 if (!returnIsNonNull__) {
7696 return returnValue__;
7698void AuthorizationArgs::SetIntegrationType(
7699 std::optional<discordpp::IntegrationType> IntegrationType)
7701 assert(state_ == DiscordObjectState::Owned);
7702 Discord_AuthorizationArgs_SetIntegrationType(
7704 (
IntegrationType.has_value() ?
reinterpret_cast<Discord_IntegrationType*
>(&*IntegrationType)
7707std::optional<std::string> AuthorizationArgs::CustomSchemeParam()
const
7709 assert(state_ == DiscordObjectState::Owned);
7710 bool returnIsNonNull__;
7711 Discord_String returnValueNative__;
7713 Discord_AuthorizationArgs_CustomSchemeParam(&instance_, &returnValueNative__);
7714 if (!returnIsNonNull__) {
7717 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7718 returnValueNative__.size);
7719 Discord_Free(returnValueNative__.ptr);
7720 return returnValue__;
7722void AuthorizationArgs::SetCustomSchemeParam(std::optional<std::string> CustomSchemeParam)
7724 assert(state_ == DiscordObjectState::Owned);
7725 Discord_String CustomSchemeParam__str{};
7726 if (CustomSchemeParam.has_value()) {
7727 CustomSchemeParam__str.ptr =
reinterpret_cast<uint8_t*
>(CustomSchemeParam->data());
7728 CustomSchemeParam__str.size = CustomSchemeParam->size();
7730 Discord_AuthorizationArgs_SetCustomSchemeParam(
7731 &instance_, (CustomSchemeParam.has_value() ? &CustomSchemeParam__str :
nullptr));
7733const DeviceAuthorizationArgs DeviceAuthorizationArgs::nullobj{{}, DiscordObjectState::Invalid};
7734DeviceAuthorizationArgs::~DeviceAuthorizationArgs()
7736 if (state_ == DiscordObjectState::Owned) {
7738 state_ = DiscordObjectState::Invalid;
7741DeviceAuthorizationArgs::DeviceAuthorizationArgs(DeviceAuthorizationArgs&& other) noexcept
7742 : instance_(other.instance_)
7743 , state_(other.state_)
7745 other.state_ = DiscordObjectState::Invalid;
7747DeviceAuthorizationArgs& DeviceAuthorizationArgs::operator=(
7748 DeviceAuthorizationArgs&& other)
noexcept
7750 if (
this != &other) {
7751 if (state_ == DiscordObjectState::Owned) {
7754 instance_ = other.instance_;
7755 state_ = other.state_;
7756 other.state_ = DiscordObjectState::Invalid;
7760DeviceAuthorizationArgs::DeviceAuthorizationArgs(
const DeviceAuthorizationArgs& arg0)
7765 Discord_DeviceAuthorizationArgs_Clone(&instance_, arg0.instance());
7767 state_ = DiscordObjectState::Owned;
7770DeviceAuthorizationArgs& DeviceAuthorizationArgs::operator=(
const DeviceAuthorizationArgs& arg0)
7772 if (
this != &arg0) {
7773 if (state_ == DiscordObjectState::Owned) {
7775 state_ = DiscordObjectState::Invalid;
7777 if (arg0.state_ == DiscordObjectState::Owned) {
7778 Discord_DeviceAuthorizationArgs_Clone(&instance_, arg0.instance());
7780 state_ = DiscordObjectState::Owned;
7785DeviceAuthorizationArgs::DeviceAuthorizationArgs(Discord_DeviceAuthorizationArgs instance,
7786 DiscordObjectState state)
7787 : instance_(instance)
7791DeviceAuthorizationArgs::DeviceAuthorizationArgs()
7793 assert(state_ == DiscordObjectState::Invalid);
7794 Discord_DeviceAuthorizationArgs_Init(&instance_);
7795 state_ = DiscordObjectState::Owned;
7797void DeviceAuthorizationArgs::Drop()
7799 if (state_ != DiscordObjectState::Owned) {
7802 Discord_DeviceAuthorizationArgs_Drop(&instance_);
7803 state_ = DiscordObjectState::Invalid;
7805uint64_t DeviceAuthorizationArgs::ClientId()
const
7807 assert(state_ == DiscordObjectState::Owned);
7808 uint64_t returnValue__;
7809 returnValue__ = Discord_DeviceAuthorizationArgs_ClientId(&instance_);
7810 return returnValue__;
7812void DeviceAuthorizationArgs::SetClientId(uint64_t ClientId)
7814 assert(state_ == DiscordObjectState::Owned);
7815 Discord_DeviceAuthorizationArgs_SetClientId(&instance_, ClientId);
7817std::string DeviceAuthorizationArgs::Scopes()
const
7819 assert(state_ == DiscordObjectState::Owned);
7820 Discord_String returnValueNative__;
7821 Discord_DeviceAuthorizationArgs_Scopes(&instance_, &returnValueNative__);
7822 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7823 returnValueNative__.size);
7824 Discord_Free(returnValueNative__.ptr);
7825 return returnValue__;
7827void DeviceAuthorizationArgs::SetScopes(std::string Scopes)
7829 assert(state_ == DiscordObjectState::Owned);
7830 Discord_String Scopes__str{(uint8_t*)(Scopes.data()), Scopes.size()};
7831 Discord_DeviceAuthorizationArgs_SetScopes(&instance_, Scopes__str);
7833const VoiceStateHandle VoiceStateHandle::nullobj{{}, DiscordObjectState::Invalid};
7834VoiceStateHandle::~VoiceStateHandle()
7836 if (state_ == DiscordObjectState::Owned) {
7838 state_ = DiscordObjectState::Invalid;
7841VoiceStateHandle::VoiceStateHandle(VoiceStateHandle&& other) noexcept
7842 : instance_(other.instance_)
7843 , state_(other.state_)
7845 other.state_ = DiscordObjectState::Invalid;
7847VoiceStateHandle& VoiceStateHandle::operator=(VoiceStateHandle&& other)
noexcept
7849 if (
this != &other) {
7850 if (state_ == DiscordObjectState::Owned) {
7853 instance_ = other.instance_;
7854 state_ = other.state_;
7855 other.state_ = DiscordObjectState::Invalid;
7859VoiceStateHandle::VoiceStateHandle(
const VoiceStateHandle& other)
7864 Discord_VoiceStateHandle_Clone(&instance_, other.instance());
7866 state_ = DiscordObjectState::Owned;
7869VoiceStateHandle& VoiceStateHandle::operator=(
const VoiceStateHandle& other)
7871 if (
this != &other) {
7872 if (state_ == DiscordObjectState::Owned) {
7874 state_ = DiscordObjectState::Invalid;
7876 if (other.state_ == DiscordObjectState::Owned) {
7877 Discord_VoiceStateHandle_Clone(&instance_, other.instance());
7879 state_ = DiscordObjectState::Owned;
7884VoiceStateHandle::VoiceStateHandle(Discord_VoiceStateHandle instance, DiscordObjectState state)
7885 : instance_(instance)
7889void VoiceStateHandle::Drop()
7891 if (state_ != DiscordObjectState::Owned) {
7894 Discord_VoiceStateHandle_Drop(&instance_);
7895 state_ = DiscordObjectState::Invalid;
7897bool VoiceStateHandle::SelfDeaf()
const
7899 assert(state_ == DiscordObjectState::Owned);
7901 returnValue__ = Discord_VoiceStateHandle_SelfDeaf(&instance_);
7902 return returnValue__;
7904bool VoiceStateHandle::SelfMute()
const
7906 assert(state_ == DiscordObjectState::Owned);
7908 returnValue__ = Discord_VoiceStateHandle_SelfMute(&instance_);
7909 return returnValue__;
7911const VADThresholdSettings VADThresholdSettings::nullobj{{}, DiscordObjectState::Invalid};
7912VADThresholdSettings::~VADThresholdSettings()
7914 if (state_ == DiscordObjectState::Owned) {
7916 state_ = DiscordObjectState::Invalid;
7919VADThresholdSettings::VADThresholdSettings(VADThresholdSettings&& other) noexcept
7920 : instance_(other.instance_)
7921 , state_(other.state_)
7923 other.state_ = DiscordObjectState::Invalid;
7925VADThresholdSettings& VADThresholdSettings::operator=(VADThresholdSettings&& other)
noexcept
7927 if (
this != &other) {
7928 if (state_ == DiscordObjectState::Owned) {
7931 instance_ = other.instance_;
7932 state_ = other.state_;
7933 other.state_ = DiscordObjectState::Invalid;
7937VADThresholdSettings::VADThresholdSettings(Discord_VADThresholdSettings instance,
7938 DiscordObjectState state)
7939 : instance_(instance)
7943void VADThresholdSettings::Drop()
7945 if (state_ != DiscordObjectState::Owned) {
7948 Discord_VADThresholdSettings_Drop(&instance_);
7949 state_ = DiscordObjectState::Invalid;
7951float VADThresholdSettings::VadThreshold()
const
7953 assert(state_ == DiscordObjectState::Owned);
7954 float returnValue__;
7955 returnValue__ = Discord_VADThresholdSettings_VadThreshold(&instance_);
7956 return returnValue__;
7958void VADThresholdSettings::SetVadThreshold(
float VadThreshold)
7960 assert(state_ == DiscordObjectState::Owned);
7961 Discord_VADThresholdSettings_SetVadThreshold(&instance_, VadThreshold);
7963bool VADThresholdSettings::Automatic()
const
7965 assert(state_ == DiscordObjectState::Owned);
7967 returnValue__ = Discord_VADThresholdSettings_Automatic(&instance_);
7968 return returnValue__;
7970void VADThresholdSettings::SetAutomatic(
bool Automatic)
7972 assert(state_ == DiscordObjectState::Owned);
7973 Discord_VADThresholdSettings_SetAutomatic(&instance_, Automatic);
7975const Call Call::nullobj{{}, DiscordObjectState::Invalid};
7978 if (state_ == DiscordObjectState::Owned) {
7980 state_ = DiscordObjectState::Invalid;
7983Call::Call(Call&& other) noexcept
7984 : instance_(other.instance_)
7985 , state_(other.state_)
7987 other.state_ = DiscordObjectState::Invalid;
7989Call& Call::operator=(Call&& other)
noexcept
7991 if (
this != &other) {
7992 if (state_ == DiscordObjectState::Owned) {
7995 instance_ = other.instance_;
7996 state_ = other.state_;
7997 other.state_ = DiscordObjectState::Invalid;
8001Call::Call(
const Call& other)
8006 Discord_Call_Clone(&instance_, other.instance());
8008 state_ = DiscordObjectState::Owned;
8011Call& Call::operator=(
const Call& other)
8013 if (
this != &other) {
8014 if (state_ == DiscordObjectState::Owned) {
8016 state_ = DiscordObjectState::Invalid;
8018 if (other.state_ == DiscordObjectState::Owned) {
8019 Discord_Call_Clone(&instance_, other.instance());
8021 state_ = DiscordObjectState::Owned;
8026Call::Call(Discord_Call instance, DiscordObjectState state)
8027 : instance_(instance)
8033 if (state_ != DiscordObjectState::Owned) {
8036 Discord_Call_Drop(&instance_);
8037 state_ = DiscordObjectState::Invalid;
8041 Discord_String returnValueNative__;
8042 Discord_Call_ErrorToString(
static_cast<Discord_Call_Error
>(type), &returnValueNative__);
8043 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
8044 returnValueNative__.size);
8045 Discord_Free(returnValueNative__.ptr);
8046 return returnValue__;
8050 assert(state_ == DiscordObjectState::Owned);
8051 Discord_AudioModeType returnValue__;
8052 returnValue__ = Discord_Call_GetAudioMode(&instance_);
8055uint64_t Call::GetChannelId()
const
8057 assert(state_ == DiscordObjectState::Owned);
8058 uint64_t returnValue__;
8059 returnValue__ = Discord_Call_GetChannelId(&instance_);
8060 return returnValue__;
8062uint64_t Call::GetGuildId()
const
8064 assert(state_ == DiscordObjectState::Owned);
8065 uint64_t returnValue__;
8066 returnValue__ = Discord_Call_GetGuildId(&instance_);
8067 return returnValue__;
8069bool Call::GetLocalMute(uint64_t userId)
8071 assert(state_ == DiscordObjectState::Owned);
8073 returnValue__ = Discord_Call_GetLocalMute(&instance_, userId);
8074 return returnValue__;
8076std::vector<uint64_t> Call::GetParticipants()
const
8078 assert(state_ == DiscordObjectState::Owned);
8079 Discord_UInt64Span returnValueNative__;
8080 Discord_Call_GetParticipants(&instance_, &returnValueNative__);
8081 std::vector<uint64_t> returnValue__(returnValueNative__.ptr,
8082 returnValueNative__.ptr + returnValueNative__.size);
8083 Discord_Free(returnValueNative__.ptr);
8084 return returnValue__;
8086float Call::GetParticipantVolume(uint64_t userId)
8088 assert(state_ == DiscordObjectState::Owned);
8089 float returnValue__;
8090 returnValue__ = Discord_Call_GetParticipantVolume(&instance_, userId);
8091 return returnValue__;
8093bool Call::GetPTTActive()
8095 assert(state_ == DiscordObjectState::Owned);
8097 returnValue__ = Discord_Call_GetPTTActive(&instance_);
8098 return returnValue__;
8100uint32_t Call::GetPTTReleaseDelay()
8102 assert(state_ == DiscordObjectState::Owned);
8103 uint32_t returnValue__;
8104 returnValue__ = Discord_Call_GetPTTReleaseDelay(&instance_);
8105 return returnValue__;
8107bool Call::GetSelfDeaf()
8109 assert(state_ == DiscordObjectState::Owned);
8111 returnValue__ = Discord_Call_GetSelfDeaf(&instance_);
8112 return returnValue__;
8114bool Call::GetSelfMute()
8116 assert(state_ == DiscordObjectState::Owned);
8118 returnValue__ = Discord_Call_GetSelfMute(&instance_);
8119 return returnValue__;
8123 assert(state_ == DiscordObjectState::Owned);
8124 Discord_Call_Status returnValue__;
8125 returnValue__ = Discord_Call_GetStatus(&instance_);
8130 assert(state_ == DiscordObjectState::Owned);
8131 Discord_VADThresholdSettings returnValueNative__{};
8132 Discord_Call_GetVADThreshold(&instance_, &returnValueNative__);
8134 return returnValue__;
8136std::optional<discordpp::VoiceStateHandle> Call::GetVoiceStateHandle(uint64_t userId)
const
8138 assert(state_ == DiscordObjectState::Owned);
8139 bool returnIsNonNull__;
8140 Discord_VoiceStateHandle returnValueNative__;
8141 returnIsNonNull__ = Discord_Call_GetVoiceStateHandle(&instance_, userId, &returnValueNative__);
8142 if (!returnIsNonNull__) {
8146 return returnValue__;
8150 assert(state_ == DiscordObjectState::Owned);
8151 Discord_Call_SetAudioMode(&instance_,
static_cast<Discord_AudioModeType
>(audioMode));
8153void Call::SetLocalMute(uint64_t userId,
bool mute)
8155 assert(state_ == DiscordObjectState::Owned);
8156 Discord_Call_SetLocalMute(&instance_, userId, mute);
8160 assert(state_ == DiscordObjectState::Owned);
8161 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
8162 auto cb__userData =
new Tcb__UserData(cb);
8163 Discord_Call_OnVoiceStateChanged cb__native = [](
auto userId,
void* userData__) {
8164 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
8165 userData__typed->delegate(userId);
8167 Discord_Call_SetOnVoiceStateChangedCallback(
8168 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
8172 assert(state_ == DiscordObjectState::Owned);
8173 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
8174 auto cb__userData =
new Tcb__UserData(cb);
8175 Discord_Call_OnParticipantChanged cb__native = [](
auto userId,
auto added,
void* userData__) {
8176 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
8177 userData__typed->delegate(userId, added);
8179 Discord_Call_SetParticipantChangedCallback(
8180 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
8182void Call::SetParticipantVolume(uint64_t userId,
float volume)
8184 assert(state_ == DiscordObjectState::Owned);
8185 Discord_Call_SetParticipantVolume(&instance_, userId, volume);
8187void Call::SetPTTActive(
bool active)
8189 assert(state_ == DiscordObjectState::Owned);
8190 Discord_Call_SetPTTActive(&instance_, active);
8192void Call::SetPTTReleaseDelay(uint32_t releaseDelayMs)
8194 assert(state_ == DiscordObjectState::Owned);
8195 Discord_Call_SetPTTReleaseDelay(&instance_, releaseDelayMs);
8197void Call::SetSelfDeaf(
bool deaf)
8199 assert(state_ == DiscordObjectState::Owned);
8200 Discord_Call_SetSelfDeaf(&instance_, deaf);
8202void Call::SetSelfMute(
bool mute)
8204 assert(state_ == DiscordObjectState::Owned);
8205 Discord_Call_SetSelfMute(&instance_, mute);
8209 assert(state_ == DiscordObjectState::Owned);
8210 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
8211 auto cb__userData =
new Tcb__UserData(cb);
8212 Discord_Call_OnSpeakingStatusChanged cb__native =
8213 [](
auto userId,
auto isPlayingSound,
void* userData__) {
8214 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
8215 userData__typed->delegate(userId, isPlayingSound);
8217 Discord_Call_SetSpeakingStatusChangedCallback(
8218 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
8222 assert(state_ == DiscordObjectState::Owned);
8223 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
8224 auto cb__userData =
new Tcb__UserData(cb);
8225 Discord_Call_OnStatusChanged cb__native =
8226 [](
auto status,
auto error,
auto errorDetail,
void* userData__) {
8227 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
8232 Discord_Call_SetStatusChangedCallback(
8233 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
8235void Call::SetVADThreshold(
bool automatic,
float threshold)
8237 assert(state_ == DiscordObjectState::Owned);
8238 Discord_Call_SetVADThreshold(&instance_, automatic, threshold);
8242 Discord_String returnValueNative__;
8243 Discord_Call_StatusToString(
static_cast<Discord_Call_Status
>(type), &returnValueNative__);
8244 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
8245 returnValueNative__.size);
8246 Discord_Free(returnValueNative__.ptr);
8247 return returnValue__;
8249const ChannelHandle ChannelHandle::nullobj{{}, DiscordObjectState::Invalid};
8250ChannelHandle::~ChannelHandle()
8252 if (state_ == DiscordObjectState::Owned) {
8254 state_ = DiscordObjectState::Invalid;
8257ChannelHandle::ChannelHandle(ChannelHandle&& other) noexcept
8258 : instance_(other.instance_)
8259 , state_(other.state_)
8261 other.state_ = DiscordObjectState::Invalid;
8263ChannelHandle& ChannelHandle::operator=(ChannelHandle&& other)
noexcept
8265 if (
this != &other) {
8266 if (state_ == DiscordObjectState::Owned) {
8269 instance_ = other.instance_;
8270 state_ = other.state_;
8271 other.state_ = DiscordObjectState::Invalid;
8275ChannelHandle::ChannelHandle(
const ChannelHandle& other)
8280 Discord_ChannelHandle_Clone(&instance_, other.instance());
8282 state_ = DiscordObjectState::Owned;
8285ChannelHandle& ChannelHandle::operator=(
const ChannelHandle& other)
8287 if (
this != &other) {
8288 if (state_ == DiscordObjectState::Owned) {
8290 state_ = DiscordObjectState::Invalid;
8292 if (other.state_ == DiscordObjectState::Owned) {
8293 Discord_ChannelHandle_Clone(&instance_, other.instance());
8295 state_ = DiscordObjectState::Owned;
8300ChannelHandle::ChannelHandle(Discord_ChannelHandle instance, DiscordObjectState state)
8301 : instance_(instance)
8305void ChannelHandle::Drop()
8307 if (state_ != DiscordObjectState::Owned) {
8310 Discord_ChannelHandle_Drop(&instance_);
8311 state_ = DiscordObjectState::Invalid;
8313uint64_t ChannelHandle::Id()
const
8315 assert(state_ == DiscordObjectState::Owned);
8316 uint64_t returnValue__;
8317 returnValue__ = Discord_ChannelHandle_Id(&instance_);
8318 return returnValue__;
8320std::string ChannelHandle::Name()
const
8322 assert(state_ == DiscordObjectState::Owned);
8323 Discord_String returnValueNative__;
8324 Discord_ChannelHandle_Name(&instance_, &returnValueNative__);
8325 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
8326 returnValueNative__.size);
8327 Discord_Free(returnValueNative__.ptr);
8328 return returnValue__;
8330std::vector<uint64_t> ChannelHandle::Recipients()
const
8332 assert(state_ == DiscordObjectState::Owned);
8333 Discord_UInt64Span returnValueNative__;
8334 Discord_ChannelHandle_Recipients(&instance_, &returnValueNative__);
8335 std::vector<uint64_t> returnValue__(returnValueNative__.ptr,
8336 returnValueNative__.ptr + returnValueNative__.size);
8337 Discord_Free(returnValueNative__.ptr);
8338 return returnValue__;
8342 assert(state_ == DiscordObjectState::Owned);
8343 Discord_ChannelType returnValue__;
8344 returnValue__ = Discord_ChannelHandle_Type(&instance_);
8347const GuildMinimal GuildMinimal::nullobj{{}, DiscordObjectState::Invalid};
8348GuildMinimal::~GuildMinimal()
8350 if (state_ == DiscordObjectState::Owned) {
8352 state_ = DiscordObjectState::Invalid;
8355GuildMinimal::GuildMinimal(GuildMinimal&& other) noexcept
8356 : instance_(other.instance_)
8357 , state_(other.state_)
8359 other.state_ = DiscordObjectState::Invalid;
8361GuildMinimal& GuildMinimal::operator=(GuildMinimal&& other)
noexcept
8363 if (
this != &other) {
8364 if (state_ == DiscordObjectState::Owned) {
8367 instance_ = other.instance_;
8368 state_ = other.state_;
8369 other.state_ = DiscordObjectState::Invalid;
8373GuildMinimal::GuildMinimal(
const GuildMinimal& arg0)
8378 Discord_GuildMinimal_Clone(&instance_, arg0.instance());
8380 state_ = DiscordObjectState::Owned;
8383GuildMinimal& GuildMinimal::operator=(
const GuildMinimal& arg0)
8385 if (
this != &arg0) {
8386 if (state_ == DiscordObjectState::Owned) {
8388 state_ = DiscordObjectState::Invalid;
8390 if (arg0.state_ == DiscordObjectState::Owned) {
8391 Discord_GuildMinimal_Clone(&instance_, arg0.instance());
8393 state_ = DiscordObjectState::Owned;
8398GuildMinimal::GuildMinimal(Discord_GuildMinimal instance, DiscordObjectState state)
8399 : instance_(instance)
8403void GuildMinimal::Drop()
8405 if (state_ != DiscordObjectState::Owned) {
8408 Discord_GuildMinimal_Drop(&instance_);
8409 state_ = DiscordObjectState::Invalid;
8411uint64_t GuildMinimal::Id()
const
8413 assert(state_ == DiscordObjectState::Owned);
8414 uint64_t returnValue__;
8415 returnValue__ = Discord_GuildMinimal_Id(&instance_);
8416 return returnValue__;
8418void GuildMinimal::SetId(uint64_t Id)
8420 assert(state_ == DiscordObjectState::Owned);
8421 Discord_GuildMinimal_SetId(&instance_, Id);
8423std::string GuildMinimal::Name()
const
8425 assert(state_ == DiscordObjectState::Owned);
8426 Discord_String returnValueNative__;
8427 Discord_GuildMinimal_Name(&instance_, &returnValueNative__);
8428 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
8429 returnValueNative__.size);
8430 Discord_Free(returnValueNative__.ptr);
8431 return returnValue__;
8433void GuildMinimal::SetName(std::string Name)
8435 assert(state_ == DiscordObjectState::Owned);
8436 Discord_String Name__str{(uint8_t*)(
Name.data()),
Name.size()};
8437 Discord_GuildMinimal_SetName(&instance_, Name__str);
8439const GuildChannel GuildChannel::nullobj{{}, DiscordObjectState::Invalid};
8440GuildChannel::~GuildChannel()
8442 if (state_ == DiscordObjectState::Owned) {
8444 state_ = DiscordObjectState::Invalid;
8447GuildChannel::GuildChannel(GuildChannel&& other) noexcept
8448 : instance_(other.instance_)
8449 , state_(other.state_)
8451 other.state_ = DiscordObjectState::Invalid;
8453GuildChannel& GuildChannel::operator=(GuildChannel&& other)
noexcept
8455 if (
this != &other) {
8456 if (state_ == DiscordObjectState::Owned) {
8459 instance_ = other.instance_;
8460 state_ = other.state_;
8461 other.state_ = DiscordObjectState::Invalid;
8465GuildChannel::GuildChannel(
const GuildChannel& arg0)
8470 Discord_GuildChannel_Clone(&instance_, arg0.instance());
8472 state_ = DiscordObjectState::Owned;
8475GuildChannel& GuildChannel::operator=(
const GuildChannel& arg0)
8477 if (
this != &arg0) {
8478 if (state_ == DiscordObjectState::Owned) {
8480 state_ = DiscordObjectState::Invalid;
8482 if (arg0.state_ == DiscordObjectState::Owned) {
8483 Discord_GuildChannel_Clone(&instance_, arg0.instance());
8485 state_ = DiscordObjectState::Owned;
8490GuildChannel::GuildChannel(Discord_GuildChannel instance, DiscordObjectState state)
8491 : instance_(instance)
8495void GuildChannel::Drop()
8497 if (state_ != DiscordObjectState::Owned) {
8500 Discord_GuildChannel_Drop(&instance_);
8501 state_ = DiscordObjectState::Invalid;
8503uint64_t GuildChannel::Id()
const
8505 assert(state_ == DiscordObjectState::Owned);
8506 uint64_t returnValue__;
8507 returnValue__ = Discord_GuildChannel_Id(&instance_);
8508 return returnValue__;
8510void GuildChannel::SetId(uint64_t Id)
8512 assert(state_ == DiscordObjectState::Owned);
8513 Discord_GuildChannel_SetId(&instance_, Id);
8515std::string GuildChannel::Name()
const
8517 assert(state_ == DiscordObjectState::Owned);
8518 Discord_String returnValueNative__;
8519 Discord_GuildChannel_Name(&instance_, &returnValueNative__);
8520 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
8521 returnValueNative__.size);
8522 Discord_Free(returnValueNative__.ptr);
8523 return returnValue__;
8525void GuildChannel::SetName(std::string Name)
8527 assert(state_ == DiscordObjectState::Owned);
8528 Discord_String Name__str{(uint8_t*)(
Name.data()),
Name.size()};
8529 Discord_GuildChannel_SetName(&instance_, Name__str);
8533 assert(state_ == DiscordObjectState::Owned);
8534 Discord_ChannelType returnValue__;
8535 returnValue__ = Discord_GuildChannel_Type(&instance_);
8540 assert(state_ == DiscordObjectState::Owned);
8541 Discord_GuildChannel_SetType(&instance_,
static_cast<Discord_ChannelType
>(Type));
8543int32_t GuildChannel::Position()
const
8545 assert(state_ == DiscordObjectState::Owned);
8546 int32_t returnValue__;
8547 returnValue__ = Discord_GuildChannel_Position(&instance_);
8548 return returnValue__;
8550void GuildChannel::SetPosition(int32_t Position)
8552 assert(state_ == DiscordObjectState::Owned);
8553 Discord_GuildChannel_SetPosition(&instance_, Position);
8555std::optional<uint64_t> GuildChannel::ParentId()
const
8557 assert(state_ == DiscordObjectState::Owned);
8558 bool returnIsNonNull__;
8559 uint64_t returnValue__;
8560 returnIsNonNull__ = Discord_GuildChannel_ParentId(&instance_, &returnValue__);
8561 if (!returnIsNonNull__) {
8562 return std::nullopt;
8564 return returnValue__;
8566void GuildChannel::SetParentId(std::optional<uint64_t> ParentId)
8568 assert(state_ == DiscordObjectState::Owned);
8569 Discord_GuildChannel_SetParentId(&instance_, (ParentId.has_value() ? &*ParentId :
nullptr));
8571bool GuildChannel::IsLinkable()
const
8573 assert(state_ == DiscordObjectState::Owned);
8575 returnValue__ = Discord_GuildChannel_IsLinkable(&instance_);
8576 return returnValue__;
8578void GuildChannel::SetIsLinkable(
bool IsLinkable)
8580 assert(state_ == DiscordObjectState::Owned);
8581 Discord_GuildChannel_SetIsLinkable(&instance_, IsLinkable);
8583bool GuildChannel::IsViewableAndWriteableByAllMembers()
const
8585 assert(state_ == DiscordObjectState::Owned);
8587 returnValue__ = Discord_GuildChannel_IsViewableAndWriteableByAllMembers(&instance_);
8588 return returnValue__;
8590void GuildChannel::SetIsViewableAndWriteableByAllMembers(
bool IsViewableAndWriteableByAllMembers)
8592 assert(state_ == DiscordObjectState::Owned);
8593 Discord_GuildChannel_SetIsViewableAndWriteableByAllMembers(&instance_,
8594 IsViewableAndWriteableByAllMembers);
8596std::optional<discordpp::LinkedLobby> GuildChannel::LinkedLobby()
const
8598 assert(state_ == DiscordObjectState::Owned);
8599 bool returnIsNonNull__;
8600 Discord_LinkedLobby returnValueNative__;
8601 returnIsNonNull__ = Discord_GuildChannel_LinkedLobby(&instance_, &returnValueNative__);
8602 if (!returnIsNonNull__) {
8606 return returnValue__;
8608void GuildChannel::SetLinkedLobby(std::optional<discordpp::LinkedLobby> LinkedLobby)
8610 assert(state_ == DiscordObjectState::Owned);
8611 Discord_GuildChannel_SetLinkedLobby(
8612 &instance_, (LinkedLobby.has_value() ? LinkedLobby->instance() :
nullptr));
8614const LinkedLobby LinkedLobby::nullobj{{}, DiscordObjectState::Invalid};
8615LinkedLobby::~LinkedLobby()
8617 if (state_ == DiscordObjectState::Owned) {
8619 state_ = DiscordObjectState::Invalid;
8622LinkedLobby::LinkedLobby(LinkedLobby&& other) noexcept
8623 : instance_(other.instance_)
8624 , state_(other.state_)
8626 other.state_ = DiscordObjectState::Invalid;
8628LinkedLobby& LinkedLobby::operator=(LinkedLobby&& other)
noexcept
8630 if (
this != &other) {
8631 if (state_ == DiscordObjectState::Owned) {
8634 instance_ = other.instance_;
8635 state_ = other.state_;
8636 other.state_ = DiscordObjectState::Invalid;
8640LinkedLobby::LinkedLobby(
const LinkedLobby& arg0)
8645 Discord_LinkedLobby_Clone(&instance_, arg0.instance());
8647 state_ = DiscordObjectState::Owned;
8650LinkedLobby& LinkedLobby::operator=(
const LinkedLobby& arg0)
8652 if (
this != &arg0) {
8653 if (state_ == DiscordObjectState::Owned) {
8655 state_ = DiscordObjectState::Invalid;
8657 if (arg0.state_ == DiscordObjectState::Owned) {
8658 Discord_LinkedLobby_Clone(&instance_, arg0.instance());
8660 state_ = DiscordObjectState::Owned;
8665LinkedLobby::LinkedLobby(Discord_LinkedLobby instance, DiscordObjectState state)
8666 : instance_(instance)
8670LinkedLobby::LinkedLobby()
8672 assert(state_ == DiscordObjectState::Invalid);
8673 Discord_LinkedLobby_Init(&instance_);
8674 state_ = DiscordObjectState::Owned;
8676void LinkedLobby::Drop()
8678 if (state_ != DiscordObjectState::Owned) {
8681 Discord_LinkedLobby_Drop(&instance_);
8682 state_ = DiscordObjectState::Invalid;
8684uint64_t LinkedLobby::ApplicationId()
const
8686 assert(state_ == DiscordObjectState::Owned);
8687 uint64_t returnValue__;
8688 returnValue__ = Discord_LinkedLobby_ApplicationId(&instance_);
8689 return returnValue__;
8691void LinkedLobby::SetApplicationId(uint64_t ApplicationId)
8693 assert(state_ == DiscordObjectState::Owned);
8694 Discord_LinkedLobby_SetApplicationId(&instance_, ApplicationId);
8696uint64_t LinkedLobby::LobbyId()
const
8698 assert(state_ == DiscordObjectState::Owned);
8699 uint64_t returnValue__;
8700 returnValue__ = Discord_LinkedLobby_LobbyId(&instance_);
8701 return returnValue__;
8703void LinkedLobby::SetLobbyId(uint64_t LobbyId)
8705 assert(state_ == DiscordObjectState::Owned);
8706 Discord_LinkedLobby_SetLobbyId(&instance_, LobbyId);
8708const LinkedChannel LinkedChannel::nullobj{{}, DiscordObjectState::Invalid};
8709LinkedChannel::~LinkedChannel()
8711 if (state_ == DiscordObjectState::Owned) {
8713 state_ = DiscordObjectState::Invalid;
8716LinkedChannel::LinkedChannel(LinkedChannel&& other) noexcept
8717 : instance_(other.instance_)
8718 , state_(other.state_)
8720 other.state_ = DiscordObjectState::Invalid;
8722LinkedChannel& LinkedChannel::operator=(LinkedChannel&& other)
noexcept
8724 if (
this != &other) {
8725 if (state_ == DiscordObjectState::Owned) {
8728 instance_ = other.instance_;
8729 state_ = other.state_;
8730 other.state_ = DiscordObjectState::Invalid;
8734LinkedChannel::LinkedChannel(
const LinkedChannel& arg0)
8739 Discord_LinkedChannel_Clone(&instance_, arg0.instance());
8741 state_ = DiscordObjectState::Owned;
8744LinkedChannel& LinkedChannel::operator=(
const LinkedChannel& arg0)
8746 if (
this != &arg0) {
8747 if (state_ == DiscordObjectState::Owned) {
8749 state_ = DiscordObjectState::Invalid;
8751 if (arg0.state_ == DiscordObjectState::Owned) {
8752 Discord_LinkedChannel_Clone(&instance_, arg0.instance());
8754 state_ = DiscordObjectState::Owned;
8759LinkedChannel::LinkedChannel(Discord_LinkedChannel instance, DiscordObjectState state)
8760 : instance_(instance)
8764void LinkedChannel::Drop()
8766 if (state_ != DiscordObjectState::Owned) {
8769 Discord_LinkedChannel_Drop(&instance_);
8770 state_ = DiscordObjectState::Invalid;
8772uint64_t LinkedChannel::Id()
const
8774 assert(state_ == DiscordObjectState::Owned);
8775 uint64_t returnValue__;
8776 returnValue__ = Discord_LinkedChannel_Id(&instance_);
8777 return returnValue__;
8779void LinkedChannel::SetId(uint64_t Id)
8781 assert(state_ == DiscordObjectState::Owned);
8782 Discord_LinkedChannel_SetId(&instance_, Id);
8784std::string LinkedChannel::Name()
const
8786 assert(state_ == DiscordObjectState::Owned);
8787 Discord_String returnValueNative__;
8788 Discord_LinkedChannel_Name(&instance_, &returnValueNative__);
8789 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
8790 returnValueNative__.size);
8791 Discord_Free(returnValueNative__.ptr);
8792 return returnValue__;
8794void LinkedChannel::SetName(std::string Name)
8796 assert(state_ == DiscordObjectState::Owned);
8797 Discord_String Name__str{(uint8_t*)(
Name.data()),
Name.size()};
8798 Discord_LinkedChannel_SetName(&instance_, Name__str);
8800uint64_t LinkedChannel::GuildId()
const
8802 assert(state_ == DiscordObjectState::Owned);
8803 uint64_t returnValue__;
8804 returnValue__ = Discord_LinkedChannel_GuildId(&instance_);
8805 return returnValue__;
8807void LinkedChannel::SetGuildId(uint64_t GuildId)
8809 assert(state_ == DiscordObjectState::Owned);
8810 Discord_LinkedChannel_SetGuildId(&instance_, GuildId);
8812const RelationshipHandle RelationshipHandle::nullobj{{}, DiscordObjectState::Invalid};
8813RelationshipHandle::~RelationshipHandle()
8815 if (state_ == DiscordObjectState::Owned) {
8817 state_ = DiscordObjectState::Invalid;
8820RelationshipHandle::RelationshipHandle(RelationshipHandle&& other) noexcept
8821 : instance_(other.instance_)
8822 , state_(other.state_)
8824 other.state_ = DiscordObjectState::Invalid;
8826RelationshipHandle& RelationshipHandle::operator=(RelationshipHandle&& other)
noexcept
8828 if (
this != &other) {
8829 if (state_ == DiscordObjectState::Owned) {
8832 instance_ = other.instance_;
8833 state_ = other.state_;
8834 other.state_ = DiscordObjectState::Invalid;
8838RelationshipHandle::RelationshipHandle(
const RelationshipHandle& other)
8843 Discord_RelationshipHandle_Clone(&instance_, other.instance());
8845 state_ = DiscordObjectState::Owned;
8848RelationshipHandle& RelationshipHandle::operator=(
const RelationshipHandle& other)
8850 if (
this != &other) {
8851 if (state_ == DiscordObjectState::Owned) {
8853 state_ = DiscordObjectState::Invalid;
8855 if (other.state_ == DiscordObjectState::Owned) {
8856 Discord_RelationshipHandle_Clone(&instance_, other.instance());
8858 state_ = DiscordObjectState::Owned;
8863RelationshipHandle::RelationshipHandle(Discord_RelationshipHandle instance,
8864 DiscordObjectState state)
8865 : instance_(instance)
8869void RelationshipHandle::Drop()
8871 if (state_ != DiscordObjectState::Owned) {
8874 Discord_RelationshipHandle_Drop(&instance_);
8875 state_ = DiscordObjectState::Invalid;
8879 assert(state_ == DiscordObjectState::Owned);
8880 Discord_RelationshipType returnValue__;
8881 returnValue__ = Discord_RelationshipHandle_DiscordRelationshipType(&instance_);
8886 assert(state_ == DiscordObjectState::Owned);
8887 Discord_RelationshipType returnValue__;
8888 returnValue__ = Discord_RelationshipHandle_GameRelationshipType(&instance_);
8891uint64_t RelationshipHandle::Id()
const
8893 assert(state_ == DiscordObjectState::Owned);
8894 uint64_t returnValue__;
8895 returnValue__ = Discord_RelationshipHandle_Id(&instance_);
8896 return returnValue__;
8898bool RelationshipHandle::IsSpamRequest()
const
8900 assert(state_ == DiscordObjectState::Owned);
8902 returnValue__ = Discord_RelationshipHandle_IsSpamRequest(&instance_);
8903 return returnValue__;
8905std::optional<discordpp::UserHandle> RelationshipHandle::User()
const
8907 assert(state_ == DiscordObjectState::Owned);
8908 bool returnIsNonNull__;
8909 Discord_UserHandle returnValueNative__;
8910 returnIsNonNull__ = Discord_RelationshipHandle_User(&instance_, &returnValueNative__);
8911 if (!returnIsNonNull__) {
8915 return returnValue__;
8917const UserApplicationProfileHandle UserApplicationProfileHandle::nullobj{
8919 DiscordObjectState::Invalid};
8920UserApplicationProfileHandle::~UserApplicationProfileHandle()
8922 if (state_ == DiscordObjectState::Owned) {
8924 state_ = DiscordObjectState::Invalid;
8927UserApplicationProfileHandle::UserApplicationProfileHandle(
8928 UserApplicationProfileHandle&& other) noexcept
8929 : instance_(other.instance_)
8930 , state_(other.state_)
8932 other.state_ = DiscordObjectState::Invalid;
8934UserApplicationProfileHandle& UserApplicationProfileHandle::operator=(
8935 UserApplicationProfileHandle&& other)
noexcept
8937 if (
this != &other) {
8938 if (state_ == DiscordObjectState::Owned) {
8941 instance_ = other.instance_;
8942 state_ = other.state_;
8943 other.state_ = DiscordObjectState::Invalid;
8947UserApplicationProfileHandle::UserApplicationProfileHandle(
8948 const UserApplicationProfileHandle& other)
8953 Discord_UserApplicationProfileHandle_Clone(&instance_, other.instance());
8955 state_ = DiscordObjectState::Owned;
8958UserApplicationProfileHandle& UserApplicationProfileHandle::operator=(
8959 const UserApplicationProfileHandle& other)
8961 if (
this != &other) {
8962 if (state_ == DiscordObjectState::Owned) {
8964 state_ = DiscordObjectState::Invalid;
8966 if (other.state_ == DiscordObjectState::Owned) {
8967 Discord_UserApplicationProfileHandle_Clone(&instance_, other.instance());
8969 state_ = DiscordObjectState::Owned;
8974UserApplicationProfileHandle::UserApplicationProfileHandle(
8975 Discord_UserApplicationProfileHandle instance,
8976 DiscordObjectState state)
8977 : instance_(instance)
8981void UserApplicationProfileHandle::Drop()
8983 if (state_ != DiscordObjectState::Owned) {
8986 Discord_UserApplicationProfileHandle_Drop(&instance_);
8987 state_ = DiscordObjectState::Invalid;
8989std::string UserApplicationProfileHandle::AvatarHash()
const
8991 assert(state_ == DiscordObjectState::Owned);
8992 Discord_String returnValueNative__;
8993 Discord_UserApplicationProfileHandle_AvatarHash(&instance_, &returnValueNative__);
8994 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
8995 returnValueNative__.size);
8996 Discord_Free(returnValueNative__.ptr);
8997 return returnValue__;
8999std::string UserApplicationProfileHandle::Metadata()
const
9001 assert(state_ == DiscordObjectState::Owned);
9002 Discord_String returnValueNative__;
9003 Discord_UserApplicationProfileHandle_Metadata(&instance_, &returnValueNative__);
9004 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
9005 returnValueNative__.size);
9006 Discord_Free(returnValueNative__.ptr);
9007 return returnValue__;
9009std::optional<std::string> UserApplicationProfileHandle::ProviderId()
const
9011 assert(state_ == DiscordObjectState::Owned);
9012 bool returnIsNonNull__;
9013 Discord_String returnValueNative__;
9015 Discord_UserApplicationProfileHandle_ProviderId(&instance_, &returnValueNative__);
9016 if (!returnIsNonNull__) {
9019 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
9020 returnValueNative__.size);
9021 Discord_Free(returnValueNative__.ptr);
9022 return returnValue__;
9024std::string UserApplicationProfileHandle::ProviderIssuedUserId()
const
9026 assert(state_ == DiscordObjectState::Owned);
9027 Discord_String returnValueNative__;
9028 Discord_UserApplicationProfileHandle_ProviderIssuedUserId(&instance_, &returnValueNative__);
9029 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
9030 returnValueNative__.size);
9031 Discord_Free(returnValueNative__.ptr);
9032 return returnValue__;
9036 assert(state_ == DiscordObjectState::Owned);
9037 Discord_ExternalIdentityProviderType returnValue__;
9038 returnValue__ = Discord_UserApplicationProfileHandle_ProviderType(&instance_);
9041std::string UserApplicationProfileHandle::Username()
const
9043 assert(state_ == DiscordObjectState::Owned);
9044 Discord_String returnValueNative__;
9045 Discord_UserApplicationProfileHandle_Username(&instance_, &returnValueNative__);
9046 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
9047 returnValueNative__.size);
9048 Discord_Free(returnValueNative__.ptr);
9049 return returnValue__;
9051const UserHandle UserHandle::nullobj{{}, DiscordObjectState::Invalid};
9052UserHandle::~UserHandle()
9054 if (state_ == DiscordObjectState::Owned) {
9056 state_ = DiscordObjectState::Invalid;
9059UserHandle::UserHandle(UserHandle&& other) noexcept
9060 : instance_(other.instance_)
9061 , state_(other.state_)
9063 other.state_ = DiscordObjectState::Invalid;
9065UserHandle& UserHandle::operator=(UserHandle&& other)
noexcept
9067 if (
this != &other) {
9068 if (state_ == DiscordObjectState::Owned) {
9071 instance_ = other.instance_;
9072 state_ = other.state_;
9073 other.state_ = DiscordObjectState::Invalid;
9077UserHandle::UserHandle(
const UserHandle& arg0)
9082 Discord_UserHandle_Clone(&instance_, arg0.instance());
9084 state_ = DiscordObjectState::Owned;
9087UserHandle& UserHandle::operator=(
const UserHandle& arg0)
9089 if (
this != &arg0) {
9090 if (state_ == DiscordObjectState::Owned) {
9092 state_ = DiscordObjectState::Invalid;
9094 if (arg0.state_ == DiscordObjectState::Owned) {
9095 Discord_UserHandle_Clone(&instance_, arg0.instance());
9097 state_ = DiscordObjectState::Owned;
9102UserHandle::UserHandle(Discord_UserHandle instance, DiscordObjectState state)
9103 : instance_(instance)
9107void UserHandle::Drop()
9109 if (state_ != DiscordObjectState::Owned) {
9112 Discord_UserHandle_Drop(&instance_);
9113 state_ = DiscordObjectState::Invalid;
9115std::optional<std::string> UserHandle::Avatar()
const
9117 assert(state_ == DiscordObjectState::Owned);
9118 bool returnIsNonNull__;
9119 Discord_String returnValueNative__;
9120 returnIsNonNull__ = Discord_UserHandle_Avatar(&instance_, &returnValueNative__);
9121 if (!returnIsNonNull__) {
9124 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
9125 returnValueNative__.size);
9126 Discord_Free(returnValueNative__.ptr);
9127 return returnValue__;
9131 Discord_String returnValueNative__;
9132 Discord_UserHandle_AvatarTypeToString(
static_cast<Discord_UserHandle_AvatarType
>(type),
9133 &returnValueNative__);
9134 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
9135 returnValueNative__.size);
9136 Discord_Free(returnValueNative__.ptr);
9137 return returnValue__;
9142 assert(state_ == DiscordObjectState::Owned);
9143 Discord_String returnValueNative__;
9144 Discord_UserHandle_AvatarUrl(&instance_,
9145 static_cast<Discord_UserHandle_AvatarType
>(animatedType),
9146 static_cast<Discord_UserHandle_AvatarType
>(staticType),
9147 &returnValueNative__);
9148 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
9149 returnValueNative__.size);
9150 Discord_Free(returnValueNative__.ptr);
9151 return returnValue__;
9153std::string UserHandle::DisplayName()
const
9155 assert(state_ == DiscordObjectState::Owned);
9156 Discord_String returnValueNative__;
9157 Discord_UserHandle_DisplayName(&instance_, &returnValueNative__);
9158 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
9159 returnValueNative__.size);
9160 Discord_Free(returnValueNative__.ptr);
9161 return returnValue__;
9163std::optional<discordpp::Activity> UserHandle::GameActivity()
const
9165 assert(state_ == DiscordObjectState::Owned);
9166 bool returnIsNonNull__;
9167 Discord_Activity returnValueNative__;
9168 returnIsNonNull__ = Discord_UserHandle_GameActivity(&instance_, &returnValueNative__);
9169 if (!returnIsNonNull__) {
9173 return returnValue__;
9175std::optional<std::string> UserHandle::GlobalName()
const
9177 assert(state_ == DiscordObjectState::Owned);
9178 bool returnIsNonNull__;
9179 Discord_String returnValueNative__;
9180 returnIsNonNull__ = Discord_UserHandle_GlobalName(&instance_, &returnValueNative__);
9181 if (!returnIsNonNull__) {
9184 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
9185 returnValueNative__.size);
9186 Discord_Free(returnValueNative__.ptr);
9187 return returnValue__;
9189uint64_t UserHandle::Id()
const
9191 assert(state_ == DiscordObjectState::Owned);
9192 uint64_t returnValue__;
9193 returnValue__ = Discord_UserHandle_Id(&instance_);
9194 return returnValue__;
9196bool UserHandle::IsProvisional()
const
9198 assert(state_ == DiscordObjectState::Owned);
9200 returnValue__ = Discord_UserHandle_IsProvisional(&instance_);
9201 return returnValue__;
9205 assert(state_ == DiscordObjectState::Owned);
9206 Discord_RelationshipHandle returnValueNative__{};
9207 Discord_UserHandle_Relationship(&instance_, &returnValueNative__);
9209 return returnValue__;
9213 assert(state_ == DiscordObjectState::Owned);
9214 Discord_StatusType returnValue__;
9215 returnValue__ = Discord_UserHandle_Status(&instance_);
9218std::vector<discordpp::UserApplicationProfileHandle> UserHandle::UserApplicationProfiles()
const
9220 assert(state_ == DiscordObjectState::Owned);
9221 Discord_UserApplicationProfileHandleSpan returnValueNative__;
9222 Discord_UserHandle_UserApplicationProfiles(&instance_, &returnValueNative__);
9223 std::vector<discordpp::UserApplicationProfileHandle> returnValue__;
9224 returnValue__.reserve(returnValueNative__.size);
9225 for (
size_t i__ = 0; i__ < returnValueNative__.size; ++i__) {
9226 returnValue__.emplace_back(returnValueNative__.ptr[i__], DiscordObjectState::Owned);
9228 Discord_Free(returnValueNative__.ptr);
9229 return returnValue__;
9231std::string UserHandle::Username()
const
9233 assert(state_ == DiscordObjectState::Owned);
9234 Discord_String returnValueNative__;
9235 Discord_UserHandle_Username(&instance_, &returnValueNative__);
9236 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
9237 returnValueNative__.size);
9238 Discord_Free(returnValueNative__.ptr);
9239 return returnValue__;
9241const LobbyMemberHandle LobbyMemberHandle::nullobj{{}, DiscordObjectState::Invalid};
9242LobbyMemberHandle::~LobbyMemberHandle()
9244 if (state_ == DiscordObjectState::Owned) {
9246 state_ = DiscordObjectState::Invalid;
9249LobbyMemberHandle::LobbyMemberHandle(LobbyMemberHandle&& other) noexcept
9250 : instance_(other.instance_)
9251 , state_(other.state_)
9253 other.state_ = DiscordObjectState::Invalid;
9255LobbyMemberHandle& LobbyMemberHandle::operator=(LobbyMemberHandle&& other)
noexcept
9257 if (
this != &other) {
9258 if (state_ == DiscordObjectState::Owned) {
9261 instance_ = other.instance_;
9262 state_ = other.state_;
9263 other.state_ = DiscordObjectState::Invalid;
9267LobbyMemberHandle::LobbyMemberHandle(
const LobbyMemberHandle& other)
9272 Discord_LobbyMemberHandle_Clone(&instance_, other.instance());
9274 state_ = DiscordObjectState::Owned;
9277LobbyMemberHandle& LobbyMemberHandle::operator=(
const LobbyMemberHandle& other)
9279 if (
this != &other) {
9280 if (state_ == DiscordObjectState::Owned) {
9282 state_ = DiscordObjectState::Invalid;
9284 if (other.state_ == DiscordObjectState::Owned) {
9285 Discord_LobbyMemberHandle_Clone(&instance_, other.instance());
9287 state_ = DiscordObjectState::Owned;
9292LobbyMemberHandle::LobbyMemberHandle(Discord_LobbyMemberHandle instance, DiscordObjectState state)
9293 : instance_(instance)
9297void LobbyMemberHandle::Drop()
9299 if (state_ != DiscordObjectState::Owned) {
9302 Discord_LobbyMemberHandle_Drop(&instance_);
9303 state_ = DiscordObjectState::Invalid;
9305bool LobbyMemberHandle::CanLinkLobby()
const
9307 assert(state_ == DiscordObjectState::Owned);
9309 returnValue__ = Discord_LobbyMemberHandle_CanLinkLobby(&instance_);
9310 return returnValue__;
9312bool LobbyMemberHandle::Connected()
const
9314 assert(state_ == DiscordObjectState::Owned);
9316 returnValue__ = Discord_LobbyMemberHandle_Connected(&instance_);
9317 return returnValue__;
9319uint64_t LobbyMemberHandle::Id()
const
9321 assert(state_ == DiscordObjectState::Owned);
9322 uint64_t returnValue__;
9323 returnValue__ = Discord_LobbyMemberHandle_Id(&instance_);
9324 return returnValue__;
9326std::unordered_map<std::string, std::string> LobbyMemberHandle::Metadata()
const
9328 assert(state_ == DiscordObjectState::Owned);
9329 Discord_Properties returnValueNative__;
9330 Discord_LobbyMemberHandle_Metadata(&instance_, &returnValueNative__);
9331 std::unordered_map<std::string, std::string> returnValue__ =
9332 ConvertReturnedProperties(returnValueNative__);
9333 Discord_FreeProperties(returnValueNative__);
9334 return returnValue__;
9336std::optional<discordpp::UserHandle> LobbyMemberHandle::User()
const
9338 assert(state_ == DiscordObjectState::Owned);
9339 bool returnIsNonNull__;
9340 Discord_UserHandle returnValueNative__;
9341 returnIsNonNull__ = Discord_LobbyMemberHandle_User(&instance_, &returnValueNative__);
9342 if (!returnIsNonNull__) {
9346 return returnValue__;
9348const LobbyHandle LobbyHandle::nullobj{{}, DiscordObjectState::Invalid};
9349LobbyHandle::~LobbyHandle()
9351 if (state_ == DiscordObjectState::Owned) {
9353 state_ = DiscordObjectState::Invalid;
9356LobbyHandle::LobbyHandle(LobbyHandle&& other) noexcept
9357 : instance_(other.instance_)
9358 , state_(other.state_)
9360 other.state_ = DiscordObjectState::Invalid;
9362LobbyHandle& LobbyHandle::operator=(LobbyHandle&& other)
noexcept
9364 if (
this != &other) {
9365 if (state_ == DiscordObjectState::Owned) {
9368 instance_ = other.instance_;
9369 state_ = other.state_;
9370 other.state_ = DiscordObjectState::Invalid;
9374LobbyHandle::LobbyHandle(
const LobbyHandle& other)
9379 Discord_LobbyHandle_Clone(&instance_, other.instance());
9381 state_ = DiscordObjectState::Owned;
9384LobbyHandle& LobbyHandle::operator=(
const LobbyHandle& other)
9386 if (
this != &other) {
9387 if (state_ == DiscordObjectState::Owned) {
9389 state_ = DiscordObjectState::Invalid;
9391 if (other.state_ == DiscordObjectState::Owned) {
9392 Discord_LobbyHandle_Clone(&instance_, other.instance());
9394 state_ = DiscordObjectState::Owned;
9399LobbyHandle::LobbyHandle(Discord_LobbyHandle instance, DiscordObjectState state)
9400 : instance_(instance)
9404void LobbyHandle::Drop()
9406 if (state_ != DiscordObjectState::Owned) {
9409 Discord_LobbyHandle_Drop(&instance_);
9410 state_ = DiscordObjectState::Invalid;
9412std::optional<discordpp::CallInfoHandle> LobbyHandle::GetCallInfoHandle()
const
9414 assert(state_ == DiscordObjectState::Owned);
9415 bool returnIsNonNull__;
9416 Discord_CallInfoHandle returnValueNative__;
9417 returnIsNonNull__ = Discord_LobbyHandle_GetCallInfoHandle(&instance_, &returnValueNative__);
9418 if (!returnIsNonNull__) {
9422 return returnValue__;
9424std::optional<discordpp::LobbyMemberHandle> LobbyHandle::GetLobbyMemberHandle(
9425 uint64_t memberId)
const
9427 assert(state_ == DiscordObjectState::Owned);
9428 bool returnIsNonNull__;
9429 Discord_LobbyMemberHandle returnValueNative__;
9431 Discord_LobbyHandle_GetLobbyMemberHandle(&instance_, memberId, &returnValueNative__);
9432 if (!returnIsNonNull__) {
9436 return returnValue__;
9438uint64_t LobbyHandle::Id()
const
9440 assert(state_ == DiscordObjectState::Owned);
9441 uint64_t returnValue__;
9442 returnValue__ = Discord_LobbyHandle_Id(&instance_);
9443 return returnValue__;
9445std::optional<discordpp::LinkedChannel> LobbyHandle::LinkedChannel()
const
9447 assert(state_ == DiscordObjectState::Owned);
9448 bool returnIsNonNull__;
9449 Discord_LinkedChannel returnValueNative__;
9450 returnIsNonNull__ = Discord_LobbyHandle_LinkedChannel(&instance_, &returnValueNative__);
9451 if (!returnIsNonNull__) {
9455 return returnValue__;
9457std::vector<uint64_t> LobbyHandle::LobbyMemberIds()
const
9459 assert(state_ == DiscordObjectState::Owned);
9460 Discord_UInt64Span returnValueNative__;
9461 Discord_LobbyHandle_LobbyMemberIds(&instance_, &returnValueNative__);
9462 std::vector<uint64_t> returnValue__(returnValueNative__.ptr,
9463 returnValueNative__.ptr + returnValueNative__.size);
9464 Discord_Free(returnValueNative__.ptr);
9465 return returnValue__;
9467std::vector<discordpp::LobbyMemberHandle> LobbyHandle::LobbyMembers()
const
9469 assert(state_ == DiscordObjectState::Owned);
9470 Discord_LobbyMemberHandleSpan returnValueNative__;
9471 Discord_LobbyHandle_LobbyMembers(&instance_, &returnValueNative__);
9472 std::vector<discordpp::LobbyMemberHandle> returnValue__;
9473 returnValue__.reserve(returnValueNative__.size);
9474 for (
size_t i__ = 0; i__ < returnValueNative__.size; ++i__) {
9475 returnValue__.emplace_back(returnValueNative__.ptr[i__], DiscordObjectState::Owned);
9477 Discord_Free(returnValueNative__.ptr);
9478 return returnValue__;
9480std::unordered_map<std::string, std::string> LobbyHandle::Metadata()
const
9482 assert(state_ == DiscordObjectState::Owned);
9483 Discord_Properties returnValueNative__;
9484 Discord_LobbyHandle_Metadata(&instance_, &returnValueNative__);
9485 std::unordered_map<std::string, std::string> returnValue__ =
9486 ConvertReturnedProperties(returnValueNative__);
9487 Discord_FreeProperties(returnValueNative__);
9488 return returnValue__;
9490const AdditionalContent AdditionalContent::nullobj{{}, DiscordObjectState::Invalid};
9491AdditionalContent::~AdditionalContent()
9493 if (state_ == DiscordObjectState::Owned) {
9495 state_ = DiscordObjectState::Invalid;
9498AdditionalContent::AdditionalContent(AdditionalContent&& other) noexcept
9499 : instance_(other.instance_)
9500 , state_(other.state_)
9502 other.state_ = DiscordObjectState::Invalid;
9504AdditionalContent& AdditionalContent::operator=(AdditionalContent&& other)
noexcept
9506 if (
this != &other) {
9507 if (state_ == DiscordObjectState::Owned) {
9510 instance_ = other.instance_;
9511 state_ = other.state_;
9512 other.state_ = DiscordObjectState::Invalid;
9516AdditionalContent::AdditionalContent(
const AdditionalContent& arg0)
9521 Discord_AdditionalContent_Clone(&instance_, arg0.instance());
9523 state_ = DiscordObjectState::Owned;
9526AdditionalContent& AdditionalContent::operator=(
const AdditionalContent& arg0)
9528 if (
this != &arg0) {
9529 if (state_ == DiscordObjectState::Owned) {
9531 state_ = DiscordObjectState::Invalid;
9533 if (arg0.state_ == DiscordObjectState::Owned) {
9534 Discord_AdditionalContent_Clone(&instance_, arg0.instance());
9536 state_ = DiscordObjectState::Owned;
9541AdditionalContent::AdditionalContent(Discord_AdditionalContent instance, DiscordObjectState state)
9542 : instance_(instance)
9546AdditionalContent::AdditionalContent()
9548 assert(state_ == DiscordObjectState::Invalid);
9549 Discord_AdditionalContent_Init(&instance_);
9550 state_ = DiscordObjectState::Owned;
9552void AdditionalContent::Drop()
9554 if (state_ != DiscordObjectState::Owned) {
9557 Discord_AdditionalContent_Drop(&instance_);
9558 state_ = DiscordObjectState::Invalid;
9562 assert(state_ == DiscordObjectState::Owned);
9564 returnValue__ = Discord_AdditionalContent_Equals(&instance_, rhs.instance());
9565 return returnValue__;
9569 Discord_String returnValueNative__;
9570 Discord_AdditionalContent_TypeToString(
static_cast<Discord_AdditionalContentType
>(type),
9571 &returnValueNative__);
9572 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
9573 returnValueNative__.size);
9574 Discord_Free(returnValueNative__.ptr);
9575 return returnValue__;
9579 assert(state_ == DiscordObjectState::Owned);
9580 Discord_AdditionalContentType returnValue__;
9581 returnValue__ = Discord_AdditionalContent_Type(&instance_);
9586 assert(state_ == DiscordObjectState::Owned);
9587 Discord_AdditionalContent_SetType(&instance_,
static_cast<Discord_AdditionalContentType
>(Type));
9589std::optional<std::string> AdditionalContent::Title()
const
9591 assert(state_ == DiscordObjectState::Owned);
9592 bool returnIsNonNull__;
9593 Discord_String returnValueNative__;
9594 returnIsNonNull__ = Discord_AdditionalContent_Title(&instance_, &returnValueNative__);
9595 if (!returnIsNonNull__) {
9598 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
9599 returnValueNative__.size);
9600 Discord_Free(returnValueNative__.ptr);
9601 return returnValue__;
9603void AdditionalContent::SetTitle(std::optional<std::string> Title)
9605 assert(state_ == DiscordObjectState::Owned);
9606 Discord_String Title__str{};
9607 if (Title.has_value()) {
9608 Title__str.ptr =
reinterpret_cast<uint8_t*
>(Title->data());
9609 Title__str.size = Title->size();
9611 Discord_AdditionalContent_SetTitle(&instance_, (Title.has_value() ? &Title__str :
nullptr));
9613uint8_t AdditionalContent::Count()
const
9615 assert(state_ == DiscordObjectState::Owned);
9616 uint8_t returnValue__;
9617 returnValue__ = Discord_AdditionalContent_Count(&instance_);
9618 return returnValue__;
9620void AdditionalContent::SetCount(uint8_t Count)
9622 assert(state_ == DiscordObjectState::Owned);
9623 Discord_AdditionalContent_SetCount(&instance_, Count);
9625const MessageHandle MessageHandle::nullobj{{}, DiscordObjectState::Invalid};
9626MessageHandle::~MessageHandle()
9628 if (state_ == DiscordObjectState::Owned) {
9630 state_ = DiscordObjectState::Invalid;
9633MessageHandle::MessageHandle(MessageHandle&& other) noexcept
9634 : instance_(other.instance_)
9635 , state_(other.state_)
9637 other.state_ = DiscordObjectState::Invalid;
9639MessageHandle& MessageHandle::operator=(MessageHandle&& other)
noexcept
9641 if (
this != &other) {
9642 if (state_ == DiscordObjectState::Owned) {
9645 instance_ = other.instance_;
9646 state_ = other.state_;
9647 other.state_ = DiscordObjectState::Invalid;
9651MessageHandle::MessageHandle(
const MessageHandle& other)
9656 Discord_MessageHandle_Clone(&instance_, other.instance());
9658 state_ = DiscordObjectState::Owned;
9661MessageHandle& MessageHandle::operator=(
const MessageHandle& other)
9663 if (
this != &other) {
9664 if (state_ == DiscordObjectState::Owned) {
9666 state_ = DiscordObjectState::Invalid;
9668 if (other.state_ == DiscordObjectState::Owned) {
9669 Discord_MessageHandle_Clone(&instance_, other.instance());
9671 state_ = DiscordObjectState::Owned;
9676MessageHandle::MessageHandle(Discord_MessageHandle instance, DiscordObjectState state)
9677 : instance_(instance)
9681void MessageHandle::Drop()
9683 if (state_ != DiscordObjectState::Owned) {
9686 Discord_MessageHandle_Drop(&instance_);
9687 state_ = DiscordObjectState::Invalid;
9689std::optional<discordpp::AdditionalContent> MessageHandle::AdditionalContent()
const
9691 assert(state_ == DiscordObjectState::Owned);
9692 bool returnIsNonNull__;
9693 Discord_AdditionalContent returnValueNative__;
9694 returnIsNonNull__ = Discord_MessageHandle_AdditionalContent(&instance_, &returnValueNative__);
9695 if (!returnIsNonNull__) {
9699 return returnValue__;
9701std::optional<uint64_t> MessageHandle::ApplicationId()
const
9703 assert(state_ == DiscordObjectState::Owned);
9704 bool returnIsNonNull__;
9705 uint64_t returnValue__;
9706 returnIsNonNull__ = Discord_MessageHandle_ApplicationId(&instance_, &returnValue__);
9707 if (!returnIsNonNull__) {
9708 return std::nullopt;
9710 return returnValue__;
9712std::optional<discordpp::UserHandle> MessageHandle::Author()
const
9714 assert(state_ == DiscordObjectState::Owned);
9715 bool returnIsNonNull__;
9716 Discord_UserHandle returnValueNative__;
9717 returnIsNonNull__ = Discord_MessageHandle_Author(&instance_, &returnValueNative__);
9718 if (!returnIsNonNull__) {
9722 return returnValue__;
9724uint64_t MessageHandle::AuthorId()
const
9726 assert(state_ == DiscordObjectState::Owned);
9727 uint64_t returnValue__;
9728 returnValue__ = Discord_MessageHandle_AuthorId(&instance_);
9729 return returnValue__;
9731std::optional<discordpp::ChannelHandle> MessageHandle::Channel()
const
9733 assert(state_ == DiscordObjectState::Owned);
9734 bool returnIsNonNull__;
9735 Discord_ChannelHandle returnValueNative__;
9736 returnIsNonNull__ = Discord_MessageHandle_Channel(&instance_, &returnValueNative__);
9737 if (!returnIsNonNull__) {
9741 return returnValue__;
9743uint64_t MessageHandle::ChannelId()
const
9745 assert(state_ == DiscordObjectState::Owned);
9746 uint64_t returnValue__;
9747 returnValue__ = Discord_MessageHandle_ChannelId(&instance_);
9748 return returnValue__;
9750std::string MessageHandle::Content()
const
9752 assert(state_ == DiscordObjectState::Owned);
9753 Discord_String returnValueNative__;
9754 Discord_MessageHandle_Content(&instance_, &returnValueNative__);
9755 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
9756 returnValueNative__.size);
9757 Discord_Free(returnValueNative__.ptr);
9758 return returnValue__;
9760std::optional<discordpp::DisclosureTypes> MessageHandle::DisclosureType()
const
9762 assert(state_ == DiscordObjectState::Owned);
9763 bool returnIsNonNull__;
9764 Discord_DisclosureTypes returnValueNative__;
9765 returnIsNonNull__ = Discord_MessageHandle_DisclosureType(&instance_, &returnValueNative__);
9766 if (!returnIsNonNull__) {
9770 return returnValue__;
9772uint64_t MessageHandle::EditedTimestamp()
const
9774 assert(state_ == DiscordObjectState::Owned);
9775 uint64_t returnValue__;
9776 returnValue__ = Discord_MessageHandle_EditedTimestamp(&instance_);
9777 return returnValue__;
9779uint64_t MessageHandle::Id()
const
9781 assert(state_ == DiscordObjectState::Owned);
9782 uint64_t returnValue__;
9783 returnValue__ = Discord_MessageHandle_Id(&instance_);
9784 return returnValue__;
9786std::optional<discordpp::LobbyHandle> MessageHandle::Lobby()
const
9788 assert(state_ == DiscordObjectState::Owned);
9789 bool returnIsNonNull__;
9790 Discord_LobbyHandle returnValueNative__;
9791 returnIsNonNull__ = Discord_MessageHandle_Lobby(&instance_, &returnValueNative__);
9792 if (!returnIsNonNull__) {
9796 return returnValue__;
9798std::unordered_map<std::string, std::string> MessageHandle::Metadata()
const
9800 assert(state_ == DiscordObjectState::Owned);
9801 Discord_Properties returnValueNative__;
9802 Discord_MessageHandle_Metadata(&instance_, &returnValueNative__);
9803 std::unordered_map<std::string, std::string> returnValue__ =
9804 ConvertReturnedProperties(returnValueNative__);
9805 Discord_FreeProperties(returnValueNative__);
9806 return returnValue__;
9808std::unordered_map<std::string, std::string> MessageHandle::ModerationMetadata()
const
9810 assert(state_ == DiscordObjectState::Owned);
9811 Discord_Properties returnValueNative__;
9812 Discord_MessageHandle_ModerationMetadata(&instance_, &returnValueNative__);
9813 std::unordered_map<std::string, std::string> returnValue__ =
9814 ConvertReturnedProperties(returnValueNative__);
9815 Discord_FreeProperties(returnValueNative__);
9816 return returnValue__;
9818std::string MessageHandle::RawContent()
const
9820 assert(state_ == DiscordObjectState::Owned);
9821 Discord_String returnValueNative__;
9822 Discord_MessageHandle_RawContent(&instance_, &returnValueNative__);
9823 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
9824 returnValueNative__.size);
9825 Discord_Free(returnValueNative__.ptr);
9826 return returnValue__;
9828std::optional<discordpp::UserHandle> MessageHandle::Recipient()
const
9830 assert(state_ == DiscordObjectState::Owned);
9831 bool returnIsNonNull__;
9832 Discord_UserHandle returnValueNative__;
9833 returnIsNonNull__ = Discord_MessageHandle_Recipient(&instance_, &returnValueNative__);
9834 if (!returnIsNonNull__) {
9838 return returnValue__;
9840uint64_t MessageHandle::RecipientId()
const
9842 assert(state_ == DiscordObjectState::Owned);
9843 uint64_t returnValue__;
9844 returnValue__ = Discord_MessageHandle_RecipientId(&instance_);
9845 return returnValue__;
9847bool MessageHandle::SentFromGame()
const
9849 assert(state_ == DiscordObjectState::Owned);
9851 returnValue__ = Discord_MessageHandle_SentFromGame(&instance_);
9852 return returnValue__;
9854uint64_t MessageHandle::SentTimestamp()
const
9856 assert(state_ == DiscordObjectState::Owned);
9857 uint64_t returnValue__;
9858 returnValue__ = Discord_MessageHandle_SentTimestamp(&instance_);
9859 return returnValue__;
9861const AudioDevice AudioDevice::nullobj{{}, DiscordObjectState::Invalid};
9862AudioDevice::~AudioDevice()
9864 if (state_ == DiscordObjectState::Owned) {
9866 state_ = DiscordObjectState::Invalid;
9869AudioDevice::AudioDevice(AudioDevice&& other) noexcept
9870 : instance_(other.instance_)
9871 , state_(other.state_)
9873 other.state_ = DiscordObjectState::Invalid;
9875AudioDevice& AudioDevice::operator=(AudioDevice&& other)
noexcept
9877 if (
this != &other) {
9878 if (state_ == DiscordObjectState::Owned) {
9881 instance_ = other.instance_;
9882 state_ = other.state_;
9883 other.state_ = DiscordObjectState::Invalid;
9887AudioDevice::AudioDevice(
const AudioDevice& arg0)
9892 Discord_AudioDevice_Clone(&instance_, arg0.instance());
9894 state_ = DiscordObjectState::Owned;
9897AudioDevice& AudioDevice::operator=(
const AudioDevice& arg0)
9899 if (
this != &arg0) {
9900 if (state_ == DiscordObjectState::Owned) {
9902 state_ = DiscordObjectState::Invalid;
9904 if (arg0.state_ == DiscordObjectState::Owned) {
9905 Discord_AudioDevice_Clone(&instance_, arg0.instance());
9907 state_ = DiscordObjectState::Owned;
9912AudioDevice::AudioDevice(Discord_AudioDevice instance, DiscordObjectState state)
9913 : instance_(instance)
9917void AudioDevice::Drop()
9919 if (state_ != DiscordObjectState::Owned) {
9922 Discord_AudioDevice_Drop(&instance_);
9923 state_ = DiscordObjectState::Invalid;
9927 assert(state_ == DiscordObjectState::Owned);
9929 returnValue__ = Discord_AudioDevice_Equals(&instance_, rhs.instance());
9930 return returnValue__;
9932std::string AudioDevice::Id()
const
9934 assert(state_ == DiscordObjectState::Owned);
9935 Discord_String returnValueNative__;
9936 Discord_AudioDevice_Id(&instance_, &returnValueNative__);
9937 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
9938 returnValueNative__.size);
9939 Discord_Free(returnValueNative__.ptr);
9940 return returnValue__;
9942void AudioDevice::SetId(std::string Id)
9944 assert(state_ == DiscordObjectState::Owned);
9945 Discord_String Id__str{(uint8_t*)(Id.data()), Id.size()};
9946 Discord_AudioDevice_SetId(&instance_, Id__str);
9948std::string AudioDevice::Name()
const
9950 assert(state_ == DiscordObjectState::Owned);
9951 Discord_String returnValueNative__;
9952 Discord_AudioDevice_Name(&instance_, &returnValueNative__);
9953 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
9954 returnValueNative__.size);
9955 Discord_Free(returnValueNative__.ptr);
9956 return returnValue__;
9958void AudioDevice::SetName(std::string Name)
9960 assert(state_ == DiscordObjectState::Owned);
9961 Discord_String Name__str{(uint8_t*)(
Name.data()),
Name.size()};
9962 Discord_AudioDevice_SetName(&instance_, Name__str);
9964bool AudioDevice::IsDefault()
const
9966 assert(state_ == DiscordObjectState::Owned);
9968 returnValue__ = Discord_AudioDevice_IsDefault(&instance_);
9969 return returnValue__;
9971void AudioDevice::SetIsDefault(
bool IsDefault)
9973 assert(state_ == DiscordObjectState::Owned);
9974 Discord_AudioDevice_SetIsDefault(&instance_, IsDefault);
9976const UserMessageSummary UserMessageSummary::nullobj{{}, DiscordObjectState::Invalid};
9977UserMessageSummary::~UserMessageSummary()
9979 if (state_ == DiscordObjectState::Owned) {
9981 state_ = DiscordObjectState::Invalid;
9984UserMessageSummary::UserMessageSummary(UserMessageSummary&& other) noexcept
9985 : instance_(other.instance_)
9986 , state_(other.state_)
9988 other.state_ = DiscordObjectState::Invalid;
9990UserMessageSummary& UserMessageSummary::operator=(UserMessageSummary&& other)
noexcept
9992 if (
this != &other) {
9993 if (state_ == DiscordObjectState::Owned) {
9996 instance_ = other.instance_;
9997 state_ = other.state_;
9998 other.state_ = DiscordObjectState::Invalid;
10002UserMessageSummary::UserMessageSummary(
const UserMessageSummary& arg0)
10007 Discord_UserMessageSummary_Clone(&instance_, arg0.instance());
10009 state_ = DiscordObjectState::Owned;
10012UserMessageSummary& UserMessageSummary::operator=(
const UserMessageSummary& arg0)
10014 if (
this != &arg0) {
10015 if (state_ == DiscordObjectState::Owned) {
10017 state_ = DiscordObjectState::Invalid;
10019 if (arg0.state_ == DiscordObjectState::Owned) {
10020 Discord_UserMessageSummary_Clone(&instance_, arg0.instance());
10022 state_ = DiscordObjectState::Owned;
10027UserMessageSummary::UserMessageSummary(Discord_UserMessageSummary instance,
10028 DiscordObjectState state)
10029 : instance_(instance)
10033void UserMessageSummary::Drop()
10035 if (state_ != DiscordObjectState::Owned) {
10038 Discord_UserMessageSummary_Drop(&instance_);
10039 state_ = DiscordObjectState::Invalid;
10041uint64_t UserMessageSummary::LastMessageId()
const
10043 assert(state_ == DiscordObjectState::Owned);
10044 uint64_t returnValue__;
10045 returnValue__ = Discord_UserMessageSummary_LastMessageId(&instance_);
10046 return returnValue__;
10048uint64_t UserMessageSummary::UserId()
const
10050 assert(state_ == DiscordObjectState::Owned);
10051 uint64_t returnValue__;
10052 returnValue__ = Discord_UserMessageSummary_UserId(&instance_);
10053 return returnValue__;
10055const ClientCreateOptions ClientCreateOptions::nullobj{{}, DiscordObjectState::Invalid};
10056ClientCreateOptions::~ClientCreateOptions()
10058 if (state_ == DiscordObjectState::Owned) {
10060 state_ = DiscordObjectState::Invalid;
10063ClientCreateOptions::ClientCreateOptions(ClientCreateOptions&& other) noexcept
10064 : instance_(other.instance_)
10065 , state_(other.state_)
10067 other.state_ = DiscordObjectState::Invalid;
10069ClientCreateOptions& ClientCreateOptions::operator=(ClientCreateOptions&& other)
noexcept
10071 if (
this != &other) {
10072 if (state_ == DiscordObjectState::Owned) {
10075 instance_ = other.instance_;
10076 state_ = other.state_;
10077 other.state_ = DiscordObjectState::Invalid;
10081ClientCreateOptions::ClientCreateOptions(
const ClientCreateOptions& arg0)
10086 Discord_ClientCreateOptions_Clone(&instance_, arg0.instance());
10088 state_ = DiscordObjectState::Owned;
10091ClientCreateOptions& ClientCreateOptions::operator=(
const ClientCreateOptions& arg0)
10093 if (
this != &arg0) {
10094 if (state_ == DiscordObjectState::Owned) {
10096 state_ = DiscordObjectState::Invalid;
10098 if (arg0.state_ == DiscordObjectState::Owned) {
10099 Discord_ClientCreateOptions_Clone(&instance_, arg0.instance());
10101 state_ = DiscordObjectState::Owned;
10106ClientCreateOptions::ClientCreateOptions(Discord_ClientCreateOptions instance,
10107 DiscordObjectState state)
10108 : instance_(instance)
10112ClientCreateOptions::ClientCreateOptions()
10114 assert(state_ == DiscordObjectState::Invalid);
10115 Discord_ClientCreateOptions_Init(&instance_);
10116 state_ = DiscordObjectState::Owned;
10118void ClientCreateOptions::Drop()
10120 if (state_ != DiscordObjectState::Owned) {
10123 Discord_ClientCreateOptions_Drop(&instance_);
10124 state_ = DiscordObjectState::Invalid;
10126std::string ClientCreateOptions::WebBase()
const
10128 assert(state_ == DiscordObjectState::Owned);
10129 Discord_String returnValueNative__;
10130 Discord_ClientCreateOptions_WebBase(&instance_, &returnValueNative__);
10131 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
10132 returnValueNative__.size);
10133 Discord_Free(returnValueNative__.ptr);
10134 return returnValue__;
10136void ClientCreateOptions::SetWebBase(std::string WebBase)
10138 assert(state_ == DiscordObjectState::Owned);
10139 Discord_String WebBase__str{(uint8_t*)(WebBase.data()), WebBase.size()};
10140 Discord_ClientCreateOptions_SetWebBase(&instance_, WebBase__str);
10142std::string ClientCreateOptions::ApiBase()
const
10144 assert(state_ == DiscordObjectState::Owned);
10145 Discord_String returnValueNative__;
10146 Discord_ClientCreateOptions_ApiBase(&instance_, &returnValueNative__);
10147 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
10148 returnValueNative__.size);
10149 Discord_Free(returnValueNative__.ptr);
10150 return returnValue__;
10152void ClientCreateOptions::SetApiBase(std::string ApiBase)
10154 assert(state_ == DiscordObjectState::Owned);
10155 Discord_String ApiBase__str{(uint8_t*)(ApiBase.data()), ApiBase.size()};
10156 Discord_ClientCreateOptions_SetApiBase(&instance_, ApiBase__str);
10160 assert(state_ == DiscordObjectState::Owned);
10161 Discord_AudioSystem returnValue__;
10162 returnValue__ = Discord_ClientCreateOptions_ExperimentalAudioSystem(&instance_);
10167 assert(state_ == DiscordObjectState::Owned);
10168 Discord_ClientCreateOptions_SetExperimentalAudioSystem(
10169 &instance_,
static_cast<Discord_AudioSystem
>(ExperimentalAudioSystem));
10171bool ClientCreateOptions::ExperimentalAndroidPreventCommsForBluetooth()
const
10173 assert(state_ == DiscordObjectState::Owned);
10174 bool returnValue__;
10176 Discord_ClientCreateOptions_ExperimentalAndroidPreventCommsForBluetooth(&instance_);
10177 return returnValue__;
10179void ClientCreateOptions::SetExperimentalAndroidPreventCommsForBluetooth(
10180 bool ExperimentalAndroidPreventCommsForBluetooth)
10182 assert(state_ == DiscordObjectState::Owned);
10183 Discord_ClientCreateOptions_SetExperimentalAndroidPreventCommsForBluetooth(
10184 &instance_, ExperimentalAndroidPreventCommsForBluetooth);
10186std::optional<uint64_t> ClientCreateOptions::CpuAffinityMask()
const
10188 assert(state_ == DiscordObjectState::Owned);
10189 bool returnIsNonNull__;
10190 uint64_t returnValue__;
10191 returnIsNonNull__ = Discord_ClientCreateOptions_CpuAffinityMask(&instance_, &returnValue__);
10192 if (!returnIsNonNull__) {
10193 return std::nullopt;
10195 return returnValue__;
10197void ClientCreateOptions::SetCpuAffinityMask(std::optional<uint64_t> CpuAffinityMask)
10199 assert(state_ == DiscordObjectState::Owned);
10200 Discord_ClientCreateOptions_SetCpuAffinityMask(
10201 &instance_, (CpuAffinityMask.has_value() ? &*CpuAffinityMask :
nullptr));
10203const Client Client::nullobj{{}, DiscordObjectState::Invalid};
10206 if (state_ == DiscordObjectState::Owned) {
10208 state_ = DiscordObjectState::Invalid;
10211Client::Client(Client&& other) noexcept
10212 : instance_(other.instance_)
10213 , state_(other.state_)
10215 other.state_ = DiscordObjectState::Invalid;
10217Client& Client::operator=(Client&& other)
noexcept
10219 if (
this != &other) {
10220 if (state_ == DiscordObjectState::Owned) {
10223 instance_ = other.instance_;
10224 state_ = other.state_;
10225 other.state_ = DiscordObjectState::Invalid;
10229Client::Client(Discord_Client instance, DiscordObjectState state)
10230 : instance_(instance)
10236 assert(state_ == DiscordObjectState::Invalid);
10237 Discord_Client_Init(&instance_);
10238 state_ = DiscordObjectState::Owned;
10240Client::Client(std::string apiBase, std::string webBase)
10242 assert(state_ == DiscordObjectState::Invalid);
10243 Discord_String apiBase__str{(uint8_t*)(apiBase.data()), apiBase.size()};
10244 Discord_String webBase__str{(uint8_t*)(webBase.data()), webBase.size()};
10245 Discord_Client_InitWithBases(&instance_, apiBase__str, webBase__str);
10246 state_ = DiscordObjectState::Owned;
10250 assert(state_ == DiscordObjectState::Invalid);
10251 Discord_Client_InitWithOptions(&instance_, options.instance());
10252 state_ = DiscordObjectState::Owned;
10256 if (state_ != DiscordObjectState::Owned) {
10259 Discord_Client_Drop(&instance_);
10260 state_ = DiscordObjectState::Invalid;
10264 Discord_String returnValueNative__;
10265 Discord_Client_ErrorToString(
static_cast<Discord_Client_Error
>(type), &returnValueNative__);
10266 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
10267 returnValueNative__.size);
10268 Discord_Free(returnValueNative__.ptr);
10269 return returnValue__;
10271uint64_t Client::GetApplicationId()
10273 assert(state_ == DiscordObjectState::Owned);
10274 uint64_t returnValue__;
10275 returnValue__ = Discord_Client_GetApplicationId(&instance_);
10276 return returnValue__;
10280 assert(state_ == DiscordObjectState::Owned);
10281 Discord_UserHandle returnValueNative__{};
10282 Discord_Client_GetCurrentUser(&instance_, &returnValueNative__);
10284 return returnValue__;
10286std::string Client::GetDefaultAudioDeviceId()
10288 Discord_String returnValueNative__;
10289 Discord_Client_GetDefaultAudioDeviceId(&returnValueNative__);
10290 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
10291 returnValueNative__.size);
10292 Discord_Free(returnValueNative__.ptr);
10293 return returnValue__;
10295std::string Client::GetDefaultCommunicationScopes()
10297 Discord_String returnValueNative__;
10298 Discord_Client_GetDefaultCommunicationScopes(&returnValueNative__);
10299 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
10300 returnValueNative__.size);
10301 Discord_Free(returnValueNative__.ptr);
10302 return returnValue__;
10304std::string Client::GetDefaultPresenceScopes()
10306 Discord_String returnValueNative__;
10307 Discord_Client_GetDefaultPresenceScopes(&returnValueNative__);
10308 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
10309 returnValueNative__.size);
10310 Discord_Free(returnValueNative__.ptr);
10311 return returnValue__;
10313std::string Client::GetVersionHash()
10315 Discord_String returnValueNative__;
10316 Discord_Client_GetVersionHash(&returnValueNative__);
10317 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
10318 returnValueNative__.size);
10319 Discord_Free(returnValueNative__.ptr);
10320 return returnValue__;
10322int32_t Client::GetVersionMajor()
10324 int32_t returnValue__;
10325 returnValue__ = Discord_Client_GetVersionMajor();
10326 return returnValue__;
10328int32_t Client::GetVersionMinor()
10330 int32_t returnValue__;
10331 returnValue__ = Discord_Client_GetVersionMinor();
10332 return returnValue__;
10334int32_t Client::GetVersionPatch()
10336 int32_t returnValue__;
10337 returnValue__ = Discord_Client_GetVersionPatch();
10338 return returnValue__;
10340void Client::SetHttpRequestTimeout(int32_t httpTimeoutInMilliseconds)
10342 assert(state_ == DiscordObjectState::Owned);
10343 Discord_Client_SetHttpRequestTimeout(&instance_, httpTimeoutInMilliseconds);
10347 Discord_String returnValueNative__;
10348 Discord_Client_StatusToString(
static_cast<Discord_Client_Status
>(type), &returnValueNative__);
10349 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
10350 returnValueNative__.size);
10351 Discord_Free(returnValueNative__.ptr);
10352 return returnValue__;
10356 Discord_String returnValueNative__;
10357 Discord_Client_ThreadToString(
static_cast<Discord_Client_Thread
>(type), &returnValueNative__);
10358 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
10359 returnValueNative__.size);
10360 Discord_Free(returnValueNative__.ptr);
10361 return returnValue__;
10365 assert(state_ == DiscordObjectState::Owned);
10366 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
10367 auto callback__userData =
new Tcallback__UserData(callback);
10368 Discord_Client_EndCallCallback callback__native = [](
void* userData__) {
10369 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
10370 userData__typed->delegate();
10372 Discord_Client_EndCall(
10373 &instance_, channelId, callback__native, Tcallback__UserData::Free, callback__userData);
10377 assert(state_ == DiscordObjectState::Owned);
10378 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
10379 auto callback__userData =
new Tcallback__UserData(callback);
10380 Discord_Client_EndCallsCallback callback__native = [](
void* userData__) {
10381 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
10382 userData__typed->delegate();
10384 Discord_Client_EndCalls(
10385 &instance_, callback__native, Tcallback__UserData::Free, callback__userData);
10389 assert(state_ == DiscordObjectState::Owned);
10390 bool returnIsNonNull__;
10391 Discord_Call returnValueNative__{};
10392 returnIsNonNull__ = Discord_Client_GetCall(&instance_, channelId, &returnValueNative__);
10394 returnValueNative__,
10395 returnIsNonNull__ ? DiscordObjectState::Owned : DiscordObjectState::Invalid);
10396 return returnValue__;
10398std::vector<discordpp::Call> Client::GetCalls()
10400 assert(state_ == DiscordObjectState::Owned);
10401 Discord_CallSpan returnValueNative__;
10402 Discord_Client_GetCalls(&instance_, &returnValueNative__);
10403 std::vector<discordpp::Call> returnValue__;
10404 returnValue__.reserve(returnValueNative__.size);
10405 for (
size_t i__ = 0; i__ < returnValueNative__.size; ++i__) {
10406 returnValue__.emplace_back(returnValueNative__.ptr[i__], DiscordObjectState::Owned);
10408 Discord_Free(returnValueNative__.ptr);
10409 return returnValue__;
10413 assert(state_ == DiscordObjectState::Owned);
10414 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10415 auto cb__userData =
new Tcb__UserData(cb);
10416 Discord_Client_GetCurrentInputDeviceCallback cb__native = [](
auto device,
void* userData__) {
10417 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10419 userData__typed->delegate(std::move(device__obj));
10421 Discord_Client_GetCurrentInputDevice(&instance_, cb__native, Tcb__UserData::Free, cb__userData);
10425 assert(state_ == DiscordObjectState::Owned);
10426 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10427 auto cb__userData =
new Tcb__UserData(cb);
10428 Discord_Client_GetCurrentOutputDeviceCallback cb__native = [](
auto device,
void* userData__) {
10429 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10431 userData__typed->delegate(std::move(device__obj));
10433 Discord_Client_GetCurrentOutputDevice(
10434 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
10438 assert(state_ == DiscordObjectState::Owned);
10439 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10440 auto cb__userData =
new Tcb__UserData(cb);
10441 Discord_Client_GetInputDevicesCallback cb__native = [](
auto devices,
void* userData__) {
10442 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10443 std::vector<discordpp::AudioDevice> devices__vec;
10444 devices__vec.reserve(devices.size);
10445 for (
size_t i__ = 0; i__ < devices.size; ++i__) {
10446 devices__vec.emplace_back(devices.ptr[i__], DiscordObjectState::Owned);
10448 Discord_Free(devices.ptr);
10449 userData__typed->delegate(std::move(devices__vec));
10451 Discord_Client_GetInputDevices(&instance_, cb__native, Tcb__UserData::Free, cb__userData);
10453float Client::GetInputVolume()
10455 assert(state_ == DiscordObjectState::Owned);
10456 float returnValue__;
10457 returnValue__ = Discord_Client_GetInputVolume(&instance_);
10458 return returnValue__;
10462 assert(state_ == DiscordObjectState::Owned);
10463 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10464 auto cb__userData =
new Tcb__UserData(cb);
10465 Discord_Client_GetOutputDevicesCallback cb__native = [](
auto devices,
void* userData__) {
10466 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10467 std::vector<discordpp::AudioDevice> devices__vec;
10468 devices__vec.reserve(devices.size);
10469 for (
size_t i__ = 0; i__ < devices.size; ++i__) {
10470 devices__vec.emplace_back(devices.ptr[i__], DiscordObjectState::Owned);
10472 Discord_Free(devices.ptr);
10473 userData__typed->delegate(std::move(devices__vec));
10475 Discord_Client_GetOutputDevices(&instance_, cb__native, Tcb__UserData::Free, cb__userData);
10477float Client::GetOutputVolume()
10479 assert(state_ == DiscordObjectState::Owned);
10480 float returnValue__;
10481 returnValue__ = Discord_Client_GetOutputVolume(&instance_);
10482 return returnValue__;
10484bool Client::GetSelfDeafAll()
const
10486 assert(state_ == DiscordObjectState::Owned);
10487 bool returnValue__;
10488 returnValue__ = Discord_Client_GetSelfDeafAll(&instance_);
10489 return returnValue__;
10491bool Client::GetSelfMuteAll()
const
10493 assert(state_ == DiscordObjectState::Owned);
10494 bool returnValue__;
10495 returnValue__ = Discord_Client_GetSelfMuteAll(&instance_);
10496 return returnValue__;
10498void Client::SetAecDump(
bool on)
10500 assert(state_ == DiscordObjectState::Owned);
10501 Discord_Client_SetAecDump(&instance_, on);
10503void Client::SetAutomaticGainControl(
bool on)
10505 assert(state_ == DiscordObjectState::Owned);
10506 Discord_Client_SetAutomaticGainControl(&instance_, on);
10510 assert(state_ == DiscordObjectState::Owned);
10511 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
10512 auto callback__userData =
new Tcallback__UserData(callback);
10513 Discord_Client_DeviceChangeCallback callback__native =
10514 [](
auto inputDevices,
auto outputDevices,
void* userData__) {
10515 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
10516 std::vector<discordpp::AudioDevice> inputDevices__vec;
10517 inputDevices__vec.reserve(inputDevices.size);
10518 for (
size_t i__ = 0; i__ < inputDevices.size; ++i__) {
10519 inputDevices__vec.emplace_back(inputDevices.ptr[i__], DiscordObjectState::Owned);
10521 Discord_Free(inputDevices.ptr);
10522 std::vector<discordpp::AudioDevice> outputDevices__vec;
10523 outputDevices__vec.reserve(outputDevices.size);
10524 for (
size_t i__ = 0; i__ < outputDevices.size; ++i__) {
10525 outputDevices__vec.emplace_back(outputDevices.ptr[i__], DiscordObjectState::Owned);
10527 Discord_Free(outputDevices.ptr);
10528 userData__typed->delegate(std::move(inputDevices__vec), std::move(outputDevices__vec));
10530 Discord_Client_SetDeviceChangeCallback(
10531 &instance_, callback__native, Tcallback__UserData::Free, callback__userData);
10533void Client::SetEchoCancellation(
bool on)
10535 assert(state_ == DiscordObjectState::Owned);
10536 Discord_Client_SetEchoCancellation(&instance_, on);
10538void Client::SetEngineManagedAudioSession(
bool isEngineManaged)
10540 assert(state_ == DiscordObjectState::Owned);
10541 Discord_Client_SetEngineManagedAudioSession(&instance_, isEngineManaged);
10545 assert(state_ == DiscordObjectState::Owned);
10546 Discord_String deviceId__str{(uint8_t*)(deviceId.data()), deviceId.size()};
10547 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10548 auto cb__userData =
new Tcb__UserData(cb);
10549 Discord_Client_SetInputDeviceCallback cb__native = [](
auto result,
void* userData__) {
10550 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10552 userData__typed->delegate(std::move(result__obj));
10554 Discord_Client_SetInputDevice(
10555 &instance_, deviceId__str, cb__native, Tcb__UserData::Free, cb__userData);
10557void Client::SetInputVolume(
float inputVolume)
10559 assert(state_ == DiscordObjectState::Owned);
10560 Discord_Client_SetInputVolume(&instance_, inputVolume);
10564 assert(state_ == DiscordObjectState::Owned);
10565 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
10566 auto callback__userData =
new Tcallback__UserData(callback);
10567 Discord_Client_NoAudioInputCallback callback__native = [](
auto inputDetected,
10568 void* userData__) {
10569 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
10570 userData__typed->delegate(inputDetected);
10572 Discord_Client_SetNoAudioInputCallback(
10573 &instance_, callback__native, Tcallback__UserData::Free, callback__userData);
10575void Client::SetNoAudioInputThreshold(
float dBFSThreshold)
10577 assert(state_ == DiscordObjectState::Owned);
10578 Discord_Client_SetNoAudioInputThreshold(&instance_, dBFSThreshold);
10580void Client::SetNoiseSuppression(
bool on)
10582 assert(state_ == DiscordObjectState::Owned);
10583 Discord_Client_SetNoiseSuppression(&instance_, on);
10585void Client::SetOpusHardwareCoding(
bool encode,
bool decode)
10587 assert(state_ == DiscordObjectState::Owned);
10588 Discord_Client_SetOpusHardwareCoding(&instance_, encode, decode);
10592 assert(state_ == DiscordObjectState::Owned);
10593 Discord_String deviceId__str{(uint8_t*)(deviceId.data()), deviceId.size()};
10594 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10595 auto cb__userData =
new Tcb__UserData(cb);
10596 Discord_Client_SetOutputDeviceCallback cb__native = [](
auto result,
void* userData__) {
10597 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10599 userData__typed->delegate(std::move(result__obj));
10601 Discord_Client_SetOutputDevice(
10602 &instance_, deviceId__str, cb__native, Tcb__UserData::Free, cb__userData);
10604void Client::SetOutputVolume(
float outputVolume)
10606 assert(state_ == DiscordObjectState::Owned);
10607 Discord_Client_SetOutputVolume(&instance_, outputVolume);
10609void Client::SetSelfDeafAll(
bool deaf)
10611 assert(state_ == DiscordObjectState::Owned);
10612 Discord_Client_SetSelfDeafAll(&instance_, deaf);
10614void Client::SetSelfMuteAll(
bool mute)
10616 assert(state_ == DiscordObjectState::Owned);
10617 Discord_Client_SetSelfMuteAll(&instance_, mute);
10619bool Client::SetSpeakerMode(
bool speakerMode)
10621 assert(state_ == DiscordObjectState::Owned);
10622 bool returnValue__;
10623 returnValue__ = Discord_Client_SetSpeakerMode(&instance_, speakerMode);
10624 return returnValue__;
10628 assert(state_ == DiscordObjectState::Owned);
10629 Discord_Client_SetThreadPriority(
10630 &instance_,
static_cast<Discord_Client_Thread
>(thread), priority);
10632void Client::SetVoiceParticipantChangedCallback(
10635 assert(state_ == DiscordObjectState::Owned);
10636 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10637 auto cb__userData =
new Tcb__UserData(cb);
10638 Discord_Client_VoiceParticipantChangedCallback cb__native =
10639 [](
auto lobbyId,
auto memberId,
auto added,
void* userData__) {
10640 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10641 userData__typed->delegate(lobbyId, memberId, added);
10643 Discord_Client_SetVoiceParticipantChangedCallback(
10644 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
10646bool Client::ShowAudioRoutePicker()
10648 assert(state_ == DiscordObjectState::Owned);
10649 bool returnValue__;
10650 returnValue__ = Discord_Client_ShowAudioRoutePicker(&instance_);
10651 return returnValue__;
10655 assert(state_ == DiscordObjectState::Owned);
10656 bool returnIsNonNull__;
10657 Discord_Call returnValueNative__{};
10658 returnIsNonNull__ = Discord_Client_StartCall(&instance_, channelId, &returnValueNative__);
10660 returnValueNative__,
10661 returnIsNonNull__ ? DiscordObjectState::Owned : DiscordObjectState::Invalid);
10662 return returnValue__;
10669 assert(state_ == DiscordObjectState::Owned);
10670 bool returnIsNonNull__;
10671 Discord_Call returnValueNative__{};
10672 using TreceivedCb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(receivedCb)>>;
10673 auto receivedCb__userData =
new TreceivedCb__UserData(receivedCb);
10674 Discord_Client_UserAudioReceivedCallback receivedCb__native = [](
auto userId,
10676 auto samplesPerChannel,
10679 auto outShouldMute,
10680 void* userData__) {
10681 auto userData__typed =
static_cast<TreceivedCb__UserData*
>(userData__);
10682 userData__typed->delegate(
10683 userId, data, samplesPerChannel, sampleRate, channels, *outShouldMute);
10685 using TcapturedCb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(capturedCb)>>;
10686 auto capturedCb__userData =
new TcapturedCb__UserData(capturedCb);
10687 Discord_Client_UserAudioCapturedCallback capturedCb__native =
10688 [](
auto data,
auto samplesPerChannel,
auto sampleRate,
auto channels,
void* userData__) {
10689 auto userData__typed =
static_cast<TcapturedCb__UserData*
>(userData__);
10690 userData__typed->delegate(data, samplesPerChannel, sampleRate, channels);
10692 returnIsNonNull__ = Discord_Client_StartCallWithAudioCallbacks(&instance_,
10694 receivedCb__native,
10695 TreceivedCb__UserData::Free,
10696 receivedCb__userData,
10697 capturedCb__native,
10698 TcapturedCb__UserData::Free,
10699 capturedCb__userData,
10700 &returnValueNative__);
10702 returnValueNative__,
10703 returnIsNonNull__ ? DiscordObjectState::Owned : DiscordObjectState::Invalid);
10704 return returnValue__;
10706void Client::AbortAuthorize()
10708 assert(state_ == DiscordObjectState::Owned);
10709 Discord_Client_AbortAuthorize(&instance_);
10711void Client::AbortGetTokenFromDevice()
10713 assert(state_ == DiscordObjectState::Owned);
10714 Discord_Client_AbortGetTokenFromDevice(&instance_);
10719 assert(state_ == DiscordObjectState::Owned);
10720 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
10721 auto callback__userData =
new Tcallback__UserData(callback);
10722 Discord_Client_AuthorizationCallback callback__native =
10723 [](
auto result,
auto code,
auto redirectUri,
void* userData__) {
10724 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
10726 std::string code__str(
reinterpret_cast<char*
>(code.ptr), code.size);
10727 std::string redirectUri__str(
reinterpret_cast<char*
>(redirectUri.ptr), redirectUri.size);
10728 userData__typed->delegate(
10729 std::move(result__obj), std::move(code__str), std::move(redirectUri__str));
10730 Discord_Free(redirectUri.ptr);
10731 Discord_Free(code.ptr);
10733 Discord_Client_Authorize(
10734 &instance_, args.instance(), callback__native, Tcallback__UserData::Free, callback__userData);
10736void Client::CloseAuthorizeDeviceScreen()
10738 assert(state_ == DiscordObjectState::Owned);
10739 Discord_Client_CloseAuthorizeDeviceScreen(&instance_);
10743 assert(state_ == DiscordObjectState::Owned);
10744 Discord_AuthorizationCodeVerifier returnValueNative__{};
10745 Discord_Client_CreateAuthorizationCodeVerifier(&instance_, &returnValueNative__);
10747 DiscordObjectState::Owned);
10748 return returnValue__;
10750void Client::ExchangeChildToken(std::string
const& parentApplicationToken,
10751 uint64_t childApplicationId,
10754 assert(state_ == DiscordObjectState::Owned);
10755 Discord_String parentApplicationToken__str{(uint8_t*)(parentApplicationToken.data()),
10756 parentApplicationToken.size()};
10757 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
10758 auto callback__userData =
new Tcallback__UserData(callback);
10759 Discord_Client_ExchangeChildTokenCallback callback__native = [](
auto result,
10764 void* userData__) {
10765 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
10767 std::string accessToken__str(
reinterpret_cast<char*
>(accessToken.ptr), accessToken.size);
10768 std::string scopes__str(
reinterpret_cast<char*
>(scopes.ptr), scopes.size);
10769 userData__typed->delegate(std::move(result__obj),
10770 std::move(accessToken__str),
10773 std::move(scopes__str));
10774 Discord_Free(scopes.ptr);
10775 Discord_Free(accessToken.ptr);
10777 Discord_Client_ExchangeChildToken(&instance_,
10778 parentApplicationToken__str,
10779 childApplicationId,
10781 Tcallback__UserData::Free,
10782 callback__userData);
10785 std::string
const& token,
10788 assert(state_ == DiscordObjectState::Owned);
10789 Discord_String token__str{(uint8_t*)(token.data()), token.size()};
10790 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
10791 auto callback__userData =
new Tcallback__UserData(callback);
10792 Discord_Client_FetchCurrentUserCallback callback__native =
10793 [](
auto result,
auto id,
auto name,
void* userData__) {
10794 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
10796 std::string name__str(
reinterpret_cast<char*
>(name.ptr), name.size);
10797 userData__typed->delegate(std::move(result__obj),
id, std::move(name__str));
10798 Discord_Free(name.ptr);
10800 Discord_Client_FetchCurrentUser(&instance_,
10801 static_cast<Discord_AuthorizationTokenType
>(tokenType),
10804 Tcallback__UserData::Free,
10805 callback__userData);
10807void Client::GetProvisionalToken(uint64_t applicationId,
10809 std::string
const& externalAuthToken,
10812 assert(state_ == DiscordObjectState::Owned);
10813 Discord_String externalAuthToken__str{(uint8_t*)(externalAuthToken.data()),
10814 externalAuthToken.size()};
10815 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
10816 auto callback__userData =
new Tcallback__UserData(callback);
10817 Discord_Client_TokenExchangeCallback callback__native = [](
auto result,
10823 void* userData__) {
10824 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
10826 std::string accessToken__str(
reinterpret_cast<char*
>(accessToken.ptr), accessToken.size);
10827 std::string refreshToken__str(
reinterpret_cast<char*
>(refreshToken.ptr), refreshToken.size);
10828 std::string scopes__str(
reinterpret_cast<char*
>(scopes.ptr), scopes.size);
10829 userData__typed->delegate(std::move(result__obj),
10830 std::move(accessToken__str),
10831 std::move(refreshToken__str),
10834 std::move(scopes__str));
10835 Discord_Free(scopes.ptr);
10836 Discord_Free(refreshToken.ptr);
10837 Discord_Free(accessToken.ptr);
10839 Discord_Client_GetProvisionalToken(
10842 static_cast<Discord_AuthenticationExternalAuthType
>(externalAuthType),
10843 externalAuthToken__str,
10845 Tcallback__UserData::Free,
10846 callback__userData);
10848void Client::GetToken(uint64_t applicationId,
10849 std::string
const& code,
10850 std::string
const& codeVerifier,
10851 std::string
const& redirectUri,
10854 assert(state_ == DiscordObjectState::Owned);
10855 Discord_String code__str{(uint8_t*)(code.data()), code.size()};
10856 Discord_String codeVerifier__str{(uint8_t*)(codeVerifier.data()), codeVerifier.size()};
10857 Discord_String redirectUri__str{(uint8_t*)(redirectUri.data()), redirectUri.size()};
10858 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
10859 auto callback__userData =
new Tcallback__UserData(callback);
10860 Discord_Client_TokenExchangeCallback callback__native = [](
auto result,
10866 void* userData__) {
10867 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
10869 std::string accessToken__str(
reinterpret_cast<char*
>(accessToken.ptr), accessToken.size);
10870 std::string refreshToken__str(
reinterpret_cast<char*
>(refreshToken.ptr), refreshToken.size);
10871 std::string scopes__str(
reinterpret_cast<char*
>(scopes.ptr), scopes.size);
10872 userData__typed->delegate(std::move(result__obj),
10873 std::move(accessToken__str),
10874 std::move(refreshToken__str),
10877 std::move(scopes__str));
10878 Discord_Free(scopes.ptr);
10879 Discord_Free(refreshToken.ptr);
10880 Discord_Free(accessToken.ptr);
10882 Discord_Client_GetToken(&instance_,
10888 Tcallback__UserData::Free,
10889 callback__userData);
10894 assert(state_ == DiscordObjectState::Owned);
10895 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
10896 auto callback__userData =
new Tcallback__UserData(callback);
10897 Discord_Client_TokenExchangeCallback callback__native = [](
auto result,
10903 void* userData__) {
10904 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
10906 std::string accessToken__str(
reinterpret_cast<char*
>(accessToken.ptr), accessToken.size);
10907 std::string refreshToken__str(
reinterpret_cast<char*
>(refreshToken.ptr), refreshToken.size);
10908 std::string scopes__str(
reinterpret_cast<char*
>(scopes.ptr), scopes.size);
10909 userData__typed->delegate(std::move(result__obj),
10910 std::move(accessToken__str),
10911 std::move(refreshToken__str),
10914 std::move(scopes__str));
10915 Discord_Free(scopes.ptr);
10916 Discord_Free(refreshToken.ptr);
10917 Discord_Free(accessToken.ptr);
10919 Discord_Client_GetTokenFromDevice(
10920 &instance_, args.instance(), callback__native, Tcallback__UserData::Free, callback__userData);
10922void Client::GetTokenFromDeviceProvisionalMerge(
10925 std::string
const& externalAuthToken,
10928 assert(state_ == DiscordObjectState::Owned);
10929 Discord_String externalAuthToken__str{(uint8_t*)(externalAuthToken.data()),
10930 externalAuthToken.size()};
10931 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
10932 auto callback__userData =
new Tcallback__UserData(callback);
10933 Discord_Client_TokenExchangeCallback callback__native = [](
auto result,
10939 void* userData__) {
10940 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
10942 std::string accessToken__str(
reinterpret_cast<char*
>(accessToken.ptr), accessToken.size);
10943 std::string refreshToken__str(
reinterpret_cast<char*
>(refreshToken.ptr), refreshToken.size);
10944 std::string scopes__str(
reinterpret_cast<char*
>(scopes.ptr), scopes.size);
10945 userData__typed->delegate(std::move(result__obj),
10946 std::move(accessToken__str),
10947 std::move(refreshToken__str),
10950 std::move(scopes__str));
10951 Discord_Free(scopes.ptr);
10952 Discord_Free(refreshToken.ptr);
10953 Discord_Free(accessToken.ptr);
10955 Discord_Client_GetTokenFromDeviceProvisionalMerge(
10958 static_cast<Discord_AuthenticationExternalAuthType
>(externalAuthType),
10959 externalAuthToken__str,
10961 Tcallback__UserData::Free,
10962 callback__userData);
10964void Client::GetTokenFromProvisionalMerge(
10965 uint64_t applicationId,
10966 std::string
const& code,
10967 std::string
const& codeVerifier,
10968 std::string
const& redirectUri,
10970 std::string
const& externalAuthToken,
10973 assert(state_ == DiscordObjectState::Owned);
10974 Discord_String code__str{(uint8_t*)(code.data()), code.size()};
10975 Discord_String codeVerifier__str{(uint8_t*)(codeVerifier.data()), codeVerifier.size()};
10976 Discord_String redirectUri__str{(uint8_t*)(redirectUri.data()), redirectUri.size()};
10977 Discord_String externalAuthToken__str{(uint8_t*)(externalAuthToken.data()),
10978 externalAuthToken.size()};
10979 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
10980 auto callback__userData =
new Tcallback__UserData(callback);
10981 Discord_Client_TokenExchangeCallback callback__native = [](
auto result,
10987 void* userData__) {
10988 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
10990 std::string accessToken__str(
reinterpret_cast<char*
>(accessToken.ptr), accessToken.size);
10991 std::string refreshToken__str(
reinterpret_cast<char*
>(refreshToken.ptr), refreshToken.size);
10992 std::string scopes__str(
reinterpret_cast<char*
>(scopes.ptr), scopes.size);
10993 userData__typed->delegate(std::move(result__obj),
10994 std::move(accessToken__str),
10995 std::move(refreshToken__str),
10998 std::move(scopes__str));
10999 Discord_Free(scopes.ptr);
11000 Discord_Free(refreshToken.ptr);
11001 Discord_Free(accessToken.ptr);
11003 Discord_Client_GetTokenFromProvisionalMerge(
11009 static_cast<Discord_AuthenticationExternalAuthType
>(externalAuthType),
11010 externalAuthToken__str,
11012 Tcallback__UserData::Free,
11013 callback__userData);
11015bool Client::IsAuthenticated()
11017 assert(state_ == DiscordObjectState::Owned);
11018 bool returnValue__;
11019 returnValue__ = Discord_Client_IsAuthenticated(&instance_);
11020 return returnValue__;
11022void Client::OpenAuthorizeDeviceScreen(uint64_t clientId, std::string
const& userCode)
11024 assert(state_ == DiscordObjectState::Owned);
11025 Discord_String userCode__str{(uint8_t*)(userCode.data()), userCode.size()};
11026 Discord_Client_OpenAuthorizeDeviceScreen(&instance_, clientId, userCode__str);
11028void Client::ProvisionalUserMergeCompleted(
bool success)
11030 assert(state_ == DiscordObjectState::Owned);
11031 Discord_Client_ProvisionalUserMergeCompleted(&instance_, success);
11033void Client::RefreshToken(uint64_t applicationId,
11034 std::string
const& refreshToken,
11037 assert(state_ == DiscordObjectState::Owned);
11038 Discord_String refreshToken__str{(uint8_t*)(refreshToken.data()), refreshToken.size()};
11039 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
11040 auto callback__userData =
new Tcallback__UserData(callback);
11041 Discord_Client_TokenExchangeCallback callback__native = [](
auto result,
11047 void* userData__) {
11048 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
11050 std::string accessToken__str(
reinterpret_cast<char*
>(accessToken.ptr), accessToken.size);
11051 std::string refreshToken__str(
reinterpret_cast<char*
>(refreshToken.ptr), refreshToken.size);
11052 std::string scopes__str(
reinterpret_cast<char*
>(scopes.ptr), scopes.size);
11053 userData__typed->delegate(std::move(result__obj),
11054 std::move(accessToken__str),
11055 std::move(refreshToken__str),
11058 std::move(scopes__str));
11059 Discord_Free(scopes.ptr);
11060 Discord_Free(refreshToken.ptr);
11061 Discord_Free(accessToken.ptr);
11063 Discord_Client_RefreshToken(&instance_,
11067 Tcallback__UserData::Free,
11068 callback__userData);
11072 assert(state_ == DiscordObjectState::Owned);
11073 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
11074 auto callback__userData =
new Tcallback__UserData(callback);
11075 Discord_Client_AuthorizeRequestCallback callback__native = [](
void* userData__) {
11076 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
11077 userData__typed->delegate();
11079 Discord_Client_RegisterAuthorizeRequestCallback(
11080 &instance_, callback__native, Tcallback__UserData::Free, callback__userData);
11082void Client::RemoveAuthorizeRequestCallback()
11084 assert(state_ == DiscordObjectState::Owned);
11085 Discord_Client_RemoveAuthorizeRequestCallback(&instance_);
11087void Client::RevokeToken(uint64_t applicationId,
11088 std::string
const& token,
11091 assert(state_ == DiscordObjectState::Owned);
11092 Discord_String token__str{(uint8_t*)(token.data()), token.size()};
11093 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
11094 auto callback__userData =
new Tcallback__UserData(callback);
11095 Discord_Client_RevokeTokenCallback callback__native = [](
auto result,
void* userData__) {
11096 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
11098 userData__typed->delegate(std::move(result__obj));
11100 Discord_Client_RevokeToken(&instance_,
11104 Tcallback__UserData::Free,
11105 callback__userData);
11107void Client::SetAuthorizeDeviceScreenClosedCallback(
11110 assert(state_ == DiscordObjectState::Owned);
11111 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11112 auto cb__userData =
new Tcb__UserData(cb);
11113 Discord_Client_AuthorizeDeviceScreenClosedCallback cb__native = [](
void* userData__) {
11114 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11115 userData__typed->delegate();
11117 Discord_Client_SetAuthorizeDeviceScreenClosedCallback(
11118 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11120void Client::SetGameWindowPid(int32_t pid)
11122 assert(state_ == DiscordObjectState::Owned);
11123 Discord_Client_SetGameWindowPid(&instance_, pid);
11127 assert(state_ == DiscordObjectState::Owned);
11128 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
11129 auto callback__userData =
new Tcallback__UserData(callback);
11130 Discord_Client_TokenExpirationCallback callback__native = [](
void* userData__) {
11131 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
11132 userData__typed->delegate();
11134 Discord_Client_SetTokenExpirationCallback(
11135 &instance_, callback__native, Tcallback__UserData::Free, callback__userData);
11137void Client::UnmergeIntoProvisionalAccount(
11138 uint64_t applicationId,
11140 std::string
const& externalAuthToken,
11143 assert(state_ == DiscordObjectState::Owned);
11144 Discord_String externalAuthToken__str{(uint8_t*)(externalAuthToken.data()),
11145 externalAuthToken.size()};
11146 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
11147 auto callback__userData =
new Tcallback__UserData(callback);
11148 Discord_Client_UnmergeIntoProvisionalAccountCallback callback__native = [](
auto result,
11149 void* userData__) {
11150 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
11152 userData__typed->delegate(std::move(result__obj));
11154 Discord_Client_UnmergeIntoProvisionalAccount(
11157 static_cast<Discord_AuthenticationExternalAuthType
>(externalAuthType),
11158 externalAuthToken__str,
11160 Tcallback__UserData::Free,
11161 callback__userData);
11163void Client::UpdateProvisionalAccountDisplayName(
11164 std::string
const& name,
11167 assert(state_ == DiscordObjectState::Owned);
11168 Discord_String name__str{(uint8_t*)(name.data()), name.size()};
11169 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
11170 auto callback__userData =
new Tcallback__UserData(callback);
11171 Discord_Client_UpdateProvisionalAccountDisplayNameCallback callback__native =
11172 [](
auto result,
void* userData__) {
11173 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
11175 userData__typed->delegate(std::move(result__obj));
11177 Discord_Client_UpdateProvisionalAccountDisplayName(
11178 &instance_, name__str, callback__native, Tcallback__UserData::Free, callback__userData);
11184 assert(state_ == DiscordObjectState::Owned);
11185 Discord_String token__str{(uint8_t*)(token.data()), token.size()};
11186 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
11187 auto callback__userData =
new Tcallback__UserData(callback);
11188 Discord_Client_UpdateTokenCallback callback__native = [](
auto result,
void* userData__) {
11189 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
11191 userData__typed->delegate(std::move(result__obj));
11193 Discord_Client_UpdateToken(&instance_,
11194 static_cast<Discord_AuthorizationTokenType
>(tokenType),
11197 Tcallback__UserData::Free,
11198 callback__userData);
11200bool Client::CanOpenMessageInDiscord(uint64_t messageId)
11202 assert(state_ == DiscordObjectState::Owned);
11203 bool returnValue__;
11204 returnValue__ = Discord_Client_CanOpenMessageInDiscord(&instance_, messageId);
11205 return returnValue__;
11207void Client::DeleteUserMessage(uint64_t recipientId,
11208 uint64_t messageId,
11211 assert(state_ == DiscordObjectState::Owned);
11212 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11213 auto cb__userData =
new Tcb__UserData(cb);
11214 Discord_Client_DeleteUserMessageCallback cb__native = [](
auto result,
void* userData__) {
11215 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11217 userData__typed->delegate(std::move(result__obj));
11219 Discord_Client_DeleteUserMessage(
11220 &instance_, recipientId, messageId, cb__native, Tcb__UserData::Free, cb__userData);
11222void Client::EditUserMessage(uint64_t recipientId,
11223 uint64_t messageId,
11224 std::string
const& content,
11227 assert(state_ == DiscordObjectState::Owned);
11228 Discord_String content__str{(uint8_t*)(content.data()), content.size()};
11229 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11230 auto cb__userData =
new Tcb__UserData(cb);
11231 Discord_Client_EditUserMessageCallback cb__native = [](
auto result,
void* userData__) {
11232 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11234 userData__typed->delegate(std::move(result__obj));
11236 Discord_Client_EditUserMessage(&instance_,
11241 Tcb__UserData::Free,
11244std::optional<discordpp::ChannelHandle> Client::GetChannelHandle(uint64_t channelId)
const
11246 assert(state_ == DiscordObjectState::Owned);
11247 bool returnIsNonNull__;
11248 Discord_ChannelHandle returnValueNative__;
11249 returnIsNonNull__ =
11250 Discord_Client_GetChannelHandle(&instance_, channelId, &returnValueNative__);
11251 if (!returnIsNonNull__) {
11255 return returnValue__;
11257void Client::GetLobbyMessagesWithLimit(uint64_t lobbyId,
11261 assert(state_ == DiscordObjectState::Owned);
11262 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11263 auto cb__userData =
new Tcb__UserData(cb);
11264 Discord_Client_GetLobbyMessagesCallback cb__native =
11265 [](
auto result,
auto messages,
void* userData__) {
11266 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11268 std::vector<discordpp::MessageHandle> messages__vec;
11269 messages__vec.reserve(messages.size);
11270 for (
size_t i__ = 0; i__ < messages.size; ++i__) {
11271 messages__vec.emplace_back(messages.ptr[i__], DiscordObjectState::Owned);
11273 Discord_Free(messages.ptr);
11274 userData__typed->delegate(std::move(result__obj), std::move(messages__vec));
11276 Discord_Client_GetLobbyMessagesWithLimit(
11277 &instance_, lobbyId, limit, cb__native, Tcb__UserData::Free, cb__userData);
11279std::optional<discordpp::MessageHandle> Client::GetMessageHandle(uint64_t messageId)
const
11281 assert(state_ == DiscordObjectState::Owned);
11282 bool returnIsNonNull__;
11283 Discord_MessageHandle returnValueNative__;
11284 returnIsNonNull__ =
11285 Discord_Client_GetMessageHandle(&instance_, messageId, &returnValueNative__);
11286 if (!returnIsNonNull__) {
11290 return returnValue__;
11294 assert(state_ == DiscordObjectState::Owned);
11295 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11296 auto cb__userData =
new Tcb__UserData(cb);
11297 Discord_Client_UserMessageSummariesCallback cb__native =
11298 [](
auto result,
auto summaries,
void* userData__) {
11299 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11301 std::vector<discordpp::UserMessageSummary> summaries__vec;
11302 summaries__vec.reserve(summaries.size);
11303 for (
size_t i__ = 0; i__ < summaries.size; ++i__) {
11304 summaries__vec.emplace_back(summaries.ptr[i__], DiscordObjectState::Owned);
11306 Discord_Free(summaries.ptr);
11307 userData__typed->delegate(std::move(result__obj), std::move(summaries__vec));
11309 Discord_Client_GetUserMessageSummaries(
11310 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11312void Client::GetUserMessagesWithLimit(uint64_t recipientId,
11316 assert(state_ == DiscordObjectState::Owned);
11317 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11318 auto cb__userData =
new Tcb__UserData(cb);
11319 Discord_Client_UserMessagesWithLimitCallback cb__native =
11320 [](
auto result,
auto messages,
void* userData__) {
11321 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11323 std::vector<discordpp::MessageHandle> messages__vec;
11324 messages__vec.reserve(messages.size);
11325 for (
size_t i__ = 0; i__ < messages.size; ++i__) {
11326 messages__vec.emplace_back(messages.ptr[i__], DiscordObjectState::Owned);
11328 Discord_Free(messages.ptr);
11329 userData__typed->delegate(std::move(result__obj), std::move(messages__vec));
11331 Discord_Client_GetUserMessagesWithLimit(
11332 &instance_, recipientId, limit, cb__native, Tcb__UserData::Free, cb__userData);
11334void Client::OpenMessageInDiscord(
11335 uint64_t messageId,
11339 assert(state_ == DiscordObjectState::Owned);
11340 using TprovisionalUserMergeRequiredCallback__UserData =
11341 TDelegateUserData<std::remove_reference_t<
decltype(provisionalUserMergeRequiredCallback)>>;
11342 auto provisionalUserMergeRequiredCallback__userData =
11343 new TprovisionalUserMergeRequiredCallback__UserData(provisionalUserMergeRequiredCallback);
11344 Discord_Client_ProvisionalUserMergeRequiredCallback
11345 provisionalUserMergeRequiredCallback__native = [](
void* userData__) {
11346 auto userData__typed =
11347 static_cast<TprovisionalUserMergeRequiredCallback__UserData*
>(userData__);
11348 userData__typed->delegate();
11350 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
11351 auto callback__userData =
new Tcallback__UserData(callback);
11352 Discord_Client_OpenMessageInDiscordCallback callback__native = [](
auto result,
11353 void* userData__) {
11354 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
11356 userData__typed->delegate(std::move(result__obj));
11358 Discord_Client_OpenMessageInDiscord(&instance_,
11360 provisionalUserMergeRequiredCallback__native,
11361 TprovisionalUserMergeRequiredCallback__UserData::Free,
11362 provisionalUserMergeRequiredCallback__userData,
11364 Tcallback__UserData::Free,
11365 callback__userData);
11367void Client::SendLobbyMessage(uint64_t lobbyId,
11368 std::string
const& content,
11371 assert(state_ == DiscordObjectState::Owned);
11372 Discord_String content__str{(uint8_t*)(content.data()), content.size()};
11373 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11374 auto cb__userData =
new Tcb__UserData(cb);
11375 Discord_Client_SendUserMessageCallback cb__native =
11376 [](
auto result,
auto messageId,
void* userData__) {
11377 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11379 userData__typed->delegate(std::move(result__obj), messageId);
11381 Discord_Client_SendLobbyMessage(
11382 &instance_, lobbyId, content__str, cb__native, Tcb__UserData::Free, cb__userData);
11384void Client::SendLobbyMessageWithMetadata(
11386 std::string
const& content,
11387 std::unordered_map<std::string, std::string>
const& metadata,
11390 assert(state_ == DiscordObjectState::Owned);
11391 Discord_String content__str{(uint8_t*)(content.data()), content.size()};
11392 ConvertedProperties metadata__convert(metadata);
11393 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11394 auto cb__userData =
new Tcb__UserData(cb);
11395 Discord_Client_SendUserMessageCallback cb__native =
11396 [](
auto result,
auto messageId,
void* userData__) {
11397 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11399 userData__typed->delegate(std::move(result__obj), messageId);
11401 Discord_Client_SendLobbyMessageWithMetadata(&instance_,
11404 metadata__convert.Properties,
11406 Tcb__UserData::Free,
11409void Client::SendUserMessage(uint64_t recipientId,
11410 std::string
const& content,
11413 assert(state_ == DiscordObjectState::Owned);
11414 Discord_String content__str{(uint8_t*)(content.data()), content.size()};
11415 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11416 auto cb__userData =
new Tcb__UserData(cb);
11417 Discord_Client_SendUserMessageCallback cb__native =
11418 [](
auto result,
auto messageId,
void* userData__) {
11419 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11421 userData__typed->delegate(std::move(result__obj), messageId);
11423 Discord_Client_SendUserMessage(
11424 &instance_, recipientId, content__str, cb__native, Tcb__UserData::Free, cb__userData);
11426void Client::SendUserMessageWithMetadata(
11427 uint64_t recipientId,
11428 std::string
const& content,
11429 std::unordered_map<std::string, std::string>
const& metadata,
11432 assert(state_ == DiscordObjectState::Owned);
11433 Discord_String content__str{(uint8_t*)(content.data()), content.size()};
11434 ConvertedProperties metadata__convert(metadata);
11435 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11436 auto cb__userData =
new Tcb__UserData(cb);
11437 Discord_Client_SendUserMessageCallback cb__native =
11438 [](
auto result,
auto messageId,
void* userData__) {
11439 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11441 userData__typed->delegate(std::move(result__obj), messageId);
11443 Discord_Client_SendUserMessageWithMetadata(&instance_,
11446 metadata__convert.Properties,
11448 Tcb__UserData::Free,
11453 assert(state_ == DiscordObjectState::Owned);
11454 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11455 auto cb__userData =
new Tcb__UserData(cb);
11456 Discord_Client_MessageCreatedCallback cb__native = [](
auto messageId,
void* userData__) {
11457 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11458 userData__typed->delegate(messageId);
11460 Discord_Client_SetMessageCreatedCallback(
11461 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11465 assert(state_ == DiscordObjectState::Owned);
11466 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11467 auto cb__userData =
new Tcb__UserData(cb);
11468 Discord_Client_MessageDeletedCallback cb__native =
11469 [](
auto messageId,
auto channelId,
void* userData__) {
11470 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11471 userData__typed->delegate(messageId, channelId);
11473 Discord_Client_SetMessageDeletedCallback(
11474 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11478 assert(state_ == DiscordObjectState::Owned);
11479 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11480 auto cb__userData =
new Tcb__UserData(cb);
11481 Discord_Client_MessageUpdatedCallback cb__native = [](
auto messageId,
void* userData__) {
11482 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11483 userData__typed->delegate(messageId);
11485 Discord_Client_SetMessageUpdatedCallback(
11486 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11488void Client::SetShowingChat(
bool showingChat)
11490 assert(state_ == DiscordObjectState::Owned);
11491 Discord_Client_SetShowingChat(&instance_, showingChat);
11496 assert(state_ == DiscordObjectState::Owned);
11497 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
11498 auto callback__userData =
new Tcallback__UserData(callback);
11499 Discord_Client_LogCallback callback__native = [](
11500 auto message,
auto severity,
void* userData__) {
11501 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
11502 std::string message__str(
reinterpret_cast<char*
>(message.ptr), message.size);
11503 userData__typed->delegate(std::move(message__str),
11505 Discord_Free(message.ptr);
11507 Discord_Client_AddLogCallback(&instance_,
11509 Tcallback__UserData::Free,
11510 callback__userData,
11511 static_cast<Discord_LoggingSeverity
>(minSeverity));
11516 assert(state_ == DiscordObjectState::Owned);
11517 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
11518 auto callback__userData =
new Tcallback__UserData(callback);
11519 Discord_Client_LogCallback callback__native = [](
11520 auto message,
auto severity,
void* userData__) {
11521 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
11522 std::string message__str(
reinterpret_cast<char*
>(message.ptr), message.size);
11523 userData__typed->delegate(std::move(message__str),
11525 Discord_Free(message.ptr);
11527 Discord_Client_AddVoiceLogCallback(&instance_,
11529 Tcallback__UserData::Free,
11530 callback__userData,
11531 static_cast<Discord_LoggingSeverity
>(minSeverity));
11533void Client::Connect()
11535 assert(state_ == DiscordObjectState::Owned);
11536 Discord_Client_Connect(&instance_);
11538void Client::Disconnect()
11540 assert(state_ == DiscordObjectState::Owned);
11541 Discord_Client_Disconnect(&instance_);
11545 assert(state_ == DiscordObjectState::Owned);
11546 Discord_Client_Status returnValue__;
11547 returnValue__ = Discord_Client_GetStatus(&instance_);
11550void Client::OpenConnectedGamesSettingsInDiscord(
11553 assert(state_ == DiscordObjectState::Owned);
11554 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
11555 auto callback__userData =
new Tcallback__UserData(callback);
11556 Discord_Client_OpenConnectedGamesSettingsInDiscordCallback callback__native =
11557 [](
auto result,
void* userData__) {
11558 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
11560 userData__typed->delegate(std::move(result__obj));
11562 Discord_Client_OpenConnectedGamesSettingsInDiscord(
11563 &instance_, callback__native, Tcallback__UserData::Free, callback__userData);
11565void Client::SetApplicationId(uint64_t applicationId)
11567 assert(state_ == DiscordObjectState::Owned);
11568 Discord_Client_SetApplicationId(&instance_, applicationId);
11572 assert(state_ == DiscordObjectState::Owned);
11573 bool returnValue__;
11574 Discord_String path__str{(uint8_t*)(path.data()), path.size()};
11575 returnValue__ = Discord_Client_SetLogDir(
11576 &instance_, path__str,
static_cast<Discord_LoggingSeverity
>(minSeverity));
11577 return returnValue__;
11581 assert(state_ == DiscordObjectState::Owned);
11582 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11583 auto cb__userData =
new Tcb__UserData(cb);
11584 Discord_Client_OnStatusChanged cb__native =
11585 [](
auto status,
auto error,
auto errorDetail,
void* userData__) {
11586 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11591 Discord_Client_SetStatusChangedCallback(
11592 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11596 assert(state_ == DiscordObjectState::Owned);
11597 Discord_String path__str{(uint8_t*)(path.data()), path.size()};
11598 Discord_Client_SetVoiceLogDir(
11599 &instance_, path__str,
static_cast<Discord_LoggingSeverity
>(minSeverity));
11601void Client::CreateOrJoinLobby(std::string
const& secret,
11604 assert(state_ == DiscordObjectState::Owned);
11605 Discord_String secret__str{(uint8_t*)(secret.data()), secret.size()};
11606 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
11607 auto callback__userData =
new Tcallback__UserData(callback);
11608 Discord_Client_CreateOrJoinLobbyCallback callback__native =
11609 [](
auto result,
auto lobbyId,
void* userData__) {
11610 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
11612 userData__typed->delegate(std::move(result__obj), lobbyId);
11614 Discord_Client_CreateOrJoinLobby(
11615 &instance_, secret__str, callback__native, Tcallback__UserData::Free, callback__userData);
11617void Client::CreateOrJoinLobbyWithMetadata(
11618 std::string
const& secret,
11619 std::unordered_map<std::string, std::string>
const& lobbyMetadata,
11620 std::unordered_map<std::string, std::string>
const& memberMetadata,
11623 assert(state_ == DiscordObjectState::Owned);
11624 Discord_String secret__str{(uint8_t*)(secret.data()), secret.size()};
11625 ConvertedProperties lobbyMetadata__convert(lobbyMetadata);
11626 ConvertedProperties memberMetadata__convert(memberMetadata);
11627 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
11628 auto callback__userData =
new Tcallback__UserData(callback);
11629 Discord_Client_CreateOrJoinLobbyCallback callback__native =
11630 [](
auto result,
auto lobbyId,
void* userData__) {
11631 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
11633 userData__typed->delegate(std::move(result__obj), lobbyId);
11635 Discord_Client_CreateOrJoinLobbyWithMetadata(&instance_,
11637 lobbyMetadata__convert.Properties,
11638 memberMetadata__convert.Properties,
11640 Tcallback__UserData::Free,
11641 callback__userData);
11645 assert(state_ == DiscordObjectState::Owned);
11646 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11647 auto cb__userData =
new Tcb__UserData(cb);
11648 Discord_Client_GetGuildChannelsCallback cb__native =
11649 [](
auto result,
auto guildChannels,
void* userData__) {
11650 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11652 std::vector<discordpp::GuildChannel> guildChannels__vec;
11653 guildChannels__vec.reserve(guildChannels.size);
11654 for (
size_t i__ = 0; i__ < guildChannels.size; ++i__) {
11655 guildChannels__vec.emplace_back(guildChannels.ptr[i__], DiscordObjectState::Owned);
11657 Discord_Free(guildChannels.ptr);
11658 userData__typed->delegate(std::move(result__obj), std::move(guildChannels__vec));
11660 Discord_Client_GetGuildChannels(
11661 &instance_, guildId, cb__native, Tcb__UserData::Free, cb__userData);
11663std::optional<discordpp::LobbyHandle> Client::GetLobbyHandle(uint64_t lobbyId)
const
11665 assert(state_ == DiscordObjectState::Owned);
11666 bool returnIsNonNull__;
11667 Discord_LobbyHandle returnValueNative__;
11668 returnIsNonNull__ = Discord_Client_GetLobbyHandle(&instance_, lobbyId, &returnValueNative__);
11669 if (!returnIsNonNull__) {
11673 return returnValue__;
11675std::vector<uint64_t> Client::GetLobbyIds()
const
11677 assert(state_ == DiscordObjectState::Owned);
11678 Discord_UInt64Span returnValueNative__;
11679 Discord_Client_GetLobbyIds(&instance_, &returnValueNative__);
11680 std::vector<uint64_t> returnValue__(returnValueNative__.ptr,
11681 returnValueNative__.ptr + returnValueNative__.size);
11682 Discord_Free(returnValueNative__.ptr);
11683 return returnValue__;
11687 assert(state_ == DiscordObjectState::Owned);
11688 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11689 auto cb__userData =
new Tcb__UserData(cb);
11690 Discord_Client_GetUserGuildsCallback cb__native =
11691 [](
auto result,
auto guilds,
void* userData__) {
11692 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11694 std::vector<discordpp::GuildMinimal> guilds__vec;
11695 guilds__vec.reserve(guilds.size);
11696 for (
size_t i__ = 0; i__ < guilds.size; ++i__) {
11697 guilds__vec.emplace_back(guilds.ptr[i__], DiscordObjectState::Owned);
11699 Discord_Free(guilds.ptr);
11700 userData__typed->delegate(std::move(result__obj), std::move(guilds__vec));
11702 Discord_Client_GetUserGuilds(&instance_, cb__native, Tcb__UserData::Free, cb__userData);
11704void Client::JoinLinkedLobbyGuild(
11709 assert(state_ == DiscordObjectState::Owned);
11710 using TprovisionalUserMergeRequiredCallback__UserData =
11711 TDelegateUserData<std::remove_reference_t<
decltype(provisionalUserMergeRequiredCallback)>>;
11712 auto provisionalUserMergeRequiredCallback__userData =
11713 new TprovisionalUserMergeRequiredCallback__UserData(provisionalUserMergeRequiredCallback);
11714 Discord_Client_ProvisionalUserMergeRequiredCallback
11715 provisionalUserMergeRequiredCallback__native = [](
void* userData__) {
11716 auto userData__typed =
11717 static_cast<TprovisionalUserMergeRequiredCallback__UserData*
>(userData__);
11718 userData__typed->delegate();
11720 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
11721 auto callback__userData =
new Tcallback__UserData(callback);
11722 Discord_Client_JoinLinkedLobbyGuildCallback callback__native =
11723 [](
auto result,
auto inviteUrl,
void* userData__) {
11724 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
11726 std::string inviteUrl__str(
reinterpret_cast<char*
>(inviteUrl.ptr), inviteUrl.size);
11727 userData__typed->delegate(std::move(result__obj), std::move(inviteUrl__str));
11728 Discord_Free(inviteUrl.ptr);
11730 Discord_Client_JoinLinkedLobbyGuild(&instance_,
11732 provisionalUserMergeRequiredCallback__native,
11733 TprovisionalUserMergeRequiredCallback__UserData::Free,
11734 provisionalUserMergeRequiredCallback__userData,
11736 Tcallback__UserData::Free,
11737 callback__userData);
11741 assert(state_ == DiscordObjectState::Owned);
11742 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
11743 auto callback__userData =
new Tcallback__UserData(callback);
11744 Discord_Client_LeaveLobbyCallback callback__native = [](
auto result,
void* userData__) {
11745 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
11747 userData__typed->delegate(std::move(result__obj));
11749 Discord_Client_LeaveLobby(
11750 &instance_, lobbyId, callback__native, Tcallback__UserData::Free, callback__userData);
11752void Client::LinkChannelToLobby(uint64_t lobbyId,
11753 uint64_t channelId,
11756 assert(state_ == DiscordObjectState::Owned);
11757 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
11758 auto callback__userData =
new Tcallback__UserData(callback);
11759 Discord_Client_LinkOrUnlinkChannelCallback callback__native = [](
auto result,
11760 void* userData__) {
11761 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
11763 userData__typed->delegate(std::move(result__obj));
11765 Discord_Client_LinkChannelToLobby(&instance_,
11769 Tcallback__UserData::Free,
11770 callback__userData);
11774 assert(state_ == DiscordObjectState::Owned);
11775 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11776 auto cb__userData =
new Tcb__UserData(cb);
11777 Discord_Client_LobbyCreatedCallback cb__native = [](
auto lobbyId,
void* userData__) {
11778 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11779 userData__typed->delegate(lobbyId);
11781 Discord_Client_SetLobbyCreatedCallback(
11782 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11786 assert(state_ == DiscordObjectState::Owned);
11787 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11788 auto cb__userData =
new Tcb__UserData(cb);
11789 Discord_Client_LobbyDeletedCallback cb__native = [](
auto lobbyId,
void* userData__) {
11790 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11791 userData__typed->delegate(lobbyId);
11793 Discord_Client_SetLobbyDeletedCallback(
11794 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11798 assert(state_ == DiscordObjectState::Owned);
11799 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11800 auto cb__userData =
new Tcb__UserData(cb);
11801 Discord_Client_LobbyMemberAddedCallback cb__native =
11802 [](
auto lobbyId,
auto memberId,
void* userData__) {
11803 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11804 userData__typed->delegate(lobbyId, memberId);
11806 Discord_Client_SetLobbyMemberAddedCallback(
11807 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11811 assert(state_ == DiscordObjectState::Owned);
11812 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11813 auto cb__userData =
new Tcb__UserData(cb);
11814 Discord_Client_LobbyMemberRemovedCallback cb__native =
11815 [](
auto lobbyId,
auto memberId,
void* userData__) {
11816 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11817 userData__typed->delegate(lobbyId, memberId);
11819 Discord_Client_SetLobbyMemberRemovedCallback(
11820 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11824 assert(state_ == DiscordObjectState::Owned);
11825 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11826 auto cb__userData =
new Tcb__UserData(cb);
11827 Discord_Client_LobbyMemberUpdatedCallback cb__native =
11828 [](
auto lobbyId,
auto memberId,
void* userData__) {
11829 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11830 userData__typed->delegate(lobbyId, memberId);
11832 Discord_Client_SetLobbyMemberUpdatedCallback(
11833 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11837 assert(state_ == DiscordObjectState::Owned);
11838 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11839 auto cb__userData =
new Tcb__UserData(cb);
11840 Discord_Client_LobbyUpdatedCallback cb__native = [](
auto lobbyId,
void* userData__) {
11841 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11842 userData__typed->delegate(lobbyId);
11844 Discord_Client_SetLobbyUpdatedCallback(
11845 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11847void Client::UnlinkChannelFromLobby(uint64_t lobbyId,
11850 assert(state_ == DiscordObjectState::Owned);
11851 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
11852 auto callback__userData =
new Tcallback__UserData(callback);
11853 Discord_Client_LinkOrUnlinkChannelCallback callback__native = [](
auto result,
11854 void* userData__) {
11855 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
11857 userData__typed->delegate(std::move(result__obj));
11859 Discord_Client_UnlinkChannelFromLobby(
11860 &instance_, lobbyId, callback__native, Tcallback__UserData::Free, callback__userData);
11864 assert(state_ == DiscordObjectState::Owned);
11865 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
11866 auto callback__userData =
new Tcallback__UserData(callback);
11867 Discord_Client_IsDiscordAppInstalledCallback callback__native = [](
auto installed,
11868 void* userData__) {
11869 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
11870 userData__typed->delegate(installed);
11872 Discord_Client_IsDiscordAppInstalled(
11873 &instance_, callback__native, Tcallback__UserData::Free, callback__userData);
11878 assert(state_ == DiscordObjectState::Owned);
11879 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11880 auto cb__userData =
new Tcb__UserData(cb);
11881 Discord_Client_AcceptActivityInviteCallback cb__native =
11882 [](
auto result,
auto joinSecret,
void* userData__) {
11883 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11885 std::string joinSecret__str(
reinterpret_cast<char*
>(joinSecret.ptr), joinSecret.size);
11886 userData__typed->delegate(std::move(result__obj), std::move(joinSecret__str));
11887 Discord_Free(joinSecret.ptr);
11889 Discord_Client_AcceptActivityInvite(
11890 &instance_, invite.instance(), cb__native, Tcb__UserData::Free, cb__userData);
11892void Client::ClearRichPresence()
11894 assert(state_ == DiscordObjectState::Owned);
11895 Discord_Client_ClearRichPresence(&instance_);
11897bool Client::RegisterLaunchCommand(uint64_t applicationId, std::string command)
11899 assert(state_ == DiscordObjectState::Owned);
11900 bool returnValue__;
11901 Discord_String command__str{(uint8_t*)(command.data()), command.size()};
11902 returnValue__ = Discord_Client_RegisterLaunchCommand(&instance_, applicationId, command__str);
11903 return returnValue__;
11905bool Client::RegisterLaunchSteamApplication(uint64_t applicationId, uint32_t steamAppId)
11907 assert(state_ == DiscordObjectState::Owned);
11908 bool returnValue__;
11910 Discord_Client_RegisterLaunchSteamApplication(&instance_, applicationId, steamAppId);
11911 return returnValue__;
11913void Client::SendActivityInvite(uint64_t userId,
11914 std::string
const& content,
11917 assert(state_ == DiscordObjectState::Owned);
11918 Discord_String content__str{(uint8_t*)(content.data()), content.size()};
11919 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11920 auto cb__userData =
new Tcb__UserData(cb);
11921 Discord_Client_SendActivityInviteCallback cb__native = [](
auto result,
void* userData__) {
11922 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11924 userData__typed->delegate(std::move(result__obj));
11926 Discord_Client_SendActivityInvite(
11927 &instance_, userId, content__str, cb__native, Tcb__UserData::Free, cb__userData);
11929void Client::SendActivityJoinRequest(uint64_t userId,
11932 assert(state_ == DiscordObjectState::Owned);
11933 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11934 auto cb__userData =
new Tcb__UserData(cb);
11935 Discord_Client_SendActivityInviteCallback cb__native = [](
auto result,
void* userData__) {
11936 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11938 userData__typed->delegate(std::move(result__obj));
11940 Discord_Client_SendActivityJoinRequest(
11941 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
11946 assert(state_ == DiscordObjectState::Owned);
11947 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11948 auto cb__userData =
new Tcb__UserData(cb);
11949 Discord_Client_SendActivityInviteCallback cb__native = [](
auto result,
void* userData__) {
11950 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11952 userData__typed->delegate(std::move(result__obj));
11954 Discord_Client_SendActivityJoinRequestReply(
11955 &instance_, invite.instance(), cb__native, Tcb__UserData::Free, cb__userData);
11959 assert(state_ == DiscordObjectState::Owned);
11960 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11961 auto cb__userData =
new Tcb__UserData(cb);
11962 Discord_Client_ActivityInviteCallback cb__native = [](
auto invite,
void* userData__) {
11963 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11965 userData__typed->delegate(std::move(invite__obj));
11967 Discord_Client_SetActivityInviteCreatedCallback(
11968 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11972 assert(state_ == DiscordObjectState::Owned);
11973 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11974 auto cb__userData =
new Tcb__UserData(cb);
11975 Discord_Client_ActivityInviteCallback cb__native = [](
auto invite,
void* userData__) {
11976 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11978 userData__typed->delegate(std::move(invite__obj));
11980 Discord_Client_SetActivityInviteUpdatedCallback(
11981 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11985 assert(state_ == DiscordObjectState::Owned);
11986 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11987 auto cb__userData =
new Tcb__UserData(cb);
11988 Discord_Client_ActivityJoinCallback cb__native = [](
auto joinSecret,
void* userData__) {
11989 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11990 std::string joinSecret__str(
reinterpret_cast<char*
>(joinSecret.ptr), joinSecret.size);
11991 userData__typed->delegate(std::move(joinSecret__str));
11992 Discord_Free(joinSecret.ptr);
11994 Discord_Client_SetActivityJoinCallback(
11995 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11997void Client::SetActivityJoinWithApplicationCallback(
12000 assert(state_ == DiscordObjectState::Owned);
12001 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12002 auto cb__userData =
new Tcb__UserData(cb);
12003 Discord_Client_ActivityJoinWithApplicationCallback cb__native =
12004 [](
auto applicationId,
auto joinSecret,
void* userData__) {
12005 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12006 std::string joinSecret__str(
reinterpret_cast<char*
>(joinSecret.ptr), joinSecret.size);
12007 userData__typed->delegate(applicationId, std::move(joinSecret__str));
12008 Discord_Free(joinSecret.ptr);
12010 Discord_Client_SetActivityJoinWithApplicationCallback(
12011 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
12016 assert(state_ == DiscordObjectState::Owned);
12017 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
12018 auto callback__userData =
new Tcallback__UserData(callback);
12019 Discord_Client_UpdateStatusCallback callback__native = [](
auto result,
void* userData__) {
12020 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
12022 userData__typed->delegate(std::move(result__obj));
12024 Discord_Client_SetOnlineStatus(&instance_,
12025 static_cast<Discord_StatusType
>(status),
12027 Tcallback__UserData::Free,
12028 callback__userData);
12033 assert(state_ == DiscordObjectState::Owned);
12034 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12035 auto cb__userData =
new Tcb__UserData(cb);
12036 Discord_Client_UpdateRichPresenceCallback cb__native = [](
auto result,
void* userData__) {
12037 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12039 userData__typed->delegate(std::move(result__obj));
12041 Discord_Client_UpdateRichPresence(
12042 &instance_, activity.instance(), cb__native, Tcb__UserData::Free, cb__userData);
12044void Client::AcceptDiscordFriendRequest(uint64_t userId,
12047 assert(state_ == DiscordObjectState::Owned);
12048 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12049 auto cb__userData =
new Tcb__UserData(cb);
12050 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
12051 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12053 userData__typed->delegate(std::move(result__obj));
12055 Discord_Client_AcceptDiscordFriendRequest(
12056 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
12058void Client::AcceptGameFriendRequest(uint64_t userId,
12061 assert(state_ == DiscordObjectState::Owned);
12062 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12063 auto cb__userData =
new Tcb__UserData(cb);
12064 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
12065 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12067 userData__typed->delegate(std::move(result__obj));
12069 Discord_Client_AcceptGameFriendRequest(
12070 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
12074 assert(state_ == DiscordObjectState::Owned);
12075 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12076 auto cb__userData =
new Tcb__UserData(cb);
12077 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
12078 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12080 userData__typed->delegate(std::move(result__obj));
12082 Discord_Client_BlockUser(&instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
12084void Client::CancelDiscordFriendRequest(uint64_t userId,
12087 assert(state_ == DiscordObjectState::Owned);
12088 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12089 auto cb__userData =
new Tcb__UserData(cb);
12090 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
12091 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12093 userData__typed->delegate(std::move(result__obj));
12095 Discord_Client_CancelDiscordFriendRequest(
12096 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
12098void Client::CancelGameFriendRequest(uint64_t userId,
12101 assert(state_ == DiscordObjectState::Owned);
12102 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12103 auto cb__userData =
new Tcb__UserData(cb);
12104 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
12105 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12107 userData__typed->delegate(std::move(result__obj));
12109 Discord_Client_CancelGameFriendRequest(
12110 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
12114 assert(state_ == DiscordObjectState::Owned);
12115 Discord_RelationshipHandle returnValueNative__{};
12116 Discord_Client_GetRelationshipHandle(&instance_, userId, &returnValueNative__);
12118 return returnValue__;
12120std::vector<discordpp::RelationshipHandle> Client::GetRelationships()
const
12122 assert(state_ == DiscordObjectState::Owned);
12123 Discord_RelationshipHandleSpan returnValueNative__;
12124 Discord_Client_GetRelationships(&instance_, &returnValueNative__);
12125 std::vector<discordpp::RelationshipHandle> returnValue__;
12126 returnValue__.reserve(returnValueNative__.size);
12127 for (
size_t i__ = 0; i__ < returnValueNative__.size; ++i__) {
12128 returnValue__.emplace_back(returnValueNative__.ptr[i__], DiscordObjectState::Owned);
12130 Discord_Free(returnValueNative__.ptr);
12131 return returnValue__;
12133std::vector<discordpp::RelationshipHandle> Client::GetRelationshipsByGroup(
12136 assert(state_ == DiscordObjectState::Owned);
12137 Discord_RelationshipHandleSpan returnValueNative__;
12138 Discord_Client_GetRelationshipsByGroup(
12139 &instance_,
static_cast<Discord_RelationshipGroupType
>(groupType), &returnValueNative__);
12140 std::vector<discordpp::RelationshipHandle> returnValue__;
12141 returnValue__.reserve(returnValueNative__.size);
12142 for (
size_t i__ = 0; i__ < returnValueNative__.size; ++i__) {
12143 returnValue__.emplace_back(returnValueNative__.ptr[i__], DiscordObjectState::Owned);
12145 Discord_Free(returnValueNative__.ptr);
12146 return returnValue__;
12148void Client::RejectDiscordFriendRequest(uint64_t userId,
12151 assert(state_ == DiscordObjectState::Owned);
12152 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12153 auto cb__userData =
new Tcb__UserData(cb);
12154 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
12155 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12157 userData__typed->delegate(std::move(result__obj));
12159 Discord_Client_RejectDiscordFriendRequest(
12160 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
12162void Client::RejectGameFriendRequest(uint64_t userId,
12165 assert(state_ == DiscordObjectState::Owned);
12166 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12167 auto cb__userData =
new Tcb__UserData(cb);
12168 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
12169 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12171 userData__typed->delegate(std::move(result__obj));
12173 Discord_Client_RejectGameFriendRequest(
12174 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
12176void Client::RemoveDiscordAndGameFriend(uint64_t userId,
12179 assert(state_ == DiscordObjectState::Owned);
12180 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12181 auto cb__userData =
new Tcb__UserData(cb);
12182 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
12183 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12185 userData__typed->delegate(std::move(result__obj));
12187 Discord_Client_RemoveDiscordAndGameFriend(
12188 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
12192 assert(state_ == DiscordObjectState::Owned);
12193 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12194 auto cb__userData =
new Tcb__UserData(cb);
12195 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
12196 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12198 userData__typed->delegate(std::move(result__obj));
12200 Discord_Client_RemoveGameFriend(
12201 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
12203std::vector<discordpp::UserHandle> Client::SearchFriendsByUsername(std::string searchStr)
const
12205 assert(state_ == DiscordObjectState::Owned);
12206 Discord_UserHandleSpan returnValueNative__;
12207 Discord_String searchStr__str{(uint8_t*)(searchStr.data()), searchStr.size()};
12208 Discord_Client_SearchFriendsByUsername(&instance_, searchStr__str, &returnValueNative__);
12209 std::vector<discordpp::UserHandle> returnValue__;
12210 returnValue__.reserve(returnValueNative__.size);
12211 for (
size_t i__ = 0; i__ < returnValueNative__.size; ++i__) {
12212 returnValue__.emplace_back(returnValueNative__.ptr[i__], DiscordObjectState::Owned);
12214 Discord_Free(returnValueNative__.ptr);
12215 return returnValue__;
12217void Client::SendDiscordFriendRequest(std::string
const& username,
12220 assert(state_ == DiscordObjectState::Owned);
12221 Discord_String username__str{(uint8_t*)(username.data()), username.size()};
12222 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12223 auto cb__userData =
new Tcb__UserData(cb);
12224 Discord_Client_SendFriendRequestCallback cb__native = [](
auto result,
void* userData__) {
12225 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12227 userData__typed->delegate(std::move(result__obj));
12229 Discord_Client_SendDiscordFriendRequest(
12230 &instance_, username__str, cb__native, Tcb__UserData::Free, cb__userData);
12232void Client::SendDiscordFriendRequestById(uint64_t userId,
12235 assert(state_ == DiscordObjectState::Owned);
12236 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12237 auto cb__userData =
new Tcb__UserData(cb);
12238 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
12239 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12241 userData__typed->delegate(std::move(result__obj));
12243 Discord_Client_SendDiscordFriendRequestById(
12244 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
12246void Client::SendGameFriendRequest(std::string
const& username,
12249 assert(state_ == DiscordObjectState::Owned);
12250 Discord_String username__str{(uint8_t*)(username.data()), username.size()};
12251 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12252 auto cb__userData =
new Tcb__UserData(cb);
12253 Discord_Client_SendFriendRequestCallback cb__native = [](
auto result,
void* userData__) {
12254 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12256 userData__typed->delegate(std::move(result__obj));
12258 Discord_Client_SendGameFriendRequest(
12259 &instance_, username__str, cb__native, Tcb__UserData::Free, cb__userData);
12261void Client::SendGameFriendRequestById(uint64_t userId,
12264 assert(state_ == DiscordObjectState::Owned);
12265 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12266 auto cb__userData =
new Tcb__UserData(cb);
12267 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
12268 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12270 userData__typed->delegate(std::move(result__obj));
12272 Discord_Client_SendGameFriendRequestById(
12273 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
12277 assert(state_ == DiscordObjectState::Owned);
12278 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12279 auto cb__userData =
new Tcb__UserData(cb);
12280 Discord_Client_RelationshipCreatedCallback cb__native =
12281 [](
auto userId,
auto isDiscordRelationshipUpdate,
void* userData__) {
12282 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12283 userData__typed->delegate(userId, isDiscordRelationshipUpdate);
12285 Discord_Client_SetRelationshipCreatedCallback(
12286 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
12290 assert(state_ == DiscordObjectState::Owned);
12291 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12292 auto cb__userData =
new Tcb__UserData(cb);
12293 Discord_Client_RelationshipDeletedCallback cb__native =
12294 [](
auto userId,
auto isDiscordRelationshipUpdate,
void* userData__) {
12295 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12296 userData__typed->delegate(userId, isDiscordRelationshipUpdate);
12298 Discord_Client_SetRelationshipDeletedCallback(
12299 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
12303 assert(state_ == DiscordObjectState::Owned);
12304 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12305 auto cb__userData =
new Tcb__UserData(cb);
12306 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
12307 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12309 userData__typed->delegate(std::move(result__obj));
12311 Discord_Client_UnblockUser(&instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
12313std::optional<discordpp::UserHandle> Client::GetCurrentUserV2()
const
12315 assert(state_ == DiscordObjectState::Owned);
12316 bool returnIsNonNull__;
12317 Discord_UserHandle returnValueNative__;
12318 returnIsNonNull__ = Discord_Client_GetCurrentUserV2(&instance_, &returnValueNative__);
12319 if (!returnIsNonNull__) {
12323 return returnValue__;
12325void Client::GetDiscordClientConnectedUser(
12326 uint64_t applicationId,
12329 assert(state_ == DiscordObjectState::Owned);
12330 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
12331 auto callback__userData =
new Tcallback__UserData(callback);
12332 Discord_Client_GetDiscordClientConnectedUserCallback callback__native =
12333 [](
auto result,
auto user,
void* userData__) {
12334 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
12336 std::optional<discordpp::UserHandle> user__opt{};
12340 userData__typed->delegate(std::move(result__obj), std::move(user__opt));
12342 Discord_Client_GetDiscordClientConnectedUser(
12343 &instance_, applicationId, callback__native, Tcallback__UserData::Free, callback__userData);
12345std::optional<discordpp::UserHandle> Client::GetUser(uint64_t userId)
const
12347 assert(state_ == DiscordObjectState::Owned);
12348 bool returnIsNonNull__;
12349 Discord_UserHandle returnValueNative__;
12350 returnIsNonNull__ = Discord_Client_GetUser(&instance_, userId, &returnValueNative__);
12351 if (!returnIsNonNull__) {
12355 return returnValue__;
12357void Client::SetRelationshipGroupsUpdatedCallback(
12360 assert(state_ == DiscordObjectState::Owned);
12361 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12362 auto cb__userData =
new Tcb__UserData(cb);
12363 Discord_Client_RelationshipGroupsUpdatedCallback cb__native = [](
auto userId,
12364 void* userData__) {
12365 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12366 userData__typed->delegate(userId);
12368 Discord_Client_SetRelationshipGroupsUpdatedCallback(
12369 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
12373 assert(state_ == DiscordObjectState::Owned);
12374 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12375 auto cb__userData =
new Tcb__UserData(cb);
12376 Discord_Client_UserUpdatedCallback cb__native = [](
auto userId,
void* userData__) {
12377 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12378 userData__typed->delegate(userId);
12380 Discord_Client_SetUserUpdatedCallback(
12381 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
12383const CallInfoHandle CallInfoHandle::nullobj{{}, DiscordObjectState::Invalid};
12384CallInfoHandle::~CallInfoHandle()
12386 if (state_ == DiscordObjectState::Owned) {
12388 state_ = DiscordObjectState::Invalid;
12391CallInfoHandle::CallInfoHandle(CallInfoHandle&& other) noexcept
12392 : instance_(other.instance_)
12393 , state_(other.state_)
12395 other.state_ = DiscordObjectState::Invalid;
12397CallInfoHandle& CallInfoHandle::operator=(CallInfoHandle&& other)
noexcept
12399 if (
this != &other) {
12400 if (state_ == DiscordObjectState::Owned) {
12403 instance_ = other.instance_;
12404 state_ = other.state_;
12405 other.state_ = DiscordObjectState::Invalid;
12409CallInfoHandle::CallInfoHandle(
const CallInfoHandle& other)
12414 Discord_CallInfoHandle_Clone(&instance_, other.instance());
12416 state_ = DiscordObjectState::Owned;
12419CallInfoHandle& CallInfoHandle::operator=(
const CallInfoHandle& other)
12421 if (
this != &other) {
12422 if (state_ == DiscordObjectState::Owned) {
12424 state_ = DiscordObjectState::Invalid;
12426 if (other.state_ == DiscordObjectState::Owned) {
12427 Discord_CallInfoHandle_Clone(&instance_, other.instance());
12429 state_ = DiscordObjectState::Owned;
12434CallInfoHandle::CallInfoHandle(Discord_CallInfoHandle instance, DiscordObjectState state)
12435 : instance_(instance)
12439void CallInfoHandle::Drop()
12441 if (state_ != DiscordObjectState::Owned) {
12444 Discord_CallInfoHandle_Drop(&instance_);
12445 state_ = DiscordObjectState::Invalid;
12447uint64_t CallInfoHandle::ChannelId()
const
12449 assert(state_ == DiscordObjectState::Owned);
12450 uint64_t returnValue__;
12451 returnValue__ = Discord_CallInfoHandle_ChannelId(&instance_);
12452 return returnValue__;
12454std::vector<uint64_t> CallInfoHandle::GetParticipants()
const
12456 assert(state_ == DiscordObjectState::Owned);
12457 Discord_UInt64Span returnValueNative__;
12458 Discord_CallInfoHandle_GetParticipants(&instance_, &returnValueNative__);
12459 std::vector<uint64_t> returnValue__(returnValueNative__.ptr,
12460 returnValueNative__.ptr + returnValueNative__.size);
12461 Discord_Free(returnValueNative__.ptr);
12462 return returnValue__;
12464std::optional<discordpp::VoiceStateHandle> CallInfoHandle::GetVoiceStateHandle(
12465 uint64_t userId)
const
12467 assert(state_ == DiscordObjectState::Owned);
12468 bool returnIsNonNull__;
12469 Discord_VoiceStateHandle returnValueNative__;
12470 returnIsNonNull__ =
12471 Discord_CallInfoHandle_GetVoiceStateHandle(&instance_, userId, &returnValueNative__);
12472 if (!returnIsNonNull__) {
12476 return returnValue__;
12478uint64_t CallInfoHandle::GuildId()
const
12480 assert(state_ == DiscordObjectState::Owned);
12481 uint64_t returnValue__;
12482 returnValue__ = Discord_CallInfoHandle_GuildId(&instance_);
12483 return returnValue__;
Struct which controls what your rich presence looks like in the Discord client. If you don't specify ...
Definition discordpp.h:816
std::optional< std::string > InviteCoverImage() const
The invite cover image identifier or URL, rendered as a banner image on activity invites.
void SetLargeImage(std::optional< std::string > LargeImage)
Setter for ActivityAssets::LargeImage.
std::optional< std::string > SmallText() const
A tooltip string that is shown when the user hovers over the small image.
void SetLargeText(std::optional< std::string > LargeText)
Setter for ActivityAssets::LargeText.
ActivityAssets(ActivityAssets &&other) noexcept
Move constructor for ActivityAssets.
std::optional< std::string > SmallImage() const
The secondary image, rendered as a small circle over the largeImage.
ActivityAssets(const ActivityAssets &arg0)
Copy constructor for ActivityAssets.
void SetLargeUrl(std::optional< std::string > LargeUrl)
Setter for ActivityAssets::LargeUrl.
std::optional< std::string > LargeText() const
A tooltip string that is shown when the user hovers over the large image.
void SetSmallImage(std::optional< std::string > SmallImage)
Setter for ActivityAssets::SmallImage.
std::optional< std::string > SmallUrl() const
A URL that opens when the user clicks/taps the small image.
ActivityAssets & operator=(const ActivityAssets &arg0)
Copy assignment operator for ActivityAssets.
static const ActivityAssets nullobj
Uninitialized instance of ActivityAssets.
Definition discordpp.h:835
std::optional< std::string > LargeImage() const
The primary image identifier or URL, rendered as a large square icon on a user's rich presence.
std::optional< std::string > LargeUrl() const
A URL that opens when the user clicks/taps the large image.
void SetSmallText(std::optional< std::string > SmallText)
Setter for ActivityAssets::SmallText.
void SetInviteCoverImage(std::optional< std::string > InviteCoverImage)
Setter for ActivityAssets::InviteCoverImage.
ActivityAssets & operator=(ActivityAssets &&other) noexcept
Move assignment operator for ActivityAssets.
void SetSmallUrl(std::optional< std::string > SmallUrl)
Setter for ActivityAssets::SmallUrl.
When one user invites another to join their game on Discord, it will send a message to that user....
Definition discordpp.h:718
static const ActivityInvite nullobj
Uninitialized instance of ActivityInvite.
Definition discordpp.h:737
std::string SessionId() const
The session id of the user who sent the invite.
void SetIsValid(bool IsValid)
Setter for ActivityInvite::IsValid.
void SetSessionId(std::string SessionId)
Setter for ActivityInvite::SessionId.
uint64_t ApplicationId() const
The target application of the invite.
uint64_t MessageId() const
The id of the Discord message that contains the invite.
uint64_t SenderId() const
The user id of the user who sent the invite.
void SetApplicationId(uint64_t ApplicationId)
Setter for ActivityInvite::ApplicationId.
void SetSenderId(uint64_t SenderId)
Setter for ActivityInvite::SenderId.
void SetParentApplicationId(uint64_t ParentApplicationId)
Setter for ActivityInvite::ParentApplicationId.
bool IsValid() const
Whether or not this invite is currently joinable. An invite becomes invalid if it was sent more than ...
void SetChannelId(uint64_t ChannelId)
Setter for ActivityInvite::ChannelId.
uint64_t ChannelId() const
The id of the Discord channel in which the invite was sent.
void SetMessageId(uint64_t MessageId)
Setter for ActivityInvite::MessageId.
std::string PartyId() const
The id of the party the invite was sent for.
ActivityInvite & operator=(ActivityInvite &&other) noexcept
Move assignment operator for ActivityInvite.
ActivityInvite(const ActivityInvite &rhs)
Copy constructor for ActivityInvite.
void SetType(discordpp::ActivityActionTypes Type)
Setter for ActivityInvite::Type.
uint64_t ParentApplicationId() const
The application id of the parent - this is only applicable if there is a parent for a publisher's sui...
void SetPartyId(std::string PartyId)
Setter for ActivityInvite::PartyId.
ActivityInvite & operator=(const ActivityInvite &rhs)
Copy assignment operator for ActivityInvite.
discordpp::ActivityActionTypes Type() const
The type of invite that was sent.
ActivityInvite(ActivityInvite &&other) noexcept
Move constructor for ActivityInvite.
Definition discordpp.h:957
void SetMaxSize(int32_t MaxSize)
Setter for ActivityParty::MaxSize.
ActivityParty(ActivityParty &&other) noexcept
Move constructor for ActivityParty.
void SetCurrentSize(int32_t CurrentSize)
Setter for ActivityParty::CurrentSize.
void SetId(std::string Id)
Setter for ActivityParty::Id.
int32_t CurrentSize() const
The number of people currently in the party, must be at least 1.
int32_t MaxSize() const
The maximum number of people that can be in the party, must be at least 0. When 0,...
ActivityParty(const ActivityParty &arg0)
Copy constructor for ActivityParty.
ActivityParty & operator=(ActivityParty &&other) noexcept
Move assignment operator for ActivityParty.
void SetPrivacy(discordpp::ActivityPartyPrivacy Privacy)
Setter for ActivityParty::Privacy.
discordpp::ActivityPartyPrivacy Privacy() const
The privacy of the party.
std::string Id() const
Specifies the id of the party. "Party" is used colloquially to refer to a group of players in a share...
static const ActivityParty nullobj
Uninitialized instance of ActivityParty.
Definition discordpp.h:976
ActivityParty & operator=(const ActivityParty &arg0)
Copy assignment operator for ActivityParty.
Definition discordpp.h:1019
ActivitySecrets & operator=(ActivitySecrets &&other) noexcept
Move assignment operator for ActivitySecrets.
std::string Join() const
A secret string that is shared with users who are accepted into the party so the game knows how to jo...
ActivitySecrets & operator=(const ActivitySecrets &arg0)
Copy assignment operator for ActivitySecrets.
ActivitySecrets(ActivitySecrets &&other) noexcept
Move constructor for ActivitySecrets.
ActivitySecrets(const ActivitySecrets &arg0)
Copy constructor for ActivitySecrets.
void SetJoin(std::string Join)
Setter for ActivitySecrets::Join.
static const ActivitySecrets nullobj
Uninitialized instance of ActivitySecrets.
Definition discordpp.h:1038
Definition discordpp.h:903
ActivityTimestamps(ActivityTimestamps &&other) noexcept
Move constructor for ActivityTimestamps.
ActivityTimestamps(const ActivityTimestamps &arg0)
Copy constructor for ActivityTimestamps.
uint64_t Start() const
The time the activity started, in milliseconds since Unix epoch.
void SetStart(uint64_t Start)
Setter for ActivityTimestamps::Start.
static const ActivityTimestamps nullobj
Uninitialized instance of ActivityTimestamps.
Definition discordpp.h:922
ActivityTimestamps & operator=(ActivityTimestamps &&other) noexcept
Move assignment operator for ActivityTimestamps.
void SetEnd(uint64_t End)
Setter for ActivityTimestamps::End.
uint64_t End() const
The time the activity will end at, in milliseconds since Unix epoch.
ActivityTimestamps & operator=(const ActivityTimestamps &arg0)
Copy assignment operator for ActivityTimestamps.
An Activity represents one "thing" a user is doing on Discord and is part of their rich presence.
Definition discordpp.h:1288
std::vector< discordpp::ActivityButton > GetButtons() const
Returns the custom buttons for the rich presence.
void SetDetailsUrl(std::optional< std::string > DetailsUrl)
Setter for Activity::DetailsUrl.
std::optional< uint64_t > ParentApplicationId() const
The application ID of the parent application that the activity is associated with if it exists....
static const Activity nullobj
Uninitialized instance of Activity.
Definition discordpp.h:1307
std::optional< uint64_t > ApplicationId() const
The application ID of the game that the activity is associated with.
std::string Name() const
The name of the game or application that the activity is associated with.
void SetStateUrl(std::optional< std::string > StateUrl)
Setter for Activity::StateUrl.
void SetDetails(std::optional< std::string > Details)
Setter for Activity::Details.
Activity & operator=(Activity &&other) noexcept
Move assignment operator for Activity.
void SetParentApplicationId(std::optional< uint64_t > ParentApplicationId)
Setter for Activity::ParentApplicationId.
void SetType(discordpp::ActivityTypes Type)
Setter for Activity::Type.
std::optional< discordpp::ActivityAssets > Assets() const
Images used to customize how the Activity is displayed in the Discord client.
void SetTimestamps(std::optional< discordpp::ActivityTimestamps > Timestamps)
Setter for Activity::Timestamps.
bool Equals(discordpp::Activity other) const
Compares each field of the Activity struct for equality.
void SetApplicationId(std::optional< uint64_t > ApplicationId)
Setter for Activity::ApplicationId.
void SetName(std::string Name)
Setter for Activity::Name.
void SetSecrets(std::optional< discordpp::ActivitySecrets > Secrets)
Setter for Activity::Secrets.
Activity(const Activity &arg0)
Copy constructor for Activity.
void SetAssets(std::optional< discordpp::ActivityAssets > Assets)
Setter for Activity::Assets.
std::optional< discordpp::StatusDisplayTypes > StatusDisplayType() const
Controls which field is used for the user's status message.
std::optional< discordpp::ActivityTimestamps > Timestamps() const
The timestamps struct can be used to render either:
void SetParty(std::optional< discordpp::ActivityParty > Party)
Setter for Activity::Party.
void SetStatusDisplayType(std::optional< discordpp::StatusDisplayTypes > StatusDisplayType)
Setter for Activity::StatusDisplayType.
Activity & operator=(const Activity &arg0)
Copy assignment operator for Activity.
std::optional< discordpp::ActivityParty > Party() const
The party struct is used to indicate the size and members of the people the current user is playing w...
void AddButton(discordpp::ActivityButton button)
Adds a custom button to the rich presence.
std::optional< std::string > DetailsUrl() const
A URL that opens when the user clicks/taps the details text.
void SetSupportedPlatforms(discordpp::ActivityGamePlatforms SupportedPlatforms)
Setter for Activity::SupportedPlatforms.
std::optional< std::string > Details() const
The state of the what the user is doing for this activity.
void SetState(std::optional< std::string > State)
Setter for Activity::State.
Activity(Activity &&other) noexcept
Move constructor for Activity.
discordpp::ActivityGamePlatforms SupportedPlatforms() const
If an activity is joinable, but only on certain platforms, this field can be used to indicate which p...
std::optional< std::string > StateUrl() const
A URL that opens when the user clicks/taps the state text.
std::optional< discordpp::ActivitySecrets > Secrets() const
The secrets struct is used in combination with the party struct to make an Activity joinable.
std::optional< std::string > State() const
The state of the party for this activity.
discordpp::ActivityTypes Type() const
The type of activity this is.
Contains information about non-text content in a message that likely cannot be rendered in game such ...
Definition discordpp.h:2892
static std::string TypeToString(discordpp::AdditionalContentType type)
Converts the AdditionalContentType enum to a string.
AdditionalContent & operator=(AdditionalContent &&other) noexcept
Move assignment operator for AdditionalContent.
void SetCount(uint8_t Count)
Setter for AdditionalContent::Count.
void SetType(discordpp::AdditionalContentType Type)
Setter for AdditionalContent::Type.
std::optional< std::string > Title() const
When the additional content is a poll or thread, this field will contain the name of the poll or thre...
discordpp::AdditionalContentType Type() const
Represents the type of additional content in the message.
uint8_t Count() const
Represents the number of pieces of additional content so you could for example renders "2 additional ...
bool Equals(discordpp::AdditionalContent rhs) const
Compares each field of the AdditionalContent struct for equality.
AdditionalContent(AdditionalContent &&other) noexcept
Move constructor for AdditionalContent.
AdditionalContent & operator=(const AdditionalContent &arg0)
Copy assignment operator for AdditionalContent.
AdditionalContent(const AdditionalContent &arg0)
Copy constructor for AdditionalContent.
void SetTitle(std::optional< std::string > Title)
Setter for AdditionalContent::Title.
static const AdditionalContent nullobj
Uninitialized instance of AdditionalContent.
Definition discordpp.h:2911
Represents a single input or output audio device available to the user.
Definition discordpp.h:3125
AudioDevice & operator=(const AudioDevice &arg0)
Copy assignment operator for AudioDevice.
bool Equals(discordpp::AudioDevice rhs)
Compares the ID of two AudioDevice objects for equality.
std::string Name() const
The display name of the audio device.
bool IsDefault() const
Whether the audio device is the system default device.
std::string Id() const
The ID of the audio device.
AudioDevice(AudioDevice &&other) noexcept
Move constructor for AudioDevice.
AudioDevice & operator=(AudioDevice &&other) noexcept
Move assignment operator for AudioDevice.
static const AudioDevice nullobj
Uninitialized instance of AudioDevice.
Definition discordpp.h:3144
void SetId(std::string Id)
Setter for AudioDevice::Id.
void SetIsDefault(bool IsDefault)
Setter for AudioDevice::IsDefault.
void SetName(std::string Name)
Setter for AudioDevice::Name.
AudioDevice(const AudioDevice &arg0)
Copy constructor for AudioDevice.
Arguments to the Client::Authorize function.
Definition discordpp.h:1629
void SetIntegrationType(std::optional< discordpp::IntegrationType > IntegrationType)
Setter for AuthorizationArgs::IntegrationType.
std::optional< std::string > State() const
See https://discord.com/developers/docs/topics/oauth2#state-and-security for details on this field.
AuthorizationArgs & operator=(AuthorizationArgs &&other) noexcept
Move assignment operator for AuthorizationArgs.
void SetCustomSchemeParam(std::optional< std::string > CustomSchemeParam)
Setter for AuthorizationArgs::CustomSchemeParam.
std::optional< std::string > Nonce() const
The nonce field is generally only useful for backend integrations using ID tokens.
std::optional< discordpp::AuthorizationCodeChallenge > CodeChallenge() const
If using the Client::GetToken flow, you will need to generate a code challenge and verifier.
uint64_t ClientId() const
Optional. The Discord application ID for your game. Defaults to the value set by Client::SetApplicati...
AuthorizationArgs(const AuthorizationArgs &arg0)
Copy constructor for AuthorizationArgs.
void SetScopes(std::string Scopes)
Setter for AuthorizationArgs::Scopes.
static const AuthorizationArgs nullobj
Uninitialized instance of AuthorizationArgs.
Definition discordpp.h:1648
void SetClientId(uint64_t ClientId)
Setter for AuthorizationArgs::ClientId.
std::optional< std::string > CustomSchemeParam() const
Custom URI scheme for mobile redirects.
std::optional< discordpp::IntegrationType > IntegrationType() const
The type of integration the app will be installed as.
void SetCodeChallenge(std::optional< discordpp::AuthorizationCodeChallenge > CodeChallenge)
Setter for AuthorizationArgs::CodeChallenge.
AuthorizationArgs(AuthorizationArgs &&other) noexcept
Move constructor for AuthorizationArgs.
AuthorizationArgs & operator=(const AuthorizationArgs &arg0)
Copy assignment operator for AuthorizationArgs.
std::string Scopes() const
Scopes is a space separated string of the oauth scopes your game is requesting.
void SetNonce(std::optional< std::string > Nonce)
Setter for AuthorizationArgs::Nonce.
void SetState(std::optional< std::string > State)
Setter for AuthorizationArgs::State.
Struct that encapsulates the challenge part of the code verification flow.
Definition discordpp.h:1537
discordpp::AuthenticationCodeChallengeMethod Method() const
The method used to generate the challenge. The only method used by the SDK is sha256.
AuthorizationCodeChallenge(const AuthorizationCodeChallenge &arg0)
Copy constructor for AuthorizationCodeChallenge.
std::string Challenge() const
The challenge value.
AuthorizationCodeChallenge & operator=(AuthorizationCodeChallenge &&other) noexcept
Move assignment operator for AuthorizationCodeChallenge.
void SetMethod(discordpp::AuthenticationCodeChallengeMethod Method)
Setter for AuthorizationCodeChallenge::Method.
static const AuthorizationCodeChallenge nullobj
Uninitialized instance of AuthorizationCodeChallenge.
Definition discordpp.h:1557
AuthorizationCodeChallenge & operator=(const AuthorizationCodeChallenge &arg0)
Copy assignment operator for AuthorizationCodeChallenge.
AuthorizationCodeChallenge(AuthorizationCodeChallenge &&other) noexcept
Move constructor for AuthorizationCodeChallenge.
void SetChallenge(std::string Challenge)
Setter for AuthorizationCodeChallenge::Challenge.
Struct that encapsulates both parts of the code verification flow.
Definition discordpp.h:1584
AuthorizationCodeVerifier(const AuthorizationCodeVerifier &arg0)
Copy constructor for AuthorizationCodeVerifier.
AuthorizationCodeVerifier & operator=(const AuthorizationCodeVerifier &arg0)
Copy assignment operator for AuthorizationCodeVerifier.
void SetVerifier(std::string Verifier)
Setter for AuthorizationCodeVerifier::Verifier.
AuthorizationCodeVerifier(AuthorizationCodeVerifier &&other) noexcept
Move constructor for AuthorizationCodeVerifier.
std::string Verifier() const
The verifier part of the code verification flow.
void SetChallenge(discordpp::AuthorizationCodeChallenge Challenge)
Setter for AuthorizationCodeVerifier::Challenge.
static const AuthorizationCodeVerifier nullobj
Uninitialized instance of AuthorizationCodeVerifier.
Definition discordpp.h:1604
discordpp::AuthorizationCodeChallenge Challenge() const
The challenge part of the code verification flow.
AuthorizationCodeVerifier & operator=(AuthorizationCodeVerifier &&other) noexcept
Move assignment operator for AuthorizationCodeVerifier.
Convenience class that represents the state of a single Discord call in a lobby.
Definition discordpp.h:5211
std::optional< discordpp::VoiceStateHandle > GetVoiceStateHandle(uint64_t userId) const
Accesses the voice state for a single user so you can know if they have muted or deafened themselves.
std::vector< uint64_t > GetParticipants() const
Returns a list of the user IDs of the participants in the call.
CallInfoHandle & operator=(const CallInfoHandle &other)
Copy assignment operator for CallInfoHandle.
CallInfoHandle(const CallInfoHandle &other)
Copy constructor for CallInfoHandle.
CallInfoHandle & operator=(CallInfoHandle &&other) noexcept
Move assignment operator for CallInfoHandle.
uint64_t GuildId() const
Returns the lobby ID of the call.
static const CallInfoHandle nullobj
Uninitialized instance of CallInfoHandle.
Definition discordpp.h:5230
CallInfoHandle(CallInfoHandle &&other) noexcept
Move constructor for CallInfoHandle.
uint64_t ChannelId() const
Returns the lobby ID of the call.
Class that manages an active voice session in a Lobby.
Definition discordpp.h:1889
static std::string ErrorToString(discordpp::Call::Error type)
Converts the Error enum to a string.
Call & operator=(const Call &other)
Copy assignment operator for Call.
void SetSelfDeaf(bool deaf)
Mutes all audio from the currently active call for the current user. They will not be able to hear an...
std::function< void(uint64_t userId, bool isPlayingSound)> OnSpeakingStatusChanged
Callback function for Call::SetSpeakingStatusChangedCallback.
Definition discordpp.h:1950
static const Call nullobj
Uninitialized instance of Call.
Definition discordpp.h:1967
Call(Call &&other) noexcept
Move constructor for Call.
void SetOnVoiceStateChangedCallback(discordpp::Call::OnVoiceStateChanged cb)
Sets a callback function to generally be invoked whenever a field on a VoiceStateHandle object for a ...
Call & operator=(Call &&other) noexcept
Move assignment operator for Call.
discordpp::AudioModeType GetAudioMode()
Returns whether the call is configured to use voice auto detection or push to talk for the current us...
bool GetPTTActive()
Returns whether push to talk is currently active, meaning the user is currently pressing their config...
discordpp::VADThresholdSettings GetVADThreshold() const
Returns the current configuration for void auto detection thresholds. See the description of the VADT...
std::optional< discordpp::VoiceStateHandle > GetVoiceStateHandle(uint64_t userId) const
Returns a reference to the VoiceStateHandle for the user ID of the given call participant.
static std::string StatusToString(discordpp::Call::Status type)
Converts the Status enum to a string.
void SetVADThreshold(bool automatic, float threshold)
Customizes the void auto detection thresholds for picking up activity from a user's mic.
bool GetSelfDeaf()
Returns whether the current user is deafened.
Error
Enum that represents any network errors with the Call.
Definition discordpp.h:1897
@ None
None.
Definition discordpp.h:1900
@ Forbidden
Forbidden.
Definition discordpp.h:1915
@ SignalingConnectionFailed
SignalingConnectionFailed.
Definition discordpp.h:1903
@ SignalingUnexpectedClose
SignalingUnexpectedClose.
Definition discordpp.h:1906
@ JoinTimeout
JoinTimeout.
Definition discordpp.h:1912
@ VoiceConnectionFailed
VoiceConnectionFailed.
Definition discordpp.h:1909
Status
Enum that respresents the state of the Call's network connection.
Definition discordpp.h:1919
@ Disconnecting
Disconnecting.
Definition discordpp.h:1940
@ Connected
Connected.
Definition discordpp.h:1934
@ Reconnecting
Reconnecting.
Definition discordpp.h:1937
@ Connecting
Connecting.
Definition discordpp.h:1928
@ SignalingConnected
SignalingConnected.
Definition discordpp.h:1931
@ Disconnected
Disconnected.
Definition discordpp.h:1922
@ Joining
Joining.
Definition discordpp.h:1925
void SetLocalMute(uint64_t userId, bool mute)
Locally mutes the given userId, so that the current user cannot hear them anymore.
void SetSpeakingStatusChangedCallback(discordpp::Call::OnSpeakingStatusChanged cb)
Sets a callback function to be invoked whenever a user starts or stops speaking and is passed in the ...
std::function< void(discordpp::Call::Status status, discordpp::Call::Error error, int32_t errorDetail)> OnStatusChanged
Callback function for Call::SetStatusChangedCallback.
Definition discordpp.h:1953
uint32_t GetPTTReleaseDelay()
Returns the time that PTT is active after the user releases the PTT key and SetPTTActive(false) is ca...
uint64_t GetGuildId() const
Returns the ID of the lobby with which this call is associated.
Call(const Call &other)
Copy constructor for Call.
void SetPTTActive(bool active)
When push to talk is enabled, this should be called whenever the user pushes or releases their config...
void SetParticipantChangedCallback(discordpp::Call::OnParticipantChanged cb)
Sets a callback function to be invoked whenever some joins or leaves a voice call.
std::vector< uint64_t > GetParticipants() const
Returns a list of all of the user IDs of the participants in the call.
bool GetSelfMute()
Returns whether the current user's microphone is muted.
void SetPTTReleaseDelay(uint32_t releaseDelayMs)
If set, extends the time that PTT is active after the user releases the PTT key and SetPTTActive(fals...
discordpp::Call::Status GetStatus() const
Returns the current call status.
std::function< void(uint64_t userId, bool added)> OnParticipantChanged
Callback function for Call::SetParticipantChangedCallback.
Definition discordpp.h:1947
void SetParticipantVolume(uint64_t userId, float volume)
Locally changes the playout volume of the given userId.
void SetStatusChangedCallback(discordpp::Call::OnStatusChanged cb)
Sets a callback function to be invoked when the call status changes, such as when it fully connects o...
void SetAudioMode(discordpp::AudioModeType audioMode)
Sets whether to use voice auto detection or push to talk for the current user on this call.
bool GetLocalMute(uint64_t userId)
Returns whether the current user has locally muted the given userId for themselves.
float GetParticipantVolume(uint64_t userId)
Returns the locally set playout volume of the given userId.
void SetSelfMute(bool mute)
Mutes the current user's microphone so that no other participant in their active calls can hear them.
std::function< void(uint64_t userId)> OnVoiceStateChanged
Callback function for Call::SetOnVoiceStateChangedCallback.
Definition discordpp.h:1944
uint64_t GetChannelId() const
Returns the ID of the lobby with which this call is associated.
All messages sent on Discord are done so in a Channel. MessageHandle::ChannelId will contain the ID o...
Definition discordpp.h:2116
ChannelHandle(const ChannelHandle &other)
Copy constructor for ChannelHandle.
ChannelHandle & operator=(const ChannelHandle &other)
Copy assignment operator for ChannelHandle.
static const ChannelHandle nullobj
Uninitialized instance of ChannelHandle.
Definition discordpp.h:2135
uint64_t Id() const
Returns the ID of the channel.
ChannelHandle & operator=(ChannelHandle &&other) noexcept
Move assignment operator for ChannelHandle.
ChannelHandle(ChannelHandle &&other) noexcept
Move constructor for ChannelHandle.
std::vector< uint64_t > Recipients() const
For DMs and GroupDMs, returns the user IDs of the members of the channel. For all other channels retu...
std::string Name() const
Returns the name of the channel.
discordpp::ChannelType Type() const
Returns the type of the channel.
Options for creating a new Client instance.
Definition discordpp.h:3219
void SetCpuAffinityMask(std::optional< uint64_t > CpuAffinityMask)
Setter for ClientCreateOptions::CpuAffinityMask.
discordpp::AudioSystem ExperimentalAudioSystem() const
The audio system to use. Defaults to AudioSystem::Standard.
static const ClientCreateOptions nullobj
Uninitialized instance of ClientCreateOptions.
Definition discordpp.h:3238
ClientCreateOptions & operator=(const ClientCreateOptions &arg0)
Copy assignment operator for ClientCreateOptions.
bool ExperimentalAndroidPreventCommsForBluetooth() const
Whether to prevent communications mode on Android when Bluetooth is connected.
std::string WebBase() const
The base URL for the Discord web application.
std::string ApiBase() const
The base URL for the Discord API.
void SetApiBase(std::string ApiBase)
Setter for ClientCreateOptions::ApiBase.
ClientCreateOptions(const ClientCreateOptions &arg0)
Copy constructor for ClientCreateOptions.
void SetExperimentalAudioSystem(discordpp::AudioSystem ExperimentalAudioSystem)
Setter for ClientCreateOptions::ExperimentalAudioSystem.
ClientCreateOptions(ClientCreateOptions &&other) noexcept
Move constructor for ClientCreateOptions.
std::optional< uint64_t > CpuAffinityMask() const
CPU affinity mask hint for certain platforms. Depending on platform support, may or may not be ignore...
void SetWebBase(std::string WebBase)
Setter for ClientCreateOptions::WebBase.
void SetExperimentalAndroidPreventCommsForBluetooth(bool ExperimentalAndroidPreventCommsForBluetooth)
Setter for ClientCreateOptions::ExperimentalAndroidPreventCommsForBluetooth.
ClientCreateOptions & operator=(ClientCreateOptions &&other) noexcept
Move assignment operator for ClientCreateOptions.
Struct that stores information about the result of an SDK function call.
Definition discordpp.h:1444
void SetRetryable(bool Retryable)
Setter for ClientResult::Retryable.
bool Retryable() const
Indicates if, although an API request failed, it is safe and recommended to retry it.
void SetErrorCode(int32_t ErrorCode)
Setter for ClientResult::ErrorCode.
ClientResult & operator=(const ClientResult &arg0)
Copy assignment operator for ClientResult.
void SetStatus(discordpp::HttpStatusCode Status)
Setter for ClientResult::Status.
std::string Error() const
A description of the error that occurred.
discordpp::ErrorType Type() const
The type of error that occurred. See ErrorType for more information.
void SetResponseBody(std::string ResponseBody)
Setter for ClientResult::ResponseBody.
ClientResult(ClientResult &&other) noexcept
Move constructor for ClientResult.
void SetSuccessful(bool Successful)
Setter for ClientResult::Successful.
std::string ToString() const
Returns the error message if any of the ClientResult.
static const ClientResult nullobj
Uninitialized instance of ClientResult.
Definition discordpp.h:1463
ClientResult & operator=(ClientResult &&other) noexcept
Move assignment operator for ClientResult.
int32_t ErrorCode() const
A more detailed error code for this failure. Currently the only use of this is when an API request is...
void SetRetryAfter(float RetryAfter)
Setter for ClientResult::RetryAfter.
float RetryAfter() const
When a user is being rate limited by Discord (and so status == 429), this field should be set and is ...
std::string ResponseBody() const
The full HTTP response body, which will usually be a JSON string.
discordpp::HttpStatusCode Status() const
The HTTP status code of the API call.
void SetError(std::string Error)
Setter for ClientResult::Error.
ClientResult(const ClientResult &arg0)
Copy constructor for ClientResult.
bool Successful() const
Equivalent to type == ErrorType::None.
void SetType(discordpp::ErrorType Type)
Setter for ClientResult::Type.
The Client class is the main entry point for the Discord SDK. All functionality is exposed through th...
Definition discordpp.h:3299
std::function< void(discordpp::ClientResult result)> UnmergeIntoProvisionalAccountCallback
Callback function for the Client::UnmergeIntoProvisionalAccount method.
Definition discordpp.h:3479
std::function< void(std::vector< discordpp::AudioDevice > devices)> GetOutputDevicesCallback
Callback function for Client::GetOutputDevices.
Definition discordpp.h:3396
std::function< void(discordpp::ClientResult result, std::string inviteUrl)> JoinLinkedLobbyGuildCallback
Callback function for Client::JoinLinkedLobbyGuild.
Definition discordpp.h:3561
bool RegisterLaunchCommand(uint64_t applicationId, std::string command)
When a user accepts an activity invite for your game within the Discord client, Discord needs to know...
void SetRelationshipCreatedCallback(discordpp::Client::RelationshipCreatedCallback cb)
Sets a callback to be invoked whenever a relationship for this user is established or changes type.
void GetUserMessagesWithLimit(uint64_t recipientId, int32_t limit, discordpp::Client::UserMessagesWithLimitCallback cb)
Retrieves messages from the DM conversation with the specified user.
void GetLobbyMessagesWithLimit(uint64_t lobbyId, int32_t limit, discordpp::Client::GetLobbyMessagesCallback cb)
Retrieves recent messages from the specified lobby.
std::function< void(uint64_t messageId)> MessageCreatedCallback
Callback function for Client::SetMessageCreatedCallback.
Definition discordpp.h:3524
discordpp::Call GetCall(uint64_t channelId)
Returns a reference to the currently active call, if any.
std::function< void(uint64_t userId)> RelationshipGroupsUpdatedCallback
Callback function for Client::SetRelationshipGroupsUpdatedCallback.
Definition discordpp.h:3644
std::function< void(discordpp::ClientResult result)> UpdateRelationshipCallback
Callback function for most other Relationship functions such as Client::SendDiscordFriendRequestById.
Definition discordpp.h:3618
void EndCalls(discordpp::Client::EndCallsCallback callback)
Ends any active call, if any. Any references you have to Call objects are invalid after they are ende...
static std::string StatusToString(discordpp::Client::Status type)
Converts the Status enum to a string.
void Disconnect()
Asynchronously disconnects the client.
void SendDiscordFriendRequest(std::string const &username, discordpp::Client::SendFriendRequestCallback cb)
Sends a Discord friend request to the target user.
void RefreshToken(uint64_t applicationId, std::string const &refreshToken, discordpp::Client::TokenExchangeCallback callback)
Generates a new access token for the current user from a refresh token.
void SendLobbyMessageWithMetadata(uint64_t lobbyId, std::string const &content, std::unordered_map< std::string, std::string > const &metadata, discordpp::Client::SendUserMessageCallback cb)
Variant of Client::SendLobbyMessage that also accepts metadata to be sent with the message.
void SetEchoCancellation(bool on)
Enables or disables the basic echo cancellation provided by the WebRTC library.
void GetInputDevices(discordpp::Client::GetInputDevicesCallback cb)
Asynchronously fetches the list of audio input devices available to the user.
void CancelGameFriendRequest(uint64_t userId, discordpp::Client::UpdateRelationshipCallback cb)
Cancels an outgoing game friend request to the target user.
void AbortGetTokenFromDevice()
This function is used to abort/cleanup the device authorization flow.
bool SetLogDir(std::string const &path, discordpp::LoggingSeverity minSeverity)
Causes logs generated by the SDK to be written to disk in the specified directory.
void OpenConnectedGamesSettingsInDiscord(discordpp::Client::OpenConnectedGamesSettingsInDiscordCallback callback)
Opens the Connected Games settings in the Discord client, which is where users can manage their setti...
void SetAuthorizeDeviceScreenClosedCallback(discordpp::Client::AuthorizeDeviceScreenClosedCallback cb)
Sets a callback function to be invoked when the device authorization screen is closed.
void SetMessageCreatedCallback(discordpp::Client::MessageCreatedCallback cb)
Sets a callback to be invoked whenever a new message is received in either a lobby or a DM.
std::function< void(discordpp::ClientResult result)> UpdateProvisionalAccountDisplayNameCallback
Callback function for Client::UpdateProvisionalAccountDisplayName.
Definition discordpp.h:3483
std::function< void(bool inputDetected)> NoAudioInputCallback
Callback function for Client::SetNoAudioInputCallback.
Definition discordpp.h:3408
void UnlinkChannelFromLobby(uint64_t lobbyId, discordpp::Client::LinkOrUnlinkChannelCallback callback)
Removes any existing channel link from the specified lobby.
std::function< void()> ProvisionalUserMergeRequiredCallback
Callback function for when Client::ProvisionalUserMergeCompleted completes.
Definition discordpp.h:3512
void SetMessageDeletedCallback(discordpp::Client::MessageDeletedCallback cb)
Sets a callback to be invoked whenever a message is deleted.
void DeleteUserMessage(uint64_t recipientId, uint64_t messageId, discordpp::Client::DeleteUserMessageCallback cb)
Deletes the specified message sent by the current user to the specified recipient.
void SetVoiceParticipantChangedCallback(discordpp::Client::VoiceParticipantChangedCallback cb)
Callback invoked whenever a user in a lobby joins or leaves a voice call.
void UnmergeIntoProvisionalAccount(uint64_t applicationId, discordpp::AuthenticationExternalAuthType externalAuthType, std::string const &externalAuthToken, discordpp::Client::UnmergeIntoProvisionalAccountCallback callback)
This function is used to unlink/unmerge a external identity from a Discord account....
std::function< void(discordpp::ClientResult result, std::vector< discordpp::GuildMinimal > guilds)> GetUserGuildsCallback
Callback function for Client::GetUserGuilds.
Definition discordpp.h:3557
Client(std::string apiBase, std::string webBase)
Creates a new instance of the Client but allows customizing the Discord URL to use.
void RevokeToken(uint64_t applicationId, std::string const &token, discordpp::Client::RevokeTokenCallback callback)
Revoke all application access/refresh tokens associated with a user with any valid access/refresh tok...
void LinkChannelToLobby(uint64_t lobbyId, uint64_t channelId, discordpp::Client::LinkOrUnlinkChannelCallback callback)
Links the specified channel on Discord to the specified in-game lobby.
std::function< void(uint64_t lobbyId)> LobbyDeletedCallback
Callback function for Client::SetLobbyDeletedCallback.
Definition discordpp.h:3574
std::function< void(std::string message, discordpp::LoggingSeverity severity)> LogCallback
Callback function invoked when a new log message is generated.
Definition discordpp.h:3533
void SetDeviceChangeCallback(discordpp::Client::DeviceChangeCallback callback)
Sets a callback function to be invoked when Discord detects a change in the available audio devices.
void GetUserMessageSummaries(discordpp::Client::UserMessageSummariesCallback cb)
Retrieves message conversation summaries for all users the current user has DM conversations with.
std::function< void(discordpp::ClientResult result)> LinkOrUnlinkChannelCallback
Callback function for Client::LinkChannelToLobby.
Definition discordpp.h:3568
std::function< void(discordpp::AudioDevice device)> GetCurrentOutputDeviceCallback
Callback function for Client::GetCurrentOutputDevice.
Definition discordpp.h:3389
std::vector< uint64_t > GetLobbyIds() const
Returns a list of all the lobbies that the user is a member of and the SDK has loaded.
void SetUserUpdatedCallback(discordpp::Client::UserUpdatedCallback cb)
The UserUpdatedCallback is invoked whenever any user the current session knows about changes,...
std::function< void()> TokenExpirationCallback
Callback function for Client::SetTokenExpirationCallback.
Definition discordpp.h:3476
std::function< void(discordpp::ClientResult result)> SetOutputDeviceCallback
Callback function for Client::SetOutputDevice.
Definition discordpp.h:3411
void SetAecDump(bool on)
Enables or disables AEC diagnostic recording.
std::function< void(discordpp::ClientResult result, std::optional< discordpp::UserHandle > user)> GetDiscordClientConnectedUserCallback
Callback function for when Client::GetDiscordClientConnectedUser completes.
Definition discordpp.h:3639
void SetActivityInviteCreatedCallback(discordpp::Client::ActivityInviteCallback cb)
Sets a callback function that is invoked when the current user receives an activity invite from anoth...
std::function< void(uint64_t lobbyId, uint64_t memberId)> LobbyMemberUpdatedCallback
Callback function for Client::SetLobbyMemberUpdatedCallback.
Definition discordpp.h:3583
void SendUserMessage(uint64_t recipientId, std::string const &content, discordpp::Client::SendUserMessageCallback cb)
Sends a direct message to the specified user.
Client & operator=(Client &&other) noexcept
Move assignment operator for Client.
void GetTokenFromProvisionalMerge(uint64_t applicationId, std::string const &code, std::string const &codeVerifier, std::string const &redirectUri, discordpp::AuthenticationExternalAuthType externalAuthType, std::string const &externalAuthToken, discordpp::Client::TokenExchangeCallback callback)
This function should be used with the Client::Authorize function whenever a user with a provisional a...
static std::string GetVersionHash()
Returns the git commit hash this version was built from.
bool RegisterLaunchSteamApplication(uint64_t applicationId, uint32_t steamAppId)
When a user accepts an activity invite for your game within the Discord client, Discord needs to know...
void FetchCurrentUser(discordpp::AuthorizationTokenType tokenType, std::string const &token, discordpp::Client::FetchCurrentUserCallback callback)
Fetches basic information about the user associated with the given auth token.
void SetNoAudioInputCallback(discordpp::Client::NoAudioInputCallback callback)
Callback function invoked when the above threshold is set and there is a change in whether audio is b...
std::vector< discordpp::UserHandle > SearchFriendsByUsername(std::string searchStr) const
Searches all of your friends by both username and display name, returning a list of all friends that ...
void SetVoiceLogDir(std::string const &path, discordpp::LoggingSeverity minSeverity)
Causes logs generated by the voice subsystem of the SDK to be written to disk in the specified direct...
std::function< void(uint64_t userId, int16_t *data, uint64_t samplesPerChannel, int32_t sampleRate, uint64_t channels, bool &outShouldMute)> UserAudioReceivedCallback
Callback function for Client::StartCallWithAudioCallbacks.
Definition discordpp.h:3420
std::function< void(discordpp::ClientResult result)> LeaveLobbyCallback
Callback function for Client::LeaveLobby.
Definition discordpp.h:3565
std::function< void(uint64_t lobbyId)> LobbyUpdatedCallback
Callback function for Client::SetLobbyUpdatedCallback.
Definition discordpp.h:3586
void GetTokenFromDevice(discordpp::DeviceAuthorizationArgs args, discordpp::Client::TokenExchangeCallback callback)
This function is a combination of Client::Authorize and Client::GetToken, but is used for the case wh...
void CloseAuthorizeDeviceScreen()
This function is used to hide the device authorization screen and is used for the case where the user...
void SetOpusHardwareCoding(bool encode, bool decode)
Enables or disables hardware encoding and decoding for audio, if it is available.
void JoinLinkedLobbyGuild(uint64_t lobbyId, discordpp::Client::ProvisionalUserMergeRequiredCallback provisionalUserMergeRequiredCallback, discordpp::Client::JoinLinkedLobbyGuildCallback callback)
Invites the current user to the Discord guild of the channel that is linked to the specified lobby....
bool ShowAudioRoutePicker()
On iOS devices, show the system audio route picker.
void SetActivityJoinCallback(discordpp::Client::ActivityJoinCallback cb)
Sets a callback function that is invoked when the current user also has Discord running on their comp...
void GetOutputDevices(discordpp::Client::GetOutputDevicesCallback cb)
Asynchronously fetches the list of audio output devices available to the user.
std::function< void()> AuthorizeDeviceScreenClosedCallback
Callback function for Client::SetAuthorizeDeviceScreenClosedCallback.
Definition discordpp.h:3473
void SetSelfDeafAll(bool deaf)
Mutes all audio from the currently active call for the current user in all calls. They will not be ab...
void ExchangeChildToken(std::string const &parentApplicationToken, uint64_t childApplicationId, discordpp::Client::ExchangeChildTokenCallback callback)
Exchanges a parent application token for a child application token.
std::function< void(bool installed)> IsDiscordAppInstalledCallback
Callback invoked when the IsDiscordAppInstalled function completes.
Definition discordpp.h:3589
std::function< void(discordpp::ClientResult result)> UpdateRichPresenceCallback
Callback function for when Client::UpdateRichPresence completes.
Definition discordpp.h:3614
std::function< void(discordpp::ClientResult result, std::vector< discordpp::MessageHandle > messages)> UserMessagesWithLimitCallback
Callback function for Client::GetUserMessagesWithLimit.
Definition discordpp.h:3507
void CreateOrJoinLobbyWithMetadata(std::string const &secret, std::unordered_map< std::string, std::string > const &lobbyMetadata, std::unordered_map< std::string, std::string > const &memberMetadata, discordpp::Client::CreateOrJoinLobbyCallback callback)
Variant of Client::CreateOrJoinLobby that also accepts developer-supplied metadata.
Client()
Creates a new instance of the Client.
std::function< void(discordpp::ClientResult result)> SendFriendRequestCallback
Callback function for Client::SendDiscordFriendRequest and Client::SendGameFriendRequest.
Definition discordpp.h:3622
std::function< void(discordpp::ClientResult result, std::vector< discordpp::MessageHandle > messages)> GetLobbyMessagesCallback
Callback function for Client::GetLobbyMessagesWithLimit.
Definition discordpp.h:3497
void RegisterAuthorizeRequestCallback(discordpp::Client::AuthorizeRequestCallback callback)
Registers a callback to be invoked when a user requests to initiate the authorization flow.
void UpdateToken(discordpp::AuthorizationTokenType tokenType, std::string token, discordpp::Client::UpdateTokenCallback callback)
Asynchronously sets a new auth token for this client to use.
std::function< void(discordpp::Client::Status status, discordpp::Client::Error error, int32_t errorDetail)> OnStatusChanged
Callback function for Client::SetStatusChangedCallback.
Definition discordpp.h:3544
std::function< void(uint64_t applicationId, std::string joinSecret)> ActivityJoinWithApplicationCallback
Callback function for Client::SetActivityJoinWithApplicationCallback.
Definition discordpp.h:3607
void SetOutputVolume(float outputVolume)
Sets the speaker volume for the current user.
std::function< void()> EndCallsCallback
Callback invoked when Client::EndCalls completes.
Definition discordpp.h:3383
void SendGameFriendRequestById(uint64_t userId, discordpp::Client::UpdateRelationshipCallback cb)
Sends (or accepts) a game friend request to the target user.
void OpenMessageInDiscord(uint64_t messageId, discordpp::Client::ProvisionalUserMergeRequiredCallback provisionalUserMergeRequiredCallback, discordpp::Client::OpenMessageInDiscordCallback callback)
Opens the given message in the Discord client.
void RemoveGameFriend(uint64_t userId, discordpp::Client::UpdateRelationshipCallback cb)
Removes any game friendship between the current user and the target user.
std::vector< discordpp::Call > GetCalls()
Returns a reference to all currently active calls, if any.
std::optional< discordpp::ChannelHandle > GetChannelHandle(uint64_t channelId) const
Returns a reference to the Discord channel object for the given ID.
std::function< void(discordpp::ClientResult result)> RevokeTokenCallback
Callback function for the Client::RevokeToken method.
Definition discordpp.h:3470
void SendActivityJoinRequest(uint64_t userId, discordpp::Client::SendActivityInviteCallback cb)
Requests to join the activity of the specified user.
std::function< void(discordpp::ClientResult result, std::string joinSecret)> AcceptActivityInviteCallback
Callback function for Client::AcceptActivityInvite.
Definition discordpp.h:3592
void RejectDiscordFriendRequest(uint64_t userId, discordpp::Client::UpdateRelationshipCallback cb)
Declines an incoming Discord friend request from the target user.
Status
This enum refers to the status of the internal websocket the SDK uses to communicate with Discord The...
Definition discordpp.h:3342
@ Disconnecting
Disconnecting.
Definition discordpp.h:3360
@ Connected
Connected.
Definition discordpp.h:3351
@ HttpWait
HttpWait.
Definition discordpp.h:3363
@ Reconnecting
Reconnecting.
Definition discordpp.h:3357
@ Connecting
Connecting.
Definition discordpp.h:3348
@ Ready
Ready.
Definition discordpp.h:3354
@ Disconnected
Disconnected.
Definition discordpp.h:3345
static std::string GetDefaultCommunicationScopes()
Returns the default set of OAuth2 scopes that should be used with the Discord SDK when making use of ...
void SetRelationshipDeletedCallback(discordpp::Client::RelationshipDeletedCallback cb)
Sets a callback to be invoked whenever a relationship for this user is removed, such as when the user...
void UpdateProvisionalAccountDisplayName(std::string const &name, discordpp::Client::UpdateProvisionalAccountDisplayNameCallback callback)
Updates the display name of a provisional account to the specified name.
static std::string GetDefaultPresenceScopes()
Returns the default set of OAuth2 scopes that should be used with the Discord SDK when leveraging bas...
void SendLobbyMessage(uint64_t lobbyId, std::string const &content, discordpp::Client::SendUserMessageCallback cb)
Sends a message in a lobby chat to all members of the lobby.
std::optional< discordpp::MessageHandle > GetMessageHandle(uint64_t messageId) const
Returns a reference to the Discord message object for the given ID.
float GetOutputVolume()
Returns the output volume for the current user.
std::function< void(discordpp::ClientResult result, std::string accessToken, std::string refreshToken, discordpp::AuthorizationTokenType tokenType, int32_t expiresIn, std::string scopes)> TokenExchangeCallback
Callback function for the token exchange APIs such as Client::GetToken.
Definition discordpp.h:3455
void SetThreadPriority(discordpp::Client::Thread thread, int32_t priority)
Allows setting the priority of various SDK threads.
discordpp::UserHandle GetCurrentUser() const
(deprecated)
std::function< void(discordpp::ClientResult result)> OpenMessageInDiscordCallback
Callback function for when Client::OpenMessageInDiscord completes.
Definition discordpp.h:3515
void GetProvisionalToken(uint64_t applicationId, discordpp::AuthenticationExternalAuthType externalAuthType, std::string const &externalAuthToken, discordpp::Client::TokenExchangeCallback callback)
Provisional accounts are a way for users that have not signed up for Discord to still access SDK func...
void GetCurrentInputDevice(discordpp::Client::GetCurrentInputDeviceCallback cb)
Asynchronously fetches the current audio input device in use by the client.
void SetAutomaticGainControl(bool on)
When enabled, automatically adjusts the microphone volume to keep it clear and consistent.
void EditUserMessage(uint64_t recipientId, uint64_t messageId, std::string const &content, discordpp::Client::EditUserMessageCallback cb)
Edits the specified message sent by the current user to the specified recipient.
std::function< void()> EndCallCallback
Callback invoked when Client::EndCall completes.
Definition discordpp.h:3380
std::function< void()> AuthorizeRequestCallback
Callback invoked when a user requests to initiate the authorization flow from the discord app.
Definition discordpp.h:3467
std::function< void(discordpp::ClientResult result)> EditUserMessageCallback
Callback function for Client::EditUserMessage.
Definition discordpp.h:3494
void Connect()
Asynchronously connects the client to Discord.
void SetLobbyDeletedCallback(discordpp::Client::LobbyDeletedCallback cb)
Sets a callback to be invoked when a lobby is no longer available.
void GetDiscordClientConnectedUser(uint64_t applicationId, discordpp::Client::GetDiscordClientConnectedUserCallback callback) const
If the Discord app is running on the user's computer and the SDK establishes a connection to it,...
static int32_t GetVersionPatch()
Returns the patch version of the Discord Social SDK.
void CreateOrJoinLobby(std::string const &secret, discordpp::Client::CreateOrJoinLobbyCallback callback)
Joins the user to the specified lobby, creating one if it does not exist.
void LeaveLobby(uint64_t lobbyId, discordpp::Client::LeaveLobbyCallback callback)
Removes the current user from the specified lobby.
float GetInputVolume()
Returns the input volume for the current user's microphone.
std::function< void(discordpp::ClientResult result)> SetInputDeviceCallback
Callback function for Client::SetInputDevice.
Definition discordpp.h:3405
void SetLobbyMemberRemovedCallback(discordpp::Client::LobbyMemberRemovedCallback cb)
Sets a callback function to be invoked whenever a member of a lobby is removed and can no longer conn...
Client(Client &&other) noexcept
Move constructor for Client.
static std::string GetDefaultAudioDeviceId()
Returns the ID of the system default audio device if the user has not explicitly chosen one.
void CancelDiscordFriendRequest(uint64_t userId, discordpp::Client::UpdateRelationshipCallback cb)
Cancels an outgoing Discord friend request to the target user.
void IsDiscordAppInstalled(discordpp::Client::IsDiscordAppInstalledCallback callback)
Checks whether the Discord mobile app is installed on this device. On desktop platforms,...
std::function< void(uint64_t lobbyId, uint64_t memberId)> LobbyMemberAddedCallback
Callback function for Client::SetLobbyMemberAddedCallback.
Definition discordpp.h:3577
void SetOnlineStatus(discordpp::StatusType status, discordpp::Client::UpdateStatusCallback callback)
Sets whether a user is online/invisible/idle/dnd on Discord.
void ClearRichPresence()
Clears the right presence for the current user.
void SetSelfMuteAll(bool mute)
Mutes the current user's microphone so that no other participant in their active calls can hear them ...
void SetStatusChangedCallback(discordpp::Client::OnStatusChanged cb)
Sets a callback function to be invoked whenever the SDKs status changes.
std::function< void(discordpp::ActivityInvite invite)> ActivityInviteCallback
Callback function for Client::SetActivityInviteCreatedCallback and Client::SetActivityInviteUpdatedCa...
Definition discordpp.h:3601
std::vector< discordpp::RelationshipHandle > GetRelationshipsByGroup(discordpp::RelationshipGroupType groupType) const
Returns a list of relationships that belong to the specified relationship group type....
std::function< void(discordpp::ClientResult result)> UpdateTokenCallback
Callback invoked when Client::UpdateToken completes. Once this is done it is safe to call Client::Con...
Definition discordpp.h:3488
void SetMessageUpdatedCallback(discordpp::Client::MessageUpdatedCallback cb)
Sets a callback to be invoked whenever a message is edited.
void SetOutputDevice(std::string deviceId, discordpp::Client::SetOutputDeviceCallback cb)
Asynchronously changes the audio output device in use by the client to the specified device....
void SendUserMessageWithMetadata(uint64_t recipientId, std::string const &content, std::unordered_map< std::string, std::string > const &metadata, discordpp::Client::SendUserMessageCallback cb)
Variant of Client::SendUserMessage that also accepts metadata to be sent with the message.
std::function< void(uint64_t lobbyId)> LobbyCreatedCallback
Callback function for Client::SetLobbyCreatedCallback.
Definition discordpp.h:3571
void RemoveDiscordAndGameFriend(uint64_t userId, discordpp::Client::UpdateRelationshipCallback cb)
Removes any friendship between the current user and the target user. This function will remove BOTH a...
std::function< void(uint64_t lobbyId, uint64_t memberId)> LobbyMemberRemovedCallback
Callback function for Client::SetLobbyMemberRemovedCallback.
Definition discordpp.h:3580
void SetTokenExpirationCallback(discordpp::Client::TokenExpirationCallback callback)
Get a notification when the current token is about to expire or expired.
void GetUserGuilds(discordpp::Client::GetUserGuildsCallback cb)
Fetches all of the guilds (also known as Discord servers) that the current user is a member of.
void SetGameWindowPid(int32_t pid)
When users are linking their account with Discord, which involves an OAuth2 flow, the SDK can streaml...
void GetToken(uint64_t applicationId, std::string const &code, std::string const &codeVerifier, std::string const &redirectUri, discordpp::Client::TokenExchangeCallback callback)
Exchanges an authorization code that was returned from the Client::Authorize function for an access t...
std::function< void(discordpp::ClientResult result, std::string code, std::string redirectUri)> AuthorizationCallback
Callback invoked when the Authorize function completes.
Definition discordpp.h:3439
void SetActivityInviteUpdatedCallback(discordpp::Client::ActivityInviteCallback cb)
Sets a callback function that is invoked when an existing activity invite changes....
void SetNoAudioInputThreshold(float dBFSThreshold)
Threshold that can be set to indicate when no audio is being received by the user's mic.
std::function< void(std::string joinSecret)> ActivityJoinCallback
Callback function for Client::SetActivityJoinCallback.
Definition discordpp.h:3604
static std::string ErrorToString(discordpp::Client::Error type)
Converts the Error enum to a string.
std::optional< discordpp::UserHandle > GetUser(uint64_t userId) const
Returns the UserHandle associated with the given user ID.
void RemoveAuthorizeRequestCallback()
Stops listening for the AUTHORIZE_REQUEST event and removes the registered callback.
discordpp::RelationshipHandle GetRelationshipHandle(uint64_t userId) const
Returns the RelationshipHandle that corresponds to the relationship between the current user and the ...
std::function< void(discordpp::ClientResult result)> SendActivityInviteCallback
Callback function for Client::SendActivityInvite, Client::SendActivityJoinRequest,...
Definition discordpp.h:3597
discordpp::AuthorizationCodeVerifier CreateAuthorizationCodeVerifier()
Helper function that can create a code challenge and verifier for use in the Client::Authorize + Clie...
std::function< void(uint64_t lobbyId, uint64_t memberId, bool added)> VoiceParticipantChangedCallback
Callback function for Client::SetVoiceParticipantChangedCallback.
Definition discordpp.h:3414
discordpp::Call StartCallWithAudioCallbacks(uint64_t lobbyId, discordpp::Client::UserAudioReceivedCallback receivedCb, discordpp::Client::UserAudioCapturedCallback capturedCb)
Starts or joins a call in the specified lobby.
uint64_t GetApplicationId()
This function is used to get the application ID for the client. This is used to identify the applicat...
std::function< void(uint64_t userId, bool isDiscordRelationshipUpdate)> RelationshipDeletedCallback
Callback function for Client::SetRelationshipDeletedCallback.
Definition discordpp.h:3635
bool GetSelfDeafAll() const
Returns whether the current user is deafened in all calls.
bool SetSpeakerMode(bool speakerMode)
(deprecated) On mobile devices, enable speakerphone mode.
static int32_t GetVersionMinor()
Returns the minor version of the Discord Social SDK.
void AddVoiceLogCallback(discordpp::Client::LogCallback callback, discordpp::LoggingSeverity minSeverity)
Adds a callback function to be invoked for each new log message generated by the voice subsystem of t...
void AbortAuthorize()
This will abort the authorize flow if it is in progress and tear down any associated state.
Error
Represents an error state for the socket connection that the Discord SDK maintains with the Discord b...
Definition discordpp.h:3313
@ None
None.
Definition discordpp.h:3316
@ ConnectionCanceled
ConnectionCanceled.
Definition discordpp.h:3325
@ ConnectionFailed
ConnectionFailed.
Definition discordpp.h:3319
@ UnexpectedClose
UnexpectedClose.
Definition discordpp.h:3322
void UnblockUser(uint64_t userId, discordpp::Client::UpdateRelationshipCallback cb)
Unblocks the target user. Does not restore any old relationship between the users though.
void SetShowingChat(bool showingChat)
Sets whether chat messages are currently being shown in the game.
static int32_t GetVersionMajor()
Returns the major version of the Discord Social SDK.
std::function< void(discordpp::ClientResult result, uint64_t messageId)> SendUserMessageCallback
This is used for all kinds of 'send message' calls despite the name, to make sure engine bindings use...
Definition discordpp.h:3520
std::function< void(discordpp::AudioDevice device)> GetCurrentInputDeviceCallback
Callback function for Client::GetCurrentInputDevice.
Definition discordpp.h:3386
void SetLobbyCreatedCallback(discordpp::Client::LobbyCreatedCallback cb)
Sets a callback to be invoked when a lobby "becomes available" to the client.
void Authorize(discordpp::AuthorizationArgs args, discordpp::Client::AuthorizationCallback callback)
Initiates an OAuth2 flow for a user to "sign in with Discord". This flow is intended for desktop and ...
std::function< void(uint64_t userId)> UserUpdatedCallback
Callback function for Client::SetUserUpdatedCallback.
Definition discordpp.h:3647
void AcceptActivityInvite(discordpp::ActivityInvite invite, discordpp::Client::AcceptActivityInviteCallback cb)
Accepts an activity invite that the current user has received.
void SetInputDevice(std::string deviceId, discordpp::Client::SetInputDeviceCallback cb)
Asynchronously changes the audio input device in use by the client to the specified device....
void RejectGameFriendRequest(uint64_t userId, discordpp::Client::UpdateRelationshipCallback cb)
Declines an incoming game friend request from the target user.
void SetInputVolume(float inputVolume)
Sets the microphone volume for the current user.
void SetApplicationId(uint64_t applicationId)
This function is used to set the application ID for the client. This is used to identify the applicat...
std::vector< discordpp::RelationshipHandle > GetRelationships() const
Returns a list of all of the relationships the current user has with others, including all Discord re...
std::function< void(uint64_t messageId, uint64_t channelId)> MessageDeletedCallback
Callback function for Client::SetMessageDeletedCallback.
Definition discordpp.h:3527
void SetLobbyUpdatedCallback(discordpp::Client::LobbyUpdatedCallback cb)
Sets a callback to be invoked when a lobby is edited, for example if the lobby's metadata is changed.
std::function< void(discordpp::ClientResult result)> OpenConnectedGamesSettingsInDiscordCallback
Callback function for when Client::OpenConnectedGamesSettingsInDiscord completes.
Definition discordpp.h:3537
Thread
Represents the type of thread to control thread priority on.
Definition discordpp.h:3367
@ Client
Client.
Definition discordpp.h:3370
@ Voice
Voice.
Definition discordpp.h:3373
@ Network
Network.
Definition discordpp.h:3376
void SendActivityJoinRequestReply(discordpp::ActivityInvite invite, discordpp::Client::SendActivityInviteCallback cb)
When another user requests to join the current user's party, this function is called to to allow that...
void GetGuildChannels(uint64_t guildId, discordpp::Client::GetGuildChannelsCallback cb)
Fetches all of the channels that the current user can access in the given guild. Channels are sorted ...
static std::string ThreadToString(discordpp::Client::Thread type)
Converts the Thread enum to a string.
void BlockUser(uint64_t userId, discordpp::Client::UpdateRelationshipCallback cb)
Blocks the target user so that they cannot send the user friend or activity invites and cannot messag...
std::function< void(uint64_t messageId)> MessageUpdatedCallback
Callback function for Client::SetMessageUpdatedCallback.
Definition discordpp.h:3530
void SetEngineManagedAudioSession(bool isEngineManaged)
On mobile devices, set whether the audio environment is managed by the engine or the SDK....
void SetLobbyMemberUpdatedCallback(discordpp::Client::LobbyMemberUpdatedCallback cb)
Sets a callback function to be invoked whenever a member of a lobby is changed.
void SetActivityJoinWithApplicationCallback(discordpp::Client::ActivityJoinWithApplicationCallback cb)
Sets a callback function that is invoked when the current user also has Discord running on their comp...
bool GetSelfMuteAll() const
Returns whether the current user's microphone is muted in all calls.
std::function< void(uint64_t userId, bool isDiscordRelationshipUpdate)> RelationshipCreatedCallback
Callback function for Client::SetRelationshipCreatedCallback.
Definition discordpp.h:3628
std::function< void(discordpp::ClientResult result)> DeleteUserMessageCallback
Callback function for Client::DeleteUserMessage.
Definition discordpp.h:3491
std::function< void(discordpp::ClientResult result, std::string accessToken, discordpp::AuthorizationTokenType tokenType, int32_t expiresIn, std::string scopes)> ExchangeChildTokenCallback
Callback function for Client::ExchangeChildToken.
Definition discordpp.h:3443
bool CanOpenMessageInDiscord(uint64_t messageId)
Returns true if the given message is able to be viewed in a Discord client.
void SetNoiseSuppression(bool on)
Enables basic background noise suppression.
std::optional< discordpp::UserHandle > GetCurrentUserV2() const
Unlike GetCurrentUser(), this method returns std::nullopt instead of a dummy object when no user is a...
void SetLobbyMemberAddedCallback(discordpp::Client::LobbyMemberAddedCallback cb)
Sets a callback function to be invoked whenever a user is added to a lobby.
void GetCurrentOutputDevice(discordpp::Client::GetCurrentOutputDeviceCallback cb)
Asynchronously fetches the current audio output device in use by the client.
void SetHttpRequestTimeout(int32_t httpTimeoutInMilliseconds)
This function is used to override the default HTTP timeout for the websocket client.
void EndCall(uint64_t channelId, discordpp::Client::EndCallCallback callback)
Ends any active call, if any. Any references you have to Call objects are invalid after they are ende...
void AcceptGameFriendRequest(uint64_t userId, discordpp::Client::UpdateRelationshipCallback cb)
Accepts an incoming game friend request from the target user.
std::function< void(discordpp::ClientResult result, uint64_t id, std::string name)> FetchCurrentUserCallback
Callback function for Client::FetchCurrentUser.
Definition discordpp.h:3451
std::function< void(discordpp::ClientResult result, std::vector< discordpp::GuildChannel > guildChannels)> GetGuildChannelsCallback
Callback function for Client::GetGuildChannels.
Definition discordpp.h:3552
std::function< void(discordpp::ClientResult result)> UpdateStatusCallback
Callback function for when Client::SetOnlineStatus completes.
Definition discordpp.h:3611
std::optional< discordpp::LobbyHandle > GetLobbyHandle(uint64_t lobbyId) const
Returns a reference to the Discord lobby object for the given ID.
std::function< void(discordpp::ClientResult result, uint64_t lobbyId)> CreateOrJoinLobbyCallback
Callback function for Client::CreateOrJoinLobby.
Definition discordpp.h:3548
std::function< void(discordpp::ClientResult result, std::vector< discordpp::UserMessageSummary > summaries)> UserMessageSummariesCallback
Callback function for Client::GetUserMessageSummaries.
Definition discordpp.h:3502
discordpp::Call StartCall(uint64_t channelId)
Starts or joins a call in the lobby specified by channelId (For a lobby, simply pass in the lobbyId).
void UpdateRichPresence(discordpp::Activity activity, discordpp::Client::UpdateRichPresenceCallback cb)
Updates the rich presence for the current user.
void SetRelationshipGroupsUpdatedCallback(discordpp::Client::RelationshipGroupsUpdatedCallback cb)
The RelationshipGroupsUpdatedCallback is invoked whenever any user in the friends list changes....
Client(discordpp::ClientCreateOptions options)
Creates a new instance of the Client with custom options.
void OpenAuthorizeDeviceScreen(uint64_t clientId, std::string const &userCode)
This function is used to show the device authorization screen and is used for the case where the user...
std::function< void(int16_t *data, uint64_t samplesPerChannel, int32_t sampleRate, uint64_t channels)> UserAudioCapturedCallback
Callback function for Client::StartCallWithAudioCallbacks.
Definition discordpp.h:3430
std::function< void(std::vector< discordpp::AudioDevice > inputDevices, std::vector< discordpp::AudioDevice > outputDevices)> DeviceChangeCallback
Callback function for Client::SetDeviceChangeCallback.
Definition discordpp.h:3400
void AddLogCallback(discordpp::Client::LogCallback callback, discordpp::LoggingSeverity minSeverity)
Adds a callback function to be invoked for each new log message generated by the SDK.
void ProvisionalUserMergeCompleted(bool success)
Some functions don't work for provisional accounts, and require the user merge their account into a f...
void AcceptDiscordFriendRequest(uint64_t userId, discordpp::Client::UpdateRelationshipCallback cb)
Accepts an incoming Discord friend request from the target user.
void SendDiscordFriendRequestById(uint64_t userId, discordpp::Client::UpdateRelationshipCallback cb)
Sends a Discord friend request to the target user.
void SendGameFriendRequest(std::string const &username, discordpp::Client::SendFriendRequestCallback cb)
Sends (or accepts) a game friend request to the target user.
void SendActivityInvite(uint64_t userId, std::string const &content, discordpp::Client::SendActivityInviteCallback cb)
Sends a Discord activity invite to the specified user.
std::function< void(std::vector< discordpp::AudioDevice > devices)> GetInputDevicesCallback
Callback function for Client::GetInputDevices.
Definition discordpp.h:3392
void GetTokenFromDeviceProvisionalMerge(discordpp::DeviceAuthorizationArgs args, discordpp::AuthenticationExternalAuthType externalAuthType, std::string const &externalAuthToken, discordpp::Client::TokenExchangeCallback callback)
This function is a combination of Client::Authorize and Client::GetTokenFromProvisionalMerge,...
bool IsAuthenticated()
Returns true if the SDK has a non-empty OAuth2 token set, regardless of whether that token is valid o...
static const Client nullobj
Uninitialized instance of Client.
Definition discordpp.h:3660
discordpp::Client::Status GetStatus() const
Returns the current status of the client, see the Status enum for an explanation of the possible valu...
Arguments to the Client::GetTokenFromDevice function.
Definition discordpp.h:1735
DeviceAuthorizationArgs(DeviceAuthorizationArgs &&other) noexcept
Move constructor for DeviceAuthorizationArgs.
DeviceAuthorizationArgs(const DeviceAuthorizationArgs &arg0)
Copy constructor for DeviceAuthorizationArgs.
uint64_t ClientId() const
Optional. The Discord application ID for your game. Defaults to the value set by Client::SetApplicati...
static const DeviceAuthorizationArgs nullobj
Uninitialized instance of DeviceAuthorizationArgs.
Definition discordpp.h:1755
void SetClientId(uint64_t ClientId)
Setter for DeviceAuthorizationArgs::ClientId.
void SetScopes(std::string Scopes)
Setter for DeviceAuthorizationArgs::Scopes.
DeviceAuthorizationArgs & operator=(const DeviceAuthorizationArgs &arg0)
Copy assignment operator for DeviceAuthorizationArgs.
std::string Scopes() const
Scopes is a space separated string of the oauth scopes your game is requesting.
DeviceAuthorizationArgs & operator=(DeviceAuthorizationArgs &&other) noexcept
Move assignment operator for DeviceAuthorizationArgs.
void SetIsLinkable(bool IsLinkable)
Setter for GuildChannel::IsLinkable.
bool IsViewableAndWriteableByAllMembers() const
Whether the channel is "fully public" which means every member of the guild is able to view and send ...
std::optional< discordpp::LinkedLobby > LinkedLobby() const
Information about the currently linked lobby, if any. Currently Discord enforces that a channel can o...
uint64_t Id() const
The id of the channel.
void SetName(std::string Name)
Setter for GuildChannel::Name.
GuildChannel(const GuildChannel &arg0)
Copy constructor for GuildChannel.
void SetId(uint64_t Id)
Setter for GuildChannel::Id.
std::optional< uint64_t > ParentId() const
The id of the parent category channel, if any.
std::string Name() const
The name of the channel.
void SetType(discordpp::ChannelType Type)
Setter for GuildChannel::Type.
void SetPosition(int32_t Position)
Setter for GuildChannel::Position.
discordpp::ChannelType Type() const
The type of the channel.
GuildChannel & operator=(const GuildChannel &arg0)
Copy assignment operator for GuildChannel.
GuildChannel & operator=(GuildChannel &&other) noexcept
Move assignment operator for GuildChannel.
GuildChannel(GuildChannel &&other) noexcept
Move constructor for GuildChannel.
bool IsLinkable() const
Whether the current user is able to link this channel to a lobby.
int32_t Position() const
The position of the channel in the guild's channel list.
void SetLinkedLobby(std::optional< discordpp::LinkedLobby > LinkedLobby)
Setter for GuildChannel::LinkedLobby.
void SetIsViewableAndWriteableByAllMembers(bool IsViewableAndWriteableByAllMembers)
Setter for GuildChannel::IsViewableAndWriteableByAllMembers.
static const GuildChannel nullobj
Uninitialized instance of GuildChannel.
Definition discordpp.h:2231
void SetParentId(std::optional< uint64_t > ParentId)
Setter for GuildChannel::ParentId.
void SetName(std::string Name)
Setter for GuildMinimal::Name.
std::string Name() const
The name of the guild.
void SetId(uint64_t Id)
Setter for GuildMinimal::Id.
static const GuildMinimal nullobj
Uninitialized instance of GuildMinimal.
Definition discordpp.h:2186
GuildMinimal & operator=(GuildMinimal &&other) noexcept
Move assignment operator for GuildMinimal.
GuildMinimal & operator=(const GuildMinimal &arg0)
Copy assignment operator for GuildMinimal.
GuildMinimal(const GuildMinimal &arg0)
Copy constructor for GuildMinimal.
GuildMinimal(GuildMinimal &&other) noexcept
Move constructor for GuildMinimal.
uint64_t Id() const
The id of the guild.
Struct that stores information about the channel that a lobby is linked to.
Definition discordpp.h:2354
uint64_t GuildId() const
The id of the guild (aka server) that owns the linked channel.
void SetName(std::string Name)
Setter for LinkedChannel::Name.
LinkedChannel & operator=(LinkedChannel &&other) noexcept
Move assignment operator for LinkedChannel.
LinkedChannel & operator=(const LinkedChannel &arg0)
Copy assignment operator for LinkedChannel.
std::string Name() const
The name of the linked channel.
void SetGuildId(uint64_t GuildId)
Setter for LinkedChannel::GuildId.
static const LinkedChannel nullobj
Uninitialized instance of LinkedChannel.
Definition discordpp.h:2373
LinkedChannel(const LinkedChannel &arg0)
Copy constructor for LinkedChannel.
void SetId(uint64_t Id)
Setter for LinkedChannel::Id.
uint64_t Id() const
The id of the linked channel.
LinkedChannel(LinkedChannel &&other) noexcept
Move constructor for LinkedChannel.
Struct that stores information about the lobby linked to a channel.
Definition discordpp.h:2308
LinkedLobby & operator=(const LinkedLobby &arg0)
Copy assignment operator for LinkedLobby.
LinkedLobby(const LinkedLobby &arg0)
Copy constructor for LinkedLobby.
uint64_t ApplicationId() const
The ID of the application that owns the lobby.
void SetLobbyId(uint64_t LobbyId)
Setter for LinkedLobby::LobbyId.
static const LinkedLobby nullobj
Uninitialized instance of LinkedLobby.
Definition discordpp.h:2327
void SetApplicationId(uint64_t ApplicationId)
Setter for LinkedLobby::ApplicationId.
LinkedLobby & operator=(LinkedLobby &&other) noexcept
Move assignment operator for LinkedLobby.
uint64_t LobbyId() const
The ID of the lobby.
LinkedLobby(LinkedLobby &&other) noexcept
Move constructor for LinkedLobby.
A LobbyHandle represents a single lobby in the SDK. A lobby can be thought of as just an arbitrary,...
Definition discordpp.h:2828
LobbyHandle(LobbyHandle &&other) noexcept
Move constructor for LobbyHandle.
std::optional< discordpp::LinkedChannel > LinkedChannel() const
Returns information about the channel linked to this lobby, if any.
static const LobbyHandle nullobj
Uninitialized instance of LobbyHandle.
Definition discordpp.h:2847
LobbyHandle & operator=(const LobbyHandle &other)
Copy assignment operator for LobbyHandle.
std::optional< discordpp::CallInfoHandle > GetCallInfoHandle() const
Returns a reference to the CallInfoHandle if there is an active voice call in this lobby.
std::unordered_map< std::string, std::string > Metadata() const
Returns any developer supplied metadata for this lobby.
std::optional< discordpp::LobbyMemberHandle > GetLobbyMemberHandle(uint64_t memberId) const
Returns a reference to the LobbyMemberHandle for the given user ID, if they are a member of this lobb...
LobbyHandle(const LobbyHandle &other)
Copy constructor for LobbyHandle.
std::vector< discordpp::LobbyMemberHandle > LobbyMembers() const
Returns a list of the LobbyMemberHandle objects for each member of this lobby.
uint64_t Id() const
Returns the id of the lobby.
std::vector< uint64_t > LobbyMemberIds() const
Returns a list of the user IDs that are members of this lobby.
LobbyHandle & operator=(LobbyHandle &&other) noexcept
Move assignment operator for LobbyHandle.
A LobbyMemberHandle represents the state of a single user in a Lobby.
Definition discordpp.h:2685
LobbyMemberHandle & operator=(const LobbyMemberHandle &other)
Copy assignment operator for LobbyMemberHandle.
static const LobbyMemberHandle nullobj
Uninitialized instance of LobbyMemberHandle.
Definition discordpp.h:2704
uint64_t Id() const
The user id of the lobby member.
LobbyMemberHandle(const LobbyMemberHandle &other)
Copy constructor for LobbyMemberHandle.
bool Connected() const
Returns true if the user is currently connected to the lobby.
LobbyMemberHandle & operator=(LobbyMemberHandle &&other) noexcept
Move assignment operator for LobbyMemberHandle.
std::optional< discordpp::UserHandle > User() const
The UserHandle of the lobby member.
bool CanLinkLobby() const
Returns true if the user is allowed to link a channel to this lobby.
LobbyMemberHandle(LobbyMemberHandle &&other) noexcept
Move constructor for LobbyMemberHandle.
std::unordered_map< std::string, std::string > Metadata() const
Metadata is a set of string key/value pairs that the game developer can use.
A MessageHandle represents a single message received by the SDK.
Definition discordpp.h:3004
uint64_t AuthorId() const
Returns the user ID of the user who sent this message.
std::optional< discordpp::ChannelHandle > Channel() const
Returns the ChannelHandle for the channel this message was sent in.
static const MessageHandle nullobj
Uninitialized instance of MessageHandle.
Definition discordpp.h:3023
std::optional< discordpp::UserHandle > Recipient() const
Returns the UserHandle for the other participant in a DM, if this message was sent in a DM.
std::optional< uint64_t > ApplicationId() const
Returns the application ID associated with this message, if any. You can use this to identify if the ...
MessageHandle & operator=(const MessageHandle &other)
Copy assignment operator for MessageHandle.
uint64_t Id() const
Returns the ID of this message.
std::optional< discordpp::UserHandle > Author() const
Returns the UserHandle for the author of this message.
MessageHandle & operator=(MessageHandle &&other) noexcept
Move assignment operator for MessageHandle.
uint64_t EditedTimestamp() const
The timestamp in millis since the epoch when the message was most recently edited.
MessageHandle(const MessageHandle &other)
Copy constructor for MessageHandle.
std::string Content() const
Returns the content of this message, if any.
std::unordered_map< std::string, std::string > Metadata() const
Returns any metadata the developer included with this message.
std::string RawContent() const
Returns the content of this message, if any, but without replacing any markup from emojis and mention...
std::optional< discordpp::LobbyHandle > Lobby() const
Returns the LobbyHandle this message was sent in, if it was sent in a lobby.
uint64_t RecipientId() const
When this message was sent in a DM or Ephemeral DM, this method will return the ID of the other user ...
uint64_t SentTimestamp() const
The timestamp in millis since the epoch when the message was sent.
std::optional< discordpp::DisclosureTypes > DisclosureType() const
If this is an auto-generated message that is explaining some integration behavior to users,...
uint64_t ChannelId() const
Returns the channel ID this message was sent in.
MessageHandle(MessageHandle &&other) noexcept
Move constructor for MessageHandle.
bool SentFromGame() const
Returns true if this message was sent in-game, otherwise false (i.e. from Discord itself)....
std::optional< discordpp::AdditionalContent > AdditionalContent() const
If the message contains non-text content, such as images, videos, embeds, polls, etc,...
std::unordered_map< std::string, std::string > ModerationMetadata() const
Returns any moderation metadata the developer set on this message.
A RelationshipHandle represents the relationship between the current user and a target user on Discor...
Definition discordpp.h:2436
RelationshipHandle & operator=(const RelationshipHandle &other)
Copy assignment operator for RelationshipHandle.
RelationshipHandle(const RelationshipHandle &other)
Copy constructor for RelationshipHandle.
uint64_t Id() const
Returns the ID of the target user in this relationship.
discordpp::RelationshipType DiscordRelationshipType() const
Returns the type of the Discord relationship.
RelationshipHandle(RelationshipHandle &&other) noexcept
Move constructor for RelationshipHandle.
discordpp::RelationshipType GameRelationshipType() const
Returns the type of the Game relationship.
static const RelationshipHandle nullobj
Uninitialized instance of RelationshipHandle.
Definition discordpp.h:2455
bool IsSpamRequest() const
Returns whether this relationship is a spam request.
std::optional< discordpp::UserHandle > User() const
Returns a handle to the target user in this relationship, if one is available. This would be the user...
RelationshipHandle & operator=(RelationshipHandle &&other) noexcept
Move assignment operator for RelationshipHandle.
static const UserApplicationProfileHandle nullobj
Uninitialized instance of UserApplicationProfileHandle.
Definition discordpp.h:2513
std::string Username() const
Returns the user's in-game username.
std::string Metadata() const
Returns any metadata set by the developer.
UserApplicationProfileHandle(UserApplicationProfileHandle &&other) noexcept
Move constructor for UserApplicationProfileHandle.
UserApplicationProfileHandle & operator=(const UserApplicationProfileHandle &other)
Copy assignment operator for UserApplicationProfileHandle.
std::string ProviderIssuedUserId() const
Returns the user's external identity provider issued user ID.
UserApplicationProfileHandle & operator=(UserApplicationProfileHandle &&other) noexcept
Move assignment operator for UserApplicationProfileHandle.
UserApplicationProfileHandle(const UserApplicationProfileHandle &other)
Copy constructor for UserApplicationProfileHandle.
std::string AvatarHash() const
Returns the user's in-game avatar hash.
std::optional< std::string > ProviderId() const
Returns the user's external identity provider ID if it exists.
discordpp::ExternalIdentityProviderType ProviderType() const
Returns the type of the external identity provider.
A UserHandle represents a single user on Discord that the SDK knows about and contains basic account ...
Definition discordpp.h:2555
uint64_t Id() const
Returns the ID of this user.
UserHandle & operator=(UserHandle &&other) noexcept
Move assignment operator for UserHandle.
std::string Username() const
Returns the globally unique username of this user.
static const UserHandle nullobj
Uninitialized instance of UserHandle.
Definition discordpp.h:2589
std::optional< std::string > Avatar() const
Returns the hash of the user's Discord profile avatar, if one is set.
UserHandle(const UserHandle &arg0)
Copy constructor for UserHandle.
discordpp::StatusType Status() const
Returns the user's online/offline/idle status.
UserHandle(UserHandle &&other) noexcept
Move constructor for UserHandle.
std::vector< discordpp::UserApplicationProfileHandle > UserApplicationProfiles() const
Returns a list of UserApplicationProfileHandles for this user. Currently, a user can only have a sing...
std::string AvatarUrl(discordpp::UserHandle::AvatarType animatedType, discordpp::UserHandle::AvatarType staticType) const
Returns a CDN url to the user's Discord profile avatar.
AvatarType
The desired type of avatar url to generate for a User.
Definition discordpp.h:2563
@ Jpeg
Jpeg.
Definition discordpp.h:2575
@ Gif
Gif.
Definition discordpp.h:2566
@ Webp
Webp.
Definition discordpp.h:2569
@ Png
Png.
Definition discordpp.h:2572
bool IsProvisional() const
Returns true if this user is a provisional account.
std::optional< std::string > GlobalName() const
Returns the preferred display name of this user, if one is set.
std::optional< discordpp::Activity > GameActivity() const
Returns the user's rich presence activity that is associated with the current game,...
UserHandle & operator=(const UserHandle &arg0)
Copy assignment operator for UserHandle.
static std::string AvatarTypeToString(discordpp::UserHandle::AvatarType type)
Converts the AvatarType enum to a string.
std::string DisplayName() const
Returns the user's preferred name, if one is set, otherwise returns their unique username.
discordpp::RelationshipHandle Relationship() const
Returns a reference to the RelationshipHandle between the currently authenticated user and this user,...
UserMessageSummary & operator=(const UserMessageSummary &arg0)
Copy assignment operator for UserMessageSummary.
static const UserMessageSummary nullobj
Uninitialized instance of UserMessageSummary.
Definition discordpp.h:3196
UserMessageSummary(UserMessageSummary &&other) noexcept
Move constructor for UserMessageSummary.
uint64_t LastMessageId() const
Returns the ID of the last message sent in the DM conversation.
uint64_t UserId() const
Returns the ID of the other user in the DM conversation.
UserMessageSummary(const UserMessageSummary &arg0)
Copy constructor for UserMessageSummary.
UserMessageSummary & operator=(UserMessageSummary &&other) noexcept
Move assignment operator for UserMessageSummary.
Settings for the void auto detection threshold for picking up activity from a user's mic.
Definition discordpp.h:1845
VADThresholdSettings & operator=(VADThresholdSettings &&other) noexcept
Move assignment operator for VADThresholdSettings.
VADThresholdSettings(VADThresholdSettings &&other) noexcept
Move constructor for VADThresholdSettings.
static const VADThresholdSettings nullobj
Uninitialized instance of VADThresholdSettings.
Definition discordpp.h:1864
bool Automatic() const
Whether or not Discord is currently automatically setting and detecting the appropriate threshold to ...
float VadThreshold() const
The current void auto detection threshold value, has a range of -100, 0 and defaults to -60.
void SetAutomatic(bool Automatic)
Setter for VADThresholdSettings::Automatic.
void SetVadThreshold(float VadThreshold)
Setter for VADThresholdSettings::VadThreshold.
A VoiceStateHandle represents the state of a single participant in a Discord voice call.
Definition discordpp.h:1803
VoiceStateHandle & operator=(VoiceStateHandle &&other) noexcept
Move assignment operator for VoiceStateHandle.
bool SelfMute() const
Returns true if the given user has muted themselves so that no one else in the call can hear them.
static const VoiceStateHandle nullobj
Uninitialized instance of VoiceStateHandle.
Definition discordpp.h:1822
bool SelfDeaf() const
Returns true if the given user has deafened themselves so that no one else in the call can hear them ...
VoiceStateHandle(VoiceStateHandle &&other) noexcept
Move constructor for VoiceStateHandle.
VoiceStateHandle & operator=(const VoiceStateHandle &other)
Copy assignment operator for VoiceStateHandle.
VoiceStateHandle(const VoiceStateHandle &other)
Copy constructor for VoiceStateHandle.
The namespace for the generated Discord SDK bindings.
Definition discordpp.h:16
ActivityPartyPrivacy
Allows your game to control the privacy of the party the user is in.
Definition discordpp.h:54
@ Public
The party is public, which means that the user is in a party which could be joinable by either friend...
Definition discordpp.h:68
@ Private
The party is private (or unknown), which means that the user is in a party but it is not joinable wit...
Definition discordpp.h:62
DisclosureTypes
Enum that represents various informational disclosures that Discord may make to users,...
Definition discordpp.h:601
@ MessageDataVisibleOnDiscord
This disclosure type happens the first time a user sends a message in game, and that message will be ...
Definition discordpp.h:607
const char * EnumToString(discordpp::ActivityActionTypes value)
Converts a discordpp::ActivityActionTypes to a string.
Definition discordpp.h:5257
HttpStatusCode
Enum that represents the various HTTP status codes that can be returned.
Definition discordpp.h:207
@ RequestHeaderFieldsTooLarge
RequestHeaderFieldsTooLarge.
Definition discordpp.h:354
@ PayloadTooLarge
PayloadTooLarge.
Definition discordpp.h:315
@ MultiStatus
MultiStatus.
Definition discordpp.h:246
@ VariantAlsoNegotiates
VariantAlsoNegotiates.
Definition discordpp.h:375
@ Gone
Gone.
Definition discordpp.h:306
@ BadGateway
BadGateway.
Definition discordpp.h:363
@ Created
Created.
Definition discordpp.h:228
@ TemporaryRedirect
TemporaryRedirect.
Definition discordpp.h:270
@ ServiceUnavailable
ServiceUnavailable.
Definition discordpp.h:366
@ MovedPermanently
MovedPermanently.
Definition discordpp.h:258
@ PreconditionFailed
PreconditionFailed.
Definition discordpp.h:312
@ RequestTimeout
RequestTimeout.
Definition discordpp.h:300
@ Accepted
Accepted.
Definition discordpp.h:231
@ NonAuthoritativeInfo
NonAuthoritativeInfo.
Definition discordpp.h:234
@ NotFound
NotFound.
Definition discordpp.h:288
@ FailedDependency
FailedDependency.
Definition discordpp.h:339
@ PaymentRequired
PaymentRequired.
Definition discordpp.h:282
@ PreconditionRequired
PreconditionRequired.
Definition discordpp.h:348
@ ResetContent
ResetContent.
Definition discordpp.h:240
@ SwitchingProtocols
SwitchingProtocols.
Definition discordpp.h:216
@ HttpVersionNotSupported
HttpVersionNotSupported.
Definition discordpp.h:372
@ Found
Found.
Definition discordpp.h:261
@ Processing
Processing.
Definition discordpp.h:219
@ None
None.
Definition discordpp.h:210
@ ExpectationFailed
ExpectationFailed.
Definition discordpp.h:327
@ Forbidden
Forbidden.
Definition discordpp.h:285
@ PartialContent
PartialContent.
Definition discordpp.h:243
@ SeeOther
SeeOther.
Definition discordpp.h:264
@ EarlyHints
EarlyHints.
Definition discordpp.h:222
@ LengthRequired
LengthRequired.
Definition discordpp.h:309
@ MethodNotAllowed
MethodNotAllowed.
Definition discordpp.h:291
@ NotExtended
NotExtended.
Definition discordpp.h:384
@ RangeNotSatisfiable
RangeNotSatisfiable.
Definition discordpp.h:324
@ NotImplemented
NotImplemented.
Definition discordpp.h:360
@ BadRequest
BadRequest.
Definition discordpp.h:276
@ Continue
Continue.
Definition discordpp.h:213
@ LoopDetected
LoopDetected.
Definition discordpp.h:381
@ UnsupportedMediaType
UnsupportedMediaType.
Definition discordpp.h:321
@ NetworkAuthorizationRequired
NetworkAuthorizationRequired.
Definition discordpp.h:387
@ ImUsed
ImUsed.
Definition discordpp.h:252
@ MultipleChoices
MultipleChoices.
Definition discordpp.h:255
@ Ok
Ok.
Definition discordpp.h:225
@ TooManyRequests
TooManyRequests.
Definition discordpp.h:351
@ ProxyAuthRequired
ProxyAuthRequired.
Definition discordpp.h:297
@ UnprocessableEntity
UnprocessableEntity.
Definition discordpp.h:333
@ MisdirectedRequest
MisdirectedRequest.
Definition discordpp.h:330
@ PermanentRedirect
PermanentRedirect.
Definition discordpp.h:273
@ NotModified
NotModified.
Definition discordpp.h:267
@ AlreadyReported
AlreadyReported.
Definition discordpp.h:249
@ NoContent
NoContent.
Definition discordpp.h:237
@ Locked
Locked.
Definition discordpp.h:336
@ GatewayTimeout
GatewayTimeout.
Definition discordpp.h:369
@ Unauthorized
Unauthorized.
Definition discordpp.h:279
@ UpgradeRequired
UpgradeRequired.
Definition discordpp.h:345
@ InsufficientStorage
InsufficientStorage.
Definition discordpp.h:378
@ InternalServerError
InternalServerError.
Definition discordpp.h:357
@ TooEarly
TooEarly.
Definition discordpp.h:342
@ Conflict
Conflict.
Definition discordpp.h:303
@ UriTooLong
UriTooLong.
Definition discordpp.h:318
@ NotAcceptable
NotAcceptable.
Definition discordpp.h:294
AuthorizationTokenType
Represents the type of auth token used by the SDK, either the normal tokens produced by the Discord d...
Definition discordpp.h:612
@ Bearer
Bearer.
Definition discordpp.h:618
@ User
User.
Definition discordpp.h:615
ChannelType
Enum that represents the various channel types on Discord.
Definition discordpp.h:412
@ GuildForum
GuildForum.
Definition discordpp.h:451
@ Dm
Dm.
Definition discordpp.h:418
@ Lobby
Lobby.
Definition discordpp.h:457
@ GuildNews
GuildNews.
Definition discordpp.h:430
@ GuildVoice
GuildVoice.
Definition discordpp.h:421
@ GuildPublicThread
GuildPublicThread.
Definition discordpp.h:439
@ GuildNewsThread
GuildNewsThread.
Definition discordpp.h:436
@ GuildDirectory
GuildDirectory.
Definition discordpp.h:448
@ GuildCategory
GuildCategory.
Definition discordpp.h:427
@ GuildStageVoice
GuildStageVoice.
Definition discordpp.h:445
@ GuildMedia
GuildMedia.
Definition discordpp.h:454
@ GuildStore
GuildStore.
Definition discordpp.h:433
@ GuildText
GuildText.
Definition discordpp.h:415
@ GroupDm
GroupDm.
Definition discordpp.h:424
@ EphemeralDm
EphemeralDm.
Definition discordpp.h:460
@ GuildPrivateThread
GuildPrivateThread.
Definition discordpp.h:442
AuthenticationCodeChallengeMethod
Represents the crypto method used to generate a code challenge.
Definition discordpp.h:393
@ S256
S256.
Definition discordpp.h:396
RelationshipType
Enum that represents the possible types of relationships that can exist between two users.
Definition discordpp.h:512
@ PendingIncoming
The current user has received a friend request from the target user, but it is not yet accepted.
Definition discordpp.h:527
@ Implicit
The Implicit type is documented for visibility, but should be unused in the SDK.
Definition discordpp.h:534
@ Suggestion
The Suggestion type is documented for visibility, but should be unused in the SDK.
Definition discordpp.h:537
@ PendingOutgoing
The current user has sent a friend request to the target user, but it is not yet accepted.
Definition discordpp.h:531
@ Blocked
The current user has blocked the target user, and so certain actions such as sending messages between...
Definition discordpp.h:522
@ None
The user has no relationship with the other user.
Definition discordpp.h:515
@ Friend
The user is friends with the other user.
Definition discordpp.h:518
AuthenticationExternalAuthType
Represents the various identity providers that can be used to authenticate a provisional account user...
Definition discordpp.h:623
@ EpicOnlineServicesIdToken
EpicOnlineServicesIdToken.
Definition discordpp.h:632
@ DiscordBotIssuedAccessToken
DiscordBotIssuedAccessToken.
Definition discordpp.h:641
@ EpicOnlineServicesAccessToken
EpicOnlineServicesAccessToken.
Definition discordpp.h:629
@ SteamSessionTicket
SteamSessionTicket.
Definition discordpp.h:635
@ OIDC
OIDC.
Definition discordpp.h:626
@ UnityServicesIdToken
UnityServicesIdToken.
Definition discordpp.h:638
@ PlayStationNetworkIdToken
PlayStationNetworkIdToken.
Definition discordpp.h:647
@ AppleIdToken
AppleIdToken.
Definition discordpp.h:644
LoggingSeverity
Enum that represents the various log levels supported by the SDK.
Definition discordpp.h:651
@ Warning
Warning.
Definition discordpp.h:660
@ Info
Info.
Definition discordpp.h:657
@ None
None.
Definition discordpp.h:666
@ Error
Error.
Definition discordpp.h:663
@ Verbose
Verbose.
Definition discordpp.h:654
RelationshipGroupType
Enum that represents the logical groups of relationships based on online status and game activity.
Definition discordpp.h:671
@ OnlinePlayingGame
Users who are online and currently playing the game.
Definition discordpp.h:674
@ Offline
Users who are offline.
Definition discordpp.h:680
@ OnlineElsewhere
Users who are online but not playing the game.
Definition discordpp.h:677
IntegrationType
Represents the type of integration the app will be installed as.
Definition discordpp.h:400
@ GuildInstall
GuildInstall.
Definition discordpp.h:403
@ UserInstall
UserInstall.
Definition discordpp.h:406
AudioSystem
The Discord Voice audio system to use.
Definition discordpp.h:489
@ Game
Use the game audio system.
Definition discordpp.h:495
@ Standard
Use the standard audio system.
Definition discordpp.h:492
ActivityGamePlatforms
Represents the type of platforms that an activity invite can be accepted on.
Definition discordpp.h:117
@ Embedded
Embedded.
Definition discordpp.h:135
@ Xbox
Xbox.
Definition discordpp.h:123
@ Desktop
Desktop.
Definition discordpp.h:120
@ Samsung
Samsung.
Definition discordpp.h:126
@ PS5
PS5.
Definition discordpp.h:141
@ PS4
PS4.
Definition discordpp.h:138
@ IOS
IOS.
Definition discordpp.h:129
@ Android
Android.
Definition discordpp.h:132
ActivityTypes
Discord RichPresence supports multiple types of activities that a user can be doing.
Definition discordpp.h:77
@ Watching
Watching.
Definition discordpp.h:89
@ Competing
Competing.
Definition discordpp.h:95
@ HangStatus
HangStatus.
Definition discordpp.h:98
@ Listening
Listening.
Definition discordpp.h:86
@ Streaming
Streaming.
Definition discordpp.h:83
@ CustomStatus
CustomStatus.
Definition discordpp.h:92
@ Playing
Playing.
Definition discordpp.h:80
StatusType
Enum that specifies the various online statuses for a user.
Definition discordpp.h:569
@ Blocked
Blocked.
Definition discordpp.h:578
@ Online
The user is online and recently active.
Definition discordpp.h:572
@ Dnd
The user is online, but wishes to suppress notifications for the time being.
Definition discordpp.h:585
@ Unknown
Unknown.
Definition discordpp.h:594
@ Invisible
The user is online, but wishes to appear as if they are offline to other users.
Definition discordpp.h:588
@ Offline
The user is offline and not connected to Discord.
Definition discordpp.h:575
@ Streaming
The user is online and is actively streaming content.
Definition discordpp.h:591
@ Idle
The user is online, but has not been active for a while and may be away from their computer.
Definition discordpp.h:582
StatusDisplayTypes
Controls which Discord RichPresence field is displayed in the user's status.
Definition discordpp.h:104
@ Details
Details.
Definition discordpp.h:113
@ State
State.
Definition discordpp.h:110
@ Name
Name.
Definition discordpp.h:107
ExternalIdentityProviderType
The type of external identity provider.
Definition discordpp.h:541
@ EpicOnlineServices
EpicOnlineServices.
Definition discordpp.h:547
@ OIDC
OIDC.
Definition discordpp.h:544
@ Steam
Steam.
Definition discordpp.h:550
@ None
None.
Definition discordpp.h:559
@ Unity
Unity.
Definition discordpp.h:553
@ Unknown
Unknown.
Definition discordpp.h:562
@ DiscordBot
DiscordBot.
Definition discordpp.h:556
void RunCallbacks()
Definition discordpp.h:29
AudioModeType
Represents whether a voice call is using push to talk or auto voice detection.
Definition discordpp.h:499
@ MODE_PTT
MODE_PTT.
Definition discordpp.h:508
@ MODE_VAD
MODE_VAD.
Definition discordpp.h:505
@ MODE_UNINIT
MODE_UNINIT.
Definition discordpp.h:502
ErrorType
Enum representing various types of errors the SDK returns.
Definition discordpp.h:145
@ HTTPError
An HTTP call was made to Discord's servers but a non success HTTP status code was returned....
Definition discordpp.h:160
@ NetworkError
The user is offline or there was some network issue that prevented an underlying HTTP call from succe...
Definition discordpp.h:152
@ AuthorizationFailed
An authorization function failed, but not necessarily as the result of an HTTP call that returned an ...
Definition discordpp.h:194
@ ClientNotReady
An operation such as sending a friend request or joining a lobby was attempted but the Client is not ...
Definition discordpp.h:170
@ None
No error, the operation was successful.
Definition discordpp.h:148
@ Aborted
The user or developer aborted an operation, such as an authorization flow.
Definition discordpp.h:189
@ RPCError
An RPC call was made to Discord's desktop application, but it returned a non-success result....
Definition discordpp.h:199
@ ValidationError
Used when an SDK method is called but the inputs don't pass local validation. For example if one atte...
Definition discordpp.h:186
@ ClientDestroyed
The Client has been destroyed and so this operation cannot complete.
Definition discordpp.h:176
@ Disabled
An operation was temporarily disabled for stability reasons.
Definition discordpp.h:173
DiscordObjectState
Represents the memory state of a Discord object.
Definition discordpp.h:19
@ Invalid
The object has been freed.
Definition discordpp.h:21
@ Owned
The object is owned by the C++ wrapper and methods can be called on it.
Definition discordpp.h:23
AdditionalContentType
Represents the type of additional content contained in a message.
Definition discordpp.h:464
@ Sticker
Sticker.
Definition discordpp.h:485
@ VoiceMessage
VoiceMessage.
Definition discordpp.h:476
@ Other
Other.
Definition discordpp.h:467
@ Poll
Poll.
Definition discordpp.h:473
@ Thread
Thread.
Definition discordpp.h:479
@ Attachment
Attachment.
Definition discordpp.h:470
@ Embed
Embed.
Definition discordpp.h:482
ActivityActionTypes
ActivityActionTypes represents the type of invite being sent to a user.
Definition discordpp.h:41
@ Invalid
Invalid.
Definition discordpp.h:44
@ Join
Join.
Definition discordpp.h:47
@ JoinRequest
JoinRequest.
Definition discordpp.h:50