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_; }
3057 std::optional<discordpp::UserHandle>
Author()
const;
3063 std::optional<discordpp::ChannelHandle>
Channel()
const;
3088 std::optional<discordpp::LobbyHandle>
Lobby()
const;
3095 std::unordered_map<std::string, std::string>
Metadata()
const;
3135 mutable Discord_AudioDevice instance_{};
3141 Discord_AudioDevice* instance()
const {
return &instance_; }
3187 mutable Discord_UserMessageSummary instance_{};
3193 Discord_UserMessageSummary* instance()
const {
return &instance_; }
3229 mutable Discord_ClientCreateOptions instance_{};
3235 Discord_ClientCreateOptions* instance()
const {
return &instance_; }
3309 mutable Discord_Client instance_{};
3401 std::function<void(std::vector<discordpp::AudioDevice> devices)>;
3405 std::function<void(std::vector<discordpp::AudioDevice> devices)>;
3409 std::function<void(std::vector<discordpp::AudioDevice> inputDevices,
3410 std::vector<discordpp::AudioDevice> outputDevices)>;
3423 std::function<void(uint64_t lobbyId, uint64_t memberId,
bool added)>;
3430 uint64_t samplesPerChannel,
3433 bool& outShouldMute)>;
3439 void(int16_t* data, uint64_t samplesPerChannel, int32_t sampleRate, uint64_t channels)>;
3453 std::string accessToken,
3456 std::string scopes)>;
3464 std::string accessToken,
3465 std::string refreshToken,
3468 std::string scopes)>;
3507 std::vector<discordpp::MessageHandle> messages)>;
3512 std::vector<discordpp::UserMessageSummary> summaries)>;
3517 std::vector<discordpp::MessageHandle> messages)>;
3562 std::vector<discordpp::GuildChannel> guildChannels)>;
3566 std::vector<discordpp::GuildMinimal> guilds)>;
3616 std::function<void(uint64_t applicationId, std::string joinSecret)>;
3637 std::function<void(uint64_t userId,
bool isDiscordRelationshipUpdate)>;
3644 std::function<void(uint64_t userId,
bool isDiscordRelationshipUpdate)>;
3649 std::optional<discordpp::UserHandle> user)>;
3657 Discord_Client* instance()
const {
return &instance_; }
3679 explicit Client(std::string apiBase, std::string webBase);
3700 [[deprecated(
"Please use GetCurrentUserV2 instead. This will be removed in a future version.")]]
3912 [[deprecated(
"Calling Client::SetSpeakerMode is DEPRECATED.")]]
4106 uint64_t childApplicationId,
4115 std::string
const& token,
4153 std::string
const& externalAuthToken,
4180 std::string
const& code,
4181 std::string
const& codeVerifier,
4182 std::string
const& redirectUri,
4252 std::string
const& externalAuthToken,
4286 std::string
const& code,
4287 std::string
const& codeVerifier,
4288 std::string
const& redirectUri,
4290 std::string
const& externalAuthToken,
4326 std::string
const& refreshToken,
4360 std::string
const& token,
4406 uint64_t applicationId,
4408 std::string
const& externalAuthToken,
4417 std::string
const& name,
4451 std::string
const& content,
4530 std::string
const& content,
4540 std::string
const& content,
4541 std::unordered_map<std::string, std::string>
const& metadata,
4557 std::string
const& content,
4567 std::string
const& content,
4568 std::unordered_map<std::string, std::string>
const& metadata,
4735 std::string
const& secret,
4736 std::unordered_map<std::string, std::string>
const& lobbyMetadata,
4737 std::unordered_map<std::string, std::string>
const& memberMetadata,
4929 std::string
const& content,
5198 uint64_t applicationId,
5206 std::optional<discordpp::UserHandle>
GetUser(uint64_t userId)
const;
5226 mutable Discord_CallInfoHandle instance_{};
5232 Discord_CallInfoHandle* instance()
const {
return &instance_; }
5278 return "JoinRequest";
5308 return "CustomStatus";
5312 return "HangStatus";
5362 return "NetworkError";
5366 return "ClientNotReady";
5370 return "ClientDestroyed";
5372 return "ValidationError";
5376 return "AuthorizationFailed";
5392 return "SwitchingProtocols";
5394 return "Processing";
5396 return "EarlyHints";
5404 return "NonAuthoritativeInfo";
5408 return "ResetContent";
5410 return "PartialContent";
5412 return "MultiStatus";
5414 return "AlreadyReported";
5418 return "MultipleChoices";
5420 return "MovedPermanently";
5426 return "NotModified";
5428 return "TemporaryRedirect";
5430 return "PermanentRedirect";
5432 return "BadRequest";
5434 return "Unauthorized";
5436 return "PaymentRequired";
5442 return "MethodNotAllowed";
5444 return "NotAcceptable";
5446 return "ProxyAuthRequired";
5448 return "RequestTimeout";
5454 return "LengthRequired";
5456 return "PreconditionFailed";
5458 return "PayloadTooLarge";
5460 return "UriTooLong";
5462 return "UnsupportedMediaType";
5464 return "RangeNotSatisfiable";
5466 return "ExpectationFailed";
5468 return "MisdirectedRequest";
5470 return "UnprocessableEntity";
5474 return "FailedDependency";
5478 return "UpgradeRequired";
5480 return "PreconditionRequired";
5482 return "TooManyRequests";
5484 return "RequestHeaderFieldsTooLarge";
5486 return "InternalServerError";
5488 return "NotImplemented";
5490 return "BadGateway";
5492 return "ServiceUnavailable";
5494 return "GatewayTimeout";
5496 return "HttpVersionNotSupported";
5498 return "VariantAlsoNegotiates";
5500 return "InsufficientStorage";
5502 return "LoopDetected";
5504 return "NotExtended";
5506 return "NetworkAuthorizationRequired";
5526 return "GuildInstall";
5528 return "UserInstall";
5542 return "GuildVoice";
5546 return "GuildCategory";
5550 return "GuildStore";
5552 return "GuildNewsThread";
5554 return "GuildPublicThread";
5556 return "GuildPrivateThread";
5558 return "GuildStageVoice";
5560 return "GuildDirectory";
5562 return "GuildForum";
5564 return "GuildMedia";
5568 return "EphemeralDm";
5580 return "Attachment";
5584 return "VoiceMessage";
5614 return "SignalingConnectionFailed";
5616 return "SignalingUnexpectedClose";
5618 return "VoiceConnectionFailed";
5620 return "JoinTimeout";
5632 return "MODE_UNINIT";
5646 return "Disconnected";
5650 return "Connecting";
5652 return "SignalingConnected";
5656 return "Reconnecting";
5658 return "Disconnecting";
5674 return "PendingIncoming";
5676 return "PendingOutgoing";
5680 return "Suggestion";
5692 return "EpicOnlineServices";
5698 return "DiscordBot";
5752 return "MessageDataVisibleOnDiscord";
5764 return "ConnectionFailed";
5766 return "UnexpectedClose";
5768 return "ConnectionCanceled";
5778 return "Disconnected";
5780 return "Connecting";
5786 return "Reconnecting";
5788 return "Disconnecting";
5828 return "EpicOnlineServicesAccessToken";
5830 return "EpicOnlineServicesIdToken";
5832 return "SteamSessionTicket";
5834 return "UnityServicesIdToken";
5836 return "DiscordBotIssuedAccessToken";
5838 return "AppleIdToken";
5840 return "PlayStationNetworkIdToken";
5868 return "OnlinePlayingGame";
5870 return "OnlineElsewhere";
5879#ifdef DISCORDPP_IMPLEMENTATION
5880#undef DISCORDPP_IMPLEMENTATION
5882#pragma clang diagnostic push
5883#pragma clang diagnostic ignored "-Wunused-parameter"
5886std::function<void(std::function<
void()>)> s_synchronizationContext;
5888inline bool HasSynchronizationContext()
5890 return !!s_synchronizationContext;
5893inline void PostTask(std::function<
void()> task)
5895 assert(s_synchronizationContext);
5896 s_synchronizationContext(std::move(task));
5899void SetSynchronizationContext(std::function<
void(std::function<
void()>)> executor)
5901 s_synchronizationContext = std::move(executor);
5904template <
typename T>
5905struct TDelegateUserData {
5907 TDelegateUserData(T delegate)
5908 : delegate{delegate}
5912 static void Free(
void* ptr) {
delete reinterpret_cast<TDelegateUserData*
>(ptr); }
5914 static T& Get(
void* userData)
5916 return reinterpret_cast<TDelegateUserData*
>(userData)->delegate;
5920struct ConvertedProperties {
5921 ConvertedProperties(std::unordered_map<std::string, std::string>
const& PropertyMap)
5923 Properties.size = PropertyMap.size();
5924 Properties.keys =
reinterpret_cast<Discord_String*
>(
5925 Discord_Alloc(Properties.size *
sizeof(Discord_String)));
5926 Properties.values =
reinterpret_cast<Discord_String*
>(
5927 Discord_Alloc(Properties.size *
sizeof(Discord_String)));
5929 for (
auto& pair : PropertyMap) {
5930 Properties.keys[i] = AllocateString(pair.first);
5931 Properties.values[i] = AllocateString(pair.second);
5935 ~ConvertedProperties() { Discord_FreeProperties(Properties); }
5936 Discord_Properties Properties{};
5939 Discord_String AllocateString(std::string
const& str)
5941 Discord_String result;
5942 result.ptr =
reinterpret_cast<uint8_t*
>(Discord_Alloc(str.size()));
5943 result.size = str.size();
5944 std::memcpy(result.ptr, str.data(), result.size);
5949std::unordered_map<std::string, std::string> ConvertReturnedProperties(
5950 Discord_Properties
const& Properties)
5952 std::unordered_map<std::string, std::string> result;
5953 for (
size_t i = 0; i < Properties.size; ++i) {
5954 std::string key(
reinterpret_cast<char*
>(Properties.keys[i].ptr), Properties.keys[i].size);
5955 std::string value(
reinterpret_cast<char*
>(Properties.values[i].ptr),
5956 Properties.values[i].size);
5957 result.emplace(std::move(key), std::move(value));
5962ActivityInvite::~ActivityInvite()
5970 : instance_(other.instance_)
5971 , state_(other.state_)
5977 if (
this != &other) {
5981 instance_ = other.instance_;
5982 state_ = other.state_;
5992 Discord_ActivityInvite_Clone(&instance_, rhs.instance());
5994 state_ = DiscordObjectState::Owned;
5997ActivityInvite& ActivityInvite::operator=(
const ActivityInvite& rhs)
6000 if (state_ == DiscordObjectState::Owned) {
6002 state_ = DiscordObjectState::Invalid;
6004 if (rhs.state_ == DiscordObjectState::Owned) {
6005 Discord_ActivityInvite_Clone(&instance_, rhs.instance());
6007 state_ = DiscordObjectState::Owned;
6012ActivityInvite::ActivityInvite(Discord_ActivityInvite instance, DiscordObjectState state)
6013 : instance_(instance)
6017ActivityInvite::ActivityInvite()
6019 assert(state_ == DiscordObjectState::Invalid);
6020 Discord_ActivityInvite_Init(&instance_);
6021 state_ = DiscordObjectState::Owned;
6023void ActivityInvite::Drop()
6025 if (state_ != DiscordObjectState::Owned) {
6028 Discord_ActivityInvite_Drop(&instance_);
6029 state_ = DiscordObjectState::Invalid;
6031uint64_t ActivityInvite::SenderId()
const
6033 assert(state_ == DiscordObjectState::Owned);
6034 uint64_t returnValue__;
6035 returnValue__ = Discord_ActivityInvite_SenderId(&instance_);
6036 return returnValue__;
6038void ActivityInvite::SetSenderId(uint64_t SenderId)
6040 assert(state_ == DiscordObjectState::Owned);
6041 Discord_ActivityInvite_SetSenderId(&instance_, SenderId);
6043uint64_t ActivityInvite::ChannelId()
const
6045 assert(state_ == DiscordObjectState::Owned);
6046 uint64_t returnValue__;
6047 returnValue__ = Discord_ActivityInvite_ChannelId(&instance_);
6048 return returnValue__;
6050void ActivityInvite::SetChannelId(uint64_t ChannelId)
6052 assert(state_ == DiscordObjectState::Owned);
6053 Discord_ActivityInvite_SetChannelId(&instance_, ChannelId);
6055uint64_t ActivityInvite::MessageId()
const
6057 assert(state_ == DiscordObjectState::Owned);
6058 uint64_t returnValue__;
6059 returnValue__ = Discord_ActivityInvite_MessageId(&instance_);
6060 return returnValue__;
6062void ActivityInvite::SetMessageId(uint64_t MessageId)
6064 assert(state_ == DiscordObjectState::Owned);
6065 Discord_ActivityInvite_SetMessageId(&instance_, MessageId);
6069 assert(state_ == DiscordObjectState::Owned);
6070 Discord_ActivityActionTypes returnValue__;
6071 returnValue__ = Discord_ActivityInvite_Type(&instance_);
6076 assert(state_ == DiscordObjectState::Owned);
6077 Discord_ActivityInvite_SetType(&instance_,
static_cast<Discord_ActivityActionTypes
>(Type));
6079uint64_t ActivityInvite::ApplicationId()
const
6081 assert(state_ == DiscordObjectState::Owned);
6082 uint64_t returnValue__;
6083 returnValue__ = Discord_ActivityInvite_ApplicationId(&instance_);
6084 return returnValue__;
6086void ActivityInvite::SetApplicationId(uint64_t ApplicationId)
6088 assert(state_ == DiscordObjectState::Owned);
6089 Discord_ActivityInvite_SetApplicationId(&instance_, ApplicationId);
6091uint64_t ActivityInvite::ParentApplicationId()
const
6093 assert(state_ == DiscordObjectState::Owned);
6094 uint64_t returnValue__;
6095 returnValue__ = Discord_ActivityInvite_ParentApplicationId(&instance_);
6096 return returnValue__;
6098void ActivityInvite::SetParentApplicationId(uint64_t ParentApplicationId)
6100 assert(state_ == DiscordObjectState::Owned);
6101 Discord_ActivityInvite_SetParentApplicationId(&instance_, ParentApplicationId);
6103std::string ActivityInvite::PartyId()
const
6105 assert(state_ == DiscordObjectState::Owned);
6106 Discord_String returnValueNative__;
6107 Discord_ActivityInvite_PartyId(&instance_, &returnValueNative__);
6108 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6109 returnValueNative__.size);
6110 Discord_Free(returnValueNative__.ptr);
6111 return returnValue__;
6113void ActivityInvite::SetPartyId(std::string PartyId)
6115 assert(state_ == DiscordObjectState::Owned);
6116 Discord_String PartyId__str{(uint8_t*)(PartyId.data()), PartyId.size()};
6117 Discord_ActivityInvite_SetPartyId(&instance_, PartyId__str);
6119std::string ActivityInvite::SessionId()
const
6121 assert(state_ == DiscordObjectState::Owned);
6122 Discord_String returnValueNative__;
6123 Discord_ActivityInvite_SessionId(&instance_, &returnValueNative__);
6124 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6125 returnValueNative__.size);
6126 Discord_Free(returnValueNative__.ptr);
6127 return returnValue__;
6129void ActivityInvite::SetSessionId(std::string SessionId)
6131 assert(state_ == DiscordObjectState::Owned);
6132 Discord_String SessionId__str{(uint8_t*)(SessionId.data()), SessionId.size()};
6133 Discord_ActivityInvite_SetSessionId(&instance_, SessionId__str);
6135bool ActivityInvite::IsValid()
const
6137 assert(state_ == DiscordObjectState::Owned);
6139 returnValue__ = Discord_ActivityInvite_IsValid(&instance_);
6140 return returnValue__;
6142void ActivityInvite::SetIsValid(
bool IsValid)
6144 assert(state_ == DiscordObjectState::Owned);
6145 Discord_ActivityInvite_SetIsValid(&instance_, IsValid);
6147const ActivityAssets ActivityAssets::nullobj{{}, DiscordObjectState::Invalid};
6148ActivityAssets::~ActivityAssets()
6150 if (state_ == DiscordObjectState::Owned) {
6152 state_ = DiscordObjectState::Invalid;
6155ActivityAssets::ActivityAssets(ActivityAssets&& other) noexcept
6156 : instance_(other.instance_)
6157 , state_(other.state_)
6159 other.state_ = DiscordObjectState::Invalid;
6161ActivityAssets& ActivityAssets::operator=(ActivityAssets&& other)
noexcept
6163 if (
this != &other) {
6164 if (state_ == DiscordObjectState::Owned) {
6167 instance_ = other.instance_;
6168 state_ = other.state_;
6169 other.state_ = DiscordObjectState::Invalid;
6173ActivityAssets::ActivityAssets(
const ActivityAssets& arg0)
6178 Discord_ActivityAssets_Clone(&instance_, arg0.instance());
6180 state_ = DiscordObjectState::Owned;
6183ActivityAssets& ActivityAssets::operator=(
const ActivityAssets& arg0)
6185 if (
this != &arg0) {
6186 if (state_ == DiscordObjectState::Owned) {
6188 state_ = DiscordObjectState::Invalid;
6190 if (arg0.state_ == DiscordObjectState::Owned) {
6191 Discord_ActivityAssets_Clone(&instance_, arg0.instance());
6193 state_ = DiscordObjectState::Owned;
6198ActivityAssets::ActivityAssets(Discord_ActivityAssets instance, DiscordObjectState state)
6199 : instance_(instance)
6203ActivityAssets::ActivityAssets()
6205 assert(state_ == DiscordObjectState::Invalid);
6206 Discord_ActivityAssets_Init(&instance_);
6207 state_ = DiscordObjectState::Owned;
6209void ActivityAssets::Drop()
6211 if (state_ != DiscordObjectState::Owned) {
6214 Discord_ActivityAssets_Drop(&instance_);
6215 state_ = DiscordObjectState::Invalid;
6217std::optional<std::string> ActivityAssets::LargeImage()
const
6219 assert(state_ == DiscordObjectState::Owned);
6220 bool returnIsNonNull__;
6221 Discord_String returnValueNative__;
6222 returnIsNonNull__ = Discord_ActivityAssets_LargeImage(&instance_, &returnValueNative__);
6223 if (!returnIsNonNull__) {
6226 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6227 returnValueNative__.size);
6228 Discord_Free(returnValueNative__.ptr);
6229 return returnValue__;
6231void ActivityAssets::SetLargeImage(std::optional<std::string> LargeImage)
6233 assert(state_ == DiscordObjectState::Owned);
6234 Discord_String LargeImage__str{};
6235 if (LargeImage.has_value()) {
6236 LargeImage__str.ptr =
reinterpret_cast<uint8_t*
>(LargeImage->data());
6237 LargeImage__str.size = LargeImage->size();
6239 Discord_ActivityAssets_SetLargeImage(&instance_,
6240 (LargeImage.has_value() ? &LargeImage__str :
nullptr));
6242std::optional<std::string> ActivityAssets::LargeText()
const
6244 assert(state_ == DiscordObjectState::Owned);
6245 bool returnIsNonNull__;
6246 Discord_String returnValueNative__;
6247 returnIsNonNull__ = Discord_ActivityAssets_LargeText(&instance_, &returnValueNative__);
6248 if (!returnIsNonNull__) {
6251 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6252 returnValueNative__.size);
6253 Discord_Free(returnValueNative__.ptr);
6254 return returnValue__;
6256void ActivityAssets::SetLargeText(std::optional<std::string> LargeText)
6258 assert(state_ == DiscordObjectState::Owned);
6259 Discord_String LargeText__str{};
6260 if (LargeText.has_value()) {
6261 LargeText__str.ptr =
reinterpret_cast<uint8_t*
>(LargeText->data());
6262 LargeText__str.size = LargeText->size();
6264 Discord_ActivityAssets_SetLargeText(&instance_,
6265 (LargeText.has_value() ? &LargeText__str :
nullptr));
6267std::optional<std::string> ActivityAssets::LargeUrl()
const
6269 assert(state_ == DiscordObjectState::Owned);
6270 bool returnIsNonNull__;
6271 Discord_String returnValueNative__;
6272 returnIsNonNull__ = Discord_ActivityAssets_LargeUrl(&instance_, &returnValueNative__);
6273 if (!returnIsNonNull__) {
6276 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6277 returnValueNative__.size);
6278 Discord_Free(returnValueNative__.ptr);
6279 return returnValue__;
6281void ActivityAssets::SetLargeUrl(std::optional<std::string> LargeUrl)
6283 assert(state_ == DiscordObjectState::Owned);
6284 Discord_String LargeUrl__str{};
6285 if (LargeUrl.has_value()) {
6286 LargeUrl__str.ptr =
reinterpret_cast<uint8_t*
>(LargeUrl->data());
6287 LargeUrl__str.size = LargeUrl->size();
6289 Discord_ActivityAssets_SetLargeUrl(&instance_,
6290 (LargeUrl.has_value() ? &LargeUrl__str :
nullptr));
6292std::optional<std::string> ActivityAssets::SmallImage()
const
6294 assert(state_ == DiscordObjectState::Owned);
6295 bool returnIsNonNull__;
6296 Discord_String returnValueNative__;
6297 returnIsNonNull__ = Discord_ActivityAssets_SmallImage(&instance_, &returnValueNative__);
6298 if (!returnIsNonNull__) {
6301 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6302 returnValueNative__.size);
6303 Discord_Free(returnValueNative__.ptr);
6304 return returnValue__;
6306void ActivityAssets::SetSmallImage(std::optional<std::string> SmallImage)
6308 assert(state_ == DiscordObjectState::Owned);
6309 Discord_String SmallImage__str{};
6310 if (SmallImage.has_value()) {
6311 SmallImage__str.ptr =
reinterpret_cast<uint8_t*
>(SmallImage->data());
6312 SmallImage__str.size = SmallImage->size();
6314 Discord_ActivityAssets_SetSmallImage(&instance_,
6315 (SmallImage.has_value() ? &SmallImage__str :
nullptr));
6317std::optional<std::string> ActivityAssets::SmallText()
const
6319 assert(state_ == DiscordObjectState::Owned);
6320 bool returnIsNonNull__;
6321 Discord_String returnValueNative__;
6322 returnIsNonNull__ = Discord_ActivityAssets_SmallText(&instance_, &returnValueNative__);
6323 if (!returnIsNonNull__) {
6326 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6327 returnValueNative__.size);
6328 Discord_Free(returnValueNative__.ptr);
6329 return returnValue__;
6331void ActivityAssets::SetSmallText(std::optional<std::string> SmallText)
6333 assert(state_ == DiscordObjectState::Owned);
6334 Discord_String SmallText__str{};
6335 if (SmallText.has_value()) {
6336 SmallText__str.ptr =
reinterpret_cast<uint8_t*
>(SmallText->data());
6337 SmallText__str.size = SmallText->size();
6339 Discord_ActivityAssets_SetSmallText(&instance_,
6340 (SmallText.has_value() ? &SmallText__str :
nullptr));
6342std::optional<std::string> ActivityAssets::SmallUrl()
const
6344 assert(state_ == DiscordObjectState::Owned);
6345 bool returnIsNonNull__;
6346 Discord_String returnValueNative__;
6347 returnIsNonNull__ = Discord_ActivityAssets_SmallUrl(&instance_, &returnValueNative__);
6348 if (!returnIsNonNull__) {
6351 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6352 returnValueNative__.size);
6353 Discord_Free(returnValueNative__.ptr);
6354 return returnValue__;
6356void ActivityAssets::SetSmallUrl(std::optional<std::string> SmallUrl)
6358 assert(state_ == DiscordObjectState::Owned);
6359 Discord_String SmallUrl__str{};
6360 if (SmallUrl.has_value()) {
6361 SmallUrl__str.ptr =
reinterpret_cast<uint8_t*
>(SmallUrl->data());
6362 SmallUrl__str.size = SmallUrl->size();
6364 Discord_ActivityAssets_SetSmallUrl(&instance_,
6365 (SmallUrl.has_value() ? &SmallUrl__str :
nullptr));
6367std::optional<std::string> ActivityAssets::InviteCoverImage()
const
6369 assert(state_ == DiscordObjectState::Owned);
6370 bool returnIsNonNull__;
6371 Discord_String returnValueNative__;
6372 returnIsNonNull__ = Discord_ActivityAssets_InviteCoverImage(&instance_, &returnValueNative__);
6373 if (!returnIsNonNull__) {
6376 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6377 returnValueNative__.size);
6378 Discord_Free(returnValueNative__.ptr);
6379 return returnValue__;
6381void ActivityAssets::SetInviteCoverImage(std::optional<std::string> InviteCoverImage)
6383 assert(state_ == DiscordObjectState::Owned);
6384 Discord_String InviteCoverImage__str{};
6385 if (InviteCoverImage.has_value()) {
6386 InviteCoverImage__str.ptr =
reinterpret_cast<uint8_t*
>(InviteCoverImage->data());
6387 InviteCoverImage__str.size = InviteCoverImage->size();
6389 Discord_ActivityAssets_SetInviteCoverImage(
6390 &instance_, (InviteCoverImage.has_value() ? &InviteCoverImage__str :
nullptr));
6392const ActivityTimestamps ActivityTimestamps::nullobj{{}, DiscordObjectState::Invalid};
6393ActivityTimestamps::~ActivityTimestamps()
6395 if (state_ == DiscordObjectState::Owned) {
6397 state_ = DiscordObjectState::Invalid;
6400ActivityTimestamps::ActivityTimestamps(ActivityTimestamps&& other) noexcept
6401 : instance_(other.instance_)
6402 , state_(other.state_)
6404 other.state_ = DiscordObjectState::Invalid;
6406ActivityTimestamps& ActivityTimestamps::operator=(ActivityTimestamps&& other)
noexcept
6408 if (
this != &other) {
6409 if (state_ == DiscordObjectState::Owned) {
6412 instance_ = other.instance_;
6413 state_ = other.state_;
6414 other.state_ = DiscordObjectState::Invalid;
6418ActivityTimestamps::ActivityTimestamps(
const ActivityTimestamps& arg0)
6423 Discord_ActivityTimestamps_Clone(&instance_, arg0.instance());
6425 state_ = DiscordObjectState::Owned;
6428ActivityTimestamps& ActivityTimestamps::operator=(
const ActivityTimestamps& arg0)
6430 if (
this != &arg0) {
6431 if (state_ == DiscordObjectState::Owned) {
6433 state_ = DiscordObjectState::Invalid;
6435 if (arg0.state_ == DiscordObjectState::Owned) {
6436 Discord_ActivityTimestamps_Clone(&instance_, arg0.instance());
6438 state_ = DiscordObjectState::Owned;
6443ActivityTimestamps::ActivityTimestamps(Discord_ActivityTimestamps instance,
6444 DiscordObjectState state)
6445 : instance_(instance)
6449ActivityTimestamps::ActivityTimestamps()
6451 assert(state_ == DiscordObjectState::Invalid);
6452 Discord_ActivityTimestamps_Init(&instance_);
6453 state_ = DiscordObjectState::Owned;
6455void ActivityTimestamps::Drop()
6457 if (state_ != DiscordObjectState::Owned) {
6460 Discord_ActivityTimestamps_Drop(&instance_);
6461 state_ = DiscordObjectState::Invalid;
6463uint64_t ActivityTimestamps::Start()
const
6465 assert(state_ == DiscordObjectState::Owned);
6466 uint64_t returnValue__;
6467 returnValue__ = Discord_ActivityTimestamps_Start(&instance_);
6468 return returnValue__;
6470void ActivityTimestamps::SetStart(uint64_t Start)
6472 assert(state_ == DiscordObjectState::Owned);
6473 Discord_ActivityTimestamps_SetStart(&instance_, Start);
6475uint64_t ActivityTimestamps::End()
const
6477 assert(state_ == DiscordObjectState::Owned);
6478 uint64_t returnValue__;
6479 returnValue__ = Discord_ActivityTimestamps_End(&instance_);
6480 return returnValue__;
6482void ActivityTimestamps::SetEnd(uint64_t End)
6484 assert(state_ == DiscordObjectState::Owned);
6485 Discord_ActivityTimestamps_SetEnd(&instance_, End);
6487const ActivityParty ActivityParty::nullobj{{}, DiscordObjectState::Invalid};
6488ActivityParty::~ActivityParty()
6490 if (state_ == DiscordObjectState::Owned) {
6492 state_ = DiscordObjectState::Invalid;
6495ActivityParty::ActivityParty(ActivityParty&& other) noexcept
6496 : instance_(other.instance_)
6497 , state_(other.state_)
6499 other.state_ = DiscordObjectState::Invalid;
6501ActivityParty& ActivityParty::operator=(ActivityParty&& other)
noexcept
6503 if (
this != &other) {
6504 if (state_ == DiscordObjectState::Owned) {
6507 instance_ = other.instance_;
6508 state_ = other.state_;
6509 other.state_ = DiscordObjectState::Invalid;
6513ActivityParty::ActivityParty(
const ActivityParty& arg0)
6518 Discord_ActivityParty_Clone(&instance_, arg0.instance());
6520 state_ = DiscordObjectState::Owned;
6523ActivityParty& ActivityParty::operator=(
const ActivityParty& arg0)
6525 if (
this != &arg0) {
6526 if (state_ == DiscordObjectState::Owned) {
6528 state_ = DiscordObjectState::Invalid;
6530 if (arg0.state_ == DiscordObjectState::Owned) {
6531 Discord_ActivityParty_Clone(&instance_, arg0.instance());
6533 state_ = DiscordObjectState::Owned;
6538ActivityParty::ActivityParty(Discord_ActivityParty instance, DiscordObjectState state)
6539 : instance_(instance)
6543ActivityParty::ActivityParty()
6545 assert(state_ == DiscordObjectState::Invalid);
6546 Discord_ActivityParty_Init(&instance_);
6547 state_ = DiscordObjectState::Owned;
6549void ActivityParty::Drop()
6551 if (state_ != DiscordObjectState::Owned) {
6554 Discord_ActivityParty_Drop(&instance_);
6555 state_ = DiscordObjectState::Invalid;
6557std::string ActivityParty::Id()
const
6559 assert(state_ == DiscordObjectState::Owned);
6560 Discord_String returnValueNative__;
6561 Discord_ActivityParty_Id(&instance_, &returnValueNative__);
6562 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6563 returnValueNative__.size);
6564 Discord_Free(returnValueNative__.ptr);
6565 return returnValue__;
6567void ActivityParty::SetId(std::string Id)
6569 assert(state_ == DiscordObjectState::Owned);
6570 Discord_String Id__str{(uint8_t*)(Id.data()), Id.size()};
6571 Discord_ActivityParty_SetId(&instance_, Id__str);
6573int32_t ActivityParty::CurrentSize()
const
6575 assert(state_ == DiscordObjectState::Owned);
6576 int32_t returnValue__;
6577 returnValue__ = Discord_ActivityParty_CurrentSize(&instance_);
6578 return returnValue__;
6580void ActivityParty::SetCurrentSize(int32_t CurrentSize)
6582 assert(state_ == DiscordObjectState::Owned);
6583 Discord_ActivityParty_SetCurrentSize(&instance_, CurrentSize);
6585int32_t ActivityParty::MaxSize()
const
6587 assert(state_ == DiscordObjectState::Owned);
6588 int32_t returnValue__;
6589 returnValue__ = Discord_ActivityParty_MaxSize(&instance_);
6590 return returnValue__;
6592void ActivityParty::SetMaxSize(int32_t MaxSize)
6594 assert(state_ == DiscordObjectState::Owned);
6595 Discord_ActivityParty_SetMaxSize(&instance_, MaxSize);
6599 assert(state_ == DiscordObjectState::Owned);
6600 Discord_ActivityPartyPrivacy returnValue__;
6601 returnValue__ = Discord_ActivityParty_Privacy(&instance_);
6606 assert(state_ == DiscordObjectState::Owned);
6607 Discord_ActivityParty_SetPrivacy(&instance_,
6608 static_cast<Discord_ActivityPartyPrivacy
>(Privacy));
6610const ActivitySecrets ActivitySecrets::nullobj{{}, DiscordObjectState::Invalid};
6611ActivitySecrets::~ActivitySecrets()
6613 if (state_ == DiscordObjectState::Owned) {
6615 state_ = DiscordObjectState::Invalid;
6618ActivitySecrets::ActivitySecrets(ActivitySecrets&& other) noexcept
6619 : instance_(other.instance_)
6620 , state_(other.state_)
6622 other.state_ = DiscordObjectState::Invalid;
6624ActivitySecrets& ActivitySecrets::operator=(ActivitySecrets&& other)
noexcept
6626 if (
this != &other) {
6627 if (state_ == DiscordObjectState::Owned) {
6630 instance_ = other.instance_;
6631 state_ = other.state_;
6632 other.state_ = DiscordObjectState::Invalid;
6636ActivitySecrets::ActivitySecrets(
const ActivitySecrets& arg0)
6641 Discord_ActivitySecrets_Clone(&instance_, arg0.instance());
6643 state_ = DiscordObjectState::Owned;
6646ActivitySecrets& ActivitySecrets::operator=(
const ActivitySecrets& arg0)
6648 if (
this != &arg0) {
6649 if (state_ == DiscordObjectState::Owned) {
6651 state_ = DiscordObjectState::Invalid;
6653 if (arg0.state_ == DiscordObjectState::Owned) {
6654 Discord_ActivitySecrets_Clone(&instance_, arg0.instance());
6656 state_ = DiscordObjectState::Owned;
6661ActivitySecrets::ActivitySecrets(Discord_ActivitySecrets instance, DiscordObjectState state)
6662 : instance_(instance)
6666ActivitySecrets::ActivitySecrets()
6668 assert(state_ == DiscordObjectState::Invalid);
6669 Discord_ActivitySecrets_Init(&instance_);
6670 state_ = DiscordObjectState::Owned;
6672void ActivitySecrets::Drop()
6674 if (state_ != DiscordObjectState::Owned) {
6677 Discord_ActivitySecrets_Drop(&instance_);
6678 state_ = DiscordObjectState::Invalid;
6680std::string ActivitySecrets::Join()
const
6682 assert(state_ == DiscordObjectState::Owned);
6683 Discord_String returnValueNative__;
6684 Discord_ActivitySecrets_Join(&instance_, &returnValueNative__);
6685 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6686 returnValueNative__.size);
6687 Discord_Free(returnValueNative__.ptr);
6688 return returnValue__;
6690void ActivitySecrets::SetJoin(std::string Join)
6692 assert(state_ == DiscordObjectState::Owned);
6693 Discord_String Join__str{(uint8_t*)(
Join.data()),
Join.size()};
6694 Discord_ActivitySecrets_SetJoin(&instance_, Join__str);
6696const ActivityButton ActivityButton::nullobj{{}, DiscordObjectState::Invalid};
6697ActivityButton::~ActivityButton()
6699 if (state_ == DiscordObjectState::Owned) {
6701 state_ = DiscordObjectState::Invalid;
6704ActivityButton::ActivityButton(ActivityButton&& other) noexcept
6705 : instance_(other.instance_)
6706 , state_(other.state_)
6708 other.state_ = DiscordObjectState::Invalid;
6710ActivityButton& ActivityButton::operator=(ActivityButton&& other)
noexcept
6712 if (
this != &other) {
6713 if (state_ == DiscordObjectState::Owned) {
6716 instance_ = other.instance_;
6717 state_ = other.state_;
6718 other.state_ = DiscordObjectState::Invalid;
6722ActivityButton::ActivityButton(
const ActivityButton& arg0)
6727 Discord_ActivityButton_Clone(&instance_, arg0.instance());
6729 state_ = DiscordObjectState::Owned;
6732ActivityButton& ActivityButton::operator=(
const ActivityButton& arg0)
6734 if (
this != &arg0) {
6735 if (state_ == DiscordObjectState::Owned) {
6737 state_ = DiscordObjectState::Invalid;
6739 if (arg0.state_ == DiscordObjectState::Owned) {
6740 Discord_ActivityButton_Clone(&instance_, arg0.instance());
6742 state_ = DiscordObjectState::Owned;
6747ActivityButton::ActivityButton(Discord_ActivityButton instance, DiscordObjectState state)
6748 : instance_(instance)
6752ActivityButton::ActivityButton()
6754 assert(state_ == DiscordObjectState::Invalid);
6755 Discord_ActivityButton_Init(&instance_);
6756 state_ = DiscordObjectState::Owned;
6758void ActivityButton::Drop()
6760 if (state_ != DiscordObjectState::Owned) {
6763 Discord_ActivityButton_Drop(&instance_);
6764 state_ = DiscordObjectState::Invalid;
6766std::string ActivityButton::Label()
const
6768 assert(state_ == DiscordObjectState::Owned);
6769 Discord_String returnValueNative__;
6770 Discord_ActivityButton_Label(&instance_, &returnValueNative__);
6771 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6772 returnValueNative__.size);
6773 Discord_Free(returnValueNative__.ptr);
6774 return returnValue__;
6776void ActivityButton::SetLabel(std::string Label)
6778 assert(state_ == DiscordObjectState::Owned);
6779 Discord_String Label__str{(uint8_t*)(Label.data()), Label.size()};
6780 Discord_ActivityButton_SetLabel(&instance_, Label__str);
6782std::string ActivityButton::Url()
const
6784 assert(state_ == DiscordObjectState::Owned);
6785 Discord_String returnValueNative__;
6786 Discord_ActivityButton_Url(&instance_, &returnValueNative__);
6787 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6788 returnValueNative__.size);
6789 Discord_Free(returnValueNative__.ptr);
6790 return returnValue__;
6792void ActivityButton::SetUrl(std::string Url)
6794 assert(state_ == DiscordObjectState::Owned);
6795 Discord_String Url__str{(uint8_t*)(Url.data()), Url.size()};
6796 Discord_ActivityButton_SetUrl(&instance_, Url__str);
6798const Activity Activity::nullobj{{}, DiscordObjectState::Invalid};
6799Activity::~Activity()
6801 if (state_ == DiscordObjectState::Owned) {
6803 state_ = DiscordObjectState::Invalid;
6806Activity::Activity(Activity&& other) noexcept
6807 : instance_(other.instance_)
6808 , state_(other.state_)
6810 other.state_ = DiscordObjectState::Invalid;
6812Activity& Activity::operator=(Activity&& other)
noexcept
6814 if (
this != &other) {
6815 if (state_ == DiscordObjectState::Owned) {
6818 instance_ = other.instance_;
6819 state_ = other.state_;
6820 other.state_ = DiscordObjectState::Invalid;
6824Activity::Activity(
const Activity& arg0)
6829 Discord_Activity_Clone(&instance_, arg0.instance());
6831 state_ = DiscordObjectState::Owned;
6834Activity& Activity::operator=(
const Activity& arg0)
6836 if (
this != &arg0) {
6837 if (state_ == DiscordObjectState::Owned) {
6839 state_ = DiscordObjectState::Invalid;
6841 if (arg0.state_ == DiscordObjectState::Owned) {
6842 Discord_Activity_Clone(&instance_, arg0.instance());
6844 state_ = DiscordObjectState::Owned;
6849Activity::Activity(Discord_Activity instance, DiscordObjectState state)
6850 : instance_(instance)
6856 assert(state_ == DiscordObjectState::Invalid);
6857 Discord_Activity_Init(&instance_);
6858 state_ = DiscordObjectState::Owned;
6860void Activity::Drop()
6862 if (state_ != DiscordObjectState::Owned) {
6865 Discord_Activity_Drop(&instance_);
6866 state_ = DiscordObjectState::Invalid;
6870 assert(state_ == DiscordObjectState::Owned);
6871 Discord_Activity_AddButton(&instance_, button.instance());
6875 assert(state_ == DiscordObjectState::Owned);
6877 returnValue__ = Discord_Activity_Equals(&instance_, other.instance());
6878 return returnValue__;
6880std::vector<discordpp::ActivityButton> Activity::GetButtons()
const
6882 assert(state_ == DiscordObjectState::Owned);
6883 Discord_ActivityButtonSpan returnValueNative__;
6884 Discord_Activity_GetButtons(&instance_, &returnValueNative__);
6885 std::vector<discordpp::ActivityButton> returnValue__;
6886 returnValue__.reserve(returnValueNative__.size);
6887 for (
size_t i__ = 0; i__ < returnValueNative__.size; ++i__) {
6888 returnValue__.emplace_back(returnValueNative__.ptr[i__], DiscordObjectState::Owned);
6890 Discord_Free(returnValueNative__.ptr);
6891 return returnValue__;
6893std::string Activity::Name()
const
6895 assert(state_ == DiscordObjectState::Owned);
6896 Discord_String returnValueNative__;
6897 Discord_Activity_Name(&instance_, &returnValueNative__);
6898 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6899 returnValueNative__.size);
6900 Discord_Free(returnValueNative__.ptr);
6901 return returnValue__;
6903void Activity::SetName(std::string Name)
6905 assert(state_ == DiscordObjectState::Owned);
6906 Discord_String Name__str{(uint8_t*)(
Name.data()),
Name.size()};
6907 Discord_Activity_SetName(&instance_, Name__str);
6911 assert(state_ == DiscordObjectState::Owned);
6912 Discord_ActivityTypes returnValue__;
6913 returnValue__ = Discord_Activity_Type(&instance_);
6918 assert(state_ == DiscordObjectState::Owned);
6919 Discord_Activity_SetType(&instance_,
static_cast<Discord_ActivityTypes
>(Type));
6921std::optional<discordpp::StatusDisplayTypes> Activity::StatusDisplayType()
const
6923 assert(state_ == DiscordObjectState::Owned);
6924 bool returnIsNonNull__;
6925 Discord_StatusDisplayTypes returnValueNative__;
6926 returnIsNonNull__ = Discord_Activity_StatusDisplayType(&instance_, &returnValueNative__);
6927 if (!returnIsNonNull__) {
6931 return returnValue__;
6933void Activity::SetStatusDisplayType(std::optional<discordpp::StatusDisplayTypes> StatusDisplayType)
6935 assert(state_ == DiscordObjectState::Owned);
6936 Discord_Activity_SetStatusDisplayType(
6938 (StatusDisplayType.has_value()
6939 ?
reinterpret_cast<Discord_StatusDisplayTypes*
>(&*StatusDisplayType)
6942std::optional<std::string> Activity::State()
const
6944 assert(state_ == DiscordObjectState::Owned);
6945 bool returnIsNonNull__;
6946 Discord_String returnValueNative__;
6947 returnIsNonNull__ = Discord_Activity_State(&instance_, &returnValueNative__);
6948 if (!returnIsNonNull__) {
6951 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6952 returnValueNative__.size);
6953 Discord_Free(returnValueNative__.ptr);
6954 return returnValue__;
6956void Activity::SetState(std::optional<std::string> State)
6958 assert(state_ == DiscordObjectState::Owned);
6959 Discord_String State__str{};
6960 if (
State.has_value()) {
6961 State__str.ptr =
reinterpret_cast<uint8_t*
>(
State->data());
6962 State__str.size =
State->size();
6964 Discord_Activity_SetState(&instance_, (
State.has_value() ? &State__str :
nullptr));
6966std::optional<std::string> Activity::StateUrl()
const
6968 assert(state_ == DiscordObjectState::Owned);
6969 bool returnIsNonNull__;
6970 Discord_String returnValueNative__;
6971 returnIsNonNull__ = Discord_Activity_StateUrl(&instance_, &returnValueNative__);
6972 if (!returnIsNonNull__) {
6975 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6976 returnValueNative__.size);
6977 Discord_Free(returnValueNative__.ptr);
6978 return returnValue__;
6980void Activity::SetStateUrl(std::optional<std::string> StateUrl)
6982 assert(state_ == DiscordObjectState::Owned);
6983 Discord_String StateUrl__str{};
6984 if (StateUrl.has_value()) {
6985 StateUrl__str.ptr =
reinterpret_cast<uint8_t*
>(StateUrl->data());
6986 StateUrl__str.size = StateUrl->size();
6988 Discord_Activity_SetStateUrl(&instance_, (StateUrl.has_value() ? &StateUrl__str :
nullptr));
6990std::optional<std::string> Activity::Details()
const
6992 assert(state_ == DiscordObjectState::Owned);
6993 bool returnIsNonNull__;
6994 Discord_String returnValueNative__;
6995 returnIsNonNull__ = Discord_Activity_Details(&instance_, &returnValueNative__);
6996 if (!returnIsNonNull__) {
6999 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7000 returnValueNative__.size);
7001 Discord_Free(returnValueNative__.ptr);
7002 return returnValue__;
7004void Activity::SetDetails(std::optional<std::string> Details)
7006 assert(state_ == DiscordObjectState::Owned);
7007 Discord_String Details__str{};
7009 Details__str.ptr =
reinterpret_cast<uint8_t*
>(
Details->data());
7010 Details__str.size =
Details->size();
7012 Discord_Activity_SetDetails(&instance_, (
Details.has_value() ? &Details__str :
nullptr));
7014std::optional<std::string> Activity::DetailsUrl()
const
7016 assert(state_ == DiscordObjectState::Owned);
7017 bool returnIsNonNull__;
7018 Discord_String returnValueNative__;
7019 returnIsNonNull__ = Discord_Activity_DetailsUrl(&instance_, &returnValueNative__);
7020 if (!returnIsNonNull__) {
7023 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7024 returnValueNative__.size);
7025 Discord_Free(returnValueNative__.ptr);
7026 return returnValue__;
7028void Activity::SetDetailsUrl(std::optional<std::string> DetailsUrl)
7030 assert(state_ == DiscordObjectState::Owned);
7031 Discord_String DetailsUrl__str{};
7032 if (DetailsUrl.has_value()) {
7033 DetailsUrl__str.ptr =
reinterpret_cast<uint8_t*
>(DetailsUrl->data());
7034 DetailsUrl__str.size = DetailsUrl->size();
7036 Discord_Activity_SetDetailsUrl(&instance_,
7037 (DetailsUrl.has_value() ? &DetailsUrl__str :
nullptr));
7039std::optional<uint64_t> Activity::ApplicationId()
const
7041 assert(state_ == DiscordObjectState::Owned);
7042 bool returnIsNonNull__;
7043 uint64_t returnValue__;
7044 returnIsNonNull__ = Discord_Activity_ApplicationId(&instance_, &returnValue__);
7045 if (!returnIsNonNull__) {
7046 return std::nullopt;
7048 return returnValue__;
7050void Activity::SetApplicationId(std::optional<uint64_t> ApplicationId)
7052 assert(state_ == DiscordObjectState::Owned);
7053 Discord_Activity_SetApplicationId(&instance_,
7054 (ApplicationId.has_value() ? &*ApplicationId :
nullptr));
7056std::optional<uint64_t> Activity::ParentApplicationId()
const
7058 assert(state_ == DiscordObjectState::Owned);
7059 bool returnIsNonNull__;
7060 uint64_t returnValue__;
7061 returnIsNonNull__ = Discord_Activity_ParentApplicationId(&instance_, &returnValue__);
7062 if (!returnIsNonNull__) {
7063 return std::nullopt;
7065 return returnValue__;
7067void Activity::SetParentApplicationId(std::optional<uint64_t> ParentApplicationId)
7069 assert(state_ == DiscordObjectState::Owned);
7070 Discord_Activity_SetParentApplicationId(
7071 &instance_, (ParentApplicationId.has_value() ? &*ParentApplicationId :
nullptr));
7073std::optional<discordpp::ActivityAssets> Activity::Assets()
const
7075 assert(state_ == DiscordObjectState::Owned);
7076 bool returnIsNonNull__;
7077 Discord_ActivityAssets returnValueNative__;
7078 returnIsNonNull__ = Discord_Activity_Assets(&instance_, &returnValueNative__);
7079 if (!returnIsNonNull__) {
7083 return returnValue__;
7085void Activity::SetAssets(std::optional<discordpp::ActivityAssets> Assets)
7087 assert(state_ == DiscordObjectState::Owned);
7088 Discord_Activity_SetAssets(&instance_, (Assets.has_value() ? Assets->instance() :
nullptr));
7090std::optional<discordpp::ActivityTimestamps> Activity::Timestamps()
const
7092 assert(state_ == DiscordObjectState::Owned);
7093 bool returnIsNonNull__;
7094 Discord_ActivityTimestamps returnValueNative__;
7095 returnIsNonNull__ = Discord_Activity_Timestamps(&instance_, &returnValueNative__);
7096 if (!returnIsNonNull__) {
7100 return returnValue__;
7102void Activity::SetTimestamps(std::optional<discordpp::ActivityTimestamps> Timestamps)
7104 assert(state_ == DiscordObjectState::Owned);
7105 Discord_Activity_SetTimestamps(&instance_,
7106 (Timestamps.has_value() ? Timestamps->instance() :
nullptr));
7108std::optional<discordpp::ActivityParty> Activity::Party()
const
7110 assert(state_ == DiscordObjectState::Owned);
7111 bool returnIsNonNull__;
7112 Discord_ActivityParty returnValueNative__;
7113 returnIsNonNull__ = Discord_Activity_Party(&instance_, &returnValueNative__);
7114 if (!returnIsNonNull__) {
7118 return returnValue__;
7120void Activity::SetParty(std::optional<discordpp::ActivityParty> Party)
7122 assert(state_ == DiscordObjectState::Owned);
7123 Discord_Activity_SetParty(&instance_, (Party.has_value() ? Party->instance() :
nullptr));
7125std::optional<discordpp::ActivitySecrets> Activity::Secrets()
const
7127 assert(state_ == DiscordObjectState::Owned);
7128 bool returnIsNonNull__;
7129 Discord_ActivitySecrets returnValueNative__;
7130 returnIsNonNull__ = Discord_Activity_Secrets(&instance_, &returnValueNative__);
7131 if (!returnIsNonNull__) {
7135 return returnValue__;
7137void Activity::SetSecrets(std::optional<discordpp::ActivitySecrets> Secrets)
7139 assert(state_ == DiscordObjectState::Owned);
7140 Discord_Activity_SetSecrets(&instance_, (Secrets.has_value() ? Secrets->instance() :
nullptr));
7144 assert(state_ == DiscordObjectState::Owned);
7145 Discord_ActivityGamePlatforms returnValue__;
7146 returnValue__ = Discord_Activity_SupportedPlatforms(&instance_);
7151 assert(state_ == DiscordObjectState::Owned);
7152 Discord_Activity_SetSupportedPlatforms(
7153 &instance_,
static_cast<Discord_ActivityGamePlatforms
>(SupportedPlatforms));
7155const ClientResult ClientResult::nullobj{{}, DiscordObjectState::Invalid};
7156ClientResult::~ClientResult()
7158 if (state_ == DiscordObjectState::Owned) {
7160 state_ = DiscordObjectState::Invalid;
7163ClientResult::ClientResult(ClientResult&& other) noexcept
7164 : instance_(other.instance_)
7165 , state_(other.state_)
7167 other.state_ = DiscordObjectState::Invalid;
7169ClientResult& ClientResult::operator=(ClientResult&& other)
noexcept
7171 if (
this != &other) {
7172 if (state_ == DiscordObjectState::Owned) {
7175 instance_ = other.instance_;
7176 state_ = other.state_;
7177 other.state_ = DiscordObjectState::Invalid;
7181ClientResult::ClientResult(
const ClientResult& arg0)
7186 Discord_ClientResult_Clone(&instance_, arg0.instance());
7188 state_ = DiscordObjectState::Owned;
7191ClientResult& ClientResult::operator=(
const ClientResult& arg0)
7193 if (
this != &arg0) {
7194 if (state_ == DiscordObjectState::Owned) {
7196 state_ = DiscordObjectState::Invalid;
7198 if (arg0.state_ == DiscordObjectState::Owned) {
7199 Discord_ClientResult_Clone(&instance_, arg0.instance());
7201 state_ = DiscordObjectState::Owned;
7206ClientResult::ClientResult(Discord_ClientResult instance, DiscordObjectState state)
7207 : instance_(instance)
7211void ClientResult::Drop()
7213 if (state_ != DiscordObjectState::Owned) {
7216 Discord_ClientResult_Drop(&instance_);
7217 state_ = DiscordObjectState::Invalid;
7219std::string ClientResult::ToString()
const
7221 assert(state_ == DiscordObjectState::Owned);
7222 Discord_String returnValueNative__;
7223 Discord_ClientResult_ToString(&instance_, &returnValueNative__);
7224 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7225 returnValueNative__.size);
7226 Discord_Free(returnValueNative__.ptr);
7227 return returnValue__;
7231 assert(state_ == DiscordObjectState::Owned);
7232 Discord_ErrorType returnValue__;
7233 returnValue__ = Discord_ClientResult_Type(&instance_);
7238 assert(state_ == DiscordObjectState::Owned);
7239 Discord_ClientResult_SetType(&instance_,
static_cast<Discord_ErrorType
>(Type));
7241std::string ClientResult::Error()
const
7243 assert(state_ == DiscordObjectState::Owned);
7244 Discord_String returnValueNative__;
7245 Discord_ClientResult_Error(&instance_, &returnValueNative__);
7246 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7247 returnValueNative__.size);
7248 Discord_Free(returnValueNative__.ptr);
7249 return returnValue__;
7251void ClientResult::SetError(std::string Error)
7253 assert(state_ == DiscordObjectState::Owned);
7254 Discord_String Error__str{(uint8_t*)(
Error.data()),
Error.size()};
7255 Discord_ClientResult_SetError(&instance_, Error__str);
7257int32_t ClientResult::ErrorCode()
const
7259 assert(state_ == DiscordObjectState::Owned);
7260 int32_t returnValue__;
7261 returnValue__ = Discord_ClientResult_ErrorCode(&instance_);
7262 return returnValue__;
7264void ClientResult::SetErrorCode(int32_t ErrorCode)
7266 assert(state_ == DiscordObjectState::Owned);
7267 Discord_ClientResult_SetErrorCode(&instance_, ErrorCode);
7271 assert(state_ == DiscordObjectState::Owned);
7272 Discord_HttpStatusCode returnValue__;
7273 returnValue__ = Discord_ClientResult_Status(&instance_);
7278 assert(state_ == DiscordObjectState::Owned);
7279 Discord_ClientResult_SetStatus(&instance_,
static_cast<Discord_HttpStatusCode
>(Status));
7281std::string ClientResult::ResponseBody()
const
7283 assert(state_ == DiscordObjectState::Owned);
7284 Discord_String returnValueNative__;
7285 Discord_ClientResult_ResponseBody(&instance_, &returnValueNative__);
7286 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7287 returnValueNative__.size);
7288 Discord_Free(returnValueNative__.ptr);
7289 return returnValue__;
7291void ClientResult::SetResponseBody(std::string ResponseBody)
7293 assert(state_ == DiscordObjectState::Owned);
7294 Discord_String ResponseBody__str{(uint8_t*)(ResponseBody.data()), ResponseBody.size()};
7295 Discord_ClientResult_SetResponseBody(&instance_, ResponseBody__str);
7297bool ClientResult::Successful()
const
7299 assert(state_ == DiscordObjectState::Owned);
7301 returnValue__ = Discord_ClientResult_Successful(&instance_);
7302 return returnValue__;
7304void ClientResult::SetSuccessful(
bool Successful)
7306 assert(state_ == DiscordObjectState::Owned);
7307 Discord_ClientResult_SetSuccessful(&instance_, Successful);
7309bool ClientResult::Retryable()
const
7311 assert(state_ == DiscordObjectState::Owned);
7313 returnValue__ = Discord_ClientResult_Retryable(&instance_);
7314 return returnValue__;
7316void ClientResult::SetRetryable(
bool Retryable)
7318 assert(state_ == DiscordObjectState::Owned);
7319 Discord_ClientResult_SetRetryable(&instance_, Retryable);
7321float ClientResult::RetryAfter()
const
7323 assert(state_ == DiscordObjectState::Owned);
7324 float returnValue__;
7325 returnValue__ = Discord_ClientResult_RetryAfter(&instance_);
7326 return returnValue__;
7328void ClientResult::SetRetryAfter(
float RetryAfter)
7330 assert(state_ == DiscordObjectState::Owned);
7331 Discord_ClientResult_SetRetryAfter(&instance_, RetryAfter);
7333const AuthorizationCodeChallenge AuthorizationCodeChallenge::nullobj{{},
7334 DiscordObjectState::Invalid};
7335AuthorizationCodeChallenge::~AuthorizationCodeChallenge()
7337 if (state_ == DiscordObjectState::Owned) {
7339 state_ = DiscordObjectState::Invalid;
7342AuthorizationCodeChallenge::AuthorizationCodeChallenge(AuthorizationCodeChallenge&& other) noexcept
7343 : instance_(other.instance_)
7344 , state_(other.state_)
7346 other.state_ = DiscordObjectState::Invalid;
7348AuthorizationCodeChallenge& AuthorizationCodeChallenge::operator=(
7349 AuthorizationCodeChallenge&& other)
noexcept
7351 if (
this != &other) {
7352 if (state_ == DiscordObjectState::Owned) {
7355 instance_ = other.instance_;
7356 state_ = other.state_;
7357 other.state_ = DiscordObjectState::Invalid;
7361AuthorizationCodeChallenge::AuthorizationCodeChallenge(
const AuthorizationCodeChallenge& arg0)
7366 Discord_AuthorizationCodeChallenge_Clone(&instance_, arg0.instance());
7368 state_ = DiscordObjectState::Owned;
7371AuthorizationCodeChallenge& AuthorizationCodeChallenge::operator=(
7372 const AuthorizationCodeChallenge& arg0)
7374 if (
this != &arg0) {
7375 if (state_ == DiscordObjectState::Owned) {
7377 state_ = DiscordObjectState::Invalid;
7379 if (arg0.state_ == DiscordObjectState::Owned) {
7380 Discord_AuthorizationCodeChallenge_Clone(&instance_, arg0.instance());
7382 state_ = DiscordObjectState::Owned;
7387AuthorizationCodeChallenge::AuthorizationCodeChallenge(Discord_AuthorizationCodeChallenge instance,
7388 DiscordObjectState state)
7389 : instance_(instance)
7393AuthorizationCodeChallenge::AuthorizationCodeChallenge()
7395 assert(state_ == DiscordObjectState::Invalid);
7396 Discord_AuthorizationCodeChallenge_Init(&instance_);
7397 state_ = DiscordObjectState::Owned;
7399void AuthorizationCodeChallenge::Drop()
7401 if (state_ != DiscordObjectState::Owned) {
7404 Discord_AuthorizationCodeChallenge_Drop(&instance_);
7405 state_ = DiscordObjectState::Invalid;
7409 assert(state_ == DiscordObjectState::Owned);
7410 Discord_AuthenticationCodeChallengeMethod returnValue__;
7411 returnValue__ = Discord_AuthorizationCodeChallenge_Method(&instance_);
7416 assert(state_ == DiscordObjectState::Owned);
7417 Discord_AuthorizationCodeChallenge_SetMethod(
7418 &instance_,
static_cast<Discord_AuthenticationCodeChallengeMethod
>(Method));
7420std::string AuthorizationCodeChallenge::Challenge()
const
7422 assert(state_ == DiscordObjectState::Owned);
7423 Discord_String returnValueNative__;
7424 Discord_AuthorizationCodeChallenge_Challenge(&instance_, &returnValueNative__);
7425 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7426 returnValueNative__.size);
7427 Discord_Free(returnValueNative__.ptr);
7428 return returnValue__;
7430void AuthorizationCodeChallenge::SetChallenge(std::string Challenge)
7432 assert(state_ == DiscordObjectState::Owned);
7433 Discord_String Challenge__str{(uint8_t*)(Challenge.data()), Challenge.size()};
7434 Discord_AuthorizationCodeChallenge_SetChallenge(&instance_, Challenge__str);
7436const AuthorizationCodeVerifier AuthorizationCodeVerifier::nullobj{{}, DiscordObjectState::Invalid};
7437AuthorizationCodeVerifier::~AuthorizationCodeVerifier()
7439 if (state_ == DiscordObjectState::Owned) {
7441 state_ = DiscordObjectState::Invalid;
7444AuthorizationCodeVerifier::AuthorizationCodeVerifier(AuthorizationCodeVerifier&& other) noexcept
7445 : instance_(other.instance_)
7446 , state_(other.state_)
7448 other.state_ = DiscordObjectState::Invalid;
7450AuthorizationCodeVerifier& AuthorizationCodeVerifier::operator=(
7451 AuthorizationCodeVerifier&& other)
noexcept
7453 if (
this != &other) {
7454 if (state_ == DiscordObjectState::Owned) {
7457 instance_ = other.instance_;
7458 state_ = other.state_;
7459 other.state_ = DiscordObjectState::Invalid;
7463AuthorizationCodeVerifier::AuthorizationCodeVerifier(
const AuthorizationCodeVerifier& arg0)
7468 Discord_AuthorizationCodeVerifier_Clone(&instance_, arg0.instance());
7470 state_ = DiscordObjectState::Owned;
7473AuthorizationCodeVerifier& AuthorizationCodeVerifier::operator=(
7474 const AuthorizationCodeVerifier& arg0)
7476 if (
this != &arg0) {
7477 if (state_ == DiscordObjectState::Owned) {
7479 state_ = DiscordObjectState::Invalid;
7481 if (arg0.state_ == DiscordObjectState::Owned) {
7482 Discord_AuthorizationCodeVerifier_Clone(&instance_, arg0.instance());
7484 state_ = DiscordObjectState::Owned;
7489AuthorizationCodeVerifier::AuthorizationCodeVerifier(Discord_AuthorizationCodeVerifier instance,
7490 DiscordObjectState state)
7491 : instance_(instance)
7495void AuthorizationCodeVerifier::Drop()
7497 if (state_ != DiscordObjectState::Owned) {
7500 Discord_AuthorizationCodeVerifier_Drop(&instance_);
7501 state_ = DiscordObjectState::Invalid;
7505 assert(state_ == DiscordObjectState::Owned);
7506 Discord_AuthorizationCodeChallenge returnValueNative__{};
7507 Discord_AuthorizationCodeVerifier_Challenge(&instance_, &returnValueNative__);
7509 DiscordObjectState::Owned);
7510 return returnValue__;
7514 assert(state_ == DiscordObjectState::Owned);
7515 Discord_AuthorizationCodeVerifier_SetChallenge(&instance_, Challenge.instance());
7517std::string AuthorizationCodeVerifier::Verifier()
const
7519 assert(state_ == DiscordObjectState::Owned);
7520 Discord_String returnValueNative__;
7521 Discord_AuthorizationCodeVerifier_Verifier(&instance_, &returnValueNative__);
7522 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7523 returnValueNative__.size);
7524 Discord_Free(returnValueNative__.ptr);
7525 return returnValue__;
7527void AuthorizationCodeVerifier::SetVerifier(std::string Verifier)
7529 assert(state_ == DiscordObjectState::Owned);
7530 Discord_String Verifier__str{(uint8_t*)(Verifier.data()), Verifier.size()};
7531 Discord_AuthorizationCodeVerifier_SetVerifier(&instance_, Verifier__str);
7533const AuthorizationArgs AuthorizationArgs::nullobj{{}, DiscordObjectState::Invalid};
7534AuthorizationArgs::~AuthorizationArgs()
7536 if (state_ == DiscordObjectState::Owned) {
7538 state_ = DiscordObjectState::Invalid;
7541AuthorizationArgs::AuthorizationArgs(AuthorizationArgs&& other) noexcept
7542 : instance_(other.instance_)
7543 , state_(other.state_)
7545 other.state_ = DiscordObjectState::Invalid;
7547AuthorizationArgs& AuthorizationArgs::operator=(AuthorizationArgs&& other)
noexcept
7549 if (
this != &other) {
7550 if (state_ == DiscordObjectState::Owned) {
7553 instance_ = other.instance_;
7554 state_ = other.state_;
7555 other.state_ = DiscordObjectState::Invalid;
7559AuthorizationArgs::AuthorizationArgs(
const AuthorizationArgs& arg0)
7564 Discord_AuthorizationArgs_Clone(&instance_, arg0.instance());
7566 state_ = DiscordObjectState::Owned;
7569AuthorizationArgs& AuthorizationArgs::operator=(
const AuthorizationArgs& arg0)
7571 if (
this != &arg0) {
7572 if (state_ == DiscordObjectState::Owned) {
7574 state_ = DiscordObjectState::Invalid;
7576 if (arg0.state_ == DiscordObjectState::Owned) {
7577 Discord_AuthorizationArgs_Clone(&instance_, arg0.instance());
7579 state_ = DiscordObjectState::Owned;
7584AuthorizationArgs::AuthorizationArgs(Discord_AuthorizationArgs instance, DiscordObjectState state)
7585 : instance_(instance)
7589AuthorizationArgs::AuthorizationArgs()
7591 assert(state_ == DiscordObjectState::Invalid);
7592 Discord_AuthorizationArgs_Init(&instance_);
7593 state_ = DiscordObjectState::Owned;
7595void AuthorizationArgs::Drop()
7597 if (state_ != DiscordObjectState::Owned) {
7600 Discord_AuthorizationArgs_Drop(&instance_);
7601 state_ = DiscordObjectState::Invalid;
7603uint64_t AuthorizationArgs::ClientId()
const
7605 assert(state_ == DiscordObjectState::Owned);
7606 uint64_t returnValue__;
7607 returnValue__ = Discord_AuthorizationArgs_ClientId(&instance_);
7608 return returnValue__;
7610void AuthorizationArgs::SetClientId(uint64_t ClientId)
7612 assert(state_ == DiscordObjectState::Owned);
7613 Discord_AuthorizationArgs_SetClientId(&instance_, ClientId);
7615std::string AuthorizationArgs::Scopes()
const
7617 assert(state_ == DiscordObjectState::Owned);
7618 Discord_String returnValueNative__;
7619 Discord_AuthorizationArgs_Scopes(&instance_, &returnValueNative__);
7620 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7621 returnValueNative__.size);
7622 Discord_Free(returnValueNative__.ptr);
7623 return returnValue__;
7625void AuthorizationArgs::SetScopes(std::string Scopes)
7627 assert(state_ == DiscordObjectState::Owned);
7628 Discord_String Scopes__str{(uint8_t*)(Scopes.data()), Scopes.size()};
7629 Discord_AuthorizationArgs_SetScopes(&instance_, Scopes__str);
7631std::optional<std::string> AuthorizationArgs::State()
const
7633 assert(state_ == DiscordObjectState::Owned);
7634 bool returnIsNonNull__;
7635 Discord_String returnValueNative__;
7636 returnIsNonNull__ = Discord_AuthorizationArgs_State(&instance_, &returnValueNative__);
7637 if (!returnIsNonNull__) {
7640 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7641 returnValueNative__.size);
7642 Discord_Free(returnValueNative__.ptr);
7643 return returnValue__;
7645void AuthorizationArgs::SetState(std::optional<std::string> State)
7647 assert(state_ == DiscordObjectState::Owned);
7648 Discord_String State__str{};
7649 if (
State.has_value()) {
7650 State__str.ptr =
reinterpret_cast<uint8_t*
>(
State->data());
7651 State__str.size =
State->size();
7653 Discord_AuthorizationArgs_SetState(&instance_, (
State.has_value() ? &State__str :
nullptr));
7655std::optional<std::string> AuthorizationArgs::Nonce()
const
7657 assert(state_ == DiscordObjectState::Owned);
7658 bool returnIsNonNull__;
7659 Discord_String returnValueNative__;
7660 returnIsNonNull__ = Discord_AuthorizationArgs_Nonce(&instance_, &returnValueNative__);
7661 if (!returnIsNonNull__) {
7664 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7665 returnValueNative__.size);
7666 Discord_Free(returnValueNative__.ptr);
7667 return returnValue__;
7669void AuthorizationArgs::SetNonce(std::optional<std::string> Nonce)
7671 assert(state_ == DiscordObjectState::Owned);
7672 Discord_String Nonce__str{};
7673 if (Nonce.has_value()) {
7674 Nonce__str.ptr =
reinterpret_cast<uint8_t*
>(Nonce->data());
7675 Nonce__str.size = Nonce->size();
7677 Discord_AuthorizationArgs_SetNonce(&instance_, (Nonce.has_value() ? &Nonce__str :
nullptr));
7679std::optional<discordpp::AuthorizationCodeChallenge> AuthorizationArgs::CodeChallenge()
const
7681 assert(state_ == DiscordObjectState::Owned);
7682 bool returnIsNonNull__;
7683 Discord_AuthorizationCodeChallenge returnValueNative__;
7684 returnIsNonNull__ = Discord_AuthorizationArgs_CodeChallenge(&instance_, &returnValueNative__);
7685 if (!returnIsNonNull__) {
7689 DiscordObjectState::Owned);
7690 return returnValue__;
7692void AuthorizationArgs::SetCodeChallenge(
7693 std::optional<discordpp::AuthorizationCodeChallenge> CodeChallenge)
7695 assert(state_ == DiscordObjectState::Owned);
7696 Discord_AuthorizationArgs_SetCodeChallenge(
7697 &instance_, (CodeChallenge.has_value() ? CodeChallenge->instance() :
nullptr));
7699std::optional<discordpp::IntegrationType> AuthorizationArgs::IntegrationType()
const
7701 assert(state_ == DiscordObjectState::Owned);
7702 bool returnIsNonNull__;
7703 Discord_IntegrationType returnValueNative__;
7704 returnIsNonNull__ = Discord_AuthorizationArgs_IntegrationType(&instance_, &returnValueNative__);
7705 if (!returnIsNonNull__) {
7709 return returnValue__;
7711void AuthorizationArgs::SetIntegrationType(
7712 std::optional<discordpp::IntegrationType> IntegrationType)
7714 assert(state_ == DiscordObjectState::Owned);
7715 Discord_AuthorizationArgs_SetIntegrationType(
7717 (
IntegrationType.has_value() ?
reinterpret_cast<Discord_IntegrationType*
>(&*IntegrationType)
7720std::optional<std::string> AuthorizationArgs::CustomSchemeParam()
const
7722 assert(state_ == DiscordObjectState::Owned);
7723 bool returnIsNonNull__;
7724 Discord_String returnValueNative__;
7726 Discord_AuthorizationArgs_CustomSchemeParam(&instance_, &returnValueNative__);
7727 if (!returnIsNonNull__) {
7730 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7731 returnValueNative__.size);
7732 Discord_Free(returnValueNative__.ptr);
7733 return returnValue__;
7735void AuthorizationArgs::SetCustomSchemeParam(std::optional<std::string> CustomSchemeParam)
7737 assert(state_ == DiscordObjectState::Owned);
7738 Discord_String CustomSchemeParam__str{};
7739 if (CustomSchemeParam.has_value()) {
7740 CustomSchemeParam__str.ptr =
reinterpret_cast<uint8_t*
>(CustomSchemeParam->data());
7741 CustomSchemeParam__str.size = CustomSchemeParam->size();
7743 Discord_AuthorizationArgs_SetCustomSchemeParam(
7744 &instance_, (CustomSchemeParam.has_value() ? &CustomSchemeParam__str :
nullptr));
7746const DeviceAuthorizationArgs DeviceAuthorizationArgs::nullobj{{}, DiscordObjectState::Invalid};
7747DeviceAuthorizationArgs::~DeviceAuthorizationArgs()
7749 if (state_ == DiscordObjectState::Owned) {
7751 state_ = DiscordObjectState::Invalid;
7754DeviceAuthorizationArgs::DeviceAuthorizationArgs(DeviceAuthorizationArgs&& other) noexcept
7755 : instance_(other.instance_)
7756 , state_(other.state_)
7758 other.state_ = DiscordObjectState::Invalid;
7760DeviceAuthorizationArgs& DeviceAuthorizationArgs::operator=(
7761 DeviceAuthorizationArgs&& other)
noexcept
7763 if (
this != &other) {
7764 if (state_ == DiscordObjectState::Owned) {
7767 instance_ = other.instance_;
7768 state_ = other.state_;
7769 other.state_ = DiscordObjectState::Invalid;
7773DeviceAuthorizationArgs::DeviceAuthorizationArgs(
const DeviceAuthorizationArgs& arg0)
7778 Discord_DeviceAuthorizationArgs_Clone(&instance_, arg0.instance());
7780 state_ = DiscordObjectState::Owned;
7783DeviceAuthorizationArgs& DeviceAuthorizationArgs::operator=(
const DeviceAuthorizationArgs& arg0)
7785 if (
this != &arg0) {
7786 if (state_ == DiscordObjectState::Owned) {
7788 state_ = DiscordObjectState::Invalid;
7790 if (arg0.state_ == DiscordObjectState::Owned) {
7791 Discord_DeviceAuthorizationArgs_Clone(&instance_, arg0.instance());
7793 state_ = DiscordObjectState::Owned;
7798DeviceAuthorizationArgs::DeviceAuthorizationArgs(Discord_DeviceAuthorizationArgs instance,
7799 DiscordObjectState state)
7800 : instance_(instance)
7804DeviceAuthorizationArgs::DeviceAuthorizationArgs()
7806 assert(state_ == DiscordObjectState::Invalid);
7807 Discord_DeviceAuthorizationArgs_Init(&instance_);
7808 state_ = DiscordObjectState::Owned;
7810void DeviceAuthorizationArgs::Drop()
7812 if (state_ != DiscordObjectState::Owned) {
7815 Discord_DeviceAuthorizationArgs_Drop(&instance_);
7816 state_ = DiscordObjectState::Invalid;
7818uint64_t DeviceAuthorizationArgs::ClientId()
const
7820 assert(state_ == DiscordObjectState::Owned);
7821 uint64_t returnValue__;
7822 returnValue__ = Discord_DeviceAuthorizationArgs_ClientId(&instance_);
7823 return returnValue__;
7825void DeviceAuthorizationArgs::SetClientId(uint64_t ClientId)
7827 assert(state_ == DiscordObjectState::Owned);
7828 Discord_DeviceAuthorizationArgs_SetClientId(&instance_, ClientId);
7830std::string DeviceAuthorizationArgs::Scopes()
const
7832 assert(state_ == DiscordObjectState::Owned);
7833 Discord_String returnValueNative__;
7834 Discord_DeviceAuthorizationArgs_Scopes(&instance_, &returnValueNative__);
7835 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7836 returnValueNative__.size);
7837 Discord_Free(returnValueNative__.ptr);
7838 return returnValue__;
7840void DeviceAuthorizationArgs::SetScopes(std::string Scopes)
7842 assert(state_ == DiscordObjectState::Owned);
7843 Discord_String Scopes__str{(uint8_t*)(Scopes.data()), Scopes.size()};
7844 Discord_DeviceAuthorizationArgs_SetScopes(&instance_, Scopes__str);
7846const VoiceStateHandle VoiceStateHandle::nullobj{{}, DiscordObjectState::Invalid};
7847VoiceStateHandle::~VoiceStateHandle()
7849 if (state_ == DiscordObjectState::Owned) {
7851 state_ = DiscordObjectState::Invalid;
7854VoiceStateHandle::VoiceStateHandle(VoiceStateHandle&& other) noexcept
7855 : instance_(other.instance_)
7856 , state_(other.state_)
7858 other.state_ = DiscordObjectState::Invalid;
7860VoiceStateHandle& VoiceStateHandle::operator=(VoiceStateHandle&& other)
noexcept
7862 if (
this != &other) {
7863 if (state_ == DiscordObjectState::Owned) {
7866 instance_ = other.instance_;
7867 state_ = other.state_;
7868 other.state_ = DiscordObjectState::Invalid;
7872VoiceStateHandle::VoiceStateHandle(
const VoiceStateHandle& other)
7877 Discord_VoiceStateHandle_Clone(&instance_, other.instance());
7879 state_ = DiscordObjectState::Owned;
7882VoiceStateHandle& VoiceStateHandle::operator=(
const VoiceStateHandle& other)
7884 if (
this != &other) {
7885 if (state_ == DiscordObjectState::Owned) {
7887 state_ = DiscordObjectState::Invalid;
7889 if (other.state_ == DiscordObjectState::Owned) {
7890 Discord_VoiceStateHandle_Clone(&instance_, other.instance());
7892 state_ = DiscordObjectState::Owned;
7897VoiceStateHandle::VoiceStateHandle(Discord_VoiceStateHandle instance, DiscordObjectState state)
7898 : instance_(instance)
7902void VoiceStateHandle::Drop()
7904 if (state_ != DiscordObjectState::Owned) {
7907 Discord_VoiceStateHandle_Drop(&instance_);
7908 state_ = DiscordObjectState::Invalid;
7910bool VoiceStateHandle::SelfDeaf()
const
7912 assert(state_ == DiscordObjectState::Owned);
7914 returnValue__ = Discord_VoiceStateHandle_SelfDeaf(&instance_);
7915 return returnValue__;
7917bool VoiceStateHandle::SelfMute()
const
7919 assert(state_ == DiscordObjectState::Owned);
7921 returnValue__ = Discord_VoiceStateHandle_SelfMute(&instance_);
7922 return returnValue__;
7924const VADThresholdSettings VADThresholdSettings::nullobj{{}, DiscordObjectState::Invalid};
7925VADThresholdSettings::~VADThresholdSettings()
7927 if (state_ == DiscordObjectState::Owned) {
7929 state_ = DiscordObjectState::Invalid;
7932VADThresholdSettings::VADThresholdSettings(VADThresholdSettings&& other) noexcept
7933 : instance_(other.instance_)
7934 , state_(other.state_)
7936 other.state_ = DiscordObjectState::Invalid;
7938VADThresholdSettings& VADThresholdSettings::operator=(VADThresholdSettings&& other)
noexcept
7940 if (
this != &other) {
7941 if (state_ == DiscordObjectState::Owned) {
7944 instance_ = other.instance_;
7945 state_ = other.state_;
7946 other.state_ = DiscordObjectState::Invalid;
7950VADThresholdSettings::VADThresholdSettings(Discord_VADThresholdSettings instance,
7951 DiscordObjectState state)
7952 : instance_(instance)
7956void VADThresholdSettings::Drop()
7958 if (state_ != DiscordObjectState::Owned) {
7961 Discord_VADThresholdSettings_Drop(&instance_);
7962 state_ = DiscordObjectState::Invalid;
7964float VADThresholdSettings::VadThreshold()
const
7966 assert(state_ == DiscordObjectState::Owned);
7967 float returnValue__;
7968 returnValue__ = Discord_VADThresholdSettings_VadThreshold(&instance_);
7969 return returnValue__;
7971void VADThresholdSettings::SetVadThreshold(
float VadThreshold)
7973 assert(state_ == DiscordObjectState::Owned);
7974 Discord_VADThresholdSettings_SetVadThreshold(&instance_, VadThreshold);
7976bool VADThresholdSettings::Automatic()
const
7978 assert(state_ == DiscordObjectState::Owned);
7980 returnValue__ = Discord_VADThresholdSettings_Automatic(&instance_);
7981 return returnValue__;
7983void VADThresholdSettings::SetAutomatic(
bool Automatic)
7985 assert(state_ == DiscordObjectState::Owned);
7986 Discord_VADThresholdSettings_SetAutomatic(&instance_, Automatic);
7988const Call Call::nullobj{{}, DiscordObjectState::Invalid};
7991 if (state_ == DiscordObjectState::Owned) {
7993 state_ = DiscordObjectState::Invalid;
7996Call::Call(Call&& other) noexcept
7997 : instance_(other.instance_)
7998 , state_(other.state_)
8000 other.state_ = DiscordObjectState::Invalid;
8002Call& Call::operator=(Call&& other)
noexcept
8004 if (
this != &other) {
8005 if (state_ == DiscordObjectState::Owned) {
8008 instance_ = other.instance_;
8009 state_ = other.state_;
8010 other.state_ = DiscordObjectState::Invalid;
8014Call::Call(
const Call& other)
8019 Discord_Call_Clone(&instance_, other.instance());
8021 state_ = DiscordObjectState::Owned;
8024Call& Call::operator=(
const Call& other)
8026 if (
this != &other) {
8027 if (state_ == DiscordObjectState::Owned) {
8029 state_ = DiscordObjectState::Invalid;
8031 if (other.state_ == DiscordObjectState::Owned) {
8032 Discord_Call_Clone(&instance_, other.instance());
8034 state_ = DiscordObjectState::Owned;
8039Call::Call(Discord_Call instance, DiscordObjectState state)
8040 : instance_(instance)
8046 if (state_ != DiscordObjectState::Owned) {
8049 Discord_Call_Drop(&instance_);
8050 state_ = DiscordObjectState::Invalid;
8054 Discord_String returnValueNative__;
8055 Discord_Call_ErrorToString(
static_cast<Discord_Call_Error
>(type), &returnValueNative__);
8056 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
8057 returnValueNative__.size);
8058 Discord_Free(returnValueNative__.ptr);
8059 return returnValue__;
8063 assert(state_ == DiscordObjectState::Owned);
8064 Discord_AudioModeType returnValue__;
8065 returnValue__ = Discord_Call_GetAudioMode(&instance_);
8068uint64_t Call::GetChannelId()
const
8070 assert(state_ == DiscordObjectState::Owned);
8071 uint64_t returnValue__;
8072 returnValue__ = Discord_Call_GetChannelId(&instance_);
8073 return returnValue__;
8075uint64_t Call::GetGuildId()
const
8077 assert(state_ == DiscordObjectState::Owned);
8078 uint64_t returnValue__;
8079 returnValue__ = Discord_Call_GetGuildId(&instance_);
8080 return returnValue__;
8082bool Call::GetLocalMute(uint64_t userId)
8084 assert(state_ == DiscordObjectState::Owned);
8086 returnValue__ = Discord_Call_GetLocalMute(&instance_, userId);
8087 return returnValue__;
8089std::vector<uint64_t> Call::GetParticipants()
const
8091 assert(state_ == DiscordObjectState::Owned);
8092 Discord_UInt64Span returnValueNative__;
8093 Discord_Call_GetParticipants(&instance_, &returnValueNative__);
8094 std::vector<uint64_t> returnValue__(returnValueNative__.ptr,
8095 returnValueNative__.ptr + returnValueNative__.size);
8096 Discord_Free(returnValueNative__.ptr);
8097 return returnValue__;
8099float Call::GetParticipantVolume(uint64_t userId)
8101 assert(state_ == DiscordObjectState::Owned);
8102 float returnValue__;
8103 returnValue__ = Discord_Call_GetParticipantVolume(&instance_, userId);
8104 return returnValue__;
8106bool Call::GetPTTActive()
8108 assert(state_ == DiscordObjectState::Owned);
8110 returnValue__ = Discord_Call_GetPTTActive(&instance_);
8111 return returnValue__;
8113uint32_t Call::GetPTTReleaseDelay()
8115 assert(state_ == DiscordObjectState::Owned);
8116 uint32_t returnValue__;
8117 returnValue__ = Discord_Call_GetPTTReleaseDelay(&instance_);
8118 return returnValue__;
8120bool Call::GetSelfDeaf()
8122 assert(state_ == DiscordObjectState::Owned);
8124 returnValue__ = Discord_Call_GetSelfDeaf(&instance_);
8125 return returnValue__;
8127bool Call::GetSelfMute()
8129 assert(state_ == DiscordObjectState::Owned);
8131 returnValue__ = Discord_Call_GetSelfMute(&instance_);
8132 return returnValue__;
8136 assert(state_ == DiscordObjectState::Owned);
8137 Discord_Call_Status returnValue__;
8138 returnValue__ = Discord_Call_GetStatus(&instance_);
8143 assert(state_ == DiscordObjectState::Owned);
8144 Discord_VADThresholdSettings returnValueNative__{};
8145 Discord_Call_GetVADThreshold(&instance_, &returnValueNative__);
8147 return returnValue__;
8149std::optional<discordpp::VoiceStateHandle> Call::GetVoiceStateHandle(uint64_t userId)
const
8151 assert(state_ == DiscordObjectState::Owned);
8152 bool returnIsNonNull__;
8153 Discord_VoiceStateHandle returnValueNative__;
8154 returnIsNonNull__ = Discord_Call_GetVoiceStateHandle(&instance_, userId, &returnValueNative__);
8155 if (!returnIsNonNull__) {
8159 return returnValue__;
8163 assert(state_ == DiscordObjectState::Owned);
8164 Discord_Call_SetAudioMode(&instance_,
static_cast<Discord_AudioModeType
>(audioMode));
8166void Call::SetLocalMute(uint64_t userId,
bool mute)
8168 assert(state_ == DiscordObjectState::Owned);
8169 Discord_Call_SetLocalMute(&instance_, userId, mute);
8173 assert(state_ == DiscordObjectState::Owned);
8174 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
8175 auto cb__userData =
new Tcb__UserData(cb);
8176 Discord_Call_OnVoiceStateChanged cb__native = [](
auto userId,
void* userData__) {
8177 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
8178 userData__typed->delegate(userId);
8180 Discord_Call_SetOnVoiceStateChangedCallback(
8181 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
8185 assert(state_ == DiscordObjectState::Owned);
8186 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
8187 auto cb__userData =
new Tcb__UserData(cb);
8188 Discord_Call_OnParticipantChanged cb__native = [](
auto userId,
auto added,
void* userData__) {
8189 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
8190 userData__typed->delegate(userId, added);
8192 Discord_Call_SetParticipantChangedCallback(
8193 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
8195void Call::SetParticipantVolume(uint64_t userId,
float volume)
8197 assert(state_ == DiscordObjectState::Owned);
8198 Discord_Call_SetParticipantVolume(&instance_, userId, volume);
8200void Call::SetPTTActive(
bool active)
8202 assert(state_ == DiscordObjectState::Owned);
8203 Discord_Call_SetPTTActive(&instance_, active);
8205void Call::SetPTTReleaseDelay(uint32_t releaseDelayMs)
8207 assert(state_ == DiscordObjectState::Owned);
8208 Discord_Call_SetPTTReleaseDelay(&instance_, releaseDelayMs);
8210void Call::SetSelfDeaf(
bool deaf)
8212 assert(state_ == DiscordObjectState::Owned);
8213 Discord_Call_SetSelfDeaf(&instance_, deaf);
8215void Call::SetSelfMute(
bool mute)
8217 assert(state_ == DiscordObjectState::Owned);
8218 Discord_Call_SetSelfMute(&instance_, mute);
8222 assert(state_ == DiscordObjectState::Owned);
8223 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
8224 auto cb__userData =
new Tcb__UserData(cb);
8225 Discord_Call_OnSpeakingStatusChanged cb__native =
8226 [](
auto userId,
auto isPlayingSound,
void* userData__) {
8227 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
8228 userData__typed->delegate(userId, isPlayingSound);
8230 Discord_Call_SetSpeakingStatusChangedCallback(
8231 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
8235 assert(state_ == DiscordObjectState::Owned);
8236 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
8237 auto cb__userData =
new Tcb__UserData(cb);
8238 Discord_Call_OnStatusChanged cb__native =
8239 [](
auto status,
auto error,
auto errorDetail,
void* userData__) {
8240 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
8245 Discord_Call_SetStatusChangedCallback(
8246 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
8248void Call::SetVADThreshold(
bool automatic,
float threshold)
8250 assert(state_ == DiscordObjectState::Owned);
8251 Discord_Call_SetVADThreshold(&instance_, automatic, threshold);
8255 Discord_String returnValueNative__;
8256 Discord_Call_StatusToString(
static_cast<Discord_Call_Status
>(type), &returnValueNative__);
8257 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
8258 returnValueNative__.size);
8259 Discord_Free(returnValueNative__.ptr);
8260 return returnValue__;
8262const ChannelHandle ChannelHandle::nullobj{{}, DiscordObjectState::Invalid};
8263ChannelHandle::~ChannelHandle()
8265 if (state_ == DiscordObjectState::Owned) {
8267 state_ = DiscordObjectState::Invalid;
8270ChannelHandle::ChannelHandle(ChannelHandle&& other) noexcept
8271 : instance_(other.instance_)
8272 , state_(other.state_)
8274 other.state_ = DiscordObjectState::Invalid;
8276ChannelHandle& ChannelHandle::operator=(ChannelHandle&& other)
noexcept
8278 if (
this != &other) {
8279 if (state_ == DiscordObjectState::Owned) {
8282 instance_ = other.instance_;
8283 state_ = other.state_;
8284 other.state_ = DiscordObjectState::Invalid;
8288ChannelHandle::ChannelHandle(
const ChannelHandle& other)
8293 Discord_ChannelHandle_Clone(&instance_, other.instance());
8295 state_ = DiscordObjectState::Owned;
8298ChannelHandle& ChannelHandle::operator=(
const ChannelHandle& other)
8300 if (
this != &other) {
8301 if (state_ == DiscordObjectState::Owned) {
8303 state_ = DiscordObjectState::Invalid;
8305 if (other.state_ == DiscordObjectState::Owned) {
8306 Discord_ChannelHandle_Clone(&instance_, other.instance());
8308 state_ = DiscordObjectState::Owned;
8313ChannelHandle::ChannelHandle(Discord_ChannelHandle instance, DiscordObjectState state)
8314 : instance_(instance)
8318void ChannelHandle::Drop()
8320 if (state_ != DiscordObjectState::Owned) {
8323 Discord_ChannelHandle_Drop(&instance_);
8324 state_ = DiscordObjectState::Invalid;
8326uint64_t ChannelHandle::Id()
const
8328 assert(state_ == DiscordObjectState::Owned);
8329 uint64_t returnValue__;
8330 returnValue__ = Discord_ChannelHandle_Id(&instance_);
8331 return returnValue__;
8333std::string ChannelHandle::Name()
const
8335 assert(state_ == DiscordObjectState::Owned);
8336 Discord_String returnValueNative__;
8337 Discord_ChannelHandle_Name(&instance_, &returnValueNative__);
8338 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
8339 returnValueNative__.size);
8340 Discord_Free(returnValueNative__.ptr);
8341 return returnValue__;
8343std::vector<uint64_t> ChannelHandle::Recipients()
const
8345 assert(state_ == DiscordObjectState::Owned);
8346 Discord_UInt64Span returnValueNative__;
8347 Discord_ChannelHandle_Recipients(&instance_, &returnValueNative__);
8348 std::vector<uint64_t> returnValue__(returnValueNative__.ptr,
8349 returnValueNative__.ptr + returnValueNative__.size);
8350 Discord_Free(returnValueNative__.ptr);
8351 return returnValue__;
8355 assert(state_ == DiscordObjectState::Owned);
8356 Discord_ChannelType returnValue__;
8357 returnValue__ = Discord_ChannelHandle_Type(&instance_);
8360const GuildMinimal GuildMinimal::nullobj{{}, DiscordObjectState::Invalid};
8361GuildMinimal::~GuildMinimal()
8363 if (state_ == DiscordObjectState::Owned) {
8365 state_ = DiscordObjectState::Invalid;
8368GuildMinimal::GuildMinimal(GuildMinimal&& other) noexcept
8369 : instance_(other.instance_)
8370 , state_(other.state_)
8372 other.state_ = DiscordObjectState::Invalid;
8374GuildMinimal& GuildMinimal::operator=(GuildMinimal&& other)
noexcept
8376 if (
this != &other) {
8377 if (state_ == DiscordObjectState::Owned) {
8380 instance_ = other.instance_;
8381 state_ = other.state_;
8382 other.state_ = DiscordObjectState::Invalid;
8386GuildMinimal::GuildMinimal(
const GuildMinimal& arg0)
8391 Discord_GuildMinimal_Clone(&instance_, arg0.instance());
8393 state_ = DiscordObjectState::Owned;
8396GuildMinimal& GuildMinimal::operator=(
const GuildMinimal& arg0)
8398 if (
this != &arg0) {
8399 if (state_ == DiscordObjectState::Owned) {
8401 state_ = DiscordObjectState::Invalid;
8403 if (arg0.state_ == DiscordObjectState::Owned) {
8404 Discord_GuildMinimal_Clone(&instance_, arg0.instance());
8406 state_ = DiscordObjectState::Owned;
8411GuildMinimal::GuildMinimal(Discord_GuildMinimal instance, DiscordObjectState state)
8412 : instance_(instance)
8416void GuildMinimal::Drop()
8418 if (state_ != DiscordObjectState::Owned) {
8421 Discord_GuildMinimal_Drop(&instance_);
8422 state_ = DiscordObjectState::Invalid;
8424uint64_t GuildMinimal::Id()
const
8426 assert(state_ == DiscordObjectState::Owned);
8427 uint64_t returnValue__;
8428 returnValue__ = Discord_GuildMinimal_Id(&instance_);
8429 return returnValue__;
8431void GuildMinimal::SetId(uint64_t Id)
8433 assert(state_ == DiscordObjectState::Owned);
8434 Discord_GuildMinimal_SetId(&instance_, Id);
8436std::string GuildMinimal::Name()
const
8438 assert(state_ == DiscordObjectState::Owned);
8439 Discord_String returnValueNative__;
8440 Discord_GuildMinimal_Name(&instance_, &returnValueNative__);
8441 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
8442 returnValueNative__.size);
8443 Discord_Free(returnValueNative__.ptr);
8444 return returnValue__;
8446void GuildMinimal::SetName(std::string Name)
8448 assert(state_ == DiscordObjectState::Owned);
8449 Discord_String Name__str{(uint8_t*)(
Name.data()),
Name.size()};
8450 Discord_GuildMinimal_SetName(&instance_, Name__str);
8452const GuildChannel GuildChannel::nullobj{{}, DiscordObjectState::Invalid};
8453GuildChannel::~GuildChannel()
8455 if (state_ == DiscordObjectState::Owned) {
8457 state_ = DiscordObjectState::Invalid;
8460GuildChannel::GuildChannel(GuildChannel&& other) noexcept
8461 : instance_(other.instance_)
8462 , state_(other.state_)
8464 other.state_ = DiscordObjectState::Invalid;
8466GuildChannel& GuildChannel::operator=(GuildChannel&& other)
noexcept
8468 if (
this != &other) {
8469 if (state_ == DiscordObjectState::Owned) {
8472 instance_ = other.instance_;
8473 state_ = other.state_;
8474 other.state_ = DiscordObjectState::Invalid;
8478GuildChannel::GuildChannel(
const GuildChannel& arg0)
8483 Discord_GuildChannel_Clone(&instance_, arg0.instance());
8485 state_ = DiscordObjectState::Owned;
8488GuildChannel& GuildChannel::operator=(
const GuildChannel& arg0)
8490 if (
this != &arg0) {
8491 if (state_ == DiscordObjectState::Owned) {
8493 state_ = DiscordObjectState::Invalid;
8495 if (arg0.state_ == DiscordObjectState::Owned) {
8496 Discord_GuildChannel_Clone(&instance_, arg0.instance());
8498 state_ = DiscordObjectState::Owned;
8503GuildChannel::GuildChannel(Discord_GuildChannel instance, DiscordObjectState state)
8504 : instance_(instance)
8508void GuildChannel::Drop()
8510 if (state_ != DiscordObjectState::Owned) {
8513 Discord_GuildChannel_Drop(&instance_);
8514 state_ = DiscordObjectState::Invalid;
8516uint64_t GuildChannel::Id()
const
8518 assert(state_ == DiscordObjectState::Owned);
8519 uint64_t returnValue__;
8520 returnValue__ = Discord_GuildChannel_Id(&instance_);
8521 return returnValue__;
8523void GuildChannel::SetId(uint64_t Id)
8525 assert(state_ == DiscordObjectState::Owned);
8526 Discord_GuildChannel_SetId(&instance_, Id);
8528std::string GuildChannel::Name()
const
8530 assert(state_ == DiscordObjectState::Owned);
8531 Discord_String returnValueNative__;
8532 Discord_GuildChannel_Name(&instance_, &returnValueNative__);
8533 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
8534 returnValueNative__.size);
8535 Discord_Free(returnValueNative__.ptr);
8536 return returnValue__;
8538void GuildChannel::SetName(std::string Name)
8540 assert(state_ == DiscordObjectState::Owned);
8541 Discord_String Name__str{(uint8_t*)(
Name.data()),
Name.size()};
8542 Discord_GuildChannel_SetName(&instance_, Name__str);
8546 assert(state_ == DiscordObjectState::Owned);
8547 Discord_ChannelType returnValue__;
8548 returnValue__ = Discord_GuildChannel_Type(&instance_);
8553 assert(state_ == DiscordObjectState::Owned);
8554 Discord_GuildChannel_SetType(&instance_,
static_cast<Discord_ChannelType
>(Type));
8556int32_t GuildChannel::Position()
const
8558 assert(state_ == DiscordObjectState::Owned);
8559 int32_t returnValue__;
8560 returnValue__ = Discord_GuildChannel_Position(&instance_);
8561 return returnValue__;
8563void GuildChannel::SetPosition(int32_t Position)
8565 assert(state_ == DiscordObjectState::Owned);
8566 Discord_GuildChannel_SetPosition(&instance_, Position);
8568std::optional<uint64_t> GuildChannel::ParentId()
const
8570 assert(state_ == DiscordObjectState::Owned);
8571 bool returnIsNonNull__;
8572 uint64_t returnValue__;
8573 returnIsNonNull__ = Discord_GuildChannel_ParentId(&instance_, &returnValue__);
8574 if (!returnIsNonNull__) {
8575 return std::nullopt;
8577 return returnValue__;
8579void GuildChannel::SetParentId(std::optional<uint64_t> ParentId)
8581 assert(state_ == DiscordObjectState::Owned);
8582 Discord_GuildChannel_SetParentId(&instance_, (ParentId.has_value() ? &*ParentId :
nullptr));
8584bool GuildChannel::IsLinkable()
const
8586 assert(state_ == DiscordObjectState::Owned);
8588 returnValue__ = Discord_GuildChannel_IsLinkable(&instance_);
8589 return returnValue__;
8591void GuildChannel::SetIsLinkable(
bool IsLinkable)
8593 assert(state_ == DiscordObjectState::Owned);
8594 Discord_GuildChannel_SetIsLinkable(&instance_, IsLinkable);
8596bool GuildChannel::IsViewableAndWriteableByAllMembers()
const
8598 assert(state_ == DiscordObjectState::Owned);
8600 returnValue__ = Discord_GuildChannel_IsViewableAndWriteableByAllMembers(&instance_);
8601 return returnValue__;
8603void GuildChannel::SetIsViewableAndWriteableByAllMembers(
bool IsViewableAndWriteableByAllMembers)
8605 assert(state_ == DiscordObjectState::Owned);
8606 Discord_GuildChannel_SetIsViewableAndWriteableByAllMembers(&instance_,
8607 IsViewableAndWriteableByAllMembers);
8609std::optional<discordpp::LinkedLobby> GuildChannel::LinkedLobby()
const
8611 assert(state_ == DiscordObjectState::Owned);
8612 bool returnIsNonNull__;
8613 Discord_LinkedLobby returnValueNative__;
8614 returnIsNonNull__ = Discord_GuildChannel_LinkedLobby(&instance_, &returnValueNative__);
8615 if (!returnIsNonNull__) {
8619 return returnValue__;
8621void GuildChannel::SetLinkedLobby(std::optional<discordpp::LinkedLobby> LinkedLobby)
8623 assert(state_ == DiscordObjectState::Owned);
8624 Discord_GuildChannel_SetLinkedLobby(
8625 &instance_, (LinkedLobby.has_value() ? LinkedLobby->instance() :
nullptr));
8627const LinkedLobby LinkedLobby::nullobj{{}, DiscordObjectState::Invalid};
8628LinkedLobby::~LinkedLobby()
8630 if (state_ == DiscordObjectState::Owned) {
8632 state_ = DiscordObjectState::Invalid;
8635LinkedLobby::LinkedLobby(LinkedLobby&& other) noexcept
8636 : instance_(other.instance_)
8637 , state_(other.state_)
8639 other.state_ = DiscordObjectState::Invalid;
8641LinkedLobby& LinkedLobby::operator=(LinkedLobby&& other)
noexcept
8643 if (
this != &other) {
8644 if (state_ == DiscordObjectState::Owned) {
8647 instance_ = other.instance_;
8648 state_ = other.state_;
8649 other.state_ = DiscordObjectState::Invalid;
8653LinkedLobby::LinkedLobby(
const LinkedLobby& arg0)
8658 Discord_LinkedLobby_Clone(&instance_, arg0.instance());
8660 state_ = DiscordObjectState::Owned;
8663LinkedLobby& LinkedLobby::operator=(
const LinkedLobby& arg0)
8665 if (
this != &arg0) {
8666 if (state_ == DiscordObjectState::Owned) {
8668 state_ = DiscordObjectState::Invalid;
8670 if (arg0.state_ == DiscordObjectState::Owned) {
8671 Discord_LinkedLobby_Clone(&instance_, arg0.instance());
8673 state_ = DiscordObjectState::Owned;
8678LinkedLobby::LinkedLobby(Discord_LinkedLobby instance, DiscordObjectState state)
8679 : instance_(instance)
8683LinkedLobby::LinkedLobby()
8685 assert(state_ == DiscordObjectState::Invalid);
8686 Discord_LinkedLobby_Init(&instance_);
8687 state_ = DiscordObjectState::Owned;
8689void LinkedLobby::Drop()
8691 if (state_ != DiscordObjectState::Owned) {
8694 Discord_LinkedLobby_Drop(&instance_);
8695 state_ = DiscordObjectState::Invalid;
8697uint64_t LinkedLobby::ApplicationId()
const
8699 assert(state_ == DiscordObjectState::Owned);
8700 uint64_t returnValue__;
8701 returnValue__ = Discord_LinkedLobby_ApplicationId(&instance_);
8702 return returnValue__;
8704void LinkedLobby::SetApplicationId(uint64_t ApplicationId)
8706 assert(state_ == DiscordObjectState::Owned);
8707 Discord_LinkedLobby_SetApplicationId(&instance_, ApplicationId);
8709uint64_t LinkedLobby::LobbyId()
const
8711 assert(state_ == DiscordObjectState::Owned);
8712 uint64_t returnValue__;
8713 returnValue__ = Discord_LinkedLobby_LobbyId(&instance_);
8714 return returnValue__;
8716void LinkedLobby::SetLobbyId(uint64_t LobbyId)
8718 assert(state_ == DiscordObjectState::Owned);
8719 Discord_LinkedLobby_SetLobbyId(&instance_, LobbyId);
8721const LinkedChannel LinkedChannel::nullobj{{}, DiscordObjectState::Invalid};
8722LinkedChannel::~LinkedChannel()
8724 if (state_ == DiscordObjectState::Owned) {
8726 state_ = DiscordObjectState::Invalid;
8729LinkedChannel::LinkedChannel(LinkedChannel&& other) noexcept
8730 : instance_(other.instance_)
8731 , state_(other.state_)
8733 other.state_ = DiscordObjectState::Invalid;
8735LinkedChannel& LinkedChannel::operator=(LinkedChannel&& other)
noexcept
8737 if (
this != &other) {
8738 if (state_ == DiscordObjectState::Owned) {
8741 instance_ = other.instance_;
8742 state_ = other.state_;
8743 other.state_ = DiscordObjectState::Invalid;
8747LinkedChannel::LinkedChannel(
const LinkedChannel& arg0)
8752 Discord_LinkedChannel_Clone(&instance_, arg0.instance());
8754 state_ = DiscordObjectState::Owned;
8757LinkedChannel& LinkedChannel::operator=(
const LinkedChannel& arg0)
8759 if (
this != &arg0) {
8760 if (state_ == DiscordObjectState::Owned) {
8762 state_ = DiscordObjectState::Invalid;
8764 if (arg0.state_ == DiscordObjectState::Owned) {
8765 Discord_LinkedChannel_Clone(&instance_, arg0.instance());
8767 state_ = DiscordObjectState::Owned;
8772LinkedChannel::LinkedChannel(Discord_LinkedChannel instance, DiscordObjectState state)
8773 : instance_(instance)
8777void LinkedChannel::Drop()
8779 if (state_ != DiscordObjectState::Owned) {
8782 Discord_LinkedChannel_Drop(&instance_);
8783 state_ = DiscordObjectState::Invalid;
8785uint64_t LinkedChannel::Id()
const
8787 assert(state_ == DiscordObjectState::Owned);
8788 uint64_t returnValue__;
8789 returnValue__ = Discord_LinkedChannel_Id(&instance_);
8790 return returnValue__;
8792void LinkedChannel::SetId(uint64_t Id)
8794 assert(state_ == DiscordObjectState::Owned);
8795 Discord_LinkedChannel_SetId(&instance_, Id);
8797std::string LinkedChannel::Name()
const
8799 assert(state_ == DiscordObjectState::Owned);
8800 Discord_String returnValueNative__;
8801 Discord_LinkedChannel_Name(&instance_, &returnValueNative__);
8802 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
8803 returnValueNative__.size);
8804 Discord_Free(returnValueNative__.ptr);
8805 return returnValue__;
8807void LinkedChannel::SetName(std::string Name)
8809 assert(state_ == DiscordObjectState::Owned);
8810 Discord_String Name__str{(uint8_t*)(
Name.data()),
Name.size()};
8811 Discord_LinkedChannel_SetName(&instance_, Name__str);
8813uint64_t LinkedChannel::GuildId()
const
8815 assert(state_ == DiscordObjectState::Owned);
8816 uint64_t returnValue__;
8817 returnValue__ = Discord_LinkedChannel_GuildId(&instance_);
8818 return returnValue__;
8820void LinkedChannel::SetGuildId(uint64_t GuildId)
8822 assert(state_ == DiscordObjectState::Owned);
8823 Discord_LinkedChannel_SetGuildId(&instance_, GuildId);
8825const RelationshipHandle RelationshipHandle::nullobj{{}, DiscordObjectState::Invalid};
8826RelationshipHandle::~RelationshipHandle()
8828 if (state_ == DiscordObjectState::Owned) {
8830 state_ = DiscordObjectState::Invalid;
8833RelationshipHandle::RelationshipHandle(RelationshipHandle&& other) noexcept
8834 : instance_(other.instance_)
8835 , state_(other.state_)
8837 other.state_ = DiscordObjectState::Invalid;
8839RelationshipHandle& RelationshipHandle::operator=(RelationshipHandle&& other)
noexcept
8841 if (
this != &other) {
8842 if (state_ == DiscordObjectState::Owned) {
8845 instance_ = other.instance_;
8846 state_ = other.state_;
8847 other.state_ = DiscordObjectState::Invalid;
8851RelationshipHandle::RelationshipHandle(
const RelationshipHandle& other)
8856 Discord_RelationshipHandle_Clone(&instance_, other.instance());
8858 state_ = DiscordObjectState::Owned;
8861RelationshipHandle& RelationshipHandle::operator=(
const RelationshipHandle& other)
8863 if (
this != &other) {
8864 if (state_ == DiscordObjectState::Owned) {
8866 state_ = DiscordObjectState::Invalid;
8868 if (other.state_ == DiscordObjectState::Owned) {
8869 Discord_RelationshipHandle_Clone(&instance_, other.instance());
8871 state_ = DiscordObjectState::Owned;
8876RelationshipHandle::RelationshipHandle(Discord_RelationshipHandle instance,
8877 DiscordObjectState state)
8878 : instance_(instance)
8882void RelationshipHandle::Drop()
8884 if (state_ != DiscordObjectState::Owned) {
8887 Discord_RelationshipHandle_Drop(&instance_);
8888 state_ = DiscordObjectState::Invalid;
8892 assert(state_ == DiscordObjectState::Owned);
8893 Discord_RelationshipType returnValue__;
8894 returnValue__ = Discord_RelationshipHandle_DiscordRelationshipType(&instance_);
8899 assert(state_ == DiscordObjectState::Owned);
8900 Discord_RelationshipType returnValue__;
8901 returnValue__ = Discord_RelationshipHandle_GameRelationshipType(&instance_);
8904uint64_t RelationshipHandle::Id()
const
8906 assert(state_ == DiscordObjectState::Owned);
8907 uint64_t returnValue__;
8908 returnValue__ = Discord_RelationshipHandle_Id(&instance_);
8909 return returnValue__;
8911bool RelationshipHandle::IsSpamRequest()
const
8913 assert(state_ == DiscordObjectState::Owned);
8915 returnValue__ = Discord_RelationshipHandle_IsSpamRequest(&instance_);
8916 return returnValue__;
8918std::optional<discordpp::UserHandle> RelationshipHandle::User()
const
8920 assert(state_ == DiscordObjectState::Owned);
8921 bool returnIsNonNull__;
8922 Discord_UserHandle returnValueNative__;
8923 returnIsNonNull__ = Discord_RelationshipHandle_User(&instance_, &returnValueNative__);
8924 if (!returnIsNonNull__) {
8928 return returnValue__;
8930const UserApplicationProfileHandle UserApplicationProfileHandle::nullobj{
8932 DiscordObjectState::Invalid};
8933UserApplicationProfileHandle::~UserApplicationProfileHandle()
8935 if (state_ == DiscordObjectState::Owned) {
8937 state_ = DiscordObjectState::Invalid;
8940UserApplicationProfileHandle::UserApplicationProfileHandle(
8941 UserApplicationProfileHandle&& other) noexcept
8942 : instance_(other.instance_)
8943 , state_(other.state_)
8945 other.state_ = DiscordObjectState::Invalid;
8947UserApplicationProfileHandle& UserApplicationProfileHandle::operator=(
8948 UserApplicationProfileHandle&& other)
noexcept
8950 if (
this != &other) {
8951 if (state_ == DiscordObjectState::Owned) {
8954 instance_ = other.instance_;
8955 state_ = other.state_;
8956 other.state_ = DiscordObjectState::Invalid;
8960UserApplicationProfileHandle::UserApplicationProfileHandle(
8961 const UserApplicationProfileHandle& other)
8966 Discord_UserApplicationProfileHandle_Clone(&instance_, other.instance());
8968 state_ = DiscordObjectState::Owned;
8971UserApplicationProfileHandle& UserApplicationProfileHandle::operator=(
8972 const UserApplicationProfileHandle& other)
8974 if (
this != &other) {
8975 if (state_ == DiscordObjectState::Owned) {
8977 state_ = DiscordObjectState::Invalid;
8979 if (other.state_ == DiscordObjectState::Owned) {
8980 Discord_UserApplicationProfileHandle_Clone(&instance_, other.instance());
8982 state_ = DiscordObjectState::Owned;
8987UserApplicationProfileHandle::UserApplicationProfileHandle(
8988 Discord_UserApplicationProfileHandle instance,
8989 DiscordObjectState state)
8990 : instance_(instance)
8994void UserApplicationProfileHandle::Drop()
8996 if (state_ != DiscordObjectState::Owned) {
8999 Discord_UserApplicationProfileHandle_Drop(&instance_);
9000 state_ = DiscordObjectState::Invalid;
9002std::string UserApplicationProfileHandle::AvatarHash()
const
9004 assert(state_ == DiscordObjectState::Owned);
9005 Discord_String returnValueNative__;
9006 Discord_UserApplicationProfileHandle_AvatarHash(&instance_, &returnValueNative__);
9007 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
9008 returnValueNative__.size);
9009 Discord_Free(returnValueNative__.ptr);
9010 return returnValue__;
9012std::string UserApplicationProfileHandle::Metadata()
const
9014 assert(state_ == DiscordObjectState::Owned);
9015 Discord_String returnValueNative__;
9016 Discord_UserApplicationProfileHandle_Metadata(&instance_, &returnValueNative__);
9017 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
9018 returnValueNative__.size);
9019 Discord_Free(returnValueNative__.ptr);
9020 return returnValue__;
9022std::optional<std::string> UserApplicationProfileHandle::ProviderId()
const
9024 assert(state_ == DiscordObjectState::Owned);
9025 bool returnIsNonNull__;
9026 Discord_String returnValueNative__;
9028 Discord_UserApplicationProfileHandle_ProviderId(&instance_, &returnValueNative__);
9029 if (!returnIsNonNull__) {
9032 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
9033 returnValueNative__.size);
9034 Discord_Free(returnValueNative__.ptr);
9035 return returnValue__;
9037std::string UserApplicationProfileHandle::ProviderIssuedUserId()
const
9039 assert(state_ == DiscordObjectState::Owned);
9040 Discord_String returnValueNative__;
9041 Discord_UserApplicationProfileHandle_ProviderIssuedUserId(&instance_, &returnValueNative__);
9042 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
9043 returnValueNative__.size);
9044 Discord_Free(returnValueNative__.ptr);
9045 return returnValue__;
9049 assert(state_ == DiscordObjectState::Owned);
9050 Discord_ExternalIdentityProviderType returnValue__;
9051 returnValue__ = Discord_UserApplicationProfileHandle_ProviderType(&instance_);
9054std::string UserApplicationProfileHandle::Username()
const
9056 assert(state_ == DiscordObjectState::Owned);
9057 Discord_String returnValueNative__;
9058 Discord_UserApplicationProfileHandle_Username(&instance_, &returnValueNative__);
9059 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
9060 returnValueNative__.size);
9061 Discord_Free(returnValueNative__.ptr);
9062 return returnValue__;
9064const UserHandle UserHandle::nullobj{{}, DiscordObjectState::Invalid};
9065UserHandle::~UserHandle()
9067 if (state_ == DiscordObjectState::Owned) {
9069 state_ = DiscordObjectState::Invalid;
9072UserHandle::UserHandle(UserHandle&& other) noexcept
9073 : instance_(other.instance_)
9074 , state_(other.state_)
9076 other.state_ = DiscordObjectState::Invalid;
9078UserHandle& UserHandle::operator=(UserHandle&& other)
noexcept
9080 if (
this != &other) {
9081 if (state_ == DiscordObjectState::Owned) {
9084 instance_ = other.instance_;
9085 state_ = other.state_;
9086 other.state_ = DiscordObjectState::Invalid;
9090UserHandle::UserHandle(
const UserHandle& arg0)
9095 Discord_UserHandle_Clone(&instance_, arg0.instance());
9097 state_ = DiscordObjectState::Owned;
9100UserHandle& UserHandle::operator=(
const UserHandle& arg0)
9102 if (
this != &arg0) {
9103 if (state_ == DiscordObjectState::Owned) {
9105 state_ = DiscordObjectState::Invalid;
9107 if (arg0.state_ == DiscordObjectState::Owned) {
9108 Discord_UserHandle_Clone(&instance_, arg0.instance());
9110 state_ = DiscordObjectState::Owned;
9115UserHandle::UserHandle(Discord_UserHandle instance, DiscordObjectState state)
9116 : instance_(instance)
9120void UserHandle::Drop()
9122 if (state_ != DiscordObjectState::Owned) {
9125 Discord_UserHandle_Drop(&instance_);
9126 state_ = DiscordObjectState::Invalid;
9128std::optional<std::string> UserHandle::Avatar()
const
9130 assert(state_ == DiscordObjectState::Owned);
9131 bool returnIsNonNull__;
9132 Discord_String returnValueNative__;
9133 returnIsNonNull__ = Discord_UserHandle_Avatar(&instance_, &returnValueNative__);
9134 if (!returnIsNonNull__) {
9137 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
9138 returnValueNative__.size);
9139 Discord_Free(returnValueNative__.ptr);
9140 return returnValue__;
9144 Discord_String returnValueNative__;
9145 Discord_UserHandle_AvatarTypeToString(
static_cast<Discord_UserHandle_AvatarType
>(type),
9146 &returnValueNative__);
9147 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
9148 returnValueNative__.size);
9149 Discord_Free(returnValueNative__.ptr);
9150 return returnValue__;
9155 assert(state_ == DiscordObjectState::Owned);
9156 Discord_String returnValueNative__;
9157 Discord_UserHandle_AvatarUrl(&instance_,
9158 static_cast<Discord_UserHandle_AvatarType
>(animatedType),
9159 static_cast<Discord_UserHandle_AvatarType
>(staticType),
9160 &returnValueNative__);
9161 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
9162 returnValueNative__.size);
9163 Discord_Free(returnValueNative__.ptr);
9164 return returnValue__;
9166std::string UserHandle::DisplayName()
const
9168 assert(state_ == DiscordObjectState::Owned);
9169 Discord_String returnValueNative__;
9170 Discord_UserHandle_DisplayName(&instance_, &returnValueNative__);
9171 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
9172 returnValueNative__.size);
9173 Discord_Free(returnValueNative__.ptr);
9174 return returnValue__;
9176std::optional<discordpp::Activity> UserHandle::GameActivity()
const
9178 assert(state_ == DiscordObjectState::Owned);
9179 bool returnIsNonNull__;
9180 Discord_Activity returnValueNative__;
9181 returnIsNonNull__ = Discord_UserHandle_GameActivity(&instance_, &returnValueNative__);
9182 if (!returnIsNonNull__) {
9186 return returnValue__;
9188std::optional<std::string> UserHandle::GlobalName()
const
9190 assert(state_ == DiscordObjectState::Owned);
9191 bool returnIsNonNull__;
9192 Discord_String returnValueNative__;
9193 returnIsNonNull__ = Discord_UserHandle_GlobalName(&instance_, &returnValueNative__);
9194 if (!returnIsNonNull__) {
9197 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
9198 returnValueNative__.size);
9199 Discord_Free(returnValueNative__.ptr);
9200 return returnValue__;
9202uint64_t UserHandle::Id()
const
9204 assert(state_ == DiscordObjectState::Owned);
9205 uint64_t returnValue__;
9206 returnValue__ = Discord_UserHandle_Id(&instance_);
9207 return returnValue__;
9209bool UserHandle::IsProvisional()
const
9211 assert(state_ == DiscordObjectState::Owned);
9213 returnValue__ = Discord_UserHandle_IsProvisional(&instance_);
9214 return returnValue__;
9218 assert(state_ == DiscordObjectState::Owned);
9219 Discord_RelationshipHandle returnValueNative__{};
9220 Discord_UserHandle_Relationship(&instance_, &returnValueNative__);
9222 return returnValue__;
9226 assert(state_ == DiscordObjectState::Owned);
9227 Discord_StatusType returnValue__;
9228 returnValue__ = Discord_UserHandle_Status(&instance_);
9231std::vector<discordpp::UserApplicationProfileHandle> UserHandle::UserApplicationProfiles()
const
9233 assert(state_ == DiscordObjectState::Owned);
9234 Discord_UserApplicationProfileHandleSpan returnValueNative__;
9235 Discord_UserHandle_UserApplicationProfiles(&instance_, &returnValueNative__);
9236 std::vector<discordpp::UserApplicationProfileHandle> returnValue__;
9237 returnValue__.reserve(returnValueNative__.size);
9238 for (
size_t i__ = 0; i__ < returnValueNative__.size; ++i__) {
9239 returnValue__.emplace_back(returnValueNative__.ptr[i__], DiscordObjectState::Owned);
9241 Discord_Free(returnValueNative__.ptr);
9242 return returnValue__;
9244std::string UserHandle::Username()
const
9246 assert(state_ == DiscordObjectState::Owned);
9247 Discord_String returnValueNative__;
9248 Discord_UserHandle_Username(&instance_, &returnValueNative__);
9249 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
9250 returnValueNative__.size);
9251 Discord_Free(returnValueNative__.ptr);
9252 return returnValue__;
9254const LobbyMemberHandle LobbyMemberHandle::nullobj{{}, DiscordObjectState::Invalid};
9255LobbyMemberHandle::~LobbyMemberHandle()
9257 if (state_ == DiscordObjectState::Owned) {
9259 state_ = DiscordObjectState::Invalid;
9262LobbyMemberHandle::LobbyMemberHandle(LobbyMemberHandle&& other) noexcept
9263 : instance_(other.instance_)
9264 , state_(other.state_)
9266 other.state_ = DiscordObjectState::Invalid;
9268LobbyMemberHandle& LobbyMemberHandle::operator=(LobbyMemberHandle&& other)
noexcept
9270 if (
this != &other) {
9271 if (state_ == DiscordObjectState::Owned) {
9274 instance_ = other.instance_;
9275 state_ = other.state_;
9276 other.state_ = DiscordObjectState::Invalid;
9280LobbyMemberHandle::LobbyMemberHandle(
const LobbyMemberHandle& other)
9285 Discord_LobbyMemberHandle_Clone(&instance_, other.instance());
9287 state_ = DiscordObjectState::Owned;
9290LobbyMemberHandle& LobbyMemberHandle::operator=(
const LobbyMemberHandle& other)
9292 if (
this != &other) {
9293 if (state_ == DiscordObjectState::Owned) {
9295 state_ = DiscordObjectState::Invalid;
9297 if (other.state_ == DiscordObjectState::Owned) {
9298 Discord_LobbyMemberHandle_Clone(&instance_, other.instance());
9300 state_ = DiscordObjectState::Owned;
9305LobbyMemberHandle::LobbyMemberHandle(Discord_LobbyMemberHandle instance, DiscordObjectState state)
9306 : instance_(instance)
9310void LobbyMemberHandle::Drop()
9312 if (state_ != DiscordObjectState::Owned) {
9315 Discord_LobbyMemberHandle_Drop(&instance_);
9316 state_ = DiscordObjectState::Invalid;
9318bool LobbyMemberHandle::CanLinkLobby()
const
9320 assert(state_ == DiscordObjectState::Owned);
9322 returnValue__ = Discord_LobbyMemberHandle_CanLinkLobby(&instance_);
9323 return returnValue__;
9325bool LobbyMemberHandle::Connected()
const
9327 assert(state_ == DiscordObjectState::Owned);
9329 returnValue__ = Discord_LobbyMemberHandle_Connected(&instance_);
9330 return returnValue__;
9332uint64_t LobbyMemberHandle::Id()
const
9334 assert(state_ == DiscordObjectState::Owned);
9335 uint64_t returnValue__;
9336 returnValue__ = Discord_LobbyMemberHandle_Id(&instance_);
9337 return returnValue__;
9339std::unordered_map<std::string, std::string> LobbyMemberHandle::Metadata()
const
9341 assert(state_ == DiscordObjectState::Owned);
9342 Discord_Properties returnValueNative__;
9343 Discord_LobbyMemberHandle_Metadata(&instance_, &returnValueNative__);
9344 std::unordered_map<std::string, std::string> returnValue__ =
9345 ConvertReturnedProperties(returnValueNative__);
9346 Discord_FreeProperties(returnValueNative__);
9347 return returnValue__;
9349std::optional<discordpp::UserHandle> LobbyMemberHandle::User()
const
9351 assert(state_ == DiscordObjectState::Owned);
9352 bool returnIsNonNull__;
9353 Discord_UserHandle returnValueNative__;
9354 returnIsNonNull__ = Discord_LobbyMemberHandle_User(&instance_, &returnValueNative__);
9355 if (!returnIsNonNull__) {
9359 return returnValue__;
9361const LobbyHandle LobbyHandle::nullobj{{}, DiscordObjectState::Invalid};
9362LobbyHandle::~LobbyHandle()
9364 if (state_ == DiscordObjectState::Owned) {
9366 state_ = DiscordObjectState::Invalid;
9369LobbyHandle::LobbyHandle(LobbyHandle&& other) noexcept
9370 : instance_(other.instance_)
9371 , state_(other.state_)
9373 other.state_ = DiscordObjectState::Invalid;
9375LobbyHandle& LobbyHandle::operator=(LobbyHandle&& other)
noexcept
9377 if (
this != &other) {
9378 if (state_ == DiscordObjectState::Owned) {
9381 instance_ = other.instance_;
9382 state_ = other.state_;
9383 other.state_ = DiscordObjectState::Invalid;
9387LobbyHandle::LobbyHandle(
const LobbyHandle& other)
9392 Discord_LobbyHandle_Clone(&instance_, other.instance());
9394 state_ = DiscordObjectState::Owned;
9397LobbyHandle& LobbyHandle::operator=(
const LobbyHandle& other)
9399 if (
this != &other) {
9400 if (state_ == DiscordObjectState::Owned) {
9402 state_ = DiscordObjectState::Invalid;
9404 if (other.state_ == DiscordObjectState::Owned) {
9405 Discord_LobbyHandle_Clone(&instance_, other.instance());
9407 state_ = DiscordObjectState::Owned;
9412LobbyHandle::LobbyHandle(Discord_LobbyHandle instance, DiscordObjectState state)
9413 : instance_(instance)
9417void LobbyHandle::Drop()
9419 if (state_ != DiscordObjectState::Owned) {
9422 Discord_LobbyHandle_Drop(&instance_);
9423 state_ = DiscordObjectState::Invalid;
9425std::optional<discordpp::CallInfoHandle> LobbyHandle::GetCallInfoHandle()
const
9427 assert(state_ == DiscordObjectState::Owned);
9428 bool returnIsNonNull__;
9429 Discord_CallInfoHandle returnValueNative__;
9430 returnIsNonNull__ = Discord_LobbyHandle_GetCallInfoHandle(&instance_, &returnValueNative__);
9431 if (!returnIsNonNull__) {
9435 return returnValue__;
9437std::optional<discordpp::LobbyMemberHandle> LobbyHandle::GetLobbyMemberHandle(
9438 uint64_t memberId)
const
9440 assert(state_ == DiscordObjectState::Owned);
9441 bool returnIsNonNull__;
9442 Discord_LobbyMemberHandle returnValueNative__;
9444 Discord_LobbyHandle_GetLobbyMemberHandle(&instance_, memberId, &returnValueNative__);
9445 if (!returnIsNonNull__) {
9449 return returnValue__;
9451uint64_t LobbyHandle::Id()
const
9453 assert(state_ == DiscordObjectState::Owned);
9454 uint64_t returnValue__;
9455 returnValue__ = Discord_LobbyHandle_Id(&instance_);
9456 return returnValue__;
9458std::optional<discordpp::LinkedChannel> LobbyHandle::LinkedChannel()
const
9460 assert(state_ == DiscordObjectState::Owned);
9461 bool returnIsNonNull__;
9462 Discord_LinkedChannel returnValueNative__;
9463 returnIsNonNull__ = Discord_LobbyHandle_LinkedChannel(&instance_, &returnValueNative__);
9464 if (!returnIsNonNull__) {
9468 return returnValue__;
9470std::vector<uint64_t> LobbyHandle::LobbyMemberIds()
const
9472 assert(state_ == DiscordObjectState::Owned);
9473 Discord_UInt64Span returnValueNative__;
9474 Discord_LobbyHandle_LobbyMemberIds(&instance_, &returnValueNative__);
9475 std::vector<uint64_t> returnValue__(returnValueNative__.ptr,
9476 returnValueNative__.ptr + returnValueNative__.size);
9477 Discord_Free(returnValueNative__.ptr);
9478 return returnValue__;
9480std::vector<discordpp::LobbyMemberHandle> LobbyHandle::LobbyMembers()
const
9482 assert(state_ == DiscordObjectState::Owned);
9483 Discord_LobbyMemberHandleSpan returnValueNative__;
9484 Discord_LobbyHandle_LobbyMembers(&instance_, &returnValueNative__);
9485 std::vector<discordpp::LobbyMemberHandle> returnValue__;
9486 returnValue__.reserve(returnValueNative__.size);
9487 for (
size_t i__ = 0; i__ < returnValueNative__.size; ++i__) {
9488 returnValue__.emplace_back(returnValueNative__.ptr[i__], DiscordObjectState::Owned);
9490 Discord_Free(returnValueNative__.ptr);
9491 return returnValue__;
9493std::unordered_map<std::string, std::string> LobbyHandle::Metadata()
const
9495 assert(state_ == DiscordObjectState::Owned);
9496 Discord_Properties returnValueNative__;
9497 Discord_LobbyHandle_Metadata(&instance_, &returnValueNative__);
9498 std::unordered_map<std::string, std::string> returnValue__ =
9499 ConvertReturnedProperties(returnValueNative__);
9500 Discord_FreeProperties(returnValueNative__);
9501 return returnValue__;
9503const AdditionalContent AdditionalContent::nullobj{{}, DiscordObjectState::Invalid};
9504AdditionalContent::~AdditionalContent()
9506 if (state_ == DiscordObjectState::Owned) {
9508 state_ = DiscordObjectState::Invalid;
9511AdditionalContent::AdditionalContent(AdditionalContent&& other) noexcept
9512 : instance_(other.instance_)
9513 , state_(other.state_)
9515 other.state_ = DiscordObjectState::Invalid;
9517AdditionalContent& AdditionalContent::operator=(AdditionalContent&& other)
noexcept
9519 if (
this != &other) {
9520 if (state_ == DiscordObjectState::Owned) {
9523 instance_ = other.instance_;
9524 state_ = other.state_;
9525 other.state_ = DiscordObjectState::Invalid;
9529AdditionalContent::AdditionalContent(
const AdditionalContent& arg0)
9534 Discord_AdditionalContent_Clone(&instance_, arg0.instance());
9536 state_ = DiscordObjectState::Owned;
9539AdditionalContent& AdditionalContent::operator=(
const AdditionalContent& arg0)
9541 if (
this != &arg0) {
9542 if (state_ == DiscordObjectState::Owned) {
9544 state_ = DiscordObjectState::Invalid;
9546 if (arg0.state_ == DiscordObjectState::Owned) {
9547 Discord_AdditionalContent_Clone(&instance_, arg0.instance());
9549 state_ = DiscordObjectState::Owned;
9554AdditionalContent::AdditionalContent(Discord_AdditionalContent instance, DiscordObjectState state)
9555 : instance_(instance)
9559AdditionalContent::AdditionalContent()
9561 assert(state_ == DiscordObjectState::Invalid);
9562 Discord_AdditionalContent_Init(&instance_);
9563 state_ = DiscordObjectState::Owned;
9565void AdditionalContent::Drop()
9567 if (state_ != DiscordObjectState::Owned) {
9570 Discord_AdditionalContent_Drop(&instance_);
9571 state_ = DiscordObjectState::Invalid;
9575 assert(state_ == DiscordObjectState::Owned);
9577 returnValue__ = Discord_AdditionalContent_Equals(&instance_, rhs.instance());
9578 return returnValue__;
9582 Discord_String returnValueNative__;
9583 Discord_AdditionalContent_TypeToString(
static_cast<Discord_AdditionalContentType
>(type),
9584 &returnValueNative__);
9585 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
9586 returnValueNative__.size);
9587 Discord_Free(returnValueNative__.ptr);
9588 return returnValue__;
9592 assert(state_ == DiscordObjectState::Owned);
9593 Discord_AdditionalContentType returnValue__;
9594 returnValue__ = Discord_AdditionalContent_Type(&instance_);
9599 assert(state_ == DiscordObjectState::Owned);
9600 Discord_AdditionalContent_SetType(&instance_,
static_cast<Discord_AdditionalContentType
>(Type));
9602std::optional<std::string> AdditionalContent::Title()
const
9604 assert(state_ == DiscordObjectState::Owned);
9605 bool returnIsNonNull__;
9606 Discord_String returnValueNative__;
9607 returnIsNonNull__ = Discord_AdditionalContent_Title(&instance_, &returnValueNative__);
9608 if (!returnIsNonNull__) {
9611 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
9612 returnValueNative__.size);
9613 Discord_Free(returnValueNative__.ptr);
9614 return returnValue__;
9616void AdditionalContent::SetTitle(std::optional<std::string> Title)
9618 assert(state_ == DiscordObjectState::Owned);
9619 Discord_String Title__str{};
9620 if (Title.has_value()) {
9621 Title__str.ptr =
reinterpret_cast<uint8_t*
>(Title->data());
9622 Title__str.size = Title->size();
9624 Discord_AdditionalContent_SetTitle(&instance_, (Title.has_value() ? &Title__str :
nullptr));
9626uint8_t AdditionalContent::Count()
const
9628 assert(state_ == DiscordObjectState::Owned);
9629 uint8_t returnValue__;
9630 returnValue__ = Discord_AdditionalContent_Count(&instance_);
9631 return returnValue__;
9633void AdditionalContent::SetCount(uint8_t Count)
9635 assert(state_ == DiscordObjectState::Owned);
9636 Discord_AdditionalContent_SetCount(&instance_, Count);
9638const MessageHandle MessageHandle::nullobj{{}, DiscordObjectState::Invalid};
9639MessageHandle::~MessageHandle()
9641 if (state_ == DiscordObjectState::Owned) {
9643 state_ = DiscordObjectState::Invalid;
9646MessageHandle::MessageHandle(MessageHandle&& other) noexcept
9647 : instance_(other.instance_)
9648 , state_(other.state_)
9650 other.state_ = DiscordObjectState::Invalid;
9652MessageHandle& MessageHandle::operator=(MessageHandle&& other)
noexcept
9654 if (
this != &other) {
9655 if (state_ == DiscordObjectState::Owned) {
9658 instance_ = other.instance_;
9659 state_ = other.state_;
9660 other.state_ = DiscordObjectState::Invalid;
9664MessageHandle::MessageHandle(
const MessageHandle& other)
9669 Discord_MessageHandle_Clone(&instance_, other.instance());
9671 state_ = DiscordObjectState::Owned;
9674MessageHandle& MessageHandle::operator=(
const MessageHandle& other)
9676 if (
this != &other) {
9677 if (state_ == DiscordObjectState::Owned) {
9679 state_ = DiscordObjectState::Invalid;
9681 if (other.state_ == DiscordObjectState::Owned) {
9682 Discord_MessageHandle_Clone(&instance_, other.instance());
9684 state_ = DiscordObjectState::Owned;
9689MessageHandle::MessageHandle(Discord_MessageHandle instance, DiscordObjectState state)
9690 : instance_(instance)
9694void MessageHandle::Drop()
9696 if (state_ != DiscordObjectState::Owned) {
9699 Discord_MessageHandle_Drop(&instance_);
9700 state_ = DiscordObjectState::Invalid;
9702std::optional<discordpp::AdditionalContent> MessageHandle::AdditionalContent()
const
9704 assert(state_ == DiscordObjectState::Owned);
9705 bool returnIsNonNull__;
9706 Discord_AdditionalContent returnValueNative__;
9707 returnIsNonNull__ = Discord_MessageHandle_AdditionalContent(&instance_, &returnValueNative__);
9708 if (!returnIsNonNull__) {
9712 return returnValue__;
9714std::optional<std::string> MessageHandle::AdditionalName()
const
9716 assert(state_ == DiscordObjectState::Owned);
9717 bool returnIsNonNull__;
9718 Discord_String returnValueNative__;
9719 returnIsNonNull__ = Discord_MessageHandle_AdditionalName(&instance_, &returnValueNative__);
9720 if (!returnIsNonNull__) {
9723 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
9724 returnValueNative__.size);
9725 Discord_Free(returnValueNative__.ptr);
9726 return returnValue__;
9728std::optional<uint64_t> MessageHandle::ApplicationId()
const
9730 assert(state_ == DiscordObjectState::Owned);
9731 bool returnIsNonNull__;
9732 uint64_t returnValue__;
9733 returnIsNonNull__ = Discord_MessageHandle_ApplicationId(&instance_, &returnValue__);
9734 if (!returnIsNonNull__) {
9735 return std::nullopt;
9737 return returnValue__;
9739std::optional<discordpp::UserHandle> MessageHandle::Author()
const
9741 assert(state_ == DiscordObjectState::Owned);
9742 bool returnIsNonNull__;
9743 Discord_UserHandle returnValueNative__;
9744 returnIsNonNull__ = Discord_MessageHandle_Author(&instance_, &returnValueNative__);
9745 if (!returnIsNonNull__) {
9749 return returnValue__;
9751uint64_t MessageHandle::AuthorId()
const
9753 assert(state_ == DiscordObjectState::Owned);
9754 uint64_t returnValue__;
9755 returnValue__ = Discord_MessageHandle_AuthorId(&instance_);
9756 return returnValue__;
9758std::optional<discordpp::ChannelHandle> MessageHandle::Channel()
const
9760 assert(state_ == DiscordObjectState::Owned);
9761 bool returnIsNonNull__;
9762 Discord_ChannelHandle returnValueNative__;
9763 returnIsNonNull__ = Discord_MessageHandle_Channel(&instance_, &returnValueNative__);
9764 if (!returnIsNonNull__) {
9768 return returnValue__;
9770uint64_t MessageHandle::ChannelId()
const
9772 assert(state_ == DiscordObjectState::Owned);
9773 uint64_t returnValue__;
9774 returnValue__ = Discord_MessageHandle_ChannelId(&instance_);
9775 return returnValue__;
9777std::string MessageHandle::Content()
const
9779 assert(state_ == DiscordObjectState::Owned);
9780 Discord_String returnValueNative__;
9781 Discord_MessageHandle_Content(&instance_, &returnValueNative__);
9782 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
9783 returnValueNative__.size);
9784 Discord_Free(returnValueNative__.ptr);
9785 return returnValue__;
9787std::optional<discordpp::DisclosureTypes> MessageHandle::DisclosureType()
const
9789 assert(state_ == DiscordObjectState::Owned);
9790 bool returnIsNonNull__;
9791 Discord_DisclosureTypes returnValueNative__;
9792 returnIsNonNull__ = Discord_MessageHandle_DisclosureType(&instance_, &returnValueNative__);
9793 if (!returnIsNonNull__) {
9797 return returnValue__;
9799uint64_t MessageHandle::EditedTimestamp()
const
9801 assert(state_ == DiscordObjectState::Owned);
9802 uint64_t returnValue__;
9803 returnValue__ = Discord_MessageHandle_EditedTimestamp(&instance_);
9804 return returnValue__;
9806uint64_t MessageHandle::Id()
const
9808 assert(state_ == DiscordObjectState::Owned);
9809 uint64_t returnValue__;
9810 returnValue__ = Discord_MessageHandle_Id(&instance_);
9811 return returnValue__;
9813std::optional<discordpp::LobbyHandle> MessageHandle::Lobby()
const
9815 assert(state_ == DiscordObjectState::Owned);
9816 bool returnIsNonNull__;
9817 Discord_LobbyHandle returnValueNative__;
9818 returnIsNonNull__ = Discord_MessageHandle_Lobby(&instance_, &returnValueNative__);
9819 if (!returnIsNonNull__) {
9823 return returnValue__;
9825std::unordered_map<std::string, std::string> MessageHandle::Metadata()
const
9827 assert(state_ == DiscordObjectState::Owned);
9828 Discord_Properties returnValueNative__;
9829 Discord_MessageHandle_Metadata(&instance_, &returnValueNative__);
9830 std::unordered_map<std::string, std::string> returnValue__ =
9831 ConvertReturnedProperties(returnValueNative__);
9832 Discord_FreeProperties(returnValueNative__);
9833 return returnValue__;
9835std::unordered_map<std::string, std::string> MessageHandle::ModerationMetadata()
const
9837 assert(state_ == DiscordObjectState::Owned);
9838 Discord_Properties returnValueNative__;
9839 Discord_MessageHandle_ModerationMetadata(&instance_, &returnValueNative__);
9840 std::unordered_map<std::string, std::string> returnValue__ =
9841 ConvertReturnedProperties(returnValueNative__);
9842 Discord_FreeProperties(returnValueNative__);
9843 return returnValue__;
9845std::string MessageHandle::RawContent()
const
9847 assert(state_ == DiscordObjectState::Owned);
9848 Discord_String returnValueNative__;
9849 Discord_MessageHandle_RawContent(&instance_, &returnValueNative__);
9850 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
9851 returnValueNative__.size);
9852 Discord_Free(returnValueNative__.ptr);
9853 return returnValue__;
9855std::optional<discordpp::UserHandle> MessageHandle::Recipient()
const
9857 assert(state_ == DiscordObjectState::Owned);
9858 bool returnIsNonNull__;
9859 Discord_UserHandle returnValueNative__;
9860 returnIsNonNull__ = Discord_MessageHandle_Recipient(&instance_, &returnValueNative__);
9861 if (!returnIsNonNull__) {
9865 return returnValue__;
9867uint64_t MessageHandle::RecipientId()
const
9869 assert(state_ == DiscordObjectState::Owned);
9870 uint64_t returnValue__;
9871 returnValue__ = Discord_MessageHandle_RecipientId(&instance_);
9872 return returnValue__;
9874bool MessageHandle::SentFromGame()
const
9876 assert(state_ == DiscordObjectState::Owned);
9878 returnValue__ = Discord_MessageHandle_SentFromGame(&instance_);
9879 return returnValue__;
9881uint64_t MessageHandle::SentTimestamp()
const
9883 assert(state_ == DiscordObjectState::Owned);
9884 uint64_t returnValue__;
9885 returnValue__ = Discord_MessageHandle_SentTimestamp(&instance_);
9886 return returnValue__;
9888const AudioDevice AudioDevice::nullobj{{}, DiscordObjectState::Invalid};
9889AudioDevice::~AudioDevice()
9891 if (state_ == DiscordObjectState::Owned) {
9893 state_ = DiscordObjectState::Invalid;
9896AudioDevice::AudioDevice(AudioDevice&& other) noexcept
9897 : instance_(other.instance_)
9898 , state_(other.state_)
9900 other.state_ = DiscordObjectState::Invalid;
9902AudioDevice& AudioDevice::operator=(AudioDevice&& other)
noexcept
9904 if (
this != &other) {
9905 if (state_ == DiscordObjectState::Owned) {
9908 instance_ = other.instance_;
9909 state_ = other.state_;
9910 other.state_ = DiscordObjectState::Invalid;
9914AudioDevice::AudioDevice(
const AudioDevice& arg0)
9919 Discord_AudioDevice_Clone(&instance_, arg0.instance());
9921 state_ = DiscordObjectState::Owned;
9924AudioDevice& AudioDevice::operator=(
const AudioDevice& arg0)
9926 if (
this != &arg0) {
9927 if (state_ == DiscordObjectState::Owned) {
9929 state_ = DiscordObjectState::Invalid;
9931 if (arg0.state_ == DiscordObjectState::Owned) {
9932 Discord_AudioDevice_Clone(&instance_, arg0.instance());
9934 state_ = DiscordObjectState::Owned;
9939AudioDevice::AudioDevice(Discord_AudioDevice instance, DiscordObjectState state)
9940 : instance_(instance)
9944void AudioDevice::Drop()
9946 if (state_ != DiscordObjectState::Owned) {
9949 Discord_AudioDevice_Drop(&instance_);
9950 state_ = DiscordObjectState::Invalid;
9954 assert(state_ == DiscordObjectState::Owned);
9956 returnValue__ = Discord_AudioDevice_Equals(&instance_, rhs.instance());
9957 return returnValue__;
9959std::string AudioDevice::Id()
const
9961 assert(state_ == DiscordObjectState::Owned);
9962 Discord_String returnValueNative__;
9963 Discord_AudioDevice_Id(&instance_, &returnValueNative__);
9964 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
9965 returnValueNative__.size);
9966 Discord_Free(returnValueNative__.ptr);
9967 return returnValue__;
9969void AudioDevice::SetId(std::string Id)
9971 assert(state_ == DiscordObjectState::Owned);
9972 Discord_String Id__str{(uint8_t*)(Id.data()), Id.size()};
9973 Discord_AudioDevice_SetId(&instance_, Id__str);
9975std::string AudioDevice::Name()
const
9977 assert(state_ == DiscordObjectState::Owned);
9978 Discord_String returnValueNative__;
9979 Discord_AudioDevice_Name(&instance_, &returnValueNative__);
9980 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
9981 returnValueNative__.size);
9982 Discord_Free(returnValueNative__.ptr);
9983 return returnValue__;
9985void AudioDevice::SetName(std::string Name)
9987 assert(state_ == DiscordObjectState::Owned);
9988 Discord_String Name__str{(uint8_t*)(
Name.data()),
Name.size()};
9989 Discord_AudioDevice_SetName(&instance_, Name__str);
9991bool AudioDevice::IsDefault()
const
9993 assert(state_ == DiscordObjectState::Owned);
9995 returnValue__ = Discord_AudioDevice_IsDefault(&instance_);
9996 return returnValue__;
9998void AudioDevice::SetIsDefault(
bool IsDefault)
10000 assert(state_ == DiscordObjectState::Owned);
10001 Discord_AudioDevice_SetIsDefault(&instance_, IsDefault);
10003const UserMessageSummary UserMessageSummary::nullobj{{}, DiscordObjectState::Invalid};
10004UserMessageSummary::~UserMessageSummary()
10006 if (state_ == DiscordObjectState::Owned) {
10008 state_ = DiscordObjectState::Invalid;
10011UserMessageSummary::UserMessageSummary(UserMessageSummary&& other) noexcept
10012 : instance_(other.instance_)
10013 , state_(other.state_)
10015 other.state_ = DiscordObjectState::Invalid;
10017UserMessageSummary& UserMessageSummary::operator=(UserMessageSummary&& other)
noexcept
10019 if (
this != &other) {
10020 if (state_ == DiscordObjectState::Owned) {
10023 instance_ = other.instance_;
10024 state_ = other.state_;
10025 other.state_ = DiscordObjectState::Invalid;
10029UserMessageSummary::UserMessageSummary(
const UserMessageSummary& arg0)
10034 Discord_UserMessageSummary_Clone(&instance_, arg0.instance());
10036 state_ = DiscordObjectState::Owned;
10039UserMessageSummary& UserMessageSummary::operator=(
const UserMessageSummary& arg0)
10041 if (
this != &arg0) {
10042 if (state_ == DiscordObjectState::Owned) {
10044 state_ = DiscordObjectState::Invalid;
10046 if (arg0.state_ == DiscordObjectState::Owned) {
10047 Discord_UserMessageSummary_Clone(&instance_, arg0.instance());
10049 state_ = DiscordObjectState::Owned;
10054UserMessageSummary::UserMessageSummary(Discord_UserMessageSummary instance,
10055 DiscordObjectState state)
10056 : instance_(instance)
10060void UserMessageSummary::Drop()
10062 if (state_ != DiscordObjectState::Owned) {
10065 Discord_UserMessageSummary_Drop(&instance_);
10066 state_ = DiscordObjectState::Invalid;
10068uint64_t UserMessageSummary::LastMessageId()
const
10070 assert(state_ == DiscordObjectState::Owned);
10071 uint64_t returnValue__;
10072 returnValue__ = Discord_UserMessageSummary_LastMessageId(&instance_);
10073 return returnValue__;
10075uint64_t UserMessageSummary::UserId()
const
10077 assert(state_ == DiscordObjectState::Owned);
10078 uint64_t returnValue__;
10079 returnValue__ = Discord_UserMessageSummary_UserId(&instance_);
10080 return returnValue__;
10082const ClientCreateOptions ClientCreateOptions::nullobj{{}, DiscordObjectState::Invalid};
10083ClientCreateOptions::~ClientCreateOptions()
10085 if (state_ == DiscordObjectState::Owned) {
10087 state_ = DiscordObjectState::Invalid;
10090ClientCreateOptions::ClientCreateOptions(ClientCreateOptions&& other) noexcept
10091 : instance_(other.instance_)
10092 , state_(other.state_)
10094 other.state_ = DiscordObjectState::Invalid;
10096ClientCreateOptions& ClientCreateOptions::operator=(ClientCreateOptions&& other)
noexcept
10098 if (
this != &other) {
10099 if (state_ == DiscordObjectState::Owned) {
10102 instance_ = other.instance_;
10103 state_ = other.state_;
10104 other.state_ = DiscordObjectState::Invalid;
10108ClientCreateOptions::ClientCreateOptions(
const ClientCreateOptions& arg0)
10113 Discord_ClientCreateOptions_Clone(&instance_, arg0.instance());
10115 state_ = DiscordObjectState::Owned;
10118ClientCreateOptions& ClientCreateOptions::operator=(
const ClientCreateOptions& arg0)
10120 if (
this != &arg0) {
10121 if (state_ == DiscordObjectState::Owned) {
10123 state_ = DiscordObjectState::Invalid;
10125 if (arg0.state_ == DiscordObjectState::Owned) {
10126 Discord_ClientCreateOptions_Clone(&instance_, arg0.instance());
10128 state_ = DiscordObjectState::Owned;
10133ClientCreateOptions::ClientCreateOptions(Discord_ClientCreateOptions instance,
10134 DiscordObjectState state)
10135 : instance_(instance)
10139ClientCreateOptions::ClientCreateOptions()
10141 assert(state_ == DiscordObjectState::Invalid);
10142 Discord_ClientCreateOptions_Init(&instance_);
10143 state_ = DiscordObjectState::Owned;
10145void ClientCreateOptions::Drop()
10147 if (state_ != DiscordObjectState::Owned) {
10150 Discord_ClientCreateOptions_Drop(&instance_);
10151 state_ = DiscordObjectState::Invalid;
10153std::string ClientCreateOptions::WebBase()
const
10155 assert(state_ == DiscordObjectState::Owned);
10156 Discord_String returnValueNative__;
10157 Discord_ClientCreateOptions_WebBase(&instance_, &returnValueNative__);
10158 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
10159 returnValueNative__.size);
10160 Discord_Free(returnValueNative__.ptr);
10161 return returnValue__;
10163void ClientCreateOptions::SetWebBase(std::string WebBase)
10165 assert(state_ == DiscordObjectState::Owned);
10166 Discord_String WebBase__str{(uint8_t*)(WebBase.data()), WebBase.size()};
10167 Discord_ClientCreateOptions_SetWebBase(&instance_, WebBase__str);
10169std::string ClientCreateOptions::ApiBase()
const
10171 assert(state_ == DiscordObjectState::Owned);
10172 Discord_String returnValueNative__;
10173 Discord_ClientCreateOptions_ApiBase(&instance_, &returnValueNative__);
10174 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
10175 returnValueNative__.size);
10176 Discord_Free(returnValueNative__.ptr);
10177 return returnValue__;
10179void ClientCreateOptions::SetApiBase(std::string ApiBase)
10181 assert(state_ == DiscordObjectState::Owned);
10182 Discord_String ApiBase__str{(uint8_t*)(ApiBase.data()), ApiBase.size()};
10183 Discord_ClientCreateOptions_SetApiBase(&instance_, ApiBase__str);
10187 assert(state_ == DiscordObjectState::Owned);
10188 Discord_AudioSystem returnValue__;
10189 returnValue__ = Discord_ClientCreateOptions_ExperimentalAudioSystem(&instance_);
10194 assert(state_ == DiscordObjectState::Owned);
10195 Discord_ClientCreateOptions_SetExperimentalAudioSystem(
10196 &instance_,
static_cast<Discord_AudioSystem
>(ExperimentalAudioSystem));
10198bool ClientCreateOptions::ExperimentalAndroidPreventCommsForBluetooth()
const
10200 assert(state_ == DiscordObjectState::Owned);
10201 bool returnValue__;
10203 Discord_ClientCreateOptions_ExperimentalAndroidPreventCommsForBluetooth(&instance_);
10204 return returnValue__;
10206void ClientCreateOptions::SetExperimentalAndroidPreventCommsForBluetooth(
10207 bool ExperimentalAndroidPreventCommsForBluetooth)
10209 assert(state_ == DiscordObjectState::Owned);
10210 Discord_ClientCreateOptions_SetExperimentalAndroidPreventCommsForBluetooth(
10211 &instance_, ExperimentalAndroidPreventCommsForBluetooth);
10213std::optional<uint64_t> ClientCreateOptions::CpuAffinityMask()
const
10215 assert(state_ == DiscordObjectState::Owned);
10216 bool returnIsNonNull__;
10217 uint64_t returnValue__;
10218 returnIsNonNull__ = Discord_ClientCreateOptions_CpuAffinityMask(&instance_, &returnValue__);
10219 if (!returnIsNonNull__) {
10220 return std::nullopt;
10222 return returnValue__;
10224void ClientCreateOptions::SetCpuAffinityMask(std::optional<uint64_t> CpuAffinityMask)
10226 assert(state_ == DiscordObjectState::Owned);
10227 Discord_ClientCreateOptions_SetCpuAffinityMask(
10228 &instance_, (CpuAffinityMask.has_value() ? &*CpuAffinityMask :
nullptr));
10230const Client Client::nullobj{{}, DiscordObjectState::Invalid};
10233 if (state_ == DiscordObjectState::Owned) {
10235 state_ = DiscordObjectState::Invalid;
10238Client::Client(Client&& other) noexcept
10239 : instance_(other.instance_)
10240 , state_(other.state_)
10242 other.state_ = DiscordObjectState::Invalid;
10244Client& Client::operator=(Client&& other)
noexcept
10246 if (
this != &other) {
10247 if (state_ == DiscordObjectState::Owned) {
10250 instance_ = other.instance_;
10251 state_ = other.state_;
10252 other.state_ = DiscordObjectState::Invalid;
10256Client::Client(Discord_Client instance, DiscordObjectState state)
10257 : instance_(instance)
10263 assert(state_ == DiscordObjectState::Invalid);
10264 Discord_Client_Init(&instance_);
10265 state_ = DiscordObjectState::Owned;
10267Client::Client(std::string apiBase, std::string webBase)
10269 assert(state_ == DiscordObjectState::Invalid);
10270 Discord_String apiBase__str{(uint8_t*)(apiBase.data()), apiBase.size()};
10271 Discord_String webBase__str{(uint8_t*)(webBase.data()), webBase.size()};
10272 Discord_Client_InitWithBases(&instance_, apiBase__str, webBase__str);
10273 state_ = DiscordObjectState::Owned;
10277 assert(state_ == DiscordObjectState::Invalid);
10278 Discord_Client_InitWithOptions(&instance_, options.instance());
10279 state_ = DiscordObjectState::Owned;
10283 if (state_ != DiscordObjectState::Owned) {
10286 Discord_Client_Drop(&instance_);
10287 state_ = DiscordObjectState::Invalid;
10291 Discord_String returnValueNative__;
10292 Discord_Client_ErrorToString(
static_cast<Discord_Client_Error
>(type), &returnValueNative__);
10293 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
10294 returnValueNative__.size);
10295 Discord_Free(returnValueNative__.ptr);
10296 return returnValue__;
10298uint64_t Client::GetApplicationId()
10300 assert(state_ == DiscordObjectState::Owned);
10301 uint64_t returnValue__;
10302 returnValue__ = Discord_Client_GetApplicationId(&instance_);
10303 return returnValue__;
10307 assert(state_ == DiscordObjectState::Owned);
10308 Discord_UserHandle returnValueNative__{};
10309 Discord_Client_GetCurrentUser(&instance_, &returnValueNative__);
10311 return returnValue__;
10313std::string Client::GetDefaultAudioDeviceId()
10315 Discord_String returnValueNative__;
10316 Discord_Client_GetDefaultAudioDeviceId(&returnValueNative__);
10317 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
10318 returnValueNative__.size);
10319 Discord_Free(returnValueNative__.ptr);
10320 return returnValue__;
10322std::string Client::GetDefaultCommunicationScopes()
10324 Discord_String returnValueNative__;
10325 Discord_Client_GetDefaultCommunicationScopes(&returnValueNative__);
10326 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
10327 returnValueNative__.size);
10328 Discord_Free(returnValueNative__.ptr);
10329 return returnValue__;
10331std::string Client::GetDefaultPresenceScopes()
10333 Discord_String returnValueNative__;
10334 Discord_Client_GetDefaultPresenceScopes(&returnValueNative__);
10335 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
10336 returnValueNative__.size);
10337 Discord_Free(returnValueNative__.ptr);
10338 return returnValue__;
10340std::string Client::GetVersionHash()
10342 Discord_String returnValueNative__;
10343 Discord_Client_GetVersionHash(&returnValueNative__);
10344 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
10345 returnValueNative__.size);
10346 Discord_Free(returnValueNative__.ptr);
10347 return returnValue__;
10349int32_t Client::GetVersionMajor()
10351 int32_t returnValue__;
10352 returnValue__ = Discord_Client_GetVersionMajor();
10353 return returnValue__;
10355int32_t Client::GetVersionMinor()
10357 int32_t returnValue__;
10358 returnValue__ = Discord_Client_GetVersionMinor();
10359 return returnValue__;
10361int32_t Client::GetVersionPatch()
10363 int32_t returnValue__;
10364 returnValue__ = Discord_Client_GetVersionPatch();
10365 return returnValue__;
10367void Client::SetHttpRequestTimeout(int32_t httpTimeoutInMilliseconds)
10369 assert(state_ == DiscordObjectState::Owned);
10370 Discord_Client_SetHttpRequestTimeout(&instance_, httpTimeoutInMilliseconds);
10374 Discord_String returnValueNative__;
10375 Discord_Client_StatusToString(
static_cast<Discord_Client_Status
>(type), &returnValueNative__);
10376 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
10377 returnValueNative__.size);
10378 Discord_Free(returnValueNative__.ptr);
10379 return returnValue__;
10383 Discord_String returnValueNative__;
10384 Discord_Client_ThreadToString(
static_cast<Discord_Client_Thread
>(type), &returnValueNative__);
10385 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
10386 returnValueNative__.size);
10387 Discord_Free(returnValueNative__.ptr);
10388 return returnValue__;
10392 assert(state_ == DiscordObjectState::Owned);
10393 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
10394 auto callback__userData =
new Tcallback__UserData(callback);
10395 Discord_Client_EndCallCallback callback__native = [](
void* userData__) {
10396 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
10397 userData__typed->delegate();
10399 Discord_Client_EndCall(
10400 &instance_, channelId, callback__native, Tcallback__UserData::Free, callback__userData);
10404 assert(state_ == DiscordObjectState::Owned);
10405 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
10406 auto callback__userData =
new Tcallback__UserData(callback);
10407 Discord_Client_EndCallsCallback callback__native = [](
void* userData__) {
10408 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
10409 userData__typed->delegate();
10411 Discord_Client_EndCalls(
10412 &instance_, callback__native, Tcallback__UserData::Free, callback__userData);
10416 assert(state_ == DiscordObjectState::Owned);
10417 bool returnIsNonNull__;
10418 Discord_Call returnValueNative__{};
10419 returnIsNonNull__ = Discord_Client_GetCall(&instance_, channelId, &returnValueNative__);
10421 returnValueNative__,
10422 returnIsNonNull__ ? DiscordObjectState::Owned : DiscordObjectState::Invalid);
10423 return returnValue__;
10425std::vector<discordpp::Call> Client::GetCalls()
10427 assert(state_ == DiscordObjectState::Owned);
10428 Discord_CallSpan returnValueNative__;
10429 Discord_Client_GetCalls(&instance_, &returnValueNative__);
10430 std::vector<discordpp::Call> returnValue__;
10431 returnValue__.reserve(returnValueNative__.size);
10432 for (
size_t i__ = 0; i__ < returnValueNative__.size; ++i__) {
10433 returnValue__.emplace_back(returnValueNative__.ptr[i__], DiscordObjectState::Owned);
10435 Discord_Free(returnValueNative__.ptr);
10436 return returnValue__;
10440 assert(state_ == DiscordObjectState::Owned);
10441 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10442 auto cb__userData =
new Tcb__UserData(cb);
10443 Discord_Client_GetCurrentInputDeviceCallback cb__native = [](
auto device,
void* userData__) {
10444 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10446 userData__typed->delegate(std::move(device__obj));
10448 Discord_Client_GetCurrentInputDevice(&instance_, cb__native, Tcb__UserData::Free, cb__userData);
10452 assert(state_ == DiscordObjectState::Owned);
10453 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10454 auto cb__userData =
new Tcb__UserData(cb);
10455 Discord_Client_GetCurrentOutputDeviceCallback cb__native = [](
auto device,
void* userData__) {
10456 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10458 userData__typed->delegate(std::move(device__obj));
10460 Discord_Client_GetCurrentOutputDevice(
10461 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
10465 assert(state_ == DiscordObjectState::Owned);
10466 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10467 auto cb__userData =
new Tcb__UserData(cb);
10468 Discord_Client_GetInputDevicesCallback cb__native = [](
auto devices,
void* userData__) {
10469 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10470 std::vector<discordpp::AudioDevice> devices__vec;
10471 devices__vec.reserve(devices.size);
10472 for (
size_t i__ = 0; i__ < devices.size; ++i__) {
10473 devices__vec.emplace_back(devices.ptr[i__], DiscordObjectState::Owned);
10475 Discord_Free(devices.ptr);
10476 userData__typed->delegate(std::move(devices__vec));
10478 Discord_Client_GetInputDevices(&instance_, cb__native, Tcb__UserData::Free, cb__userData);
10480float Client::GetInputVolume()
10482 assert(state_ == DiscordObjectState::Owned);
10483 float returnValue__;
10484 returnValue__ = Discord_Client_GetInputVolume(&instance_);
10485 return returnValue__;
10489 assert(state_ == DiscordObjectState::Owned);
10490 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10491 auto cb__userData =
new Tcb__UserData(cb);
10492 Discord_Client_GetOutputDevicesCallback cb__native = [](
auto devices,
void* userData__) {
10493 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10494 std::vector<discordpp::AudioDevice> devices__vec;
10495 devices__vec.reserve(devices.size);
10496 for (
size_t i__ = 0; i__ < devices.size; ++i__) {
10497 devices__vec.emplace_back(devices.ptr[i__], DiscordObjectState::Owned);
10499 Discord_Free(devices.ptr);
10500 userData__typed->delegate(std::move(devices__vec));
10502 Discord_Client_GetOutputDevices(&instance_, cb__native, Tcb__UserData::Free, cb__userData);
10504float Client::GetOutputVolume()
10506 assert(state_ == DiscordObjectState::Owned);
10507 float returnValue__;
10508 returnValue__ = Discord_Client_GetOutputVolume(&instance_);
10509 return returnValue__;
10511bool Client::GetSelfDeafAll()
const
10513 assert(state_ == DiscordObjectState::Owned);
10514 bool returnValue__;
10515 returnValue__ = Discord_Client_GetSelfDeafAll(&instance_);
10516 return returnValue__;
10518bool Client::GetSelfMuteAll()
const
10520 assert(state_ == DiscordObjectState::Owned);
10521 bool returnValue__;
10522 returnValue__ = Discord_Client_GetSelfMuteAll(&instance_);
10523 return returnValue__;
10525void Client::SetAecDump(
bool on)
10527 assert(state_ == DiscordObjectState::Owned);
10528 Discord_Client_SetAecDump(&instance_, on);
10530void Client::SetAutomaticGainControl(
bool on)
10532 assert(state_ == DiscordObjectState::Owned);
10533 Discord_Client_SetAutomaticGainControl(&instance_, on);
10537 assert(state_ == DiscordObjectState::Owned);
10538 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
10539 auto callback__userData =
new Tcallback__UserData(callback);
10540 Discord_Client_DeviceChangeCallback callback__native =
10541 [](
auto inputDevices,
auto outputDevices,
void* userData__) {
10542 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
10543 std::vector<discordpp::AudioDevice> inputDevices__vec;
10544 inputDevices__vec.reserve(inputDevices.size);
10545 for (
size_t i__ = 0; i__ < inputDevices.size; ++i__) {
10546 inputDevices__vec.emplace_back(inputDevices.ptr[i__], DiscordObjectState::Owned);
10548 Discord_Free(inputDevices.ptr);
10549 std::vector<discordpp::AudioDevice> outputDevices__vec;
10550 outputDevices__vec.reserve(outputDevices.size);
10551 for (
size_t i__ = 0; i__ < outputDevices.size; ++i__) {
10552 outputDevices__vec.emplace_back(outputDevices.ptr[i__], DiscordObjectState::Owned);
10554 Discord_Free(outputDevices.ptr);
10555 userData__typed->delegate(std::move(inputDevices__vec), std::move(outputDevices__vec));
10557 Discord_Client_SetDeviceChangeCallback(
10558 &instance_, callback__native, Tcallback__UserData::Free, callback__userData);
10560void Client::SetEchoCancellation(
bool on)
10562 assert(state_ == DiscordObjectState::Owned);
10563 Discord_Client_SetEchoCancellation(&instance_, on);
10565void Client::SetEngineManagedAudioSession(
bool isEngineManaged)
10567 assert(state_ == DiscordObjectState::Owned);
10568 Discord_Client_SetEngineManagedAudioSession(&instance_, isEngineManaged);
10572 assert(state_ == DiscordObjectState::Owned);
10573 Discord_String deviceId__str{(uint8_t*)(deviceId.data()), deviceId.size()};
10574 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10575 auto cb__userData =
new Tcb__UserData(cb);
10576 Discord_Client_SetInputDeviceCallback cb__native = [](
auto result,
void* userData__) {
10577 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10579 userData__typed->delegate(std::move(result__obj));
10581 Discord_Client_SetInputDevice(
10582 &instance_, deviceId__str, cb__native, Tcb__UserData::Free, cb__userData);
10584void Client::SetInputVolume(
float inputVolume)
10586 assert(state_ == DiscordObjectState::Owned);
10587 Discord_Client_SetInputVolume(&instance_, inputVolume);
10591 assert(state_ == DiscordObjectState::Owned);
10592 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
10593 auto callback__userData =
new Tcallback__UserData(callback);
10594 Discord_Client_NoAudioInputCallback callback__native = [](
auto inputDetected,
10595 void* userData__) {
10596 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
10597 userData__typed->delegate(inputDetected);
10599 Discord_Client_SetNoAudioInputCallback(
10600 &instance_, callback__native, Tcallback__UserData::Free, callback__userData);
10602void Client::SetNoAudioInputThreshold(
float dBFSThreshold)
10604 assert(state_ == DiscordObjectState::Owned);
10605 Discord_Client_SetNoAudioInputThreshold(&instance_, dBFSThreshold);
10607void Client::SetNoiseCancellation(
bool on)
10609 assert(state_ == DiscordObjectState::Owned);
10610 Discord_Client_SetNoiseCancellation(&instance_, on);
10612void Client::SetNoiseSuppression(
bool on)
10614 assert(state_ == DiscordObjectState::Owned);
10615 Discord_Client_SetNoiseSuppression(&instance_, on);
10617void Client::SetOpusHardwareCoding(
bool encode,
bool decode)
10619 assert(state_ == DiscordObjectState::Owned);
10620 Discord_Client_SetOpusHardwareCoding(&instance_, encode, decode);
10624 assert(state_ == DiscordObjectState::Owned);
10625 Discord_String deviceId__str{(uint8_t*)(deviceId.data()), deviceId.size()};
10626 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10627 auto cb__userData =
new Tcb__UserData(cb);
10628 Discord_Client_SetOutputDeviceCallback cb__native = [](
auto result,
void* userData__) {
10629 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10631 userData__typed->delegate(std::move(result__obj));
10633 Discord_Client_SetOutputDevice(
10634 &instance_, deviceId__str, cb__native, Tcb__UserData::Free, cb__userData);
10636void Client::SetOutputVolume(
float outputVolume)
10638 assert(state_ == DiscordObjectState::Owned);
10639 Discord_Client_SetOutputVolume(&instance_, outputVolume);
10641void Client::SetSelfDeafAll(
bool deaf)
10643 assert(state_ == DiscordObjectState::Owned);
10644 Discord_Client_SetSelfDeafAll(&instance_, deaf);
10646void Client::SetSelfMuteAll(
bool mute)
10648 assert(state_ == DiscordObjectState::Owned);
10649 Discord_Client_SetSelfMuteAll(&instance_, mute);
10651bool Client::SetSpeakerMode(
bool speakerMode)
10653 assert(state_ == DiscordObjectState::Owned);
10654 bool returnValue__;
10655 returnValue__ = Discord_Client_SetSpeakerMode(&instance_, speakerMode);
10656 return returnValue__;
10660 assert(state_ == DiscordObjectState::Owned);
10661 Discord_Client_SetThreadPriority(
10662 &instance_,
static_cast<Discord_Client_Thread
>(thread), priority);
10664void Client::SetVoiceParticipantChangedCallback(
10667 assert(state_ == DiscordObjectState::Owned);
10668 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10669 auto cb__userData =
new Tcb__UserData(cb);
10670 Discord_Client_VoiceParticipantChangedCallback cb__native =
10671 [](
auto lobbyId,
auto memberId,
auto added,
void* userData__) {
10672 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10673 userData__typed->delegate(lobbyId, memberId, added);
10675 Discord_Client_SetVoiceParticipantChangedCallback(
10676 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
10678bool Client::ShowAudioRoutePicker()
10680 assert(state_ == DiscordObjectState::Owned);
10681 bool returnValue__;
10682 returnValue__ = Discord_Client_ShowAudioRoutePicker(&instance_);
10683 return returnValue__;
10687 assert(state_ == DiscordObjectState::Owned);
10688 bool returnIsNonNull__;
10689 Discord_Call returnValueNative__{};
10690 returnIsNonNull__ = Discord_Client_StartCall(&instance_, channelId, &returnValueNative__);
10692 returnValueNative__,
10693 returnIsNonNull__ ? DiscordObjectState::Owned : DiscordObjectState::Invalid);
10694 return returnValue__;
10701 assert(state_ == DiscordObjectState::Owned);
10702 bool returnIsNonNull__;
10703 Discord_Call returnValueNative__{};
10704 using TreceivedCb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(receivedCb)>>;
10705 auto receivedCb__userData =
new TreceivedCb__UserData(receivedCb);
10706 Discord_Client_UserAudioReceivedCallback receivedCb__native = [](
auto userId,
10708 auto samplesPerChannel,
10711 auto outShouldMute,
10712 void* userData__) {
10713 auto userData__typed =
static_cast<TreceivedCb__UserData*
>(userData__);
10714 userData__typed->delegate(
10715 userId, data, samplesPerChannel, sampleRate, channels, *outShouldMute);
10717 using TcapturedCb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(capturedCb)>>;
10718 auto capturedCb__userData =
new TcapturedCb__UserData(capturedCb);
10719 Discord_Client_UserAudioCapturedCallback capturedCb__native =
10720 [](
auto data,
auto samplesPerChannel,
auto sampleRate,
auto channels,
void* userData__) {
10721 auto userData__typed =
static_cast<TcapturedCb__UserData*
>(userData__);
10722 userData__typed->delegate(data, samplesPerChannel, sampleRate, channels);
10724 returnIsNonNull__ = Discord_Client_StartCallWithAudioCallbacks(&instance_,
10726 receivedCb__native,
10727 TreceivedCb__UserData::Free,
10728 receivedCb__userData,
10729 capturedCb__native,
10730 TcapturedCb__UserData::Free,
10731 capturedCb__userData,
10732 &returnValueNative__);
10734 returnValueNative__,
10735 returnIsNonNull__ ? DiscordObjectState::Owned : DiscordObjectState::Invalid);
10736 return returnValue__;
10738void Client::AbortAuthorize()
10740 assert(state_ == DiscordObjectState::Owned);
10741 Discord_Client_AbortAuthorize(&instance_);
10743void Client::AbortGetTokenFromDevice()
10745 assert(state_ == DiscordObjectState::Owned);
10746 Discord_Client_AbortGetTokenFromDevice(&instance_);
10751 assert(state_ == DiscordObjectState::Owned);
10752 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
10753 auto callback__userData =
new Tcallback__UserData(callback);
10754 Discord_Client_AuthorizationCallback callback__native =
10755 [](
auto result,
auto code,
auto redirectUri,
void* userData__) {
10756 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
10758 std::string code__str(
reinterpret_cast<char*
>(code.ptr), code.size);
10759 std::string redirectUri__str(
reinterpret_cast<char*
>(redirectUri.ptr), redirectUri.size);
10760 userData__typed->delegate(
10761 std::move(result__obj), std::move(code__str), std::move(redirectUri__str));
10762 Discord_Free(redirectUri.ptr);
10763 Discord_Free(code.ptr);
10765 Discord_Client_Authorize(
10766 &instance_, args.instance(), callback__native, Tcallback__UserData::Free, callback__userData);
10768void Client::CloseAuthorizeDeviceScreen()
10770 assert(state_ == DiscordObjectState::Owned);
10771 Discord_Client_CloseAuthorizeDeviceScreen(&instance_);
10775 assert(state_ == DiscordObjectState::Owned);
10776 Discord_AuthorizationCodeVerifier returnValueNative__{};
10777 Discord_Client_CreateAuthorizationCodeVerifier(&instance_, &returnValueNative__);
10779 DiscordObjectState::Owned);
10780 return returnValue__;
10782void Client::ExchangeChildToken(std::string
const& parentApplicationToken,
10783 uint64_t childApplicationId,
10786 assert(state_ == DiscordObjectState::Owned);
10787 Discord_String parentApplicationToken__str{(uint8_t*)(parentApplicationToken.data()),
10788 parentApplicationToken.size()};
10789 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
10790 auto callback__userData =
new Tcallback__UserData(callback);
10791 Discord_Client_ExchangeChildTokenCallback callback__native = [](
auto result,
10796 void* userData__) {
10797 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
10799 std::string accessToken__str(
reinterpret_cast<char*
>(accessToken.ptr), accessToken.size);
10800 std::string scopes__str(
reinterpret_cast<char*
>(scopes.ptr), scopes.size);
10801 userData__typed->delegate(std::move(result__obj),
10802 std::move(accessToken__str),
10805 std::move(scopes__str));
10806 Discord_Free(scopes.ptr);
10807 Discord_Free(accessToken.ptr);
10809 Discord_Client_ExchangeChildToken(&instance_,
10810 parentApplicationToken__str,
10811 childApplicationId,
10813 Tcallback__UserData::Free,
10814 callback__userData);
10817 std::string
const& token,
10820 assert(state_ == DiscordObjectState::Owned);
10821 Discord_String token__str{(uint8_t*)(token.data()), token.size()};
10822 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
10823 auto callback__userData =
new Tcallback__UserData(callback);
10824 Discord_Client_FetchCurrentUserCallback callback__native =
10825 [](
auto result,
auto id,
auto name,
void* userData__) {
10826 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
10828 std::string name__str(
reinterpret_cast<char*
>(name.ptr), name.size);
10829 userData__typed->delegate(std::move(result__obj),
id, std::move(name__str));
10830 Discord_Free(name.ptr);
10832 Discord_Client_FetchCurrentUser(&instance_,
10833 static_cast<Discord_AuthorizationTokenType
>(tokenType),
10836 Tcallback__UserData::Free,
10837 callback__userData);
10839void Client::GetProvisionalToken(uint64_t applicationId,
10841 std::string
const& externalAuthToken,
10844 assert(state_ == DiscordObjectState::Owned);
10845 Discord_String externalAuthToken__str{(uint8_t*)(externalAuthToken.data()),
10846 externalAuthToken.size()};
10847 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
10848 auto callback__userData =
new Tcallback__UserData(callback);
10849 Discord_Client_TokenExchangeCallback callback__native = [](
auto result,
10855 void* userData__) {
10856 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
10858 std::string accessToken__str(
reinterpret_cast<char*
>(accessToken.ptr), accessToken.size);
10859 std::string refreshToken__str(
reinterpret_cast<char*
>(refreshToken.ptr), refreshToken.size);
10860 std::string scopes__str(
reinterpret_cast<char*
>(scopes.ptr), scopes.size);
10861 userData__typed->delegate(std::move(result__obj),
10862 std::move(accessToken__str),
10863 std::move(refreshToken__str),
10866 std::move(scopes__str));
10867 Discord_Free(scopes.ptr);
10868 Discord_Free(refreshToken.ptr);
10869 Discord_Free(accessToken.ptr);
10871 Discord_Client_GetProvisionalToken(
10874 static_cast<Discord_AuthenticationExternalAuthType
>(externalAuthType),
10875 externalAuthToken__str,
10877 Tcallback__UserData::Free,
10878 callback__userData);
10880void Client::GetToken(uint64_t applicationId,
10881 std::string
const& code,
10882 std::string
const& codeVerifier,
10883 std::string
const& redirectUri,
10886 assert(state_ == DiscordObjectState::Owned);
10887 Discord_String code__str{(uint8_t*)(code.data()), code.size()};
10888 Discord_String codeVerifier__str{(uint8_t*)(codeVerifier.data()), codeVerifier.size()};
10889 Discord_String redirectUri__str{(uint8_t*)(redirectUri.data()), redirectUri.size()};
10890 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
10891 auto callback__userData =
new Tcallback__UserData(callback);
10892 Discord_Client_TokenExchangeCallback callback__native = [](
auto result,
10898 void* userData__) {
10899 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
10901 std::string accessToken__str(
reinterpret_cast<char*
>(accessToken.ptr), accessToken.size);
10902 std::string refreshToken__str(
reinterpret_cast<char*
>(refreshToken.ptr), refreshToken.size);
10903 std::string scopes__str(
reinterpret_cast<char*
>(scopes.ptr), scopes.size);
10904 userData__typed->delegate(std::move(result__obj),
10905 std::move(accessToken__str),
10906 std::move(refreshToken__str),
10909 std::move(scopes__str));
10910 Discord_Free(scopes.ptr);
10911 Discord_Free(refreshToken.ptr);
10912 Discord_Free(accessToken.ptr);
10914 Discord_Client_GetToken(&instance_,
10920 Tcallback__UserData::Free,
10921 callback__userData);
10926 assert(state_ == DiscordObjectState::Owned);
10927 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
10928 auto callback__userData =
new Tcallback__UserData(callback);
10929 Discord_Client_TokenExchangeCallback callback__native = [](
auto result,
10935 void* userData__) {
10936 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
10938 std::string accessToken__str(
reinterpret_cast<char*
>(accessToken.ptr), accessToken.size);
10939 std::string refreshToken__str(
reinterpret_cast<char*
>(refreshToken.ptr), refreshToken.size);
10940 std::string scopes__str(
reinterpret_cast<char*
>(scopes.ptr), scopes.size);
10941 userData__typed->delegate(std::move(result__obj),
10942 std::move(accessToken__str),
10943 std::move(refreshToken__str),
10946 std::move(scopes__str));
10947 Discord_Free(scopes.ptr);
10948 Discord_Free(refreshToken.ptr);
10949 Discord_Free(accessToken.ptr);
10951 Discord_Client_GetTokenFromDevice(
10952 &instance_, args.instance(), callback__native, Tcallback__UserData::Free, callback__userData);
10954void Client::GetTokenFromDeviceProvisionalMerge(
10957 std::string
const& externalAuthToken,
10960 assert(state_ == DiscordObjectState::Owned);
10961 Discord_String externalAuthToken__str{(uint8_t*)(externalAuthToken.data()),
10962 externalAuthToken.size()};
10963 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
10964 auto callback__userData =
new Tcallback__UserData(callback);
10965 Discord_Client_TokenExchangeCallback callback__native = [](
auto result,
10971 void* userData__) {
10972 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
10974 std::string accessToken__str(
reinterpret_cast<char*
>(accessToken.ptr), accessToken.size);
10975 std::string refreshToken__str(
reinterpret_cast<char*
>(refreshToken.ptr), refreshToken.size);
10976 std::string scopes__str(
reinterpret_cast<char*
>(scopes.ptr), scopes.size);
10977 userData__typed->delegate(std::move(result__obj),
10978 std::move(accessToken__str),
10979 std::move(refreshToken__str),
10982 std::move(scopes__str));
10983 Discord_Free(scopes.ptr);
10984 Discord_Free(refreshToken.ptr);
10985 Discord_Free(accessToken.ptr);
10987 Discord_Client_GetTokenFromDeviceProvisionalMerge(
10990 static_cast<Discord_AuthenticationExternalAuthType
>(externalAuthType),
10991 externalAuthToken__str,
10993 Tcallback__UserData::Free,
10994 callback__userData);
10996void Client::GetTokenFromProvisionalMerge(
10997 uint64_t applicationId,
10998 std::string
const& code,
10999 std::string
const& codeVerifier,
11000 std::string
const& redirectUri,
11002 std::string
const& externalAuthToken,
11005 assert(state_ == DiscordObjectState::Owned);
11006 Discord_String code__str{(uint8_t*)(code.data()), code.size()};
11007 Discord_String codeVerifier__str{(uint8_t*)(codeVerifier.data()), codeVerifier.size()};
11008 Discord_String redirectUri__str{(uint8_t*)(redirectUri.data()), redirectUri.size()};
11009 Discord_String externalAuthToken__str{(uint8_t*)(externalAuthToken.data()),
11010 externalAuthToken.size()};
11011 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
11012 auto callback__userData =
new Tcallback__UserData(callback);
11013 Discord_Client_TokenExchangeCallback callback__native = [](
auto result,
11019 void* userData__) {
11020 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
11022 std::string accessToken__str(
reinterpret_cast<char*
>(accessToken.ptr), accessToken.size);
11023 std::string refreshToken__str(
reinterpret_cast<char*
>(refreshToken.ptr), refreshToken.size);
11024 std::string scopes__str(
reinterpret_cast<char*
>(scopes.ptr), scopes.size);
11025 userData__typed->delegate(std::move(result__obj),
11026 std::move(accessToken__str),
11027 std::move(refreshToken__str),
11030 std::move(scopes__str));
11031 Discord_Free(scopes.ptr);
11032 Discord_Free(refreshToken.ptr);
11033 Discord_Free(accessToken.ptr);
11035 Discord_Client_GetTokenFromProvisionalMerge(
11041 static_cast<Discord_AuthenticationExternalAuthType
>(externalAuthType),
11042 externalAuthToken__str,
11044 Tcallback__UserData::Free,
11045 callback__userData);
11047bool Client::IsAuthenticated()
11049 assert(state_ == DiscordObjectState::Owned);
11050 bool returnValue__;
11051 returnValue__ = Discord_Client_IsAuthenticated(&instance_);
11052 return returnValue__;
11054void Client::OpenAuthorizeDeviceScreen(uint64_t clientId, std::string
const& userCode)
11056 assert(state_ == DiscordObjectState::Owned);
11057 Discord_String userCode__str{(uint8_t*)(userCode.data()), userCode.size()};
11058 Discord_Client_OpenAuthorizeDeviceScreen(&instance_, clientId, userCode__str);
11060void Client::ProvisionalUserMergeCompleted(
bool success)
11062 assert(state_ == DiscordObjectState::Owned);
11063 Discord_Client_ProvisionalUserMergeCompleted(&instance_, success);
11065void Client::RefreshToken(uint64_t applicationId,
11066 std::string
const& refreshToken,
11069 assert(state_ == DiscordObjectState::Owned);
11070 Discord_String refreshToken__str{(uint8_t*)(refreshToken.data()), refreshToken.size()};
11071 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
11072 auto callback__userData =
new Tcallback__UserData(callback);
11073 Discord_Client_TokenExchangeCallback callback__native = [](
auto result,
11079 void* userData__) {
11080 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
11082 std::string accessToken__str(
reinterpret_cast<char*
>(accessToken.ptr), accessToken.size);
11083 std::string refreshToken__str(
reinterpret_cast<char*
>(refreshToken.ptr), refreshToken.size);
11084 std::string scopes__str(
reinterpret_cast<char*
>(scopes.ptr), scopes.size);
11085 userData__typed->delegate(std::move(result__obj),
11086 std::move(accessToken__str),
11087 std::move(refreshToken__str),
11090 std::move(scopes__str));
11091 Discord_Free(scopes.ptr);
11092 Discord_Free(refreshToken.ptr);
11093 Discord_Free(accessToken.ptr);
11095 Discord_Client_RefreshToken(&instance_,
11099 Tcallback__UserData::Free,
11100 callback__userData);
11104 assert(state_ == DiscordObjectState::Owned);
11105 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
11106 auto callback__userData =
new Tcallback__UserData(callback);
11107 Discord_Client_AuthorizeRequestCallback callback__native = [](
void* userData__) {
11108 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
11109 userData__typed->delegate();
11111 Discord_Client_RegisterAuthorizeRequestCallback(
11112 &instance_, callback__native, Tcallback__UserData::Free, callback__userData);
11114void Client::RemoveAuthorizeRequestCallback()
11116 assert(state_ == DiscordObjectState::Owned);
11117 Discord_Client_RemoveAuthorizeRequestCallback(&instance_);
11119void Client::RevokeToken(uint64_t applicationId,
11120 std::string
const& token,
11123 assert(state_ == DiscordObjectState::Owned);
11124 Discord_String token__str{(uint8_t*)(token.data()), token.size()};
11125 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
11126 auto callback__userData =
new Tcallback__UserData(callback);
11127 Discord_Client_RevokeTokenCallback callback__native = [](
auto result,
void* userData__) {
11128 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
11130 userData__typed->delegate(std::move(result__obj));
11132 Discord_Client_RevokeToken(&instance_,
11136 Tcallback__UserData::Free,
11137 callback__userData);
11139void Client::SetAuthorizeDeviceScreenClosedCallback(
11142 assert(state_ == DiscordObjectState::Owned);
11143 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11144 auto cb__userData =
new Tcb__UserData(cb);
11145 Discord_Client_AuthorizeDeviceScreenClosedCallback cb__native = [](
void* userData__) {
11146 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11147 userData__typed->delegate();
11149 Discord_Client_SetAuthorizeDeviceScreenClosedCallback(
11150 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11152void Client::SetGameWindowPid(int32_t pid)
11154 assert(state_ == DiscordObjectState::Owned);
11155 Discord_Client_SetGameWindowPid(&instance_, pid);
11159 assert(state_ == DiscordObjectState::Owned);
11160 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
11161 auto callback__userData =
new Tcallback__UserData(callback);
11162 Discord_Client_TokenExpirationCallback callback__native = [](
void* userData__) {
11163 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
11164 userData__typed->delegate();
11166 Discord_Client_SetTokenExpirationCallback(
11167 &instance_, callback__native, Tcallback__UserData::Free, callback__userData);
11169void Client::UnmergeIntoProvisionalAccount(
11170 uint64_t applicationId,
11172 std::string
const& externalAuthToken,
11175 assert(state_ == DiscordObjectState::Owned);
11176 Discord_String externalAuthToken__str{(uint8_t*)(externalAuthToken.data()),
11177 externalAuthToken.size()};
11178 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
11179 auto callback__userData =
new Tcallback__UserData(callback);
11180 Discord_Client_UnmergeIntoProvisionalAccountCallback callback__native = [](
auto result,
11181 void* userData__) {
11182 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
11184 userData__typed->delegate(std::move(result__obj));
11186 Discord_Client_UnmergeIntoProvisionalAccount(
11189 static_cast<Discord_AuthenticationExternalAuthType
>(externalAuthType),
11190 externalAuthToken__str,
11192 Tcallback__UserData::Free,
11193 callback__userData);
11195void Client::UpdateProvisionalAccountDisplayName(
11196 std::string
const& name,
11199 assert(state_ == DiscordObjectState::Owned);
11200 Discord_String name__str{(uint8_t*)(name.data()), name.size()};
11201 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
11202 auto callback__userData =
new Tcallback__UserData(callback);
11203 Discord_Client_UpdateProvisionalAccountDisplayNameCallback callback__native =
11204 [](
auto result,
void* userData__) {
11205 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
11207 userData__typed->delegate(std::move(result__obj));
11209 Discord_Client_UpdateProvisionalAccountDisplayName(
11210 &instance_, name__str, callback__native, Tcallback__UserData::Free, callback__userData);
11216 assert(state_ == DiscordObjectState::Owned);
11217 Discord_String token__str{(uint8_t*)(token.data()), token.size()};
11218 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
11219 auto callback__userData =
new Tcallback__UserData(callback);
11220 Discord_Client_UpdateTokenCallback callback__native = [](
auto result,
void* userData__) {
11221 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
11223 userData__typed->delegate(std::move(result__obj));
11225 Discord_Client_UpdateToken(&instance_,
11226 static_cast<Discord_AuthorizationTokenType
>(tokenType),
11229 Tcallback__UserData::Free,
11230 callback__userData);
11232bool Client::CanOpenMessageInDiscord(uint64_t messageId)
11234 assert(state_ == DiscordObjectState::Owned);
11235 bool returnValue__;
11236 returnValue__ = Discord_Client_CanOpenMessageInDiscord(&instance_, messageId);
11237 return returnValue__;
11239void Client::DeleteUserMessage(uint64_t recipientId,
11240 uint64_t messageId,
11243 assert(state_ == DiscordObjectState::Owned);
11244 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11245 auto cb__userData =
new Tcb__UserData(cb);
11246 Discord_Client_DeleteUserMessageCallback cb__native = [](
auto result,
void* userData__) {
11247 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11249 userData__typed->delegate(std::move(result__obj));
11251 Discord_Client_DeleteUserMessage(
11252 &instance_, recipientId, messageId, cb__native, Tcb__UserData::Free, cb__userData);
11254void Client::EditUserMessage(uint64_t recipientId,
11255 uint64_t messageId,
11256 std::string
const& content,
11259 assert(state_ == DiscordObjectState::Owned);
11260 Discord_String content__str{(uint8_t*)(content.data()), content.size()};
11261 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11262 auto cb__userData =
new Tcb__UserData(cb);
11263 Discord_Client_EditUserMessageCallback cb__native = [](
auto result,
void* userData__) {
11264 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11266 userData__typed->delegate(std::move(result__obj));
11268 Discord_Client_EditUserMessage(&instance_,
11273 Tcb__UserData::Free,
11276std::optional<discordpp::ChannelHandle> Client::GetChannelHandle(uint64_t channelId)
const
11278 assert(state_ == DiscordObjectState::Owned);
11279 bool returnIsNonNull__;
11280 Discord_ChannelHandle returnValueNative__;
11281 returnIsNonNull__ =
11282 Discord_Client_GetChannelHandle(&instance_, channelId, &returnValueNative__);
11283 if (!returnIsNonNull__) {
11287 return returnValue__;
11289void Client::GetLobbyMessagesWithLimit(uint64_t lobbyId,
11293 assert(state_ == DiscordObjectState::Owned);
11294 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11295 auto cb__userData =
new Tcb__UserData(cb);
11296 Discord_Client_GetLobbyMessagesCallback cb__native =
11297 [](
auto result,
auto messages,
void* userData__) {
11298 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11300 std::vector<discordpp::MessageHandle> messages__vec;
11301 messages__vec.reserve(messages.size);
11302 for (
size_t i__ = 0; i__ < messages.size; ++i__) {
11303 messages__vec.emplace_back(messages.ptr[i__], DiscordObjectState::Owned);
11305 Discord_Free(messages.ptr);
11306 userData__typed->delegate(std::move(result__obj), std::move(messages__vec));
11308 Discord_Client_GetLobbyMessagesWithLimit(
11309 &instance_, lobbyId, limit, cb__native, Tcb__UserData::Free, cb__userData);
11311std::optional<discordpp::MessageHandle> Client::GetMessageHandle(uint64_t messageId)
const
11313 assert(state_ == DiscordObjectState::Owned);
11314 bool returnIsNonNull__;
11315 Discord_MessageHandle returnValueNative__;
11316 returnIsNonNull__ =
11317 Discord_Client_GetMessageHandle(&instance_, messageId, &returnValueNative__);
11318 if (!returnIsNonNull__) {
11322 return returnValue__;
11326 assert(state_ == DiscordObjectState::Owned);
11327 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11328 auto cb__userData =
new Tcb__UserData(cb);
11329 Discord_Client_UserMessageSummariesCallback cb__native =
11330 [](
auto result,
auto summaries,
void* userData__) {
11331 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11333 std::vector<discordpp::UserMessageSummary> summaries__vec;
11334 summaries__vec.reserve(summaries.size);
11335 for (
size_t i__ = 0; i__ < summaries.size; ++i__) {
11336 summaries__vec.emplace_back(summaries.ptr[i__], DiscordObjectState::Owned);
11338 Discord_Free(summaries.ptr);
11339 userData__typed->delegate(std::move(result__obj), std::move(summaries__vec));
11341 Discord_Client_GetUserMessageSummaries(
11342 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11344void Client::GetUserMessagesWithLimit(uint64_t recipientId,
11348 assert(state_ == DiscordObjectState::Owned);
11349 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11350 auto cb__userData =
new Tcb__UserData(cb);
11351 Discord_Client_UserMessagesWithLimitCallback cb__native =
11352 [](
auto result,
auto messages,
void* userData__) {
11353 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11355 std::vector<discordpp::MessageHandle> messages__vec;
11356 messages__vec.reserve(messages.size);
11357 for (
size_t i__ = 0; i__ < messages.size; ++i__) {
11358 messages__vec.emplace_back(messages.ptr[i__], DiscordObjectState::Owned);
11360 Discord_Free(messages.ptr);
11361 userData__typed->delegate(std::move(result__obj), std::move(messages__vec));
11363 Discord_Client_GetUserMessagesWithLimit(
11364 &instance_, recipientId, limit, cb__native, Tcb__UserData::Free, cb__userData);
11366void Client::OpenMessageInDiscord(
11367 uint64_t messageId,
11371 assert(state_ == DiscordObjectState::Owned);
11372 using TprovisionalUserMergeRequiredCallback__UserData =
11373 TDelegateUserData<std::remove_reference_t<
decltype(provisionalUserMergeRequiredCallback)>>;
11374 auto provisionalUserMergeRequiredCallback__userData =
11375 new TprovisionalUserMergeRequiredCallback__UserData(provisionalUserMergeRequiredCallback);
11376 Discord_Client_ProvisionalUserMergeRequiredCallback
11377 provisionalUserMergeRequiredCallback__native = [](
void* userData__) {
11378 auto userData__typed =
11379 static_cast<TprovisionalUserMergeRequiredCallback__UserData*
>(userData__);
11380 userData__typed->delegate();
11382 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
11383 auto callback__userData =
new Tcallback__UserData(callback);
11384 Discord_Client_OpenMessageInDiscordCallback callback__native = [](
auto result,
11385 void* userData__) {
11386 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
11388 userData__typed->delegate(std::move(result__obj));
11390 Discord_Client_OpenMessageInDiscord(&instance_,
11392 provisionalUserMergeRequiredCallback__native,
11393 TprovisionalUserMergeRequiredCallback__UserData::Free,
11394 provisionalUserMergeRequiredCallback__userData,
11396 Tcallback__UserData::Free,
11397 callback__userData);
11399void Client::SendLobbyMessage(uint64_t lobbyId,
11400 std::string
const& content,
11403 assert(state_ == DiscordObjectState::Owned);
11404 Discord_String content__str{(uint8_t*)(content.data()), content.size()};
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_SendLobbyMessage(
11414 &instance_, lobbyId, content__str, cb__native, Tcb__UserData::Free, cb__userData);
11416void Client::SendLobbyMessageWithMetadata(
11418 std::string
const& content,
11419 std::unordered_map<std::string, std::string>
const& metadata,
11422 assert(state_ == DiscordObjectState::Owned);
11423 Discord_String content__str{(uint8_t*)(content.data()), content.size()};
11424 ConvertedProperties metadata__convert(metadata);
11425 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11426 auto cb__userData =
new Tcb__UserData(cb);
11427 Discord_Client_SendUserMessageCallback cb__native =
11428 [](
auto result,
auto messageId,
void* userData__) {
11429 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11431 userData__typed->delegate(std::move(result__obj), messageId);
11433 Discord_Client_SendLobbyMessageWithMetadata(&instance_,
11436 metadata__convert.Properties,
11438 Tcb__UserData::Free,
11441void Client::SendUserMessage(uint64_t recipientId,
11442 std::string
const& content,
11445 assert(state_ == DiscordObjectState::Owned);
11446 Discord_String content__str{(uint8_t*)(content.data()), content.size()};
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_SendUserMessage(
11456 &instance_, recipientId, content__str, cb__native, Tcb__UserData::Free, cb__userData);
11458void Client::SendUserMessageWithMetadata(
11459 uint64_t recipientId,
11460 std::string
const& content,
11461 std::unordered_map<std::string, std::string>
const& metadata,
11464 assert(state_ == DiscordObjectState::Owned);
11465 Discord_String content__str{(uint8_t*)(content.data()), content.size()};
11466 ConvertedProperties metadata__convert(metadata);
11467 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11468 auto cb__userData =
new Tcb__UserData(cb);
11469 Discord_Client_SendUserMessageCallback cb__native =
11470 [](
auto result,
auto messageId,
void* userData__) {
11471 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11473 userData__typed->delegate(std::move(result__obj), messageId);
11475 Discord_Client_SendUserMessageWithMetadata(&instance_,
11478 metadata__convert.Properties,
11480 Tcb__UserData::Free,
11485 assert(state_ == DiscordObjectState::Owned);
11486 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11487 auto cb__userData =
new Tcb__UserData(cb);
11488 Discord_Client_MessageCreatedCallback cb__native = [](
auto messageId,
void* userData__) {
11489 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11490 userData__typed->delegate(messageId);
11492 Discord_Client_SetMessageCreatedCallback(
11493 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11497 assert(state_ == DiscordObjectState::Owned);
11498 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11499 auto cb__userData =
new Tcb__UserData(cb);
11500 Discord_Client_MessageDeletedCallback cb__native =
11501 [](
auto messageId,
auto channelId,
void* userData__) {
11502 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11503 userData__typed->delegate(messageId, channelId);
11505 Discord_Client_SetMessageDeletedCallback(
11506 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11510 assert(state_ == DiscordObjectState::Owned);
11511 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11512 auto cb__userData =
new Tcb__UserData(cb);
11513 Discord_Client_MessageUpdatedCallback cb__native = [](
auto messageId,
void* userData__) {
11514 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11515 userData__typed->delegate(messageId);
11517 Discord_Client_SetMessageUpdatedCallback(
11518 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11520void Client::SetShowingChat(
bool showingChat)
11522 assert(state_ == DiscordObjectState::Owned);
11523 Discord_Client_SetShowingChat(&instance_, showingChat);
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_AddLogCallback(&instance_,
11541 Tcallback__UserData::Free,
11542 callback__userData,
11543 static_cast<Discord_LoggingSeverity
>(minSeverity));
11548 assert(state_ == DiscordObjectState::Owned);
11549 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
11550 auto callback__userData =
new Tcallback__UserData(callback);
11551 Discord_Client_LogCallback callback__native = [](
11552 auto message,
auto severity,
void* userData__) {
11553 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
11554 std::string message__str(
reinterpret_cast<char*
>(message.ptr), message.size);
11555 userData__typed->delegate(std::move(message__str),
11557 Discord_Free(message.ptr);
11559 Discord_Client_AddVoiceLogCallback(&instance_,
11561 Tcallback__UserData::Free,
11562 callback__userData,
11563 static_cast<Discord_LoggingSeverity
>(minSeverity));
11565void Client::Connect()
11567 assert(state_ == DiscordObjectState::Owned);
11568 Discord_Client_Connect(&instance_);
11570void Client::Disconnect()
11572 assert(state_ == DiscordObjectState::Owned);
11573 Discord_Client_Disconnect(&instance_);
11577 assert(state_ == DiscordObjectState::Owned);
11578 Discord_Client_Status returnValue__;
11579 returnValue__ = Discord_Client_GetStatus(&instance_);
11582void Client::OpenConnectedGamesSettingsInDiscord(
11585 assert(state_ == DiscordObjectState::Owned);
11586 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
11587 auto callback__userData =
new Tcallback__UserData(callback);
11588 Discord_Client_OpenConnectedGamesSettingsInDiscordCallback callback__native =
11589 [](
auto result,
void* userData__) {
11590 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
11592 userData__typed->delegate(std::move(result__obj));
11594 Discord_Client_OpenConnectedGamesSettingsInDiscord(
11595 &instance_, callback__native, Tcallback__UserData::Free, callback__userData);
11597void Client::SetApplicationId(uint64_t applicationId)
11599 assert(state_ == DiscordObjectState::Owned);
11600 Discord_Client_SetApplicationId(&instance_, applicationId);
11604 assert(state_ == DiscordObjectState::Owned);
11605 bool returnValue__;
11606 Discord_String path__str{(uint8_t*)(path.data()), path.size()};
11607 returnValue__ = Discord_Client_SetLogDir(
11608 &instance_, path__str,
static_cast<Discord_LoggingSeverity
>(minSeverity));
11609 return returnValue__;
11613 assert(state_ == DiscordObjectState::Owned);
11614 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11615 auto cb__userData =
new Tcb__UserData(cb);
11616 Discord_Client_OnStatusChanged cb__native =
11617 [](
auto status,
auto error,
auto errorDetail,
void* userData__) {
11618 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11623 Discord_Client_SetStatusChangedCallback(
11624 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11628 assert(state_ == DiscordObjectState::Owned);
11629 Discord_String path__str{(uint8_t*)(path.data()), path.size()};
11630 Discord_Client_SetVoiceLogDir(
11631 &instance_, path__str,
static_cast<Discord_LoggingSeverity
>(minSeverity));
11633void Client::CreateOrJoinLobby(std::string
const& secret,
11636 assert(state_ == DiscordObjectState::Owned);
11637 Discord_String secret__str{(uint8_t*)(secret.data()), secret.size()};
11638 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
11639 auto callback__userData =
new Tcallback__UserData(callback);
11640 Discord_Client_CreateOrJoinLobbyCallback callback__native =
11641 [](
auto result,
auto lobbyId,
void* userData__) {
11642 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
11644 userData__typed->delegate(std::move(result__obj), lobbyId);
11646 Discord_Client_CreateOrJoinLobby(
11647 &instance_, secret__str, callback__native, Tcallback__UserData::Free, callback__userData);
11649void Client::CreateOrJoinLobbyWithMetadata(
11650 std::string
const& secret,
11651 std::unordered_map<std::string, std::string>
const& lobbyMetadata,
11652 std::unordered_map<std::string, std::string>
const& memberMetadata,
11655 assert(state_ == DiscordObjectState::Owned);
11656 Discord_String secret__str{(uint8_t*)(secret.data()), secret.size()};
11657 ConvertedProperties lobbyMetadata__convert(lobbyMetadata);
11658 ConvertedProperties memberMetadata__convert(memberMetadata);
11659 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
11660 auto callback__userData =
new Tcallback__UserData(callback);
11661 Discord_Client_CreateOrJoinLobbyCallback callback__native =
11662 [](
auto result,
auto lobbyId,
void* userData__) {
11663 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
11665 userData__typed->delegate(std::move(result__obj), lobbyId);
11667 Discord_Client_CreateOrJoinLobbyWithMetadata(&instance_,
11669 lobbyMetadata__convert.Properties,
11670 memberMetadata__convert.Properties,
11672 Tcallback__UserData::Free,
11673 callback__userData);
11677 assert(state_ == DiscordObjectState::Owned);
11678 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11679 auto cb__userData =
new Tcb__UserData(cb);
11680 Discord_Client_GetGuildChannelsCallback cb__native =
11681 [](
auto result,
auto guildChannels,
void* userData__) {
11682 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11684 std::vector<discordpp::GuildChannel> guildChannels__vec;
11685 guildChannels__vec.reserve(guildChannels.size);
11686 for (
size_t i__ = 0; i__ < guildChannels.size; ++i__) {
11687 guildChannels__vec.emplace_back(guildChannels.ptr[i__], DiscordObjectState::Owned);
11689 Discord_Free(guildChannels.ptr);
11690 userData__typed->delegate(std::move(result__obj), std::move(guildChannels__vec));
11692 Discord_Client_GetGuildChannels(
11693 &instance_, guildId, cb__native, Tcb__UserData::Free, cb__userData);
11695std::optional<discordpp::LobbyHandle> Client::GetLobbyHandle(uint64_t lobbyId)
const
11697 assert(state_ == DiscordObjectState::Owned);
11698 bool returnIsNonNull__;
11699 Discord_LobbyHandle returnValueNative__;
11700 returnIsNonNull__ = Discord_Client_GetLobbyHandle(&instance_, lobbyId, &returnValueNative__);
11701 if (!returnIsNonNull__) {
11705 return returnValue__;
11707std::vector<uint64_t> Client::GetLobbyIds()
const
11709 assert(state_ == DiscordObjectState::Owned);
11710 Discord_UInt64Span returnValueNative__;
11711 Discord_Client_GetLobbyIds(&instance_, &returnValueNative__);
11712 std::vector<uint64_t> returnValue__(returnValueNative__.ptr,
11713 returnValueNative__.ptr + returnValueNative__.size);
11714 Discord_Free(returnValueNative__.ptr);
11715 return returnValue__;
11719 assert(state_ == DiscordObjectState::Owned);
11720 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11721 auto cb__userData =
new Tcb__UserData(cb);
11722 Discord_Client_GetUserGuildsCallback cb__native =
11723 [](
auto result,
auto guilds,
void* userData__) {
11724 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11726 std::vector<discordpp::GuildMinimal> guilds__vec;
11727 guilds__vec.reserve(guilds.size);
11728 for (
size_t i__ = 0; i__ < guilds.size; ++i__) {
11729 guilds__vec.emplace_back(guilds.ptr[i__], DiscordObjectState::Owned);
11731 Discord_Free(guilds.ptr);
11732 userData__typed->delegate(std::move(result__obj), std::move(guilds__vec));
11734 Discord_Client_GetUserGuilds(&instance_, cb__native, Tcb__UserData::Free, cb__userData);
11736void Client::JoinLinkedLobbyGuild(
11741 assert(state_ == DiscordObjectState::Owned);
11742 using TprovisionalUserMergeRequiredCallback__UserData =
11743 TDelegateUserData<std::remove_reference_t<
decltype(provisionalUserMergeRequiredCallback)>>;
11744 auto provisionalUserMergeRequiredCallback__userData =
11745 new TprovisionalUserMergeRequiredCallback__UserData(provisionalUserMergeRequiredCallback);
11746 Discord_Client_ProvisionalUserMergeRequiredCallback
11747 provisionalUserMergeRequiredCallback__native = [](
void* userData__) {
11748 auto userData__typed =
11749 static_cast<TprovisionalUserMergeRequiredCallback__UserData*
>(userData__);
11750 userData__typed->delegate();
11752 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
11753 auto callback__userData =
new Tcallback__UserData(callback);
11754 Discord_Client_JoinLinkedLobbyGuildCallback callback__native =
11755 [](
auto result,
auto inviteUrl,
void* userData__) {
11756 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
11758 std::string inviteUrl__str(
reinterpret_cast<char*
>(inviteUrl.ptr), inviteUrl.size);
11759 userData__typed->delegate(std::move(result__obj), std::move(inviteUrl__str));
11760 Discord_Free(inviteUrl.ptr);
11762 Discord_Client_JoinLinkedLobbyGuild(&instance_,
11764 provisionalUserMergeRequiredCallback__native,
11765 TprovisionalUserMergeRequiredCallback__UserData::Free,
11766 provisionalUserMergeRequiredCallback__userData,
11768 Tcallback__UserData::Free,
11769 callback__userData);
11773 assert(state_ == DiscordObjectState::Owned);
11774 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
11775 auto callback__userData =
new Tcallback__UserData(callback);
11776 Discord_Client_LeaveLobbyCallback callback__native = [](
auto result,
void* userData__) {
11777 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
11779 userData__typed->delegate(std::move(result__obj));
11781 Discord_Client_LeaveLobby(
11782 &instance_, lobbyId, callback__native, Tcallback__UserData::Free, callback__userData);
11784void Client::LinkChannelToLobby(uint64_t lobbyId,
11785 uint64_t channelId,
11788 assert(state_ == DiscordObjectState::Owned);
11789 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
11790 auto callback__userData =
new Tcallback__UserData(callback);
11791 Discord_Client_LinkOrUnlinkChannelCallback callback__native = [](
auto result,
11792 void* userData__) {
11793 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
11795 userData__typed->delegate(std::move(result__obj));
11797 Discord_Client_LinkChannelToLobby(&instance_,
11801 Tcallback__UserData::Free,
11802 callback__userData);
11806 assert(state_ == DiscordObjectState::Owned);
11807 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11808 auto cb__userData =
new Tcb__UserData(cb);
11809 Discord_Client_LobbyCreatedCallback cb__native = [](
auto lobbyId,
void* userData__) {
11810 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11811 userData__typed->delegate(lobbyId);
11813 Discord_Client_SetLobbyCreatedCallback(
11814 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11818 assert(state_ == DiscordObjectState::Owned);
11819 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11820 auto cb__userData =
new Tcb__UserData(cb);
11821 Discord_Client_LobbyDeletedCallback cb__native = [](
auto lobbyId,
void* userData__) {
11822 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11823 userData__typed->delegate(lobbyId);
11825 Discord_Client_SetLobbyDeletedCallback(
11826 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11830 assert(state_ == DiscordObjectState::Owned);
11831 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11832 auto cb__userData =
new Tcb__UserData(cb);
11833 Discord_Client_LobbyMemberAddedCallback cb__native =
11834 [](
auto lobbyId,
auto memberId,
void* userData__) {
11835 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11836 userData__typed->delegate(lobbyId, memberId);
11838 Discord_Client_SetLobbyMemberAddedCallback(
11839 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11843 assert(state_ == DiscordObjectState::Owned);
11844 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11845 auto cb__userData =
new Tcb__UserData(cb);
11846 Discord_Client_LobbyMemberRemovedCallback cb__native =
11847 [](
auto lobbyId,
auto memberId,
void* userData__) {
11848 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11849 userData__typed->delegate(lobbyId, memberId);
11851 Discord_Client_SetLobbyMemberRemovedCallback(
11852 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11856 assert(state_ == DiscordObjectState::Owned);
11857 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11858 auto cb__userData =
new Tcb__UserData(cb);
11859 Discord_Client_LobbyMemberUpdatedCallback cb__native =
11860 [](
auto lobbyId,
auto memberId,
void* userData__) {
11861 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11862 userData__typed->delegate(lobbyId, memberId);
11864 Discord_Client_SetLobbyMemberUpdatedCallback(
11865 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11869 assert(state_ == DiscordObjectState::Owned);
11870 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11871 auto cb__userData =
new Tcb__UserData(cb);
11872 Discord_Client_LobbyUpdatedCallback cb__native = [](
auto lobbyId,
void* userData__) {
11873 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11874 userData__typed->delegate(lobbyId);
11876 Discord_Client_SetLobbyUpdatedCallback(
11877 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11879void Client::UnlinkChannelFromLobby(uint64_t lobbyId,
11882 assert(state_ == DiscordObjectState::Owned);
11883 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
11884 auto callback__userData =
new Tcallback__UserData(callback);
11885 Discord_Client_LinkOrUnlinkChannelCallback callback__native = [](
auto result,
11886 void* userData__) {
11887 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
11889 userData__typed->delegate(std::move(result__obj));
11891 Discord_Client_UnlinkChannelFromLobby(
11892 &instance_, lobbyId, callback__native, Tcallback__UserData::Free, callback__userData);
11896 assert(state_ == DiscordObjectState::Owned);
11897 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
11898 auto callback__userData =
new Tcallback__UserData(callback);
11899 Discord_Client_IsDiscordAppInstalledCallback callback__native = [](
auto installed,
11900 void* userData__) {
11901 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
11902 userData__typed->delegate(installed);
11904 Discord_Client_IsDiscordAppInstalled(
11905 &instance_, callback__native, Tcallback__UserData::Free, callback__userData);
11910 assert(state_ == DiscordObjectState::Owned);
11911 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11912 auto cb__userData =
new Tcb__UserData(cb);
11913 Discord_Client_AcceptActivityInviteCallback cb__native =
11914 [](
auto result,
auto joinSecret,
void* userData__) {
11915 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11917 std::string joinSecret__str(
reinterpret_cast<char*
>(joinSecret.ptr), joinSecret.size);
11918 userData__typed->delegate(std::move(result__obj), std::move(joinSecret__str));
11919 Discord_Free(joinSecret.ptr);
11921 Discord_Client_AcceptActivityInvite(
11922 &instance_, invite.instance(), cb__native, Tcb__UserData::Free, cb__userData);
11924void Client::ClearRichPresence()
11926 assert(state_ == DiscordObjectState::Owned);
11927 Discord_Client_ClearRichPresence(&instance_);
11929bool Client::RegisterLaunchCommand(uint64_t applicationId, std::string command)
11931 assert(state_ == DiscordObjectState::Owned);
11932 bool returnValue__;
11933 Discord_String command__str{(uint8_t*)(command.data()), command.size()};
11934 returnValue__ = Discord_Client_RegisterLaunchCommand(&instance_, applicationId, command__str);
11935 return returnValue__;
11937bool Client::RegisterLaunchSteamApplication(uint64_t applicationId, uint32_t steamAppId)
11939 assert(state_ == DiscordObjectState::Owned);
11940 bool returnValue__;
11942 Discord_Client_RegisterLaunchSteamApplication(&instance_, applicationId, steamAppId);
11943 return returnValue__;
11945void Client::SendActivityInvite(uint64_t userId,
11946 std::string
const& content,
11949 assert(state_ == DiscordObjectState::Owned);
11950 Discord_String content__str{(uint8_t*)(content.data()), content.size()};
11951 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11952 auto cb__userData =
new Tcb__UserData(cb);
11953 Discord_Client_SendActivityInviteCallback cb__native = [](
auto result,
void* userData__) {
11954 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11956 userData__typed->delegate(std::move(result__obj));
11958 Discord_Client_SendActivityInvite(
11959 &instance_, userId, content__str, cb__native, Tcb__UserData::Free, cb__userData);
11961void Client::SendActivityJoinRequest(uint64_t userId,
11964 assert(state_ == DiscordObjectState::Owned);
11965 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11966 auto cb__userData =
new Tcb__UserData(cb);
11967 Discord_Client_SendActivityInviteCallback cb__native = [](
auto result,
void* userData__) {
11968 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11970 userData__typed->delegate(std::move(result__obj));
11972 Discord_Client_SendActivityJoinRequest(
11973 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
11978 assert(state_ == DiscordObjectState::Owned);
11979 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11980 auto cb__userData =
new Tcb__UserData(cb);
11981 Discord_Client_SendActivityInviteCallback cb__native = [](
auto result,
void* userData__) {
11982 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11984 userData__typed->delegate(std::move(result__obj));
11986 Discord_Client_SendActivityJoinRequestReply(
11987 &instance_, invite.instance(), cb__native, Tcb__UserData::Free, cb__userData);
11991 assert(state_ == DiscordObjectState::Owned);
11992 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11993 auto cb__userData =
new Tcb__UserData(cb);
11994 Discord_Client_ActivityInviteCallback cb__native = [](
auto invite,
void* userData__) {
11995 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11997 userData__typed->delegate(std::move(invite__obj));
11999 Discord_Client_SetActivityInviteCreatedCallback(
12000 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
12004 assert(state_ == DiscordObjectState::Owned);
12005 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12006 auto cb__userData =
new Tcb__UserData(cb);
12007 Discord_Client_ActivityInviteCallback cb__native = [](
auto invite,
void* userData__) {
12008 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12010 userData__typed->delegate(std::move(invite__obj));
12012 Discord_Client_SetActivityInviteUpdatedCallback(
12013 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
12017 assert(state_ == DiscordObjectState::Owned);
12018 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12019 auto cb__userData =
new Tcb__UserData(cb);
12020 Discord_Client_ActivityJoinCallback cb__native = [](
auto joinSecret,
void* userData__) {
12021 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12022 std::string joinSecret__str(
reinterpret_cast<char*
>(joinSecret.ptr), joinSecret.size);
12023 userData__typed->delegate(std::move(joinSecret__str));
12024 Discord_Free(joinSecret.ptr);
12026 Discord_Client_SetActivityJoinCallback(
12027 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
12029void Client::SetActivityJoinWithApplicationCallback(
12032 assert(state_ == DiscordObjectState::Owned);
12033 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12034 auto cb__userData =
new Tcb__UserData(cb);
12035 Discord_Client_ActivityJoinWithApplicationCallback cb__native =
12036 [](
auto applicationId,
auto joinSecret,
void* userData__) {
12037 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12038 std::string joinSecret__str(
reinterpret_cast<char*
>(joinSecret.ptr), joinSecret.size);
12039 userData__typed->delegate(applicationId, std::move(joinSecret__str));
12040 Discord_Free(joinSecret.ptr);
12042 Discord_Client_SetActivityJoinWithApplicationCallback(
12043 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
12048 assert(state_ == DiscordObjectState::Owned);
12049 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
12050 auto callback__userData =
new Tcallback__UserData(callback);
12051 Discord_Client_UpdateStatusCallback callback__native = [](
auto result,
void* userData__) {
12052 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
12054 userData__typed->delegate(std::move(result__obj));
12056 Discord_Client_SetOnlineStatus(&instance_,
12057 static_cast<Discord_StatusType
>(status),
12059 Tcallback__UserData::Free,
12060 callback__userData);
12065 assert(state_ == DiscordObjectState::Owned);
12066 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12067 auto cb__userData =
new Tcb__UserData(cb);
12068 Discord_Client_UpdateRichPresenceCallback cb__native = [](
auto result,
void* userData__) {
12069 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12071 userData__typed->delegate(std::move(result__obj));
12073 Discord_Client_UpdateRichPresence(
12074 &instance_, activity.instance(), cb__native, Tcb__UserData::Free, cb__userData);
12076void Client::AcceptDiscordFriendRequest(uint64_t userId,
12079 assert(state_ == DiscordObjectState::Owned);
12080 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12081 auto cb__userData =
new Tcb__UserData(cb);
12082 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
12083 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12085 userData__typed->delegate(std::move(result__obj));
12087 Discord_Client_AcceptDiscordFriendRequest(
12088 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
12090void Client::AcceptGameFriendRequest(uint64_t userId,
12093 assert(state_ == DiscordObjectState::Owned);
12094 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12095 auto cb__userData =
new Tcb__UserData(cb);
12096 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
12097 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12099 userData__typed->delegate(std::move(result__obj));
12101 Discord_Client_AcceptGameFriendRequest(
12102 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
12106 assert(state_ == DiscordObjectState::Owned);
12107 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12108 auto cb__userData =
new Tcb__UserData(cb);
12109 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
12110 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12112 userData__typed->delegate(std::move(result__obj));
12114 Discord_Client_BlockUser(&instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
12116void Client::CancelDiscordFriendRequest(uint64_t userId,
12119 assert(state_ == DiscordObjectState::Owned);
12120 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12121 auto cb__userData =
new Tcb__UserData(cb);
12122 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
12123 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12125 userData__typed->delegate(std::move(result__obj));
12127 Discord_Client_CancelDiscordFriendRequest(
12128 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
12130void Client::CancelGameFriendRequest(uint64_t userId,
12133 assert(state_ == DiscordObjectState::Owned);
12134 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12135 auto cb__userData =
new Tcb__UserData(cb);
12136 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
12137 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12139 userData__typed->delegate(std::move(result__obj));
12141 Discord_Client_CancelGameFriendRequest(
12142 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
12146 assert(state_ == DiscordObjectState::Owned);
12147 Discord_RelationshipHandle returnValueNative__{};
12148 Discord_Client_GetRelationshipHandle(&instance_, userId, &returnValueNative__);
12150 return returnValue__;
12152std::vector<discordpp::RelationshipHandle> Client::GetRelationships()
const
12154 assert(state_ == DiscordObjectState::Owned);
12155 Discord_RelationshipHandleSpan returnValueNative__;
12156 Discord_Client_GetRelationships(&instance_, &returnValueNative__);
12157 std::vector<discordpp::RelationshipHandle> returnValue__;
12158 returnValue__.reserve(returnValueNative__.size);
12159 for (
size_t i__ = 0; i__ < returnValueNative__.size; ++i__) {
12160 returnValue__.emplace_back(returnValueNative__.ptr[i__], DiscordObjectState::Owned);
12162 Discord_Free(returnValueNative__.ptr);
12163 return returnValue__;
12165std::vector<discordpp::RelationshipHandle> Client::GetRelationshipsByGroup(
12168 assert(state_ == DiscordObjectState::Owned);
12169 Discord_RelationshipHandleSpan returnValueNative__;
12170 Discord_Client_GetRelationshipsByGroup(
12171 &instance_,
static_cast<Discord_RelationshipGroupType
>(groupType), &returnValueNative__);
12172 std::vector<discordpp::RelationshipHandle> returnValue__;
12173 returnValue__.reserve(returnValueNative__.size);
12174 for (
size_t i__ = 0; i__ < returnValueNative__.size; ++i__) {
12175 returnValue__.emplace_back(returnValueNative__.ptr[i__], DiscordObjectState::Owned);
12177 Discord_Free(returnValueNative__.ptr);
12178 return returnValue__;
12180void Client::RejectDiscordFriendRequest(uint64_t userId,
12183 assert(state_ == DiscordObjectState::Owned);
12184 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12185 auto cb__userData =
new Tcb__UserData(cb);
12186 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
12187 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12189 userData__typed->delegate(std::move(result__obj));
12191 Discord_Client_RejectDiscordFriendRequest(
12192 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
12194void Client::RejectGameFriendRequest(uint64_t userId,
12197 assert(state_ == DiscordObjectState::Owned);
12198 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12199 auto cb__userData =
new Tcb__UserData(cb);
12200 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
12201 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12203 userData__typed->delegate(std::move(result__obj));
12205 Discord_Client_RejectGameFriendRequest(
12206 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
12208void Client::RemoveDiscordAndGameFriend(uint64_t userId,
12211 assert(state_ == DiscordObjectState::Owned);
12212 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12213 auto cb__userData =
new Tcb__UserData(cb);
12214 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
12215 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12217 userData__typed->delegate(std::move(result__obj));
12219 Discord_Client_RemoveDiscordAndGameFriend(
12220 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
12224 assert(state_ == DiscordObjectState::Owned);
12225 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12226 auto cb__userData =
new Tcb__UserData(cb);
12227 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
12228 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12230 userData__typed->delegate(std::move(result__obj));
12232 Discord_Client_RemoveGameFriend(
12233 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
12235std::vector<discordpp::UserHandle> Client::SearchFriendsByUsername(std::string searchStr)
const
12237 assert(state_ == DiscordObjectState::Owned);
12238 Discord_UserHandleSpan returnValueNative__;
12239 Discord_String searchStr__str{(uint8_t*)(searchStr.data()), searchStr.size()};
12240 Discord_Client_SearchFriendsByUsername(&instance_, searchStr__str, &returnValueNative__);
12241 std::vector<discordpp::UserHandle> returnValue__;
12242 returnValue__.reserve(returnValueNative__.size);
12243 for (
size_t i__ = 0; i__ < returnValueNative__.size; ++i__) {
12244 returnValue__.emplace_back(returnValueNative__.ptr[i__], DiscordObjectState::Owned);
12246 Discord_Free(returnValueNative__.ptr);
12247 return returnValue__;
12249void Client::SendDiscordFriendRequest(std::string
const& username,
12252 assert(state_ == DiscordObjectState::Owned);
12253 Discord_String username__str{(uint8_t*)(username.data()), username.size()};
12254 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12255 auto cb__userData =
new Tcb__UserData(cb);
12256 Discord_Client_SendFriendRequestCallback cb__native = [](
auto result,
void* userData__) {
12257 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12259 userData__typed->delegate(std::move(result__obj));
12261 Discord_Client_SendDiscordFriendRequest(
12262 &instance_, username__str, cb__native, Tcb__UserData::Free, cb__userData);
12264void Client::SendDiscordFriendRequestById(uint64_t userId,
12267 assert(state_ == DiscordObjectState::Owned);
12268 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12269 auto cb__userData =
new Tcb__UserData(cb);
12270 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
12271 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12273 userData__typed->delegate(std::move(result__obj));
12275 Discord_Client_SendDiscordFriendRequestById(
12276 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
12278void Client::SendGameFriendRequest(std::string
const& username,
12281 assert(state_ == DiscordObjectState::Owned);
12282 Discord_String username__str{(uint8_t*)(username.data()), username.size()};
12283 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12284 auto cb__userData =
new Tcb__UserData(cb);
12285 Discord_Client_SendFriendRequestCallback cb__native = [](
auto result,
void* userData__) {
12286 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12288 userData__typed->delegate(std::move(result__obj));
12290 Discord_Client_SendGameFriendRequest(
12291 &instance_, username__str, cb__native, Tcb__UserData::Free, cb__userData);
12293void Client::SendGameFriendRequestById(uint64_t userId,
12296 assert(state_ == DiscordObjectState::Owned);
12297 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12298 auto cb__userData =
new Tcb__UserData(cb);
12299 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
12300 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12302 userData__typed->delegate(std::move(result__obj));
12304 Discord_Client_SendGameFriendRequestById(
12305 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
12309 assert(state_ == DiscordObjectState::Owned);
12310 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12311 auto cb__userData =
new Tcb__UserData(cb);
12312 Discord_Client_RelationshipCreatedCallback cb__native =
12313 [](
auto userId,
auto isDiscordRelationshipUpdate,
void* userData__) {
12314 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12315 userData__typed->delegate(userId, isDiscordRelationshipUpdate);
12317 Discord_Client_SetRelationshipCreatedCallback(
12318 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
12322 assert(state_ == DiscordObjectState::Owned);
12323 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12324 auto cb__userData =
new Tcb__UserData(cb);
12325 Discord_Client_RelationshipDeletedCallback cb__native =
12326 [](
auto userId,
auto isDiscordRelationshipUpdate,
void* userData__) {
12327 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12328 userData__typed->delegate(userId, isDiscordRelationshipUpdate);
12330 Discord_Client_SetRelationshipDeletedCallback(
12331 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
12335 assert(state_ == DiscordObjectState::Owned);
12336 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12337 auto cb__userData =
new Tcb__UserData(cb);
12338 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
12339 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12341 userData__typed->delegate(std::move(result__obj));
12343 Discord_Client_UnblockUser(&instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
12345std::optional<discordpp::UserHandle> Client::GetCurrentUserV2()
const
12347 assert(state_ == DiscordObjectState::Owned);
12348 bool returnIsNonNull__;
12349 Discord_UserHandle returnValueNative__;
12350 returnIsNonNull__ = Discord_Client_GetCurrentUserV2(&instance_, &returnValueNative__);
12351 if (!returnIsNonNull__) {
12355 return returnValue__;
12357void Client::GetDiscordClientConnectedUser(
12358 uint64_t applicationId,
12361 assert(state_ == DiscordObjectState::Owned);
12362 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
12363 auto callback__userData =
new Tcallback__UserData(callback);
12364 Discord_Client_GetDiscordClientConnectedUserCallback callback__native =
12365 [](
auto result,
auto user,
void* userData__) {
12366 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
12368 std::optional<discordpp::UserHandle> user__opt{};
12372 userData__typed->delegate(std::move(result__obj), std::move(user__opt));
12374 Discord_Client_GetDiscordClientConnectedUser(
12375 &instance_, applicationId, callback__native, Tcallback__UserData::Free, callback__userData);
12377std::optional<discordpp::UserHandle> Client::GetUser(uint64_t userId)
const
12379 assert(state_ == DiscordObjectState::Owned);
12380 bool returnIsNonNull__;
12381 Discord_UserHandle returnValueNative__;
12382 returnIsNonNull__ = Discord_Client_GetUser(&instance_, userId, &returnValueNative__);
12383 if (!returnIsNonNull__) {
12387 return returnValue__;
12389void Client::SetRelationshipGroupsUpdatedCallback(
12392 assert(state_ == DiscordObjectState::Owned);
12393 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12394 auto cb__userData =
new Tcb__UserData(cb);
12395 Discord_Client_RelationshipGroupsUpdatedCallback cb__native = [](
auto userId,
12396 void* userData__) {
12397 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12398 userData__typed->delegate(userId);
12400 Discord_Client_SetRelationshipGroupsUpdatedCallback(
12401 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
12405 assert(state_ == DiscordObjectState::Owned);
12406 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12407 auto cb__userData =
new Tcb__UserData(cb);
12408 Discord_Client_UserUpdatedCallback cb__native = [](
auto userId,
void* userData__) {
12409 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12410 userData__typed->delegate(userId);
12412 Discord_Client_SetUserUpdatedCallback(
12413 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
12415const CallInfoHandle CallInfoHandle::nullobj{{}, DiscordObjectState::Invalid};
12416CallInfoHandle::~CallInfoHandle()
12418 if (state_ == DiscordObjectState::Owned) {
12420 state_ = DiscordObjectState::Invalid;
12423CallInfoHandle::CallInfoHandle(CallInfoHandle&& other) noexcept
12424 : instance_(other.instance_)
12425 , state_(other.state_)
12427 other.state_ = DiscordObjectState::Invalid;
12429CallInfoHandle& CallInfoHandle::operator=(CallInfoHandle&& other)
noexcept
12431 if (
this != &other) {
12432 if (state_ == DiscordObjectState::Owned) {
12435 instance_ = other.instance_;
12436 state_ = other.state_;
12437 other.state_ = DiscordObjectState::Invalid;
12441CallInfoHandle::CallInfoHandle(
const CallInfoHandle& other)
12446 Discord_CallInfoHandle_Clone(&instance_, other.instance());
12448 state_ = DiscordObjectState::Owned;
12451CallInfoHandle& CallInfoHandle::operator=(
const CallInfoHandle& other)
12453 if (
this != &other) {
12454 if (state_ == DiscordObjectState::Owned) {
12456 state_ = DiscordObjectState::Invalid;
12458 if (other.state_ == DiscordObjectState::Owned) {
12459 Discord_CallInfoHandle_Clone(&instance_, other.instance());
12461 state_ = DiscordObjectState::Owned;
12466CallInfoHandle::CallInfoHandle(Discord_CallInfoHandle instance, DiscordObjectState state)
12467 : instance_(instance)
12471void CallInfoHandle::Drop()
12473 if (state_ != DiscordObjectState::Owned) {
12476 Discord_CallInfoHandle_Drop(&instance_);
12477 state_ = DiscordObjectState::Invalid;
12479uint64_t CallInfoHandle::ChannelId()
const
12481 assert(state_ == DiscordObjectState::Owned);
12482 uint64_t returnValue__;
12483 returnValue__ = Discord_CallInfoHandle_ChannelId(&instance_);
12484 return returnValue__;
12486std::vector<uint64_t> CallInfoHandle::GetParticipants()
const
12488 assert(state_ == DiscordObjectState::Owned);
12489 Discord_UInt64Span returnValueNative__;
12490 Discord_CallInfoHandle_GetParticipants(&instance_, &returnValueNative__);
12491 std::vector<uint64_t> returnValue__(returnValueNative__.ptr,
12492 returnValueNative__.ptr + returnValueNative__.size);
12493 Discord_Free(returnValueNative__.ptr);
12494 return returnValue__;
12496std::optional<discordpp::VoiceStateHandle> CallInfoHandle::GetVoiceStateHandle(
12497 uint64_t userId)
const
12499 assert(state_ == DiscordObjectState::Owned);
12500 bool returnIsNonNull__;
12501 Discord_VoiceStateHandle returnValueNative__;
12502 returnIsNonNull__ =
12503 Discord_CallInfoHandle_GetVoiceStateHandle(&instance_, userId, &returnValueNative__);
12504 if (!returnIsNonNull__) {
12508 return returnValue__;
12510uint64_t CallInfoHandle::GuildId()
const
12512 assert(state_ == DiscordObjectState::Owned);
12513 uint64_t returnValue__;
12514 returnValue__ = Discord_CallInfoHandle_GuildId(&instance_);
12515 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:3133
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:3152
void SetId(std::string Id)
Setter for AudioDevice::Id.
void SetIsDefault(bool IsDefault)
Setter for AudioDevice::IsDefault.
void SetName(std::string Name)
Setter for AudioDevice::Name.
AudioDevice(const AudioDevice &arg0)
Copy constructor for AudioDevice.
Arguments to the Client::Authorize function.
Definition discordpp.h:1629
void SetIntegrationType(std::optional< discordpp::IntegrationType > IntegrationType)
Setter for AuthorizationArgs::IntegrationType.
std::optional< std::string > State() const
See https://dc.everythinginc.live/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:5224
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:5243
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:3227
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:3246
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:3307
std::function< void(discordpp::ClientResult result)> UnmergeIntoProvisionalAccountCallback
Callback function for the Client::UnmergeIntoProvisionalAccount method.
Definition discordpp.h:3487
std::function< void(std::vector< discordpp::AudioDevice > devices)> GetOutputDevicesCallback
Callback function for Client::GetOutputDevices.
Definition discordpp.h:3404
std::function< void(discordpp::ClientResult result, std::string inviteUrl)> JoinLinkedLobbyGuildCallback
Callback function for Client::JoinLinkedLobbyGuild.
Definition discordpp.h:3569
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:3532
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:3652
std::function< void(discordpp::ClientResult result)> UpdateRelationshipCallback
Callback function for most other Relationship functions such as Client::SendDiscordFriendRequestById.
Definition discordpp.h:3626
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:3491
std::function< void(bool inputDetected)> NoAudioInputCallback
Callback function for Client::SetNoAudioInputCallback.
Definition discordpp.h:3416
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:3520
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:3565
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:3582
std::function< void(std::string message, discordpp::LoggingSeverity severity)> LogCallback
Callback function invoked when a new log message is generated.
Definition discordpp.h:3541
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:3576
std::function< void(discordpp::AudioDevice device)> GetCurrentOutputDeviceCallback
Callback function for Client::GetCurrentOutputDevice.
Definition discordpp.h:3397
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:3484
std::function< void(discordpp::ClientResult result)> SetOutputDeviceCallback
Callback function for Client::SetOutputDevice.
Definition discordpp.h:3419
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:3647
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:3591
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:3428
std::function< void(discordpp::ClientResult result)> LeaveLobbyCallback
Callback function for Client::LeaveLobby.
Definition discordpp.h:3573
std::function< void(uint64_t lobbyId)> LobbyUpdatedCallback
Callback function for Client::SetLobbyUpdatedCallback.
Definition discordpp.h:3594
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:3481
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:3597
std::function< void(discordpp::ClientResult result)> UpdateRichPresenceCallback
Callback function for when Client::UpdateRichPresence completes.
Definition discordpp.h:3622
std::function< void(discordpp::ClientResult result, std::vector< discordpp::MessageHandle > messages)> UserMessagesWithLimitCallback
Callback function for Client::GetUserMessagesWithLimit.
Definition discordpp.h:3515
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:3630
std::function< void(discordpp::ClientResult result, std::vector< discordpp::MessageHandle > messages)> GetLobbyMessagesCallback
Callback function for Client::GetLobbyMessagesWithLimit.
Definition discordpp.h:3505
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:3552
std::function< void(uint64_t applicationId, std::string joinSecret)> ActivityJoinWithApplicationCallback
Callback function for Client::SetActivityJoinWithApplicationCallback.
Definition discordpp.h:3615
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:3391
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:3478
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:3600
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:3350
@ Disconnecting
Disconnecting.
Definition discordpp.h:3368
@ Connected
Connected.
Definition discordpp.h:3359
@ HttpWait
HttpWait.
Definition discordpp.h:3371
@ Reconnecting
Reconnecting.
Definition discordpp.h:3365
@ Connecting
Connecting.
Definition discordpp.h:3356
@ Ready
Ready.
Definition discordpp.h:3362
@ Disconnected
Disconnected.
Definition discordpp.h:3353
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:3463
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:3523
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:3388
std::function< void()> AuthorizeRequestCallback
Callback invoked when a user requests to initiate the authorization flow from the discord app.
Definition discordpp.h:3475
std::function< void(discordpp::ClientResult result)> EditUserMessageCallback
Callback function for Client::EditUserMessage.
Definition discordpp.h:3502
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:3413
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:3585
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:3609
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:3496
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:3579
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:3588
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:3447
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:3612
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:3605
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:3422
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:3643
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:3321
@ None
None.
Definition discordpp.h:3324
@ ConnectionCanceled
ConnectionCanceled.
Definition discordpp.h:3333
@ ConnectionFailed
ConnectionFailed.
Definition discordpp.h:3327
@ UnexpectedClose
UnexpectedClose.
Definition discordpp.h:3330
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:3528
std::function< void(discordpp::AudioDevice device)> GetCurrentInputDeviceCallback
Callback function for Client::GetCurrentInputDevice.
Definition discordpp.h:3394
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:3655
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:3535
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:3545
Thread
Represents the type of thread to control thread priority on.
Definition discordpp.h:3375
@ Client
Client.
Definition discordpp.h:3378
@ Voice
Voice.
Definition discordpp.h:3381
@ Network
Network.
Definition discordpp.h:3384
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:3538
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:3636
std::function< void(discordpp::ClientResult result)> DeleteUserMessageCallback
Callback function for Client::DeleteUserMessage.
Definition discordpp.h:3499
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:3451
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:3459
std::function< void(discordpp::ClientResult result, std::vector< discordpp::GuildChannel > guildChannels)> GetGuildChannelsCallback
Callback function for Client::GetGuildChannels.
Definition discordpp.h:3560
std::function< void(discordpp::ClientResult result)> UpdateStatusCallback
Callback function for when Client::SetOnlineStatus completes.
Definition discordpp.h:3619
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:3556
std::function< void(discordpp::ClientResult result, std::vector< discordpp::UserMessageSummary > summaries)> UserMessageSummariesCallback
Callback function for Client::GetUserMessageSummaries.
Definition discordpp.h:3510
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:3438
std::function< void(std::vector< discordpp::AudioDevice > inputDevices, std::vector< discordpp::AudioDevice > outputDevices)> DeviceChangeCallback
Callback function for Client::SetDeviceChangeCallback.
Definition discordpp.h:3408
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:3400
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:3668
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< std::string > AdditionalName() const
Returns an additional display name for this message, if one was set.
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:3204
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:5270
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