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;
2832 mutable Discord_LobbyHandle instance_{};
2838 Discord_LobbyHandle* instance()
const {
return &instance_; }
2889 std::unordered_map<std::string, std::string>
Metadata()
const;
2896 mutable Discord_AdditionalContent instance_{};
2902 Discord_AdditionalContent* instance()
const {
return &instance_; }
2941 std::optional<std::string>
Title()
const;
3008 mutable Discord_MessageHandle instance_{};
3014 Discord_MessageHandle* instance()
const {
return &instance_; }
3051 std::optional<discordpp::UserHandle>
Author()
const;
3057 std::optional<discordpp::ChannelHandle>
Channel()
const;
3082 std::optional<discordpp::LobbyHandle>
Lobby()
const;
3089 std::unordered_map<std::string, std::string>
Metadata()
const;
3129 mutable Discord_AudioDevice instance_{};
3135 Discord_AudioDevice* instance()
const {
return &instance_; }
3181 mutable Discord_UserMessageSummary instance_{};
3187 Discord_UserMessageSummary* instance()
const {
return &instance_; }
3223 mutable Discord_ClientCreateOptions instance_{};
3229 Discord_ClientCreateOptions* instance()
const {
return &instance_; }
3303 mutable Discord_Client instance_{};
3395 std::function<void(std::vector<discordpp::AudioDevice> devices)>;
3399 std::function<void(std::vector<discordpp::AudioDevice> devices)>;
3403 std::function<void(std::vector<discordpp::AudioDevice> inputDevices,
3404 std::vector<discordpp::AudioDevice> outputDevices)>;
3417 std::function<void(uint64_t lobbyId, uint64_t memberId,
bool added)>;
3424 uint64_t samplesPerChannel,
3427 bool& outShouldMute)>;
3433 void(int16_t* data, uint64_t samplesPerChannel, int32_t sampleRate, uint64_t channels)>;
3447 std::string accessToken,
3450 std::string scopes)>;
3458 std::string accessToken,
3459 std::string refreshToken,
3462 std::string scopes)>;
3501 std::vector<discordpp::MessageHandle> messages)>;
3506 std::vector<discordpp::UserMessageSummary> summaries)>;
3511 std::vector<discordpp::MessageHandle> messages)>;
3556 std::vector<discordpp::GuildChannel> guildChannels)>;
3560 std::vector<discordpp::GuildMinimal> guilds)>;
3610 std::function<void(uint64_t applicationId, std::string joinSecret)>;
3631 std::function<void(uint64_t userId,
bool isDiscordRelationshipUpdate)>;
3638 std::function<void(uint64_t userId,
bool isDiscordRelationshipUpdate)>;
3643 std::optional<discordpp::UserHandle> user)>;
3651 Discord_Client* instance()
const {
return &instance_; }
3673 explicit Client(std::string apiBase, std::string webBase);
3694 [[deprecated(
"Please use GetCurrentUserV2 instead. This will be removed in a future version.")]]
3906 [[deprecated(
"Calling Client::SetSpeakerMode is DEPRECATED.")]]
4100 uint64_t childApplicationId,
4109 std::string
const& token,
4147 std::string
const& externalAuthToken,
4174 std::string
const& code,
4175 std::string
const& codeVerifier,
4176 std::string
const& redirectUri,
4246 std::string
const& externalAuthToken,
4280 std::string
const& code,
4281 std::string
const& codeVerifier,
4282 std::string
const& redirectUri,
4284 std::string
const& externalAuthToken,
4320 std::string
const& refreshToken,
4354 std::string
const& token,
4400 uint64_t applicationId,
4402 std::string
const& externalAuthToken,
4411 std::string
const& name,
4445 std::string
const& content,
4524 std::string
const& content,
4534 std::string
const& content,
4535 std::unordered_map<std::string, std::string>
const& metadata,
4551 std::string
const& content,
4561 std::string
const& content,
4562 std::unordered_map<std::string, std::string>
const& metadata,
4729 std::string
const& secret,
4730 std::unordered_map<std::string, std::string>
const& lobbyMetadata,
4731 std::unordered_map<std::string, std::string>
const& memberMetadata,
4923 std::string
const& content,
5192 uint64_t applicationId,
5200 std::optional<discordpp::UserHandle>
GetUser(uint64_t userId)
const;
5220 mutable Discord_CallInfoHandle instance_{};
5226 Discord_CallInfoHandle* instance()
const {
return &instance_; }
5272 return "JoinRequest";
5302 return "CustomStatus";
5306 return "HangStatus";
5356 return "NetworkError";
5360 return "ClientNotReady";
5364 return "ClientDestroyed";
5366 return "ValidationError";
5370 return "AuthorizationFailed";
5386 return "SwitchingProtocols";
5388 return "Processing";
5390 return "EarlyHints";
5398 return "NonAuthoritativeInfo";
5402 return "ResetContent";
5404 return "PartialContent";
5406 return "MultiStatus";
5408 return "AlreadyReported";
5412 return "MultipleChoices";
5414 return "MovedPermanently";
5420 return "NotModified";
5422 return "TemporaryRedirect";
5424 return "PermanentRedirect";
5426 return "BadRequest";
5428 return "Unauthorized";
5430 return "PaymentRequired";
5436 return "MethodNotAllowed";
5438 return "NotAcceptable";
5440 return "ProxyAuthRequired";
5442 return "RequestTimeout";
5448 return "LengthRequired";
5450 return "PreconditionFailed";
5452 return "PayloadTooLarge";
5454 return "UriTooLong";
5456 return "UnsupportedMediaType";
5458 return "RangeNotSatisfiable";
5460 return "ExpectationFailed";
5462 return "MisdirectedRequest";
5464 return "UnprocessableEntity";
5468 return "FailedDependency";
5472 return "UpgradeRequired";
5474 return "PreconditionRequired";
5476 return "TooManyRequests";
5478 return "RequestHeaderFieldsTooLarge";
5480 return "InternalServerError";
5482 return "NotImplemented";
5484 return "BadGateway";
5486 return "ServiceUnavailable";
5488 return "GatewayTimeout";
5490 return "HttpVersionNotSupported";
5492 return "VariantAlsoNegotiates";
5494 return "InsufficientStorage";
5496 return "LoopDetected";
5498 return "NotExtended";
5500 return "NetworkAuthorizationRequired";
5520 return "GuildInstall";
5522 return "UserInstall";
5536 return "GuildVoice";
5540 return "GuildCategory";
5544 return "GuildStore";
5546 return "GuildNewsThread";
5548 return "GuildPublicThread";
5550 return "GuildPrivateThread";
5552 return "GuildStageVoice";
5554 return "GuildDirectory";
5556 return "GuildForum";
5558 return "GuildMedia";
5562 return "EphemeralDm";
5574 return "Attachment";
5578 return "VoiceMessage";
5608 return "SignalingConnectionFailed";
5610 return "SignalingUnexpectedClose";
5612 return "VoiceConnectionFailed";
5614 return "JoinTimeout";
5626 return "MODE_UNINIT";
5640 return "Disconnected";
5644 return "Connecting";
5646 return "SignalingConnected";
5650 return "Reconnecting";
5652 return "Disconnecting";
5668 return "PendingIncoming";
5670 return "PendingOutgoing";
5674 return "Suggestion";
5686 return "EpicOnlineServices";
5692 return "DiscordBot";
5746 return "MessageDataVisibleOnDiscord";
5758 return "ConnectionFailed";
5760 return "UnexpectedClose";
5762 return "ConnectionCanceled";
5772 return "Disconnected";
5774 return "Connecting";
5780 return "Reconnecting";
5782 return "Disconnecting";
5822 return "EpicOnlineServicesAccessToken";
5824 return "EpicOnlineServicesIdToken";
5826 return "SteamSessionTicket";
5828 return "UnityServicesIdToken";
5830 return "DiscordBotIssuedAccessToken";
5832 return "AppleIdToken";
5834 return "PlayStationNetworkIdToken";
5862 return "OnlinePlayingGame";
5864 return "OnlineElsewhere";
5873#ifdef DISCORDPP_IMPLEMENTATION
5874#undef DISCORDPP_IMPLEMENTATION
5876#pragma clang diagnostic push
5877#pragma clang diagnostic ignored "-Wunused-parameter"
5880std::function<void(std::function<
void()>)> s_synchronizationContext;
5882inline bool HasSynchronizationContext()
5884 return !!s_synchronizationContext;
5887inline void PostTask(std::function<
void()> task)
5889 assert(s_synchronizationContext);
5890 s_synchronizationContext(std::move(task));
5893void SetSynchronizationContext(std::function<
void(std::function<
void()>)> executor)
5895 s_synchronizationContext = std::move(executor);
5898template <
typename T>
5899struct TDelegateUserData {
5901 TDelegateUserData(T delegate)
5902 : delegate{delegate}
5906 static void Free(
void* ptr) {
delete reinterpret_cast<TDelegateUserData*
>(ptr); }
5908 static T& Get(
void* userData)
5910 return reinterpret_cast<TDelegateUserData*
>(userData)->delegate;
5914struct ConvertedProperties {
5915 ConvertedProperties(std::unordered_map<std::string, std::string>
const& PropertyMap)
5917 Properties.size = PropertyMap.size();
5918 Properties.keys =
reinterpret_cast<Discord_String*
>(
5919 Discord_Alloc(Properties.size *
sizeof(Discord_String)));
5920 Properties.values =
reinterpret_cast<Discord_String*
>(
5921 Discord_Alloc(Properties.size *
sizeof(Discord_String)));
5923 for (
auto& pair : PropertyMap) {
5924 Properties.keys[i] = AllocateString(pair.first);
5925 Properties.values[i] = AllocateString(pair.second);
5929 ~ConvertedProperties() { Discord_FreeProperties(Properties); }
5930 Discord_Properties Properties{};
5933 Discord_String AllocateString(std::string
const& str)
5935 Discord_String result;
5936 result.ptr =
reinterpret_cast<uint8_t*
>(Discord_Alloc(str.size()));
5937 result.size = str.size();
5938 std::memcpy(result.ptr, str.data(), result.size);
5943std::unordered_map<std::string, std::string> ConvertReturnedProperties(
5944 Discord_Properties
const& Properties)
5946 std::unordered_map<std::string, std::string> result;
5947 for (
size_t i = 0; i < Properties.size; ++i) {
5948 std::string key(
reinterpret_cast<char*
>(Properties.keys[i].ptr), Properties.keys[i].size);
5949 std::string value(
reinterpret_cast<char*
>(Properties.values[i].ptr),
5950 Properties.values[i].size);
5951 result.emplace(std::move(key), std::move(value));
5956ActivityInvite::~ActivityInvite()
5964 : instance_(other.instance_)
5965 , state_(other.state_)
5971 if (
this != &other) {
5975 instance_ = other.instance_;
5976 state_ = other.state_;
5986 Discord_ActivityInvite_Clone(&instance_, rhs.instance());
5988 state_ = DiscordObjectState::Owned;
5991ActivityInvite& ActivityInvite::operator=(
const ActivityInvite& rhs)
5994 if (state_ == DiscordObjectState::Owned) {
5996 state_ = DiscordObjectState::Invalid;
5998 if (rhs.state_ == DiscordObjectState::Owned) {
5999 Discord_ActivityInvite_Clone(&instance_, rhs.instance());
6001 state_ = DiscordObjectState::Owned;
6006ActivityInvite::ActivityInvite(Discord_ActivityInvite instance, DiscordObjectState state)
6007 : instance_(instance)
6011ActivityInvite::ActivityInvite()
6013 assert(state_ == DiscordObjectState::Invalid);
6014 Discord_ActivityInvite_Init(&instance_);
6015 state_ = DiscordObjectState::Owned;
6017void ActivityInvite::Drop()
6019 if (state_ != DiscordObjectState::Owned) {
6022 Discord_ActivityInvite_Drop(&instance_);
6023 state_ = DiscordObjectState::Invalid;
6025uint64_t ActivityInvite::SenderId()
const
6027 assert(state_ == DiscordObjectState::Owned);
6028 uint64_t returnValue__;
6029 returnValue__ = Discord_ActivityInvite_SenderId(&instance_);
6030 return returnValue__;
6032void ActivityInvite::SetSenderId(uint64_t SenderId)
6034 assert(state_ == DiscordObjectState::Owned);
6035 Discord_ActivityInvite_SetSenderId(&instance_, SenderId);
6037uint64_t ActivityInvite::ChannelId()
const
6039 assert(state_ == DiscordObjectState::Owned);
6040 uint64_t returnValue__;
6041 returnValue__ = Discord_ActivityInvite_ChannelId(&instance_);
6042 return returnValue__;
6044void ActivityInvite::SetChannelId(uint64_t ChannelId)
6046 assert(state_ == DiscordObjectState::Owned);
6047 Discord_ActivityInvite_SetChannelId(&instance_, ChannelId);
6049uint64_t ActivityInvite::MessageId()
const
6051 assert(state_ == DiscordObjectState::Owned);
6052 uint64_t returnValue__;
6053 returnValue__ = Discord_ActivityInvite_MessageId(&instance_);
6054 return returnValue__;
6056void ActivityInvite::SetMessageId(uint64_t MessageId)
6058 assert(state_ == DiscordObjectState::Owned);
6059 Discord_ActivityInvite_SetMessageId(&instance_, MessageId);
6063 assert(state_ == DiscordObjectState::Owned);
6064 Discord_ActivityActionTypes returnValue__;
6065 returnValue__ = Discord_ActivityInvite_Type(&instance_);
6070 assert(state_ == DiscordObjectState::Owned);
6071 Discord_ActivityInvite_SetType(&instance_,
static_cast<Discord_ActivityActionTypes
>(Type));
6073uint64_t ActivityInvite::ApplicationId()
const
6075 assert(state_ == DiscordObjectState::Owned);
6076 uint64_t returnValue__;
6077 returnValue__ = Discord_ActivityInvite_ApplicationId(&instance_);
6078 return returnValue__;
6080void ActivityInvite::SetApplicationId(uint64_t ApplicationId)
6082 assert(state_ == DiscordObjectState::Owned);
6083 Discord_ActivityInvite_SetApplicationId(&instance_, ApplicationId);
6085uint64_t ActivityInvite::ParentApplicationId()
const
6087 assert(state_ == DiscordObjectState::Owned);
6088 uint64_t returnValue__;
6089 returnValue__ = Discord_ActivityInvite_ParentApplicationId(&instance_);
6090 return returnValue__;
6092void ActivityInvite::SetParentApplicationId(uint64_t ParentApplicationId)
6094 assert(state_ == DiscordObjectState::Owned);
6095 Discord_ActivityInvite_SetParentApplicationId(&instance_, ParentApplicationId);
6097std::string ActivityInvite::PartyId()
const
6099 assert(state_ == DiscordObjectState::Owned);
6100 Discord_String returnValueNative__;
6101 Discord_ActivityInvite_PartyId(&instance_, &returnValueNative__);
6102 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6103 returnValueNative__.size);
6104 Discord_Free(returnValueNative__.ptr);
6105 return returnValue__;
6107void ActivityInvite::SetPartyId(std::string PartyId)
6109 assert(state_ == DiscordObjectState::Owned);
6110 Discord_String PartyId__str{(uint8_t*)(PartyId.data()), PartyId.size()};
6111 Discord_ActivityInvite_SetPartyId(&instance_, PartyId__str);
6113std::string ActivityInvite::SessionId()
const
6115 assert(state_ == DiscordObjectState::Owned);
6116 Discord_String returnValueNative__;
6117 Discord_ActivityInvite_SessionId(&instance_, &returnValueNative__);
6118 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6119 returnValueNative__.size);
6120 Discord_Free(returnValueNative__.ptr);
6121 return returnValue__;
6123void ActivityInvite::SetSessionId(std::string SessionId)
6125 assert(state_ == DiscordObjectState::Owned);
6126 Discord_String SessionId__str{(uint8_t*)(SessionId.data()), SessionId.size()};
6127 Discord_ActivityInvite_SetSessionId(&instance_, SessionId__str);
6129bool ActivityInvite::IsValid()
const
6131 assert(state_ == DiscordObjectState::Owned);
6133 returnValue__ = Discord_ActivityInvite_IsValid(&instance_);
6134 return returnValue__;
6136void ActivityInvite::SetIsValid(
bool IsValid)
6138 assert(state_ == DiscordObjectState::Owned);
6139 Discord_ActivityInvite_SetIsValid(&instance_, IsValid);
6141const ActivityAssets ActivityAssets::nullobj{{}, DiscordObjectState::Invalid};
6142ActivityAssets::~ActivityAssets()
6144 if (state_ == DiscordObjectState::Owned) {
6146 state_ = DiscordObjectState::Invalid;
6149ActivityAssets::ActivityAssets(ActivityAssets&& other) noexcept
6150 : instance_(other.instance_)
6151 , state_(other.state_)
6153 other.state_ = DiscordObjectState::Invalid;
6155ActivityAssets& ActivityAssets::operator=(ActivityAssets&& other)
noexcept
6157 if (
this != &other) {
6158 if (state_ == DiscordObjectState::Owned) {
6161 instance_ = other.instance_;
6162 state_ = other.state_;
6163 other.state_ = DiscordObjectState::Invalid;
6167ActivityAssets::ActivityAssets(
const ActivityAssets& arg0)
6172 Discord_ActivityAssets_Clone(&instance_, arg0.instance());
6174 state_ = DiscordObjectState::Owned;
6177ActivityAssets& ActivityAssets::operator=(
const ActivityAssets& arg0)
6179 if (
this != &arg0) {
6180 if (state_ == DiscordObjectState::Owned) {
6182 state_ = DiscordObjectState::Invalid;
6184 if (arg0.state_ == DiscordObjectState::Owned) {
6185 Discord_ActivityAssets_Clone(&instance_, arg0.instance());
6187 state_ = DiscordObjectState::Owned;
6192ActivityAssets::ActivityAssets(Discord_ActivityAssets instance, DiscordObjectState state)
6193 : instance_(instance)
6197ActivityAssets::ActivityAssets()
6199 assert(state_ == DiscordObjectState::Invalid);
6200 Discord_ActivityAssets_Init(&instance_);
6201 state_ = DiscordObjectState::Owned;
6203void ActivityAssets::Drop()
6205 if (state_ != DiscordObjectState::Owned) {
6208 Discord_ActivityAssets_Drop(&instance_);
6209 state_ = DiscordObjectState::Invalid;
6211std::optional<std::string> ActivityAssets::LargeImage()
const
6213 assert(state_ == DiscordObjectState::Owned);
6214 bool returnIsNonNull__;
6215 Discord_String returnValueNative__;
6216 returnIsNonNull__ = Discord_ActivityAssets_LargeImage(&instance_, &returnValueNative__);
6217 if (!returnIsNonNull__) {
6220 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6221 returnValueNative__.size);
6222 Discord_Free(returnValueNative__.ptr);
6223 return returnValue__;
6225void ActivityAssets::SetLargeImage(std::optional<std::string> LargeImage)
6227 assert(state_ == DiscordObjectState::Owned);
6228 Discord_String LargeImage__str{};
6229 if (LargeImage.has_value()) {
6230 LargeImage__str.ptr =
reinterpret_cast<uint8_t*
>(LargeImage->data());
6231 LargeImage__str.size = LargeImage->size();
6233 Discord_ActivityAssets_SetLargeImage(&instance_,
6234 (LargeImage.has_value() ? &LargeImage__str :
nullptr));
6236std::optional<std::string> ActivityAssets::LargeText()
const
6238 assert(state_ == DiscordObjectState::Owned);
6239 bool returnIsNonNull__;
6240 Discord_String returnValueNative__;
6241 returnIsNonNull__ = Discord_ActivityAssets_LargeText(&instance_, &returnValueNative__);
6242 if (!returnIsNonNull__) {
6245 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6246 returnValueNative__.size);
6247 Discord_Free(returnValueNative__.ptr);
6248 return returnValue__;
6250void ActivityAssets::SetLargeText(std::optional<std::string> LargeText)
6252 assert(state_ == DiscordObjectState::Owned);
6253 Discord_String LargeText__str{};
6254 if (LargeText.has_value()) {
6255 LargeText__str.ptr =
reinterpret_cast<uint8_t*
>(LargeText->data());
6256 LargeText__str.size = LargeText->size();
6258 Discord_ActivityAssets_SetLargeText(&instance_,
6259 (LargeText.has_value() ? &LargeText__str :
nullptr));
6261std::optional<std::string> ActivityAssets::LargeUrl()
const
6263 assert(state_ == DiscordObjectState::Owned);
6264 bool returnIsNonNull__;
6265 Discord_String returnValueNative__;
6266 returnIsNonNull__ = Discord_ActivityAssets_LargeUrl(&instance_, &returnValueNative__);
6267 if (!returnIsNonNull__) {
6270 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6271 returnValueNative__.size);
6272 Discord_Free(returnValueNative__.ptr);
6273 return returnValue__;
6275void ActivityAssets::SetLargeUrl(std::optional<std::string> LargeUrl)
6277 assert(state_ == DiscordObjectState::Owned);
6278 Discord_String LargeUrl__str{};
6279 if (LargeUrl.has_value()) {
6280 LargeUrl__str.ptr =
reinterpret_cast<uint8_t*
>(LargeUrl->data());
6281 LargeUrl__str.size = LargeUrl->size();
6283 Discord_ActivityAssets_SetLargeUrl(&instance_,
6284 (LargeUrl.has_value() ? &LargeUrl__str :
nullptr));
6286std::optional<std::string> ActivityAssets::SmallImage()
const
6288 assert(state_ == DiscordObjectState::Owned);
6289 bool returnIsNonNull__;
6290 Discord_String returnValueNative__;
6291 returnIsNonNull__ = Discord_ActivityAssets_SmallImage(&instance_, &returnValueNative__);
6292 if (!returnIsNonNull__) {
6295 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6296 returnValueNative__.size);
6297 Discord_Free(returnValueNative__.ptr);
6298 return returnValue__;
6300void ActivityAssets::SetSmallImage(std::optional<std::string> SmallImage)
6302 assert(state_ == DiscordObjectState::Owned);
6303 Discord_String SmallImage__str{};
6304 if (SmallImage.has_value()) {
6305 SmallImage__str.ptr =
reinterpret_cast<uint8_t*
>(SmallImage->data());
6306 SmallImage__str.size = SmallImage->size();
6308 Discord_ActivityAssets_SetSmallImage(&instance_,
6309 (SmallImage.has_value() ? &SmallImage__str :
nullptr));
6311std::optional<std::string> ActivityAssets::SmallText()
const
6313 assert(state_ == DiscordObjectState::Owned);
6314 bool returnIsNonNull__;
6315 Discord_String returnValueNative__;
6316 returnIsNonNull__ = Discord_ActivityAssets_SmallText(&instance_, &returnValueNative__);
6317 if (!returnIsNonNull__) {
6320 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6321 returnValueNative__.size);
6322 Discord_Free(returnValueNative__.ptr);
6323 return returnValue__;
6325void ActivityAssets::SetSmallText(std::optional<std::string> SmallText)
6327 assert(state_ == DiscordObjectState::Owned);
6328 Discord_String SmallText__str{};
6329 if (SmallText.has_value()) {
6330 SmallText__str.ptr =
reinterpret_cast<uint8_t*
>(SmallText->data());
6331 SmallText__str.size = SmallText->size();
6333 Discord_ActivityAssets_SetSmallText(&instance_,
6334 (SmallText.has_value() ? &SmallText__str :
nullptr));
6336std::optional<std::string> ActivityAssets::SmallUrl()
const
6338 assert(state_ == DiscordObjectState::Owned);
6339 bool returnIsNonNull__;
6340 Discord_String returnValueNative__;
6341 returnIsNonNull__ = Discord_ActivityAssets_SmallUrl(&instance_, &returnValueNative__);
6342 if (!returnIsNonNull__) {
6345 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6346 returnValueNative__.size);
6347 Discord_Free(returnValueNative__.ptr);
6348 return returnValue__;
6350void ActivityAssets::SetSmallUrl(std::optional<std::string> SmallUrl)
6352 assert(state_ == DiscordObjectState::Owned);
6353 Discord_String SmallUrl__str{};
6354 if (SmallUrl.has_value()) {
6355 SmallUrl__str.ptr =
reinterpret_cast<uint8_t*
>(SmallUrl->data());
6356 SmallUrl__str.size = SmallUrl->size();
6358 Discord_ActivityAssets_SetSmallUrl(&instance_,
6359 (SmallUrl.has_value() ? &SmallUrl__str :
nullptr));
6361std::optional<std::string> ActivityAssets::InviteCoverImage()
const
6363 assert(state_ == DiscordObjectState::Owned);
6364 bool returnIsNonNull__;
6365 Discord_String returnValueNative__;
6366 returnIsNonNull__ = Discord_ActivityAssets_InviteCoverImage(&instance_, &returnValueNative__);
6367 if (!returnIsNonNull__) {
6370 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6371 returnValueNative__.size);
6372 Discord_Free(returnValueNative__.ptr);
6373 return returnValue__;
6375void ActivityAssets::SetInviteCoverImage(std::optional<std::string> InviteCoverImage)
6377 assert(state_ == DiscordObjectState::Owned);
6378 Discord_String InviteCoverImage__str{};
6379 if (InviteCoverImage.has_value()) {
6380 InviteCoverImage__str.ptr =
reinterpret_cast<uint8_t*
>(InviteCoverImage->data());
6381 InviteCoverImage__str.size = InviteCoverImage->size();
6383 Discord_ActivityAssets_SetInviteCoverImage(
6384 &instance_, (InviteCoverImage.has_value() ? &InviteCoverImage__str :
nullptr));
6386const ActivityTimestamps ActivityTimestamps::nullobj{{}, DiscordObjectState::Invalid};
6387ActivityTimestamps::~ActivityTimestamps()
6389 if (state_ == DiscordObjectState::Owned) {
6391 state_ = DiscordObjectState::Invalid;
6394ActivityTimestamps::ActivityTimestamps(ActivityTimestamps&& other) noexcept
6395 : instance_(other.instance_)
6396 , state_(other.state_)
6398 other.state_ = DiscordObjectState::Invalid;
6400ActivityTimestamps& ActivityTimestamps::operator=(ActivityTimestamps&& other)
noexcept
6402 if (
this != &other) {
6403 if (state_ == DiscordObjectState::Owned) {
6406 instance_ = other.instance_;
6407 state_ = other.state_;
6408 other.state_ = DiscordObjectState::Invalid;
6412ActivityTimestamps::ActivityTimestamps(
const ActivityTimestamps& arg0)
6417 Discord_ActivityTimestamps_Clone(&instance_, arg0.instance());
6419 state_ = DiscordObjectState::Owned;
6422ActivityTimestamps& ActivityTimestamps::operator=(
const ActivityTimestamps& arg0)
6424 if (
this != &arg0) {
6425 if (state_ == DiscordObjectState::Owned) {
6427 state_ = DiscordObjectState::Invalid;
6429 if (arg0.state_ == DiscordObjectState::Owned) {
6430 Discord_ActivityTimestamps_Clone(&instance_, arg0.instance());
6432 state_ = DiscordObjectState::Owned;
6437ActivityTimestamps::ActivityTimestamps(Discord_ActivityTimestamps instance,
6438 DiscordObjectState state)
6439 : instance_(instance)
6443ActivityTimestamps::ActivityTimestamps()
6445 assert(state_ == DiscordObjectState::Invalid);
6446 Discord_ActivityTimestamps_Init(&instance_);
6447 state_ = DiscordObjectState::Owned;
6449void ActivityTimestamps::Drop()
6451 if (state_ != DiscordObjectState::Owned) {
6454 Discord_ActivityTimestamps_Drop(&instance_);
6455 state_ = DiscordObjectState::Invalid;
6457uint64_t ActivityTimestamps::Start()
const
6459 assert(state_ == DiscordObjectState::Owned);
6460 uint64_t returnValue__;
6461 returnValue__ = Discord_ActivityTimestamps_Start(&instance_);
6462 return returnValue__;
6464void ActivityTimestamps::SetStart(uint64_t Start)
6466 assert(state_ == DiscordObjectState::Owned);
6467 Discord_ActivityTimestamps_SetStart(&instance_, Start);
6469uint64_t ActivityTimestamps::End()
const
6471 assert(state_ == DiscordObjectState::Owned);
6472 uint64_t returnValue__;
6473 returnValue__ = Discord_ActivityTimestamps_End(&instance_);
6474 return returnValue__;
6476void ActivityTimestamps::SetEnd(uint64_t End)
6478 assert(state_ == DiscordObjectState::Owned);
6479 Discord_ActivityTimestamps_SetEnd(&instance_, End);
6481const ActivityParty ActivityParty::nullobj{{}, DiscordObjectState::Invalid};
6482ActivityParty::~ActivityParty()
6484 if (state_ == DiscordObjectState::Owned) {
6486 state_ = DiscordObjectState::Invalid;
6489ActivityParty::ActivityParty(ActivityParty&& other) noexcept
6490 : instance_(other.instance_)
6491 , state_(other.state_)
6493 other.state_ = DiscordObjectState::Invalid;
6495ActivityParty& ActivityParty::operator=(ActivityParty&& other)
noexcept
6497 if (
this != &other) {
6498 if (state_ == DiscordObjectState::Owned) {
6501 instance_ = other.instance_;
6502 state_ = other.state_;
6503 other.state_ = DiscordObjectState::Invalid;
6507ActivityParty::ActivityParty(
const ActivityParty& arg0)
6512 Discord_ActivityParty_Clone(&instance_, arg0.instance());
6514 state_ = DiscordObjectState::Owned;
6517ActivityParty& ActivityParty::operator=(
const ActivityParty& arg0)
6519 if (
this != &arg0) {
6520 if (state_ == DiscordObjectState::Owned) {
6522 state_ = DiscordObjectState::Invalid;
6524 if (arg0.state_ == DiscordObjectState::Owned) {
6525 Discord_ActivityParty_Clone(&instance_, arg0.instance());
6527 state_ = DiscordObjectState::Owned;
6532ActivityParty::ActivityParty(Discord_ActivityParty instance, DiscordObjectState state)
6533 : instance_(instance)
6537ActivityParty::ActivityParty()
6539 assert(state_ == DiscordObjectState::Invalid);
6540 Discord_ActivityParty_Init(&instance_);
6541 state_ = DiscordObjectState::Owned;
6543void ActivityParty::Drop()
6545 if (state_ != DiscordObjectState::Owned) {
6548 Discord_ActivityParty_Drop(&instance_);
6549 state_ = DiscordObjectState::Invalid;
6551std::string ActivityParty::Id()
const
6553 assert(state_ == DiscordObjectState::Owned);
6554 Discord_String returnValueNative__;
6555 Discord_ActivityParty_Id(&instance_, &returnValueNative__);
6556 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6557 returnValueNative__.size);
6558 Discord_Free(returnValueNative__.ptr);
6559 return returnValue__;
6561void ActivityParty::SetId(std::string Id)
6563 assert(state_ == DiscordObjectState::Owned);
6564 Discord_String Id__str{(uint8_t*)(Id.data()), Id.size()};
6565 Discord_ActivityParty_SetId(&instance_, Id__str);
6567int32_t ActivityParty::CurrentSize()
const
6569 assert(state_ == DiscordObjectState::Owned);
6570 int32_t returnValue__;
6571 returnValue__ = Discord_ActivityParty_CurrentSize(&instance_);
6572 return returnValue__;
6574void ActivityParty::SetCurrentSize(int32_t CurrentSize)
6576 assert(state_ == DiscordObjectState::Owned);
6577 Discord_ActivityParty_SetCurrentSize(&instance_, CurrentSize);
6579int32_t ActivityParty::MaxSize()
const
6581 assert(state_ == DiscordObjectState::Owned);
6582 int32_t returnValue__;
6583 returnValue__ = Discord_ActivityParty_MaxSize(&instance_);
6584 return returnValue__;
6586void ActivityParty::SetMaxSize(int32_t MaxSize)
6588 assert(state_ == DiscordObjectState::Owned);
6589 Discord_ActivityParty_SetMaxSize(&instance_, MaxSize);
6593 assert(state_ == DiscordObjectState::Owned);
6594 Discord_ActivityPartyPrivacy returnValue__;
6595 returnValue__ = Discord_ActivityParty_Privacy(&instance_);
6600 assert(state_ == DiscordObjectState::Owned);
6601 Discord_ActivityParty_SetPrivacy(&instance_,
6602 static_cast<Discord_ActivityPartyPrivacy
>(Privacy));
6604const ActivitySecrets ActivitySecrets::nullobj{{}, DiscordObjectState::Invalid};
6605ActivitySecrets::~ActivitySecrets()
6607 if (state_ == DiscordObjectState::Owned) {
6609 state_ = DiscordObjectState::Invalid;
6612ActivitySecrets::ActivitySecrets(ActivitySecrets&& other) noexcept
6613 : instance_(other.instance_)
6614 , state_(other.state_)
6616 other.state_ = DiscordObjectState::Invalid;
6618ActivitySecrets& ActivitySecrets::operator=(ActivitySecrets&& other)
noexcept
6620 if (
this != &other) {
6621 if (state_ == DiscordObjectState::Owned) {
6624 instance_ = other.instance_;
6625 state_ = other.state_;
6626 other.state_ = DiscordObjectState::Invalid;
6630ActivitySecrets::ActivitySecrets(
const ActivitySecrets& arg0)
6635 Discord_ActivitySecrets_Clone(&instance_, arg0.instance());
6637 state_ = DiscordObjectState::Owned;
6640ActivitySecrets& ActivitySecrets::operator=(
const ActivitySecrets& arg0)
6642 if (
this != &arg0) {
6643 if (state_ == DiscordObjectState::Owned) {
6645 state_ = DiscordObjectState::Invalid;
6647 if (arg0.state_ == DiscordObjectState::Owned) {
6648 Discord_ActivitySecrets_Clone(&instance_, arg0.instance());
6650 state_ = DiscordObjectState::Owned;
6655ActivitySecrets::ActivitySecrets(Discord_ActivitySecrets instance, DiscordObjectState state)
6656 : instance_(instance)
6660ActivitySecrets::ActivitySecrets()
6662 assert(state_ == DiscordObjectState::Invalid);
6663 Discord_ActivitySecrets_Init(&instance_);
6664 state_ = DiscordObjectState::Owned;
6666void ActivitySecrets::Drop()
6668 if (state_ != DiscordObjectState::Owned) {
6671 Discord_ActivitySecrets_Drop(&instance_);
6672 state_ = DiscordObjectState::Invalid;
6674std::string ActivitySecrets::Join()
const
6676 assert(state_ == DiscordObjectState::Owned);
6677 Discord_String returnValueNative__;
6678 Discord_ActivitySecrets_Join(&instance_, &returnValueNative__);
6679 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6680 returnValueNative__.size);
6681 Discord_Free(returnValueNative__.ptr);
6682 return returnValue__;
6684void ActivitySecrets::SetJoin(std::string Join)
6686 assert(state_ == DiscordObjectState::Owned);
6687 Discord_String Join__str{(uint8_t*)(
Join.data()),
Join.size()};
6688 Discord_ActivitySecrets_SetJoin(&instance_, Join__str);
6690const ActivityButton ActivityButton::nullobj{{}, DiscordObjectState::Invalid};
6691ActivityButton::~ActivityButton()
6693 if (state_ == DiscordObjectState::Owned) {
6695 state_ = DiscordObjectState::Invalid;
6698ActivityButton::ActivityButton(ActivityButton&& other) noexcept
6699 : instance_(other.instance_)
6700 , state_(other.state_)
6702 other.state_ = DiscordObjectState::Invalid;
6704ActivityButton& ActivityButton::operator=(ActivityButton&& other)
noexcept
6706 if (
this != &other) {
6707 if (state_ == DiscordObjectState::Owned) {
6710 instance_ = other.instance_;
6711 state_ = other.state_;
6712 other.state_ = DiscordObjectState::Invalid;
6716ActivityButton::ActivityButton(
const ActivityButton& arg0)
6721 Discord_ActivityButton_Clone(&instance_, arg0.instance());
6723 state_ = DiscordObjectState::Owned;
6726ActivityButton& ActivityButton::operator=(
const ActivityButton& arg0)
6728 if (
this != &arg0) {
6729 if (state_ == DiscordObjectState::Owned) {
6731 state_ = DiscordObjectState::Invalid;
6733 if (arg0.state_ == DiscordObjectState::Owned) {
6734 Discord_ActivityButton_Clone(&instance_, arg0.instance());
6736 state_ = DiscordObjectState::Owned;
6741ActivityButton::ActivityButton(Discord_ActivityButton instance, DiscordObjectState state)
6742 : instance_(instance)
6746ActivityButton::ActivityButton()
6748 assert(state_ == DiscordObjectState::Invalid);
6749 Discord_ActivityButton_Init(&instance_);
6750 state_ = DiscordObjectState::Owned;
6752void ActivityButton::Drop()
6754 if (state_ != DiscordObjectState::Owned) {
6757 Discord_ActivityButton_Drop(&instance_);
6758 state_ = DiscordObjectState::Invalid;
6760std::string ActivityButton::Label()
const
6762 assert(state_ == DiscordObjectState::Owned);
6763 Discord_String returnValueNative__;
6764 Discord_ActivityButton_Label(&instance_, &returnValueNative__);
6765 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6766 returnValueNative__.size);
6767 Discord_Free(returnValueNative__.ptr);
6768 return returnValue__;
6770void ActivityButton::SetLabel(std::string Label)
6772 assert(state_ == DiscordObjectState::Owned);
6773 Discord_String Label__str{(uint8_t*)(Label.data()), Label.size()};
6774 Discord_ActivityButton_SetLabel(&instance_, Label__str);
6776std::string ActivityButton::Url()
const
6778 assert(state_ == DiscordObjectState::Owned);
6779 Discord_String returnValueNative__;
6780 Discord_ActivityButton_Url(&instance_, &returnValueNative__);
6781 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6782 returnValueNative__.size);
6783 Discord_Free(returnValueNative__.ptr);
6784 return returnValue__;
6786void ActivityButton::SetUrl(std::string Url)
6788 assert(state_ == DiscordObjectState::Owned);
6789 Discord_String Url__str{(uint8_t*)(Url.data()), Url.size()};
6790 Discord_ActivityButton_SetUrl(&instance_, Url__str);
6792const Activity Activity::nullobj{{}, DiscordObjectState::Invalid};
6793Activity::~Activity()
6795 if (state_ == DiscordObjectState::Owned) {
6797 state_ = DiscordObjectState::Invalid;
6800Activity::Activity(Activity&& other) noexcept
6801 : instance_(other.instance_)
6802 , state_(other.state_)
6804 other.state_ = DiscordObjectState::Invalid;
6806Activity& Activity::operator=(Activity&& other)
noexcept
6808 if (
this != &other) {
6809 if (state_ == DiscordObjectState::Owned) {
6812 instance_ = other.instance_;
6813 state_ = other.state_;
6814 other.state_ = DiscordObjectState::Invalid;
6818Activity::Activity(
const Activity& arg0)
6823 Discord_Activity_Clone(&instance_, arg0.instance());
6825 state_ = DiscordObjectState::Owned;
6828Activity& Activity::operator=(
const Activity& arg0)
6830 if (
this != &arg0) {
6831 if (state_ == DiscordObjectState::Owned) {
6833 state_ = DiscordObjectState::Invalid;
6835 if (arg0.state_ == DiscordObjectState::Owned) {
6836 Discord_Activity_Clone(&instance_, arg0.instance());
6838 state_ = DiscordObjectState::Owned;
6843Activity::Activity(Discord_Activity instance, DiscordObjectState state)
6844 : instance_(instance)
6850 assert(state_ == DiscordObjectState::Invalid);
6851 Discord_Activity_Init(&instance_);
6852 state_ = DiscordObjectState::Owned;
6854void Activity::Drop()
6856 if (state_ != DiscordObjectState::Owned) {
6859 Discord_Activity_Drop(&instance_);
6860 state_ = DiscordObjectState::Invalid;
6864 assert(state_ == DiscordObjectState::Owned);
6865 Discord_Activity_AddButton(&instance_, button.instance());
6869 assert(state_ == DiscordObjectState::Owned);
6871 returnValue__ = Discord_Activity_Equals(&instance_, other.instance());
6872 return returnValue__;
6874std::vector<discordpp::ActivityButton> Activity::GetButtons()
const
6876 assert(state_ == DiscordObjectState::Owned);
6877 Discord_ActivityButtonSpan returnValueNative__;
6878 Discord_Activity_GetButtons(&instance_, &returnValueNative__);
6879 std::vector<discordpp::ActivityButton> returnValue__;
6880 returnValue__.reserve(returnValueNative__.size);
6881 for (
size_t i__ = 0; i__ < returnValueNative__.size; ++i__) {
6882 returnValue__.emplace_back(returnValueNative__.ptr[i__], DiscordObjectState::Owned);
6884 Discord_Free(returnValueNative__.ptr);
6885 return returnValue__;
6887std::string Activity::Name()
const
6889 assert(state_ == DiscordObjectState::Owned);
6890 Discord_String returnValueNative__;
6891 Discord_Activity_Name(&instance_, &returnValueNative__);
6892 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6893 returnValueNative__.size);
6894 Discord_Free(returnValueNative__.ptr);
6895 return returnValue__;
6897void Activity::SetName(std::string Name)
6899 assert(state_ == DiscordObjectState::Owned);
6900 Discord_String Name__str{(uint8_t*)(
Name.data()),
Name.size()};
6901 Discord_Activity_SetName(&instance_, Name__str);
6905 assert(state_ == DiscordObjectState::Owned);
6906 Discord_ActivityTypes returnValue__;
6907 returnValue__ = Discord_Activity_Type(&instance_);
6912 assert(state_ == DiscordObjectState::Owned);
6913 Discord_Activity_SetType(&instance_,
static_cast<Discord_ActivityTypes
>(Type));
6915std::optional<discordpp::StatusDisplayTypes> Activity::StatusDisplayType()
const
6917 assert(state_ == DiscordObjectState::Owned);
6918 bool returnIsNonNull__;
6919 Discord_StatusDisplayTypes returnValueNative__;
6920 returnIsNonNull__ = Discord_Activity_StatusDisplayType(&instance_, &returnValueNative__);
6921 if (!returnIsNonNull__) {
6925 return returnValue__;
6927void Activity::SetStatusDisplayType(std::optional<discordpp::StatusDisplayTypes> StatusDisplayType)
6929 assert(state_ == DiscordObjectState::Owned);
6930 Discord_Activity_SetStatusDisplayType(
6932 (StatusDisplayType.has_value()
6933 ?
reinterpret_cast<Discord_StatusDisplayTypes*
>(&*StatusDisplayType)
6936std::optional<std::string> Activity::State()
const
6938 assert(state_ == DiscordObjectState::Owned);
6939 bool returnIsNonNull__;
6940 Discord_String returnValueNative__;
6941 returnIsNonNull__ = Discord_Activity_State(&instance_, &returnValueNative__);
6942 if (!returnIsNonNull__) {
6945 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6946 returnValueNative__.size);
6947 Discord_Free(returnValueNative__.ptr);
6948 return returnValue__;
6950void Activity::SetState(std::optional<std::string> State)
6952 assert(state_ == DiscordObjectState::Owned);
6953 Discord_String State__str{};
6954 if (
State.has_value()) {
6955 State__str.ptr =
reinterpret_cast<uint8_t*
>(
State->data());
6956 State__str.size =
State->size();
6958 Discord_Activity_SetState(&instance_, (
State.has_value() ? &State__str :
nullptr));
6960std::optional<std::string> Activity::StateUrl()
const
6962 assert(state_ == DiscordObjectState::Owned);
6963 bool returnIsNonNull__;
6964 Discord_String returnValueNative__;
6965 returnIsNonNull__ = Discord_Activity_StateUrl(&instance_, &returnValueNative__);
6966 if (!returnIsNonNull__) {
6969 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6970 returnValueNative__.size);
6971 Discord_Free(returnValueNative__.ptr);
6972 return returnValue__;
6974void Activity::SetStateUrl(std::optional<std::string> StateUrl)
6976 assert(state_ == DiscordObjectState::Owned);
6977 Discord_String StateUrl__str{};
6978 if (StateUrl.has_value()) {
6979 StateUrl__str.ptr =
reinterpret_cast<uint8_t*
>(StateUrl->data());
6980 StateUrl__str.size = StateUrl->size();
6982 Discord_Activity_SetStateUrl(&instance_, (StateUrl.has_value() ? &StateUrl__str :
nullptr));
6984std::optional<std::string> Activity::Details()
const
6986 assert(state_ == DiscordObjectState::Owned);
6987 bool returnIsNonNull__;
6988 Discord_String returnValueNative__;
6989 returnIsNonNull__ = Discord_Activity_Details(&instance_, &returnValueNative__);
6990 if (!returnIsNonNull__) {
6993 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6994 returnValueNative__.size);
6995 Discord_Free(returnValueNative__.ptr);
6996 return returnValue__;
6998void Activity::SetDetails(std::optional<std::string> Details)
7000 assert(state_ == DiscordObjectState::Owned);
7001 Discord_String Details__str{};
7003 Details__str.ptr =
reinterpret_cast<uint8_t*
>(
Details->data());
7004 Details__str.size =
Details->size();
7006 Discord_Activity_SetDetails(&instance_, (
Details.has_value() ? &Details__str :
nullptr));
7008std::optional<std::string> Activity::DetailsUrl()
const
7010 assert(state_ == DiscordObjectState::Owned);
7011 bool returnIsNonNull__;
7012 Discord_String returnValueNative__;
7013 returnIsNonNull__ = Discord_Activity_DetailsUrl(&instance_, &returnValueNative__);
7014 if (!returnIsNonNull__) {
7017 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7018 returnValueNative__.size);
7019 Discord_Free(returnValueNative__.ptr);
7020 return returnValue__;
7022void Activity::SetDetailsUrl(std::optional<std::string> DetailsUrl)
7024 assert(state_ == DiscordObjectState::Owned);
7025 Discord_String DetailsUrl__str{};
7026 if (DetailsUrl.has_value()) {
7027 DetailsUrl__str.ptr =
reinterpret_cast<uint8_t*
>(DetailsUrl->data());
7028 DetailsUrl__str.size = DetailsUrl->size();
7030 Discord_Activity_SetDetailsUrl(&instance_,
7031 (DetailsUrl.has_value() ? &DetailsUrl__str :
nullptr));
7033std::optional<uint64_t> Activity::ApplicationId()
const
7035 assert(state_ == DiscordObjectState::Owned);
7036 bool returnIsNonNull__;
7037 uint64_t returnValue__;
7038 returnIsNonNull__ = Discord_Activity_ApplicationId(&instance_, &returnValue__);
7039 if (!returnIsNonNull__) {
7040 return std::nullopt;
7042 return returnValue__;
7044void Activity::SetApplicationId(std::optional<uint64_t> ApplicationId)
7046 assert(state_ == DiscordObjectState::Owned);
7047 Discord_Activity_SetApplicationId(&instance_,
7048 (ApplicationId.has_value() ? &*ApplicationId :
nullptr));
7050std::optional<uint64_t> Activity::ParentApplicationId()
const
7052 assert(state_ == DiscordObjectState::Owned);
7053 bool returnIsNonNull__;
7054 uint64_t returnValue__;
7055 returnIsNonNull__ = Discord_Activity_ParentApplicationId(&instance_, &returnValue__);
7056 if (!returnIsNonNull__) {
7057 return std::nullopt;
7059 return returnValue__;
7061void Activity::SetParentApplicationId(std::optional<uint64_t> ParentApplicationId)
7063 assert(state_ == DiscordObjectState::Owned);
7064 Discord_Activity_SetParentApplicationId(
7065 &instance_, (ParentApplicationId.has_value() ? &*ParentApplicationId :
nullptr));
7067std::optional<discordpp::ActivityAssets> Activity::Assets()
const
7069 assert(state_ == DiscordObjectState::Owned);
7070 bool returnIsNonNull__;
7071 Discord_ActivityAssets returnValueNative__;
7072 returnIsNonNull__ = Discord_Activity_Assets(&instance_, &returnValueNative__);
7073 if (!returnIsNonNull__) {
7077 return returnValue__;
7079void Activity::SetAssets(std::optional<discordpp::ActivityAssets> Assets)
7081 assert(state_ == DiscordObjectState::Owned);
7082 Discord_Activity_SetAssets(&instance_, (Assets.has_value() ? Assets->instance() :
nullptr));
7084std::optional<discordpp::ActivityTimestamps> Activity::Timestamps()
const
7086 assert(state_ == DiscordObjectState::Owned);
7087 bool returnIsNonNull__;
7088 Discord_ActivityTimestamps returnValueNative__;
7089 returnIsNonNull__ = Discord_Activity_Timestamps(&instance_, &returnValueNative__);
7090 if (!returnIsNonNull__) {
7094 return returnValue__;
7096void Activity::SetTimestamps(std::optional<discordpp::ActivityTimestamps> Timestamps)
7098 assert(state_ == DiscordObjectState::Owned);
7099 Discord_Activity_SetTimestamps(&instance_,
7100 (Timestamps.has_value() ? Timestamps->instance() :
nullptr));
7102std::optional<discordpp::ActivityParty> Activity::Party()
const
7104 assert(state_ == DiscordObjectState::Owned);
7105 bool returnIsNonNull__;
7106 Discord_ActivityParty returnValueNative__;
7107 returnIsNonNull__ = Discord_Activity_Party(&instance_, &returnValueNative__);
7108 if (!returnIsNonNull__) {
7112 return returnValue__;
7114void Activity::SetParty(std::optional<discordpp::ActivityParty> Party)
7116 assert(state_ == DiscordObjectState::Owned);
7117 Discord_Activity_SetParty(&instance_, (Party.has_value() ? Party->instance() :
nullptr));
7119std::optional<discordpp::ActivitySecrets> Activity::Secrets()
const
7121 assert(state_ == DiscordObjectState::Owned);
7122 bool returnIsNonNull__;
7123 Discord_ActivitySecrets returnValueNative__;
7124 returnIsNonNull__ = Discord_Activity_Secrets(&instance_, &returnValueNative__);
7125 if (!returnIsNonNull__) {
7129 return returnValue__;
7131void Activity::SetSecrets(std::optional<discordpp::ActivitySecrets> Secrets)
7133 assert(state_ == DiscordObjectState::Owned);
7134 Discord_Activity_SetSecrets(&instance_, (Secrets.has_value() ? Secrets->instance() :
nullptr));
7138 assert(state_ == DiscordObjectState::Owned);
7139 Discord_ActivityGamePlatforms returnValue__;
7140 returnValue__ = Discord_Activity_SupportedPlatforms(&instance_);
7145 assert(state_ == DiscordObjectState::Owned);
7146 Discord_Activity_SetSupportedPlatforms(
7147 &instance_,
static_cast<Discord_ActivityGamePlatforms
>(SupportedPlatforms));
7149const ClientResult ClientResult::nullobj{{}, DiscordObjectState::Invalid};
7150ClientResult::~ClientResult()
7152 if (state_ == DiscordObjectState::Owned) {
7154 state_ = DiscordObjectState::Invalid;
7157ClientResult::ClientResult(ClientResult&& other) noexcept
7158 : instance_(other.instance_)
7159 , state_(other.state_)
7161 other.state_ = DiscordObjectState::Invalid;
7163ClientResult& ClientResult::operator=(ClientResult&& other)
noexcept
7165 if (
this != &other) {
7166 if (state_ == DiscordObjectState::Owned) {
7169 instance_ = other.instance_;
7170 state_ = other.state_;
7171 other.state_ = DiscordObjectState::Invalid;
7175ClientResult::ClientResult(
const ClientResult& arg0)
7180 Discord_ClientResult_Clone(&instance_, arg0.instance());
7182 state_ = DiscordObjectState::Owned;
7185ClientResult& ClientResult::operator=(
const ClientResult& arg0)
7187 if (
this != &arg0) {
7188 if (state_ == DiscordObjectState::Owned) {
7190 state_ = DiscordObjectState::Invalid;
7192 if (arg0.state_ == DiscordObjectState::Owned) {
7193 Discord_ClientResult_Clone(&instance_, arg0.instance());
7195 state_ = DiscordObjectState::Owned;
7200ClientResult::ClientResult(Discord_ClientResult instance, DiscordObjectState state)
7201 : instance_(instance)
7205void ClientResult::Drop()
7207 if (state_ != DiscordObjectState::Owned) {
7210 Discord_ClientResult_Drop(&instance_);
7211 state_ = DiscordObjectState::Invalid;
7213std::string ClientResult::ToString()
const
7215 assert(state_ == DiscordObjectState::Owned);
7216 Discord_String returnValueNative__;
7217 Discord_ClientResult_ToString(&instance_, &returnValueNative__);
7218 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7219 returnValueNative__.size);
7220 Discord_Free(returnValueNative__.ptr);
7221 return returnValue__;
7225 assert(state_ == DiscordObjectState::Owned);
7226 Discord_ErrorType returnValue__;
7227 returnValue__ = Discord_ClientResult_Type(&instance_);
7232 assert(state_ == DiscordObjectState::Owned);
7233 Discord_ClientResult_SetType(&instance_,
static_cast<Discord_ErrorType
>(Type));
7235std::string ClientResult::Error()
const
7237 assert(state_ == DiscordObjectState::Owned);
7238 Discord_String returnValueNative__;
7239 Discord_ClientResult_Error(&instance_, &returnValueNative__);
7240 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7241 returnValueNative__.size);
7242 Discord_Free(returnValueNative__.ptr);
7243 return returnValue__;
7245void ClientResult::SetError(std::string Error)
7247 assert(state_ == DiscordObjectState::Owned);
7248 Discord_String Error__str{(uint8_t*)(
Error.data()),
Error.size()};
7249 Discord_ClientResult_SetError(&instance_, Error__str);
7251int32_t ClientResult::ErrorCode()
const
7253 assert(state_ == DiscordObjectState::Owned);
7254 int32_t returnValue__;
7255 returnValue__ = Discord_ClientResult_ErrorCode(&instance_);
7256 return returnValue__;
7258void ClientResult::SetErrorCode(int32_t ErrorCode)
7260 assert(state_ == DiscordObjectState::Owned);
7261 Discord_ClientResult_SetErrorCode(&instance_, ErrorCode);
7265 assert(state_ == DiscordObjectState::Owned);
7266 Discord_HttpStatusCode returnValue__;
7267 returnValue__ = Discord_ClientResult_Status(&instance_);
7272 assert(state_ == DiscordObjectState::Owned);
7273 Discord_ClientResult_SetStatus(&instance_,
static_cast<Discord_HttpStatusCode
>(Status));
7275std::string ClientResult::ResponseBody()
const
7277 assert(state_ == DiscordObjectState::Owned);
7278 Discord_String returnValueNative__;
7279 Discord_ClientResult_ResponseBody(&instance_, &returnValueNative__);
7280 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7281 returnValueNative__.size);
7282 Discord_Free(returnValueNative__.ptr);
7283 return returnValue__;
7285void ClientResult::SetResponseBody(std::string ResponseBody)
7287 assert(state_ == DiscordObjectState::Owned);
7288 Discord_String ResponseBody__str{(uint8_t*)(ResponseBody.data()), ResponseBody.size()};
7289 Discord_ClientResult_SetResponseBody(&instance_, ResponseBody__str);
7291bool ClientResult::Successful()
const
7293 assert(state_ == DiscordObjectState::Owned);
7295 returnValue__ = Discord_ClientResult_Successful(&instance_);
7296 return returnValue__;
7298void ClientResult::SetSuccessful(
bool Successful)
7300 assert(state_ == DiscordObjectState::Owned);
7301 Discord_ClientResult_SetSuccessful(&instance_, Successful);
7303bool ClientResult::Retryable()
const
7305 assert(state_ == DiscordObjectState::Owned);
7307 returnValue__ = Discord_ClientResult_Retryable(&instance_);
7308 return returnValue__;
7310void ClientResult::SetRetryable(
bool Retryable)
7312 assert(state_ == DiscordObjectState::Owned);
7313 Discord_ClientResult_SetRetryable(&instance_, Retryable);
7315float ClientResult::RetryAfter()
const
7317 assert(state_ == DiscordObjectState::Owned);
7318 float returnValue__;
7319 returnValue__ = Discord_ClientResult_RetryAfter(&instance_);
7320 return returnValue__;
7322void ClientResult::SetRetryAfter(
float RetryAfter)
7324 assert(state_ == DiscordObjectState::Owned);
7325 Discord_ClientResult_SetRetryAfter(&instance_, RetryAfter);
7327const AuthorizationCodeChallenge AuthorizationCodeChallenge::nullobj{{},
7328 DiscordObjectState::Invalid};
7329AuthorizationCodeChallenge::~AuthorizationCodeChallenge()
7331 if (state_ == DiscordObjectState::Owned) {
7333 state_ = DiscordObjectState::Invalid;
7336AuthorizationCodeChallenge::AuthorizationCodeChallenge(AuthorizationCodeChallenge&& other) noexcept
7337 : instance_(other.instance_)
7338 , state_(other.state_)
7340 other.state_ = DiscordObjectState::Invalid;
7342AuthorizationCodeChallenge& AuthorizationCodeChallenge::operator=(
7343 AuthorizationCodeChallenge&& other)
noexcept
7345 if (
this != &other) {
7346 if (state_ == DiscordObjectState::Owned) {
7349 instance_ = other.instance_;
7350 state_ = other.state_;
7351 other.state_ = DiscordObjectState::Invalid;
7355AuthorizationCodeChallenge::AuthorizationCodeChallenge(
const AuthorizationCodeChallenge& arg0)
7360 Discord_AuthorizationCodeChallenge_Clone(&instance_, arg0.instance());
7362 state_ = DiscordObjectState::Owned;
7365AuthorizationCodeChallenge& AuthorizationCodeChallenge::operator=(
7366 const AuthorizationCodeChallenge& arg0)
7368 if (
this != &arg0) {
7369 if (state_ == DiscordObjectState::Owned) {
7371 state_ = DiscordObjectState::Invalid;
7373 if (arg0.state_ == DiscordObjectState::Owned) {
7374 Discord_AuthorizationCodeChallenge_Clone(&instance_, arg0.instance());
7376 state_ = DiscordObjectState::Owned;
7381AuthorizationCodeChallenge::AuthorizationCodeChallenge(Discord_AuthorizationCodeChallenge instance,
7382 DiscordObjectState state)
7383 : instance_(instance)
7387AuthorizationCodeChallenge::AuthorizationCodeChallenge()
7389 assert(state_ == DiscordObjectState::Invalid);
7390 Discord_AuthorizationCodeChallenge_Init(&instance_);
7391 state_ = DiscordObjectState::Owned;
7393void AuthorizationCodeChallenge::Drop()
7395 if (state_ != DiscordObjectState::Owned) {
7398 Discord_AuthorizationCodeChallenge_Drop(&instance_);
7399 state_ = DiscordObjectState::Invalid;
7403 assert(state_ == DiscordObjectState::Owned);
7404 Discord_AuthenticationCodeChallengeMethod returnValue__;
7405 returnValue__ = Discord_AuthorizationCodeChallenge_Method(&instance_);
7410 assert(state_ == DiscordObjectState::Owned);
7411 Discord_AuthorizationCodeChallenge_SetMethod(
7412 &instance_,
static_cast<Discord_AuthenticationCodeChallengeMethod
>(Method));
7414std::string AuthorizationCodeChallenge::Challenge()
const
7416 assert(state_ == DiscordObjectState::Owned);
7417 Discord_String returnValueNative__;
7418 Discord_AuthorizationCodeChallenge_Challenge(&instance_, &returnValueNative__);
7419 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7420 returnValueNative__.size);
7421 Discord_Free(returnValueNative__.ptr);
7422 return returnValue__;
7424void AuthorizationCodeChallenge::SetChallenge(std::string Challenge)
7426 assert(state_ == DiscordObjectState::Owned);
7427 Discord_String Challenge__str{(uint8_t*)(Challenge.data()), Challenge.size()};
7428 Discord_AuthorizationCodeChallenge_SetChallenge(&instance_, Challenge__str);
7430const AuthorizationCodeVerifier AuthorizationCodeVerifier::nullobj{{}, DiscordObjectState::Invalid};
7431AuthorizationCodeVerifier::~AuthorizationCodeVerifier()
7433 if (state_ == DiscordObjectState::Owned) {
7435 state_ = DiscordObjectState::Invalid;
7438AuthorizationCodeVerifier::AuthorizationCodeVerifier(AuthorizationCodeVerifier&& other) noexcept
7439 : instance_(other.instance_)
7440 , state_(other.state_)
7442 other.state_ = DiscordObjectState::Invalid;
7444AuthorizationCodeVerifier& AuthorizationCodeVerifier::operator=(
7445 AuthorizationCodeVerifier&& other)
noexcept
7447 if (
this != &other) {
7448 if (state_ == DiscordObjectState::Owned) {
7451 instance_ = other.instance_;
7452 state_ = other.state_;
7453 other.state_ = DiscordObjectState::Invalid;
7457AuthorizationCodeVerifier::AuthorizationCodeVerifier(
const AuthorizationCodeVerifier& arg0)
7462 Discord_AuthorizationCodeVerifier_Clone(&instance_, arg0.instance());
7464 state_ = DiscordObjectState::Owned;
7467AuthorizationCodeVerifier& AuthorizationCodeVerifier::operator=(
7468 const AuthorizationCodeVerifier& arg0)
7470 if (
this != &arg0) {
7471 if (state_ == DiscordObjectState::Owned) {
7473 state_ = DiscordObjectState::Invalid;
7475 if (arg0.state_ == DiscordObjectState::Owned) {
7476 Discord_AuthorizationCodeVerifier_Clone(&instance_, arg0.instance());
7478 state_ = DiscordObjectState::Owned;
7483AuthorizationCodeVerifier::AuthorizationCodeVerifier(Discord_AuthorizationCodeVerifier instance,
7484 DiscordObjectState state)
7485 : instance_(instance)
7489void AuthorizationCodeVerifier::Drop()
7491 if (state_ != DiscordObjectState::Owned) {
7494 Discord_AuthorizationCodeVerifier_Drop(&instance_);
7495 state_ = DiscordObjectState::Invalid;
7499 assert(state_ == DiscordObjectState::Owned);
7500 Discord_AuthorizationCodeChallenge returnValueNative__{};
7501 Discord_AuthorizationCodeVerifier_Challenge(&instance_, &returnValueNative__);
7503 DiscordObjectState::Owned);
7504 return returnValue__;
7508 assert(state_ == DiscordObjectState::Owned);
7509 Discord_AuthorizationCodeVerifier_SetChallenge(&instance_, Challenge.instance());
7511std::string AuthorizationCodeVerifier::Verifier()
const
7513 assert(state_ == DiscordObjectState::Owned);
7514 Discord_String returnValueNative__;
7515 Discord_AuthorizationCodeVerifier_Verifier(&instance_, &returnValueNative__);
7516 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7517 returnValueNative__.size);
7518 Discord_Free(returnValueNative__.ptr);
7519 return returnValue__;
7521void AuthorizationCodeVerifier::SetVerifier(std::string Verifier)
7523 assert(state_ == DiscordObjectState::Owned);
7524 Discord_String Verifier__str{(uint8_t*)(Verifier.data()), Verifier.size()};
7525 Discord_AuthorizationCodeVerifier_SetVerifier(&instance_, Verifier__str);
7527const AuthorizationArgs AuthorizationArgs::nullobj{{}, DiscordObjectState::Invalid};
7528AuthorizationArgs::~AuthorizationArgs()
7530 if (state_ == DiscordObjectState::Owned) {
7532 state_ = DiscordObjectState::Invalid;
7535AuthorizationArgs::AuthorizationArgs(AuthorizationArgs&& other) noexcept
7536 : instance_(other.instance_)
7537 , state_(other.state_)
7539 other.state_ = DiscordObjectState::Invalid;
7541AuthorizationArgs& AuthorizationArgs::operator=(AuthorizationArgs&& other)
noexcept
7543 if (
this != &other) {
7544 if (state_ == DiscordObjectState::Owned) {
7547 instance_ = other.instance_;
7548 state_ = other.state_;
7549 other.state_ = DiscordObjectState::Invalid;
7553AuthorizationArgs::AuthorizationArgs(
const AuthorizationArgs& arg0)
7558 Discord_AuthorizationArgs_Clone(&instance_, arg0.instance());
7560 state_ = DiscordObjectState::Owned;
7563AuthorizationArgs& AuthorizationArgs::operator=(
const AuthorizationArgs& arg0)
7565 if (
this != &arg0) {
7566 if (state_ == DiscordObjectState::Owned) {
7568 state_ = DiscordObjectState::Invalid;
7570 if (arg0.state_ == DiscordObjectState::Owned) {
7571 Discord_AuthorizationArgs_Clone(&instance_, arg0.instance());
7573 state_ = DiscordObjectState::Owned;
7578AuthorizationArgs::AuthorizationArgs(Discord_AuthorizationArgs instance, DiscordObjectState state)
7579 : instance_(instance)
7583AuthorizationArgs::AuthorizationArgs()
7585 assert(state_ == DiscordObjectState::Invalid);
7586 Discord_AuthorizationArgs_Init(&instance_);
7587 state_ = DiscordObjectState::Owned;
7589void AuthorizationArgs::Drop()
7591 if (state_ != DiscordObjectState::Owned) {
7594 Discord_AuthorizationArgs_Drop(&instance_);
7595 state_ = DiscordObjectState::Invalid;
7597uint64_t AuthorizationArgs::ClientId()
const
7599 assert(state_ == DiscordObjectState::Owned);
7600 uint64_t returnValue__;
7601 returnValue__ = Discord_AuthorizationArgs_ClientId(&instance_);
7602 return returnValue__;
7604void AuthorizationArgs::SetClientId(uint64_t ClientId)
7606 assert(state_ == DiscordObjectState::Owned);
7607 Discord_AuthorizationArgs_SetClientId(&instance_, ClientId);
7609std::string AuthorizationArgs::Scopes()
const
7611 assert(state_ == DiscordObjectState::Owned);
7612 Discord_String returnValueNative__;
7613 Discord_AuthorizationArgs_Scopes(&instance_, &returnValueNative__);
7614 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7615 returnValueNative__.size);
7616 Discord_Free(returnValueNative__.ptr);
7617 return returnValue__;
7619void AuthorizationArgs::SetScopes(std::string Scopes)
7621 assert(state_ == DiscordObjectState::Owned);
7622 Discord_String Scopes__str{(uint8_t*)(Scopes.data()), Scopes.size()};
7623 Discord_AuthorizationArgs_SetScopes(&instance_, Scopes__str);
7625std::optional<std::string> AuthorizationArgs::State()
const
7627 assert(state_ == DiscordObjectState::Owned);
7628 bool returnIsNonNull__;
7629 Discord_String returnValueNative__;
7630 returnIsNonNull__ = Discord_AuthorizationArgs_State(&instance_, &returnValueNative__);
7631 if (!returnIsNonNull__) {
7634 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7635 returnValueNative__.size);
7636 Discord_Free(returnValueNative__.ptr);
7637 return returnValue__;
7639void AuthorizationArgs::SetState(std::optional<std::string> State)
7641 assert(state_ == DiscordObjectState::Owned);
7642 Discord_String State__str{};
7643 if (
State.has_value()) {
7644 State__str.ptr =
reinterpret_cast<uint8_t*
>(
State->data());
7645 State__str.size =
State->size();
7647 Discord_AuthorizationArgs_SetState(&instance_, (
State.has_value() ? &State__str :
nullptr));
7649std::optional<std::string> AuthorizationArgs::Nonce()
const
7651 assert(state_ == DiscordObjectState::Owned);
7652 bool returnIsNonNull__;
7653 Discord_String returnValueNative__;
7654 returnIsNonNull__ = Discord_AuthorizationArgs_Nonce(&instance_, &returnValueNative__);
7655 if (!returnIsNonNull__) {
7658 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7659 returnValueNative__.size);
7660 Discord_Free(returnValueNative__.ptr);
7661 return returnValue__;
7663void AuthorizationArgs::SetNonce(std::optional<std::string> Nonce)
7665 assert(state_ == DiscordObjectState::Owned);
7666 Discord_String Nonce__str{};
7667 if (Nonce.has_value()) {
7668 Nonce__str.ptr =
reinterpret_cast<uint8_t*
>(Nonce->data());
7669 Nonce__str.size = Nonce->size();
7671 Discord_AuthorizationArgs_SetNonce(&instance_, (Nonce.has_value() ? &Nonce__str :
nullptr));
7673std::optional<discordpp::AuthorizationCodeChallenge> AuthorizationArgs::CodeChallenge()
const
7675 assert(state_ == DiscordObjectState::Owned);
7676 bool returnIsNonNull__;
7677 Discord_AuthorizationCodeChallenge returnValueNative__;
7678 returnIsNonNull__ = Discord_AuthorizationArgs_CodeChallenge(&instance_, &returnValueNative__);
7679 if (!returnIsNonNull__) {
7683 DiscordObjectState::Owned);
7684 return returnValue__;
7686void AuthorizationArgs::SetCodeChallenge(
7687 std::optional<discordpp::AuthorizationCodeChallenge> CodeChallenge)
7689 assert(state_ == DiscordObjectState::Owned);
7690 Discord_AuthorizationArgs_SetCodeChallenge(
7691 &instance_, (CodeChallenge.has_value() ? CodeChallenge->instance() :
nullptr));
7693std::optional<discordpp::IntegrationType> AuthorizationArgs::IntegrationType()
const
7695 assert(state_ == DiscordObjectState::Owned);
7696 bool returnIsNonNull__;
7697 Discord_IntegrationType returnValueNative__;
7698 returnIsNonNull__ = Discord_AuthorizationArgs_IntegrationType(&instance_, &returnValueNative__);
7699 if (!returnIsNonNull__) {
7703 return returnValue__;
7705void AuthorizationArgs::SetIntegrationType(
7706 std::optional<discordpp::IntegrationType> IntegrationType)
7708 assert(state_ == DiscordObjectState::Owned);
7709 Discord_AuthorizationArgs_SetIntegrationType(
7711 (
IntegrationType.has_value() ?
reinterpret_cast<Discord_IntegrationType*
>(&*IntegrationType)
7714std::optional<std::string> AuthorizationArgs::CustomSchemeParam()
const
7716 assert(state_ == DiscordObjectState::Owned);
7717 bool returnIsNonNull__;
7718 Discord_String returnValueNative__;
7720 Discord_AuthorizationArgs_CustomSchemeParam(&instance_, &returnValueNative__);
7721 if (!returnIsNonNull__) {
7724 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7725 returnValueNative__.size);
7726 Discord_Free(returnValueNative__.ptr);
7727 return returnValue__;
7729void AuthorizationArgs::SetCustomSchemeParam(std::optional<std::string> CustomSchemeParam)
7731 assert(state_ == DiscordObjectState::Owned);
7732 Discord_String CustomSchemeParam__str{};
7733 if (CustomSchemeParam.has_value()) {
7734 CustomSchemeParam__str.ptr =
reinterpret_cast<uint8_t*
>(CustomSchemeParam->data());
7735 CustomSchemeParam__str.size = CustomSchemeParam->size();
7737 Discord_AuthorizationArgs_SetCustomSchemeParam(
7738 &instance_, (CustomSchemeParam.has_value() ? &CustomSchemeParam__str :
nullptr));
7740const DeviceAuthorizationArgs DeviceAuthorizationArgs::nullobj{{}, DiscordObjectState::Invalid};
7741DeviceAuthorizationArgs::~DeviceAuthorizationArgs()
7743 if (state_ == DiscordObjectState::Owned) {
7745 state_ = DiscordObjectState::Invalid;
7748DeviceAuthorizationArgs::DeviceAuthorizationArgs(DeviceAuthorizationArgs&& other) noexcept
7749 : instance_(other.instance_)
7750 , state_(other.state_)
7752 other.state_ = DiscordObjectState::Invalid;
7754DeviceAuthorizationArgs& DeviceAuthorizationArgs::operator=(
7755 DeviceAuthorizationArgs&& other)
noexcept
7757 if (
this != &other) {
7758 if (state_ == DiscordObjectState::Owned) {
7761 instance_ = other.instance_;
7762 state_ = other.state_;
7763 other.state_ = DiscordObjectState::Invalid;
7767DeviceAuthorizationArgs::DeviceAuthorizationArgs(
const DeviceAuthorizationArgs& arg0)
7772 Discord_DeviceAuthorizationArgs_Clone(&instance_, arg0.instance());
7774 state_ = DiscordObjectState::Owned;
7777DeviceAuthorizationArgs& DeviceAuthorizationArgs::operator=(
const DeviceAuthorizationArgs& arg0)
7779 if (
this != &arg0) {
7780 if (state_ == DiscordObjectState::Owned) {
7782 state_ = DiscordObjectState::Invalid;
7784 if (arg0.state_ == DiscordObjectState::Owned) {
7785 Discord_DeviceAuthorizationArgs_Clone(&instance_, arg0.instance());
7787 state_ = DiscordObjectState::Owned;
7792DeviceAuthorizationArgs::DeviceAuthorizationArgs(Discord_DeviceAuthorizationArgs instance,
7793 DiscordObjectState state)
7794 : instance_(instance)
7798DeviceAuthorizationArgs::DeviceAuthorizationArgs()
7800 assert(state_ == DiscordObjectState::Invalid);
7801 Discord_DeviceAuthorizationArgs_Init(&instance_);
7802 state_ = DiscordObjectState::Owned;
7804void DeviceAuthorizationArgs::Drop()
7806 if (state_ != DiscordObjectState::Owned) {
7809 Discord_DeviceAuthorizationArgs_Drop(&instance_);
7810 state_ = DiscordObjectState::Invalid;
7812uint64_t DeviceAuthorizationArgs::ClientId()
const
7814 assert(state_ == DiscordObjectState::Owned);
7815 uint64_t returnValue__;
7816 returnValue__ = Discord_DeviceAuthorizationArgs_ClientId(&instance_);
7817 return returnValue__;
7819void DeviceAuthorizationArgs::SetClientId(uint64_t ClientId)
7821 assert(state_ == DiscordObjectState::Owned);
7822 Discord_DeviceAuthorizationArgs_SetClientId(&instance_, ClientId);
7824std::string DeviceAuthorizationArgs::Scopes()
const
7826 assert(state_ == DiscordObjectState::Owned);
7827 Discord_String returnValueNative__;
7828 Discord_DeviceAuthorizationArgs_Scopes(&instance_, &returnValueNative__);
7829 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7830 returnValueNative__.size);
7831 Discord_Free(returnValueNative__.ptr);
7832 return returnValue__;
7834void DeviceAuthorizationArgs::SetScopes(std::string Scopes)
7836 assert(state_ == DiscordObjectState::Owned);
7837 Discord_String Scopes__str{(uint8_t*)(Scopes.data()), Scopes.size()};
7838 Discord_DeviceAuthorizationArgs_SetScopes(&instance_, Scopes__str);
7840const VoiceStateHandle VoiceStateHandle::nullobj{{}, DiscordObjectState::Invalid};
7841VoiceStateHandle::~VoiceStateHandle()
7843 if (state_ == DiscordObjectState::Owned) {
7845 state_ = DiscordObjectState::Invalid;
7848VoiceStateHandle::VoiceStateHandle(VoiceStateHandle&& other) noexcept
7849 : instance_(other.instance_)
7850 , state_(other.state_)
7852 other.state_ = DiscordObjectState::Invalid;
7854VoiceStateHandle& VoiceStateHandle::operator=(VoiceStateHandle&& other)
noexcept
7856 if (
this != &other) {
7857 if (state_ == DiscordObjectState::Owned) {
7860 instance_ = other.instance_;
7861 state_ = other.state_;
7862 other.state_ = DiscordObjectState::Invalid;
7866VoiceStateHandle::VoiceStateHandle(
const VoiceStateHandle& other)
7871 Discord_VoiceStateHandle_Clone(&instance_, other.instance());
7873 state_ = DiscordObjectState::Owned;
7876VoiceStateHandle& VoiceStateHandle::operator=(
const VoiceStateHandle& other)
7878 if (
this != &other) {
7879 if (state_ == DiscordObjectState::Owned) {
7881 state_ = DiscordObjectState::Invalid;
7883 if (other.state_ == DiscordObjectState::Owned) {
7884 Discord_VoiceStateHandle_Clone(&instance_, other.instance());
7886 state_ = DiscordObjectState::Owned;
7891VoiceStateHandle::VoiceStateHandle(Discord_VoiceStateHandle instance, DiscordObjectState state)
7892 : instance_(instance)
7896void VoiceStateHandle::Drop()
7898 if (state_ != DiscordObjectState::Owned) {
7901 Discord_VoiceStateHandle_Drop(&instance_);
7902 state_ = DiscordObjectState::Invalid;
7904bool VoiceStateHandle::SelfDeaf()
const
7906 assert(state_ == DiscordObjectState::Owned);
7908 returnValue__ = Discord_VoiceStateHandle_SelfDeaf(&instance_);
7909 return returnValue__;
7911bool VoiceStateHandle::SelfMute()
const
7913 assert(state_ == DiscordObjectState::Owned);
7915 returnValue__ = Discord_VoiceStateHandle_SelfMute(&instance_);
7916 return returnValue__;
7918const VADThresholdSettings VADThresholdSettings::nullobj{{}, DiscordObjectState::Invalid};
7919VADThresholdSettings::~VADThresholdSettings()
7921 if (state_ == DiscordObjectState::Owned) {
7923 state_ = DiscordObjectState::Invalid;
7926VADThresholdSettings::VADThresholdSettings(VADThresholdSettings&& other) noexcept
7927 : instance_(other.instance_)
7928 , state_(other.state_)
7930 other.state_ = DiscordObjectState::Invalid;
7932VADThresholdSettings& VADThresholdSettings::operator=(VADThresholdSettings&& other)
noexcept
7934 if (
this != &other) {
7935 if (state_ == DiscordObjectState::Owned) {
7938 instance_ = other.instance_;
7939 state_ = other.state_;
7940 other.state_ = DiscordObjectState::Invalid;
7944VADThresholdSettings::VADThresholdSettings(Discord_VADThresholdSettings instance,
7945 DiscordObjectState state)
7946 : instance_(instance)
7950void VADThresholdSettings::Drop()
7952 if (state_ != DiscordObjectState::Owned) {
7955 Discord_VADThresholdSettings_Drop(&instance_);
7956 state_ = DiscordObjectState::Invalid;
7958float VADThresholdSettings::VadThreshold()
const
7960 assert(state_ == DiscordObjectState::Owned);
7961 float returnValue__;
7962 returnValue__ = Discord_VADThresholdSettings_VadThreshold(&instance_);
7963 return returnValue__;
7965void VADThresholdSettings::SetVadThreshold(
float VadThreshold)
7967 assert(state_ == DiscordObjectState::Owned);
7968 Discord_VADThresholdSettings_SetVadThreshold(&instance_, VadThreshold);
7970bool VADThresholdSettings::Automatic()
const
7972 assert(state_ == DiscordObjectState::Owned);
7974 returnValue__ = Discord_VADThresholdSettings_Automatic(&instance_);
7975 return returnValue__;
7977void VADThresholdSettings::SetAutomatic(
bool Automatic)
7979 assert(state_ == DiscordObjectState::Owned);
7980 Discord_VADThresholdSettings_SetAutomatic(&instance_, Automatic);
7982const Call Call::nullobj{{}, DiscordObjectState::Invalid};
7985 if (state_ == DiscordObjectState::Owned) {
7987 state_ = DiscordObjectState::Invalid;
7990Call::Call(Call&& other) noexcept
7991 : instance_(other.instance_)
7992 , state_(other.state_)
7994 other.state_ = DiscordObjectState::Invalid;
7996Call& Call::operator=(Call&& other)
noexcept
7998 if (
this != &other) {
7999 if (state_ == DiscordObjectState::Owned) {
8002 instance_ = other.instance_;
8003 state_ = other.state_;
8004 other.state_ = DiscordObjectState::Invalid;
8008Call::Call(
const Call& other)
8013 Discord_Call_Clone(&instance_, other.instance());
8015 state_ = DiscordObjectState::Owned;
8018Call& Call::operator=(
const Call& other)
8020 if (
this != &other) {
8021 if (state_ == DiscordObjectState::Owned) {
8023 state_ = DiscordObjectState::Invalid;
8025 if (other.state_ == DiscordObjectState::Owned) {
8026 Discord_Call_Clone(&instance_, other.instance());
8028 state_ = DiscordObjectState::Owned;
8033Call::Call(Discord_Call instance, DiscordObjectState state)
8034 : instance_(instance)
8040 if (state_ != DiscordObjectState::Owned) {
8043 Discord_Call_Drop(&instance_);
8044 state_ = DiscordObjectState::Invalid;
8048 Discord_String returnValueNative__;
8049 Discord_Call_ErrorToString(
static_cast<Discord_Call_Error
>(type), &returnValueNative__);
8050 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
8051 returnValueNative__.size);
8052 Discord_Free(returnValueNative__.ptr);
8053 return returnValue__;
8057 assert(state_ == DiscordObjectState::Owned);
8058 Discord_AudioModeType returnValue__;
8059 returnValue__ = Discord_Call_GetAudioMode(&instance_);
8062uint64_t Call::GetChannelId()
const
8064 assert(state_ == DiscordObjectState::Owned);
8065 uint64_t returnValue__;
8066 returnValue__ = Discord_Call_GetChannelId(&instance_);
8067 return returnValue__;
8069uint64_t Call::GetGuildId()
const
8071 assert(state_ == DiscordObjectState::Owned);
8072 uint64_t returnValue__;
8073 returnValue__ = Discord_Call_GetGuildId(&instance_);
8074 return returnValue__;
8076bool Call::GetLocalMute(uint64_t userId)
8078 assert(state_ == DiscordObjectState::Owned);
8080 returnValue__ = Discord_Call_GetLocalMute(&instance_, userId);
8081 return returnValue__;
8083std::vector<uint64_t> Call::GetParticipants()
const
8085 assert(state_ == DiscordObjectState::Owned);
8086 Discord_UInt64Span returnValueNative__;
8087 Discord_Call_GetParticipants(&instance_, &returnValueNative__);
8088 std::vector<uint64_t> returnValue__(returnValueNative__.ptr,
8089 returnValueNative__.ptr + returnValueNative__.size);
8090 Discord_Free(returnValueNative__.ptr);
8091 return returnValue__;
8093float Call::GetParticipantVolume(uint64_t userId)
8095 assert(state_ == DiscordObjectState::Owned);
8096 float returnValue__;
8097 returnValue__ = Discord_Call_GetParticipantVolume(&instance_, userId);
8098 return returnValue__;
8100bool Call::GetPTTActive()
8102 assert(state_ == DiscordObjectState::Owned);
8104 returnValue__ = Discord_Call_GetPTTActive(&instance_);
8105 return returnValue__;
8107uint32_t Call::GetPTTReleaseDelay()
8109 assert(state_ == DiscordObjectState::Owned);
8110 uint32_t returnValue__;
8111 returnValue__ = Discord_Call_GetPTTReleaseDelay(&instance_);
8112 return returnValue__;
8114bool Call::GetSelfDeaf()
8116 assert(state_ == DiscordObjectState::Owned);
8118 returnValue__ = Discord_Call_GetSelfDeaf(&instance_);
8119 return returnValue__;
8121bool Call::GetSelfMute()
8123 assert(state_ == DiscordObjectState::Owned);
8125 returnValue__ = Discord_Call_GetSelfMute(&instance_);
8126 return returnValue__;
8130 assert(state_ == DiscordObjectState::Owned);
8131 Discord_Call_Status returnValue__;
8132 returnValue__ = Discord_Call_GetStatus(&instance_);
8137 assert(state_ == DiscordObjectState::Owned);
8138 Discord_VADThresholdSettings returnValueNative__{};
8139 Discord_Call_GetVADThreshold(&instance_, &returnValueNative__);
8141 return returnValue__;
8143std::optional<discordpp::VoiceStateHandle> Call::GetVoiceStateHandle(uint64_t userId)
const
8145 assert(state_ == DiscordObjectState::Owned);
8146 bool returnIsNonNull__;
8147 Discord_VoiceStateHandle returnValueNative__;
8148 returnIsNonNull__ = Discord_Call_GetVoiceStateHandle(&instance_, userId, &returnValueNative__);
8149 if (!returnIsNonNull__) {
8153 return returnValue__;
8157 assert(state_ == DiscordObjectState::Owned);
8158 Discord_Call_SetAudioMode(&instance_,
static_cast<Discord_AudioModeType
>(audioMode));
8160void Call::SetLocalMute(uint64_t userId,
bool mute)
8162 assert(state_ == DiscordObjectState::Owned);
8163 Discord_Call_SetLocalMute(&instance_, userId, mute);
8167 assert(state_ == DiscordObjectState::Owned);
8168 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
8169 auto cb__userData =
new Tcb__UserData(cb);
8170 Discord_Call_OnVoiceStateChanged cb__native = [](
auto userId,
void* userData__) {
8171 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
8172 userData__typed->delegate(userId);
8174 Discord_Call_SetOnVoiceStateChangedCallback(
8175 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
8179 assert(state_ == DiscordObjectState::Owned);
8180 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
8181 auto cb__userData =
new Tcb__UserData(cb);
8182 Discord_Call_OnParticipantChanged cb__native = [](
auto userId,
auto added,
void* userData__) {
8183 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
8184 userData__typed->delegate(userId, added);
8186 Discord_Call_SetParticipantChangedCallback(
8187 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
8189void Call::SetParticipantVolume(uint64_t userId,
float volume)
8191 assert(state_ == DiscordObjectState::Owned);
8192 Discord_Call_SetParticipantVolume(&instance_, userId, volume);
8194void Call::SetPTTActive(
bool active)
8196 assert(state_ == DiscordObjectState::Owned);
8197 Discord_Call_SetPTTActive(&instance_, active);
8199void Call::SetPTTReleaseDelay(uint32_t releaseDelayMs)
8201 assert(state_ == DiscordObjectState::Owned);
8202 Discord_Call_SetPTTReleaseDelay(&instance_, releaseDelayMs);
8204void Call::SetSelfDeaf(
bool deaf)
8206 assert(state_ == DiscordObjectState::Owned);
8207 Discord_Call_SetSelfDeaf(&instance_, deaf);
8209void Call::SetSelfMute(
bool mute)
8211 assert(state_ == DiscordObjectState::Owned);
8212 Discord_Call_SetSelfMute(&instance_, mute);
8216 assert(state_ == DiscordObjectState::Owned);
8217 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
8218 auto cb__userData =
new Tcb__UserData(cb);
8219 Discord_Call_OnSpeakingStatusChanged cb__native =
8220 [](
auto userId,
auto isPlayingSound,
void* userData__) {
8221 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
8222 userData__typed->delegate(userId, isPlayingSound);
8224 Discord_Call_SetSpeakingStatusChangedCallback(
8225 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
8229 assert(state_ == DiscordObjectState::Owned);
8230 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
8231 auto cb__userData =
new Tcb__UserData(cb);
8232 Discord_Call_OnStatusChanged cb__native =
8233 [](
auto status,
auto error,
auto errorDetail,
void* userData__) {
8234 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
8239 Discord_Call_SetStatusChangedCallback(
8240 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
8242void Call::SetVADThreshold(
bool automatic,
float threshold)
8244 assert(state_ == DiscordObjectState::Owned);
8245 Discord_Call_SetVADThreshold(&instance_, automatic, threshold);
8249 Discord_String returnValueNative__;
8250 Discord_Call_StatusToString(
static_cast<Discord_Call_Status
>(type), &returnValueNative__);
8251 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
8252 returnValueNative__.size);
8253 Discord_Free(returnValueNative__.ptr);
8254 return returnValue__;
8256const ChannelHandle ChannelHandle::nullobj{{}, DiscordObjectState::Invalid};
8257ChannelHandle::~ChannelHandle()
8259 if (state_ == DiscordObjectState::Owned) {
8261 state_ = DiscordObjectState::Invalid;
8264ChannelHandle::ChannelHandle(ChannelHandle&& other) noexcept
8265 : instance_(other.instance_)
8266 , state_(other.state_)
8268 other.state_ = DiscordObjectState::Invalid;
8270ChannelHandle& ChannelHandle::operator=(ChannelHandle&& other)
noexcept
8272 if (
this != &other) {
8273 if (state_ == DiscordObjectState::Owned) {
8276 instance_ = other.instance_;
8277 state_ = other.state_;
8278 other.state_ = DiscordObjectState::Invalid;
8282ChannelHandle::ChannelHandle(
const ChannelHandle& other)
8287 Discord_ChannelHandle_Clone(&instance_, other.instance());
8289 state_ = DiscordObjectState::Owned;
8292ChannelHandle& ChannelHandle::operator=(
const ChannelHandle& other)
8294 if (
this != &other) {
8295 if (state_ == DiscordObjectState::Owned) {
8297 state_ = DiscordObjectState::Invalid;
8299 if (other.state_ == DiscordObjectState::Owned) {
8300 Discord_ChannelHandle_Clone(&instance_, other.instance());
8302 state_ = DiscordObjectState::Owned;
8307ChannelHandle::ChannelHandle(Discord_ChannelHandle instance, DiscordObjectState state)
8308 : instance_(instance)
8312void ChannelHandle::Drop()
8314 if (state_ != DiscordObjectState::Owned) {
8317 Discord_ChannelHandle_Drop(&instance_);
8318 state_ = DiscordObjectState::Invalid;
8320uint64_t ChannelHandle::Id()
const
8322 assert(state_ == DiscordObjectState::Owned);
8323 uint64_t returnValue__;
8324 returnValue__ = Discord_ChannelHandle_Id(&instance_);
8325 return returnValue__;
8327std::string ChannelHandle::Name()
const
8329 assert(state_ == DiscordObjectState::Owned);
8330 Discord_String returnValueNative__;
8331 Discord_ChannelHandle_Name(&instance_, &returnValueNative__);
8332 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
8333 returnValueNative__.size);
8334 Discord_Free(returnValueNative__.ptr);
8335 return returnValue__;
8337std::vector<uint64_t> ChannelHandle::Recipients()
const
8339 assert(state_ == DiscordObjectState::Owned);
8340 Discord_UInt64Span returnValueNative__;
8341 Discord_ChannelHandle_Recipients(&instance_, &returnValueNative__);
8342 std::vector<uint64_t> returnValue__(returnValueNative__.ptr,
8343 returnValueNative__.ptr + returnValueNative__.size);
8344 Discord_Free(returnValueNative__.ptr);
8345 return returnValue__;
8349 assert(state_ == DiscordObjectState::Owned);
8350 Discord_ChannelType returnValue__;
8351 returnValue__ = Discord_ChannelHandle_Type(&instance_);
8354const GuildMinimal GuildMinimal::nullobj{{}, DiscordObjectState::Invalid};
8355GuildMinimal::~GuildMinimal()
8357 if (state_ == DiscordObjectState::Owned) {
8359 state_ = DiscordObjectState::Invalid;
8362GuildMinimal::GuildMinimal(GuildMinimal&& other) noexcept
8363 : instance_(other.instance_)
8364 , state_(other.state_)
8366 other.state_ = DiscordObjectState::Invalid;
8368GuildMinimal& GuildMinimal::operator=(GuildMinimal&& other)
noexcept
8370 if (
this != &other) {
8371 if (state_ == DiscordObjectState::Owned) {
8374 instance_ = other.instance_;
8375 state_ = other.state_;
8376 other.state_ = DiscordObjectState::Invalid;
8380GuildMinimal::GuildMinimal(
const GuildMinimal& arg0)
8385 Discord_GuildMinimal_Clone(&instance_, arg0.instance());
8387 state_ = DiscordObjectState::Owned;
8390GuildMinimal& GuildMinimal::operator=(
const GuildMinimal& arg0)
8392 if (
this != &arg0) {
8393 if (state_ == DiscordObjectState::Owned) {
8395 state_ = DiscordObjectState::Invalid;
8397 if (arg0.state_ == DiscordObjectState::Owned) {
8398 Discord_GuildMinimal_Clone(&instance_, arg0.instance());
8400 state_ = DiscordObjectState::Owned;
8405GuildMinimal::GuildMinimal(Discord_GuildMinimal instance, DiscordObjectState state)
8406 : instance_(instance)
8410void GuildMinimal::Drop()
8412 if (state_ != DiscordObjectState::Owned) {
8415 Discord_GuildMinimal_Drop(&instance_);
8416 state_ = DiscordObjectState::Invalid;
8418uint64_t GuildMinimal::Id()
const
8420 assert(state_ == DiscordObjectState::Owned);
8421 uint64_t returnValue__;
8422 returnValue__ = Discord_GuildMinimal_Id(&instance_);
8423 return returnValue__;
8425void GuildMinimal::SetId(uint64_t Id)
8427 assert(state_ == DiscordObjectState::Owned);
8428 Discord_GuildMinimal_SetId(&instance_, Id);
8430std::string GuildMinimal::Name()
const
8432 assert(state_ == DiscordObjectState::Owned);
8433 Discord_String returnValueNative__;
8434 Discord_GuildMinimal_Name(&instance_, &returnValueNative__);
8435 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
8436 returnValueNative__.size);
8437 Discord_Free(returnValueNative__.ptr);
8438 return returnValue__;
8440void GuildMinimal::SetName(std::string Name)
8442 assert(state_ == DiscordObjectState::Owned);
8443 Discord_String Name__str{(uint8_t*)(
Name.data()),
Name.size()};
8444 Discord_GuildMinimal_SetName(&instance_, Name__str);
8446const GuildChannel GuildChannel::nullobj{{}, DiscordObjectState::Invalid};
8447GuildChannel::~GuildChannel()
8449 if (state_ == DiscordObjectState::Owned) {
8451 state_ = DiscordObjectState::Invalid;
8454GuildChannel::GuildChannel(GuildChannel&& other) noexcept
8455 : instance_(other.instance_)
8456 , state_(other.state_)
8458 other.state_ = DiscordObjectState::Invalid;
8460GuildChannel& GuildChannel::operator=(GuildChannel&& other)
noexcept
8462 if (
this != &other) {
8463 if (state_ == DiscordObjectState::Owned) {
8466 instance_ = other.instance_;
8467 state_ = other.state_;
8468 other.state_ = DiscordObjectState::Invalid;
8472GuildChannel::GuildChannel(
const GuildChannel& arg0)
8477 Discord_GuildChannel_Clone(&instance_, arg0.instance());
8479 state_ = DiscordObjectState::Owned;
8482GuildChannel& GuildChannel::operator=(
const GuildChannel& arg0)
8484 if (
this != &arg0) {
8485 if (state_ == DiscordObjectState::Owned) {
8487 state_ = DiscordObjectState::Invalid;
8489 if (arg0.state_ == DiscordObjectState::Owned) {
8490 Discord_GuildChannel_Clone(&instance_, arg0.instance());
8492 state_ = DiscordObjectState::Owned;
8497GuildChannel::GuildChannel(Discord_GuildChannel instance, DiscordObjectState state)
8498 : instance_(instance)
8502void GuildChannel::Drop()
8504 if (state_ != DiscordObjectState::Owned) {
8507 Discord_GuildChannel_Drop(&instance_);
8508 state_ = DiscordObjectState::Invalid;
8510uint64_t GuildChannel::Id()
const
8512 assert(state_ == DiscordObjectState::Owned);
8513 uint64_t returnValue__;
8514 returnValue__ = Discord_GuildChannel_Id(&instance_);
8515 return returnValue__;
8517void GuildChannel::SetId(uint64_t Id)
8519 assert(state_ == DiscordObjectState::Owned);
8520 Discord_GuildChannel_SetId(&instance_, Id);
8522std::string GuildChannel::Name()
const
8524 assert(state_ == DiscordObjectState::Owned);
8525 Discord_String returnValueNative__;
8526 Discord_GuildChannel_Name(&instance_, &returnValueNative__);
8527 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
8528 returnValueNative__.size);
8529 Discord_Free(returnValueNative__.ptr);
8530 return returnValue__;
8532void GuildChannel::SetName(std::string Name)
8534 assert(state_ == DiscordObjectState::Owned);
8535 Discord_String Name__str{(uint8_t*)(
Name.data()),
Name.size()};
8536 Discord_GuildChannel_SetName(&instance_, Name__str);
8540 assert(state_ == DiscordObjectState::Owned);
8541 Discord_ChannelType returnValue__;
8542 returnValue__ = Discord_GuildChannel_Type(&instance_);
8547 assert(state_ == DiscordObjectState::Owned);
8548 Discord_GuildChannel_SetType(&instance_,
static_cast<Discord_ChannelType
>(Type));
8550int32_t GuildChannel::Position()
const
8552 assert(state_ == DiscordObjectState::Owned);
8553 int32_t returnValue__;
8554 returnValue__ = Discord_GuildChannel_Position(&instance_);
8555 return returnValue__;
8557void GuildChannel::SetPosition(int32_t Position)
8559 assert(state_ == DiscordObjectState::Owned);
8560 Discord_GuildChannel_SetPosition(&instance_, Position);
8562std::optional<uint64_t> GuildChannel::ParentId()
const
8564 assert(state_ == DiscordObjectState::Owned);
8565 bool returnIsNonNull__;
8566 uint64_t returnValue__;
8567 returnIsNonNull__ = Discord_GuildChannel_ParentId(&instance_, &returnValue__);
8568 if (!returnIsNonNull__) {
8569 return std::nullopt;
8571 return returnValue__;
8573void GuildChannel::SetParentId(std::optional<uint64_t> ParentId)
8575 assert(state_ == DiscordObjectState::Owned);
8576 Discord_GuildChannel_SetParentId(&instance_, (ParentId.has_value() ? &*ParentId :
nullptr));
8578bool GuildChannel::IsLinkable()
const
8580 assert(state_ == DiscordObjectState::Owned);
8582 returnValue__ = Discord_GuildChannel_IsLinkable(&instance_);
8583 return returnValue__;
8585void GuildChannel::SetIsLinkable(
bool IsLinkable)
8587 assert(state_ == DiscordObjectState::Owned);
8588 Discord_GuildChannel_SetIsLinkable(&instance_, IsLinkable);
8590bool GuildChannel::IsViewableAndWriteableByAllMembers()
const
8592 assert(state_ == DiscordObjectState::Owned);
8594 returnValue__ = Discord_GuildChannel_IsViewableAndWriteableByAllMembers(&instance_);
8595 return returnValue__;
8597void GuildChannel::SetIsViewableAndWriteableByAllMembers(
bool IsViewableAndWriteableByAllMembers)
8599 assert(state_ == DiscordObjectState::Owned);
8600 Discord_GuildChannel_SetIsViewableAndWriteableByAllMembers(&instance_,
8601 IsViewableAndWriteableByAllMembers);
8603std::optional<discordpp::LinkedLobby> GuildChannel::LinkedLobby()
const
8605 assert(state_ == DiscordObjectState::Owned);
8606 bool returnIsNonNull__;
8607 Discord_LinkedLobby returnValueNative__;
8608 returnIsNonNull__ = Discord_GuildChannel_LinkedLobby(&instance_, &returnValueNative__);
8609 if (!returnIsNonNull__) {
8613 return returnValue__;
8615void GuildChannel::SetLinkedLobby(std::optional<discordpp::LinkedLobby> LinkedLobby)
8617 assert(state_ == DiscordObjectState::Owned);
8618 Discord_GuildChannel_SetLinkedLobby(
8619 &instance_, (LinkedLobby.has_value() ? LinkedLobby->instance() :
nullptr));
8621const LinkedLobby LinkedLobby::nullobj{{}, DiscordObjectState::Invalid};
8622LinkedLobby::~LinkedLobby()
8624 if (state_ == DiscordObjectState::Owned) {
8626 state_ = DiscordObjectState::Invalid;
8629LinkedLobby::LinkedLobby(LinkedLobby&& other) noexcept
8630 : instance_(other.instance_)
8631 , state_(other.state_)
8633 other.state_ = DiscordObjectState::Invalid;
8635LinkedLobby& LinkedLobby::operator=(LinkedLobby&& other)
noexcept
8637 if (
this != &other) {
8638 if (state_ == DiscordObjectState::Owned) {
8641 instance_ = other.instance_;
8642 state_ = other.state_;
8643 other.state_ = DiscordObjectState::Invalid;
8647LinkedLobby::LinkedLobby(
const LinkedLobby& arg0)
8652 Discord_LinkedLobby_Clone(&instance_, arg0.instance());
8654 state_ = DiscordObjectState::Owned;
8657LinkedLobby& LinkedLobby::operator=(
const LinkedLobby& arg0)
8659 if (
this != &arg0) {
8660 if (state_ == DiscordObjectState::Owned) {
8662 state_ = DiscordObjectState::Invalid;
8664 if (arg0.state_ == DiscordObjectState::Owned) {
8665 Discord_LinkedLobby_Clone(&instance_, arg0.instance());
8667 state_ = DiscordObjectState::Owned;
8672LinkedLobby::LinkedLobby(Discord_LinkedLobby instance, DiscordObjectState state)
8673 : instance_(instance)
8677LinkedLobby::LinkedLobby()
8679 assert(state_ == DiscordObjectState::Invalid);
8680 Discord_LinkedLobby_Init(&instance_);
8681 state_ = DiscordObjectState::Owned;
8683void LinkedLobby::Drop()
8685 if (state_ != DiscordObjectState::Owned) {
8688 Discord_LinkedLobby_Drop(&instance_);
8689 state_ = DiscordObjectState::Invalid;
8691uint64_t LinkedLobby::ApplicationId()
const
8693 assert(state_ == DiscordObjectState::Owned);
8694 uint64_t returnValue__;
8695 returnValue__ = Discord_LinkedLobby_ApplicationId(&instance_);
8696 return returnValue__;
8698void LinkedLobby::SetApplicationId(uint64_t ApplicationId)
8700 assert(state_ == DiscordObjectState::Owned);
8701 Discord_LinkedLobby_SetApplicationId(&instance_, ApplicationId);
8703uint64_t LinkedLobby::LobbyId()
const
8705 assert(state_ == DiscordObjectState::Owned);
8706 uint64_t returnValue__;
8707 returnValue__ = Discord_LinkedLobby_LobbyId(&instance_);
8708 return returnValue__;
8710void LinkedLobby::SetLobbyId(uint64_t LobbyId)
8712 assert(state_ == DiscordObjectState::Owned);
8713 Discord_LinkedLobby_SetLobbyId(&instance_, LobbyId);
8715const LinkedChannel LinkedChannel::nullobj{{}, DiscordObjectState::Invalid};
8716LinkedChannel::~LinkedChannel()
8718 if (state_ == DiscordObjectState::Owned) {
8720 state_ = DiscordObjectState::Invalid;
8723LinkedChannel::LinkedChannel(LinkedChannel&& other) noexcept
8724 : instance_(other.instance_)
8725 , state_(other.state_)
8727 other.state_ = DiscordObjectState::Invalid;
8729LinkedChannel& LinkedChannel::operator=(LinkedChannel&& other)
noexcept
8731 if (
this != &other) {
8732 if (state_ == DiscordObjectState::Owned) {
8735 instance_ = other.instance_;
8736 state_ = other.state_;
8737 other.state_ = DiscordObjectState::Invalid;
8741LinkedChannel::LinkedChannel(
const LinkedChannel& arg0)
8746 Discord_LinkedChannel_Clone(&instance_, arg0.instance());
8748 state_ = DiscordObjectState::Owned;
8751LinkedChannel& LinkedChannel::operator=(
const LinkedChannel& arg0)
8753 if (
this != &arg0) {
8754 if (state_ == DiscordObjectState::Owned) {
8756 state_ = DiscordObjectState::Invalid;
8758 if (arg0.state_ == DiscordObjectState::Owned) {
8759 Discord_LinkedChannel_Clone(&instance_, arg0.instance());
8761 state_ = DiscordObjectState::Owned;
8766LinkedChannel::LinkedChannel(Discord_LinkedChannel instance, DiscordObjectState state)
8767 : instance_(instance)
8771void LinkedChannel::Drop()
8773 if (state_ != DiscordObjectState::Owned) {
8776 Discord_LinkedChannel_Drop(&instance_);
8777 state_ = DiscordObjectState::Invalid;
8779uint64_t LinkedChannel::Id()
const
8781 assert(state_ == DiscordObjectState::Owned);
8782 uint64_t returnValue__;
8783 returnValue__ = Discord_LinkedChannel_Id(&instance_);
8784 return returnValue__;
8786void LinkedChannel::SetId(uint64_t Id)
8788 assert(state_ == DiscordObjectState::Owned);
8789 Discord_LinkedChannel_SetId(&instance_, Id);
8791std::string LinkedChannel::Name()
const
8793 assert(state_ == DiscordObjectState::Owned);
8794 Discord_String returnValueNative__;
8795 Discord_LinkedChannel_Name(&instance_, &returnValueNative__);
8796 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
8797 returnValueNative__.size);
8798 Discord_Free(returnValueNative__.ptr);
8799 return returnValue__;
8801void LinkedChannel::SetName(std::string Name)
8803 assert(state_ == DiscordObjectState::Owned);
8804 Discord_String Name__str{(uint8_t*)(
Name.data()),
Name.size()};
8805 Discord_LinkedChannel_SetName(&instance_, Name__str);
8807uint64_t LinkedChannel::GuildId()
const
8809 assert(state_ == DiscordObjectState::Owned);
8810 uint64_t returnValue__;
8811 returnValue__ = Discord_LinkedChannel_GuildId(&instance_);
8812 return returnValue__;
8814void LinkedChannel::SetGuildId(uint64_t GuildId)
8816 assert(state_ == DiscordObjectState::Owned);
8817 Discord_LinkedChannel_SetGuildId(&instance_, GuildId);
8819const RelationshipHandle RelationshipHandle::nullobj{{}, DiscordObjectState::Invalid};
8820RelationshipHandle::~RelationshipHandle()
8822 if (state_ == DiscordObjectState::Owned) {
8824 state_ = DiscordObjectState::Invalid;
8827RelationshipHandle::RelationshipHandle(RelationshipHandle&& other) noexcept
8828 : instance_(other.instance_)
8829 , state_(other.state_)
8831 other.state_ = DiscordObjectState::Invalid;
8833RelationshipHandle& RelationshipHandle::operator=(RelationshipHandle&& other)
noexcept
8835 if (
this != &other) {
8836 if (state_ == DiscordObjectState::Owned) {
8839 instance_ = other.instance_;
8840 state_ = other.state_;
8841 other.state_ = DiscordObjectState::Invalid;
8845RelationshipHandle::RelationshipHandle(
const RelationshipHandle& other)
8850 Discord_RelationshipHandle_Clone(&instance_, other.instance());
8852 state_ = DiscordObjectState::Owned;
8855RelationshipHandle& RelationshipHandle::operator=(
const RelationshipHandle& other)
8857 if (
this != &other) {
8858 if (state_ == DiscordObjectState::Owned) {
8860 state_ = DiscordObjectState::Invalid;
8862 if (other.state_ == DiscordObjectState::Owned) {
8863 Discord_RelationshipHandle_Clone(&instance_, other.instance());
8865 state_ = DiscordObjectState::Owned;
8870RelationshipHandle::RelationshipHandle(Discord_RelationshipHandle instance,
8871 DiscordObjectState state)
8872 : instance_(instance)
8876void RelationshipHandle::Drop()
8878 if (state_ != DiscordObjectState::Owned) {
8881 Discord_RelationshipHandle_Drop(&instance_);
8882 state_ = DiscordObjectState::Invalid;
8886 assert(state_ == DiscordObjectState::Owned);
8887 Discord_RelationshipType returnValue__;
8888 returnValue__ = Discord_RelationshipHandle_DiscordRelationshipType(&instance_);
8893 assert(state_ == DiscordObjectState::Owned);
8894 Discord_RelationshipType returnValue__;
8895 returnValue__ = Discord_RelationshipHandle_GameRelationshipType(&instance_);
8898uint64_t RelationshipHandle::Id()
const
8900 assert(state_ == DiscordObjectState::Owned);
8901 uint64_t returnValue__;
8902 returnValue__ = Discord_RelationshipHandle_Id(&instance_);
8903 return returnValue__;
8905bool RelationshipHandle::IsSpamRequest()
const
8907 assert(state_ == DiscordObjectState::Owned);
8909 returnValue__ = Discord_RelationshipHandle_IsSpamRequest(&instance_);
8910 return returnValue__;
8912std::optional<discordpp::UserHandle> RelationshipHandle::User()
const
8914 assert(state_ == DiscordObjectState::Owned);
8915 bool returnIsNonNull__;
8916 Discord_UserHandle returnValueNative__;
8917 returnIsNonNull__ = Discord_RelationshipHandle_User(&instance_, &returnValueNative__);
8918 if (!returnIsNonNull__) {
8922 return returnValue__;
8924const UserApplicationProfileHandle UserApplicationProfileHandle::nullobj{
8926 DiscordObjectState::Invalid};
8927UserApplicationProfileHandle::~UserApplicationProfileHandle()
8929 if (state_ == DiscordObjectState::Owned) {
8931 state_ = DiscordObjectState::Invalid;
8934UserApplicationProfileHandle::UserApplicationProfileHandle(
8935 UserApplicationProfileHandle&& other) noexcept
8936 : instance_(other.instance_)
8937 , state_(other.state_)
8939 other.state_ = DiscordObjectState::Invalid;
8941UserApplicationProfileHandle& UserApplicationProfileHandle::operator=(
8942 UserApplicationProfileHandle&& other)
noexcept
8944 if (
this != &other) {
8945 if (state_ == DiscordObjectState::Owned) {
8948 instance_ = other.instance_;
8949 state_ = other.state_;
8950 other.state_ = DiscordObjectState::Invalid;
8954UserApplicationProfileHandle::UserApplicationProfileHandle(
8955 const UserApplicationProfileHandle& other)
8960 Discord_UserApplicationProfileHandle_Clone(&instance_, other.instance());
8962 state_ = DiscordObjectState::Owned;
8965UserApplicationProfileHandle& UserApplicationProfileHandle::operator=(
8966 const UserApplicationProfileHandle& other)
8968 if (
this != &other) {
8969 if (state_ == DiscordObjectState::Owned) {
8971 state_ = DiscordObjectState::Invalid;
8973 if (other.state_ == DiscordObjectState::Owned) {
8974 Discord_UserApplicationProfileHandle_Clone(&instance_, other.instance());
8976 state_ = DiscordObjectState::Owned;
8981UserApplicationProfileHandle::UserApplicationProfileHandle(
8982 Discord_UserApplicationProfileHandle instance,
8983 DiscordObjectState state)
8984 : instance_(instance)
8988void UserApplicationProfileHandle::Drop()
8990 if (state_ != DiscordObjectState::Owned) {
8993 Discord_UserApplicationProfileHandle_Drop(&instance_);
8994 state_ = DiscordObjectState::Invalid;
8996std::string UserApplicationProfileHandle::AvatarHash()
const
8998 assert(state_ == DiscordObjectState::Owned);
8999 Discord_String returnValueNative__;
9000 Discord_UserApplicationProfileHandle_AvatarHash(&instance_, &returnValueNative__);
9001 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
9002 returnValueNative__.size);
9003 Discord_Free(returnValueNative__.ptr);
9004 return returnValue__;
9006std::string UserApplicationProfileHandle::Metadata()
const
9008 assert(state_ == DiscordObjectState::Owned);
9009 Discord_String returnValueNative__;
9010 Discord_UserApplicationProfileHandle_Metadata(&instance_, &returnValueNative__);
9011 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
9012 returnValueNative__.size);
9013 Discord_Free(returnValueNative__.ptr);
9014 return returnValue__;
9016std::optional<std::string> UserApplicationProfileHandle::ProviderId()
const
9018 assert(state_ == DiscordObjectState::Owned);
9019 bool returnIsNonNull__;
9020 Discord_String returnValueNative__;
9022 Discord_UserApplicationProfileHandle_ProviderId(&instance_, &returnValueNative__);
9023 if (!returnIsNonNull__) {
9026 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
9027 returnValueNative__.size);
9028 Discord_Free(returnValueNative__.ptr);
9029 return returnValue__;
9031std::string UserApplicationProfileHandle::ProviderIssuedUserId()
const
9033 assert(state_ == DiscordObjectState::Owned);
9034 Discord_String returnValueNative__;
9035 Discord_UserApplicationProfileHandle_ProviderIssuedUserId(&instance_, &returnValueNative__);
9036 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
9037 returnValueNative__.size);
9038 Discord_Free(returnValueNative__.ptr);
9039 return returnValue__;
9043 assert(state_ == DiscordObjectState::Owned);
9044 Discord_ExternalIdentityProviderType returnValue__;
9045 returnValue__ = Discord_UserApplicationProfileHandle_ProviderType(&instance_);
9048std::string UserApplicationProfileHandle::Username()
const
9050 assert(state_ == DiscordObjectState::Owned);
9051 Discord_String returnValueNative__;
9052 Discord_UserApplicationProfileHandle_Username(&instance_, &returnValueNative__);
9053 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
9054 returnValueNative__.size);
9055 Discord_Free(returnValueNative__.ptr);
9056 return returnValue__;
9058const UserHandle UserHandle::nullobj{{}, DiscordObjectState::Invalid};
9059UserHandle::~UserHandle()
9061 if (state_ == DiscordObjectState::Owned) {
9063 state_ = DiscordObjectState::Invalid;
9066UserHandle::UserHandle(UserHandle&& other) noexcept
9067 : instance_(other.instance_)
9068 , state_(other.state_)
9070 other.state_ = DiscordObjectState::Invalid;
9072UserHandle& UserHandle::operator=(UserHandle&& other)
noexcept
9074 if (
this != &other) {
9075 if (state_ == DiscordObjectState::Owned) {
9078 instance_ = other.instance_;
9079 state_ = other.state_;
9080 other.state_ = DiscordObjectState::Invalid;
9084UserHandle::UserHandle(
const UserHandle& arg0)
9089 Discord_UserHandle_Clone(&instance_, arg0.instance());
9091 state_ = DiscordObjectState::Owned;
9094UserHandle& UserHandle::operator=(
const UserHandle& arg0)
9096 if (
this != &arg0) {
9097 if (state_ == DiscordObjectState::Owned) {
9099 state_ = DiscordObjectState::Invalid;
9101 if (arg0.state_ == DiscordObjectState::Owned) {
9102 Discord_UserHandle_Clone(&instance_, arg0.instance());
9104 state_ = DiscordObjectState::Owned;
9109UserHandle::UserHandle(Discord_UserHandle instance, DiscordObjectState state)
9110 : instance_(instance)
9114void UserHandle::Drop()
9116 if (state_ != DiscordObjectState::Owned) {
9119 Discord_UserHandle_Drop(&instance_);
9120 state_ = DiscordObjectState::Invalid;
9122std::optional<std::string> UserHandle::Avatar()
const
9124 assert(state_ == DiscordObjectState::Owned);
9125 bool returnIsNonNull__;
9126 Discord_String returnValueNative__;
9127 returnIsNonNull__ = Discord_UserHandle_Avatar(&instance_, &returnValueNative__);
9128 if (!returnIsNonNull__) {
9131 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
9132 returnValueNative__.size);
9133 Discord_Free(returnValueNative__.ptr);
9134 return returnValue__;
9138 Discord_String returnValueNative__;
9139 Discord_UserHandle_AvatarTypeToString(
static_cast<Discord_UserHandle_AvatarType
>(type),
9140 &returnValueNative__);
9141 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
9142 returnValueNative__.size);
9143 Discord_Free(returnValueNative__.ptr);
9144 return returnValue__;
9149 assert(state_ == DiscordObjectState::Owned);
9150 Discord_String returnValueNative__;
9151 Discord_UserHandle_AvatarUrl(&instance_,
9152 static_cast<Discord_UserHandle_AvatarType
>(animatedType),
9153 static_cast<Discord_UserHandle_AvatarType
>(staticType),
9154 &returnValueNative__);
9155 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
9156 returnValueNative__.size);
9157 Discord_Free(returnValueNative__.ptr);
9158 return returnValue__;
9160std::string UserHandle::DisplayName()
const
9162 assert(state_ == DiscordObjectState::Owned);
9163 Discord_String returnValueNative__;
9164 Discord_UserHandle_DisplayName(&instance_, &returnValueNative__);
9165 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
9166 returnValueNative__.size);
9167 Discord_Free(returnValueNative__.ptr);
9168 return returnValue__;
9170std::optional<discordpp::Activity> UserHandle::GameActivity()
const
9172 assert(state_ == DiscordObjectState::Owned);
9173 bool returnIsNonNull__;
9174 Discord_Activity returnValueNative__;
9175 returnIsNonNull__ = Discord_UserHandle_GameActivity(&instance_, &returnValueNative__);
9176 if (!returnIsNonNull__) {
9180 return returnValue__;
9182std::optional<std::string> UserHandle::GlobalName()
const
9184 assert(state_ == DiscordObjectState::Owned);
9185 bool returnIsNonNull__;
9186 Discord_String returnValueNative__;
9187 returnIsNonNull__ = Discord_UserHandle_GlobalName(&instance_, &returnValueNative__);
9188 if (!returnIsNonNull__) {
9191 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
9192 returnValueNative__.size);
9193 Discord_Free(returnValueNative__.ptr);
9194 return returnValue__;
9196uint64_t UserHandle::Id()
const
9198 assert(state_ == DiscordObjectState::Owned);
9199 uint64_t returnValue__;
9200 returnValue__ = Discord_UserHandle_Id(&instance_);
9201 return returnValue__;
9203bool UserHandle::IsProvisional()
const
9205 assert(state_ == DiscordObjectState::Owned);
9207 returnValue__ = Discord_UserHandle_IsProvisional(&instance_);
9208 return returnValue__;
9212 assert(state_ == DiscordObjectState::Owned);
9213 Discord_RelationshipHandle returnValueNative__{};
9214 Discord_UserHandle_Relationship(&instance_, &returnValueNative__);
9216 return returnValue__;
9220 assert(state_ == DiscordObjectState::Owned);
9221 Discord_StatusType returnValue__;
9222 returnValue__ = Discord_UserHandle_Status(&instance_);
9225std::vector<discordpp::UserApplicationProfileHandle> UserHandle::UserApplicationProfiles()
const
9227 assert(state_ == DiscordObjectState::Owned);
9228 Discord_UserApplicationProfileHandleSpan returnValueNative__;
9229 Discord_UserHandle_UserApplicationProfiles(&instance_, &returnValueNative__);
9230 std::vector<discordpp::UserApplicationProfileHandle> returnValue__;
9231 returnValue__.reserve(returnValueNative__.size);
9232 for (
size_t i__ = 0; i__ < returnValueNative__.size; ++i__) {
9233 returnValue__.emplace_back(returnValueNative__.ptr[i__], DiscordObjectState::Owned);
9235 Discord_Free(returnValueNative__.ptr);
9236 return returnValue__;
9238std::string UserHandle::Username()
const
9240 assert(state_ == DiscordObjectState::Owned);
9241 Discord_String returnValueNative__;
9242 Discord_UserHandle_Username(&instance_, &returnValueNative__);
9243 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
9244 returnValueNative__.size);
9245 Discord_Free(returnValueNative__.ptr);
9246 return returnValue__;
9248const LobbyMemberHandle LobbyMemberHandle::nullobj{{}, DiscordObjectState::Invalid};
9249LobbyMemberHandle::~LobbyMemberHandle()
9251 if (state_ == DiscordObjectState::Owned) {
9253 state_ = DiscordObjectState::Invalid;
9256LobbyMemberHandle::LobbyMemberHandle(LobbyMemberHandle&& other) noexcept
9257 : instance_(other.instance_)
9258 , state_(other.state_)
9260 other.state_ = DiscordObjectState::Invalid;
9262LobbyMemberHandle& LobbyMemberHandle::operator=(LobbyMemberHandle&& other)
noexcept
9264 if (
this != &other) {
9265 if (state_ == DiscordObjectState::Owned) {
9268 instance_ = other.instance_;
9269 state_ = other.state_;
9270 other.state_ = DiscordObjectState::Invalid;
9274LobbyMemberHandle::LobbyMemberHandle(
const LobbyMemberHandle& other)
9279 Discord_LobbyMemberHandle_Clone(&instance_, other.instance());
9281 state_ = DiscordObjectState::Owned;
9284LobbyMemberHandle& LobbyMemberHandle::operator=(
const LobbyMemberHandle& other)
9286 if (
this != &other) {
9287 if (state_ == DiscordObjectState::Owned) {
9289 state_ = DiscordObjectState::Invalid;
9291 if (other.state_ == DiscordObjectState::Owned) {
9292 Discord_LobbyMemberHandle_Clone(&instance_, other.instance());
9294 state_ = DiscordObjectState::Owned;
9299LobbyMemberHandle::LobbyMemberHandle(Discord_LobbyMemberHandle instance, DiscordObjectState state)
9300 : instance_(instance)
9304void LobbyMemberHandle::Drop()
9306 if (state_ != DiscordObjectState::Owned) {
9309 Discord_LobbyMemberHandle_Drop(&instance_);
9310 state_ = DiscordObjectState::Invalid;
9312bool LobbyMemberHandle::CanLinkLobby()
const
9314 assert(state_ == DiscordObjectState::Owned);
9316 returnValue__ = Discord_LobbyMemberHandle_CanLinkLobby(&instance_);
9317 return returnValue__;
9319bool LobbyMemberHandle::Connected()
const
9321 assert(state_ == DiscordObjectState::Owned);
9323 returnValue__ = Discord_LobbyMemberHandle_Connected(&instance_);
9324 return returnValue__;
9326uint64_t LobbyMemberHandle::Id()
const
9328 assert(state_ == DiscordObjectState::Owned);
9329 uint64_t returnValue__;
9330 returnValue__ = Discord_LobbyMemberHandle_Id(&instance_);
9331 return returnValue__;
9333std::unordered_map<std::string, std::string> LobbyMemberHandle::Metadata()
const
9335 assert(state_ == DiscordObjectState::Owned);
9336 Discord_Properties returnValueNative__;
9337 Discord_LobbyMemberHandle_Metadata(&instance_, &returnValueNative__);
9338 std::unordered_map<std::string, std::string> returnValue__ =
9339 ConvertReturnedProperties(returnValueNative__);
9340 Discord_FreeProperties(returnValueNative__);
9341 return returnValue__;
9343std::optional<discordpp::UserHandle> LobbyMemberHandle::User()
const
9345 assert(state_ == DiscordObjectState::Owned);
9346 bool returnIsNonNull__;
9347 Discord_UserHandle returnValueNative__;
9348 returnIsNonNull__ = Discord_LobbyMemberHandle_User(&instance_, &returnValueNative__);
9349 if (!returnIsNonNull__) {
9353 return returnValue__;
9355const LobbyHandle LobbyHandle::nullobj{{}, DiscordObjectState::Invalid};
9356LobbyHandle::~LobbyHandle()
9358 if (state_ == DiscordObjectState::Owned) {
9360 state_ = DiscordObjectState::Invalid;
9363LobbyHandle::LobbyHandle(LobbyHandle&& other) noexcept
9364 : instance_(other.instance_)
9365 , state_(other.state_)
9367 other.state_ = DiscordObjectState::Invalid;
9369LobbyHandle& LobbyHandle::operator=(LobbyHandle&& other)
noexcept
9371 if (
this != &other) {
9372 if (state_ == DiscordObjectState::Owned) {
9375 instance_ = other.instance_;
9376 state_ = other.state_;
9377 other.state_ = DiscordObjectState::Invalid;
9381LobbyHandle::LobbyHandle(
const LobbyHandle& other)
9386 Discord_LobbyHandle_Clone(&instance_, other.instance());
9388 state_ = DiscordObjectState::Owned;
9391LobbyHandle& LobbyHandle::operator=(
const LobbyHandle& other)
9393 if (
this != &other) {
9394 if (state_ == DiscordObjectState::Owned) {
9396 state_ = DiscordObjectState::Invalid;
9398 if (other.state_ == DiscordObjectState::Owned) {
9399 Discord_LobbyHandle_Clone(&instance_, other.instance());
9401 state_ = DiscordObjectState::Owned;
9406LobbyHandle::LobbyHandle(Discord_LobbyHandle instance, DiscordObjectState state)
9407 : instance_(instance)
9411void LobbyHandle::Drop()
9413 if (state_ != DiscordObjectState::Owned) {
9416 Discord_LobbyHandle_Drop(&instance_);
9417 state_ = DiscordObjectState::Invalid;
9419std::optional<discordpp::CallInfoHandle> LobbyHandle::GetCallInfoHandle()
const
9421 assert(state_ == DiscordObjectState::Owned);
9422 bool returnIsNonNull__;
9423 Discord_CallInfoHandle returnValueNative__;
9424 returnIsNonNull__ = Discord_LobbyHandle_GetCallInfoHandle(&instance_, &returnValueNative__);
9425 if (!returnIsNonNull__) {
9429 return returnValue__;
9431std::optional<discordpp::LobbyMemberHandle> LobbyHandle::GetLobbyMemberHandle(
9432 uint64_t memberId)
const
9434 assert(state_ == DiscordObjectState::Owned);
9435 bool returnIsNonNull__;
9436 Discord_LobbyMemberHandle returnValueNative__;
9438 Discord_LobbyHandle_GetLobbyMemberHandle(&instance_, memberId, &returnValueNative__);
9439 if (!returnIsNonNull__) {
9443 return returnValue__;
9445uint64_t LobbyHandle::Id()
const
9447 assert(state_ == DiscordObjectState::Owned);
9448 uint64_t returnValue__;
9449 returnValue__ = Discord_LobbyHandle_Id(&instance_);
9450 return returnValue__;
9452std::optional<discordpp::LinkedChannel> LobbyHandle::LinkedChannel()
const
9454 assert(state_ == DiscordObjectState::Owned);
9455 bool returnIsNonNull__;
9456 Discord_LinkedChannel returnValueNative__;
9457 returnIsNonNull__ = Discord_LobbyHandle_LinkedChannel(&instance_, &returnValueNative__);
9458 if (!returnIsNonNull__) {
9462 return returnValue__;
9464std::vector<uint64_t> LobbyHandle::LobbyMemberIds()
const
9466 assert(state_ == DiscordObjectState::Owned);
9467 Discord_UInt64Span returnValueNative__;
9468 Discord_LobbyHandle_LobbyMemberIds(&instance_, &returnValueNative__);
9469 std::vector<uint64_t> returnValue__(returnValueNative__.ptr,
9470 returnValueNative__.ptr + returnValueNative__.size);
9471 Discord_Free(returnValueNative__.ptr);
9472 return returnValue__;
9474std::vector<discordpp::LobbyMemberHandle> LobbyHandle::LobbyMembers()
const
9476 assert(state_ == DiscordObjectState::Owned);
9477 Discord_LobbyMemberHandleSpan returnValueNative__;
9478 Discord_LobbyHandle_LobbyMembers(&instance_, &returnValueNative__);
9479 std::vector<discordpp::LobbyMemberHandle> returnValue__;
9480 returnValue__.reserve(returnValueNative__.size);
9481 for (
size_t i__ = 0; i__ < returnValueNative__.size; ++i__) {
9482 returnValue__.emplace_back(returnValueNative__.ptr[i__], DiscordObjectState::Owned);
9484 Discord_Free(returnValueNative__.ptr);
9485 return returnValue__;
9487std::unordered_map<std::string, std::string> LobbyHandle::Metadata()
const
9489 assert(state_ == DiscordObjectState::Owned);
9490 Discord_Properties returnValueNative__;
9491 Discord_LobbyHandle_Metadata(&instance_, &returnValueNative__);
9492 std::unordered_map<std::string, std::string> returnValue__ =
9493 ConvertReturnedProperties(returnValueNative__);
9494 Discord_FreeProperties(returnValueNative__);
9495 return returnValue__;
9497const AdditionalContent AdditionalContent::nullobj{{}, DiscordObjectState::Invalid};
9498AdditionalContent::~AdditionalContent()
9500 if (state_ == DiscordObjectState::Owned) {
9502 state_ = DiscordObjectState::Invalid;
9505AdditionalContent::AdditionalContent(AdditionalContent&& other) noexcept
9506 : instance_(other.instance_)
9507 , state_(other.state_)
9509 other.state_ = DiscordObjectState::Invalid;
9511AdditionalContent& AdditionalContent::operator=(AdditionalContent&& other)
noexcept
9513 if (
this != &other) {
9514 if (state_ == DiscordObjectState::Owned) {
9517 instance_ = other.instance_;
9518 state_ = other.state_;
9519 other.state_ = DiscordObjectState::Invalid;
9523AdditionalContent::AdditionalContent(
const AdditionalContent& arg0)
9528 Discord_AdditionalContent_Clone(&instance_, arg0.instance());
9530 state_ = DiscordObjectState::Owned;
9533AdditionalContent& AdditionalContent::operator=(
const AdditionalContent& arg0)
9535 if (
this != &arg0) {
9536 if (state_ == DiscordObjectState::Owned) {
9538 state_ = DiscordObjectState::Invalid;
9540 if (arg0.state_ == DiscordObjectState::Owned) {
9541 Discord_AdditionalContent_Clone(&instance_, arg0.instance());
9543 state_ = DiscordObjectState::Owned;
9548AdditionalContent::AdditionalContent(Discord_AdditionalContent instance, DiscordObjectState state)
9549 : instance_(instance)
9553AdditionalContent::AdditionalContent()
9555 assert(state_ == DiscordObjectState::Invalid);
9556 Discord_AdditionalContent_Init(&instance_);
9557 state_ = DiscordObjectState::Owned;
9559void AdditionalContent::Drop()
9561 if (state_ != DiscordObjectState::Owned) {
9564 Discord_AdditionalContent_Drop(&instance_);
9565 state_ = DiscordObjectState::Invalid;
9569 assert(state_ == DiscordObjectState::Owned);
9571 returnValue__ = Discord_AdditionalContent_Equals(&instance_, rhs.instance());
9572 return returnValue__;
9576 Discord_String returnValueNative__;
9577 Discord_AdditionalContent_TypeToString(
static_cast<Discord_AdditionalContentType
>(type),
9578 &returnValueNative__);
9579 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
9580 returnValueNative__.size);
9581 Discord_Free(returnValueNative__.ptr);
9582 return returnValue__;
9586 assert(state_ == DiscordObjectState::Owned);
9587 Discord_AdditionalContentType returnValue__;
9588 returnValue__ = Discord_AdditionalContent_Type(&instance_);
9593 assert(state_ == DiscordObjectState::Owned);
9594 Discord_AdditionalContent_SetType(&instance_,
static_cast<Discord_AdditionalContentType
>(Type));
9596std::optional<std::string> AdditionalContent::Title()
const
9598 assert(state_ == DiscordObjectState::Owned);
9599 bool returnIsNonNull__;
9600 Discord_String returnValueNative__;
9601 returnIsNonNull__ = Discord_AdditionalContent_Title(&instance_, &returnValueNative__);
9602 if (!returnIsNonNull__) {
9605 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
9606 returnValueNative__.size);
9607 Discord_Free(returnValueNative__.ptr);
9608 return returnValue__;
9610void AdditionalContent::SetTitle(std::optional<std::string> Title)
9612 assert(state_ == DiscordObjectState::Owned);
9613 Discord_String Title__str{};
9614 if (Title.has_value()) {
9615 Title__str.ptr =
reinterpret_cast<uint8_t*
>(Title->data());
9616 Title__str.size = Title->size();
9618 Discord_AdditionalContent_SetTitle(&instance_, (Title.has_value() ? &Title__str :
nullptr));
9620uint8_t AdditionalContent::Count()
const
9622 assert(state_ == DiscordObjectState::Owned);
9623 uint8_t returnValue__;
9624 returnValue__ = Discord_AdditionalContent_Count(&instance_);
9625 return returnValue__;
9627void AdditionalContent::SetCount(uint8_t Count)
9629 assert(state_ == DiscordObjectState::Owned);
9630 Discord_AdditionalContent_SetCount(&instance_, Count);
9632const MessageHandle MessageHandle::nullobj{{}, DiscordObjectState::Invalid};
9633MessageHandle::~MessageHandle()
9635 if (state_ == DiscordObjectState::Owned) {
9637 state_ = DiscordObjectState::Invalid;
9640MessageHandle::MessageHandle(MessageHandle&& other) noexcept
9641 : instance_(other.instance_)
9642 , state_(other.state_)
9644 other.state_ = DiscordObjectState::Invalid;
9646MessageHandle& MessageHandle::operator=(MessageHandle&& other)
noexcept
9648 if (
this != &other) {
9649 if (state_ == DiscordObjectState::Owned) {
9652 instance_ = other.instance_;
9653 state_ = other.state_;
9654 other.state_ = DiscordObjectState::Invalid;
9658MessageHandle::MessageHandle(
const MessageHandle& other)
9663 Discord_MessageHandle_Clone(&instance_, other.instance());
9665 state_ = DiscordObjectState::Owned;
9668MessageHandle& MessageHandle::operator=(
const MessageHandle& other)
9670 if (
this != &other) {
9671 if (state_ == DiscordObjectState::Owned) {
9673 state_ = DiscordObjectState::Invalid;
9675 if (other.state_ == DiscordObjectState::Owned) {
9676 Discord_MessageHandle_Clone(&instance_, other.instance());
9678 state_ = DiscordObjectState::Owned;
9683MessageHandle::MessageHandle(Discord_MessageHandle instance, DiscordObjectState state)
9684 : instance_(instance)
9688void MessageHandle::Drop()
9690 if (state_ != DiscordObjectState::Owned) {
9693 Discord_MessageHandle_Drop(&instance_);
9694 state_ = DiscordObjectState::Invalid;
9696std::optional<discordpp::AdditionalContent> MessageHandle::AdditionalContent()
const
9698 assert(state_ == DiscordObjectState::Owned);
9699 bool returnIsNonNull__;
9700 Discord_AdditionalContent returnValueNative__;
9701 returnIsNonNull__ = Discord_MessageHandle_AdditionalContent(&instance_, &returnValueNative__);
9702 if (!returnIsNonNull__) {
9706 return returnValue__;
9708std::optional<uint64_t> MessageHandle::ApplicationId()
const
9710 assert(state_ == DiscordObjectState::Owned);
9711 bool returnIsNonNull__;
9712 uint64_t returnValue__;
9713 returnIsNonNull__ = Discord_MessageHandle_ApplicationId(&instance_, &returnValue__);
9714 if (!returnIsNonNull__) {
9715 return std::nullopt;
9717 return returnValue__;
9719std::optional<discordpp::UserHandle> MessageHandle::Author()
const
9721 assert(state_ == DiscordObjectState::Owned);
9722 bool returnIsNonNull__;
9723 Discord_UserHandle returnValueNative__;
9724 returnIsNonNull__ = Discord_MessageHandle_Author(&instance_, &returnValueNative__);
9725 if (!returnIsNonNull__) {
9729 return returnValue__;
9731uint64_t MessageHandle::AuthorId()
const
9733 assert(state_ == DiscordObjectState::Owned);
9734 uint64_t returnValue__;
9735 returnValue__ = Discord_MessageHandle_AuthorId(&instance_);
9736 return returnValue__;
9738std::optional<discordpp::ChannelHandle> MessageHandle::Channel()
const
9740 assert(state_ == DiscordObjectState::Owned);
9741 bool returnIsNonNull__;
9742 Discord_ChannelHandle returnValueNative__;
9743 returnIsNonNull__ = Discord_MessageHandle_Channel(&instance_, &returnValueNative__);
9744 if (!returnIsNonNull__) {
9748 return returnValue__;
9750uint64_t MessageHandle::ChannelId()
const
9752 assert(state_ == DiscordObjectState::Owned);
9753 uint64_t returnValue__;
9754 returnValue__ = Discord_MessageHandle_ChannelId(&instance_);
9755 return returnValue__;
9757std::string MessageHandle::Content()
const
9759 assert(state_ == DiscordObjectState::Owned);
9760 Discord_String returnValueNative__;
9761 Discord_MessageHandle_Content(&instance_, &returnValueNative__);
9762 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
9763 returnValueNative__.size);
9764 Discord_Free(returnValueNative__.ptr);
9765 return returnValue__;
9767std::optional<discordpp::DisclosureTypes> MessageHandle::DisclosureType()
const
9769 assert(state_ == DiscordObjectState::Owned);
9770 bool returnIsNonNull__;
9771 Discord_DisclosureTypes returnValueNative__;
9772 returnIsNonNull__ = Discord_MessageHandle_DisclosureType(&instance_, &returnValueNative__);
9773 if (!returnIsNonNull__) {
9777 return returnValue__;
9779uint64_t MessageHandle::EditedTimestamp()
const
9781 assert(state_ == DiscordObjectState::Owned);
9782 uint64_t returnValue__;
9783 returnValue__ = Discord_MessageHandle_EditedTimestamp(&instance_);
9784 return returnValue__;
9786uint64_t MessageHandle::Id()
const
9788 assert(state_ == DiscordObjectState::Owned);
9789 uint64_t returnValue__;
9790 returnValue__ = Discord_MessageHandle_Id(&instance_);
9791 return returnValue__;
9793std::optional<discordpp::LobbyHandle> MessageHandle::Lobby()
const
9795 assert(state_ == DiscordObjectState::Owned);
9796 bool returnIsNonNull__;
9797 Discord_LobbyHandle returnValueNative__;
9798 returnIsNonNull__ = Discord_MessageHandle_Lobby(&instance_, &returnValueNative__);
9799 if (!returnIsNonNull__) {
9803 return returnValue__;
9805std::unordered_map<std::string, std::string> MessageHandle::Metadata()
const
9807 assert(state_ == DiscordObjectState::Owned);
9808 Discord_Properties returnValueNative__;
9809 Discord_MessageHandle_Metadata(&instance_, &returnValueNative__);
9810 std::unordered_map<std::string, std::string> returnValue__ =
9811 ConvertReturnedProperties(returnValueNative__);
9812 Discord_FreeProperties(returnValueNative__);
9813 return returnValue__;
9815std::unordered_map<std::string, std::string> MessageHandle::ModerationMetadata()
const
9817 assert(state_ == DiscordObjectState::Owned);
9818 Discord_Properties returnValueNative__;
9819 Discord_MessageHandle_ModerationMetadata(&instance_, &returnValueNative__);
9820 std::unordered_map<std::string, std::string> returnValue__ =
9821 ConvertReturnedProperties(returnValueNative__);
9822 Discord_FreeProperties(returnValueNative__);
9823 return returnValue__;
9825std::string MessageHandle::RawContent()
const
9827 assert(state_ == DiscordObjectState::Owned);
9828 Discord_String returnValueNative__;
9829 Discord_MessageHandle_RawContent(&instance_, &returnValueNative__);
9830 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
9831 returnValueNative__.size);
9832 Discord_Free(returnValueNative__.ptr);
9833 return returnValue__;
9835std::optional<discordpp::UserHandle> MessageHandle::Recipient()
const
9837 assert(state_ == DiscordObjectState::Owned);
9838 bool returnIsNonNull__;
9839 Discord_UserHandle returnValueNative__;
9840 returnIsNonNull__ = Discord_MessageHandle_Recipient(&instance_, &returnValueNative__);
9841 if (!returnIsNonNull__) {
9845 return returnValue__;
9847uint64_t MessageHandle::RecipientId()
const
9849 assert(state_ == DiscordObjectState::Owned);
9850 uint64_t returnValue__;
9851 returnValue__ = Discord_MessageHandle_RecipientId(&instance_);
9852 return returnValue__;
9854bool MessageHandle::SentFromGame()
const
9856 assert(state_ == DiscordObjectState::Owned);
9858 returnValue__ = Discord_MessageHandle_SentFromGame(&instance_);
9859 return returnValue__;
9861uint64_t MessageHandle::SentTimestamp()
const
9863 assert(state_ == DiscordObjectState::Owned);
9864 uint64_t returnValue__;
9865 returnValue__ = Discord_MessageHandle_SentTimestamp(&instance_);
9866 return returnValue__;
9868const AudioDevice AudioDevice::nullobj{{}, DiscordObjectState::Invalid};
9869AudioDevice::~AudioDevice()
9871 if (state_ == DiscordObjectState::Owned) {
9873 state_ = DiscordObjectState::Invalid;
9876AudioDevice::AudioDevice(AudioDevice&& other) noexcept
9877 : instance_(other.instance_)
9878 , state_(other.state_)
9880 other.state_ = DiscordObjectState::Invalid;
9882AudioDevice& AudioDevice::operator=(AudioDevice&& other)
noexcept
9884 if (
this != &other) {
9885 if (state_ == DiscordObjectState::Owned) {
9888 instance_ = other.instance_;
9889 state_ = other.state_;
9890 other.state_ = DiscordObjectState::Invalid;
9894AudioDevice::AudioDevice(
const AudioDevice& arg0)
9899 Discord_AudioDevice_Clone(&instance_, arg0.instance());
9901 state_ = DiscordObjectState::Owned;
9904AudioDevice& AudioDevice::operator=(
const AudioDevice& arg0)
9906 if (
this != &arg0) {
9907 if (state_ == DiscordObjectState::Owned) {
9909 state_ = DiscordObjectState::Invalid;
9911 if (arg0.state_ == DiscordObjectState::Owned) {
9912 Discord_AudioDevice_Clone(&instance_, arg0.instance());
9914 state_ = DiscordObjectState::Owned;
9919AudioDevice::AudioDevice(Discord_AudioDevice instance, DiscordObjectState state)
9920 : instance_(instance)
9924void AudioDevice::Drop()
9926 if (state_ != DiscordObjectState::Owned) {
9929 Discord_AudioDevice_Drop(&instance_);
9930 state_ = DiscordObjectState::Invalid;
9934 assert(state_ == DiscordObjectState::Owned);
9936 returnValue__ = Discord_AudioDevice_Equals(&instance_, rhs.instance());
9937 return returnValue__;
9939std::string AudioDevice::Id()
const
9941 assert(state_ == DiscordObjectState::Owned);
9942 Discord_String returnValueNative__;
9943 Discord_AudioDevice_Id(&instance_, &returnValueNative__);
9944 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
9945 returnValueNative__.size);
9946 Discord_Free(returnValueNative__.ptr);
9947 return returnValue__;
9949void AudioDevice::SetId(std::string Id)
9951 assert(state_ == DiscordObjectState::Owned);
9952 Discord_String Id__str{(uint8_t*)(Id.data()), Id.size()};
9953 Discord_AudioDevice_SetId(&instance_, Id__str);
9955std::string AudioDevice::Name()
const
9957 assert(state_ == DiscordObjectState::Owned);
9958 Discord_String returnValueNative__;
9959 Discord_AudioDevice_Name(&instance_, &returnValueNative__);
9960 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
9961 returnValueNative__.size);
9962 Discord_Free(returnValueNative__.ptr);
9963 return returnValue__;
9965void AudioDevice::SetName(std::string Name)
9967 assert(state_ == DiscordObjectState::Owned);
9968 Discord_String Name__str{(uint8_t*)(
Name.data()),
Name.size()};
9969 Discord_AudioDevice_SetName(&instance_, Name__str);
9971bool AudioDevice::IsDefault()
const
9973 assert(state_ == DiscordObjectState::Owned);
9975 returnValue__ = Discord_AudioDevice_IsDefault(&instance_);
9976 return returnValue__;
9978void AudioDevice::SetIsDefault(
bool IsDefault)
9980 assert(state_ == DiscordObjectState::Owned);
9981 Discord_AudioDevice_SetIsDefault(&instance_, IsDefault);
9983const UserMessageSummary UserMessageSummary::nullobj{{}, DiscordObjectState::Invalid};
9984UserMessageSummary::~UserMessageSummary()
9986 if (state_ == DiscordObjectState::Owned) {
9988 state_ = DiscordObjectState::Invalid;
9991UserMessageSummary::UserMessageSummary(UserMessageSummary&& other) noexcept
9992 : instance_(other.instance_)
9993 , state_(other.state_)
9995 other.state_ = DiscordObjectState::Invalid;
9997UserMessageSummary& UserMessageSummary::operator=(UserMessageSummary&& other)
noexcept
9999 if (
this != &other) {
10000 if (state_ == DiscordObjectState::Owned) {
10003 instance_ = other.instance_;
10004 state_ = other.state_;
10005 other.state_ = DiscordObjectState::Invalid;
10009UserMessageSummary::UserMessageSummary(
const UserMessageSummary& arg0)
10014 Discord_UserMessageSummary_Clone(&instance_, arg0.instance());
10016 state_ = DiscordObjectState::Owned;
10019UserMessageSummary& UserMessageSummary::operator=(
const UserMessageSummary& arg0)
10021 if (
this != &arg0) {
10022 if (state_ == DiscordObjectState::Owned) {
10024 state_ = DiscordObjectState::Invalid;
10026 if (arg0.state_ == DiscordObjectState::Owned) {
10027 Discord_UserMessageSummary_Clone(&instance_, arg0.instance());
10029 state_ = DiscordObjectState::Owned;
10034UserMessageSummary::UserMessageSummary(Discord_UserMessageSummary instance,
10035 DiscordObjectState state)
10036 : instance_(instance)
10040void UserMessageSummary::Drop()
10042 if (state_ != DiscordObjectState::Owned) {
10045 Discord_UserMessageSummary_Drop(&instance_);
10046 state_ = DiscordObjectState::Invalid;
10048uint64_t UserMessageSummary::LastMessageId()
const
10050 assert(state_ == DiscordObjectState::Owned);
10051 uint64_t returnValue__;
10052 returnValue__ = Discord_UserMessageSummary_LastMessageId(&instance_);
10053 return returnValue__;
10055uint64_t UserMessageSummary::UserId()
const
10057 assert(state_ == DiscordObjectState::Owned);
10058 uint64_t returnValue__;
10059 returnValue__ = Discord_UserMessageSummary_UserId(&instance_);
10060 return returnValue__;
10062const ClientCreateOptions ClientCreateOptions::nullobj{{}, DiscordObjectState::Invalid};
10063ClientCreateOptions::~ClientCreateOptions()
10065 if (state_ == DiscordObjectState::Owned) {
10067 state_ = DiscordObjectState::Invalid;
10070ClientCreateOptions::ClientCreateOptions(ClientCreateOptions&& other) noexcept
10071 : instance_(other.instance_)
10072 , state_(other.state_)
10074 other.state_ = DiscordObjectState::Invalid;
10076ClientCreateOptions& ClientCreateOptions::operator=(ClientCreateOptions&& other)
noexcept
10078 if (
this != &other) {
10079 if (state_ == DiscordObjectState::Owned) {
10082 instance_ = other.instance_;
10083 state_ = other.state_;
10084 other.state_ = DiscordObjectState::Invalid;
10088ClientCreateOptions::ClientCreateOptions(
const ClientCreateOptions& arg0)
10093 Discord_ClientCreateOptions_Clone(&instance_, arg0.instance());
10095 state_ = DiscordObjectState::Owned;
10098ClientCreateOptions& ClientCreateOptions::operator=(
const ClientCreateOptions& arg0)
10100 if (
this != &arg0) {
10101 if (state_ == DiscordObjectState::Owned) {
10103 state_ = DiscordObjectState::Invalid;
10105 if (arg0.state_ == DiscordObjectState::Owned) {
10106 Discord_ClientCreateOptions_Clone(&instance_, arg0.instance());
10108 state_ = DiscordObjectState::Owned;
10113ClientCreateOptions::ClientCreateOptions(Discord_ClientCreateOptions instance,
10114 DiscordObjectState state)
10115 : instance_(instance)
10119ClientCreateOptions::ClientCreateOptions()
10121 assert(state_ == DiscordObjectState::Invalid);
10122 Discord_ClientCreateOptions_Init(&instance_);
10123 state_ = DiscordObjectState::Owned;
10125void ClientCreateOptions::Drop()
10127 if (state_ != DiscordObjectState::Owned) {
10130 Discord_ClientCreateOptions_Drop(&instance_);
10131 state_ = DiscordObjectState::Invalid;
10133std::string ClientCreateOptions::WebBase()
const
10135 assert(state_ == DiscordObjectState::Owned);
10136 Discord_String returnValueNative__;
10137 Discord_ClientCreateOptions_WebBase(&instance_, &returnValueNative__);
10138 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
10139 returnValueNative__.size);
10140 Discord_Free(returnValueNative__.ptr);
10141 return returnValue__;
10143void ClientCreateOptions::SetWebBase(std::string WebBase)
10145 assert(state_ == DiscordObjectState::Owned);
10146 Discord_String WebBase__str{(uint8_t*)(WebBase.data()), WebBase.size()};
10147 Discord_ClientCreateOptions_SetWebBase(&instance_, WebBase__str);
10149std::string ClientCreateOptions::ApiBase()
const
10151 assert(state_ == DiscordObjectState::Owned);
10152 Discord_String returnValueNative__;
10153 Discord_ClientCreateOptions_ApiBase(&instance_, &returnValueNative__);
10154 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
10155 returnValueNative__.size);
10156 Discord_Free(returnValueNative__.ptr);
10157 return returnValue__;
10159void ClientCreateOptions::SetApiBase(std::string ApiBase)
10161 assert(state_ == DiscordObjectState::Owned);
10162 Discord_String ApiBase__str{(uint8_t*)(ApiBase.data()), ApiBase.size()};
10163 Discord_ClientCreateOptions_SetApiBase(&instance_, ApiBase__str);
10167 assert(state_ == DiscordObjectState::Owned);
10168 Discord_AudioSystem returnValue__;
10169 returnValue__ = Discord_ClientCreateOptions_ExperimentalAudioSystem(&instance_);
10174 assert(state_ == DiscordObjectState::Owned);
10175 Discord_ClientCreateOptions_SetExperimentalAudioSystem(
10176 &instance_,
static_cast<Discord_AudioSystem
>(ExperimentalAudioSystem));
10178bool ClientCreateOptions::ExperimentalAndroidPreventCommsForBluetooth()
const
10180 assert(state_ == DiscordObjectState::Owned);
10181 bool returnValue__;
10183 Discord_ClientCreateOptions_ExperimentalAndroidPreventCommsForBluetooth(&instance_);
10184 return returnValue__;
10186void ClientCreateOptions::SetExperimentalAndroidPreventCommsForBluetooth(
10187 bool ExperimentalAndroidPreventCommsForBluetooth)
10189 assert(state_ == DiscordObjectState::Owned);
10190 Discord_ClientCreateOptions_SetExperimentalAndroidPreventCommsForBluetooth(
10191 &instance_, ExperimentalAndroidPreventCommsForBluetooth);
10193std::optional<uint64_t> ClientCreateOptions::CpuAffinityMask()
const
10195 assert(state_ == DiscordObjectState::Owned);
10196 bool returnIsNonNull__;
10197 uint64_t returnValue__;
10198 returnIsNonNull__ = Discord_ClientCreateOptions_CpuAffinityMask(&instance_, &returnValue__);
10199 if (!returnIsNonNull__) {
10200 return std::nullopt;
10202 return returnValue__;
10204void ClientCreateOptions::SetCpuAffinityMask(std::optional<uint64_t> CpuAffinityMask)
10206 assert(state_ == DiscordObjectState::Owned);
10207 Discord_ClientCreateOptions_SetCpuAffinityMask(
10208 &instance_, (CpuAffinityMask.has_value() ? &*CpuAffinityMask :
nullptr));
10210const Client Client::nullobj{{}, DiscordObjectState::Invalid};
10213 if (state_ == DiscordObjectState::Owned) {
10215 state_ = DiscordObjectState::Invalid;
10218Client::Client(Client&& other) noexcept
10219 : instance_(other.instance_)
10220 , state_(other.state_)
10222 other.state_ = DiscordObjectState::Invalid;
10224Client& Client::operator=(Client&& other)
noexcept
10226 if (
this != &other) {
10227 if (state_ == DiscordObjectState::Owned) {
10230 instance_ = other.instance_;
10231 state_ = other.state_;
10232 other.state_ = DiscordObjectState::Invalid;
10236Client::Client(Discord_Client instance, DiscordObjectState state)
10237 : instance_(instance)
10243 assert(state_ == DiscordObjectState::Invalid);
10244 Discord_Client_Init(&instance_);
10245 state_ = DiscordObjectState::Owned;
10247Client::Client(std::string apiBase, std::string webBase)
10249 assert(state_ == DiscordObjectState::Invalid);
10250 Discord_String apiBase__str{(uint8_t*)(apiBase.data()), apiBase.size()};
10251 Discord_String webBase__str{(uint8_t*)(webBase.data()), webBase.size()};
10252 Discord_Client_InitWithBases(&instance_, apiBase__str, webBase__str);
10253 state_ = DiscordObjectState::Owned;
10257 assert(state_ == DiscordObjectState::Invalid);
10258 Discord_Client_InitWithOptions(&instance_, options.instance());
10259 state_ = DiscordObjectState::Owned;
10263 if (state_ != DiscordObjectState::Owned) {
10266 Discord_Client_Drop(&instance_);
10267 state_ = DiscordObjectState::Invalid;
10271 Discord_String returnValueNative__;
10272 Discord_Client_ErrorToString(
static_cast<Discord_Client_Error
>(type), &returnValueNative__);
10273 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
10274 returnValueNative__.size);
10275 Discord_Free(returnValueNative__.ptr);
10276 return returnValue__;
10278uint64_t Client::GetApplicationId()
10280 assert(state_ == DiscordObjectState::Owned);
10281 uint64_t returnValue__;
10282 returnValue__ = Discord_Client_GetApplicationId(&instance_);
10283 return returnValue__;
10287 assert(state_ == DiscordObjectState::Owned);
10288 Discord_UserHandle returnValueNative__{};
10289 Discord_Client_GetCurrentUser(&instance_, &returnValueNative__);
10291 return returnValue__;
10293std::string Client::GetDefaultAudioDeviceId()
10295 Discord_String returnValueNative__;
10296 Discord_Client_GetDefaultAudioDeviceId(&returnValueNative__);
10297 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
10298 returnValueNative__.size);
10299 Discord_Free(returnValueNative__.ptr);
10300 return returnValue__;
10302std::string Client::GetDefaultCommunicationScopes()
10304 Discord_String returnValueNative__;
10305 Discord_Client_GetDefaultCommunicationScopes(&returnValueNative__);
10306 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
10307 returnValueNative__.size);
10308 Discord_Free(returnValueNative__.ptr);
10309 return returnValue__;
10311std::string Client::GetDefaultPresenceScopes()
10313 Discord_String returnValueNative__;
10314 Discord_Client_GetDefaultPresenceScopes(&returnValueNative__);
10315 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
10316 returnValueNative__.size);
10317 Discord_Free(returnValueNative__.ptr);
10318 return returnValue__;
10320std::string Client::GetVersionHash()
10322 Discord_String returnValueNative__;
10323 Discord_Client_GetVersionHash(&returnValueNative__);
10324 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
10325 returnValueNative__.size);
10326 Discord_Free(returnValueNative__.ptr);
10327 return returnValue__;
10329int32_t Client::GetVersionMajor()
10331 int32_t returnValue__;
10332 returnValue__ = Discord_Client_GetVersionMajor();
10333 return returnValue__;
10335int32_t Client::GetVersionMinor()
10337 int32_t returnValue__;
10338 returnValue__ = Discord_Client_GetVersionMinor();
10339 return returnValue__;
10341int32_t Client::GetVersionPatch()
10343 int32_t returnValue__;
10344 returnValue__ = Discord_Client_GetVersionPatch();
10345 return returnValue__;
10347void Client::SetHttpRequestTimeout(int32_t httpTimeoutInMilliseconds)
10349 assert(state_ == DiscordObjectState::Owned);
10350 Discord_Client_SetHttpRequestTimeout(&instance_, httpTimeoutInMilliseconds);
10354 Discord_String returnValueNative__;
10355 Discord_Client_StatusToString(
static_cast<Discord_Client_Status
>(type), &returnValueNative__);
10356 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
10357 returnValueNative__.size);
10358 Discord_Free(returnValueNative__.ptr);
10359 return returnValue__;
10363 Discord_String returnValueNative__;
10364 Discord_Client_ThreadToString(
static_cast<Discord_Client_Thread
>(type), &returnValueNative__);
10365 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
10366 returnValueNative__.size);
10367 Discord_Free(returnValueNative__.ptr);
10368 return returnValue__;
10372 assert(state_ == DiscordObjectState::Owned);
10373 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
10374 auto callback__userData =
new Tcallback__UserData(callback);
10375 Discord_Client_EndCallCallback callback__native = [](
void* userData__) {
10376 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
10377 userData__typed->delegate();
10379 Discord_Client_EndCall(
10380 &instance_, channelId, callback__native, Tcallback__UserData::Free, callback__userData);
10384 assert(state_ == DiscordObjectState::Owned);
10385 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
10386 auto callback__userData =
new Tcallback__UserData(callback);
10387 Discord_Client_EndCallsCallback callback__native = [](
void* userData__) {
10388 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
10389 userData__typed->delegate();
10391 Discord_Client_EndCalls(
10392 &instance_, callback__native, Tcallback__UserData::Free, callback__userData);
10396 assert(state_ == DiscordObjectState::Owned);
10397 bool returnIsNonNull__;
10398 Discord_Call returnValueNative__{};
10399 returnIsNonNull__ = Discord_Client_GetCall(&instance_, channelId, &returnValueNative__);
10401 returnValueNative__,
10402 returnIsNonNull__ ? DiscordObjectState::Owned : DiscordObjectState::Invalid);
10403 return returnValue__;
10405std::vector<discordpp::Call> Client::GetCalls()
10407 assert(state_ == DiscordObjectState::Owned);
10408 Discord_CallSpan returnValueNative__;
10409 Discord_Client_GetCalls(&instance_, &returnValueNative__);
10410 std::vector<discordpp::Call> returnValue__;
10411 returnValue__.reserve(returnValueNative__.size);
10412 for (
size_t i__ = 0; i__ < returnValueNative__.size; ++i__) {
10413 returnValue__.emplace_back(returnValueNative__.ptr[i__], DiscordObjectState::Owned);
10415 Discord_Free(returnValueNative__.ptr);
10416 return returnValue__;
10420 assert(state_ == DiscordObjectState::Owned);
10421 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10422 auto cb__userData =
new Tcb__UserData(cb);
10423 Discord_Client_GetCurrentInputDeviceCallback cb__native = [](
auto device,
void* userData__) {
10424 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10426 userData__typed->delegate(std::move(device__obj));
10428 Discord_Client_GetCurrentInputDevice(&instance_, cb__native, Tcb__UserData::Free, cb__userData);
10432 assert(state_ == DiscordObjectState::Owned);
10433 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10434 auto cb__userData =
new Tcb__UserData(cb);
10435 Discord_Client_GetCurrentOutputDeviceCallback cb__native = [](
auto device,
void* userData__) {
10436 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10438 userData__typed->delegate(std::move(device__obj));
10440 Discord_Client_GetCurrentOutputDevice(
10441 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
10445 assert(state_ == DiscordObjectState::Owned);
10446 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10447 auto cb__userData =
new Tcb__UserData(cb);
10448 Discord_Client_GetInputDevicesCallback cb__native = [](
auto devices,
void* userData__) {
10449 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10450 std::vector<discordpp::AudioDevice> devices__vec;
10451 devices__vec.reserve(devices.size);
10452 for (
size_t i__ = 0; i__ < devices.size; ++i__) {
10453 devices__vec.emplace_back(devices.ptr[i__], DiscordObjectState::Owned);
10455 Discord_Free(devices.ptr);
10456 userData__typed->delegate(std::move(devices__vec));
10458 Discord_Client_GetInputDevices(&instance_, cb__native, Tcb__UserData::Free, cb__userData);
10460float Client::GetInputVolume()
10462 assert(state_ == DiscordObjectState::Owned);
10463 float returnValue__;
10464 returnValue__ = Discord_Client_GetInputVolume(&instance_);
10465 return returnValue__;
10469 assert(state_ == DiscordObjectState::Owned);
10470 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10471 auto cb__userData =
new Tcb__UserData(cb);
10472 Discord_Client_GetOutputDevicesCallback cb__native = [](
auto devices,
void* userData__) {
10473 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10474 std::vector<discordpp::AudioDevice> devices__vec;
10475 devices__vec.reserve(devices.size);
10476 for (
size_t i__ = 0; i__ < devices.size; ++i__) {
10477 devices__vec.emplace_back(devices.ptr[i__], DiscordObjectState::Owned);
10479 Discord_Free(devices.ptr);
10480 userData__typed->delegate(std::move(devices__vec));
10482 Discord_Client_GetOutputDevices(&instance_, cb__native, Tcb__UserData::Free, cb__userData);
10484float Client::GetOutputVolume()
10486 assert(state_ == DiscordObjectState::Owned);
10487 float returnValue__;
10488 returnValue__ = Discord_Client_GetOutputVolume(&instance_);
10489 return returnValue__;
10491bool Client::GetSelfDeafAll()
const
10493 assert(state_ == DiscordObjectState::Owned);
10494 bool returnValue__;
10495 returnValue__ = Discord_Client_GetSelfDeafAll(&instance_);
10496 return returnValue__;
10498bool Client::GetSelfMuteAll()
const
10500 assert(state_ == DiscordObjectState::Owned);
10501 bool returnValue__;
10502 returnValue__ = Discord_Client_GetSelfMuteAll(&instance_);
10503 return returnValue__;
10505void Client::SetAecDump(
bool on)
10507 assert(state_ == DiscordObjectState::Owned);
10508 Discord_Client_SetAecDump(&instance_, on);
10510void Client::SetAutomaticGainControl(
bool on)
10512 assert(state_ == DiscordObjectState::Owned);
10513 Discord_Client_SetAutomaticGainControl(&instance_, on);
10517 assert(state_ == DiscordObjectState::Owned);
10518 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
10519 auto callback__userData =
new Tcallback__UserData(callback);
10520 Discord_Client_DeviceChangeCallback callback__native =
10521 [](
auto inputDevices,
auto outputDevices,
void* userData__) {
10522 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
10523 std::vector<discordpp::AudioDevice> inputDevices__vec;
10524 inputDevices__vec.reserve(inputDevices.size);
10525 for (
size_t i__ = 0; i__ < inputDevices.size; ++i__) {
10526 inputDevices__vec.emplace_back(inputDevices.ptr[i__], DiscordObjectState::Owned);
10528 Discord_Free(inputDevices.ptr);
10529 std::vector<discordpp::AudioDevice> outputDevices__vec;
10530 outputDevices__vec.reserve(outputDevices.size);
10531 for (
size_t i__ = 0; i__ < outputDevices.size; ++i__) {
10532 outputDevices__vec.emplace_back(outputDevices.ptr[i__], DiscordObjectState::Owned);
10534 Discord_Free(outputDevices.ptr);
10535 userData__typed->delegate(std::move(inputDevices__vec), std::move(outputDevices__vec));
10537 Discord_Client_SetDeviceChangeCallback(
10538 &instance_, callback__native, Tcallback__UserData::Free, callback__userData);
10540void Client::SetEchoCancellation(
bool on)
10542 assert(state_ == DiscordObjectState::Owned);
10543 Discord_Client_SetEchoCancellation(&instance_, on);
10545void Client::SetEngineManagedAudioSession(
bool isEngineManaged)
10547 assert(state_ == DiscordObjectState::Owned);
10548 Discord_Client_SetEngineManagedAudioSession(&instance_, isEngineManaged);
10552 assert(state_ == DiscordObjectState::Owned);
10553 Discord_String deviceId__str{(uint8_t*)(deviceId.data()), deviceId.size()};
10554 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10555 auto cb__userData =
new Tcb__UserData(cb);
10556 Discord_Client_SetInputDeviceCallback cb__native = [](
auto result,
void* userData__) {
10557 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10559 userData__typed->delegate(std::move(result__obj));
10561 Discord_Client_SetInputDevice(
10562 &instance_, deviceId__str, cb__native, Tcb__UserData::Free, cb__userData);
10564void Client::SetInputVolume(
float inputVolume)
10566 assert(state_ == DiscordObjectState::Owned);
10567 Discord_Client_SetInputVolume(&instance_, inputVolume);
10571 assert(state_ == DiscordObjectState::Owned);
10572 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
10573 auto callback__userData =
new Tcallback__UserData(callback);
10574 Discord_Client_NoAudioInputCallback callback__native = [](
auto inputDetected,
10575 void* userData__) {
10576 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
10577 userData__typed->delegate(inputDetected);
10579 Discord_Client_SetNoAudioInputCallback(
10580 &instance_, callback__native, Tcallback__UserData::Free, callback__userData);
10582void Client::SetNoAudioInputThreshold(
float dBFSThreshold)
10584 assert(state_ == DiscordObjectState::Owned);
10585 Discord_Client_SetNoAudioInputThreshold(&instance_, dBFSThreshold);
10587void Client::SetNoiseCancellation(
bool on)
10589 assert(state_ == DiscordObjectState::Owned);
10590 Discord_Client_SetNoiseCancellation(&instance_, on);
10592void Client::SetNoiseSuppression(
bool on)
10594 assert(state_ == DiscordObjectState::Owned);
10595 Discord_Client_SetNoiseSuppression(&instance_, on);
10597void Client::SetOpusHardwareCoding(
bool encode,
bool decode)
10599 assert(state_ == DiscordObjectState::Owned);
10600 Discord_Client_SetOpusHardwareCoding(&instance_, encode, decode);
10604 assert(state_ == DiscordObjectState::Owned);
10605 Discord_String deviceId__str{(uint8_t*)(deviceId.data()), deviceId.size()};
10606 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10607 auto cb__userData =
new Tcb__UserData(cb);
10608 Discord_Client_SetOutputDeviceCallback cb__native = [](
auto result,
void* userData__) {
10609 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10611 userData__typed->delegate(std::move(result__obj));
10613 Discord_Client_SetOutputDevice(
10614 &instance_, deviceId__str, cb__native, Tcb__UserData::Free, cb__userData);
10616void Client::SetOutputVolume(
float outputVolume)
10618 assert(state_ == DiscordObjectState::Owned);
10619 Discord_Client_SetOutputVolume(&instance_, outputVolume);
10621void Client::SetSelfDeafAll(
bool deaf)
10623 assert(state_ == DiscordObjectState::Owned);
10624 Discord_Client_SetSelfDeafAll(&instance_, deaf);
10626void Client::SetSelfMuteAll(
bool mute)
10628 assert(state_ == DiscordObjectState::Owned);
10629 Discord_Client_SetSelfMuteAll(&instance_, mute);
10631bool Client::SetSpeakerMode(
bool speakerMode)
10633 assert(state_ == DiscordObjectState::Owned);
10634 bool returnValue__;
10635 returnValue__ = Discord_Client_SetSpeakerMode(&instance_, speakerMode);
10636 return returnValue__;
10640 assert(state_ == DiscordObjectState::Owned);
10641 Discord_Client_SetThreadPriority(
10642 &instance_,
static_cast<Discord_Client_Thread
>(thread), priority);
10644void Client::SetVoiceParticipantChangedCallback(
10647 assert(state_ == DiscordObjectState::Owned);
10648 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10649 auto cb__userData =
new Tcb__UserData(cb);
10650 Discord_Client_VoiceParticipantChangedCallback cb__native =
10651 [](
auto lobbyId,
auto memberId,
auto added,
void* userData__) {
10652 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10653 userData__typed->delegate(lobbyId, memberId, added);
10655 Discord_Client_SetVoiceParticipantChangedCallback(
10656 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
10658bool Client::ShowAudioRoutePicker()
10660 assert(state_ == DiscordObjectState::Owned);
10661 bool returnValue__;
10662 returnValue__ = Discord_Client_ShowAudioRoutePicker(&instance_);
10663 return returnValue__;
10667 assert(state_ == DiscordObjectState::Owned);
10668 bool returnIsNonNull__;
10669 Discord_Call returnValueNative__{};
10670 returnIsNonNull__ = Discord_Client_StartCall(&instance_, channelId, &returnValueNative__);
10672 returnValueNative__,
10673 returnIsNonNull__ ? DiscordObjectState::Owned : DiscordObjectState::Invalid);
10674 return returnValue__;
10681 assert(state_ == DiscordObjectState::Owned);
10682 bool returnIsNonNull__;
10683 Discord_Call returnValueNative__{};
10684 using TreceivedCb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(receivedCb)>>;
10685 auto receivedCb__userData =
new TreceivedCb__UserData(receivedCb);
10686 Discord_Client_UserAudioReceivedCallback receivedCb__native = [](
auto userId,
10688 auto samplesPerChannel,
10691 auto outShouldMute,
10692 void* userData__) {
10693 auto userData__typed =
static_cast<TreceivedCb__UserData*
>(userData__);
10694 userData__typed->delegate(
10695 userId, data, samplesPerChannel, sampleRate, channels, *outShouldMute);
10697 using TcapturedCb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(capturedCb)>>;
10698 auto capturedCb__userData =
new TcapturedCb__UserData(capturedCb);
10699 Discord_Client_UserAudioCapturedCallback capturedCb__native =
10700 [](
auto data,
auto samplesPerChannel,
auto sampleRate,
auto channels,
void* userData__) {
10701 auto userData__typed =
static_cast<TcapturedCb__UserData*
>(userData__);
10702 userData__typed->delegate(data, samplesPerChannel, sampleRate, channels);
10704 returnIsNonNull__ = Discord_Client_StartCallWithAudioCallbacks(&instance_,
10706 receivedCb__native,
10707 TreceivedCb__UserData::Free,
10708 receivedCb__userData,
10709 capturedCb__native,
10710 TcapturedCb__UserData::Free,
10711 capturedCb__userData,
10712 &returnValueNative__);
10714 returnValueNative__,
10715 returnIsNonNull__ ? DiscordObjectState::Owned : DiscordObjectState::Invalid);
10716 return returnValue__;
10718void Client::AbortAuthorize()
10720 assert(state_ == DiscordObjectState::Owned);
10721 Discord_Client_AbortAuthorize(&instance_);
10723void Client::AbortGetTokenFromDevice()
10725 assert(state_ == DiscordObjectState::Owned);
10726 Discord_Client_AbortGetTokenFromDevice(&instance_);
10731 assert(state_ == DiscordObjectState::Owned);
10732 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
10733 auto callback__userData =
new Tcallback__UserData(callback);
10734 Discord_Client_AuthorizationCallback callback__native =
10735 [](
auto result,
auto code,
auto redirectUri,
void* userData__) {
10736 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
10738 std::string code__str(
reinterpret_cast<char*
>(code.ptr), code.size);
10739 std::string redirectUri__str(
reinterpret_cast<char*
>(redirectUri.ptr), redirectUri.size);
10740 userData__typed->delegate(
10741 std::move(result__obj), std::move(code__str), std::move(redirectUri__str));
10742 Discord_Free(redirectUri.ptr);
10743 Discord_Free(code.ptr);
10745 Discord_Client_Authorize(
10746 &instance_, args.instance(), callback__native, Tcallback__UserData::Free, callback__userData);
10748void Client::CloseAuthorizeDeviceScreen()
10750 assert(state_ == DiscordObjectState::Owned);
10751 Discord_Client_CloseAuthorizeDeviceScreen(&instance_);
10755 assert(state_ == DiscordObjectState::Owned);
10756 Discord_AuthorizationCodeVerifier returnValueNative__{};
10757 Discord_Client_CreateAuthorizationCodeVerifier(&instance_, &returnValueNative__);
10759 DiscordObjectState::Owned);
10760 return returnValue__;
10762void Client::ExchangeChildToken(std::string
const& parentApplicationToken,
10763 uint64_t childApplicationId,
10766 assert(state_ == DiscordObjectState::Owned);
10767 Discord_String parentApplicationToken__str{(uint8_t*)(parentApplicationToken.data()),
10768 parentApplicationToken.size()};
10769 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
10770 auto callback__userData =
new Tcallback__UserData(callback);
10771 Discord_Client_ExchangeChildTokenCallback callback__native = [](
auto result,
10776 void* userData__) {
10777 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
10779 std::string accessToken__str(
reinterpret_cast<char*
>(accessToken.ptr), accessToken.size);
10780 std::string scopes__str(
reinterpret_cast<char*
>(scopes.ptr), scopes.size);
10781 userData__typed->delegate(std::move(result__obj),
10782 std::move(accessToken__str),
10785 std::move(scopes__str));
10786 Discord_Free(scopes.ptr);
10787 Discord_Free(accessToken.ptr);
10789 Discord_Client_ExchangeChildToken(&instance_,
10790 parentApplicationToken__str,
10791 childApplicationId,
10793 Tcallback__UserData::Free,
10794 callback__userData);
10797 std::string
const& token,
10800 assert(state_ == DiscordObjectState::Owned);
10801 Discord_String token__str{(uint8_t*)(token.data()), token.size()};
10802 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
10803 auto callback__userData =
new Tcallback__UserData(callback);
10804 Discord_Client_FetchCurrentUserCallback callback__native =
10805 [](
auto result,
auto id,
auto name,
void* userData__) {
10806 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
10808 std::string name__str(
reinterpret_cast<char*
>(name.ptr), name.size);
10809 userData__typed->delegate(std::move(result__obj),
id, std::move(name__str));
10810 Discord_Free(name.ptr);
10812 Discord_Client_FetchCurrentUser(&instance_,
10813 static_cast<Discord_AuthorizationTokenType
>(tokenType),
10816 Tcallback__UserData::Free,
10817 callback__userData);
10819void Client::GetProvisionalToken(uint64_t applicationId,
10821 std::string
const& externalAuthToken,
10824 assert(state_ == DiscordObjectState::Owned);
10825 Discord_String externalAuthToken__str{(uint8_t*)(externalAuthToken.data()),
10826 externalAuthToken.size()};
10827 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
10828 auto callback__userData =
new Tcallback__UserData(callback);
10829 Discord_Client_TokenExchangeCallback callback__native = [](
auto result,
10835 void* userData__) {
10836 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
10838 std::string accessToken__str(
reinterpret_cast<char*
>(accessToken.ptr), accessToken.size);
10839 std::string refreshToken__str(
reinterpret_cast<char*
>(refreshToken.ptr), refreshToken.size);
10840 std::string scopes__str(
reinterpret_cast<char*
>(scopes.ptr), scopes.size);
10841 userData__typed->delegate(std::move(result__obj),
10842 std::move(accessToken__str),
10843 std::move(refreshToken__str),
10846 std::move(scopes__str));
10847 Discord_Free(scopes.ptr);
10848 Discord_Free(refreshToken.ptr);
10849 Discord_Free(accessToken.ptr);
10851 Discord_Client_GetProvisionalToken(
10854 static_cast<Discord_AuthenticationExternalAuthType
>(externalAuthType),
10855 externalAuthToken__str,
10857 Tcallback__UserData::Free,
10858 callback__userData);
10860void Client::GetToken(uint64_t applicationId,
10861 std::string
const& code,
10862 std::string
const& codeVerifier,
10863 std::string
const& redirectUri,
10866 assert(state_ == DiscordObjectState::Owned);
10867 Discord_String code__str{(uint8_t*)(code.data()), code.size()};
10868 Discord_String codeVerifier__str{(uint8_t*)(codeVerifier.data()), codeVerifier.size()};
10869 Discord_String redirectUri__str{(uint8_t*)(redirectUri.data()), redirectUri.size()};
10870 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
10871 auto callback__userData =
new Tcallback__UserData(callback);
10872 Discord_Client_TokenExchangeCallback callback__native = [](
auto result,
10878 void* userData__) {
10879 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
10881 std::string accessToken__str(
reinterpret_cast<char*
>(accessToken.ptr), accessToken.size);
10882 std::string refreshToken__str(
reinterpret_cast<char*
>(refreshToken.ptr), refreshToken.size);
10883 std::string scopes__str(
reinterpret_cast<char*
>(scopes.ptr), scopes.size);
10884 userData__typed->delegate(std::move(result__obj),
10885 std::move(accessToken__str),
10886 std::move(refreshToken__str),
10889 std::move(scopes__str));
10890 Discord_Free(scopes.ptr);
10891 Discord_Free(refreshToken.ptr);
10892 Discord_Free(accessToken.ptr);
10894 Discord_Client_GetToken(&instance_,
10900 Tcallback__UserData::Free,
10901 callback__userData);
10906 assert(state_ == DiscordObjectState::Owned);
10907 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
10908 auto callback__userData =
new Tcallback__UserData(callback);
10909 Discord_Client_TokenExchangeCallback callback__native = [](
auto result,
10915 void* userData__) {
10916 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
10918 std::string accessToken__str(
reinterpret_cast<char*
>(accessToken.ptr), accessToken.size);
10919 std::string refreshToken__str(
reinterpret_cast<char*
>(refreshToken.ptr), refreshToken.size);
10920 std::string scopes__str(
reinterpret_cast<char*
>(scopes.ptr), scopes.size);
10921 userData__typed->delegate(std::move(result__obj),
10922 std::move(accessToken__str),
10923 std::move(refreshToken__str),
10926 std::move(scopes__str));
10927 Discord_Free(scopes.ptr);
10928 Discord_Free(refreshToken.ptr);
10929 Discord_Free(accessToken.ptr);
10931 Discord_Client_GetTokenFromDevice(
10932 &instance_, args.instance(), callback__native, Tcallback__UserData::Free, callback__userData);
10934void Client::GetTokenFromDeviceProvisionalMerge(
10937 std::string
const& externalAuthToken,
10940 assert(state_ == DiscordObjectState::Owned);
10941 Discord_String externalAuthToken__str{(uint8_t*)(externalAuthToken.data()),
10942 externalAuthToken.size()};
10943 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
10944 auto callback__userData =
new Tcallback__UserData(callback);
10945 Discord_Client_TokenExchangeCallback callback__native = [](
auto result,
10951 void* userData__) {
10952 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
10954 std::string accessToken__str(
reinterpret_cast<char*
>(accessToken.ptr), accessToken.size);
10955 std::string refreshToken__str(
reinterpret_cast<char*
>(refreshToken.ptr), refreshToken.size);
10956 std::string scopes__str(
reinterpret_cast<char*
>(scopes.ptr), scopes.size);
10957 userData__typed->delegate(std::move(result__obj),
10958 std::move(accessToken__str),
10959 std::move(refreshToken__str),
10962 std::move(scopes__str));
10963 Discord_Free(scopes.ptr);
10964 Discord_Free(refreshToken.ptr);
10965 Discord_Free(accessToken.ptr);
10967 Discord_Client_GetTokenFromDeviceProvisionalMerge(
10970 static_cast<Discord_AuthenticationExternalAuthType
>(externalAuthType),
10971 externalAuthToken__str,
10973 Tcallback__UserData::Free,
10974 callback__userData);
10976void Client::GetTokenFromProvisionalMerge(
10977 uint64_t applicationId,
10978 std::string
const& code,
10979 std::string
const& codeVerifier,
10980 std::string
const& redirectUri,
10982 std::string
const& externalAuthToken,
10985 assert(state_ == DiscordObjectState::Owned);
10986 Discord_String code__str{(uint8_t*)(code.data()), code.size()};
10987 Discord_String codeVerifier__str{(uint8_t*)(codeVerifier.data()), codeVerifier.size()};
10988 Discord_String redirectUri__str{(uint8_t*)(redirectUri.data()), redirectUri.size()};
10989 Discord_String externalAuthToken__str{(uint8_t*)(externalAuthToken.data()),
10990 externalAuthToken.size()};
10991 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
10992 auto callback__userData =
new Tcallback__UserData(callback);
10993 Discord_Client_TokenExchangeCallback callback__native = [](
auto result,
10999 void* userData__) {
11000 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
11002 std::string accessToken__str(
reinterpret_cast<char*
>(accessToken.ptr), accessToken.size);
11003 std::string refreshToken__str(
reinterpret_cast<char*
>(refreshToken.ptr), refreshToken.size);
11004 std::string scopes__str(
reinterpret_cast<char*
>(scopes.ptr), scopes.size);
11005 userData__typed->delegate(std::move(result__obj),
11006 std::move(accessToken__str),
11007 std::move(refreshToken__str),
11010 std::move(scopes__str));
11011 Discord_Free(scopes.ptr);
11012 Discord_Free(refreshToken.ptr);
11013 Discord_Free(accessToken.ptr);
11015 Discord_Client_GetTokenFromProvisionalMerge(
11021 static_cast<Discord_AuthenticationExternalAuthType
>(externalAuthType),
11022 externalAuthToken__str,
11024 Tcallback__UserData::Free,
11025 callback__userData);
11027bool Client::IsAuthenticated()
11029 assert(state_ == DiscordObjectState::Owned);
11030 bool returnValue__;
11031 returnValue__ = Discord_Client_IsAuthenticated(&instance_);
11032 return returnValue__;
11034void Client::OpenAuthorizeDeviceScreen(uint64_t clientId, std::string
const& userCode)
11036 assert(state_ == DiscordObjectState::Owned);
11037 Discord_String userCode__str{(uint8_t*)(userCode.data()), userCode.size()};
11038 Discord_Client_OpenAuthorizeDeviceScreen(&instance_, clientId, userCode__str);
11040void Client::ProvisionalUserMergeCompleted(
bool success)
11042 assert(state_ == DiscordObjectState::Owned);
11043 Discord_Client_ProvisionalUserMergeCompleted(&instance_, success);
11045void Client::RefreshToken(uint64_t applicationId,
11046 std::string
const& refreshToken,
11049 assert(state_ == DiscordObjectState::Owned);
11050 Discord_String refreshToken__str{(uint8_t*)(refreshToken.data()), refreshToken.size()};
11051 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
11052 auto callback__userData =
new Tcallback__UserData(callback);
11053 Discord_Client_TokenExchangeCallback callback__native = [](
auto result,
11059 void* userData__) {
11060 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
11062 std::string accessToken__str(
reinterpret_cast<char*
>(accessToken.ptr), accessToken.size);
11063 std::string refreshToken__str(
reinterpret_cast<char*
>(refreshToken.ptr), refreshToken.size);
11064 std::string scopes__str(
reinterpret_cast<char*
>(scopes.ptr), scopes.size);
11065 userData__typed->delegate(std::move(result__obj),
11066 std::move(accessToken__str),
11067 std::move(refreshToken__str),
11070 std::move(scopes__str));
11071 Discord_Free(scopes.ptr);
11072 Discord_Free(refreshToken.ptr);
11073 Discord_Free(accessToken.ptr);
11075 Discord_Client_RefreshToken(&instance_,
11079 Tcallback__UserData::Free,
11080 callback__userData);
11084 assert(state_ == DiscordObjectState::Owned);
11085 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
11086 auto callback__userData =
new Tcallback__UserData(callback);
11087 Discord_Client_AuthorizeRequestCallback callback__native = [](
void* userData__) {
11088 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
11089 userData__typed->delegate();
11091 Discord_Client_RegisterAuthorizeRequestCallback(
11092 &instance_, callback__native, Tcallback__UserData::Free, callback__userData);
11094void Client::RemoveAuthorizeRequestCallback()
11096 assert(state_ == DiscordObjectState::Owned);
11097 Discord_Client_RemoveAuthorizeRequestCallback(&instance_);
11099void Client::RevokeToken(uint64_t applicationId,
11100 std::string
const& token,
11103 assert(state_ == DiscordObjectState::Owned);
11104 Discord_String token__str{(uint8_t*)(token.data()), token.size()};
11105 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
11106 auto callback__userData =
new Tcallback__UserData(callback);
11107 Discord_Client_RevokeTokenCallback callback__native = [](
auto result,
void* userData__) {
11108 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
11110 userData__typed->delegate(std::move(result__obj));
11112 Discord_Client_RevokeToken(&instance_,
11116 Tcallback__UserData::Free,
11117 callback__userData);
11119void Client::SetAuthorizeDeviceScreenClosedCallback(
11122 assert(state_ == DiscordObjectState::Owned);
11123 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11124 auto cb__userData =
new Tcb__UserData(cb);
11125 Discord_Client_AuthorizeDeviceScreenClosedCallback cb__native = [](
void* userData__) {
11126 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11127 userData__typed->delegate();
11129 Discord_Client_SetAuthorizeDeviceScreenClosedCallback(
11130 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11132void Client::SetGameWindowPid(int32_t pid)
11134 assert(state_ == DiscordObjectState::Owned);
11135 Discord_Client_SetGameWindowPid(&instance_, pid);
11139 assert(state_ == DiscordObjectState::Owned);
11140 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
11141 auto callback__userData =
new Tcallback__UserData(callback);
11142 Discord_Client_TokenExpirationCallback callback__native = [](
void* userData__) {
11143 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
11144 userData__typed->delegate();
11146 Discord_Client_SetTokenExpirationCallback(
11147 &instance_, callback__native, Tcallback__UserData::Free, callback__userData);
11149void Client::UnmergeIntoProvisionalAccount(
11150 uint64_t applicationId,
11152 std::string
const& externalAuthToken,
11155 assert(state_ == DiscordObjectState::Owned);
11156 Discord_String externalAuthToken__str{(uint8_t*)(externalAuthToken.data()),
11157 externalAuthToken.size()};
11158 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
11159 auto callback__userData =
new Tcallback__UserData(callback);
11160 Discord_Client_UnmergeIntoProvisionalAccountCallback callback__native = [](
auto result,
11161 void* userData__) {
11162 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
11164 userData__typed->delegate(std::move(result__obj));
11166 Discord_Client_UnmergeIntoProvisionalAccount(
11169 static_cast<Discord_AuthenticationExternalAuthType
>(externalAuthType),
11170 externalAuthToken__str,
11172 Tcallback__UserData::Free,
11173 callback__userData);
11175void Client::UpdateProvisionalAccountDisplayName(
11176 std::string
const& name,
11179 assert(state_ == DiscordObjectState::Owned);
11180 Discord_String name__str{(uint8_t*)(name.data()), name.size()};
11181 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
11182 auto callback__userData =
new Tcallback__UserData(callback);
11183 Discord_Client_UpdateProvisionalAccountDisplayNameCallback callback__native =
11184 [](
auto result,
void* userData__) {
11185 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
11187 userData__typed->delegate(std::move(result__obj));
11189 Discord_Client_UpdateProvisionalAccountDisplayName(
11190 &instance_, name__str, callback__native, Tcallback__UserData::Free, callback__userData);
11196 assert(state_ == DiscordObjectState::Owned);
11197 Discord_String token__str{(uint8_t*)(token.data()), token.size()};
11198 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
11199 auto callback__userData =
new Tcallback__UserData(callback);
11200 Discord_Client_UpdateTokenCallback callback__native = [](
auto result,
void* userData__) {
11201 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
11203 userData__typed->delegate(std::move(result__obj));
11205 Discord_Client_UpdateToken(&instance_,
11206 static_cast<Discord_AuthorizationTokenType
>(tokenType),
11209 Tcallback__UserData::Free,
11210 callback__userData);
11212bool Client::CanOpenMessageInDiscord(uint64_t messageId)
11214 assert(state_ == DiscordObjectState::Owned);
11215 bool returnValue__;
11216 returnValue__ = Discord_Client_CanOpenMessageInDiscord(&instance_, messageId);
11217 return returnValue__;
11219void Client::DeleteUserMessage(uint64_t recipientId,
11220 uint64_t messageId,
11223 assert(state_ == DiscordObjectState::Owned);
11224 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11225 auto cb__userData =
new Tcb__UserData(cb);
11226 Discord_Client_DeleteUserMessageCallback cb__native = [](
auto result,
void* userData__) {
11227 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11229 userData__typed->delegate(std::move(result__obj));
11231 Discord_Client_DeleteUserMessage(
11232 &instance_, recipientId, messageId, cb__native, Tcb__UserData::Free, cb__userData);
11234void Client::EditUserMessage(uint64_t recipientId,
11235 uint64_t messageId,
11236 std::string
const& content,
11239 assert(state_ == DiscordObjectState::Owned);
11240 Discord_String content__str{(uint8_t*)(content.data()), content.size()};
11241 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11242 auto cb__userData =
new Tcb__UserData(cb);
11243 Discord_Client_EditUserMessageCallback cb__native = [](
auto result,
void* userData__) {
11244 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11246 userData__typed->delegate(std::move(result__obj));
11248 Discord_Client_EditUserMessage(&instance_,
11253 Tcb__UserData::Free,
11256std::optional<discordpp::ChannelHandle> Client::GetChannelHandle(uint64_t channelId)
const
11258 assert(state_ == DiscordObjectState::Owned);
11259 bool returnIsNonNull__;
11260 Discord_ChannelHandle returnValueNative__;
11261 returnIsNonNull__ =
11262 Discord_Client_GetChannelHandle(&instance_, channelId, &returnValueNative__);
11263 if (!returnIsNonNull__) {
11267 return returnValue__;
11269void Client::GetLobbyMessagesWithLimit(uint64_t lobbyId,
11273 assert(state_ == DiscordObjectState::Owned);
11274 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11275 auto cb__userData =
new Tcb__UserData(cb);
11276 Discord_Client_GetLobbyMessagesCallback cb__native =
11277 [](
auto result,
auto messages,
void* userData__) {
11278 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11280 std::vector<discordpp::MessageHandle> messages__vec;
11281 messages__vec.reserve(messages.size);
11282 for (
size_t i__ = 0; i__ < messages.size; ++i__) {
11283 messages__vec.emplace_back(messages.ptr[i__], DiscordObjectState::Owned);
11285 Discord_Free(messages.ptr);
11286 userData__typed->delegate(std::move(result__obj), std::move(messages__vec));
11288 Discord_Client_GetLobbyMessagesWithLimit(
11289 &instance_, lobbyId, limit, cb__native, Tcb__UserData::Free, cb__userData);
11291std::optional<discordpp::MessageHandle> Client::GetMessageHandle(uint64_t messageId)
const
11293 assert(state_ == DiscordObjectState::Owned);
11294 bool returnIsNonNull__;
11295 Discord_MessageHandle returnValueNative__;
11296 returnIsNonNull__ =
11297 Discord_Client_GetMessageHandle(&instance_, messageId, &returnValueNative__);
11298 if (!returnIsNonNull__) {
11302 return returnValue__;
11306 assert(state_ == DiscordObjectState::Owned);
11307 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11308 auto cb__userData =
new Tcb__UserData(cb);
11309 Discord_Client_UserMessageSummariesCallback cb__native =
11310 [](
auto result,
auto summaries,
void* userData__) {
11311 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11313 std::vector<discordpp::UserMessageSummary> summaries__vec;
11314 summaries__vec.reserve(summaries.size);
11315 for (
size_t i__ = 0; i__ < summaries.size; ++i__) {
11316 summaries__vec.emplace_back(summaries.ptr[i__], DiscordObjectState::Owned);
11318 Discord_Free(summaries.ptr);
11319 userData__typed->delegate(std::move(result__obj), std::move(summaries__vec));
11321 Discord_Client_GetUserMessageSummaries(
11322 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11324void Client::GetUserMessagesWithLimit(uint64_t recipientId,
11328 assert(state_ == DiscordObjectState::Owned);
11329 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11330 auto cb__userData =
new Tcb__UserData(cb);
11331 Discord_Client_UserMessagesWithLimitCallback cb__native =
11332 [](
auto result,
auto messages,
void* userData__) {
11333 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11335 std::vector<discordpp::MessageHandle> messages__vec;
11336 messages__vec.reserve(messages.size);
11337 for (
size_t i__ = 0; i__ < messages.size; ++i__) {
11338 messages__vec.emplace_back(messages.ptr[i__], DiscordObjectState::Owned);
11340 Discord_Free(messages.ptr);
11341 userData__typed->delegate(std::move(result__obj), std::move(messages__vec));
11343 Discord_Client_GetUserMessagesWithLimit(
11344 &instance_, recipientId, limit, cb__native, Tcb__UserData::Free, cb__userData);
11346void Client::OpenMessageInDiscord(
11347 uint64_t messageId,
11351 assert(state_ == DiscordObjectState::Owned);
11352 using TprovisionalUserMergeRequiredCallback__UserData =
11353 TDelegateUserData<std::remove_reference_t<
decltype(provisionalUserMergeRequiredCallback)>>;
11354 auto provisionalUserMergeRequiredCallback__userData =
11355 new TprovisionalUserMergeRequiredCallback__UserData(provisionalUserMergeRequiredCallback);
11356 Discord_Client_ProvisionalUserMergeRequiredCallback
11357 provisionalUserMergeRequiredCallback__native = [](
void* userData__) {
11358 auto userData__typed =
11359 static_cast<TprovisionalUserMergeRequiredCallback__UserData*
>(userData__);
11360 userData__typed->delegate();
11362 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
11363 auto callback__userData =
new Tcallback__UserData(callback);
11364 Discord_Client_OpenMessageInDiscordCallback callback__native = [](
auto result,
11365 void* userData__) {
11366 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
11368 userData__typed->delegate(std::move(result__obj));
11370 Discord_Client_OpenMessageInDiscord(&instance_,
11372 provisionalUserMergeRequiredCallback__native,
11373 TprovisionalUserMergeRequiredCallback__UserData::Free,
11374 provisionalUserMergeRequiredCallback__userData,
11376 Tcallback__UserData::Free,
11377 callback__userData);
11379void Client::SendLobbyMessage(uint64_t lobbyId,
11380 std::string
const& content,
11383 assert(state_ == DiscordObjectState::Owned);
11384 Discord_String content__str{(uint8_t*)(content.data()), content.size()};
11385 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11386 auto cb__userData =
new Tcb__UserData(cb);
11387 Discord_Client_SendUserMessageCallback cb__native =
11388 [](
auto result,
auto messageId,
void* userData__) {
11389 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11391 userData__typed->delegate(std::move(result__obj), messageId);
11393 Discord_Client_SendLobbyMessage(
11394 &instance_, lobbyId, content__str, cb__native, Tcb__UserData::Free, cb__userData);
11396void Client::SendLobbyMessageWithMetadata(
11398 std::string
const& content,
11399 std::unordered_map<std::string, std::string>
const& metadata,
11402 assert(state_ == DiscordObjectState::Owned);
11403 Discord_String content__str{(uint8_t*)(content.data()), content.size()};
11404 ConvertedProperties metadata__convert(metadata);
11405 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11406 auto cb__userData =
new Tcb__UserData(cb);
11407 Discord_Client_SendUserMessageCallback cb__native =
11408 [](
auto result,
auto messageId,
void* userData__) {
11409 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11411 userData__typed->delegate(std::move(result__obj), messageId);
11413 Discord_Client_SendLobbyMessageWithMetadata(&instance_,
11416 metadata__convert.Properties,
11418 Tcb__UserData::Free,
11421void Client::SendUserMessage(uint64_t recipientId,
11422 std::string
const& content,
11425 assert(state_ == DiscordObjectState::Owned);
11426 Discord_String content__str{(uint8_t*)(content.data()), content.size()};
11427 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11428 auto cb__userData =
new Tcb__UserData(cb);
11429 Discord_Client_SendUserMessageCallback cb__native =
11430 [](
auto result,
auto messageId,
void* userData__) {
11431 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11433 userData__typed->delegate(std::move(result__obj), messageId);
11435 Discord_Client_SendUserMessage(
11436 &instance_, recipientId, content__str, cb__native, Tcb__UserData::Free, cb__userData);
11438void Client::SendUserMessageWithMetadata(
11439 uint64_t recipientId,
11440 std::string
const& content,
11441 std::unordered_map<std::string, std::string>
const& metadata,
11444 assert(state_ == DiscordObjectState::Owned);
11445 Discord_String content__str{(uint8_t*)(content.data()), content.size()};
11446 ConvertedProperties metadata__convert(metadata);
11447 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11448 auto cb__userData =
new Tcb__UserData(cb);
11449 Discord_Client_SendUserMessageCallback cb__native =
11450 [](
auto result,
auto messageId,
void* userData__) {
11451 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11453 userData__typed->delegate(std::move(result__obj), messageId);
11455 Discord_Client_SendUserMessageWithMetadata(&instance_,
11458 metadata__convert.Properties,
11460 Tcb__UserData::Free,
11465 assert(state_ == DiscordObjectState::Owned);
11466 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11467 auto cb__userData =
new Tcb__UserData(cb);
11468 Discord_Client_MessageCreatedCallback cb__native = [](
auto messageId,
void* userData__) {
11469 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11470 userData__typed->delegate(messageId);
11472 Discord_Client_SetMessageCreatedCallback(
11473 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11477 assert(state_ == DiscordObjectState::Owned);
11478 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11479 auto cb__userData =
new Tcb__UserData(cb);
11480 Discord_Client_MessageDeletedCallback cb__native =
11481 [](
auto messageId,
auto channelId,
void* userData__) {
11482 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11483 userData__typed->delegate(messageId, channelId);
11485 Discord_Client_SetMessageDeletedCallback(
11486 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11490 assert(state_ == DiscordObjectState::Owned);
11491 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11492 auto cb__userData =
new Tcb__UserData(cb);
11493 Discord_Client_MessageUpdatedCallback cb__native = [](
auto messageId,
void* userData__) {
11494 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11495 userData__typed->delegate(messageId);
11497 Discord_Client_SetMessageUpdatedCallback(
11498 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11500void Client::SetShowingChat(
bool showingChat)
11502 assert(state_ == DiscordObjectState::Owned);
11503 Discord_Client_SetShowingChat(&instance_, showingChat);
11508 assert(state_ == DiscordObjectState::Owned);
11509 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
11510 auto callback__userData =
new Tcallback__UserData(callback);
11511 Discord_Client_LogCallback callback__native = [](
11512 auto message,
auto severity,
void* userData__) {
11513 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
11514 std::string message__str(
reinterpret_cast<char*
>(message.ptr), message.size);
11515 userData__typed->delegate(std::move(message__str),
11517 Discord_Free(message.ptr);
11519 Discord_Client_AddLogCallback(&instance_,
11521 Tcallback__UserData::Free,
11522 callback__userData,
11523 static_cast<Discord_LoggingSeverity
>(minSeverity));
11528 assert(state_ == DiscordObjectState::Owned);
11529 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
11530 auto callback__userData =
new Tcallback__UserData(callback);
11531 Discord_Client_LogCallback callback__native = [](
11532 auto message,
auto severity,
void* userData__) {
11533 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
11534 std::string message__str(
reinterpret_cast<char*
>(message.ptr), message.size);
11535 userData__typed->delegate(std::move(message__str),
11537 Discord_Free(message.ptr);
11539 Discord_Client_AddVoiceLogCallback(&instance_,
11541 Tcallback__UserData::Free,
11542 callback__userData,
11543 static_cast<Discord_LoggingSeverity
>(minSeverity));
11545void Client::Connect()
11547 assert(state_ == DiscordObjectState::Owned);
11548 Discord_Client_Connect(&instance_);
11550void Client::Disconnect()
11552 assert(state_ == DiscordObjectState::Owned);
11553 Discord_Client_Disconnect(&instance_);
11557 assert(state_ == DiscordObjectState::Owned);
11558 Discord_Client_Status returnValue__;
11559 returnValue__ = Discord_Client_GetStatus(&instance_);
11562void Client::OpenConnectedGamesSettingsInDiscord(
11565 assert(state_ == DiscordObjectState::Owned);
11566 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
11567 auto callback__userData =
new Tcallback__UserData(callback);
11568 Discord_Client_OpenConnectedGamesSettingsInDiscordCallback callback__native =
11569 [](
auto result,
void* userData__) {
11570 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
11572 userData__typed->delegate(std::move(result__obj));
11574 Discord_Client_OpenConnectedGamesSettingsInDiscord(
11575 &instance_, callback__native, Tcallback__UserData::Free, callback__userData);
11577void Client::SetApplicationId(uint64_t applicationId)
11579 assert(state_ == DiscordObjectState::Owned);
11580 Discord_Client_SetApplicationId(&instance_, applicationId);
11584 assert(state_ == DiscordObjectState::Owned);
11585 bool returnValue__;
11586 Discord_String path__str{(uint8_t*)(path.data()), path.size()};
11587 returnValue__ = Discord_Client_SetLogDir(
11588 &instance_, path__str,
static_cast<Discord_LoggingSeverity
>(minSeverity));
11589 return returnValue__;
11593 assert(state_ == DiscordObjectState::Owned);
11594 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11595 auto cb__userData =
new Tcb__UserData(cb);
11596 Discord_Client_OnStatusChanged cb__native =
11597 [](
auto status,
auto error,
auto errorDetail,
void* userData__) {
11598 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11603 Discord_Client_SetStatusChangedCallback(
11604 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11608 assert(state_ == DiscordObjectState::Owned);
11609 Discord_String path__str{(uint8_t*)(path.data()), path.size()};
11610 Discord_Client_SetVoiceLogDir(
11611 &instance_, path__str,
static_cast<Discord_LoggingSeverity
>(minSeverity));
11613void Client::CreateOrJoinLobby(std::string
const& secret,
11616 assert(state_ == DiscordObjectState::Owned);
11617 Discord_String secret__str{(uint8_t*)(secret.data()), secret.size()};
11618 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
11619 auto callback__userData =
new Tcallback__UserData(callback);
11620 Discord_Client_CreateOrJoinLobbyCallback callback__native =
11621 [](
auto result,
auto lobbyId,
void* userData__) {
11622 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
11624 userData__typed->delegate(std::move(result__obj), lobbyId);
11626 Discord_Client_CreateOrJoinLobby(
11627 &instance_, secret__str, callback__native, Tcallback__UserData::Free, callback__userData);
11629void Client::CreateOrJoinLobbyWithMetadata(
11630 std::string
const& secret,
11631 std::unordered_map<std::string, std::string>
const& lobbyMetadata,
11632 std::unordered_map<std::string, std::string>
const& memberMetadata,
11635 assert(state_ == DiscordObjectState::Owned);
11636 Discord_String secret__str{(uint8_t*)(secret.data()), secret.size()};
11637 ConvertedProperties lobbyMetadata__convert(lobbyMetadata);
11638 ConvertedProperties memberMetadata__convert(memberMetadata);
11639 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
11640 auto callback__userData =
new Tcallback__UserData(callback);
11641 Discord_Client_CreateOrJoinLobbyCallback callback__native =
11642 [](
auto result,
auto lobbyId,
void* userData__) {
11643 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
11645 userData__typed->delegate(std::move(result__obj), lobbyId);
11647 Discord_Client_CreateOrJoinLobbyWithMetadata(&instance_,
11649 lobbyMetadata__convert.Properties,
11650 memberMetadata__convert.Properties,
11652 Tcallback__UserData::Free,
11653 callback__userData);
11657 assert(state_ == DiscordObjectState::Owned);
11658 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11659 auto cb__userData =
new Tcb__UserData(cb);
11660 Discord_Client_GetGuildChannelsCallback cb__native =
11661 [](
auto result,
auto guildChannels,
void* userData__) {
11662 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11664 std::vector<discordpp::GuildChannel> guildChannels__vec;
11665 guildChannels__vec.reserve(guildChannels.size);
11666 for (
size_t i__ = 0; i__ < guildChannels.size; ++i__) {
11667 guildChannels__vec.emplace_back(guildChannels.ptr[i__], DiscordObjectState::Owned);
11669 Discord_Free(guildChannels.ptr);
11670 userData__typed->delegate(std::move(result__obj), std::move(guildChannels__vec));
11672 Discord_Client_GetGuildChannels(
11673 &instance_, guildId, cb__native, Tcb__UserData::Free, cb__userData);
11675std::optional<discordpp::LobbyHandle> Client::GetLobbyHandle(uint64_t lobbyId)
const
11677 assert(state_ == DiscordObjectState::Owned);
11678 bool returnIsNonNull__;
11679 Discord_LobbyHandle returnValueNative__;
11680 returnIsNonNull__ = Discord_Client_GetLobbyHandle(&instance_, lobbyId, &returnValueNative__);
11681 if (!returnIsNonNull__) {
11685 return returnValue__;
11687std::vector<uint64_t> Client::GetLobbyIds()
const
11689 assert(state_ == DiscordObjectState::Owned);
11690 Discord_UInt64Span returnValueNative__;
11691 Discord_Client_GetLobbyIds(&instance_, &returnValueNative__);
11692 std::vector<uint64_t> returnValue__(returnValueNative__.ptr,
11693 returnValueNative__.ptr + returnValueNative__.size);
11694 Discord_Free(returnValueNative__.ptr);
11695 return returnValue__;
11699 assert(state_ == DiscordObjectState::Owned);
11700 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11701 auto cb__userData =
new Tcb__UserData(cb);
11702 Discord_Client_GetUserGuildsCallback cb__native =
11703 [](
auto result,
auto guilds,
void* userData__) {
11704 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11706 std::vector<discordpp::GuildMinimal> guilds__vec;
11707 guilds__vec.reserve(guilds.size);
11708 for (
size_t i__ = 0; i__ < guilds.size; ++i__) {
11709 guilds__vec.emplace_back(guilds.ptr[i__], DiscordObjectState::Owned);
11711 Discord_Free(guilds.ptr);
11712 userData__typed->delegate(std::move(result__obj), std::move(guilds__vec));
11714 Discord_Client_GetUserGuilds(&instance_, cb__native, Tcb__UserData::Free, cb__userData);
11716void Client::JoinLinkedLobbyGuild(
11721 assert(state_ == DiscordObjectState::Owned);
11722 using TprovisionalUserMergeRequiredCallback__UserData =
11723 TDelegateUserData<std::remove_reference_t<
decltype(provisionalUserMergeRequiredCallback)>>;
11724 auto provisionalUserMergeRequiredCallback__userData =
11725 new TprovisionalUserMergeRequiredCallback__UserData(provisionalUserMergeRequiredCallback);
11726 Discord_Client_ProvisionalUserMergeRequiredCallback
11727 provisionalUserMergeRequiredCallback__native = [](
void* userData__) {
11728 auto userData__typed =
11729 static_cast<TprovisionalUserMergeRequiredCallback__UserData*
>(userData__);
11730 userData__typed->delegate();
11732 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
11733 auto callback__userData =
new Tcallback__UserData(callback);
11734 Discord_Client_JoinLinkedLobbyGuildCallback callback__native =
11735 [](
auto result,
auto inviteUrl,
void* userData__) {
11736 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
11738 std::string inviteUrl__str(
reinterpret_cast<char*
>(inviteUrl.ptr), inviteUrl.size);
11739 userData__typed->delegate(std::move(result__obj), std::move(inviteUrl__str));
11740 Discord_Free(inviteUrl.ptr);
11742 Discord_Client_JoinLinkedLobbyGuild(&instance_,
11744 provisionalUserMergeRequiredCallback__native,
11745 TprovisionalUserMergeRequiredCallback__UserData::Free,
11746 provisionalUserMergeRequiredCallback__userData,
11748 Tcallback__UserData::Free,
11749 callback__userData);
11753 assert(state_ == DiscordObjectState::Owned);
11754 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
11755 auto callback__userData =
new Tcallback__UserData(callback);
11756 Discord_Client_LeaveLobbyCallback callback__native = [](
auto result,
void* userData__) {
11757 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
11759 userData__typed->delegate(std::move(result__obj));
11761 Discord_Client_LeaveLobby(
11762 &instance_, lobbyId, callback__native, Tcallback__UserData::Free, callback__userData);
11764void Client::LinkChannelToLobby(uint64_t lobbyId,
11765 uint64_t channelId,
11768 assert(state_ == DiscordObjectState::Owned);
11769 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
11770 auto callback__userData =
new Tcallback__UserData(callback);
11771 Discord_Client_LinkOrUnlinkChannelCallback callback__native = [](
auto result,
11772 void* userData__) {
11773 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
11775 userData__typed->delegate(std::move(result__obj));
11777 Discord_Client_LinkChannelToLobby(&instance_,
11781 Tcallback__UserData::Free,
11782 callback__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_LobbyCreatedCallback cb__native = [](
auto lobbyId,
void* userData__) {
11790 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11791 userData__typed->delegate(lobbyId);
11793 Discord_Client_SetLobbyCreatedCallback(
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_LobbyDeletedCallback cb__native = [](
auto lobbyId,
void* userData__) {
11802 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11803 userData__typed->delegate(lobbyId);
11805 Discord_Client_SetLobbyDeletedCallback(
11806 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11810 assert(state_ == DiscordObjectState::Owned);
11811 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11812 auto cb__userData =
new Tcb__UserData(cb);
11813 Discord_Client_LobbyMemberAddedCallback cb__native =
11814 [](
auto lobbyId,
auto memberId,
void* userData__) {
11815 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11816 userData__typed->delegate(lobbyId, memberId);
11818 Discord_Client_SetLobbyMemberAddedCallback(
11819 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11823 assert(state_ == DiscordObjectState::Owned);
11824 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11825 auto cb__userData =
new Tcb__UserData(cb);
11826 Discord_Client_LobbyMemberRemovedCallback cb__native =
11827 [](
auto lobbyId,
auto memberId,
void* userData__) {
11828 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11829 userData__typed->delegate(lobbyId, memberId);
11831 Discord_Client_SetLobbyMemberRemovedCallback(
11832 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11836 assert(state_ == DiscordObjectState::Owned);
11837 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11838 auto cb__userData =
new Tcb__UserData(cb);
11839 Discord_Client_LobbyMemberUpdatedCallback cb__native =
11840 [](
auto lobbyId,
auto memberId,
void* userData__) {
11841 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11842 userData__typed->delegate(lobbyId, memberId);
11844 Discord_Client_SetLobbyMemberUpdatedCallback(
11845 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11849 assert(state_ == DiscordObjectState::Owned);
11850 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11851 auto cb__userData =
new Tcb__UserData(cb);
11852 Discord_Client_LobbyUpdatedCallback cb__native = [](
auto lobbyId,
void* userData__) {
11853 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11854 userData__typed->delegate(lobbyId);
11856 Discord_Client_SetLobbyUpdatedCallback(
11857 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11859void Client::UnlinkChannelFromLobby(uint64_t lobbyId,
11862 assert(state_ == DiscordObjectState::Owned);
11863 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
11864 auto callback__userData =
new Tcallback__UserData(callback);
11865 Discord_Client_LinkOrUnlinkChannelCallback callback__native = [](
auto result,
11866 void* userData__) {
11867 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
11869 userData__typed->delegate(std::move(result__obj));
11871 Discord_Client_UnlinkChannelFromLobby(
11872 &instance_, lobbyId, callback__native, Tcallback__UserData::Free, callback__userData);
11876 assert(state_ == DiscordObjectState::Owned);
11877 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
11878 auto callback__userData =
new Tcallback__UserData(callback);
11879 Discord_Client_IsDiscordAppInstalledCallback callback__native = [](
auto installed,
11880 void* userData__) {
11881 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
11882 userData__typed->delegate(installed);
11884 Discord_Client_IsDiscordAppInstalled(
11885 &instance_, callback__native, Tcallback__UserData::Free, callback__userData);
11890 assert(state_ == DiscordObjectState::Owned);
11891 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11892 auto cb__userData =
new Tcb__UserData(cb);
11893 Discord_Client_AcceptActivityInviteCallback cb__native =
11894 [](
auto result,
auto joinSecret,
void* userData__) {
11895 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11897 std::string joinSecret__str(
reinterpret_cast<char*
>(joinSecret.ptr), joinSecret.size);
11898 userData__typed->delegate(std::move(result__obj), std::move(joinSecret__str));
11899 Discord_Free(joinSecret.ptr);
11901 Discord_Client_AcceptActivityInvite(
11902 &instance_, invite.instance(), cb__native, Tcb__UserData::Free, cb__userData);
11904void Client::ClearRichPresence()
11906 assert(state_ == DiscordObjectState::Owned);
11907 Discord_Client_ClearRichPresence(&instance_);
11909bool Client::RegisterLaunchCommand(uint64_t applicationId, std::string command)
11911 assert(state_ == DiscordObjectState::Owned);
11912 bool returnValue__;
11913 Discord_String command__str{(uint8_t*)(command.data()), command.size()};
11914 returnValue__ = Discord_Client_RegisterLaunchCommand(&instance_, applicationId, command__str);
11915 return returnValue__;
11917bool Client::RegisterLaunchSteamApplication(uint64_t applicationId, uint32_t steamAppId)
11919 assert(state_ == DiscordObjectState::Owned);
11920 bool returnValue__;
11922 Discord_Client_RegisterLaunchSteamApplication(&instance_, applicationId, steamAppId);
11923 return returnValue__;
11925void Client::SendActivityInvite(uint64_t userId,
11926 std::string
const& content,
11929 assert(state_ == DiscordObjectState::Owned);
11930 Discord_String content__str{(uint8_t*)(content.data()), content.size()};
11931 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11932 auto cb__userData =
new Tcb__UserData(cb);
11933 Discord_Client_SendActivityInviteCallback cb__native = [](
auto result,
void* userData__) {
11934 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11936 userData__typed->delegate(std::move(result__obj));
11938 Discord_Client_SendActivityInvite(
11939 &instance_, userId, content__str, cb__native, Tcb__UserData::Free, cb__userData);
11941void Client::SendActivityJoinRequest(uint64_t userId,
11944 assert(state_ == DiscordObjectState::Owned);
11945 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11946 auto cb__userData =
new Tcb__UserData(cb);
11947 Discord_Client_SendActivityInviteCallback cb__native = [](
auto result,
void* userData__) {
11948 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11950 userData__typed->delegate(std::move(result__obj));
11952 Discord_Client_SendActivityJoinRequest(
11953 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
11958 assert(state_ == DiscordObjectState::Owned);
11959 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11960 auto cb__userData =
new Tcb__UserData(cb);
11961 Discord_Client_SendActivityInviteCallback cb__native = [](
auto result,
void* userData__) {
11962 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11964 userData__typed->delegate(std::move(result__obj));
11966 Discord_Client_SendActivityJoinRequestReply(
11967 &instance_, invite.instance(), cb__native, Tcb__UserData::Free, cb__userData);
11971 assert(state_ == DiscordObjectState::Owned);
11972 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11973 auto cb__userData =
new Tcb__UserData(cb);
11974 Discord_Client_ActivityInviteCallback cb__native = [](
auto invite,
void* userData__) {
11975 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11977 userData__typed->delegate(std::move(invite__obj));
11979 Discord_Client_SetActivityInviteCreatedCallback(
11980 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11984 assert(state_ == DiscordObjectState::Owned);
11985 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11986 auto cb__userData =
new Tcb__UserData(cb);
11987 Discord_Client_ActivityInviteCallback cb__native = [](
auto invite,
void* userData__) {
11988 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11990 userData__typed->delegate(std::move(invite__obj));
11992 Discord_Client_SetActivityInviteUpdatedCallback(
11993 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11997 assert(state_ == DiscordObjectState::Owned);
11998 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11999 auto cb__userData =
new Tcb__UserData(cb);
12000 Discord_Client_ActivityJoinCallback cb__native = [](
auto joinSecret,
void* userData__) {
12001 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12002 std::string joinSecret__str(
reinterpret_cast<char*
>(joinSecret.ptr), joinSecret.size);
12003 userData__typed->delegate(std::move(joinSecret__str));
12004 Discord_Free(joinSecret.ptr);
12006 Discord_Client_SetActivityJoinCallback(
12007 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
12009void Client::SetActivityJoinWithApplicationCallback(
12012 assert(state_ == DiscordObjectState::Owned);
12013 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12014 auto cb__userData =
new Tcb__UserData(cb);
12015 Discord_Client_ActivityJoinWithApplicationCallback cb__native =
12016 [](
auto applicationId,
auto joinSecret,
void* userData__) {
12017 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12018 std::string joinSecret__str(
reinterpret_cast<char*
>(joinSecret.ptr), joinSecret.size);
12019 userData__typed->delegate(applicationId, std::move(joinSecret__str));
12020 Discord_Free(joinSecret.ptr);
12022 Discord_Client_SetActivityJoinWithApplicationCallback(
12023 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
12028 assert(state_ == DiscordObjectState::Owned);
12029 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
12030 auto callback__userData =
new Tcallback__UserData(callback);
12031 Discord_Client_UpdateStatusCallback callback__native = [](
auto result,
void* userData__) {
12032 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
12034 userData__typed->delegate(std::move(result__obj));
12036 Discord_Client_SetOnlineStatus(&instance_,
12037 static_cast<Discord_StatusType
>(status),
12039 Tcallback__UserData::Free,
12040 callback__userData);
12045 assert(state_ == DiscordObjectState::Owned);
12046 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12047 auto cb__userData =
new Tcb__UserData(cb);
12048 Discord_Client_UpdateRichPresenceCallback cb__native = [](
auto result,
void* userData__) {
12049 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12051 userData__typed->delegate(std::move(result__obj));
12053 Discord_Client_UpdateRichPresence(
12054 &instance_, activity.instance(), cb__native, Tcb__UserData::Free, cb__userData);
12056void Client::AcceptDiscordFriendRequest(uint64_t userId,
12059 assert(state_ == DiscordObjectState::Owned);
12060 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12061 auto cb__userData =
new Tcb__UserData(cb);
12062 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
12063 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12065 userData__typed->delegate(std::move(result__obj));
12067 Discord_Client_AcceptDiscordFriendRequest(
12068 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
12070void Client::AcceptGameFriendRequest(uint64_t userId,
12073 assert(state_ == DiscordObjectState::Owned);
12074 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12075 auto cb__userData =
new Tcb__UserData(cb);
12076 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
12077 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12079 userData__typed->delegate(std::move(result__obj));
12081 Discord_Client_AcceptGameFriendRequest(
12082 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
12086 assert(state_ == DiscordObjectState::Owned);
12087 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12088 auto cb__userData =
new Tcb__UserData(cb);
12089 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
12090 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12092 userData__typed->delegate(std::move(result__obj));
12094 Discord_Client_BlockUser(&instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
12096void Client::CancelDiscordFriendRequest(uint64_t userId,
12099 assert(state_ == DiscordObjectState::Owned);
12100 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12101 auto cb__userData =
new Tcb__UserData(cb);
12102 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
12103 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12105 userData__typed->delegate(std::move(result__obj));
12107 Discord_Client_CancelDiscordFriendRequest(
12108 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
12110void Client::CancelGameFriendRequest(uint64_t userId,
12113 assert(state_ == DiscordObjectState::Owned);
12114 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12115 auto cb__userData =
new Tcb__UserData(cb);
12116 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
12117 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12119 userData__typed->delegate(std::move(result__obj));
12121 Discord_Client_CancelGameFriendRequest(
12122 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
12126 assert(state_ == DiscordObjectState::Owned);
12127 Discord_RelationshipHandle returnValueNative__{};
12128 Discord_Client_GetRelationshipHandle(&instance_, userId, &returnValueNative__);
12130 return returnValue__;
12132std::vector<discordpp::RelationshipHandle> Client::GetRelationships()
const
12134 assert(state_ == DiscordObjectState::Owned);
12135 Discord_RelationshipHandleSpan returnValueNative__;
12136 Discord_Client_GetRelationships(&instance_, &returnValueNative__);
12137 std::vector<discordpp::RelationshipHandle> returnValue__;
12138 returnValue__.reserve(returnValueNative__.size);
12139 for (
size_t i__ = 0; i__ < returnValueNative__.size; ++i__) {
12140 returnValue__.emplace_back(returnValueNative__.ptr[i__], DiscordObjectState::Owned);
12142 Discord_Free(returnValueNative__.ptr);
12143 return returnValue__;
12145std::vector<discordpp::RelationshipHandle> Client::GetRelationshipsByGroup(
12148 assert(state_ == DiscordObjectState::Owned);
12149 Discord_RelationshipHandleSpan returnValueNative__;
12150 Discord_Client_GetRelationshipsByGroup(
12151 &instance_,
static_cast<Discord_RelationshipGroupType
>(groupType), &returnValueNative__);
12152 std::vector<discordpp::RelationshipHandle> returnValue__;
12153 returnValue__.reserve(returnValueNative__.size);
12154 for (
size_t i__ = 0; i__ < returnValueNative__.size; ++i__) {
12155 returnValue__.emplace_back(returnValueNative__.ptr[i__], DiscordObjectState::Owned);
12157 Discord_Free(returnValueNative__.ptr);
12158 return returnValue__;
12160void Client::RejectDiscordFriendRequest(uint64_t userId,
12163 assert(state_ == DiscordObjectState::Owned);
12164 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12165 auto cb__userData =
new Tcb__UserData(cb);
12166 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
12167 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12169 userData__typed->delegate(std::move(result__obj));
12171 Discord_Client_RejectDiscordFriendRequest(
12172 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
12174void Client::RejectGameFriendRequest(uint64_t userId,
12177 assert(state_ == DiscordObjectState::Owned);
12178 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12179 auto cb__userData =
new Tcb__UserData(cb);
12180 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
12181 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12183 userData__typed->delegate(std::move(result__obj));
12185 Discord_Client_RejectGameFriendRequest(
12186 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
12188void Client::RemoveDiscordAndGameFriend(uint64_t userId,
12191 assert(state_ == DiscordObjectState::Owned);
12192 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12193 auto cb__userData =
new Tcb__UserData(cb);
12194 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
12195 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12197 userData__typed->delegate(std::move(result__obj));
12199 Discord_Client_RemoveDiscordAndGameFriend(
12200 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
12204 assert(state_ == DiscordObjectState::Owned);
12205 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12206 auto cb__userData =
new Tcb__UserData(cb);
12207 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
12208 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12210 userData__typed->delegate(std::move(result__obj));
12212 Discord_Client_RemoveGameFriend(
12213 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
12215std::vector<discordpp::UserHandle> Client::SearchFriendsByUsername(std::string searchStr)
const
12217 assert(state_ == DiscordObjectState::Owned);
12218 Discord_UserHandleSpan returnValueNative__;
12219 Discord_String searchStr__str{(uint8_t*)(searchStr.data()), searchStr.size()};
12220 Discord_Client_SearchFriendsByUsername(&instance_, searchStr__str, &returnValueNative__);
12221 std::vector<discordpp::UserHandle> returnValue__;
12222 returnValue__.reserve(returnValueNative__.size);
12223 for (
size_t i__ = 0; i__ < returnValueNative__.size; ++i__) {
12224 returnValue__.emplace_back(returnValueNative__.ptr[i__], DiscordObjectState::Owned);
12226 Discord_Free(returnValueNative__.ptr);
12227 return returnValue__;
12229void Client::SendDiscordFriendRequest(std::string
const& username,
12232 assert(state_ == DiscordObjectState::Owned);
12233 Discord_String username__str{(uint8_t*)(username.data()), username.size()};
12234 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12235 auto cb__userData =
new Tcb__UserData(cb);
12236 Discord_Client_SendFriendRequestCallback cb__native = [](
auto result,
void* userData__) {
12237 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12239 userData__typed->delegate(std::move(result__obj));
12241 Discord_Client_SendDiscordFriendRequest(
12242 &instance_, username__str, cb__native, Tcb__UserData::Free, cb__userData);
12244void Client::SendDiscordFriendRequestById(uint64_t userId,
12247 assert(state_ == DiscordObjectState::Owned);
12248 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12249 auto cb__userData =
new Tcb__UserData(cb);
12250 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
12251 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12253 userData__typed->delegate(std::move(result__obj));
12255 Discord_Client_SendDiscordFriendRequestById(
12256 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
12258void Client::SendGameFriendRequest(std::string
const& username,
12261 assert(state_ == DiscordObjectState::Owned);
12262 Discord_String username__str{(uint8_t*)(username.data()), username.size()};
12263 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12264 auto cb__userData =
new Tcb__UserData(cb);
12265 Discord_Client_SendFriendRequestCallback cb__native = [](
auto result,
void* userData__) {
12266 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12268 userData__typed->delegate(std::move(result__obj));
12270 Discord_Client_SendGameFriendRequest(
12271 &instance_, username__str, cb__native, Tcb__UserData::Free, cb__userData);
12273void Client::SendGameFriendRequestById(uint64_t userId,
12276 assert(state_ == DiscordObjectState::Owned);
12277 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12278 auto cb__userData =
new Tcb__UserData(cb);
12279 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
12280 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12282 userData__typed->delegate(std::move(result__obj));
12284 Discord_Client_SendGameFriendRequestById(
12285 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
12289 assert(state_ == DiscordObjectState::Owned);
12290 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12291 auto cb__userData =
new Tcb__UserData(cb);
12292 Discord_Client_RelationshipCreatedCallback cb__native =
12293 [](
auto userId,
auto isDiscordRelationshipUpdate,
void* userData__) {
12294 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12295 userData__typed->delegate(userId, isDiscordRelationshipUpdate);
12297 Discord_Client_SetRelationshipCreatedCallback(
12298 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
12302 assert(state_ == DiscordObjectState::Owned);
12303 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12304 auto cb__userData =
new Tcb__UserData(cb);
12305 Discord_Client_RelationshipDeletedCallback cb__native =
12306 [](
auto userId,
auto isDiscordRelationshipUpdate,
void* userData__) {
12307 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12308 userData__typed->delegate(userId, isDiscordRelationshipUpdate);
12310 Discord_Client_SetRelationshipDeletedCallback(
12311 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
12315 assert(state_ == DiscordObjectState::Owned);
12316 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12317 auto cb__userData =
new Tcb__UserData(cb);
12318 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
12319 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12321 userData__typed->delegate(std::move(result__obj));
12323 Discord_Client_UnblockUser(&instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
12325std::optional<discordpp::UserHandle> Client::GetCurrentUserV2()
const
12327 assert(state_ == DiscordObjectState::Owned);
12328 bool returnIsNonNull__;
12329 Discord_UserHandle returnValueNative__;
12330 returnIsNonNull__ = Discord_Client_GetCurrentUserV2(&instance_, &returnValueNative__);
12331 if (!returnIsNonNull__) {
12335 return returnValue__;
12337void Client::GetDiscordClientConnectedUser(
12338 uint64_t applicationId,
12341 assert(state_ == DiscordObjectState::Owned);
12342 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
12343 auto callback__userData =
new Tcallback__UserData(callback);
12344 Discord_Client_GetDiscordClientConnectedUserCallback callback__native =
12345 [](
auto result,
auto user,
void* userData__) {
12346 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
12348 std::optional<discordpp::UserHandle> user__opt{};
12352 userData__typed->delegate(std::move(result__obj), std::move(user__opt));
12354 Discord_Client_GetDiscordClientConnectedUser(
12355 &instance_, applicationId, callback__native, Tcallback__UserData::Free, callback__userData);
12357std::optional<discordpp::UserHandle> Client::GetUser(uint64_t userId)
const
12359 assert(state_ == DiscordObjectState::Owned);
12360 bool returnIsNonNull__;
12361 Discord_UserHandle returnValueNative__;
12362 returnIsNonNull__ = Discord_Client_GetUser(&instance_, userId, &returnValueNative__);
12363 if (!returnIsNonNull__) {
12367 return returnValue__;
12369void Client::SetRelationshipGroupsUpdatedCallback(
12372 assert(state_ == DiscordObjectState::Owned);
12373 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12374 auto cb__userData =
new Tcb__UserData(cb);
12375 Discord_Client_RelationshipGroupsUpdatedCallback cb__native = [](
auto userId,
12376 void* userData__) {
12377 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12378 userData__typed->delegate(userId);
12380 Discord_Client_SetRelationshipGroupsUpdatedCallback(
12381 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
12385 assert(state_ == DiscordObjectState::Owned);
12386 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12387 auto cb__userData =
new Tcb__UserData(cb);
12388 Discord_Client_UserUpdatedCallback cb__native = [](
auto userId,
void* userData__) {
12389 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12390 userData__typed->delegate(userId);
12392 Discord_Client_SetUserUpdatedCallback(
12393 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
12395const CallInfoHandle CallInfoHandle::nullobj{{}, DiscordObjectState::Invalid};
12396CallInfoHandle::~CallInfoHandle()
12398 if (state_ == DiscordObjectState::Owned) {
12400 state_ = DiscordObjectState::Invalid;
12403CallInfoHandle::CallInfoHandle(CallInfoHandle&& other) noexcept
12404 : instance_(other.instance_)
12405 , state_(other.state_)
12407 other.state_ = DiscordObjectState::Invalid;
12409CallInfoHandle& CallInfoHandle::operator=(CallInfoHandle&& other)
noexcept
12411 if (
this != &other) {
12412 if (state_ == DiscordObjectState::Owned) {
12415 instance_ = other.instance_;
12416 state_ = other.state_;
12417 other.state_ = DiscordObjectState::Invalid;
12421CallInfoHandle::CallInfoHandle(
const CallInfoHandle& other)
12426 Discord_CallInfoHandle_Clone(&instance_, other.instance());
12428 state_ = DiscordObjectState::Owned;
12431CallInfoHandle& CallInfoHandle::operator=(
const CallInfoHandle& other)
12433 if (
this != &other) {
12434 if (state_ == DiscordObjectState::Owned) {
12436 state_ = DiscordObjectState::Invalid;
12438 if (other.state_ == DiscordObjectState::Owned) {
12439 Discord_CallInfoHandle_Clone(&instance_, other.instance());
12441 state_ = DiscordObjectState::Owned;
12446CallInfoHandle::CallInfoHandle(Discord_CallInfoHandle instance, DiscordObjectState state)
12447 : instance_(instance)
12451void CallInfoHandle::Drop()
12453 if (state_ != DiscordObjectState::Owned) {
12456 Discord_CallInfoHandle_Drop(&instance_);
12457 state_ = DiscordObjectState::Invalid;
12459uint64_t CallInfoHandle::ChannelId()
const
12461 assert(state_ == DiscordObjectState::Owned);
12462 uint64_t returnValue__;
12463 returnValue__ = Discord_CallInfoHandle_ChannelId(&instance_);
12464 return returnValue__;
12466std::vector<uint64_t> CallInfoHandle::GetParticipants()
const
12468 assert(state_ == DiscordObjectState::Owned);
12469 Discord_UInt64Span returnValueNative__;
12470 Discord_CallInfoHandle_GetParticipants(&instance_, &returnValueNative__);
12471 std::vector<uint64_t> returnValue__(returnValueNative__.ptr,
12472 returnValueNative__.ptr + returnValueNative__.size);
12473 Discord_Free(returnValueNative__.ptr);
12474 return returnValue__;
12476std::optional<discordpp::VoiceStateHandle> CallInfoHandle::GetVoiceStateHandle(
12477 uint64_t userId)
const
12479 assert(state_ == DiscordObjectState::Owned);
12480 bool returnIsNonNull__;
12481 Discord_VoiceStateHandle returnValueNative__;
12482 returnIsNonNull__ =
12483 Discord_CallInfoHandle_GetVoiceStateHandle(&instance_, userId, &returnValueNative__);
12484 if (!returnIsNonNull__) {
12488 return returnValue__;
12490uint64_t CallInfoHandle::GuildId()
const
12492 assert(state_ == DiscordObjectState::Owned);
12493 uint64_t returnValue__;
12494 returnValue__ = Discord_CallInfoHandle_GuildId(&instance_);
12495 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:2894
static std::string TypeToString(discordpp::AdditionalContentType type)
Converts the AdditionalContentType enum to a string.
AdditionalContent & operator=(AdditionalContent &&other) noexcept
Move assignment operator for AdditionalContent.
void SetCount(uint8_t Count)
Setter for AdditionalContent::Count.
void SetType(discordpp::AdditionalContentType Type)
Setter for AdditionalContent::Type.
std::optional< std::string > Title() const
When the additional content is a poll or thread, this field will contain the name of the poll or thre...
discordpp::AdditionalContentType Type() const
Represents the type of additional content in the message.
uint8_t Count() const
Represents the number of pieces of additional content so you could for example renders "2 additional ...
bool Equals(discordpp::AdditionalContent rhs) const
Compares each field of the AdditionalContent struct for equality.
AdditionalContent(AdditionalContent &&other) noexcept
Move constructor for AdditionalContent.
AdditionalContent & operator=(const AdditionalContent &arg0)
Copy assignment operator for AdditionalContent.
AdditionalContent(const AdditionalContent &arg0)
Copy constructor for AdditionalContent.
void SetTitle(std::optional< std::string > Title)
Setter for AdditionalContent::Title.
static const AdditionalContent nullobj
Uninitialized instance of AdditionalContent.
Definition discordpp.h:2913
Represents a single input or output audio device available to the user.
Definition discordpp.h:3127
AudioDevice & operator=(const AudioDevice &arg0)
Copy assignment operator for AudioDevice.
bool Equals(discordpp::AudioDevice rhs)
Compares the ID of two AudioDevice objects for equality.
std::string Name() const
The display name of the audio device.
bool IsDefault() const
Whether the audio device is the system default device.
std::string Id() const
The ID of the audio device.
AudioDevice(AudioDevice &&other) noexcept
Move constructor for AudioDevice.
AudioDevice & operator=(AudioDevice &&other) noexcept
Move assignment operator for AudioDevice.
static const AudioDevice nullobj
Uninitialized instance of AudioDevice.
Definition discordpp.h:3146
void SetId(std::string Id)
Setter for AudioDevice::Id.
void SetIsDefault(bool IsDefault)
Setter for AudioDevice::IsDefault.
void SetName(std::string Name)
Setter for AudioDevice::Name.
AudioDevice(const AudioDevice &arg0)
Copy constructor for AudioDevice.
Arguments to the Client::Authorize function.
Definition discordpp.h:1629
void SetIntegrationType(std::optional< discordpp::IntegrationType > IntegrationType)
Setter for AuthorizationArgs::IntegrationType.
std::optional< std::string > State() const
See https://entry.hychan.art/developers/docs/topics/oauth2#state-and-security for details on this field.
AuthorizationArgs & operator=(AuthorizationArgs &&other) noexcept
Move assignment operator for AuthorizationArgs.
void SetCustomSchemeParam(std::optional< std::string > CustomSchemeParam)
Setter for AuthorizationArgs::CustomSchemeParam.
std::optional< std::string > Nonce() const
The nonce field is generally only useful for backend integrations using ID tokens.
std::optional< discordpp::AuthorizationCodeChallenge > CodeChallenge() const
If using the Client::GetToken flow, you will need to generate a code challenge and verifier.
uint64_t ClientId() const
Optional. The Discord application ID for your game. Defaults to the value set by Client::SetApplicati...
AuthorizationArgs(const AuthorizationArgs &arg0)
Copy constructor for AuthorizationArgs.
void SetScopes(std::string Scopes)
Setter for AuthorizationArgs::Scopes.
static const AuthorizationArgs nullobj
Uninitialized instance of AuthorizationArgs.
Definition discordpp.h:1648
void SetClientId(uint64_t ClientId)
Setter for AuthorizationArgs::ClientId.
std::optional< std::string > CustomSchemeParam() const
Custom URI scheme for mobile redirects.
std::optional< discordpp::IntegrationType > IntegrationType() const
The type of integration the app will be installed as.
void SetCodeChallenge(std::optional< discordpp::AuthorizationCodeChallenge > CodeChallenge)
Setter for AuthorizationArgs::CodeChallenge.
AuthorizationArgs(AuthorizationArgs &&other) noexcept
Move constructor for AuthorizationArgs.
AuthorizationArgs & operator=(const AuthorizationArgs &arg0)
Copy assignment operator for AuthorizationArgs.
std::string Scopes() const
Scopes is a space separated string of the oauth scopes your game is requesting.
void SetNonce(std::optional< std::string > Nonce)
Setter for AuthorizationArgs::Nonce.
void SetState(std::optional< std::string > State)
Setter for AuthorizationArgs::State.
Struct that encapsulates the challenge part of the code verification flow.
Definition discordpp.h:1537
discordpp::AuthenticationCodeChallengeMethod Method() const
The method used to generate the challenge. The only method used by the SDK is sha256.
AuthorizationCodeChallenge(const AuthorizationCodeChallenge &arg0)
Copy constructor for AuthorizationCodeChallenge.
std::string Challenge() const
The challenge value.
AuthorizationCodeChallenge & operator=(AuthorizationCodeChallenge &&other) noexcept
Move assignment operator for AuthorizationCodeChallenge.
void SetMethod(discordpp::AuthenticationCodeChallengeMethod Method)
Setter for AuthorizationCodeChallenge::Method.
static const AuthorizationCodeChallenge nullobj
Uninitialized instance of AuthorizationCodeChallenge.
Definition discordpp.h:1557
AuthorizationCodeChallenge & operator=(const AuthorizationCodeChallenge &arg0)
Copy assignment operator for AuthorizationCodeChallenge.
AuthorizationCodeChallenge(AuthorizationCodeChallenge &&other) noexcept
Move constructor for AuthorizationCodeChallenge.
void SetChallenge(std::string Challenge)
Setter for AuthorizationCodeChallenge::Challenge.
Struct that encapsulates both parts of the code verification flow.
Definition discordpp.h:1584
AuthorizationCodeVerifier(const AuthorizationCodeVerifier &arg0)
Copy constructor for AuthorizationCodeVerifier.
AuthorizationCodeVerifier & operator=(const AuthorizationCodeVerifier &arg0)
Copy assignment operator for AuthorizationCodeVerifier.
void SetVerifier(std::string Verifier)
Setter for AuthorizationCodeVerifier::Verifier.
AuthorizationCodeVerifier(AuthorizationCodeVerifier &&other) noexcept
Move constructor for AuthorizationCodeVerifier.
std::string Verifier() const
The verifier part of the code verification flow.
void SetChallenge(discordpp::AuthorizationCodeChallenge Challenge)
Setter for AuthorizationCodeVerifier::Challenge.
static const AuthorizationCodeVerifier nullobj
Uninitialized instance of AuthorizationCodeVerifier.
Definition discordpp.h:1604
discordpp::AuthorizationCodeChallenge Challenge() const
The challenge part of the code verification flow.
AuthorizationCodeVerifier & operator=(AuthorizationCodeVerifier &&other) noexcept
Move assignment operator for AuthorizationCodeVerifier.
Convenience class that represents the state of a single Discord call in a lobby.
Definition discordpp.h:5218
std::optional< discordpp::VoiceStateHandle > GetVoiceStateHandle(uint64_t userId) const
Accesses the voice state for a single user so you can know if they have muted or deafened themselves.
std::vector< uint64_t > GetParticipants() const
Returns a list of the user IDs of the participants in the call.
CallInfoHandle & operator=(const CallInfoHandle &other)
Copy assignment operator for CallInfoHandle.
CallInfoHandle(const CallInfoHandle &other)
Copy constructor for CallInfoHandle.
CallInfoHandle & operator=(CallInfoHandle &&other) noexcept
Move assignment operator for CallInfoHandle.
uint64_t GuildId() const
Returns the lobby ID of the call.
static const CallInfoHandle nullobj
Uninitialized instance of CallInfoHandle.
Definition discordpp.h:5237
CallInfoHandle(CallInfoHandle &&other) noexcept
Move constructor for CallInfoHandle.
uint64_t ChannelId() const
Returns the lobby ID of the call.
Class that manages an active voice session in a Lobby.
Definition discordpp.h:1889
static std::string ErrorToString(discordpp::Call::Error type)
Converts the Error enum to a string.
Call & operator=(const Call &other)
Copy assignment operator for Call.
void SetSelfDeaf(bool deaf)
Mutes all audio from the currently active call for the current user. They will not be able to hear an...
std::function< void(uint64_t userId, bool isPlayingSound)> OnSpeakingStatusChanged
Callback function for Call::SetSpeakingStatusChangedCallback.
Definition discordpp.h:1950
static const Call nullobj
Uninitialized instance of Call.
Definition discordpp.h:1967
Call(Call &&other) noexcept
Move constructor for Call.
void SetOnVoiceStateChangedCallback(discordpp::Call::OnVoiceStateChanged cb)
Sets a callback function to generally be invoked whenever a field on a VoiceStateHandle object for a ...
Call & operator=(Call &&other) noexcept
Move assignment operator for Call.
discordpp::AudioModeType GetAudioMode()
Returns whether the call is configured to use voice auto detection or push to talk for the current us...
bool GetPTTActive()
Returns whether push to talk is currently active, meaning the user is currently pressing their config...
discordpp::VADThresholdSettings GetVADThreshold() const
Returns the current configuration for void auto detection thresholds. See the description of the VADT...
std::optional< discordpp::VoiceStateHandle > GetVoiceStateHandle(uint64_t userId) const
Returns a reference to the VoiceStateHandle for the user ID of the given call participant.
static std::string StatusToString(discordpp::Call::Status type)
Converts the Status enum to a string.
void SetVADThreshold(bool automatic, float threshold)
Customizes the void auto detection thresholds for picking up activity from a user's mic.
bool GetSelfDeaf()
Returns whether the current user is deafened.
Error
Enum that represents any network errors with the Call.
Definition discordpp.h:1897
@ None
None.
Definition discordpp.h:1900
@ Forbidden
Forbidden.
Definition discordpp.h:1915
@ SignalingConnectionFailed
SignalingConnectionFailed.
Definition discordpp.h:1903
@ SignalingUnexpectedClose
SignalingUnexpectedClose.
Definition discordpp.h:1906
@ JoinTimeout
JoinTimeout.
Definition discordpp.h:1912
@ VoiceConnectionFailed
VoiceConnectionFailed.
Definition discordpp.h:1909
Status
Enum that respresents the state of the Call's network connection.
Definition discordpp.h:1919
@ Disconnecting
Disconnecting.
Definition discordpp.h:1940
@ Connected
Connected.
Definition discordpp.h:1934
@ Reconnecting
Reconnecting.
Definition discordpp.h:1937
@ Connecting
Connecting.
Definition discordpp.h:1928
@ SignalingConnected
SignalingConnected.
Definition discordpp.h:1931
@ Disconnected
Disconnected.
Definition discordpp.h:1922
@ Joining
Joining.
Definition discordpp.h:1925
void SetLocalMute(uint64_t userId, bool mute)
Locally mutes the given userId, so that the current user cannot hear them anymore.
void SetSpeakingStatusChangedCallback(discordpp::Call::OnSpeakingStatusChanged cb)
Sets a callback function to be invoked whenever a user starts or stops speaking and is passed in the ...
std::function< void(discordpp::Call::Status status, discordpp::Call::Error error, int32_t errorDetail)> OnStatusChanged
Callback function for Call::SetStatusChangedCallback.
Definition discordpp.h:1953
uint32_t GetPTTReleaseDelay()
Returns the time that PTT is active after the user releases the PTT key and SetPTTActive(false) is ca...
uint64_t GetGuildId() const
Returns the ID of the lobby with which this call is associated.
Call(const Call &other)
Copy constructor for Call.
void SetPTTActive(bool active)
When push to talk is enabled, this should be called whenever the user pushes or releases their config...
void SetParticipantChangedCallback(discordpp::Call::OnParticipantChanged cb)
Sets a callback function to be invoked whenever some joins or leaves a voice call.
std::vector< uint64_t > GetParticipants() const
Returns a list of all of the user IDs of the participants in the call.
bool GetSelfMute()
Returns whether the current user's microphone is muted.
void SetPTTReleaseDelay(uint32_t releaseDelayMs)
If set, extends the time that PTT is active after the user releases the PTT key and SetPTTActive(fals...
discordpp::Call::Status GetStatus() const
Returns the current call status.
std::function< void(uint64_t userId, bool added)> OnParticipantChanged
Callback function for Call::SetParticipantChangedCallback.
Definition discordpp.h:1947
void SetParticipantVolume(uint64_t userId, float volume)
Locally changes the playout volume of the given userId.
void SetStatusChangedCallback(discordpp::Call::OnStatusChanged cb)
Sets a callback function to be invoked when the call status changes, such as when it fully connects o...
void SetAudioMode(discordpp::AudioModeType audioMode)
Sets whether to use voice auto detection or push to talk for the current user on this call.
bool GetLocalMute(uint64_t userId)
Returns whether the current user has locally muted the given userId for themselves.
float GetParticipantVolume(uint64_t userId)
Returns the locally set playout volume of the given userId.
void SetSelfMute(bool mute)
Mutes the current user's microphone so that no other participant in their active calls can hear them.
std::function< void(uint64_t userId)> OnVoiceStateChanged
Callback function for Call::SetOnVoiceStateChangedCallback.
Definition discordpp.h:1944
uint64_t GetChannelId() const
Returns the ID of the lobby with which this call is associated.
All messages sent on Discord are done so in a Channel. MessageHandle::ChannelId will contain the ID o...
Definition discordpp.h:2116
ChannelHandle(const ChannelHandle &other)
Copy constructor for ChannelHandle.
ChannelHandle & operator=(const ChannelHandle &other)
Copy assignment operator for ChannelHandle.
static const ChannelHandle nullobj
Uninitialized instance of ChannelHandle.
Definition discordpp.h:2135
uint64_t Id() const
Returns the ID of the channel.
ChannelHandle & operator=(ChannelHandle &&other) noexcept
Move assignment operator for ChannelHandle.
ChannelHandle(ChannelHandle &&other) noexcept
Move constructor for ChannelHandle.
std::vector< uint64_t > Recipients() const
For DMs and GroupDMs, returns the user IDs of the members of the channel. For all other channels retu...
std::string Name() const
Returns the name of the channel.
discordpp::ChannelType Type() const
Returns the type of the channel.
Options for creating a new Client instance.
Definition discordpp.h:3221
void SetCpuAffinityMask(std::optional< uint64_t > CpuAffinityMask)
Setter for ClientCreateOptions::CpuAffinityMask.
discordpp::AudioSystem ExperimentalAudioSystem() const
The audio system to use. Defaults to AudioSystem::Standard.
static const ClientCreateOptions nullobj
Uninitialized instance of ClientCreateOptions.
Definition discordpp.h:3240
ClientCreateOptions & operator=(const ClientCreateOptions &arg0)
Copy assignment operator for ClientCreateOptions.
bool ExperimentalAndroidPreventCommsForBluetooth() const
Whether to prevent communications mode on Android when Bluetooth is connected.
std::string WebBase() const
The base URL for the Discord web application.
std::string ApiBase() const
The base URL for the Discord API.
void SetApiBase(std::string ApiBase)
Setter for ClientCreateOptions::ApiBase.
ClientCreateOptions(const ClientCreateOptions &arg0)
Copy constructor for ClientCreateOptions.
void SetExperimentalAudioSystem(discordpp::AudioSystem ExperimentalAudioSystem)
Setter for ClientCreateOptions::ExperimentalAudioSystem.
ClientCreateOptions(ClientCreateOptions &&other) noexcept
Move constructor for ClientCreateOptions.
std::optional< uint64_t > CpuAffinityMask() const
CPU affinity mask hint for certain platforms. Depending on platform support, may or may not be ignore...
void SetWebBase(std::string WebBase)
Setter for ClientCreateOptions::WebBase.
void SetExperimentalAndroidPreventCommsForBluetooth(bool ExperimentalAndroidPreventCommsForBluetooth)
Setter for ClientCreateOptions::ExperimentalAndroidPreventCommsForBluetooth.
ClientCreateOptions & operator=(ClientCreateOptions &&other) noexcept
Move assignment operator for ClientCreateOptions.
Struct that stores information about the result of an SDK function call.
Definition discordpp.h:1444
void SetRetryable(bool Retryable)
Setter for ClientResult::Retryable.
bool Retryable() const
Indicates if, although an API request failed, it is safe and recommended to retry it.
void SetErrorCode(int32_t ErrorCode)
Setter for ClientResult::ErrorCode.
ClientResult & operator=(const ClientResult &arg0)
Copy assignment operator for ClientResult.
void SetStatus(discordpp::HttpStatusCode Status)
Setter for ClientResult::Status.
std::string Error() const
A description of the error that occurred.
discordpp::ErrorType Type() const
The type of error that occurred. See ErrorType for more information.
void SetResponseBody(std::string ResponseBody)
Setter for ClientResult::ResponseBody.
ClientResult(ClientResult &&other) noexcept
Move constructor for ClientResult.
void SetSuccessful(bool Successful)
Setter for ClientResult::Successful.
std::string ToString() const
Returns the error message if any of the ClientResult.
static const ClientResult nullobj
Uninitialized instance of ClientResult.
Definition discordpp.h:1463
ClientResult & operator=(ClientResult &&other) noexcept
Move assignment operator for ClientResult.
int32_t ErrorCode() const
A more detailed error code for this failure. Currently the only use of this is when an API request is...
void SetRetryAfter(float RetryAfter)
Setter for ClientResult::RetryAfter.
float RetryAfter() const
When a user is being rate limited by Discord (and so status == 429), this field should be set and is ...
std::string ResponseBody() const
The full HTTP response body, which will usually be a JSON string.
discordpp::HttpStatusCode Status() const
The HTTP status code of the API call.
void SetError(std::string Error)
Setter for ClientResult::Error.
ClientResult(const ClientResult &arg0)
Copy constructor for ClientResult.
bool Successful() const
Equivalent to type == ErrorType::None.
void SetType(discordpp::ErrorType Type)
Setter for ClientResult::Type.
The Client class is the main entry point for the Discord SDK. All functionality is exposed through th...
Definition discordpp.h:3301
std::function< void(discordpp::ClientResult result)> UnmergeIntoProvisionalAccountCallback
Callback function for the Client::UnmergeIntoProvisionalAccount method.
Definition discordpp.h:3481
std::function< void(std::vector< discordpp::AudioDevice > devices)> GetOutputDevicesCallback
Callback function for Client::GetOutputDevices.
Definition discordpp.h:3398
std::function< void(discordpp::ClientResult result, std::string inviteUrl)> JoinLinkedLobbyGuildCallback
Callback function for Client::JoinLinkedLobbyGuild.
Definition discordpp.h:3563
bool RegisterLaunchCommand(uint64_t applicationId, std::string command)
When a user accepts an activity invite for your game within the Discord client, Discord needs to know...
void SetRelationshipCreatedCallback(discordpp::Client::RelationshipCreatedCallback cb)
Sets a callback to be invoked whenever a relationship for this user is established or changes type.
void GetUserMessagesWithLimit(uint64_t recipientId, int32_t limit, discordpp::Client::UserMessagesWithLimitCallback cb)
Retrieves messages from the DM conversation with the specified user.
void GetLobbyMessagesWithLimit(uint64_t lobbyId, int32_t limit, discordpp::Client::GetLobbyMessagesCallback cb)
Retrieves recent messages from the specified lobby.
std::function< void(uint64_t messageId)> MessageCreatedCallback
Callback function for Client::SetMessageCreatedCallback.
Definition discordpp.h:3526
discordpp::Call GetCall(uint64_t channelId)
Returns a reference to the currently active call, if any.
std::function< void(uint64_t userId)> RelationshipGroupsUpdatedCallback
Callback function for Client::SetRelationshipGroupsUpdatedCallback.
Definition discordpp.h:3646
std::function< void(discordpp::ClientResult result)> UpdateRelationshipCallback
Callback function for most other Relationship functions such as Client::SendDiscordFriendRequestById.
Definition discordpp.h:3620
void EndCalls(discordpp::Client::EndCallsCallback callback)
Ends any active call, if any. Any references you have to Call objects are invalid after they are ende...
static std::string StatusToString(discordpp::Client::Status type)
Converts the Status enum to a string.
void Disconnect()
Asynchronously disconnects the client.
void SendDiscordFriendRequest(std::string const &username, discordpp::Client::SendFriendRequestCallback cb)
Sends a Discord friend request to the target user.
void RefreshToken(uint64_t applicationId, std::string const &refreshToken, discordpp::Client::TokenExchangeCallback callback)
Generates a new access token for the current user from a refresh token.
void SendLobbyMessageWithMetadata(uint64_t lobbyId, std::string const &content, std::unordered_map< std::string, std::string > const &metadata, discordpp::Client::SendUserMessageCallback cb)
Variant of Client::SendLobbyMessage that also accepts metadata to be sent with the message.
void SetEchoCancellation(bool on)
Enables or disables the basic echo cancellation provided by the WebRTC library.
void GetInputDevices(discordpp::Client::GetInputDevicesCallback cb)
Asynchronously fetches the list of audio input devices available to the user.
void CancelGameFriendRequest(uint64_t userId, discordpp::Client::UpdateRelationshipCallback cb)
Cancels an outgoing game friend request to the target user.
void AbortGetTokenFromDevice()
This function is used to abort/cleanup the device authorization flow.
bool SetLogDir(std::string const &path, discordpp::LoggingSeverity minSeverity)
Causes logs generated by the SDK to be written to disk in the specified directory.
void OpenConnectedGamesSettingsInDiscord(discordpp::Client::OpenConnectedGamesSettingsInDiscordCallback callback)
Opens the Connected Games settings in the Discord client, which is where users can manage their setti...
void SetAuthorizeDeviceScreenClosedCallback(discordpp::Client::AuthorizeDeviceScreenClosedCallback cb)
Sets a callback function to be invoked when the device authorization screen is closed.
void SetMessageCreatedCallback(discordpp::Client::MessageCreatedCallback cb)
Sets a callback to be invoked whenever a new message is received in either a lobby or a DM.
std::function< void(discordpp::ClientResult result)> UpdateProvisionalAccountDisplayNameCallback
Callback function for Client::UpdateProvisionalAccountDisplayName.
Definition discordpp.h:3485
std::function< void(bool inputDetected)> NoAudioInputCallback
Callback function for Client::SetNoAudioInputCallback.
Definition discordpp.h:3410
void UnlinkChannelFromLobby(uint64_t lobbyId, discordpp::Client::LinkOrUnlinkChannelCallback callback)
Removes any existing channel link from the specified lobby.
std::function< void()> ProvisionalUserMergeRequiredCallback
Callback function for when Client::ProvisionalUserMergeCompleted completes.
Definition discordpp.h:3514
void SetMessageDeletedCallback(discordpp::Client::MessageDeletedCallback cb)
Sets a callback to be invoked whenever a message is deleted.
void DeleteUserMessage(uint64_t recipientId, uint64_t messageId, discordpp::Client::DeleteUserMessageCallback cb)
Deletes the specified message sent by the current user to the specified recipient.
void SetVoiceParticipantChangedCallback(discordpp::Client::VoiceParticipantChangedCallback cb)
Callback invoked whenever a user in a lobby joins or leaves a voice call.
void UnmergeIntoProvisionalAccount(uint64_t applicationId, discordpp::AuthenticationExternalAuthType externalAuthType, std::string const &externalAuthToken, discordpp::Client::UnmergeIntoProvisionalAccountCallback callback)
This function is used to unlink/unmerge a external identity from a Discord account....
std::function< void(discordpp::ClientResult result, std::vector< discordpp::GuildMinimal > guilds)> GetUserGuildsCallback
Callback function for Client::GetUserGuilds.
Definition discordpp.h:3559
Client(std::string apiBase, std::string webBase)
Creates a new instance of the Client but allows customizing the Discord URL to use.
void RevokeToken(uint64_t applicationId, std::string const &token, discordpp::Client::RevokeTokenCallback callback)
Revoke all application access/refresh tokens associated with a user with any valid access/refresh tok...
void LinkChannelToLobby(uint64_t lobbyId, uint64_t channelId, discordpp::Client::LinkOrUnlinkChannelCallback callback)
Links the specified channel on Discord to the specified in-game lobby.
std::function< void(uint64_t lobbyId)> LobbyDeletedCallback
Callback function for Client::SetLobbyDeletedCallback.
Definition discordpp.h:3576
std::function< void(std::string message, discordpp::LoggingSeverity severity)> LogCallback
Callback function invoked when a new log message is generated.
Definition discordpp.h:3535
void SetDeviceChangeCallback(discordpp::Client::DeviceChangeCallback callback)
Sets a callback function to be invoked when Discord detects a change in the available audio devices.
void GetUserMessageSummaries(discordpp::Client::UserMessageSummariesCallback cb)
Retrieves message conversation summaries for all users the current user has DM conversations with.
std::function< void(discordpp::ClientResult result)> LinkOrUnlinkChannelCallback
Callback function for Client::LinkChannelToLobby.
Definition discordpp.h:3570
std::function< void(discordpp::AudioDevice device)> GetCurrentOutputDeviceCallback
Callback function for Client::GetCurrentOutputDevice.
Definition discordpp.h:3391
std::vector< uint64_t > GetLobbyIds() const
Returns a list of all the lobbies that the user is a member of and the SDK has loaded.
void SetUserUpdatedCallback(discordpp::Client::UserUpdatedCallback cb)
The UserUpdatedCallback is invoked whenever any user the current session knows about changes,...
std::function< void()> TokenExpirationCallback
Callback function for Client::SetTokenExpirationCallback.
Definition discordpp.h:3478
std::function< void(discordpp::ClientResult result)> SetOutputDeviceCallback
Callback function for Client::SetOutputDevice.
Definition discordpp.h:3413
void SetAecDump(bool on)
Enables or disables AEC diagnostic recording.
std::function< void(discordpp::ClientResult result, std::optional< discordpp::UserHandle > user)> GetDiscordClientConnectedUserCallback
Callback function for when Client::GetDiscordClientConnectedUser completes.
Definition discordpp.h:3641
void SetActivityInviteCreatedCallback(discordpp::Client::ActivityInviteCallback cb)
Sets a callback function that is invoked when the current user receives an activity invite from anoth...
std::function< void(uint64_t lobbyId, uint64_t memberId)> LobbyMemberUpdatedCallback
Callback function for Client::SetLobbyMemberUpdatedCallback.
Definition discordpp.h:3585
void SendUserMessage(uint64_t recipientId, std::string const &content, discordpp::Client::SendUserMessageCallback cb)
Sends a direct message to the specified user.
Client & operator=(Client &&other) noexcept
Move assignment operator for Client.
void GetTokenFromProvisionalMerge(uint64_t applicationId, std::string const &code, std::string const &codeVerifier, std::string const &redirectUri, discordpp::AuthenticationExternalAuthType externalAuthType, std::string const &externalAuthToken, discordpp::Client::TokenExchangeCallback callback)
This function should be used with the Client::Authorize function whenever a user with a provisional a...
static std::string GetVersionHash()
Returns the git commit hash this version was built from.
bool RegisterLaunchSteamApplication(uint64_t applicationId, uint32_t steamAppId)
When a user accepts an activity invite for your game within the Discord client, Discord needs to know...
void FetchCurrentUser(discordpp::AuthorizationTokenType tokenType, std::string const &token, discordpp::Client::FetchCurrentUserCallback callback)
Fetches basic information about the user associated with the given auth token.
void SetNoAudioInputCallback(discordpp::Client::NoAudioInputCallback callback)
Callback function invoked when the above threshold is set and there is a change in whether audio is b...
std::vector< discordpp::UserHandle > SearchFriendsByUsername(std::string searchStr) const
Searches all of your friends by both username and display name, returning a list of all friends that ...
void SetVoiceLogDir(std::string const &path, discordpp::LoggingSeverity minSeverity)
Causes logs generated by the voice subsystem of the SDK to be written to disk in the specified direct...
std::function< void(uint64_t userId, int16_t *data, uint64_t samplesPerChannel, int32_t sampleRate, uint64_t channels, bool &outShouldMute)> UserAudioReceivedCallback
Callback function for Client::StartCallWithAudioCallbacks.
Definition discordpp.h:3422
std::function< void(discordpp::ClientResult result)> LeaveLobbyCallback
Callback function for Client::LeaveLobby.
Definition discordpp.h:3567
std::function< void(uint64_t lobbyId)> LobbyUpdatedCallback
Callback function for Client::SetLobbyUpdatedCallback.
Definition discordpp.h:3588
void GetTokenFromDevice(discordpp::DeviceAuthorizationArgs args, discordpp::Client::TokenExchangeCallback callback)
This function is a combination of Client::Authorize and Client::GetToken, but is used for the case wh...
void CloseAuthorizeDeviceScreen()
This function is used to hide the device authorization screen and is used for the case where the user...
void SetOpusHardwareCoding(bool encode, bool decode)
Enables or disables hardware encoding and decoding for audio, if it is available.
void SetNoiseCancellation(bool on)
Enables or disables Krisp noise cancellation.
void JoinLinkedLobbyGuild(uint64_t lobbyId, discordpp::Client::ProvisionalUserMergeRequiredCallback provisionalUserMergeRequiredCallback, discordpp::Client::JoinLinkedLobbyGuildCallback callback)
Invites the current user to the Discord guild of the channel that is linked to the specified lobby....
bool ShowAudioRoutePicker()
On iOS devices, show the system audio route picker.
void SetActivityJoinCallback(discordpp::Client::ActivityJoinCallback cb)
Sets a callback function that is invoked when the current user also has Discord running on their comp...
void GetOutputDevices(discordpp::Client::GetOutputDevicesCallback cb)
Asynchronously fetches the list of audio output devices available to the user.
std::function< void()> AuthorizeDeviceScreenClosedCallback
Callback function for Client::SetAuthorizeDeviceScreenClosedCallback.
Definition discordpp.h:3475
void SetSelfDeafAll(bool deaf)
Mutes all audio from the currently active call for the current user in all calls. They will not be ab...
void ExchangeChildToken(std::string const &parentApplicationToken, uint64_t childApplicationId, discordpp::Client::ExchangeChildTokenCallback callback)
Exchanges a parent application token for a child application token.
std::function< void(bool installed)> IsDiscordAppInstalledCallback
Callback invoked when the IsDiscordAppInstalled function completes.
Definition discordpp.h:3591
std::function< void(discordpp::ClientResult result)> UpdateRichPresenceCallback
Callback function for when Client::UpdateRichPresence completes.
Definition discordpp.h:3616
std::function< void(discordpp::ClientResult result, std::vector< discordpp::MessageHandle > messages)> UserMessagesWithLimitCallback
Callback function for Client::GetUserMessagesWithLimit.
Definition discordpp.h:3509
void CreateOrJoinLobbyWithMetadata(std::string const &secret, std::unordered_map< std::string, std::string > const &lobbyMetadata, std::unordered_map< std::string, std::string > const &memberMetadata, discordpp::Client::CreateOrJoinLobbyCallback callback)
Variant of Client::CreateOrJoinLobby that also accepts developer-supplied metadata.
Client()
Creates a new instance of the Client.
std::function< void(discordpp::ClientResult result)> SendFriendRequestCallback
Callback function for Client::SendDiscordFriendRequest and Client::SendGameFriendRequest.
Definition discordpp.h:3624
std::function< void(discordpp::ClientResult result, std::vector< discordpp::MessageHandle > messages)> GetLobbyMessagesCallback
Callback function for Client::GetLobbyMessagesWithLimit.
Definition discordpp.h:3499
void RegisterAuthorizeRequestCallback(discordpp::Client::AuthorizeRequestCallback callback)
Registers a callback to be invoked when a user requests to initiate the authorization flow.
void UpdateToken(discordpp::AuthorizationTokenType tokenType, std::string token, discordpp::Client::UpdateTokenCallback callback)
Asynchronously sets a new auth token for this client to use.
std::function< void(discordpp::Client::Status status, discordpp::Client::Error error, int32_t errorDetail)> OnStatusChanged
Callback function for Client::SetStatusChangedCallback.
Definition discordpp.h:3546
std::function< void(uint64_t applicationId, std::string joinSecret)> ActivityJoinWithApplicationCallback
Callback function for Client::SetActivityJoinWithApplicationCallback.
Definition discordpp.h:3609
void SetOutputVolume(float outputVolume)
Sets the speaker volume for the current user.
std::function< void()> EndCallsCallback
Callback invoked when Client::EndCalls completes.
Definition discordpp.h:3385
void SendGameFriendRequestById(uint64_t userId, discordpp::Client::UpdateRelationshipCallback cb)
Sends (or accepts) a game friend request to the target user.
void OpenMessageInDiscord(uint64_t messageId, discordpp::Client::ProvisionalUserMergeRequiredCallback provisionalUserMergeRequiredCallback, discordpp::Client::OpenMessageInDiscordCallback callback)
Opens the given message in the Discord client.
void RemoveGameFriend(uint64_t userId, discordpp::Client::UpdateRelationshipCallback cb)
Removes any game friendship between the current user and the target user.
std::vector< discordpp::Call > GetCalls()
Returns a reference to all currently active calls, if any.
std::optional< discordpp::ChannelHandle > GetChannelHandle(uint64_t channelId) const
Returns a reference to the Discord channel object for the given ID.
std::function< void(discordpp::ClientResult result)> RevokeTokenCallback
Callback function for the Client::RevokeToken method.
Definition discordpp.h:3472
void SendActivityJoinRequest(uint64_t userId, discordpp::Client::SendActivityInviteCallback cb)
Requests to join the activity of the specified user.
std::function< void(discordpp::ClientResult result, std::string joinSecret)> AcceptActivityInviteCallback
Callback function for Client::AcceptActivityInvite.
Definition discordpp.h:3594
void RejectDiscordFriendRequest(uint64_t userId, discordpp::Client::UpdateRelationshipCallback cb)
Declines an incoming Discord friend request from the target user.
Status
This enum refers to the status of the internal websocket the SDK uses to communicate with Discord The...
Definition discordpp.h:3344
@ Disconnecting
Disconnecting.
Definition discordpp.h:3362
@ Connected
Connected.
Definition discordpp.h:3353
@ HttpWait
HttpWait.
Definition discordpp.h:3365
@ Reconnecting
Reconnecting.
Definition discordpp.h:3359
@ Connecting
Connecting.
Definition discordpp.h:3350
@ Ready
Ready.
Definition discordpp.h:3356
@ Disconnected
Disconnected.
Definition discordpp.h:3347
static std::string GetDefaultCommunicationScopes()
Returns the default set of OAuth2 scopes that should be used with the Discord SDK when making use of ...
void SetRelationshipDeletedCallback(discordpp::Client::RelationshipDeletedCallback cb)
Sets a callback to be invoked whenever a relationship for this user is removed, such as when the user...
void UpdateProvisionalAccountDisplayName(std::string const &name, discordpp::Client::UpdateProvisionalAccountDisplayNameCallback callback)
Updates the display name of a provisional account to the specified name.
static std::string GetDefaultPresenceScopes()
Returns the default set of OAuth2 scopes that should be used with the Discord SDK when leveraging bas...
void SendLobbyMessage(uint64_t lobbyId, std::string const &content, discordpp::Client::SendUserMessageCallback cb)
Sends a message in a lobby chat to all members of the lobby.
std::optional< discordpp::MessageHandle > GetMessageHandle(uint64_t messageId) const
Returns a reference to the Discord message object for the given ID.
float GetOutputVolume()
Returns the output volume for the current user.
std::function< void(discordpp::ClientResult result, std::string accessToken, std::string refreshToken, discordpp::AuthorizationTokenType tokenType, int32_t expiresIn, std::string scopes)> TokenExchangeCallback
Callback function for the token exchange APIs such as Client::GetToken.
Definition discordpp.h:3457
void SetThreadPriority(discordpp::Client::Thread thread, int32_t priority)
Allows setting the priority of various SDK threads.
discordpp::UserHandle GetCurrentUser() const
(deprecated)
std::function< void(discordpp::ClientResult result)> OpenMessageInDiscordCallback
Callback function for when Client::OpenMessageInDiscord completes.
Definition discordpp.h:3517
void GetProvisionalToken(uint64_t applicationId, discordpp::AuthenticationExternalAuthType externalAuthType, std::string const &externalAuthToken, discordpp::Client::TokenExchangeCallback callback)
Provisional accounts are a way for users that have not signed up for Discord to still access SDK func...
void GetCurrentInputDevice(discordpp::Client::GetCurrentInputDeviceCallback cb)
Asynchronously fetches the current audio input device in use by the client.
void SetAutomaticGainControl(bool on)
When enabled, automatically adjusts the microphone volume to keep it clear and consistent.
void EditUserMessage(uint64_t recipientId, uint64_t messageId, std::string const &content, discordpp::Client::EditUserMessageCallback cb)
Edits the specified message sent by the current user to the specified recipient.
std::function< void()> EndCallCallback
Callback invoked when Client::EndCall completes.
Definition discordpp.h:3382
std::function< void()> AuthorizeRequestCallback
Callback invoked when a user requests to initiate the authorization flow from the discord app.
Definition discordpp.h:3469
std::function< void(discordpp::ClientResult result)> EditUserMessageCallback
Callback function for Client::EditUserMessage.
Definition discordpp.h:3496
void Connect()
Asynchronously connects the client to Discord.
void SetLobbyDeletedCallback(discordpp::Client::LobbyDeletedCallback cb)
Sets a callback to be invoked when a lobby is no longer available.
void GetDiscordClientConnectedUser(uint64_t applicationId, discordpp::Client::GetDiscordClientConnectedUserCallback callback) const
If the Discord app is running on the user's computer and the SDK establishes a connection to it,...
static int32_t GetVersionPatch()
Returns the patch version of the Discord Social SDK.
void CreateOrJoinLobby(std::string const &secret, discordpp::Client::CreateOrJoinLobbyCallback callback)
Joins the user to the specified lobby, creating one if it does not exist.
void LeaveLobby(uint64_t lobbyId, discordpp::Client::LeaveLobbyCallback callback)
Removes the current user from the specified lobby.
float GetInputVolume()
Returns the input volume for the current user's microphone.
std::function< void(discordpp::ClientResult result)> SetInputDeviceCallback
Callback function for Client::SetInputDevice.
Definition discordpp.h:3407
void SetLobbyMemberRemovedCallback(discordpp::Client::LobbyMemberRemovedCallback cb)
Sets a callback function to be invoked whenever a member of a lobby is removed and can no longer conn...
Client(Client &&other) noexcept
Move constructor for Client.
static std::string GetDefaultAudioDeviceId()
Returns the ID of the system default audio device if the user has not explicitly chosen one.
void CancelDiscordFriendRequest(uint64_t userId, discordpp::Client::UpdateRelationshipCallback cb)
Cancels an outgoing Discord friend request to the target user.
void IsDiscordAppInstalled(discordpp::Client::IsDiscordAppInstalledCallback callback)
Checks whether the Discord mobile app is installed on this device. On desktop platforms,...
std::function< void(uint64_t lobbyId, uint64_t memberId)> LobbyMemberAddedCallback
Callback function for Client::SetLobbyMemberAddedCallback.
Definition discordpp.h:3579
void SetOnlineStatus(discordpp::StatusType status, discordpp::Client::UpdateStatusCallback callback)
Sets whether a user is online/invisible/idle/dnd on Discord.
void ClearRichPresence()
Clears the right presence for the current user.
void SetSelfMuteAll(bool mute)
Mutes the current user's microphone so that no other participant in their active calls can hear them ...
void SetStatusChangedCallback(discordpp::Client::OnStatusChanged cb)
Sets a callback function to be invoked whenever the SDKs status changes.
std::function< void(discordpp::ActivityInvite invite)> ActivityInviteCallback
Callback function for Client::SetActivityInviteCreatedCallback and Client::SetActivityInviteUpdatedCa...
Definition discordpp.h:3603
std::vector< discordpp::RelationshipHandle > GetRelationshipsByGroup(discordpp::RelationshipGroupType groupType) const
Returns a list of relationships that belong to the specified relationship group type....
std::function< void(discordpp::ClientResult result)> UpdateTokenCallback
Callback invoked when Client::UpdateToken completes. Once this is done it is safe to call Client::Con...
Definition discordpp.h:3490
void SetMessageUpdatedCallback(discordpp::Client::MessageUpdatedCallback cb)
Sets a callback to be invoked whenever a message is edited.
void SetOutputDevice(std::string deviceId, discordpp::Client::SetOutputDeviceCallback cb)
Asynchronously changes the audio output device in use by the client to the specified device....
void SendUserMessageWithMetadata(uint64_t recipientId, std::string const &content, std::unordered_map< std::string, std::string > const &metadata, discordpp::Client::SendUserMessageCallback cb)
Variant of Client::SendUserMessage that also accepts metadata to be sent with the message.
std::function< void(uint64_t lobbyId)> LobbyCreatedCallback
Callback function for Client::SetLobbyCreatedCallback.
Definition discordpp.h:3573
void RemoveDiscordAndGameFriend(uint64_t userId, discordpp::Client::UpdateRelationshipCallback cb)
Removes any friendship between the current user and the target user. This function will remove BOTH a...
std::function< void(uint64_t lobbyId, uint64_t memberId)> LobbyMemberRemovedCallback
Callback function for Client::SetLobbyMemberRemovedCallback.
Definition discordpp.h:3582
void SetTokenExpirationCallback(discordpp::Client::TokenExpirationCallback callback)
Get a notification when the current token is about to expire or expired.
void GetUserGuilds(discordpp::Client::GetUserGuildsCallback cb)
Fetches all of the guilds (also known as Discord servers) that the current user is a member of.
void SetGameWindowPid(int32_t pid)
When users are linking their account with Discord, which involves an OAuth2 flow, the SDK can streaml...
void GetToken(uint64_t applicationId, std::string const &code, std::string const &codeVerifier, std::string const &redirectUri, discordpp::Client::TokenExchangeCallback callback)
Exchanges an authorization code that was returned from the Client::Authorize function for an access t...
std::function< void(discordpp::ClientResult result, std::string code, std::string redirectUri)> AuthorizationCallback
Callback invoked when the Authorize function completes.
Definition discordpp.h:3441
void SetActivityInviteUpdatedCallback(discordpp::Client::ActivityInviteCallback cb)
Sets a callback function that is invoked when an existing activity invite changes....
void SetNoAudioInputThreshold(float dBFSThreshold)
Threshold that can be set to indicate when no audio is being received by the user's mic.
std::function< void(std::string joinSecret)> ActivityJoinCallback
Callback function for Client::SetActivityJoinCallback.
Definition discordpp.h:3606
static std::string ErrorToString(discordpp::Client::Error type)
Converts the Error enum to a string.
std::optional< discordpp::UserHandle > GetUser(uint64_t userId) const
Returns the UserHandle associated with the given user ID.
void RemoveAuthorizeRequestCallback()
Stops listening for the AUTHORIZE_REQUEST event and removes the registered callback.
discordpp::RelationshipHandle GetRelationshipHandle(uint64_t userId) const
Returns the RelationshipHandle that corresponds to the relationship between the current user and the ...
std::function< void(discordpp::ClientResult result)> SendActivityInviteCallback
Callback function for Client::SendActivityInvite, Client::SendActivityJoinRequest,...
Definition discordpp.h:3599
discordpp::AuthorizationCodeVerifier CreateAuthorizationCodeVerifier()
Helper function that can create a code challenge and verifier for use in the Client::Authorize + Clie...
std::function< void(uint64_t lobbyId, uint64_t memberId, bool added)> VoiceParticipantChangedCallback
Callback function for Client::SetVoiceParticipantChangedCallback.
Definition discordpp.h:3416
discordpp::Call StartCallWithAudioCallbacks(uint64_t lobbyId, discordpp::Client::UserAudioReceivedCallback receivedCb, discordpp::Client::UserAudioCapturedCallback capturedCb)
Starts or joins a call in the specified lobby.
uint64_t GetApplicationId()
This function is used to get the application ID for the client. This is used to identify the applicat...
std::function< void(uint64_t userId, bool isDiscordRelationshipUpdate)> RelationshipDeletedCallback
Callback function for Client::SetRelationshipDeletedCallback.
Definition discordpp.h:3637
bool GetSelfDeafAll() const
Returns whether the current user is deafened in all calls.
bool SetSpeakerMode(bool speakerMode)
(deprecated) On mobile devices, enable speakerphone mode.
static int32_t GetVersionMinor()
Returns the minor version of the Discord Social SDK.
void AddVoiceLogCallback(discordpp::Client::LogCallback callback, discordpp::LoggingSeverity minSeverity)
Adds a callback function to be invoked for each new log message generated by the voice subsystem of t...
void AbortAuthorize()
This will abort the authorize flow if it is in progress and tear down any associated state.
Error
Represents an error state for the socket connection that the Discord SDK maintains with the Discord b...
Definition discordpp.h:3315
@ None
None.
Definition discordpp.h:3318
@ ConnectionCanceled
ConnectionCanceled.
Definition discordpp.h:3327
@ ConnectionFailed
ConnectionFailed.
Definition discordpp.h:3321
@ UnexpectedClose
UnexpectedClose.
Definition discordpp.h:3324
void UnblockUser(uint64_t userId, discordpp::Client::UpdateRelationshipCallback cb)
Unblocks the target user. Does not restore any old relationship between the users though.
void SetShowingChat(bool showingChat)
Sets whether chat messages are currently being shown in the game.
static int32_t GetVersionMajor()
Returns the major version of the Discord Social SDK.
std::function< void(discordpp::ClientResult result, uint64_t messageId)> SendUserMessageCallback
This is used for all kinds of 'send message' calls despite the name, to make sure engine bindings use...
Definition discordpp.h:3522
std::function< void(discordpp::AudioDevice device)> GetCurrentInputDeviceCallback
Callback function for Client::GetCurrentInputDevice.
Definition discordpp.h:3388
void SetLobbyCreatedCallback(discordpp::Client::LobbyCreatedCallback cb)
Sets a callback to be invoked when a lobby "becomes available" to the client.
void Authorize(discordpp::AuthorizationArgs args, discordpp::Client::AuthorizationCallback callback)
Initiates an OAuth2 flow for a user to "sign in with Discord". This flow is intended for desktop and ...
std::function< void(uint64_t userId)> UserUpdatedCallback
Callback function for Client::SetUserUpdatedCallback.
Definition discordpp.h:3649
void AcceptActivityInvite(discordpp::ActivityInvite invite, discordpp::Client::AcceptActivityInviteCallback cb)
Accepts an activity invite that the current user has received.
void SetInputDevice(std::string deviceId, discordpp::Client::SetInputDeviceCallback cb)
Asynchronously changes the audio input device in use by the client to the specified device....
void RejectGameFriendRequest(uint64_t userId, discordpp::Client::UpdateRelationshipCallback cb)
Declines an incoming game friend request from the target user.
void SetInputVolume(float inputVolume)
Sets the microphone volume for the current user.
void SetApplicationId(uint64_t applicationId)
This function is used to set the application ID for the client. This is used to identify the applicat...
std::vector< discordpp::RelationshipHandle > GetRelationships() const
Returns a list of all of the relationships the current user has with others, including all Discord re...
std::function< void(uint64_t messageId, uint64_t channelId)> MessageDeletedCallback
Callback function for Client::SetMessageDeletedCallback.
Definition discordpp.h:3529
void SetLobbyUpdatedCallback(discordpp::Client::LobbyUpdatedCallback cb)
Sets a callback to be invoked when a lobby is edited, for example if the lobby's metadata is changed.
std::function< void(discordpp::ClientResult result)> OpenConnectedGamesSettingsInDiscordCallback
Callback function for when Client::OpenConnectedGamesSettingsInDiscord completes.
Definition discordpp.h:3539
Thread
Represents the type of thread to control thread priority on.
Definition discordpp.h:3369
@ Client
Client.
Definition discordpp.h:3372
@ Voice
Voice.
Definition discordpp.h:3375
@ Network
Network.
Definition discordpp.h:3378
void SendActivityJoinRequestReply(discordpp::ActivityInvite invite, discordpp::Client::SendActivityInviteCallback cb)
When another user requests to join the current user's party, this function is called to to allow that...
void GetGuildChannels(uint64_t guildId, discordpp::Client::GetGuildChannelsCallback cb)
Fetches all of the channels that the current user can access in the given guild. Channels are sorted ...
static std::string ThreadToString(discordpp::Client::Thread type)
Converts the Thread enum to a string.
void BlockUser(uint64_t userId, discordpp::Client::UpdateRelationshipCallback cb)
Blocks the target user so that they cannot send the user friend or activity invites and cannot messag...
std::function< void(uint64_t messageId)> MessageUpdatedCallback
Callback function for Client::SetMessageUpdatedCallback.
Definition discordpp.h:3532
void SetEngineManagedAudioSession(bool isEngineManaged)
On mobile devices, set whether the audio environment is managed by the engine or the SDK....
void SetLobbyMemberUpdatedCallback(discordpp::Client::LobbyMemberUpdatedCallback cb)
Sets a callback function to be invoked whenever a member of a lobby is changed.
void SetActivityJoinWithApplicationCallback(discordpp::Client::ActivityJoinWithApplicationCallback cb)
Sets a callback function that is invoked when the current user also has Discord running on their comp...
bool GetSelfMuteAll() const
Returns whether the current user's microphone is muted in all calls.
std::function< void(uint64_t userId, bool isDiscordRelationshipUpdate)> RelationshipCreatedCallback
Callback function for Client::SetRelationshipCreatedCallback.
Definition discordpp.h:3630
std::function< void(discordpp::ClientResult result)> DeleteUserMessageCallback
Callback function for Client::DeleteUserMessage.
Definition discordpp.h:3493
std::function< void(discordpp::ClientResult result, std::string accessToken, discordpp::AuthorizationTokenType tokenType, int32_t expiresIn, std::string scopes)> ExchangeChildTokenCallback
Callback function for Client::ExchangeChildToken.
Definition discordpp.h:3445
bool CanOpenMessageInDiscord(uint64_t messageId)
Returns true if the given message is able to be viewed in a Discord client.
void SetNoiseSuppression(bool on)
Enables basic background noise suppression.
std::optional< discordpp::UserHandle > GetCurrentUserV2() const
Unlike GetCurrentUser(), this method returns std::nullopt instead of a dummy object when no user is a...
void SetLobbyMemberAddedCallback(discordpp::Client::LobbyMemberAddedCallback cb)
Sets a callback function to be invoked whenever a user is added to a lobby.
void GetCurrentOutputDevice(discordpp::Client::GetCurrentOutputDeviceCallback cb)
Asynchronously fetches the current audio output device in use by the client.
void SetHttpRequestTimeout(int32_t httpTimeoutInMilliseconds)
This function is used to override the default HTTP timeout for the websocket client.
void EndCall(uint64_t channelId, discordpp::Client::EndCallCallback callback)
Ends any active call, if any. Any references you have to Call objects are invalid after they are ende...
void AcceptGameFriendRequest(uint64_t userId, discordpp::Client::UpdateRelationshipCallback cb)
Accepts an incoming game friend request from the target user.
std::function< void(discordpp::ClientResult result, uint64_t id, std::string name)> FetchCurrentUserCallback
Callback function for Client::FetchCurrentUser.
Definition discordpp.h:3453
std::function< void(discordpp::ClientResult result, std::vector< discordpp::GuildChannel > guildChannels)> GetGuildChannelsCallback
Callback function for Client::GetGuildChannels.
Definition discordpp.h:3554
std::function< void(discordpp::ClientResult result)> UpdateStatusCallback
Callback function for when Client::SetOnlineStatus completes.
Definition discordpp.h:3613
std::optional< discordpp::LobbyHandle > GetLobbyHandle(uint64_t lobbyId) const
Returns a reference to the Discord lobby object for the given ID.
std::function< void(discordpp::ClientResult result, uint64_t lobbyId)> CreateOrJoinLobbyCallback
Callback function for Client::CreateOrJoinLobby.
Definition discordpp.h:3550
std::function< void(discordpp::ClientResult result, std::vector< discordpp::UserMessageSummary > summaries)> UserMessageSummariesCallback
Callback function for Client::GetUserMessageSummaries.
Definition discordpp.h:3504
discordpp::Call StartCall(uint64_t channelId)
Starts or joins a call in the lobby specified by channelId (For a lobby, simply pass in the lobbyId).
void UpdateRichPresence(discordpp::Activity activity, discordpp::Client::UpdateRichPresenceCallback cb)
Updates the rich presence for the current user.
void SetRelationshipGroupsUpdatedCallback(discordpp::Client::RelationshipGroupsUpdatedCallback cb)
The RelationshipGroupsUpdatedCallback is invoked whenever any user in the friends list changes....
Client(discordpp::ClientCreateOptions options)
Creates a new instance of the Client with custom options.
void OpenAuthorizeDeviceScreen(uint64_t clientId, std::string const &userCode)
This function is used to show the device authorization screen and is used for the case where the user...
std::function< void(int16_t *data, uint64_t samplesPerChannel, int32_t sampleRate, uint64_t channels)> UserAudioCapturedCallback
Callback function for Client::StartCallWithAudioCallbacks.
Definition discordpp.h:3432
std::function< void(std::vector< discordpp::AudioDevice > inputDevices, std::vector< discordpp::AudioDevice > outputDevices)> DeviceChangeCallback
Callback function for Client::SetDeviceChangeCallback.
Definition discordpp.h:3402
void AddLogCallback(discordpp::Client::LogCallback callback, discordpp::LoggingSeverity minSeverity)
Adds a callback function to be invoked for each new log message generated by the SDK.
void ProvisionalUserMergeCompleted(bool success)
Some functions don't work for provisional accounts, and require the user merge their account into a f...
void AcceptDiscordFriendRequest(uint64_t userId, discordpp::Client::UpdateRelationshipCallback cb)
Accepts an incoming Discord friend request from the target user.
void SendDiscordFriendRequestById(uint64_t userId, discordpp::Client::UpdateRelationshipCallback cb)
Sends a Discord friend request to the target user.
void SendGameFriendRequest(std::string const &username, discordpp::Client::SendFriendRequestCallback cb)
Sends (or accepts) a game friend request to the target user.
void SendActivityInvite(uint64_t userId, std::string const &content, discordpp::Client::SendActivityInviteCallback cb)
Sends a Discord activity invite to the specified user.
std::function< void(std::vector< discordpp::AudioDevice > devices)> GetInputDevicesCallback
Callback function for Client::GetInputDevices.
Definition discordpp.h:3394
void GetTokenFromDeviceProvisionalMerge(discordpp::DeviceAuthorizationArgs args, discordpp::AuthenticationExternalAuthType externalAuthType, std::string const &externalAuthToken, discordpp::Client::TokenExchangeCallback callback)
This function is a combination of Client::Authorize and Client::GetTokenFromProvisionalMerge,...
bool IsAuthenticated()
Returns true if the SDK has a non-empty OAuth2 token set, regardless of whether that token is valid o...
static const Client nullobj
Uninitialized instance of Client.
Definition discordpp.h:3662
discordpp::Client::Status GetStatus() const
Returns the current status of the client, see the Status enum for an explanation of the possible valu...
Arguments to the Client::GetTokenFromDevice function.
Definition discordpp.h:1735
DeviceAuthorizationArgs(DeviceAuthorizationArgs &&other) noexcept
Move constructor for DeviceAuthorizationArgs.
DeviceAuthorizationArgs(const DeviceAuthorizationArgs &arg0)
Copy constructor for DeviceAuthorizationArgs.
uint64_t ClientId() const
Optional. The Discord application ID for your game. Defaults to the value set by Client::SetApplicati...
static const DeviceAuthorizationArgs nullobj
Uninitialized instance of DeviceAuthorizationArgs.
Definition discordpp.h:1755
void SetClientId(uint64_t ClientId)
Setter for DeviceAuthorizationArgs::ClientId.
void SetScopes(std::string Scopes)
Setter for DeviceAuthorizationArgs::Scopes.
DeviceAuthorizationArgs & operator=(const DeviceAuthorizationArgs &arg0)
Copy assignment operator for DeviceAuthorizationArgs.
std::string Scopes() const
Scopes is a space separated string of the oauth scopes your game is requesting.
DeviceAuthorizationArgs & operator=(DeviceAuthorizationArgs &&other) noexcept
Move assignment operator for DeviceAuthorizationArgs.
void SetIsLinkable(bool IsLinkable)
Setter for GuildChannel::IsLinkable.
bool IsViewableAndWriteableByAllMembers() const
Whether the channel is "fully public" which means every member of the guild is able to view and send ...
std::optional< discordpp::LinkedLobby > LinkedLobby() const
Information about the currently linked lobby, if any. Currently Discord enforces that a channel can o...
uint64_t Id() const
The id of the channel.
void SetName(std::string Name)
Setter for GuildChannel::Name.
GuildChannel(const GuildChannel &arg0)
Copy constructor for GuildChannel.
void SetId(uint64_t Id)
Setter for GuildChannel::Id.
std::optional< uint64_t > ParentId() const
The id of the parent category channel, if any.
std::string Name() const
The name of the channel.
void SetType(discordpp::ChannelType Type)
Setter for GuildChannel::Type.
void SetPosition(int32_t Position)
Setter for GuildChannel::Position.
discordpp::ChannelType Type() const
The type of the channel.
GuildChannel & operator=(const GuildChannel &arg0)
Copy assignment operator for GuildChannel.
GuildChannel & operator=(GuildChannel &&other) noexcept
Move assignment operator for GuildChannel.
GuildChannel(GuildChannel &&other) noexcept
Move constructor for GuildChannel.
bool IsLinkable() const
Whether the current user is able to link this channel to a lobby.
int32_t Position() const
The position of the channel in the guild's channel list.
void SetLinkedLobby(std::optional< discordpp::LinkedLobby > LinkedLobby)
Setter for GuildChannel::LinkedLobby.
void SetIsViewableAndWriteableByAllMembers(bool IsViewableAndWriteableByAllMembers)
Setter for GuildChannel::IsViewableAndWriteableByAllMembers.
static const GuildChannel nullobj
Uninitialized instance of GuildChannel.
Definition discordpp.h:2231
void SetParentId(std::optional< uint64_t > ParentId)
Setter for GuildChannel::ParentId.
void SetName(std::string Name)
Setter for GuildMinimal::Name.
std::string Name() const
The name of the guild.
void SetId(uint64_t Id)
Setter for GuildMinimal::Id.
static const GuildMinimal nullobj
Uninitialized instance of GuildMinimal.
Definition discordpp.h:2186
GuildMinimal & operator=(GuildMinimal &&other) noexcept
Move assignment operator for GuildMinimal.
GuildMinimal & operator=(const GuildMinimal &arg0)
Copy assignment operator for GuildMinimal.
GuildMinimal(const GuildMinimal &arg0)
Copy constructor for GuildMinimal.
GuildMinimal(GuildMinimal &&other) noexcept
Move constructor for GuildMinimal.
uint64_t Id() const
The id of the guild.
Struct that stores information about the channel that a lobby is linked to.
Definition discordpp.h:2354
uint64_t GuildId() const
The id of the guild (aka server) that owns the linked channel.
void SetName(std::string Name)
Setter for LinkedChannel::Name.
LinkedChannel & operator=(LinkedChannel &&other) noexcept
Move assignment operator for LinkedChannel.
LinkedChannel & operator=(const LinkedChannel &arg0)
Copy assignment operator for LinkedChannel.
std::string Name() const
The name of the linked channel.
void SetGuildId(uint64_t GuildId)
Setter for LinkedChannel::GuildId.
static const LinkedChannel nullobj
Uninitialized instance of LinkedChannel.
Definition discordpp.h:2373
LinkedChannel(const LinkedChannel &arg0)
Copy constructor for LinkedChannel.
void SetId(uint64_t Id)
Setter for LinkedChannel::Id.
uint64_t Id() const
The id of the linked channel.
LinkedChannel(LinkedChannel &&other) noexcept
Move constructor for LinkedChannel.
Struct that stores information about the lobby linked to a channel.
Definition discordpp.h:2308
LinkedLobby & operator=(const LinkedLobby &arg0)
Copy assignment operator for LinkedLobby.
LinkedLobby(const LinkedLobby &arg0)
Copy constructor for LinkedLobby.
uint64_t ApplicationId() const
The ID of the application that owns the lobby.
void SetLobbyId(uint64_t LobbyId)
Setter for LinkedLobby::LobbyId.
static const LinkedLobby nullobj
Uninitialized instance of LinkedLobby.
Definition discordpp.h:2327
void SetApplicationId(uint64_t ApplicationId)
Setter for LinkedLobby::ApplicationId.
LinkedLobby & operator=(LinkedLobby &&other) noexcept
Move assignment operator for LinkedLobby.
uint64_t LobbyId() const
The ID of the lobby.
LinkedLobby(LinkedLobby &&other) noexcept
Move constructor for LinkedLobby.
A LobbyHandle represents a single lobby in the SDK. A lobby can be thought of as just an arbitrary,...
Definition discordpp.h:2830
LobbyHandle(LobbyHandle &&other) noexcept
Move constructor for LobbyHandle.
std::optional< discordpp::LinkedChannel > LinkedChannel() const
Returns information about the channel linked to this lobby, if any.
static const LobbyHandle nullobj
Uninitialized instance of LobbyHandle.
Definition discordpp.h:2849
LobbyHandle & operator=(const LobbyHandle &other)
Copy assignment operator for LobbyHandle.
std::optional< discordpp::CallInfoHandle > GetCallInfoHandle() const
Returns a reference to the CallInfoHandle if there is an active voice call in this lobby.
std::unordered_map< std::string, std::string > Metadata() const
Returns any developer supplied metadata for this lobby.
std::optional< discordpp::LobbyMemberHandle > GetLobbyMemberHandle(uint64_t memberId) const
Returns a reference to the LobbyMemberHandle for the given user ID, if they are a member of this lobb...
LobbyHandle(const LobbyHandle &other)
Copy constructor for LobbyHandle.
std::vector< discordpp::LobbyMemberHandle > LobbyMembers() const
Returns a list of the LobbyMemberHandle objects for each member of this lobby.
uint64_t Id() const
Returns the id of the lobby.
std::vector< uint64_t > LobbyMemberIds() const
Returns a list of the user IDs that are members of this lobby.
LobbyHandle & operator=(LobbyHandle &&other) noexcept
Move assignment operator for LobbyHandle.
A LobbyMemberHandle represents the state of a single user in a Lobby.
Definition discordpp.h:2685
LobbyMemberHandle & operator=(const LobbyMemberHandle &other)
Copy assignment operator for LobbyMemberHandle.
static const LobbyMemberHandle nullobj
Uninitialized instance of LobbyMemberHandle.
Definition discordpp.h:2704
uint64_t Id() const
The user id of the lobby member.
LobbyMemberHandle(const LobbyMemberHandle &other)
Copy constructor for LobbyMemberHandle.
bool Connected() const
Returns true if the user is currently connected to the lobby.
LobbyMemberHandle & operator=(LobbyMemberHandle &&other) noexcept
Move assignment operator for LobbyMemberHandle.
std::optional< discordpp::UserHandle > User() const
The UserHandle of the lobby member.
bool CanLinkLobby() const
Returns true if the user is allowed to link a channel to this lobby.
LobbyMemberHandle(LobbyMemberHandle &&other) noexcept
Move constructor for LobbyMemberHandle.
std::unordered_map< std::string, std::string > Metadata() const
Metadata is a set of string key/value pairs that the game developer can use.
A MessageHandle represents a single message received by the SDK.
Definition discordpp.h:3006
uint64_t AuthorId() const
Returns the user ID of the user who sent this message.
std::optional< discordpp::ChannelHandle > Channel() const
Returns the ChannelHandle for the channel this message was sent in.
static const MessageHandle nullobj
Uninitialized instance of MessageHandle.
Definition discordpp.h:3025
std::optional< discordpp::UserHandle > Recipient() const
Returns the UserHandle for the other participant in a DM, if this message was sent in a DM.
std::optional< uint64_t > ApplicationId() const
Returns the application ID associated with this message, if any. You can use this to identify if the ...
MessageHandle & operator=(const MessageHandle &other)
Copy assignment operator for MessageHandle.
uint64_t Id() const
Returns the ID of this message.
std::optional< discordpp::UserHandle > Author() const
Returns the UserHandle for the author of this message.
MessageHandle & operator=(MessageHandle &&other) noexcept
Move assignment operator for MessageHandle.
uint64_t EditedTimestamp() const
The timestamp in millis since the epoch when the message was most recently edited.
MessageHandle(const MessageHandle &other)
Copy constructor for MessageHandle.
std::string Content() const
Returns the content of this message, if any.
std::unordered_map< std::string, std::string > Metadata() const
Returns any metadata the developer included with this message.
std::string RawContent() const
Returns the content of this message, if any, but without replacing any markup from emojis and mention...
std::optional< discordpp::LobbyHandle > Lobby() const
Returns the LobbyHandle this message was sent in, if it was sent in a lobby.
uint64_t RecipientId() const
When this message was sent in a DM or Ephemeral DM, this method will return the ID of the other user ...
uint64_t SentTimestamp() const
The timestamp in millis since the epoch when the message was sent.
std::optional< discordpp::DisclosureTypes > DisclosureType() const
If this is an auto-generated message that is explaining some integration behavior to users,...
uint64_t ChannelId() const
Returns the channel ID this message was sent in.
MessageHandle(MessageHandle &&other) noexcept
Move constructor for MessageHandle.
bool SentFromGame() const
Returns true if this message was sent in-game, otherwise false (i.e. from Discord itself)....
std::optional< discordpp::AdditionalContent > AdditionalContent() const
If the message contains non-text content, such as images, videos, embeds, polls, etc,...
std::unordered_map< std::string, std::string > ModerationMetadata() const
Returns any moderation metadata the developer set on this message.
A RelationshipHandle represents the relationship between the current user and a target user on Discor...
Definition discordpp.h:2436
RelationshipHandle & operator=(const RelationshipHandle &other)
Copy assignment operator for RelationshipHandle.
RelationshipHandle(const RelationshipHandle &other)
Copy constructor for RelationshipHandle.
uint64_t Id() const
Returns the ID of the target user in this relationship.
discordpp::RelationshipType DiscordRelationshipType() const
Returns the type of the Discord relationship.
RelationshipHandle(RelationshipHandle &&other) noexcept
Move constructor for RelationshipHandle.
discordpp::RelationshipType GameRelationshipType() const
Returns the type of the Game relationship.
static const RelationshipHandle nullobj
Uninitialized instance of RelationshipHandle.
Definition discordpp.h:2455
bool IsSpamRequest() const
Returns whether this relationship is a spam request.
std::optional< discordpp::UserHandle > User() const
Returns a handle to the target user in this relationship, if one is available. This would be the user...
RelationshipHandle & operator=(RelationshipHandle &&other) noexcept
Move assignment operator for RelationshipHandle.
static const UserApplicationProfileHandle nullobj
Uninitialized instance of UserApplicationProfileHandle.
Definition discordpp.h:2513
std::string Username() const
Returns the user's in-game username.
std::string Metadata() const
Returns any metadata set by the developer.
UserApplicationProfileHandle(UserApplicationProfileHandle &&other) noexcept
Move constructor for UserApplicationProfileHandle.
UserApplicationProfileHandle & operator=(const UserApplicationProfileHandle &other)
Copy assignment operator for UserApplicationProfileHandle.
std::string ProviderIssuedUserId() const
Returns the user's external identity provider issued user ID.
UserApplicationProfileHandle & operator=(UserApplicationProfileHandle &&other) noexcept
Move assignment operator for UserApplicationProfileHandle.
UserApplicationProfileHandle(const UserApplicationProfileHandle &other)
Copy constructor for UserApplicationProfileHandle.
std::string AvatarHash() const
Returns the user's in-game avatar hash.
std::optional< std::string > ProviderId() const
Returns the user's external identity provider ID if it exists.
discordpp::ExternalIdentityProviderType ProviderType() const
Returns the type of the external identity provider.
A UserHandle represents a single user on Discord that the SDK knows about and contains basic account ...
Definition discordpp.h:2555
uint64_t Id() const
Returns the ID of this user.
UserHandle & operator=(UserHandle &&other) noexcept
Move assignment operator for UserHandle.
std::string Username() const
Returns the globally unique username of this user.
static const UserHandle nullobj
Uninitialized instance of UserHandle.
Definition discordpp.h:2589
std::optional< std::string > Avatar() const
Returns the hash of the user's Discord profile avatar, if one is set.
UserHandle(const UserHandle &arg0)
Copy constructor for UserHandle.
discordpp::StatusType Status() const
Returns the user's online/offline/idle status.
UserHandle(UserHandle &&other) noexcept
Move constructor for UserHandle.
std::vector< discordpp::UserApplicationProfileHandle > UserApplicationProfiles() const
Returns a list of UserApplicationProfileHandles for this user. Currently, a user can only have a sing...
std::string AvatarUrl(discordpp::UserHandle::AvatarType animatedType, discordpp::UserHandle::AvatarType staticType) const
Returns a CDN url to the user's Discord profile avatar.
AvatarType
The desired type of avatar url to generate for a User.
Definition discordpp.h:2563
@ Jpeg
Jpeg.
Definition discordpp.h:2575
@ Gif
Gif.
Definition discordpp.h:2566
@ Webp
Webp.
Definition discordpp.h:2569
@ Png
Png.
Definition discordpp.h:2572
bool IsProvisional() const
Returns true if this user is a provisional account.
std::optional< std::string > GlobalName() const
Returns the preferred display name of this user, if one is set.
std::optional< discordpp::Activity > GameActivity() const
Returns the user's rich presence activity that is associated with the current game,...
UserHandle & operator=(const UserHandle &arg0)
Copy assignment operator for UserHandle.
static std::string AvatarTypeToString(discordpp::UserHandle::AvatarType type)
Converts the AvatarType enum to a string.
std::string DisplayName() const
Returns the user's preferred name, if one is set, otherwise returns their unique username.
discordpp::RelationshipHandle Relationship() const
Returns a reference to the RelationshipHandle between the currently authenticated user and this user,...
UserMessageSummary & operator=(const UserMessageSummary &arg0)
Copy assignment operator for UserMessageSummary.
static const UserMessageSummary nullobj
Uninitialized instance of UserMessageSummary.
Definition discordpp.h:3198
UserMessageSummary(UserMessageSummary &&other) noexcept
Move constructor for UserMessageSummary.
uint64_t LastMessageId() const
Returns the ID of the last message sent in the DM conversation.
uint64_t UserId() const
Returns the ID of the other user in the DM conversation.
UserMessageSummary(const UserMessageSummary &arg0)
Copy constructor for UserMessageSummary.
UserMessageSummary & operator=(UserMessageSummary &&other) noexcept
Move assignment operator for UserMessageSummary.
Settings for the void auto detection threshold for picking up activity from a user's mic.
Definition discordpp.h:1845
VADThresholdSettings & operator=(VADThresholdSettings &&other) noexcept
Move assignment operator for VADThresholdSettings.
VADThresholdSettings(VADThresholdSettings &&other) noexcept
Move constructor for VADThresholdSettings.
static const VADThresholdSettings nullobj
Uninitialized instance of VADThresholdSettings.
Definition discordpp.h:1864
bool Automatic() const
Whether or not Discord is currently automatically setting and detecting the appropriate threshold to ...
float VadThreshold() const
The current void auto detection threshold value, has a range of -100, 0 and defaults to -60.
void SetAutomatic(bool Automatic)
Setter for VADThresholdSettings::Automatic.
void SetVadThreshold(float VadThreshold)
Setter for VADThresholdSettings::VadThreshold.
A VoiceStateHandle represents the state of a single participant in a Discord voice call.
Definition discordpp.h:1803
VoiceStateHandle & operator=(VoiceStateHandle &&other) noexcept
Move assignment operator for VoiceStateHandle.
bool SelfMute() const
Returns true if the given user has muted themselves so that no one else in the call can hear them.
static const VoiceStateHandle nullobj
Uninitialized instance of VoiceStateHandle.
Definition discordpp.h:1822
bool SelfDeaf() const
Returns true if the given user has deafened themselves so that no one else in the call can hear them ...
VoiceStateHandle(VoiceStateHandle &&other) noexcept
Move constructor for VoiceStateHandle.
VoiceStateHandle & operator=(const VoiceStateHandle &other)
Copy assignment operator for VoiceStateHandle.
VoiceStateHandle(const VoiceStateHandle &other)
Copy constructor for VoiceStateHandle.
The namespace for the generated Discord SDK bindings.
Definition discordpp.h:16
ActivityPartyPrivacy
Allows your game to control the privacy of the party the user is in.
Definition discordpp.h:54
@ Public
The party is public, which means that the user is in a party which could be joinable by either friend...
Definition discordpp.h:68
@ Private
The party is private (or unknown), which means that the user is in a party but it is not joinable wit...
Definition discordpp.h:62
DisclosureTypes
Enum that represents various informational disclosures that Discord may make to users,...
Definition discordpp.h:601
@ MessageDataVisibleOnDiscord
This disclosure type happens the first time a user sends a message in game, and that message will be ...
Definition discordpp.h:607
const char * EnumToString(discordpp::ActivityActionTypes value)
Converts a discordpp::ActivityActionTypes to a string.
Definition discordpp.h:5264
HttpStatusCode
Enum that represents the various HTTP status codes that can be returned.
Definition discordpp.h:207
@ RequestHeaderFieldsTooLarge
RequestHeaderFieldsTooLarge.
Definition discordpp.h:354
@ PayloadTooLarge
PayloadTooLarge.
Definition discordpp.h:315
@ MultiStatus
MultiStatus.
Definition discordpp.h:246
@ VariantAlsoNegotiates
VariantAlsoNegotiates.
Definition discordpp.h:375
@ Gone
Gone.
Definition discordpp.h:306
@ BadGateway
BadGateway.
Definition discordpp.h:363
@ Created
Created.
Definition discordpp.h:228
@ TemporaryRedirect
TemporaryRedirect.
Definition discordpp.h:270
@ ServiceUnavailable
ServiceUnavailable.
Definition discordpp.h:366
@ MovedPermanently
MovedPermanently.
Definition discordpp.h:258
@ PreconditionFailed
PreconditionFailed.
Definition discordpp.h:312
@ RequestTimeout
RequestTimeout.
Definition discordpp.h:300
@ Accepted
Accepted.
Definition discordpp.h:231
@ NonAuthoritativeInfo
NonAuthoritativeInfo.
Definition discordpp.h:234
@ NotFound
NotFound.
Definition discordpp.h:288
@ FailedDependency
FailedDependency.
Definition discordpp.h:339
@ PaymentRequired
PaymentRequired.
Definition discordpp.h:282
@ PreconditionRequired
PreconditionRequired.
Definition discordpp.h:348
@ ResetContent
ResetContent.
Definition discordpp.h:240
@ SwitchingProtocols
SwitchingProtocols.
Definition discordpp.h:216
@ HttpVersionNotSupported
HttpVersionNotSupported.
Definition discordpp.h:372
@ Found
Found.
Definition discordpp.h:261
@ Processing
Processing.
Definition discordpp.h:219
@ None
None.
Definition discordpp.h:210
@ ExpectationFailed
ExpectationFailed.
Definition discordpp.h:327
@ Forbidden
Forbidden.
Definition discordpp.h:285
@ PartialContent
PartialContent.
Definition discordpp.h:243
@ SeeOther
SeeOther.
Definition discordpp.h:264
@ EarlyHints
EarlyHints.
Definition discordpp.h:222
@ LengthRequired
LengthRequired.
Definition discordpp.h:309
@ MethodNotAllowed
MethodNotAllowed.
Definition discordpp.h:291
@ NotExtended
NotExtended.
Definition discordpp.h:384
@ RangeNotSatisfiable
RangeNotSatisfiable.
Definition discordpp.h:324
@ NotImplemented
NotImplemented.
Definition discordpp.h:360
@ BadRequest
BadRequest.
Definition discordpp.h:276
@ Continue
Continue.
Definition discordpp.h:213
@ LoopDetected
LoopDetected.
Definition discordpp.h:381
@ UnsupportedMediaType
UnsupportedMediaType.
Definition discordpp.h:321
@ NetworkAuthorizationRequired
NetworkAuthorizationRequired.
Definition discordpp.h:387
@ ImUsed
ImUsed.
Definition discordpp.h:252
@ MultipleChoices
MultipleChoices.
Definition discordpp.h:255
@ Ok
Ok.
Definition discordpp.h:225
@ TooManyRequests
TooManyRequests.
Definition discordpp.h:351
@ ProxyAuthRequired
ProxyAuthRequired.
Definition discordpp.h:297
@ UnprocessableEntity
UnprocessableEntity.
Definition discordpp.h:333
@ MisdirectedRequest
MisdirectedRequest.
Definition discordpp.h:330
@ PermanentRedirect
PermanentRedirect.
Definition discordpp.h:273
@ NotModified
NotModified.
Definition discordpp.h:267
@ AlreadyReported
AlreadyReported.
Definition discordpp.h:249
@ NoContent
NoContent.
Definition discordpp.h:237
@ Locked
Locked.
Definition discordpp.h:336
@ GatewayTimeout
GatewayTimeout.
Definition discordpp.h:369
@ Unauthorized
Unauthorized.
Definition discordpp.h:279
@ UpgradeRequired
UpgradeRequired.
Definition discordpp.h:345
@ InsufficientStorage
InsufficientStorage.
Definition discordpp.h:378
@ InternalServerError
InternalServerError.
Definition discordpp.h:357
@ TooEarly
TooEarly.
Definition discordpp.h:342
@ Conflict
Conflict.
Definition discordpp.h:303
@ UriTooLong
UriTooLong.
Definition discordpp.h:318
@ NotAcceptable
NotAcceptable.
Definition discordpp.h:294
AuthorizationTokenType
Represents the type of auth token used by the SDK, either the normal tokens produced by the Discord d...
Definition discordpp.h:612
@ Bearer
Bearer.
Definition discordpp.h:618
@ User
User.
Definition discordpp.h:615
ChannelType
Enum that represents the various channel types on Discord.
Definition discordpp.h:412
@ GuildForum
GuildForum.
Definition discordpp.h:451
@ Dm
Dm.
Definition discordpp.h:418
@ Lobby
Lobby.
Definition discordpp.h:457
@ GuildNews
GuildNews.
Definition discordpp.h:430
@ GuildVoice
GuildVoice.
Definition discordpp.h:421
@ GuildPublicThread
GuildPublicThread.
Definition discordpp.h:439
@ GuildNewsThread
GuildNewsThread.
Definition discordpp.h:436
@ GuildDirectory
GuildDirectory.
Definition discordpp.h:448
@ GuildCategory
GuildCategory.
Definition discordpp.h:427
@ GuildStageVoice
GuildStageVoice.
Definition discordpp.h:445
@ GuildMedia
GuildMedia.
Definition discordpp.h:454
@ GuildStore
GuildStore.
Definition discordpp.h:433
@ GuildText
GuildText.
Definition discordpp.h:415
@ GroupDm
GroupDm.
Definition discordpp.h:424
@ EphemeralDm
EphemeralDm.
Definition discordpp.h:460
@ GuildPrivateThread
GuildPrivateThread.
Definition discordpp.h:442
AuthenticationCodeChallengeMethod
Represents the crypto method used to generate a code challenge.
Definition discordpp.h:393
@ S256
S256.
Definition discordpp.h:396
RelationshipType
Enum that represents the possible types of relationships that can exist between two users.
Definition discordpp.h:512
@ PendingIncoming
The current user has received a friend request from the target user, but it is not yet accepted.
Definition discordpp.h:527
@ Implicit
The Implicit type is documented for visibility, but should be unused in the SDK.
Definition discordpp.h:534
@ Suggestion
The Suggestion type is documented for visibility, but should be unused in the SDK.
Definition discordpp.h:537
@ PendingOutgoing
The current user has sent a friend request to the target user, but it is not yet accepted.
Definition discordpp.h:531
@ Blocked
The current user has blocked the target user, and so certain actions such as sending messages between...
Definition discordpp.h:522
@ None
The user has no relationship with the other user.
Definition discordpp.h:515
@ Friend
The user is friends with the other user.
Definition discordpp.h:518
AuthenticationExternalAuthType
Represents the various identity providers that can be used to authenticate a provisional account user...
Definition discordpp.h:623
@ EpicOnlineServicesIdToken
EpicOnlineServicesIdToken.
Definition discordpp.h:632
@ DiscordBotIssuedAccessToken
DiscordBotIssuedAccessToken.
Definition discordpp.h:641
@ EpicOnlineServicesAccessToken
EpicOnlineServicesAccessToken.
Definition discordpp.h:629
@ SteamSessionTicket
SteamSessionTicket.
Definition discordpp.h:635
@ OIDC
OIDC.
Definition discordpp.h:626
@ UnityServicesIdToken
UnityServicesIdToken.
Definition discordpp.h:638
@ PlayStationNetworkIdToken
PlayStationNetworkIdToken.
Definition discordpp.h:647
@ AppleIdToken
AppleIdToken.
Definition discordpp.h:644
LoggingSeverity
Enum that represents the various log levels supported by the SDK.
Definition discordpp.h:651
@ Warning
Warning.
Definition discordpp.h:660
@ Info
Info.
Definition discordpp.h:657
@ None
None.
Definition discordpp.h:666
@ Error
Error.
Definition discordpp.h:663
@ Verbose
Verbose.
Definition discordpp.h:654
RelationshipGroupType
Enum that represents the logical groups of relationships based on online status and game activity.
Definition discordpp.h:671
@ OnlinePlayingGame
Users who are online and currently playing the game.
Definition discordpp.h:674
@ Offline
Users who are offline.
Definition discordpp.h:680
@ OnlineElsewhere
Users who are online but not playing the game.
Definition discordpp.h:677
IntegrationType
Represents the type of integration the app will be installed as.
Definition discordpp.h:400
@ GuildInstall
GuildInstall.
Definition discordpp.h:403
@ UserInstall
UserInstall.
Definition discordpp.h:406
AudioSystem
The Discord Voice audio system to use.
Definition discordpp.h:489
@ Game
Use the game audio system.
Definition discordpp.h:495
@ Standard
Use the standard audio system.
Definition discordpp.h:492
ActivityGamePlatforms
Represents the type of platforms that an activity invite can be accepted on.
Definition discordpp.h:117
@ Embedded
Embedded.
Definition discordpp.h:135
@ Xbox
Xbox.
Definition discordpp.h:123
@ Desktop
Desktop.
Definition discordpp.h:120
@ Samsung
Samsung.
Definition discordpp.h:126
@ PS5
PS5.
Definition discordpp.h:141
@ PS4
PS4.
Definition discordpp.h:138
@ IOS
IOS.
Definition discordpp.h:129
@ Android
Android.
Definition discordpp.h:132
ActivityTypes
Discord RichPresence supports multiple types of activities that a user can be doing.
Definition discordpp.h:77
@ Watching
Watching.
Definition discordpp.h:89
@ Competing
Competing.
Definition discordpp.h:95
@ HangStatus
HangStatus.
Definition discordpp.h:98
@ Listening
Listening.
Definition discordpp.h:86
@ Streaming
Streaming.
Definition discordpp.h:83
@ CustomStatus
CustomStatus.
Definition discordpp.h:92
@ Playing
Playing.
Definition discordpp.h:80
StatusType
Enum that specifies the various online statuses for a user.
Definition discordpp.h:569
@ Blocked
Blocked.
Definition discordpp.h:578
@ Online
The user is online and recently active.
Definition discordpp.h:572
@ Dnd
The user is online, but wishes to suppress notifications for the time being.
Definition discordpp.h:585
@ Unknown
Unknown.
Definition discordpp.h:594
@ Invisible
The user is online, but wishes to appear as if they are offline to other users.
Definition discordpp.h:588
@ Offline
The user is offline and not connected to Discord.
Definition discordpp.h:575
@ Streaming
The user is online and is actively streaming content.
Definition discordpp.h:591
@ Idle
The user is online, but has not been active for a while and may be away from their computer.
Definition discordpp.h:582
StatusDisplayTypes
Controls which Discord RichPresence field is displayed in the user's status.
Definition discordpp.h:104
@ Details
Details.
Definition discordpp.h:113
@ State
State.
Definition discordpp.h:110
@ Name
Name.
Definition discordpp.h:107
ExternalIdentityProviderType
The type of external identity provider.
Definition discordpp.h:541
@ EpicOnlineServices
EpicOnlineServices.
Definition discordpp.h:547
@ OIDC
OIDC.
Definition discordpp.h:544
@ Steam
Steam.
Definition discordpp.h:550
@ None
None.
Definition discordpp.h:559
@ Unity
Unity.
Definition discordpp.h:553
@ Unknown
Unknown.
Definition discordpp.h:562
@ DiscordBot
DiscordBot.
Definition discordpp.h:556
void RunCallbacks()
Definition discordpp.h:29
AudioModeType
Represents whether a voice call is using push to talk or auto voice detection.
Definition discordpp.h:499
@ MODE_PTT
MODE_PTT.
Definition discordpp.h:508
@ MODE_VAD
MODE_VAD.
Definition discordpp.h:505
@ MODE_UNINIT
MODE_UNINIT.
Definition discordpp.h:502
ErrorType
Enum representing various types of errors the SDK returns.
Definition discordpp.h:145
@ HTTPError
An HTTP call was made to Discord's servers but a non success HTTP status code was returned....
Definition discordpp.h:160
@ NetworkError
The user is offline or there was some network issue that prevented an underlying HTTP call from succe...
Definition discordpp.h:152
@ AuthorizationFailed
An authorization function failed, but not necessarily as the result of an HTTP call that returned an ...
Definition discordpp.h:194
@ ClientNotReady
An operation such as sending a friend request or joining a lobby was attempted but the Client is not ...
Definition discordpp.h:170
@ None
No error, the operation was successful.
Definition discordpp.h:148
@ Aborted
The user or developer aborted an operation, such as an authorization flow.
Definition discordpp.h:189
@ RPCError
An RPC call was made to Discord's desktop application, but it returned a non-success result....
Definition discordpp.h:199
@ ValidationError
Used when an SDK method is called but the inputs don't pass local validation. For example if one atte...
Definition discordpp.h:186
@ ClientDestroyed
The Client has been destroyed and so this operation cannot complete.
Definition discordpp.h:176
@ Disabled
An operation was temporarily disabled for stability reasons.
Definition discordpp.h:173
DiscordObjectState
Represents the memory state of a Discord object.
Definition discordpp.h:19
@ Invalid
The object has been freed.
Definition discordpp.h:21
@ Owned
The object is owned by the C++ wrapper and methods can be called on it.
Definition discordpp.h:23
AdditionalContentType
Represents the type of additional content contained in a message.
Definition discordpp.h:464
@ Sticker
Sticker.
Definition discordpp.h:485
@ VoiceMessage
VoiceMessage.
Definition discordpp.h:476
@ Other
Other.
Definition discordpp.h:467
@ Poll
Poll.
Definition discordpp.h:473
@ Thread
Thread.
Definition discordpp.h:479
@ Attachment
Attachment.
Definition discordpp.h:470
@ Embed
Embed.
Definition discordpp.h:482
ActivityActionTypes
ActivityActionTypes represents the type of invite being sent to a user.
Definition discordpp.h:41
@ Invalid
Invalid.
Definition discordpp.h:44
@ Join
Join.
Definition discordpp.h:47
@ JoinRequest
JoinRequest.
Definition discordpp.h:50