2#ifndef DISCORD_HEADER_DISCORDPP_H_
3#define DISCORD_HEADER_DISCORDPP_H_
12#include <unordered_map>
31 Discord_RunCallbacks();
632class ActivityTimestamps;
634class ActivitySecrets;
638class AuthorizationCodeChallenge;
639class AuthorizationCodeVerifier;
640class AuthorizationArgs;
641class DeviceAuthorizationArgs;
642class VoiceStateHandle;
643class VADThresholdSettings;
650class RelationshipHandle;
652class LobbyMemberHandle;
654class AdditionalContent;
657class ClientCreateOptions;
666 mutable Discord_ActivityInvite instance_{};
672 Discord_ActivityInvite* instance()
const {
return &instance_; }
764 mutable Discord_ActivityAssets instance_{};
770 Discord_ActivityAssets* instance()
const {
return &instance_; }
829 mutable Discord_ActivityTimestamps instance_{};
835 Discord_ActivityTimestamps* instance()
const {
return &instance_; }
883 mutable Discord_ActivityParty instance_{};
889 Discord_ActivityParty* instance()
const {
return &instance_; }
921 std::string
Id()
const;
945 mutable Discord_ActivitySecrets instance_{};
951 Discord_ActivitySecrets* instance()
const {
return &instance_; }
989 mutable Discord_ActivityButton instance_{};
995 Discord_ActivityButton* instance()
const {
return &instance_; }
1214 mutable Discord_Activity instance_{};
1220 Discord_Activity* instance()
const {
return &instance_; }
1273 std::optional<std::string>
State()
const;
1303 std::optional<discordpp::ActivityAssets>
Assets()
const;
1316 std::optional<discordpp::ActivityParty>
Party()
const;
1322 std::optional<discordpp::ActivitySecrets>
Secrets()
const;
1347 mutable Discord_ClientResult instance_{};
1353 Discord_ClientResult* instance()
const {
return &instance_; }
1440 mutable Discord_AuthorizationCodeChallenge instance_{};
1446 Discord_AuthorizationCodeChallenge* instance()
const {
return &instance_; }
1487 mutable Discord_AuthorizationCodeVerifier instance_{};
1493 Discord_AuthorizationCodeVerifier* instance()
const {
return &instance_; }
1532 mutable Discord_AuthorizationArgs instance_{};
1538 Discord_AuthorizationArgs* instance()
const {
return &instance_; }
1591 std::optional<std::string>
State()
const;
1599 std::optional<std::string>
Nonce()
const;
1623 mutable Discord_DeviceAuthorizationArgs instance_{};
1629 Discord_DeviceAuthorizationArgs* instance()
const {
return &instance_; }
1691 mutable Discord_VoiceStateHandle instance_{};
1697 Discord_VoiceStateHandle* instance()
const {
return &instance_; }
1733 mutable Discord_VADThresholdSettings instance_{};
1739 Discord_VADThresholdSettings* instance()
const {
return &instance_; }
1777 mutable Discord_Call instance_{};
1842 Discord_Call* instance()
const {
return &instance_; }
2004 mutable Discord_ChannelHandle instance_{};
2010 Discord_ChannelHandle* instance()
const {
return &instance_; }
2055 mutable Discord_GuildMinimal instance_{};
2061 Discord_GuildMinimal* instance()
const {
return &instance_; }
2100 mutable Discord_GuildChannel instance_{};
2106 Discord_GuildChannel* instance()
const {
return &instance_; }
2181 mutable Discord_LinkedLobby instance_{};
2187 Discord_LinkedLobby* instance()
const {
return &instance_; }
2227 mutable Discord_LinkedChannel instance_{};
2233 Discord_LinkedChannel* instance()
const {
return &instance_; }
2309 mutable Discord_RelationshipHandle instance_{};
2315 Discord_RelationshipHandle* instance()
const {
return &instance_; }
2353 std::optional<discordpp::UserHandle>
User()
const;
2368 mutable Discord_UserHandle instance_{};
2389 Discord_UserHandle* instance()
const {
return &instance_; }
2493 mutable Discord_LobbyMemberHandle instance_{};
2499 Discord_LobbyMemberHandle* instance()
const {
return &instance_; }
2542 std::unordered_map<std::string, std::string>
Metadata()
const;
2545 std::optional<discordpp::UserHandle>
User()
const;
2636 mutable Discord_LobbyHandle instance_{};
2642 Discord_LobbyHandle* instance()
const {
return &instance_; }
2693 std::unordered_map<std::string, std::string>
Metadata()
const;
2700 mutable Discord_AdditionalContent instance_{};
2706 Discord_AdditionalContent* instance()
const {
return &instance_; }
2745 std::optional<std::string>
Title()
const;
2812 mutable Discord_MessageHandle instance_{};
2818 Discord_MessageHandle* instance()
const {
return &instance_; }
2855 std::optional<discordpp::UserHandle>
Author()
const;
2861 std::optional<discordpp::ChannelHandle>
Channel()
const;
2886 std::optional<discordpp::LobbyHandle>
Lobby()
const;
2893 std::unordered_map<std::string, std::string>
Metadata()
const;
2925 mutable Discord_AudioDevice instance_{};
2931 Discord_AudioDevice* instance()
const {
return &instance_; }
2979 mutable Discord_ClientCreateOptions instance_{};
2985 Discord_ClientCreateOptions* instance()
const {
return &instance_; }
3041 mutable Discord_Client instance_{};
3133 std::function<void(std::vector<discordpp::AudioDevice> devices)>;
3137 std::function<void(std::vector<discordpp::AudioDevice> devices)>;
3141 std::function<void(std::vector<discordpp::AudioDevice> inputDevices,
3142 std::vector<discordpp::AudioDevice> outputDevices)>;
3155 std::function<void(uint64_t lobbyId, uint64_t memberId,
bool added)>;
3162 uint64_t samplesPerChannel,
3165 bool& outShouldMute)>;
3171 void(int16_t* data, uint64_t samplesPerChannel, int32_t sampleRate, uint64_t channels)>;
3185 std::string accessToken,
3188 std::string scopes)>;
3196 std::string accessToken,
3197 std::string refreshToken,
3200 std::string scopes)>;
3232 std::vector<discordpp::MessageHandle> messages)>;
3277 std::vector<discordpp::GuildChannel> guildChannels)>;
3281 std::vector<discordpp::GuildMinimal> guilds)>;
3341 std::function<void(uint64_t userId,
bool isDiscordRelationshipUpdate)>;
3348 std::function<void(uint64_t userId,
bool isDiscordRelationshipUpdate)>;
3353 std::optional<discordpp::UserHandle> user)>;
3361 Discord_Client* instance()
const {
return &instance_; }
3383 explicit Client(std::string apiBase, std::string webBase);
3605 [[deprecated(
"Calling Client::SetSpeakerMode is DEPRECATED.")]]
3799 uint64_t childApplicationId,
3808 std::string
const& token,
3846 std::string
const& externalAuthToken,
3873 std::string
const& code,
3874 std::string
const& codeVerifier,
3875 std::string
const& redirectUri,
3945 std::string
const& externalAuthToken,
3979 std::string
const& code,
3980 std::string
const& codeVerifier,
3981 std::string
const& redirectUri,
3983 std::string
const& externalAuthToken,
4019 std::string
const& refreshToken,
4035 std::string
const& token,
4081 uint64_t applicationId,
4083 std::string
const& externalAuthToken,
4092 std::string
const& name,
4126 std::string
const& content,
4179 std::string
const& content,
4189 std::string
const& content,
4190 std::unordered_map<std::string, std::string>
const& metadata,
4206 std::string
const& content,
4216 std::string
const& content,
4217 std::unordered_map<std::string, std::string>
const& metadata,
4384 std::string
const& secret,
4385 std::unordered_map<std::string, std::string>
const& lobbyMetadata,
4386 std::unordered_map<std::string, std::string>
const& memberMetadata,
4546 std::string
const& content,
4809 uint64_t applicationId,
4817 std::optional<discordpp::UserHandle>
GetUser(uint64_t userId)
const;
4837 mutable Discord_CallInfoHandle instance_{};
4843 Discord_CallInfoHandle* instance()
const {
return &instance_; }
4887 return "JoinRequest";
4917 return "CustomStatus";
4921 return "HangStatus";
4957 return "NetworkError";
4961 return "ClientNotReady";
4965 return "ClientDestroyed";
4967 return "ValidationError";
4971 return "AuthorizationFailed";
4987 return "SwitchingProtocols";
4989 return "Processing";
4991 return "EarlyHints";
4999 return "NonAuthoritativeInfo";
5003 return "ResetContent";
5005 return "PartialContent";
5007 return "MultiStatus";
5009 return "AlreadyReported";
5013 return "MultipleChoices";
5015 return "MovedPermanently";
5021 return "NotModified";
5023 return "TemporaryRedirect";
5025 return "PermanentRedirect";
5027 return "BadRequest";
5029 return "Unauthorized";
5031 return "PaymentRequired";
5037 return "MethodNotAllowed";
5039 return "NotAcceptable";
5041 return "ProxyAuthRequired";
5043 return "RequestTimeout";
5049 return "LengthRequired";
5051 return "PreconditionFailed";
5053 return "PayloadTooLarge";
5055 return "UriTooLong";
5057 return "UnsupportedMediaType";
5059 return "RangeNotSatisfiable";
5061 return "ExpectationFailed";
5063 return "MisdirectedRequest";
5065 return "UnprocessableEntity";
5069 return "FailedDependency";
5073 return "UpgradeRequired";
5075 return "PreconditionRequired";
5077 return "TooManyRequests";
5079 return "RequestHeaderFieldsTooLarge";
5081 return "InternalServerError";
5083 return "NotImplemented";
5085 return "BadGateway";
5087 return "ServiceUnavailable";
5089 return "GatewayTimeout";
5091 return "HttpVersionNotSupported";
5093 return "VariantAlsoNegotiates";
5095 return "InsufficientStorage";
5097 return "LoopDetected";
5099 return "NotExtended";
5101 return "NetworkAuthorizationRequired";
5121 return "GuildInstall";
5123 return "UserInstall";
5135 return "Attachment";
5139 return "VoiceMessage";
5169 return "SignalingConnectionFailed";
5171 return "SignalingUnexpectedClose";
5173 return "VoiceConnectionFailed";
5175 return "JoinTimeout";
5187 return "MODE_UNINIT";
5201 return "Disconnected";
5205 return "Connecting";
5207 return "SignalingConnected";
5211 return "Reconnecting";
5213 return "Disconnecting";
5227 return "GuildVoice";
5231 return "GuildCategory";
5235 return "GuildStore";
5237 return "GuildNewsThread";
5239 return "GuildPublicThread";
5241 return "GuildPrivateThread";
5243 return "GuildStageVoice";
5245 return "GuildDirectory";
5247 return "GuildForum";
5249 return "GuildMedia";
5253 return "EphemeralDm";
5269 return "PendingIncoming";
5271 return "PendingOutgoing";
5275 return "Suggestion";
5325 return "MessageDataVisibleOnDiscord";
5337 return "ConnectionFailed";
5339 return "UnexpectedClose";
5341 return "ConnectionCanceled";
5351 return "Disconnected";
5353 return "Connecting";
5359 return "Reconnecting";
5361 return "Disconnecting";
5401 return "EpicOnlineServicesAccessToken";
5403 return "EpicOnlineServicesIdToken";
5405 return "SteamSessionTicket";
5407 return "UnityServicesIdToken";
5435 return "OnlinePlayingGame";
5437 return "OnlineElsewhere";
5446#ifdef DISCORDPP_IMPLEMENTATION
5447#undef DISCORDPP_IMPLEMENTATION
5449#pragma clang diagnostic push
5450#pragma clang diagnostic ignored "-Wunused-parameter"
5453std::function<void(std::function<
void()>)> s_synchronizationContext;
5455inline bool HasSynchronizationContext()
5457 return !!s_synchronizationContext;
5460inline void PostTask(std::function<
void()> task)
5462 assert(s_synchronizationContext);
5463 s_synchronizationContext(std::move(task));
5466void SetSynchronizationContext(std::function<
void(std::function<
void()>)> executor)
5468 s_synchronizationContext = std::move(executor);
5471template <
typename T>
5472struct TDelegateUserData {
5474 TDelegateUserData(T delegate)
5475 : delegate{delegate}
5479 static void Free(
void* ptr) {
delete reinterpret_cast<TDelegateUserData*
>(ptr); }
5481 static T& Get(
void* userData)
5483 return reinterpret_cast<TDelegateUserData*
>(userData)->delegate;
5487struct ConvertedProperties {
5488 ConvertedProperties(std::unordered_map<std::string, std::string>
const& PropertyMap)
5490 Properties.size = PropertyMap.size();
5491 Properties.keys =
reinterpret_cast<Discord_String*
>(
5492 Discord_Alloc(Properties.size *
sizeof(Discord_String)));
5493 Properties.values =
reinterpret_cast<Discord_String*
>(
5494 Discord_Alloc(Properties.size *
sizeof(Discord_String)));
5496 for (
auto& pair : PropertyMap) {
5497 Properties.keys[i] = AllocateString(pair.first);
5498 Properties.values[i] = AllocateString(pair.second);
5502 ~ConvertedProperties() { Discord_FreeProperties(Properties); }
5503 Discord_Properties Properties{};
5506 Discord_String AllocateString(std::string
const& str)
5508 Discord_String result;
5509 result.ptr =
reinterpret_cast<uint8_t*
>(Discord_Alloc(str.size()));
5510 result.size = str.size();
5511 std::memcpy(result.ptr, str.data(), result.size);
5516std::unordered_map<std::string, std::string> ConvertReturnedProperties(
5517 Discord_Properties
const& Properties)
5519 std::unordered_map<std::string, std::string> result;
5520 for (
size_t i = 0; i < Properties.size; ++i) {
5521 std::string key(
reinterpret_cast<char*
>(Properties.keys[i].ptr), Properties.keys[i].size);
5522 std::string value(
reinterpret_cast<char*
>(Properties.values[i].ptr),
5523 Properties.values[i].size);
5524 result.emplace(std::move(key), std::move(value));
5529ActivityInvite::~ActivityInvite()
5537 : instance_(other.instance_)
5538 , state_(other.state_)
5544 if (
this != &other) {
5548 instance_ = other.instance_;
5549 state_ = other.state_;
5559 Discord_ActivityInvite_Clone(&instance_, rhs.instance());
5561 state_ = DiscordObjectState::Owned;
5564ActivityInvite& ActivityInvite::operator=(
const ActivityInvite& rhs)
5567 if (state_ == DiscordObjectState::Owned) {
5569 state_ = DiscordObjectState::Invalid;
5571 if (rhs.state_ == DiscordObjectState::Owned) {
5572 Discord_ActivityInvite_Clone(&instance_, rhs.instance());
5574 state_ = DiscordObjectState::Owned;
5579ActivityInvite::ActivityInvite(Discord_ActivityInvite instance, DiscordObjectState state)
5580 : instance_(instance)
5584ActivityInvite::ActivityInvite()
5586 assert(state_ == DiscordObjectState::Invalid);
5587 Discord_ActivityInvite_Init(&instance_);
5588 state_ = DiscordObjectState::Owned;
5590void ActivityInvite::Drop()
5592 if (state_ != DiscordObjectState::Owned) {
5595 Discord_ActivityInvite_Drop(&instance_);
5596 state_ = DiscordObjectState::Invalid;
5598uint64_t ActivityInvite::SenderId()
const
5600 assert(state_ == DiscordObjectState::Owned);
5601 uint64_t returnValue__;
5602 returnValue__ = Discord_ActivityInvite_SenderId(&instance_);
5603 return returnValue__;
5605void ActivityInvite::SetSenderId(uint64_t SenderId)
5607 assert(state_ == DiscordObjectState::Owned);
5608 Discord_ActivityInvite_SetSenderId(&instance_, SenderId);
5610uint64_t ActivityInvite::ChannelId()
const
5612 assert(state_ == DiscordObjectState::Owned);
5613 uint64_t returnValue__;
5614 returnValue__ = Discord_ActivityInvite_ChannelId(&instance_);
5615 return returnValue__;
5617void ActivityInvite::SetChannelId(uint64_t ChannelId)
5619 assert(state_ == DiscordObjectState::Owned);
5620 Discord_ActivityInvite_SetChannelId(&instance_, ChannelId);
5622uint64_t ActivityInvite::MessageId()
const
5624 assert(state_ == DiscordObjectState::Owned);
5625 uint64_t returnValue__;
5626 returnValue__ = Discord_ActivityInvite_MessageId(&instance_);
5627 return returnValue__;
5629void ActivityInvite::SetMessageId(uint64_t MessageId)
5631 assert(state_ == DiscordObjectState::Owned);
5632 Discord_ActivityInvite_SetMessageId(&instance_, MessageId);
5636 assert(state_ == DiscordObjectState::Owned);
5637 Discord_ActivityActionTypes returnValue__;
5638 returnValue__ = Discord_ActivityInvite_Type(&instance_);
5643 assert(state_ == DiscordObjectState::Owned);
5644 Discord_ActivityInvite_SetType(&instance_,
static_cast<Discord_ActivityActionTypes
>(Type));
5646uint64_t ActivityInvite::ApplicationId()
const
5648 assert(state_ == DiscordObjectState::Owned);
5649 uint64_t returnValue__;
5650 returnValue__ = Discord_ActivityInvite_ApplicationId(&instance_);
5651 return returnValue__;
5653void ActivityInvite::SetApplicationId(uint64_t ApplicationId)
5655 assert(state_ == DiscordObjectState::Owned);
5656 Discord_ActivityInvite_SetApplicationId(&instance_, ApplicationId);
5658uint64_t ActivityInvite::ParentApplicationId()
const
5660 assert(state_ == DiscordObjectState::Owned);
5661 uint64_t returnValue__;
5662 returnValue__ = Discord_ActivityInvite_ParentApplicationId(&instance_);
5663 return returnValue__;
5665void ActivityInvite::SetParentApplicationId(uint64_t ParentApplicationId)
5667 assert(state_ == DiscordObjectState::Owned);
5668 Discord_ActivityInvite_SetParentApplicationId(&instance_, ParentApplicationId);
5670std::string ActivityInvite::PartyId()
const
5672 assert(state_ == DiscordObjectState::Owned);
5673 Discord_String returnValueNative__;
5674 Discord_ActivityInvite_PartyId(&instance_, &returnValueNative__);
5675 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
5676 returnValueNative__.size);
5677 Discord_Free(returnValueNative__.ptr);
5678 return returnValue__;
5680void ActivityInvite::SetPartyId(std::string PartyId)
5682 assert(state_ == DiscordObjectState::Owned);
5683 Discord_String PartyId__str{(uint8_t*)(PartyId.data()), PartyId.size()};
5684 Discord_ActivityInvite_SetPartyId(&instance_, PartyId__str);
5686std::string ActivityInvite::SessionId()
const
5688 assert(state_ == DiscordObjectState::Owned);
5689 Discord_String returnValueNative__;
5690 Discord_ActivityInvite_SessionId(&instance_, &returnValueNative__);
5691 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
5692 returnValueNative__.size);
5693 Discord_Free(returnValueNative__.ptr);
5694 return returnValue__;
5696void ActivityInvite::SetSessionId(std::string SessionId)
5698 assert(state_ == DiscordObjectState::Owned);
5699 Discord_String SessionId__str{(uint8_t*)(SessionId.data()), SessionId.size()};
5700 Discord_ActivityInvite_SetSessionId(&instance_, SessionId__str);
5702bool ActivityInvite::IsValid()
const
5704 assert(state_ == DiscordObjectState::Owned);
5706 returnValue__ = Discord_ActivityInvite_IsValid(&instance_);
5707 return returnValue__;
5709void ActivityInvite::SetIsValid(
bool IsValid)
5711 assert(state_ == DiscordObjectState::Owned);
5712 Discord_ActivityInvite_SetIsValid(&instance_, IsValid);
5714const ActivityAssets ActivityAssets::nullobj{{}, DiscordObjectState::Invalid};
5715ActivityAssets::~ActivityAssets()
5717 if (state_ == DiscordObjectState::Owned) {
5719 state_ = DiscordObjectState::Invalid;
5722ActivityAssets::ActivityAssets(ActivityAssets&& other) noexcept
5723 : instance_(other.instance_)
5724 , state_(other.state_)
5726 other.state_ = DiscordObjectState::Invalid;
5728ActivityAssets& ActivityAssets::operator=(ActivityAssets&& other)
noexcept
5730 if (
this != &other) {
5731 if (state_ == DiscordObjectState::Owned) {
5734 instance_ = other.instance_;
5735 state_ = other.state_;
5736 other.state_ = DiscordObjectState::Invalid;
5740ActivityAssets::ActivityAssets(
const ActivityAssets& arg0)
5745 Discord_ActivityAssets_Clone(&instance_, arg0.instance());
5747 state_ = DiscordObjectState::Owned;
5750ActivityAssets& ActivityAssets::operator=(
const ActivityAssets& arg0)
5752 if (
this != &arg0) {
5753 if (state_ == DiscordObjectState::Owned) {
5755 state_ = DiscordObjectState::Invalid;
5757 if (arg0.state_ == DiscordObjectState::Owned) {
5758 Discord_ActivityAssets_Clone(&instance_, arg0.instance());
5760 state_ = DiscordObjectState::Owned;
5765ActivityAssets::ActivityAssets(Discord_ActivityAssets instance, DiscordObjectState state)
5766 : instance_(instance)
5770ActivityAssets::ActivityAssets()
5772 assert(state_ == DiscordObjectState::Invalid);
5773 Discord_ActivityAssets_Init(&instance_);
5774 state_ = DiscordObjectState::Owned;
5776void ActivityAssets::Drop()
5778 if (state_ != DiscordObjectState::Owned) {
5781 Discord_ActivityAssets_Drop(&instance_);
5782 state_ = DiscordObjectState::Invalid;
5784std::optional<std::string> ActivityAssets::LargeImage()
const
5786 assert(state_ == DiscordObjectState::Owned);
5787 bool returnIsNonNull__;
5788 Discord_String returnValueNative__;
5789 returnIsNonNull__ = Discord_ActivityAssets_LargeImage(&instance_, &returnValueNative__);
5790 if (!returnIsNonNull__) {
5793 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
5794 returnValueNative__.size);
5795 Discord_Free(returnValueNative__.ptr);
5796 return returnValue__;
5798void ActivityAssets::SetLargeImage(std::optional<std::string> LargeImage)
5800 assert(state_ == DiscordObjectState::Owned);
5801 Discord_String LargeImage__str{};
5802 if (LargeImage.has_value()) {
5803 LargeImage__str.ptr =
reinterpret_cast<uint8_t*
>(LargeImage->data());
5804 LargeImage__str.size = LargeImage->size();
5806 Discord_ActivityAssets_SetLargeImage(&instance_,
5807 (LargeImage.has_value() ? &LargeImage__str :
nullptr));
5809std::optional<std::string> ActivityAssets::LargeText()
const
5811 assert(state_ == DiscordObjectState::Owned);
5812 bool returnIsNonNull__;
5813 Discord_String returnValueNative__;
5814 returnIsNonNull__ = Discord_ActivityAssets_LargeText(&instance_, &returnValueNative__);
5815 if (!returnIsNonNull__) {
5818 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
5819 returnValueNative__.size);
5820 Discord_Free(returnValueNative__.ptr);
5821 return returnValue__;
5823void ActivityAssets::SetLargeText(std::optional<std::string> LargeText)
5825 assert(state_ == DiscordObjectState::Owned);
5826 Discord_String LargeText__str{};
5827 if (LargeText.has_value()) {
5828 LargeText__str.ptr =
reinterpret_cast<uint8_t*
>(LargeText->data());
5829 LargeText__str.size = LargeText->size();
5831 Discord_ActivityAssets_SetLargeText(&instance_,
5832 (LargeText.has_value() ? &LargeText__str :
nullptr));
5834std::optional<std::string> ActivityAssets::SmallImage()
const
5836 assert(state_ == DiscordObjectState::Owned);
5837 bool returnIsNonNull__;
5838 Discord_String returnValueNative__;
5839 returnIsNonNull__ = Discord_ActivityAssets_SmallImage(&instance_, &returnValueNative__);
5840 if (!returnIsNonNull__) {
5843 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
5844 returnValueNative__.size);
5845 Discord_Free(returnValueNative__.ptr);
5846 return returnValue__;
5848void ActivityAssets::SetSmallImage(std::optional<std::string> SmallImage)
5850 assert(state_ == DiscordObjectState::Owned);
5851 Discord_String SmallImage__str{};
5852 if (SmallImage.has_value()) {
5853 SmallImage__str.ptr =
reinterpret_cast<uint8_t*
>(SmallImage->data());
5854 SmallImage__str.size = SmallImage->size();
5856 Discord_ActivityAssets_SetSmallImage(&instance_,
5857 (SmallImage.has_value() ? &SmallImage__str :
nullptr));
5859std::optional<std::string> ActivityAssets::SmallText()
const
5861 assert(state_ == DiscordObjectState::Owned);
5862 bool returnIsNonNull__;
5863 Discord_String returnValueNative__;
5864 returnIsNonNull__ = Discord_ActivityAssets_SmallText(&instance_, &returnValueNative__);
5865 if (!returnIsNonNull__) {
5868 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
5869 returnValueNative__.size);
5870 Discord_Free(returnValueNative__.ptr);
5871 return returnValue__;
5873void ActivityAssets::SetSmallText(std::optional<std::string> SmallText)
5875 assert(state_ == DiscordObjectState::Owned);
5876 Discord_String SmallText__str{};
5877 if (SmallText.has_value()) {
5878 SmallText__str.ptr =
reinterpret_cast<uint8_t*
>(SmallText->data());
5879 SmallText__str.size = SmallText->size();
5881 Discord_ActivityAssets_SetSmallText(&instance_,
5882 (SmallText.has_value() ? &SmallText__str :
nullptr));
5884const ActivityTimestamps ActivityTimestamps::nullobj{{}, DiscordObjectState::Invalid};
5885ActivityTimestamps::~ActivityTimestamps()
5887 if (state_ == DiscordObjectState::Owned) {
5889 state_ = DiscordObjectState::Invalid;
5892ActivityTimestamps::ActivityTimestamps(ActivityTimestamps&& other) noexcept
5893 : instance_(other.instance_)
5894 , state_(other.state_)
5896 other.state_ = DiscordObjectState::Invalid;
5898ActivityTimestamps& ActivityTimestamps::operator=(ActivityTimestamps&& other)
noexcept
5900 if (
this != &other) {
5901 if (state_ == DiscordObjectState::Owned) {
5904 instance_ = other.instance_;
5905 state_ = other.state_;
5906 other.state_ = DiscordObjectState::Invalid;
5910ActivityTimestamps::ActivityTimestamps(
const ActivityTimestamps& arg0)
5915 Discord_ActivityTimestamps_Clone(&instance_, arg0.instance());
5917 state_ = DiscordObjectState::Owned;
5920ActivityTimestamps& ActivityTimestamps::operator=(
const ActivityTimestamps& arg0)
5922 if (
this != &arg0) {
5923 if (state_ == DiscordObjectState::Owned) {
5925 state_ = DiscordObjectState::Invalid;
5927 if (arg0.state_ == DiscordObjectState::Owned) {
5928 Discord_ActivityTimestamps_Clone(&instance_, arg0.instance());
5930 state_ = DiscordObjectState::Owned;
5935ActivityTimestamps::ActivityTimestamps(Discord_ActivityTimestamps instance,
5936 DiscordObjectState state)
5937 : instance_(instance)
5941ActivityTimestamps::ActivityTimestamps()
5943 assert(state_ == DiscordObjectState::Invalid);
5944 Discord_ActivityTimestamps_Init(&instance_);
5945 state_ = DiscordObjectState::Owned;
5947void ActivityTimestamps::Drop()
5949 if (state_ != DiscordObjectState::Owned) {
5952 Discord_ActivityTimestamps_Drop(&instance_);
5953 state_ = DiscordObjectState::Invalid;
5955uint64_t ActivityTimestamps::Start()
const
5957 assert(state_ == DiscordObjectState::Owned);
5958 uint64_t returnValue__;
5959 returnValue__ = Discord_ActivityTimestamps_Start(&instance_);
5960 return returnValue__;
5962void ActivityTimestamps::SetStart(uint64_t Start)
5964 assert(state_ == DiscordObjectState::Owned);
5965 Discord_ActivityTimestamps_SetStart(&instance_, Start);
5967uint64_t ActivityTimestamps::End()
const
5969 assert(state_ == DiscordObjectState::Owned);
5970 uint64_t returnValue__;
5971 returnValue__ = Discord_ActivityTimestamps_End(&instance_);
5972 return returnValue__;
5974void ActivityTimestamps::SetEnd(uint64_t End)
5976 assert(state_ == DiscordObjectState::Owned);
5977 Discord_ActivityTimestamps_SetEnd(&instance_, End);
5979const ActivityParty ActivityParty::nullobj{{}, DiscordObjectState::Invalid};
5980ActivityParty::~ActivityParty()
5982 if (state_ == DiscordObjectState::Owned) {
5984 state_ = DiscordObjectState::Invalid;
5987ActivityParty::ActivityParty(ActivityParty&& other) noexcept
5988 : instance_(other.instance_)
5989 , state_(other.state_)
5991 other.state_ = DiscordObjectState::Invalid;
5993ActivityParty& ActivityParty::operator=(ActivityParty&& other)
noexcept
5995 if (
this != &other) {
5996 if (state_ == DiscordObjectState::Owned) {
5999 instance_ = other.instance_;
6000 state_ = other.state_;
6001 other.state_ = DiscordObjectState::Invalid;
6005ActivityParty::ActivityParty(
const ActivityParty& arg0)
6010 Discord_ActivityParty_Clone(&instance_, arg0.instance());
6012 state_ = DiscordObjectState::Owned;
6015ActivityParty& ActivityParty::operator=(
const ActivityParty& arg0)
6017 if (
this != &arg0) {
6018 if (state_ == DiscordObjectState::Owned) {
6020 state_ = DiscordObjectState::Invalid;
6022 if (arg0.state_ == DiscordObjectState::Owned) {
6023 Discord_ActivityParty_Clone(&instance_, arg0.instance());
6025 state_ = DiscordObjectState::Owned;
6030ActivityParty::ActivityParty(Discord_ActivityParty instance, DiscordObjectState state)
6031 : instance_(instance)
6035ActivityParty::ActivityParty()
6037 assert(state_ == DiscordObjectState::Invalid);
6038 Discord_ActivityParty_Init(&instance_);
6039 state_ = DiscordObjectState::Owned;
6041void ActivityParty::Drop()
6043 if (state_ != DiscordObjectState::Owned) {
6046 Discord_ActivityParty_Drop(&instance_);
6047 state_ = DiscordObjectState::Invalid;
6049std::string ActivityParty::Id()
const
6051 assert(state_ == DiscordObjectState::Owned);
6052 Discord_String returnValueNative__;
6053 Discord_ActivityParty_Id(&instance_, &returnValueNative__);
6054 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6055 returnValueNative__.size);
6056 Discord_Free(returnValueNative__.ptr);
6057 return returnValue__;
6059void ActivityParty::SetId(std::string Id)
6061 assert(state_ == DiscordObjectState::Owned);
6062 Discord_String Id__str{(uint8_t*)(Id.data()), Id.size()};
6063 Discord_ActivityParty_SetId(&instance_, Id__str);
6065int32_t ActivityParty::CurrentSize()
const
6067 assert(state_ == DiscordObjectState::Owned);
6068 int32_t returnValue__;
6069 returnValue__ = Discord_ActivityParty_CurrentSize(&instance_);
6070 return returnValue__;
6072void ActivityParty::SetCurrentSize(int32_t CurrentSize)
6074 assert(state_ == DiscordObjectState::Owned);
6075 Discord_ActivityParty_SetCurrentSize(&instance_, CurrentSize);
6077int32_t ActivityParty::MaxSize()
const
6079 assert(state_ == DiscordObjectState::Owned);
6080 int32_t returnValue__;
6081 returnValue__ = Discord_ActivityParty_MaxSize(&instance_);
6082 return returnValue__;
6084void ActivityParty::SetMaxSize(int32_t MaxSize)
6086 assert(state_ == DiscordObjectState::Owned);
6087 Discord_ActivityParty_SetMaxSize(&instance_, MaxSize);
6091 assert(state_ == DiscordObjectState::Owned);
6092 Discord_ActivityPartyPrivacy returnValue__;
6093 returnValue__ = Discord_ActivityParty_Privacy(&instance_);
6098 assert(state_ == DiscordObjectState::Owned);
6099 Discord_ActivityParty_SetPrivacy(&instance_,
6100 static_cast<Discord_ActivityPartyPrivacy
>(Privacy));
6102const ActivitySecrets ActivitySecrets::nullobj{{}, DiscordObjectState::Invalid};
6103ActivitySecrets::~ActivitySecrets()
6105 if (state_ == DiscordObjectState::Owned) {
6107 state_ = DiscordObjectState::Invalid;
6110ActivitySecrets::ActivitySecrets(ActivitySecrets&& other) noexcept
6111 : instance_(other.instance_)
6112 , state_(other.state_)
6114 other.state_ = DiscordObjectState::Invalid;
6116ActivitySecrets& ActivitySecrets::operator=(ActivitySecrets&& other)
noexcept
6118 if (
this != &other) {
6119 if (state_ == DiscordObjectState::Owned) {
6122 instance_ = other.instance_;
6123 state_ = other.state_;
6124 other.state_ = DiscordObjectState::Invalid;
6128ActivitySecrets::ActivitySecrets(
const ActivitySecrets& arg0)
6133 Discord_ActivitySecrets_Clone(&instance_, arg0.instance());
6135 state_ = DiscordObjectState::Owned;
6138ActivitySecrets& ActivitySecrets::operator=(
const ActivitySecrets& arg0)
6140 if (
this != &arg0) {
6141 if (state_ == DiscordObjectState::Owned) {
6143 state_ = DiscordObjectState::Invalid;
6145 if (arg0.state_ == DiscordObjectState::Owned) {
6146 Discord_ActivitySecrets_Clone(&instance_, arg0.instance());
6148 state_ = DiscordObjectState::Owned;
6153ActivitySecrets::ActivitySecrets(Discord_ActivitySecrets instance, DiscordObjectState state)
6154 : instance_(instance)
6158ActivitySecrets::ActivitySecrets()
6160 assert(state_ == DiscordObjectState::Invalid);
6161 Discord_ActivitySecrets_Init(&instance_);
6162 state_ = DiscordObjectState::Owned;
6164void ActivitySecrets::Drop()
6166 if (state_ != DiscordObjectState::Owned) {
6169 Discord_ActivitySecrets_Drop(&instance_);
6170 state_ = DiscordObjectState::Invalid;
6172std::string ActivitySecrets::Join()
const
6174 assert(state_ == DiscordObjectState::Owned);
6175 Discord_String returnValueNative__;
6176 Discord_ActivitySecrets_Join(&instance_, &returnValueNative__);
6177 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6178 returnValueNative__.size);
6179 Discord_Free(returnValueNative__.ptr);
6180 return returnValue__;
6182void ActivitySecrets::SetJoin(std::string Join)
6184 assert(state_ == DiscordObjectState::Owned);
6185 Discord_String Join__str{(uint8_t*)(
Join.data()),
Join.size()};
6186 Discord_ActivitySecrets_SetJoin(&instance_, Join__str);
6188const ActivityButton ActivityButton::nullobj{{}, DiscordObjectState::Invalid};
6189ActivityButton::~ActivityButton()
6191 if (state_ == DiscordObjectState::Owned) {
6193 state_ = DiscordObjectState::Invalid;
6196ActivityButton::ActivityButton(ActivityButton&& other) noexcept
6197 : instance_(other.instance_)
6198 , state_(other.state_)
6200 other.state_ = DiscordObjectState::Invalid;
6202ActivityButton& ActivityButton::operator=(ActivityButton&& other)
noexcept
6204 if (
this != &other) {
6205 if (state_ == DiscordObjectState::Owned) {
6208 instance_ = other.instance_;
6209 state_ = other.state_;
6210 other.state_ = DiscordObjectState::Invalid;
6214ActivityButton::ActivityButton(
const ActivityButton& arg0)
6219 Discord_ActivityButton_Clone(&instance_, arg0.instance());
6221 state_ = DiscordObjectState::Owned;
6224ActivityButton& ActivityButton::operator=(
const ActivityButton& arg0)
6226 if (
this != &arg0) {
6227 if (state_ == DiscordObjectState::Owned) {
6229 state_ = DiscordObjectState::Invalid;
6231 if (arg0.state_ == DiscordObjectState::Owned) {
6232 Discord_ActivityButton_Clone(&instance_, arg0.instance());
6234 state_ = DiscordObjectState::Owned;
6239ActivityButton::ActivityButton(Discord_ActivityButton instance, DiscordObjectState state)
6240 : instance_(instance)
6244ActivityButton::ActivityButton()
6246 assert(state_ == DiscordObjectState::Invalid);
6247 Discord_ActivityButton_Init(&instance_);
6248 state_ = DiscordObjectState::Owned;
6250void ActivityButton::Drop()
6252 if (state_ != DiscordObjectState::Owned) {
6255 Discord_ActivityButton_Drop(&instance_);
6256 state_ = DiscordObjectState::Invalid;
6258std::string ActivityButton::Label()
const
6260 assert(state_ == DiscordObjectState::Owned);
6261 Discord_String returnValueNative__;
6262 Discord_ActivityButton_Label(&instance_, &returnValueNative__);
6263 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6264 returnValueNative__.size);
6265 Discord_Free(returnValueNative__.ptr);
6266 return returnValue__;
6268void ActivityButton::SetLabel(std::string Label)
6270 assert(state_ == DiscordObjectState::Owned);
6271 Discord_String Label__str{(uint8_t*)(Label.data()), Label.size()};
6272 Discord_ActivityButton_SetLabel(&instance_, Label__str);
6274std::string ActivityButton::Url()
const
6276 assert(state_ == DiscordObjectState::Owned);
6277 Discord_String returnValueNative__;
6278 Discord_ActivityButton_Url(&instance_, &returnValueNative__);
6279 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6280 returnValueNative__.size);
6281 Discord_Free(returnValueNative__.ptr);
6282 return returnValue__;
6284void ActivityButton::SetUrl(std::string Url)
6286 assert(state_ == DiscordObjectState::Owned);
6287 Discord_String Url__str{(uint8_t*)(Url.data()), Url.size()};
6288 Discord_ActivityButton_SetUrl(&instance_, Url__str);
6290const Activity Activity::nullobj{{}, DiscordObjectState::Invalid};
6291Activity::~Activity()
6293 if (state_ == DiscordObjectState::Owned) {
6295 state_ = DiscordObjectState::Invalid;
6298Activity::Activity(Activity&& other) noexcept
6299 : instance_(other.instance_)
6300 , state_(other.state_)
6302 other.state_ = DiscordObjectState::Invalid;
6304Activity& Activity::operator=(Activity&& other)
noexcept
6306 if (
this != &other) {
6307 if (state_ == DiscordObjectState::Owned) {
6310 instance_ = other.instance_;
6311 state_ = other.state_;
6312 other.state_ = DiscordObjectState::Invalid;
6316Activity::Activity(
const Activity& arg0)
6321 Discord_Activity_Clone(&instance_, arg0.instance());
6323 state_ = DiscordObjectState::Owned;
6326Activity& Activity::operator=(
const Activity& arg0)
6328 if (
this != &arg0) {
6329 if (state_ == DiscordObjectState::Owned) {
6331 state_ = DiscordObjectState::Invalid;
6333 if (arg0.state_ == DiscordObjectState::Owned) {
6334 Discord_Activity_Clone(&instance_, arg0.instance());
6336 state_ = DiscordObjectState::Owned;
6341Activity::Activity(Discord_Activity instance, DiscordObjectState state)
6342 : instance_(instance)
6348 assert(state_ == DiscordObjectState::Invalid);
6349 Discord_Activity_Init(&instance_);
6350 state_ = DiscordObjectState::Owned;
6352void Activity::Drop()
6354 if (state_ != DiscordObjectState::Owned) {
6357 Discord_Activity_Drop(&instance_);
6358 state_ = DiscordObjectState::Invalid;
6362 assert(state_ == DiscordObjectState::Owned);
6363 Discord_Activity_AddButton(&instance_, button.instance());
6367 assert(state_ == DiscordObjectState::Owned);
6369 returnValue__ = Discord_Activity_Equals(&instance_, other.instance());
6370 return returnValue__;
6372std::vector<discordpp::ActivityButton> Activity::GetButtons()
const
6374 assert(state_ == DiscordObjectState::Owned);
6375 Discord_ActivityButtonSpan returnValueNative__;
6376 Discord_Activity_GetButtons(&instance_, &returnValueNative__);
6377 std::vector<discordpp::ActivityButton> returnValue__;
6378 returnValue__.reserve(returnValueNative__.size);
6379 for (
size_t i__ = 0; i__ < returnValueNative__.size; ++i__) {
6380 returnValue__.emplace_back(returnValueNative__.ptr[i__], DiscordObjectState::Owned);
6382 Discord_Free(returnValueNative__.ptr);
6383 return returnValue__;
6385std::string Activity::Name()
const
6387 assert(state_ == DiscordObjectState::Owned);
6388 Discord_String returnValueNative__;
6389 Discord_Activity_Name(&instance_, &returnValueNative__);
6390 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6391 returnValueNative__.size);
6392 Discord_Free(returnValueNative__.ptr);
6393 return returnValue__;
6395void Activity::SetName(std::string Name)
6397 assert(state_ == DiscordObjectState::Owned);
6398 Discord_String Name__str{(uint8_t*)(Name.data()), Name.size()};
6399 Discord_Activity_SetName(&instance_, Name__str);
6403 assert(state_ == DiscordObjectState::Owned);
6404 Discord_ActivityTypes returnValue__;
6405 returnValue__ = Discord_Activity_Type(&instance_);
6410 assert(state_ == DiscordObjectState::Owned);
6411 Discord_Activity_SetType(&instance_,
static_cast<Discord_ActivityTypes
>(Type));
6413std::optional<std::string> Activity::State()
const
6415 assert(state_ == DiscordObjectState::Owned);
6416 bool returnIsNonNull__;
6417 Discord_String returnValueNative__;
6418 returnIsNonNull__ = Discord_Activity_State(&instance_, &returnValueNative__);
6419 if (!returnIsNonNull__) {
6422 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6423 returnValueNative__.size);
6424 Discord_Free(returnValueNative__.ptr);
6425 return returnValue__;
6427void Activity::SetState(std::optional<std::string> State)
6429 assert(state_ == DiscordObjectState::Owned);
6430 Discord_String State__str{};
6431 if (State.has_value()) {
6432 State__str.ptr =
reinterpret_cast<uint8_t*
>(State->data());
6433 State__str.size = State->size();
6435 Discord_Activity_SetState(&instance_, (State.has_value() ? &State__str :
nullptr));
6437std::optional<std::string> Activity::Details()
const
6439 assert(state_ == DiscordObjectState::Owned);
6440 bool returnIsNonNull__;
6441 Discord_String returnValueNative__;
6442 returnIsNonNull__ = Discord_Activity_Details(&instance_, &returnValueNative__);
6443 if (!returnIsNonNull__) {
6446 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6447 returnValueNative__.size);
6448 Discord_Free(returnValueNative__.ptr);
6449 return returnValue__;
6451void Activity::SetDetails(std::optional<std::string> Details)
6453 assert(state_ == DiscordObjectState::Owned);
6454 Discord_String Details__str{};
6455 if (Details.has_value()) {
6456 Details__str.ptr =
reinterpret_cast<uint8_t*
>(Details->data());
6457 Details__str.size = Details->size();
6459 Discord_Activity_SetDetails(&instance_, (Details.has_value() ? &Details__str :
nullptr));
6461std::optional<uint64_t> Activity::ApplicationId()
const
6463 assert(state_ == DiscordObjectState::Owned);
6464 bool returnIsNonNull__;
6465 uint64_t returnValue__;
6466 returnIsNonNull__ = Discord_Activity_ApplicationId(&instance_, &returnValue__);
6467 if (!returnIsNonNull__) {
6468 return std::nullopt;
6470 return returnValue__;
6472void Activity::SetApplicationId(std::optional<uint64_t> ApplicationId)
6474 assert(state_ == DiscordObjectState::Owned);
6475 Discord_Activity_SetApplicationId(&instance_,
6476 (ApplicationId.has_value() ? &*ApplicationId :
nullptr));
6478std::optional<uint64_t> Activity::ParentApplicationId()
const
6480 assert(state_ == DiscordObjectState::Owned);
6481 bool returnIsNonNull__;
6482 uint64_t returnValue__;
6483 returnIsNonNull__ = Discord_Activity_ParentApplicationId(&instance_, &returnValue__);
6484 if (!returnIsNonNull__) {
6485 return std::nullopt;
6487 return returnValue__;
6489void Activity::SetParentApplicationId(std::optional<uint64_t> ParentApplicationId)
6491 assert(state_ == DiscordObjectState::Owned);
6492 Discord_Activity_SetParentApplicationId(
6493 &instance_, (ParentApplicationId.has_value() ? &*ParentApplicationId :
nullptr));
6495std::optional<discordpp::ActivityAssets> Activity::Assets()
const
6497 assert(state_ == DiscordObjectState::Owned);
6498 bool returnIsNonNull__;
6499 Discord_ActivityAssets returnValueNative__;
6500 returnIsNonNull__ = Discord_Activity_Assets(&instance_, &returnValueNative__);
6501 if (!returnIsNonNull__) {
6505 return returnValue__;
6507void Activity::SetAssets(std::optional<discordpp::ActivityAssets> Assets)
6509 assert(state_ == DiscordObjectState::Owned);
6510 Discord_Activity_SetAssets(&instance_, (Assets.has_value() ? Assets->instance() :
nullptr));
6512std::optional<discordpp::ActivityTimestamps> Activity::Timestamps()
const
6514 assert(state_ == DiscordObjectState::Owned);
6515 bool returnIsNonNull__;
6516 Discord_ActivityTimestamps returnValueNative__;
6517 returnIsNonNull__ = Discord_Activity_Timestamps(&instance_, &returnValueNative__);
6518 if (!returnIsNonNull__) {
6522 return returnValue__;
6524void Activity::SetTimestamps(std::optional<discordpp::ActivityTimestamps> Timestamps)
6526 assert(state_ == DiscordObjectState::Owned);
6527 Discord_Activity_SetTimestamps(&instance_,
6528 (Timestamps.has_value() ? Timestamps->instance() :
nullptr));
6530std::optional<discordpp::ActivityParty> Activity::Party()
const
6532 assert(state_ == DiscordObjectState::Owned);
6533 bool returnIsNonNull__;
6534 Discord_ActivityParty returnValueNative__;
6535 returnIsNonNull__ = Discord_Activity_Party(&instance_, &returnValueNative__);
6536 if (!returnIsNonNull__) {
6540 return returnValue__;
6542void Activity::SetParty(std::optional<discordpp::ActivityParty> Party)
6544 assert(state_ == DiscordObjectState::Owned);
6545 Discord_Activity_SetParty(&instance_, (Party.has_value() ? Party->instance() :
nullptr));
6547std::optional<discordpp::ActivitySecrets> Activity::Secrets()
const
6549 assert(state_ == DiscordObjectState::Owned);
6550 bool returnIsNonNull__;
6551 Discord_ActivitySecrets returnValueNative__;
6552 returnIsNonNull__ = Discord_Activity_Secrets(&instance_, &returnValueNative__);
6553 if (!returnIsNonNull__) {
6557 return returnValue__;
6559void Activity::SetSecrets(std::optional<discordpp::ActivitySecrets> Secrets)
6561 assert(state_ == DiscordObjectState::Owned);
6562 Discord_Activity_SetSecrets(&instance_, (Secrets.has_value() ? Secrets->instance() :
nullptr));
6566 assert(state_ == DiscordObjectState::Owned);
6567 Discord_ActivityGamePlatforms returnValue__;
6568 returnValue__ = Discord_Activity_SupportedPlatforms(&instance_);
6573 assert(state_ == DiscordObjectState::Owned);
6574 Discord_Activity_SetSupportedPlatforms(
6575 &instance_,
static_cast<Discord_ActivityGamePlatforms
>(SupportedPlatforms));
6577const ClientResult ClientResult::nullobj{{}, DiscordObjectState::Invalid};
6578ClientResult::~ClientResult()
6580 if (state_ == DiscordObjectState::Owned) {
6582 state_ = DiscordObjectState::Invalid;
6585ClientResult::ClientResult(ClientResult&& other) noexcept
6586 : instance_(other.instance_)
6587 , state_(other.state_)
6589 other.state_ = DiscordObjectState::Invalid;
6591ClientResult& ClientResult::operator=(ClientResult&& other)
noexcept
6593 if (
this != &other) {
6594 if (state_ == DiscordObjectState::Owned) {
6597 instance_ = other.instance_;
6598 state_ = other.state_;
6599 other.state_ = DiscordObjectState::Invalid;
6603ClientResult::ClientResult(
const ClientResult& arg0)
6608 Discord_ClientResult_Clone(&instance_, arg0.instance());
6610 state_ = DiscordObjectState::Owned;
6613ClientResult& ClientResult::operator=(
const ClientResult& arg0)
6615 if (
this != &arg0) {
6616 if (state_ == DiscordObjectState::Owned) {
6618 state_ = DiscordObjectState::Invalid;
6620 if (arg0.state_ == DiscordObjectState::Owned) {
6621 Discord_ClientResult_Clone(&instance_, arg0.instance());
6623 state_ = DiscordObjectState::Owned;
6628ClientResult::ClientResult(Discord_ClientResult instance, DiscordObjectState state)
6629 : instance_(instance)
6633void ClientResult::Drop()
6635 if (state_ != DiscordObjectState::Owned) {
6638 Discord_ClientResult_Drop(&instance_);
6639 state_ = DiscordObjectState::Invalid;
6641std::string ClientResult::ToString()
const
6643 assert(state_ == DiscordObjectState::Owned);
6644 Discord_String returnValueNative__;
6645 Discord_ClientResult_ToString(&instance_, &returnValueNative__);
6646 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6647 returnValueNative__.size);
6648 Discord_Free(returnValueNative__.ptr);
6649 return returnValue__;
6653 assert(state_ == DiscordObjectState::Owned);
6654 Discord_ErrorType returnValue__;
6655 returnValue__ = Discord_ClientResult_Type(&instance_);
6660 assert(state_ == DiscordObjectState::Owned);
6661 Discord_ClientResult_SetType(&instance_,
static_cast<Discord_ErrorType
>(Type));
6663std::string ClientResult::Error()
const
6665 assert(state_ == DiscordObjectState::Owned);
6666 Discord_String returnValueNative__;
6667 Discord_ClientResult_Error(&instance_, &returnValueNative__);
6668 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6669 returnValueNative__.size);
6670 Discord_Free(returnValueNative__.ptr);
6671 return returnValue__;
6673void ClientResult::SetError(std::string Error)
6675 assert(state_ == DiscordObjectState::Owned);
6676 Discord_String Error__str{(uint8_t*)(
Error.data()),
Error.size()};
6677 Discord_ClientResult_SetError(&instance_, Error__str);
6679int32_t ClientResult::ErrorCode()
const
6681 assert(state_ == DiscordObjectState::Owned);
6682 int32_t returnValue__;
6683 returnValue__ = Discord_ClientResult_ErrorCode(&instance_);
6684 return returnValue__;
6686void ClientResult::SetErrorCode(int32_t ErrorCode)
6688 assert(state_ == DiscordObjectState::Owned);
6689 Discord_ClientResult_SetErrorCode(&instance_, ErrorCode);
6693 assert(state_ == DiscordObjectState::Owned);
6694 Discord_HttpStatusCode returnValue__;
6695 returnValue__ = Discord_ClientResult_Status(&instance_);
6700 assert(state_ == DiscordObjectState::Owned);
6701 Discord_ClientResult_SetStatus(&instance_,
static_cast<Discord_HttpStatusCode
>(Status));
6703std::string ClientResult::ResponseBody()
const
6705 assert(state_ == DiscordObjectState::Owned);
6706 Discord_String returnValueNative__;
6707 Discord_ClientResult_ResponseBody(&instance_, &returnValueNative__);
6708 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6709 returnValueNative__.size);
6710 Discord_Free(returnValueNative__.ptr);
6711 return returnValue__;
6713void ClientResult::SetResponseBody(std::string ResponseBody)
6715 assert(state_ == DiscordObjectState::Owned);
6716 Discord_String ResponseBody__str{(uint8_t*)(ResponseBody.data()), ResponseBody.size()};
6717 Discord_ClientResult_SetResponseBody(&instance_, ResponseBody__str);
6719bool ClientResult::Successful()
const
6721 assert(state_ == DiscordObjectState::Owned);
6723 returnValue__ = Discord_ClientResult_Successful(&instance_);
6724 return returnValue__;
6726void ClientResult::SetSuccessful(
bool Successful)
6728 assert(state_ == DiscordObjectState::Owned);
6729 Discord_ClientResult_SetSuccessful(&instance_, Successful);
6731bool ClientResult::Retryable()
const
6733 assert(state_ == DiscordObjectState::Owned);
6735 returnValue__ = Discord_ClientResult_Retryable(&instance_);
6736 return returnValue__;
6738void ClientResult::SetRetryable(
bool Retryable)
6740 assert(state_ == DiscordObjectState::Owned);
6741 Discord_ClientResult_SetRetryable(&instance_, Retryable);
6743float ClientResult::RetryAfter()
const
6745 assert(state_ == DiscordObjectState::Owned);
6746 float returnValue__;
6747 returnValue__ = Discord_ClientResult_RetryAfter(&instance_);
6748 return returnValue__;
6750void ClientResult::SetRetryAfter(
float RetryAfter)
6752 assert(state_ == DiscordObjectState::Owned);
6753 Discord_ClientResult_SetRetryAfter(&instance_, RetryAfter);
6755const AuthorizationCodeChallenge AuthorizationCodeChallenge::nullobj{{},
6756 DiscordObjectState::Invalid};
6757AuthorizationCodeChallenge::~AuthorizationCodeChallenge()
6759 if (state_ == DiscordObjectState::Owned) {
6761 state_ = DiscordObjectState::Invalid;
6764AuthorizationCodeChallenge::AuthorizationCodeChallenge(AuthorizationCodeChallenge&& other) noexcept
6765 : instance_(other.instance_)
6766 , state_(other.state_)
6768 other.state_ = DiscordObjectState::Invalid;
6770AuthorizationCodeChallenge& AuthorizationCodeChallenge::operator=(
6771 AuthorizationCodeChallenge&& other)
noexcept
6773 if (
this != &other) {
6774 if (state_ == DiscordObjectState::Owned) {
6777 instance_ = other.instance_;
6778 state_ = other.state_;
6779 other.state_ = DiscordObjectState::Invalid;
6783AuthorizationCodeChallenge::AuthorizationCodeChallenge(
const AuthorizationCodeChallenge& arg0)
6788 Discord_AuthorizationCodeChallenge_Clone(&instance_, arg0.instance());
6790 state_ = DiscordObjectState::Owned;
6793AuthorizationCodeChallenge& AuthorizationCodeChallenge::operator=(
6794 const AuthorizationCodeChallenge& arg0)
6796 if (
this != &arg0) {
6797 if (state_ == DiscordObjectState::Owned) {
6799 state_ = DiscordObjectState::Invalid;
6801 if (arg0.state_ == DiscordObjectState::Owned) {
6802 Discord_AuthorizationCodeChallenge_Clone(&instance_, arg0.instance());
6804 state_ = DiscordObjectState::Owned;
6809AuthorizationCodeChallenge::AuthorizationCodeChallenge(Discord_AuthorizationCodeChallenge instance,
6810 DiscordObjectState state)
6811 : instance_(instance)
6815AuthorizationCodeChallenge::AuthorizationCodeChallenge()
6817 assert(state_ == DiscordObjectState::Invalid);
6818 Discord_AuthorizationCodeChallenge_Init(&instance_);
6819 state_ = DiscordObjectState::Owned;
6821void AuthorizationCodeChallenge::Drop()
6823 if (state_ != DiscordObjectState::Owned) {
6826 Discord_AuthorizationCodeChallenge_Drop(&instance_);
6827 state_ = DiscordObjectState::Invalid;
6831 assert(state_ == DiscordObjectState::Owned);
6832 Discord_AuthenticationCodeChallengeMethod returnValue__;
6833 returnValue__ = Discord_AuthorizationCodeChallenge_Method(&instance_);
6838 assert(state_ == DiscordObjectState::Owned);
6839 Discord_AuthorizationCodeChallenge_SetMethod(
6840 &instance_,
static_cast<Discord_AuthenticationCodeChallengeMethod
>(Method));
6842std::string AuthorizationCodeChallenge::Challenge()
const
6844 assert(state_ == DiscordObjectState::Owned);
6845 Discord_String returnValueNative__;
6846 Discord_AuthorizationCodeChallenge_Challenge(&instance_, &returnValueNative__);
6847 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6848 returnValueNative__.size);
6849 Discord_Free(returnValueNative__.ptr);
6850 return returnValue__;
6852void AuthorizationCodeChallenge::SetChallenge(std::string Challenge)
6854 assert(state_ == DiscordObjectState::Owned);
6855 Discord_String Challenge__str{(uint8_t*)(Challenge.data()), Challenge.size()};
6856 Discord_AuthorizationCodeChallenge_SetChallenge(&instance_, Challenge__str);
6858const AuthorizationCodeVerifier AuthorizationCodeVerifier::nullobj{{}, DiscordObjectState::Invalid};
6859AuthorizationCodeVerifier::~AuthorizationCodeVerifier()
6861 if (state_ == DiscordObjectState::Owned) {
6863 state_ = DiscordObjectState::Invalid;
6866AuthorizationCodeVerifier::AuthorizationCodeVerifier(AuthorizationCodeVerifier&& other) noexcept
6867 : instance_(other.instance_)
6868 , state_(other.state_)
6870 other.state_ = DiscordObjectState::Invalid;
6872AuthorizationCodeVerifier& AuthorizationCodeVerifier::operator=(
6873 AuthorizationCodeVerifier&& other)
noexcept
6875 if (
this != &other) {
6876 if (state_ == DiscordObjectState::Owned) {
6879 instance_ = other.instance_;
6880 state_ = other.state_;
6881 other.state_ = DiscordObjectState::Invalid;
6885AuthorizationCodeVerifier::AuthorizationCodeVerifier(
const AuthorizationCodeVerifier& arg0)
6890 Discord_AuthorizationCodeVerifier_Clone(&instance_, arg0.instance());
6892 state_ = DiscordObjectState::Owned;
6895AuthorizationCodeVerifier& AuthorizationCodeVerifier::operator=(
6896 const AuthorizationCodeVerifier& arg0)
6898 if (
this != &arg0) {
6899 if (state_ == DiscordObjectState::Owned) {
6901 state_ = DiscordObjectState::Invalid;
6903 if (arg0.state_ == DiscordObjectState::Owned) {
6904 Discord_AuthorizationCodeVerifier_Clone(&instance_, arg0.instance());
6906 state_ = DiscordObjectState::Owned;
6911AuthorizationCodeVerifier::AuthorizationCodeVerifier(Discord_AuthorizationCodeVerifier instance,
6912 DiscordObjectState state)
6913 : instance_(instance)
6917void AuthorizationCodeVerifier::Drop()
6919 if (state_ != DiscordObjectState::Owned) {
6922 Discord_AuthorizationCodeVerifier_Drop(&instance_);
6923 state_ = DiscordObjectState::Invalid;
6927 assert(state_ == DiscordObjectState::Owned);
6928 Discord_AuthorizationCodeChallenge returnValueNative__{};
6929 Discord_AuthorizationCodeVerifier_Challenge(&instance_, &returnValueNative__);
6931 DiscordObjectState::Owned);
6932 return returnValue__;
6936 assert(state_ == DiscordObjectState::Owned);
6937 Discord_AuthorizationCodeVerifier_SetChallenge(&instance_, Challenge.instance());
6939std::string AuthorizationCodeVerifier::Verifier()
const
6941 assert(state_ == DiscordObjectState::Owned);
6942 Discord_String returnValueNative__;
6943 Discord_AuthorizationCodeVerifier_Verifier(&instance_, &returnValueNative__);
6944 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6945 returnValueNative__.size);
6946 Discord_Free(returnValueNative__.ptr);
6947 return returnValue__;
6949void AuthorizationCodeVerifier::SetVerifier(std::string Verifier)
6951 assert(state_ == DiscordObjectState::Owned);
6952 Discord_String Verifier__str{(uint8_t*)(Verifier.data()), Verifier.size()};
6953 Discord_AuthorizationCodeVerifier_SetVerifier(&instance_, Verifier__str);
6955const AuthorizationArgs AuthorizationArgs::nullobj{{}, DiscordObjectState::Invalid};
6956AuthorizationArgs::~AuthorizationArgs()
6958 if (state_ == DiscordObjectState::Owned) {
6960 state_ = DiscordObjectState::Invalid;
6963AuthorizationArgs::AuthorizationArgs(AuthorizationArgs&& other) noexcept
6964 : instance_(other.instance_)
6965 , state_(other.state_)
6967 other.state_ = DiscordObjectState::Invalid;
6969AuthorizationArgs& AuthorizationArgs::operator=(AuthorizationArgs&& other)
noexcept
6971 if (
this != &other) {
6972 if (state_ == DiscordObjectState::Owned) {
6975 instance_ = other.instance_;
6976 state_ = other.state_;
6977 other.state_ = DiscordObjectState::Invalid;
6981AuthorizationArgs::AuthorizationArgs(
const AuthorizationArgs& arg0)
6986 Discord_AuthorizationArgs_Clone(&instance_, arg0.instance());
6988 state_ = DiscordObjectState::Owned;
6991AuthorizationArgs& AuthorizationArgs::operator=(
const AuthorizationArgs& arg0)
6993 if (
this != &arg0) {
6994 if (state_ == DiscordObjectState::Owned) {
6996 state_ = DiscordObjectState::Invalid;
6998 if (arg0.state_ == DiscordObjectState::Owned) {
6999 Discord_AuthorizationArgs_Clone(&instance_, arg0.instance());
7001 state_ = DiscordObjectState::Owned;
7006AuthorizationArgs::AuthorizationArgs(Discord_AuthorizationArgs instance, DiscordObjectState state)
7007 : instance_(instance)
7011AuthorizationArgs::AuthorizationArgs()
7013 assert(state_ == DiscordObjectState::Invalid);
7014 Discord_AuthorizationArgs_Init(&instance_);
7015 state_ = DiscordObjectState::Owned;
7017void AuthorizationArgs::Drop()
7019 if (state_ != DiscordObjectState::Owned) {
7022 Discord_AuthorizationArgs_Drop(&instance_);
7023 state_ = DiscordObjectState::Invalid;
7025uint64_t AuthorizationArgs::ClientId()
const
7027 assert(state_ == DiscordObjectState::Owned);
7028 uint64_t returnValue__;
7029 returnValue__ = Discord_AuthorizationArgs_ClientId(&instance_);
7030 return returnValue__;
7032void AuthorizationArgs::SetClientId(uint64_t ClientId)
7034 assert(state_ == DiscordObjectState::Owned);
7035 Discord_AuthorizationArgs_SetClientId(&instance_, ClientId);
7037std::string AuthorizationArgs::Scopes()
const
7039 assert(state_ == DiscordObjectState::Owned);
7040 Discord_String returnValueNative__;
7041 Discord_AuthorizationArgs_Scopes(&instance_, &returnValueNative__);
7042 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7043 returnValueNative__.size);
7044 Discord_Free(returnValueNative__.ptr);
7045 return returnValue__;
7047void AuthorizationArgs::SetScopes(std::string Scopes)
7049 assert(state_ == DiscordObjectState::Owned);
7050 Discord_String Scopes__str{(uint8_t*)(Scopes.data()), Scopes.size()};
7051 Discord_AuthorizationArgs_SetScopes(&instance_, Scopes__str);
7053std::optional<std::string> AuthorizationArgs::State()
const
7055 assert(state_ == DiscordObjectState::Owned);
7056 bool returnIsNonNull__;
7057 Discord_String returnValueNative__;
7058 returnIsNonNull__ = Discord_AuthorizationArgs_State(&instance_, &returnValueNative__);
7059 if (!returnIsNonNull__) {
7062 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7063 returnValueNative__.size);
7064 Discord_Free(returnValueNative__.ptr);
7065 return returnValue__;
7067void AuthorizationArgs::SetState(std::optional<std::string> State)
7069 assert(state_ == DiscordObjectState::Owned);
7070 Discord_String State__str{};
7071 if (State.has_value()) {
7072 State__str.ptr =
reinterpret_cast<uint8_t*
>(State->data());
7073 State__str.size = State->size();
7075 Discord_AuthorizationArgs_SetState(&instance_, (State.has_value() ? &State__str :
nullptr));
7077std::optional<std::string> AuthorizationArgs::Nonce()
const
7079 assert(state_ == DiscordObjectState::Owned);
7080 bool returnIsNonNull__;
7081 Discord_String returnValueNative__;
7082 returnIsNonNull__ = Discord_AuthorizationArgs_Nonce(&instance_, &returnValueNative__);
7083 if (!returnIsNonNull__) {
7086 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7087 returnValueNative__.size);
7088 Discord_Free(returnValueNative__.ptr);
7089 return returnValue__;
7091void AuthorizationArgs::SetNonce(std::optional<std::string> Nonce)
7093 assert(state_ == DiscordObjectState::Owned);
7094 Discord_String Nonce__str{};
7095 if (Nonce.has_value()) {
7096 Nonce__str.ptr =
reinterpret_cast<uint8_t*
>(Nonce->data());
7097 Nonce__str.size = Nonce->size();
7099 Discord_AuthorizationArgs_SetNonce(&instance_, (Nonce.has_value() ? &Nonce__str :
nullptr));
7101std::optional<discordpp::AuthorizationCodeChallenge> AuthorizationArgs::CodeChallenge()
const
7103 assert(state_ == DiscordObjectState::Owned);
7104 bool returnIsNonNull__;
7105 Discord_AuthorizationCodeChallenge returnValueNative__;
7106 returnIsNonNull__ = Discord_AuthorizationArgs_CodeChallenge(&instance_, &returnValueNative__);
7107 if (!returnIsNonNull__) {
7111 DiscordObjectState::Owned);
7112 return returnValue__;
7114void AuthorizationArgs::SetCodeChallenge(
7115 std::optional<discordpp::AuthorizationCodeChallenge> CodeChallenge)
7117 assert(state_ == DiscordObjectState::Owned);
7118 Discord_AuthorizationArgs_SetCodeChallenge(
7119 &instance_, (CodeChallenge.has_value() ? CodeChallenge->instance() :
nullptr));
7121std::optional<discordpp::IntegrationType> AuthorizationArgs::IntegrationType()
const
7123 assert(state_ == DiscordObjectState::Owned);
7124 bool returnIsNonNull__;
7125 Discord_IntegrationType returnValueNative__;
7126 returnIsNonNull__ = Discord_AuthorizationArgs_IntegrationType(&instance_, &returnValueNative__);
7127 if (!returnIsNonNull__) {
7131 return returnValue__;
7133void AuthorizationArgs::SetIntegrationType(
7134 std::optional<discordpp::IntegrationType> IntegrationType)
7136 assert(state_ == DiscordObjectState::Owned);
7137 Discord_AuthorizationArgs_SetIntegrationType(
7139 (
IntegrationType.has_value() ?
reinterpret_cast<Discord_IntegrationType*
>(&*IntegrationType)
7142const DeviceAuthorizationArgs DeviceAuthorizationArgs::nullobj{{}, DiscordObjectState::Invalid};
7143DeviceAuthorizationArgs::~DeviceAuthorizationArgs()
7145 if (state_ == DiscordObjectState::Owned) {
7147 state_ = DiscordObjectState::Invalid;
7150DeviceAuthorizationArgs::DeviceAuthorizationArgs(DeviceAuthorizationArgs&& other) noexcept
7151 : instance_(other.instance_)
7152 , state_(other.state_)
7154 other.state_ = DiscordObjectState::Invalid;
7156DeviceAuthorizationArgs& DeviceAuthorizationArgs::operator=(
7157 DeviceAuthorizationArgs&& other)
noexcept
7159 if (
this != &other) {
7160 if (state_ == DiscordObjectState::Owned) {
7163 instance_ = other.instance_;
7164 state_ = other.state_;
7165 other.state_ = DiscordObjectState::Invalid;
7169DeviceAuthorizationArgs::DeviceAuthorizationArgs(
const DeviceAuthorizationArgs& arg0)
7174 Discord_DeviceAuthorizationArgs_Clone(&instance_, arg0.instance());
7176 state_ = DiscordObjectState::Owned;
7179DeviceAuthorizationArgs& DeviceAuthorizationArgs::operator=(
const DeviceAuthorizationArgs& arg0)
7181 if (
this != &arg0) {
7182 if (state_ == DiscordObjectState::Owned) {
7184 state_ = DiscordObjectState::Invalid;
7186 if (arg0.state_ == DiscordObjectState::Owned) {
7187 Discord_DeviceAuthorizationArgs_Clone(&instance_, arg0.instance());
7189 state_ = DiscordObjectState::Owned;
7194DeviceAuthorizationArgs::DeviceAuthorizationArgs(Discord_DeviceAuthorizationArgs instance,
7195 DiscordObjectState state)
7196 : instance_(instance)
7200DeviceAuthorizationArgs::DeviceAuthorizationArgs()
7202 assert(state_ == DiscordObjectState::Invalid);
7203 Discord_DeviceAuthorizationArgs_Init(&instance_);
7204 state_ = DiscordObjectState::Owned;
7206void DeviceAuthorizationArgs::Drop()
7208 if (state_ != DiscordObjectState::Owned) {
7211 Discord_DeviceAuthorizationArgs_Drop(&instance_);
7212 state_ = DiscordObjectState::Invalid;
7214uint64_t DeviceAuthorizationArgs::ClientId()
const
7216 assert(state_ == DiscordObjectState::Owned);
7217 uint64_t returnValue__;
7218 returnValue__ = Discord_DeviceAuthorizationArgs_ClientId(&instance_);
7219 return returnValue__;
7221void DeviceAuthorizationArgs::SetClientId(uint64_t ClientId)
7223 assert(state_ == DiscordObjectState::Owned);
7224 Discord_DeviceAuthorizationArgs_SetClientId(&instance_, ClientId);
7226std::string DeviceAuthorizationArgs::Scopes()
const
7228 assert(state_ == DiscordObjectState::Owned);
7229 Discord_String returnValueNative__;
7230 Discord_DeviceAuthorizationArgs_Scopes(&instance_, &returnValueNative__);
7231 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7232 returnValueNative__.size);
7233 Discord_Free(returnValueNative__.ptr);
7234 return returnValue__;
7236void DeviceAuthorizationArgs::SetScopes(std::string Scopes)
7238 assert(state_ == DiscordObjectState::Owned);
7239 Discord_String Scopes__str{(uint8_t*)(Scopes.data()), Scopes.size()};
7240 Discord_DeviceAuthorizationArgs_SetScopes(&instance_, Scopes__str);
7242const VoiceStateHandle VoiceStateHandle::nullobj{{}, DiscordObjectState::Invalid};
7243VoiceStateHandle::~VoiceStateHandle()
7245 if (state_ == DiscordObjectState::Owned) {
7247 state_ = DiscordObjectState::Invalid;
7250VoiceStateHandle::VoiceStateHandle(VoiceStateHandle&& other) noexcept
7251 : instance_(other.instance_)
7252 , state_(other.state_)
7254 other.state_ = DiscordObjectState::Invalid;
7256VoiceStateHandle& VoiceStateHandle::operator=(VoiceStateHandle&& other)
noexcept
7258 if (
this != &other) {
7259 if (state_ == DiscordObjectState::Owned) {
7262 instance_ = other.instance_;
7263 state_ = other.state_;
7264 other.state_ = DiscordObjectState::Invalid;
7268VoiceStateHandle::VoiceStateHandle(
const VoiceStateHandle& other)
7273 Discord_VoiceStateHandle_Clone(&instance_, other.instance());
7275 state_ = DiscordObjectState::Owned;
7278VoiceStateHandle& VoiceStateHandle::operator=(
const VoiceStateHandle& other)
7280 if (
this != &other) {
7281 if (state_ == DiscordObjectState::Owned) {
7283 state_ = DiscordObjectState::Invalid;
7285 if (other.state_ == DiscordObjectState::Owned) {
7286 Discord_VoiceStateHandle_Clone(&instance_, other.instance());
7288 state_ = DiscordObjectState::Owned;
7293VoiceStateHandle::VoiceStateHandle(Discord_VoiceStateHandle instance, DiscordObjectState state)
7294 : instance_(instance)
7298void VoiceStateHandle::Drop()
7300 if (state_ != DiscordObjectState::Owned) {
7303 Discord_VoiceStateHandle_Drop(&instance_);
7304 state_ = DiscordObjectState::Invalid;
7306bool VoiceStateHandle::SelfDeaf()
const
7308 assert(state_ == DiscordObjectState::Owned);
7310 returnValue__ = Discord_VoiceStateHandle_SelfDeaf(&instance_);
7311 return returnValue__;
7313bool VoiceStateHandle::SelfMute()
const
7315 assert(state_ == DiscordObjectState::Owned);
7317 returnValue__ = Discord_VoiceStateHandle_SelfMute(&instance_);
7318 return returnValue__;
7320const VADThresholdSettings VADThresholdSettings::nullobj{{}, DiscordObjectState::Invalid};
7321VADThresholdSettings::~VADThresholdSettings()
7323 if (state_ == DiscordObjectState::Owned) {
7325 state_ = DiscordObjectState::Invalid;
7328VADThresholdSettings::VADThresholdSettings(VADThresholdSettings&& other) noexcept
7329 : instance_(other.instance_)
7330 , state_(other.state_)
7332 other.state_ = DiscordObjectState::Invalid;
7334VADThresholdSettings& VADThresholdSettings::operator=(VADThresholdSettings&& other)
noexcept
7336 if (
this != &other) {
7337 if (state_ == DiscordObjectState::Owned) {
7340 instance_ = other.instance_;
7341 state_ = other.state_;
7342 other.state_ = DiscordObjectState::Invalid;
7346VADThresholdSettings::VADThresholdSettings(Discord_VADThresholdSettings instance,
7347 DiscordObjectState state)
7348 : instance_(instance)
7352void VADThresholdSettings::Drop()
7354 if (state_ != DiscordObjectState::Owned) {
7357 Discord_VADThresholdSettings_Drop(&instance_);
7358 state_ = DiscordObjectState::Invalid;
7360float VADThresholdSettings::VadThreshold()
const
7362 assert(state_ == DiscordObjectState::Owned);
7363 float returnValue__;
7364 returnValue__ = Discord_VADThresholdSettings_VadThreshold(&instance_);
7365 return returnValue__;
7367void VADThresholdSettings::SetVadThreshold(
float VadThreshold)
7369 assert(state_ == DiscordObjectState::Owned);
7370 Discord_VADThresholdSettings_SetVadThreshold(&instance_, VadThreshold);
7372bool VADThresholdSettings::Automatic()
const
7374 assert(state_ == DiscordObjectState::Owned);
7376 returnValue__ = Discord_VADThresholdSettings_Automatic(&instance_);
7377 return returnValue__;
7379void VADThresholdSettings::SetAutomatic(
bool Automatic)
7381 assert(state_ == DiscordObjectState::Owned);
7382 Discord_VADThresholdSettings_SetAutomatic(&instance_, Automatic);
7384const Call Call::nullobj{{}, DiscordObjectState::Invalid};
7387 if (state_ == DiscordObjectState::Owned) {
7389 state_ = DiscordObjectState::Invalid;
7392Call::Call(Call&& other) noexcept
7393 : instance_(other.instance_)
7394 , state_(other.state_)
7396 other.state_ = DiscordObjectState::Invalid;
7398Call& Call::operator=(Call&& other)
noexcept
7400 if (
this != &other) {
7401 if (state_ == DiscordObjectState::Owned) {
7404 instance_ = other.instance_;
7405 state_ = other.state_;
7406 other.state_ = DiscordObjectState::Invalid;
7410Call::Call(
const Call& other)
7415 Discord_Call_Clone(&instance_, other.instance());
7417 state_ = DiscordObjectState::Owned;
7420Call& Call::operator=(
const Call& other)
7422 if (
this != &other) {
7423 if (state_ == DiscordObjectState::Owned) {
7425 state_ = DiscordObjectState::Invalid;
7427 if (other.state_ == DiscordObjectState::Owned) {
7428 Discord_Call_Clone(&instance_, other.instance());
7430 state_ = DiscordObjectState::Owned;
7435Call::Call(Discord_Call instance, DiscordObjectState state)
7436 : instance_(instance)
7442 if (state_ != DiscordObjectState::Owned) {
7445 Discord_Call_Drop(&instance_);
7446 state_ = DiscordObjectState::Invalid;
7450 Discord_String returnValueNative__;
7451 Discord_Call_ErrorToString(
static_cast<Discord_Call_Error
>(type), &returnValueNative__);
7452 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7453 returnValueNative__.size);
7454 Discord_Free(returnValueNative__.ptr);
7455 return returnValue__;
7459 assert(state_ == DiscordObjectState::Owned);
7460 Discord_AudioModeType returnValue__;
7461 returnValue__ = Discord_Call_GetAudioMode(&instance_);
7464uint64_t Call::GetChannelId()
const
7466 assert(state_ == DiscordObjectState::Owned);
7467 uint64_t returnValue__;
7468 returnValue__ = Discord_Call_GetChannelId(&instance_);
7469 return returnValue__;
7471uint64_t Call::GetGuildId()
const
7473 assert(state_ == DiscordObjectState::Owned);
7474 uint64_t returnValue__;
7475 returnValue__ = Discord_Call_GetGuildId(&instance_);
7476 return returnValue__;
7478bool Call::GetLocalMute(uint64_t userId)
7480 assert(state_ == DiscordObjectState::Owned);
7482 returnValue__ = Discord_Call_GetLocalMute(&instance_, userId);
7483 return returnValue__;
7485std::vector<uint64_t> Call::GetParticipants()
const
7487 assert(state_ == DiscordObjectState::Owned);
7488 Discord_UInt64Span returnValueNative__;
7489 Discord_Call_GetParticipants(&instance_, &returnValueNative__);
7490 std::vector<uint64_t> returnValue__(returnValueNative__.ptr,
7491 returnValueNative__.ptr + returnValueNative__.size);
7492 Discord_Free(returnValueNative__.ptr);
7493 return returnValue__;
7495float Call::GetParticipantVolume(uint64_t userId)
7497 assert(state_ == DiscordObjectState::Owned);
7498 float returnValue__;
7499 returnValue__ = Discord_Call_GetParticipantVolume(&instance_, userId);
7500 return returnValue__;
7502bool Call::GetPTTActive()
7504 assert(state_ == DiscordObjectState::Owned);
7506 returnValue__ = Discord_Call_GetPTTActive(&instance_);
7507 return returnValue__;
7509uint32_t Call::GetPTTReleaseDelay()
7511 assert(state_ == DiscordObjectState::Owned);
7512 uint32_t returnValue__;
7513 returnValue__ = Discord_Call_GetPTTReleaseDelay(&instance_);
7514 return returnValue__;
7516bool Call::GetSelfDeaf()
7518 assert(state_ == DiscordObjectState::Owned);
7520 returnValue__ = Discord_Call_GetSelfDeaf(&instance_);
7521 return returnValue__;
7523bool Call::GetSelfMute()
7525 assert(state_ == DiscordObjectState::Owned);
7527 returnValue__ = Discord_Call_GetSelfMute(&instance_);
7528 return returnValue__;
7532 assert(state_ == DiscordObjectState::Owned);
7533 Discord_Call_Status returnValue__;
7534 returnValue__ = Discord_Call_GetStatus(&instance_);
7539 assert(state_ == DiscordObjectState::Owned);
7540 Discord_VADThresholdSettings returnValueNative__{};
7541 Discord_Call_GetVADThreshold(&instance_, &returnValueNative__);
7543 return returnValue__;
7545std::optional<discordpp::VoiceStateHandle> Call::GetVoiceStateHandle(uint64_t userId)
const
7547 assert(state_ == DiscordObjectState::Owned);
7548 bool returnIsNonNull__;
7549 Discord_VoiceStateHandle returnValueNative__;
7550 returnIsNonNull__ = Discord_Call_GetVoiceStateHandle(&instance_, userId, &returnValueNative__);
7551 if (!returnIsNonNull__) {
7555 return returnValue__;
7559 assert(state_ == DiscordObjectState::Owned);
7560 Discord_Call_SetAudioMode(&instance_,
static_cast<Discord_AudioModeType
>(audioMode));
7562void Call::SetLocalMute(uint64_t userId,
bool mute)
7564 assert(state_ == DiscordObjectState::Owned);
7565 Discord_Call_SetLocalMute(&instance_, userId, mute);
7569 assert(state_ == DiscordObjectState::Owned);
7570 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
7571 auto cb__userData =
new Tcb__UserData(cb);
7572 Discord_Call_OnVoiceStateChanged cb__native = [](
auto userId,
void* userData__) {
7573 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
7574 userData__typed->delegate(userId);
7576 Discord_Call_SetOnVoiceStateChangedCallback(
7577 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
7581 assert(state_ == DiscordObjectState::Owned);
7582 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
7583 auto cb__userData =
new Tcb__UserData(cb);
7584 Discord_Call_OnParticipantChanged cb__native = [](
auto userId,
auto added,
void* userData__) {
7585 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
7586 userData__typed->delegate(userId, added);
7588 Discord_Call_SetParticipantChangedCallback(
7589 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
7591void Call::SetParticipantVolume(uint64_t userId,
float volume)
7593 assert(state_ == DiscordObjectState::Owned);
7594 Discord_Call_SetParticipantVolume(&instance_, userId, volume);
7596void Call::SetPTTActive(
bool active)
7598 assert(state_ == DiscordObjectState::Owned);
7599 Discord_Call_SetPTTActive(&instance_, active);
7601void Call::SetPTTReleaseDelay(uint32_t releaseDelayMs)
7603 assert(state_ == DiscordObjectState::Owned);
7604 Discord_Call_SetPTTReleaseDelay(&instance_, releaseDelayMs);
7606void Call::SetSelfDeaf(
bool deaf)
7608 assert(state_ == DiscordObjectState::Owned);
7609 Discord_Call_SetSelfDeaf(&instance_, deaf);
7611void Call::SetSelfMute(
bool mute)
7613 assert(state_ == DiscordObjectState::Owned);
7614 Discord_Call_SetSelfMute(&instance_, mute);
7618 assert(state_ == DiscordObjectState::Owned);
7619 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
7620 auto cb__userData =
new Tcb__UserData(cb);
7621 Discord_Call_OnSpeakingStatusChanged cb__native =
7622 [](
auto userId,
auto isPlayingSound,
void* userData__) {
7623 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
7624 userData__typed->delegate(userId, isPlayingSound);
7626 Discord_Call_SetSpeakingStatusChangedCallback(
7627 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
7631 assert(state_ == DiscordObjectState::Owned);
7632 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
7633 auto cb__userData =
new Tcb__UserData(cb);
7634 Discord_Call_OnStatusChanged cb__native =
7635 [](
auto status,
auto error,
auto errorDetail,
void* userData__) {
7636 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
7641 Discord_Call_SetStatusChangedCallback(
7642 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
7644void Call::SetVADThreshold(
bool automatic,
float threshold)
7646 assert(state_ == DiscordObjectState::Owned);
7647 Discord_Call_SetVADThreshold(&instance_, automatic, threshold);
7651 Discord_String returnValueNative__;
7652 Discord_Call_StatusToString(
static_cast<Discord_Call_Status
>(type), &returnValueNative__);
7653 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7654 returnValueNative__.size);
7655 Discord_Free(returnValueNative__.ptr);
7656 return returnValue__;
7658const ChannelHandle ChannelHandle::nullobj{{}, DiscordObjectState::Invalid};
7659ChannelHandle::~ChannelHandle()
7661 if (state_ == DiscordObjectState::Owned) {
7663 state_ = DiscordObjectState::Invalid;
7666ChannelHandle::ChannelHandle(ChannelHandle&& other) noexcept
7667 : instance_(other.instance_)
7668 , state_(other.state_)
7670 other.state_ = DiscordObjectState::Invalid;
7672ChannelHandle& ChannelHandle::operator=(ChannelHandle&& other)
noexcept
7674 if (
this != &other) {
7675 if (state_ == DiscordObjectState::Owned) {
7678 instance_ = other.instance_;
7679 state_ = other.state_;
7680 other.state_ = DiscordObjectState::Invalid;
7684ChannelHandle::ChannelHandle(
const ChannelHandle& other)
7689 Discord_ChannelHandle_Clone(&instance_, other.instance());
7691 state_ = DiscordObjectState::Owned;
7694ChannelHandle& ChannelHandle::operator=(
const ChannelHandle& other)
7696 if (
this != &other) {
7697 if (state_ == DiscordObjectState::Owned) {
7699 state_ = DiscordObjectState::Invalid;
7701 if (other.state_ == DiscordObjectState::Owned) {
7702 Discord_ChannelHandle_Clone(&instance_, other.instance());
7704 state_ = DiscordObjectState::Owned;
7709ChannelHandle::ChannelHandle(Discord_ChannelHandle instance, DiscordObjectState state)
7710 : instance_(instance)
7714void ChannelHandle::Drop()
7716 if (state_ != DiscordObjectState::Owned) {
7719 Discord_ChannelHandle_Drop(&instance_);
7720 state_ = DiscordObjectState::Invalid;
7722uint64_t ChannelHandle::Id()
const
7724 assert(state_ == DiscordObjectState::Owned);
7725 uint64_t returnValue__;
7726 returnValue__ = Discord_ChannelHandle_Id(&instance_);
7727 return returnValue__;
7729std::string ChannelHandle::Name()
const
7731 assert(state_ == DiscordObjectState::Owned);
7732 Discord_String returnValueNative__;
7733 Discord_ChannelHandle_Name(&instance_, &returnValueNative__);
7734 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7735 returnValueNative__.size);
7736 Discord_Free(returnValueNative__.ptr);
7737 return returnValue__;
7739std::vector<uint64_t> ChannelHandle::Recipients()
const
7741 assert(state_ == DiscordObjectState::Owned);
7742 Discord_UInt64Span returnValueNative__;
7743 Discord_ChannelHandle_Recipients(&instance_, &returnValueNative__);
7744 std::vector<uint64_t> returnValue__(returnValueNative__.ptr,
7745 returnValueNative__.ptr + returnValueNative__.size);
7746 Discord_Free(returnValueNative__.ptr);
7747 return returnValue__;
7751 assert(state_ == DiscordObjectState::Owned);
7752 Discord_ChannelType returnValue__;
7753 returnValue__ = Discord_ChannelHandle_Type(&instance_);
7756const GuildMinimal GuildMinimal::nullobj{{}, DiscordObjectState::Invalid};
7757GuildMinimal::~GuildMinimal()
7759 if (state_ == DiscordObjectState::Owned) {
7761 state_ = DiscordObjectState::Invalid;
7764GuildMinimal::GuildMinimal(GuildMinimal&& other) noexcept
7765 : instance_(other.instance_)
7766 , state_(other.state_)
7768 other.state_ = DiscordObjectState::Invalid;
7770GuildMinimal& GuildMinimal::operator=(GuildMinimal&& other)
noexcept
7772 if (
this != &other) {
7773 if (state_ == DiscordObjectState::Owned) {
7776 instance_ = other.instance_;
7777 state_ = other.state_;
7778 other.state_ = DiscordObjectState::Invalid;
7782GuildMinimal::GuildMinimal(
const GuildMinimal& arg0)
7787 Discord_GuildMinimal_Clone(&instance_, arg0.instance());
7789 state_ = DiscordObjectState::Owned;
7792GuildMinimal& GuildMinimal::operator=(
const GuildMinimal& arg0)
7794 if (
this != &arg0) {
7795 if (state_ == DiscordObjectState::Owned) {
7797 state_ = DiscordObjectState::Invalid;
7799 if (arg0.state_ == DiscordObjectState::Owned) {
7800 Discord_GuildMinimal_Clone(&instance_, arg0.instance());
7802 state_ = DiscordObjectState::Owned;
7807GuildMinimal::GuildMinimal(Discord_GuildMinimal instance, DiscordObjectState state)
7808 : instance_(instance)
7812void GuildMinimal::Drop()
7814 if (state_ != DiscordObjectState::Owned) {
7817 Discord_GuildMinimal_Drop(&instance_);
7818 state_ = DiscordObjectState::Invalid;
7820uint64_t GuildMinimal::Id()
const
7822 assert(state_ == DiscordObjectState::Owned);
7823 uint64_t returnValue__;
7824 returnValue__ = Discord_GuildMinimal_Id(&instance_);
7825 return returnValue__;
7827void GuildMinimal::SetId(uint64_t Id)
7829 assert(state_ == DiscordObjectState::Owned);
7830 Discord_GuildMinimal_SetId(&instance_, Id);
7832std::string GuildMinimal::Name()
const
7834 assert(state_ == DiscordObjectState::Owned);
7835 Discord_String returnValueNative__;
7836 Discord_GuildMinimal_Name(&instance_, &returnValueNative__);
7837 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7838 returnValueNative__.size);
7839 Discord_Free(returnValueNative__.ptr);
7840 return returnValue__;
7842void GuildMinimal::SetName(std::string Name)
7844 assert(state_ == DiscordObjectState::Owned);
7845 Discord_String Name__str{(uint8_t*)(Name.data()), Name.size()};
7846 Discord_GuildMinimal_SetName(&instance_, Name__str);
7848const GuildChannel GuildChannel::nullobj{{}, DiscordObjectState::Invalid};
7849GuildChannel::~GuildChannel()
7851 if (state_ == DiscordObjectState::Owned) {
7853 state_ = DiscordObjectState::Invalid;
7856GuildChannel::GuildChannel(GuildChannel&& other) noexcept
7857 : instance_(other.instance_)
7858 , state_(other.state_)
7860 other.state_ = DiscordObjectState::Invalid;
7862GuildChannel& GuildChannel::operator=(GuildChannel&& other)
noexcept
7864 if (
this != &other) {
7865 if (state_ == DiscordObjectState::Owned) {
7868 instance_ = other.instance_;
7869 state_ = other.state_;
7870 other.state_ = DiscordObjectState::Invalid;
7874GuildChannel::GuildChannel(
const GuildChannel& arg0)
7879 Discord_GuildChannel_Clone(&instance_, arg0.instance());
7881 state_ = DiscordObjectState::Owned;
7884GuildChannel& GuildChannel::operator=(
const GuildChannel& arg0)
7886 if (
this != &arg0) {
7887 if (state_ == DiscordObjectState::Owned) {
7889 state_ = DiscordObjectState::Invalid;
7891 if (arg0.state_ == DiscordObjectState::Owned) {
7892 Discord_GuildChannel_Clone(&instance_, arg0.instance());
7894 state_ = DiscordObjectState::Owned;
7899GuildChannel::GuildChannel(Discord_GuildChannel instance, DiscordObjectState state)
7900 : instance_(instance)
7904void GuildChannel::Drop()
7906 if (state_ != DiscordObjectState::Owned) {
7909 Discord_GuildChannel_Drop(&instance_);
7910 state_ = DiscordObjectState::Invalid;
7912uint64_t GuildChannel::Id()
const
7914 assert(state_ == DiscordObjectState::Owned);
7915 uint64_t returnValue__;
7916 returnValue__ = Discord_GuildChannel_Id(&instance_);
7917 return returnValue__;
7919void GuildChannel::SetId(uint64_t Id)
7921 assert(state_ == DiscordObjectState::Owned);
7922 Discord_GuildChannel_SetId(&instance_, Id);
7924std::string GuildChannel::Name()
const
7926 assert(state_ == DiscordObjectState::Owned);
7927 Discord_String returnValueNative__;
7928 Discord_GuildChannel_Name(&instance_, &returnValueNative__);
7929 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7930 returnValueNative__.size);
7931 Discord_Free(returnValueNative__.ptr);
7932 return returnValue__;
7934void GuildChannel::SetName(std::string Name)
7936 assert(state_ == DiscordObjectState::Owned);
7937 Discord_String Name__str{(uint8_t*)(Name.data()), Name.size()};
7938 Discord_GuildChannel_SetName(&instance_, Name__str);
7940bool GuildChannel::IsLinkable()
const
7942 assert(state_ == DiscordObjectState::Owned);
7944 returnValue__ = Discord_GuildChannel_IsLinkable(&instance_);
7945 return returnValue__;
7947void GuildChannel::SetIsLinkable(
bool IsLinkable)
7949 assert(state_ == DiscordObjectState::Owned);
7950 Discord_GuildChannel_SetIsLinkable(&instance_, IsLinkable);
7952bool GuildChannel::IsViewableAndWriteableByAllMembers()
const
7954 assert(state_ == DiscordObjectState::Owned);
7956 returnValue__ = Discord_GuildChannel_IsViewableAndWriteableByAllMembers(&instance_);
7957 return returnValue__;
7959void GuildChannel::SetIsViewableAndWriteableByAllMembers(
bool IsViewableAndWriteableByAllMembers)
7961 assert(state_ == DiscordObjectState::Owned);
7962 Discord_GuildChannel_SetIsViewableAndWriteableByAllMembers(&instance_,
7963 IsViewableAndWriteableByAllMembers);
7965std::optional<discordpp::LinkedLobby> GuildChannel::LinkedLobby()
const
7967 assert(state_ == DiscordObjectState::Owned);
7968 bool returnIsNonNull__;
7969 Discord_LinkedLobby returnValueNative__;
7970 returnIsNonNull__ = Discord_GuildChannel_LinkedLobby(&instance_, &returnValueNative__);
7971 if (!returnIsNonNull__) {
7975 return returnValue__;
7977void GuildChannel::SetLinkedLobby(std::optional<discordpp::LinkedLobby> LinkedLobby)
7979 assert(state_ == DiscordObjectState::Owned);
7980 Discord_GuildChannel_SetLinkedLobby(
7981 &instance_, (LinkedLobby.has_value() ? LinkedLobby->instance() :
nullptr));
7983const LinkedLobby LinkedLobby::nullobj{{}, DiscordObjectState::Invalid};
7984LinkedLobby::~LinkedLobby()
7986 if (state_ == DiscordObjectState::Owned) {
7988 state_ = DiscordObjectState::Invalid;
7991LinkedLobby::LinkedLobby(LinkedLobby&& other) noexcept
7992 : instance_(other.instance_)
7993 , state_(other.state_)
7995 other.state_ = DiscordObjectState::Invalid;
7997LinkedLobby& LinkedLobby::operator=(LinkedLobby&& other)
noexcept
7999 if (
this != &other) {
8000 if (state_ == DiscordObjectState::Owned) {
8003 instance_ = other.instance_;
8004 state_ = other.state_;
8005 other.state_ = DiscordObjectState::Invalid;
8009LinkedLobby::LinkedLobby(
const LinkedLobby& arg0)
8014 Discord_LinkedLobby_Clone(&instance_, arg0.instance());
8016 state_ = DiscordObjectState::Owned;
8019LinkedLobby& LinkedLobby::operator=(
const LinkedLobby& arg0)
8021 if (
this != &arg0) {
8022 if (state_ == DiscordObjectState::Owned) {
8024 state_ = DiscordObjectState::Invalid;
8026 if (arg0.state_ == DiscordObjectState::Owned) {
8027 Discord_LinkedLobby_Clone(&instance_, arg0.instance());
8029 state_ = DiscordObjectState::Owned;
8034LinkedLobby::LinkedLobby(Discord_LinkedLobby instance, DiscordObjectState state)
8035 : instance_(instance)
8039LinkedLobby::LinkedLobby()
8041 assert(state_ == DiscordObjectState::Invalid);
8042 Discord_LinkedLobby_Init(&instance_);
8043 state_ = DiscordObjectState::Owned;
8045void LinkedLobby::Drop()
8047 if (state_ != DiscordObjectState::Owned) {
8050 Discord_LinkedLobby_Drop(&instance_);
8051 state_ = DiscordObjectState::Invalid;
8053uint64_t LinkedLobby::ApplicationId()
const
8055 assert(state_ == DiscordObjectState::Owned);
8056 uint64_t returnValue__;
8057 returnValue__ = Discord_LinkedLobby_ApplicationId(&instance_);
8058 return returnValue__;
8060void LinkedLobby::SetApplicationId(uint64_t ApplicationId)
8062 assert(state_ == DiscordObjectState::Owned);
8063 Discord_LinkedLobby_SetApplicationId(&instance_, ApplicationId);
8065uint64_t LinkedLobby::LobbyId()
const
8067 assert(state_ == DiscordObjectState::Owned);
8068 uint64_t returnValue__;
8069 returnValue__ = Discord_LinkedLobby_LobbyId(&instance_);
8070 return returnValue__;
8072void LinkedLobby::SetLobbyId(uint64_t LobbyId)
8074 assert(state_ == DiscordObjectState::Owned);
8075 Discord_LinkedLobby_SetLobbyId(&instance_, LobbyId);
8077const LinkedChannel LinkedChannel::nullobj{{}, DiscordObjectState::Invalid};
8078LinkedChannel::~LinkedChannel()
8080 if (state_ == DiscordObjectState::Owned) {
8082 state_ = DiscordObjectState::Invalid;
8085LinkedChannel::LinkedChannel(LinkedChannel&& other) noexcept
8086 : instance_(other.instance_)
8087 , state_(other.state_)
8089 other.state_ = DiscordObjectState::Invalid;
8091LinkedChannel& LinkedChannel::operator=(LinkedChannel&& other)
noexcept
8093 if (
this != &other) {
8094 if (state_ == DiscordObjectState::Owned) {
8097 instance_ = other.instance_;
8098 state_ = other.state_;
8099 other.state_ = DiscordObjectState::Invalid;
8103LinkedChannel::LinkedChannel(
const LinkedChannel& arg0)
8108 Discord_LinkedChannel_Clone(&instance_, arg0.instance());
8110 state_ = DiscordObjectState::Owned;
8113LinkedChannel& LinkedChannel::operator=(
const LinkedChannel& arg0)
8115 if (
this != &arg0) {
8116 if (state_ == DiscordObjectState::Owned) {
8118 state_ = DiscordObjectState::Invalid;
8120 if (arg0.state_ == DiscordObjectState::Owned) {
8121 Discord_LinkedChannel_Clone(&instance_, arg0.instance());
8123 state_ = DiscordObjectState::Owned;
8128LinkedChannel::LinkedChannel(Discord_LinkedChannel instance, DiscordObjectState state)
8129 : instance_(instance)
8133void LinkedChannel::Drop()
8135 if (state_ != DiscordObjectState::Owned) {
8138 Discord_LinkedChannel_Drop(&instance_);
8139 state_ = DiscordObjectState::Invalid;
8141uint64_t LinkedChannel::Id()
const
8143 assert(state_ == DiscordObjectState::Owned);
8144 uint64_t returnValue__;
8145 returnValue__ = Discord_LinkedChannel_Id(&instance_);
8146 return returnValue__;
8148void LinkedChannel::SetId(uint64_t Id)
8150 assert(state_ == DiscordObjectState::Owned);
8151 Discord_LinkedChannel_SetId(&instance_, Id);
8153std::string LinkedChannel::Name()
const
8155 assert(state_ == DiscordObjectState::Owned);
8156 Discord_String returnValueNative__;
8157 Discord_LinkedChannel_Name(&instance_, &returnValueNative__);
8158 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
8159 returnValueNative__.size);
8160 Discord_Free(returnValueNative__.ptr);
8161 return returnValue__;
8163void LinkedChannel::SetName(std::string Name)
8165 assert(state_ == DiscordObjectState::Owned);
8166 Discord_String Name__str{(uint8_t*)(Name.data()), Name.size()};
8167 Discord_LinkedChannel_SetName(&instance_, Name__str);
8169uint64_t LinkedChannel::GuildId()
const
8171 assert(state_ == DiscordObjectState::Owned);
8172 uint64_t returnValue__;
8173 returnValue__ = Discord_LinkedChannel_GuildId(&instance_);
8174 return returnValue__;
8176void LinkedChannel::SetGuildId(uint64_t GuildId)
8178 assert(state_ == DiscordObjectState::Owned);
8179 Discord_LinkedChannel_SetGuildId(&instance_, GuildId);
8181const RelationshipHandle RelationshipHandle::nullobj{{}, DiscordObjectState::Invalid};
8182RelationshipHandle::~RelationshipHandle()
8184 if (state_ == DiscordObjectState::Owned) {
8186 state_ = DiscordObjectState::Invalid;
8189RelationshipHandle::RelationshipHandle(RelationshipHandle&& other) noexcept
8190 : instance_(other.instance_)
8191 , state_(other.state_)
8193 other.state_ = DiscordObjectState::Invalid;
8195RelationshipHandle& RelationshipHandle::operator=(RelationshipHandle&& other)
noexcept
8197 if (
this != &other) {
8198 if (state_ == DiscordObjectState::Owned) {
8201 instance_ = other.instance_;
8202 state_ = other.state_;
8203 other.state_ = DiscordObjectState::Invalid;
8207RelationshipHandle::RelationshipHandle(
const RelationshipHandle& other)
8212 Discord_RelationshipHandle_Clone(&instance_, other.instance());
8214 state_ = DiscordObjectState::Owned;
8217RelationshipHandle& RelationshipHandle::operator=(
const RelationshipHandle& other)
8219 if (
this != &other) {
8220 if (state_ == DiscordObjectState::Owned) {
8222 state_ = DiscordObjectState::Invalid;
8224 if (other.state_ == DiscordObjectState::Owned) {
8225 Discord_RelationshipHandle_Clone(&instance_, other.instance());
8227 state_ = DiscordObjectState::Owned;
8232RelationshipHandle::RelationshipHandle(Discord_RelationshipHandle instance,
8233 DiscordObjectState state)
8234 : instance_(instance)
8238void RelationshipHandle::Drop()
8240 if (state_ != DiscordObjectState::Owned) {
8243 Discord_RelationshipHandle_Drop(&instance_);
8244 state_ = DiscordObjectState::Invalid;
8248 assert(state_ == DiscordObjectState::Owned);
8249 Discord_RelationshipType returnValue__;
8250 returnValue__ = Discord_RelationshipHandle_DiscordRelationshipType(&instance_);
8255 assert(state_ == DiscordObjectState::Owned);
8256 Discord_RelationshipType returnValue__;
8257 returnValue__ = Discord_RelationshipHandle_GameRelationshipType(&instance_);
8260uint64_t RelationshipHandle::Id()
const
8262 assert(state_ == DiscordObjectState::Owned);
8263 uint64_t returnValue__;
8264 returnValue__ = Discord_RelationshipHandle_Id(&instance_);
8265 return returnValue__;
8267bool RelationshipHandle::IsSpamRequest()
const
8269 assert(state_ == DiscordObjectState::Owned);
8271 returnValue__ = Discord_RelationshipHandle_IsSpamRequest(&instance_);
8272 return returnValue__;
8274std::optional<discordpp::UserHandle> RelationshipHandle::User()
const
8276 assert(state_ == DiscordObjectState::Owned);
8277 bool returnIsNonNull__;
8278 Discord_UserHandle returnValueNative__;
8279 returnIsNonNull__ = Discord_RelationshipHandle_User(&instance_, &returnValueNative__);
8280 if (!returnIsNonNull__) {
8284 return returnValue__;
8286const UserHandle UserHandle::nullobj{{}, DiscordObjectState::Invalid};
8287UserHandle::~UserHandle()
8289 if (state_ == DiscordObjectState::Owned) {
8291 state_ = DiscordObjectState::Invalid;
8294UserHandle::UserHandle(UserHandle&& other) noexcept
8295 : instance_(other.instance_)
8296 , state_(other.state_)
8298 other.state_ = DiscordObjectState::Invalid;
8300UserHandle& UserHandle::operator=(UserHandle&& other)
noexcept
8302 if (
this != &other) {
8303 if (state_ == DiscordObjectState::Owned) {
8306 instance_ = other.instance_;
8307 state_ = other.state_;
8308 other.state_ = DiscordObjectState::Invalid;
8312UserHandle::UserHandle(
const UserHandle& arg0)
8317 Discord_UserHandle_Clone(&instance_, arg0.instance());
8319 state_ = DiscordObjectState::Owned;
8322UserHandle& UserHandle::operator=(
const UserHandle& arg0)
8324 if (
this != &arg0) {
8325 if (state_ == DiscordObjectState::Owned) {
8327 state_ = DiscordObjectState::Invalid;
8329 if (arg0.state_ == DiscordObjectState::Owned) {
8330 Discord_UserHandle_Clone(&instance_, arg0.instance());
8332 state_ = DiscordObjectState::Owned;
8337UserHandle::UserHandle(Discord_UserHandle instance, DiscordObjectState state)
8338 : instance_(instance)
8342void UserHandle::Drop()
8344 if (state_ != DiscordObjectState::Owned) {
8347 Discord_UserHandle_Drop(&instance_);
8348 state_ = DiscordObjectState::Invalid;
8350std::optional<std::string> UserHandle::Avatar()
const
8352 assert(state_ == DiscordObjectState::Owned);
8353 bool returnIsNonNull__;
8354 Discord_String returnValueNative__;
8355 returnIsNonNull__ = Discord_UserHandle_Avatar(&instance_, &returnValueNative__);
8356 if (!returnIsNonNull__) {
8359 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
8360 returnValueNative__.size);
8361 Discord_Free(returnValueNative__.ptr);
8362 return returnValue__;
8366 Discord_String returnValueNative__;
8367 Discord_UserHandle_AvatarTypeToString(
static_cast<Discord_UserHandle_AvatarType
>(type),
8368 &returnValueNative__);
8369 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
8370 returnValueNative__.size);
8371 Discord_Free(returnValueNative__.ptr);
8372 return returnValue__;
8377 assert(state_ == DiscordObjectState::Owned);
8378 Discord_String returnValueNative__;
8379 Discord_UserHandle_AvatarUrl(&instance_,
8380 static_cast<Discord_UserHandle_AvatarType
>(animatedType),
8381 static_cast<Discord_UserHandle_AvatarType
>(staticType),
8382 &returnValueNative__);
8383 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
8384 returnValueNative__.size);
8385 Discord_Free(returnValueNative__.ptr);
8386 return returnValue__;
8388std::string UserHandle::DisplayName()
const
8390 assert(state_ == DiscordObjectState::Owned);
8391 Discord_String returnValueNative__;
8392 Discord_UserHandle_DisplayName(&instance_, &returnValueNative__);
8393 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
8394 returnValueNative__.size);
8395 Discord_Free(returnValueNative__.ptr);
8396 return returnValue__;
8398std::optional<discordpp::Activity> UserHandle::GameActivity()
const
8400 assert(state_ == DiscordObjectState::Owned);
8401 bool returnIsNonNull__;
8402 Discord_Activity returnValueNative__;
8403 returnIsNonNull__ = Discord_UserHandle_GameActivity(&instance_, &returnValueNative__);
8404 if (!returnIsNonNull__) {
8408 return returnValue__;
8410std::optional<std::string> UserHandle::GlobalName()
const
8412 assert(state_ == DiscordObjectState::Owned);
8413 bool returnIsNonNull__;
8414 Discord_String returnValueNative__;
8415 returnIsNonNull__ = Discord_UserHandle_GlobalName(&instance_, &returnValueNative__);
8416 if (!returnIsNonNull__) {
8419 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
8420 returnValueNative__.size);
8421 Discord_Free(returnValueNative__.ptr);
8422 return returnValue__;
8424uint64_t UserHandle::Id()
const
8426 assert(state_ == DiscordObjectState::Owned);
8427 uint64_t returnValue__;
8428 returnValue__ = Discord_UserHandle_Id(&instance_);
8429 return returnValue__;
8431bool UserHandle::IsProvisional()
const
8433 assert(state_ == DiscordObjectState::Owned);
8435 returnValue__ = Discord_UserHandle_IsProvisional(&instance_);
8436 return returnValue__;
8440 assert(state_ == DiscordObjectState::Owned);
8441 Discord_RelationshipHandle returnValueNative__{};
8442 Discord_UserHandle_Relationship(&instance_, &returnValueNative__);
8444 return returnValue__;
8448 assert(state_ == DiscordObjectState::Owned);
8449 Discord_StatusType returnValue__;
8450 returnValue__ = Discord_UserHandle_Status(&instance_);
8453std::string UserHandle::Username()
const
8455 assert(state_ == DiscordObjectState::Owned);
8456 Discord_String returnValueNative__;
8457 Discord_UserHandle_Username(&instance_, &returnValueNative__);
8458 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
8459 returnValueNative__.size);
8460 Discord_Free(returnValueNative__.ptr);
8461 return returnValue__;
8463const LobbyMemberHandle LobbyMemberHandle::nullobj{{}, DiscordObjectState::Invalid};
8464LobbyMemberHandle::~LobbyMemberHandle()
8466 if (state_ == DiscordObjectState::Owned) {
8468 state_ = DiscordObjectState::Invalid;
8471LobbyMemberHandle::LobbyMemberHandle(LobbyMemberHandle&& other) noexcept
8472 : instance_(other.instance_)
8473 , state_(other.state_)
8475 other.state_ = DiscordObjectState::Invalid;
8477LobbyMemberHandle& LobbyMemberHandle::operator=(LobbyMemberHandle&& other)
noexcept
8479 if (
this != &other) {
8480 if (state_ == DiscordObjectState::Owned) {
8483 instance_ = other.instance_;
8484 state_ = other.state_;
8485 other.state_ = DiscordObjectState::Invalid;
8489LobbyMemberHandle::LobbyMemberHandle(
const LobbyMemberHandle& other)
8494 Discord_LobbyMemberHandle_Clone(&instance_, other.instance());
8496 state_ = DiscordObjectState::Owned;
8499LobbyMemberHandle& LobbyMemberHandle::operator=(
const LobbyMemberHandle& other)
8501 if (
this != &other) {
8502 if (state_ == DiscordObjectState::Owned) {
8504 state_ = DiscordObjectState::Invalid;
8506 if (other.state_ == DiscordObjectState::Owned) {
8507 Discord_LobbyMemberHandle_Clone(&instance_, other.instance());
8509 state_ = DiscordObjectState::Owned;
8514LobbyMemberHandle::LobbyMemberHandle(Discord_LobbyMemberHandle instance, DiscordObjectState state)
8515 : instance_(instance)
8519void LobbyMemberHandle::Drop()
8521 if (state_ != DiscordObjectState::Owned) {
8524 Discord_LobbyMemberHandle_Drop(&instance_);
8525 state_ = DiscordObjectState::Invalid;
8527bool LobbyMemberHandle::CanLinkLobby()
const
8529 assert(state_ == DiscordObjectState::Owned);
8531 returnValue__ = Discord_LobbyMemberHandle_CanLinkLobby(&instance_);
8532 return returnValue__;
8534bool LobbyMemberHandle::Connected()
const
8536 assert(state_ == DiscordObjectState::Owned);
8538 returnValue__ = Discord_LobbyMemberHandle_Connected(&instance_);
8539 return returnValue__;
8541uint64_t LobbyMemberHandle::Id()
const
8543 assert(state_ == DiscordObjectState::Owned);
8544 uint64_t returnValue__;
8545 returnValue__ = Discord_LobbyMemberHandle_Id(&instance_);
8546 return returnValue__;
8548std::unordered_map<std::string, std::string> LobbyMemberHandle::Metadata()
const
8550 assert(state_ == DiscordObjectState::Owned);
8551 Discord_Properties returnValueNative__;
8552 Discord_LobbyMemberHandle_Metadata(&instance_, &returnValueNative__);
8553 std::unordered_map<std::string, std::string> returnValue__ =
8554 ConvertReturnedProperties(returnValueNative__);
8555 Discord_FreeProperties(returnValueNative__);
8556 return returnValue__;
8558std::optional<discordpp::UserHandle> LobbyMemberHandle::User()
const
8560 assert(state_ == DiscordObjectState::Owned);
8561 bool returnIsNonNull__;
8562 Discord_UserHandle returnValueNative__;
8563 returnIsNonNull__ = Discord_LobbyMemberHandle_User(&instance_, &returnValueNative__);
8564 if (!returnIsNonNull__) {
8568 return returnValue__;
8570const LobbyHandle LobbyHandle::nullobj{{}, DiscordObjectState::Invalid};
8571LobbyHandle::~LobbyHandle()
8573 if (state_ == DiscordObjectState::Owned) {
8575 state_ = DiscordObjectState::Invalid;
8578LobbyHandle::LobbyHandle(LobbyHandle&& other) noexcept
8579 : instance_(other.instance_)
8580 , state_(other.state_)
8582 other.state_ = DiscordObjectState::Invalid;
8584LobbyHandle& LobbyHandle::operator=(LobbyHandle&& other)
noexcept
8586 if (
this != &other) {
8587 if (state_ == DiscordObjectState::Owned) {
8590 instance_ = other.instance_;
8591 state_ = other.state_;
8592 other.state_ = DiscordObjectState::Invalid;
8596LobbyHandle::LobbyHandle(
const LobbyHandle& other)
8601 Discord_LobbyHandle_Clone(&instance_, other.instance());
8603 state_ = DiscordObjectState::Owned;
8606LobbyHandle& LobbyHandle::operator=(
const LobbyHandle& other)
8608 if (
this != &other) {
8609 if (state_ == DiscordObjectState::Owned) {
8611 state_ = DiscordObjectState::Invalid;
8613 if (other.state_ == DiscordObjectState::Owned) {
8614 Discord_LobbyHandle_Clone(&instance_, other.instance());
8616 state_ = DiscordObjectState::Owned;
8621LobbyHandle::LobbyHandle(Discord_LobbyHandle instance, DiscordObjectState state)
8622 : instance_(instance)
8626void LobbyHandle::Drop()
8628 if (state_ != DiscordObjectState::Owned) {
8631 Discord_LobbyHandle_Drop(&instance_);
8632 state_ = DiscordObjectState::Invalid;
8634std::optional<discordpp::CallInfoHandle> LobbyHandle::GetCallInfoHandle()
const
8636 assert(state_ == DiscordObjectState::Owned);
8637 bool returnIsNonNull__;
8638 Discord_CallInfoHandle returnValueNative__;
8639 returnIsNonNull__ = Discord_LobbyHandle_GetCallInfoHandle(&instance_, &returnValueNative__);
8640 if (!returnIsNonNull__) {
8644 return returnValue__;
8646std::optional<discordpp::LobbyMemberHandle> LobbyHandle::GetLobbyMemberHandle(
8647 uint64_t memberId)
const
8649 assert(state_ == DiscordObjectState::Owned);
8650 bool returnIsNonNull__;
8651 Discord_LobbyMemberHandle returnValueNative__;
8653 Discord_LobbyHandle_GetLobbyMemberHandle(&instance_, memberId, &returnValueNative__);
8654 if (!returnIsNonNull__) {
8658 return returnValue__;
8660uint64_t LobbyHandle::Id()
const
8662 assert(state_ == DiscordObjectState::Owned);
8663 uint64_t returnValue__;
8664 returnValue__ = Discord_LobbyHandle_Id(&instance_);
8665 return returnValue__;
8667std::optional<discordpp::LinkedChannel> LobbyHandle::LinkedChannel()
const
8669 assert(state_ == DiscordObjectState::Owned);
8670 bool returnIsNonNull__;
8671 Discord_LinkedChannel returnValueNative__;
8672 returnIsNonNull__ = Discord_LobbyHandle_LinkedChannel(&instance_, &returnValueNative__);
8673 if (!returnIsNonNull__) {
8677 return returnValue__;
8679std::vector<uint64_t> LobbyHandle::LobbyMemberIds()
const
8681 assert(state_ == DiscordObjectState::Owned);
8682 Discord_UInt64Span returnValueNative__;
8683 Discord_LobbyHandle_LobbyMemberIds(&instance_, &returnValueNative__);
8684 std::vector<uint64_t> returnValue__(returnValueNative__.ptr,
8685 returnValueNative__.ptr + returnValueNative__.size);
8686 Discord_Free(returnValueNative__.ptr);
8687 return returnValue__;
8689std::vector<discordpp::LobbyMemberHandle> LobbyHandle::LobbyMembers()
const
8691 assert(state_ == DiscordObjectState::Owned);
8692 Discord_LobbyMemberHandleSpan returnValueNative__;
8693 Discord_LobbyHandle_LobbyMembers(&instance_, &returnValueNative__);
8694 std::vector<discordpp::LobbyMemberHandle> returnValue__;
8695 returnValue__.reserve(returnValueNative__.size);
8696 for (
size_t i__ = 0; i__ < returnValueNative__.size; ++i__) {
8697 returnValue__.emplace_back(returnValueNative__.ptr[i__], DiscordObjectState::Owned);
8699 Discord_Free(returnValueNative__.ptr);
8700 return returnValue__;
8702std::unordered_map<std::string, std::string> LobbyHandle::Metadata()
const
8704 assert(state_ == DiscordObjectState::Owned);
8705 Discord_Properties returnValueNative__;
8706 Discord_LobbyHandle_Metadata(&instance_, &returnValueNative__);
8707 std::unordered_map<std::string, std::string> returnValue__ =
8708 ConvertReturnedProperties(returnValueNative__);
8709 Discord_FreeProperties(returnValueNative__);
8710 return returnValue__;
8712const AdditionalContent AdditionalContent::nullobj{{}, DiscordObjectState::Invalid};
8713AdditionalContent::~AdditionalContent()
8715 if (state_ == DiscordObjectState::Owned) {
8717 state_ = DiscordObjectState::Invalid;
8720AdditionalContent::AdditionalContent(AdditionalContent&& other) noexcept
8721 : instance_(other.instance_)
8722 , state_(other.state_)
8724 other.state_ = DiscordObjectState::Invalid;
8726AdditionalContent& AdditionalContent::operator=(AdditionalContent&& other)
noexcept
8728 if (
this != &other) {
8729 if (state_ == DiscordObjectState::Owned) {
8732 instance_ = other.instance_;
8733 state_ = other.state_;
8734 other.state_ = DiscordObjectState::Invalid;
8738AdditionalContent::AdditionalContent(
const AdditionalContent& arg0)
8743 Discord_AdditionalContent_Clone(&instance_, arg0.instance());
8745 state_ = DiscordObjectState::Owned;
8748AdditionalContent& AdditionalContent::operator=(
const AdditionalContent& arg0)
8750 if (
this != &arg0) {
8751 if (state_ == DiscordObjectState::Owned) {
8753 state_ = DiscordObjectState::Invalid;
8755 if (arg0.state_ == DiscordObjectState::Owned) {
8756 Discord_AdditionalContent_Clone(&instance_, arg0.instance());
8758 state_ = DiscordObjectState::Owned;
8763AdditionalContent::AdditionalContent(Discord_AdditionalContent instance, DiscordObjectState state)
8764 : instance_(instance)
8768AdditionalContent::AdditionalContent()
8770 assert(state_ == DiscordObjectState::Invalid);
8771 Discord_AdditionalContent_Init(&instance_);
8772 state_ = DiscordObjectState::Owned;
8774void AdditionalContent::Drop()
8776 if (state_ != DiscordObjectState::Owned) {
8779 Discord_AdditionalContent_Drop(&instance_);
8780 state_ = DiscordObjectState::Invalid;
8784 assert(state_ == DiscordObjectState::Owned);
8786 returnValue__ = Discord_AdditionalContent_Equals(&instance_, rhs.instance());
8787 return returnValue__;
8791 Discord_String returnValueNative__;
8792 Discord_AdditionalContent_TypeToString(
static_cast<Discord_AdditionalContentType
>(type),
8793 &returnValueNative__);
8794 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
8795 returnValueNative__.size);
8796 Discord_Free(returnValueNative__.ptr);
8797 return returnValue__;
8801 assert(state_ == DiscordObjectState::Owned);
8802 Discord_AdditionalContentType returnValue__;
8803 returnValue__ = Discord_AdditionalContent_Type(&instance_);
8808 assert(state_ == DiscordObjectState::Owned);
8809 Discord_AdditionalContent_SetType(&instance_,
static_cast<Discord_AdditionalContentType
>(Type));
8811std::optional<std::string> AdditionalContent::Title()
const
8813 assert(state_ == DiscordObjectState::Owned);
8814 bool returnIsNonNull__;
8815 Discord_String returnValueNative__;
8816 returnIsNonNull__ = Discord_AdditionalContent_Title(&instance_, &returnValueNative__);
8817 if (!returnIsNonNull__) {
8820 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
8821 returnValueNative__.size);
8822 Discord_Free(returnValueNative__.ptr);
8823 return returnValue__;
8825void AdditionalContent::SetTitle(std::optional<std::string> Title)
8827 assert(state_ == DiscordObjectState::Owned);
8828 Discord_String Title__str{};
8829 if (Title.has_value()) {
8830 Title__str.ptr =
reinterpret_cast<uint8_t*
>(Title->data());
8831 Title__str.size = Title->size();
8833 Discord_AdditionalContent_SetTitle(&instance_, (Title.has_value() ? &Title__str :
nullptr));
8835uint8_t AdditionalContent::Count()
const
8837 assert(state_ == DiscordObjectState::Owned);
8838 uint8_t returnValue__;
8839 returnValue__ = Discord_AdditionalContent_Count(&instance_);
8840 return returnValue__;
8842void AdditionalContent::SetCount(uint8_t Count)
8844 assert(state_ == DiscordObjectState::Owned);
8845 Discord_AdditionalContent_SetCount(&instance_, Count);
8847const MessageHandle MessageHandle::nullobj{{}, DiscordObjectState::Invalid};
8848MessageHandle::~MessageHandle()
8850 if (state_ == DiscordObjectState::Owned) {
8852 state_ = DiscordObjectState::Invalid;
8855MessageHandle::MessageHandle(MessageHandle&& other) noexcept
8856 : instance_(other.instance_)
8857 , state_(other.state_)
8859 other.state_ = DiscordObjectState::Invalid;
8861MessageHandle& MessageHandle::operator=(MessageHandle&& other)
noexcept
8863 if (
this != &other) {
8864 if (state_ == DiscordObjectState::Owned) {
8867 instance_ = other.instance_;
8868 state_ = other.state_;
8869 other.state_ = DiscordObjectState::Invalid;
8873MessageHandle::MessageHandle(
const MessageHandle& other)
8878 Discord_MessageHandle_Clone(&instance_, other.instance());
8880 state_ = DiscordObjectState::Owned;
8883MessageHandle& MessageHandle::operator=(
const MessageHandle& other)
8885 if (
this != &other) {
8886 if (state_ == DiscordObjectState::Owned) {
8888 state_ = DiscordObjectState::Invalid;
8890 if (other.state_ == DiscordObjectState::Owned) {
8891 Discord_MessageHandle_Clone(&instance_, other.instance());
8893 state_ = DiscordObjectState::Owned;
8898MessageHandle::MessageHandle(Discord_MessageHandle instance, DiscordObjectState state)
8899 : instance_(instance)
8903void MessageHandle::Drop()
8905 if (state_ != DiscordObjectState::Owned) {
8908 Discord_MessageHandle_Drop(&instance_);
8909 state_ = DiscordObjectState::Invalid;
8911std::optional<discordpp::AdditionalContent> MessageHandle::AdditionalContent()
const
8913 assert(state_ == DiscordObjectState::Owned);
8914 bool returnIsNonNull__;
8915 Discord_AdditionalContent returnValueNative__;
8916 returnIsNonNull__ = Discord_MessageHandle_AdditionalContent(&instance_, &returnValueNative__);
8917 if (!returnIsNonNull__) {
8921 return returnValue__;
8923std::optional<uint64_t> MessageHandle::ApplicationId()
const
8925 assert(state_ == DiscordObjectState::Owned);
8926 bool returnIsNonNull__;
8927 uint64_t returnValue__;
8928 returnIsNonNull__ = Discord_MessageHandle_ApplicationId(&instance_, &returnValue__);
8929 if (!returnIsNonNull__) {
8930 return std::nullopt;
8932 return returnValue__;
8934std::optional<discordpp::UserHandle> MessageHandle::Author()
const
8936 assert(state_ == DiscordObjectState::Owned);
8937 bool returnIsNonNull__;
8938 Discord_UserHandle returnValueNative__;
8939 returnIsNonNull__ = Discord_MessageHandle_Author(&instance_, &returnValueNative__);
8940 if (!returnIsNonNull__) {
8944 return returnValue__;
8946uint64_t MessageHandle::AuthorId()
const
8948 assert(state_ == DiscordObjectState::Owned);
8949 uint64_t returnValue__;
8950 returnValue__ = Discord_MessageHandle_AuthorId(&instance_);
8951 return returnValue__;
8953std::optional<discordpp::ChannelHandle> MessageHandle::Channel()
const
8955 assert(state_ == DiscordObjectState::Owned);
8956 bool returnIsNonNull__;
8957 Discord_ChannelHandle returnValueNative__;
8958 returnIsNonNull__ = Discord_MessageHandle_Channel(&instance_, &returnValueNative__);
8959 if (!returnIsNonNull__) {
8963 return returnValue__;
8965uint64_t MessageHandle::ChannelId()
const
8967 assert(state_ == DiscordObjectState::Owned);
8968 uint64_t returnValue__;
8969 returnValue__ = Discord_MessageHandle_ChannelId(&instance_);
8970 return returnValue__;
8972std::string MessageHandle::Content()
const
8974 assert(state_ == DiscordObjectState::Owned);
8975 Discord_String returnValueNative__;
8976 Discord_MessageHandle_Content(&instance_, &returnValueNative__);
8977 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
8978 returnValueNative__.size);
8979 Discord_Free(returnValueNative__.ptr);
8980 return returnValue__;
8982std::optional<discordpp::DisclosureTypes> MessageHandle::DisclosureType()
const
8984 assert(state_ == DiscordObjectState::Owned);
8985 bool returnIsNonNull__;
8986 Discord_DisclosureTypes returnValueNative__;
8987 returnIsNonNull__ = Discord_MessageHandle_DisclosureType(&instance_, &returnValueNative__);
8988 if (!returnIsNonNull__) {
8992 return returnValue__;
8994uint64_t MessageHandle::EditedTimestamp()
const
8996 assert(state_ == DiscordObjectState::Owned);
8997 uint64_t returnValue__;
8998 returnValue__ = Discord_MessageHandle_EditedTimestamp(&instance_);
8999 return returnValue__;
9001uint64_t MessageHandle::Id()
const
9003 assert(state_ == DiscordObjectState::Owned);
9004 uint64_t returnValue__;
9005 returnValue__ = Discord_MessageHandle_Id(&instance_);
9006 return returnValue__;
9008std::optional<discordpp::LobbyHandle> MessageHandle::Lobby()
const
9010 assert(state_ == DiscordObjectState::Owned);
9011 bool returnIsNonNull__;
9012 Discord_LobbyHandle returnValueNative__;
9013 returnIsNonNull__ = Discord_MessageHandle_Lobby(&instance_, &returnValueNative__);
9014 if (!returnIsNonNull__) {
9018 return returnValue__;
9020std::unordered_map<std::string, std::string> MessageHandle::Metadata()
const
9022 assert(state_ == DiscordObjectState::Owned);
9023 Discord_Properties returnValueNative__;
9024 Discord_MessageHandle_Metadata(&instance_, &returnValueNative__);
9025 std::unordered_map<std::string, std::string> returnValue__ =
9026 ConvertReturnedProperties(returnValueNative__);
9027 Discord_FreeProperties(returnValueNative__);
9028 return returnValue__;
9030std::string MessageHandle::RawContent()
const
9032 assert(state_ == DiscordObjectState::Owned);
9033 Discord_String returnValueNative__;
9034 Discord_MessageHandle_RawContent(&instance_, &returnValueNative__);
9035 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
9036 returnValueNative__.size);
9037 Discord_Free(returnValueNative__.ptr);
9038 return returnValue__;
9040std::optional<discordpp::UserHandle> MessageHandle::Recipient()
const
9042 assert(state_ == DiscordObjectState::Owned);
9043 bool returnIsNonNull__;
9044 Discord_UserHandle returnValueNative__;
9045 returnIsNonNull__ = Discord_MessageHandle_Recipient(&instance_, &returnValueNative__);
9046 if (!returnIsNonNull__) {
9050 return returnValue__;
9052uint64_t MessageHandle::RecipientId()
const
9054 assert(state_ == DiscordObjectState::Owned);
9055 uint64_t returnValue__;
9056 returnValue__ = Discord_MessageHandle_RecipientId(&instance_);
9057 return returnValue__;
9059bool MessageHandle::SentFromGame()
const
9061 assert(state_ == DiscordObjectState::Owned);
9063 returnValue__ = Discord_MessageHandle_SentFromGame(&instance_);
9064 return returnValue__;
9066uint64_t MessageHandle::SentTimestamp()
const
9068 assert(state_ == DiscordObjectState::Owned);
9069 uint64_t returnValue__;
9070 returnValue__ = Discord_MessageHandle_SentTimestamp(&instance_);
9071 return returnValue__;
9073const AudioDevice AudioDevice::nullobj{{}, DiscordObjectState::Invalid};
9074AudioDevice::~AudioDevice()
9076 if (state_ == DiscordObjectState::Owned) {
9078 state_ = DiscordObjectState::Invalid;
9081AudioDevice::AudioDevice(AudioDevice&& other) noexcept
9082 : instance_(other.instance_)
9083 , state_(other.state_)
9085 other.state_ = DiscordObjectState::Invalid;
9087AudioDevice& AudioDevice::operator=(AudioDevice&& other)
noexcept
9089 if (
this != &other) {
9090 if (state_ == DiscordObjectState::Owned) {
9093 instance_ = other.instance_;
9094 state_ = other.state_;
9095 other.state_ = DiscordObjectState::Invalid;
9099AudioDevice::AudioDevice(
const AudioDevice& arg0)
9104 Discord_AudioDevice_Clone(&instance_, arg0.instance());
9106 state_ = DiscordObjectState::Owned;
9109AudioDevice& AudioDevice::operator=(
const AudioDevice& arg0)
9111 if (
this != &arg0) {
9112 if (state_ == DiscordObjectState::Owned) {
9114 state_ = DiscordObjectState::Invalid;
9116 if (arg0.state_ == DiscordObjectState::Owned) {
9117 Discord_AudioDevice_Clone(&instance_, arg0.instance());
9119 state_ = DiscordObjectState::Owned;
9124AudioDevice::AudioDevice(Discord_AudioDevice instance, DiscordObjectState state)
9125 : instance_(instance)
9129void AudioDevice::Drop()
9131 if (state_ != DiscordObjectState::Owned) {
9134 Discord_AudioDevice_Drop(&instance_);
9135 state_ = DiscordObjectState::Invalid;
9139 assert(state_ == DiscordObjectState::Owned);
9141 returnValue__ = Discord_AudioDevice_Equals(&instance_, rhs.instance());
9142 return returnValue__;
9144std::string AudioDevice::Id()
const
9146 assert(state_ == DiscordObjectState::Owned);
9147 Discord_String returnValueNative__;
9148 Discord_AudioDevice_Id(&instance_, &returnValueNative__);
9149 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
9150 returnValueNative__.size);
9151 Discord_Free(returnValueNative__.ptr);
9152 return returnValue__;
9154void AudioDevice::SetId(std::string Id)
9156 assert(state_ == DiscordObjectState::Owned);
9157 Discord_String Id__str{(uint8_t*)(Id.data()), Id.size()};
9158 Discord_AudioDevice_SetId(&instance_, Id__str);
9160std::string AudioDevice::Name()
const
9162 assert(state_ == DiscordObjectState::Owned);
9163 Discord_String returnValueNative__;
9164 Discord_AudioDevice_Name(&instance_, &returnValueNative__);
9165 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
9166 returnValueNative__.size);
9167 Discord_Free(returnValueNative__.ptr);
9168 return returnValue__;
9170void AudioDevice::SetName(std::string Name)
9172 assert(state_ == DiscordObjectState::Owned);
9173 Discord_String Name__str{(uint8_t*)(Name.data()), Name.size()};
9174 Discord_AudioDevice_SetName(&instance_, Name__str);
9176bool AudioDevice::IsDefault()
const
9178 assert(state_ == DiscordObjectState::Owned);
9180 returnValue__ = Discord_AudioDevice_IsDefault(&instance_);
9181 return returnValue__;
9183void AudioDevice::SetIsDefault(
bool IsDefault)
9185 assert(state_ == DiscordObjectState::Owned);
9186 Discord_AudioDevice_SetIsDefault(&instance_, IsDefault);
9188const ClientCreateOptions ClientCreateOptions::nullobj{{}, DiscordObjectState::Invalid};
9189ClientCreateOptions::~ClientCreateOptions()
9191 if (state_ == DiscordObjectState::Owned) {
9193 state_ = DiscordObjectState::Invalid;
9196ClientCreateOptions::ClientCreateOptions(ClientCreateOptions&& other) noexcept
9197 : instance_(other.instance_)
9198 , state_(other.state_)
9200 other.state_ = DiscordObjectState::Invalid;
9202ClientCreateOptions& ClientCreateOptions::operator=(ClientCreateOptions&& other)
noexcept
9204 if (
this != &other) {
9205 if (state_ == DiscordObjectState::Owned) {
9208 instance_ = other.instance_;
9209 state_ = other.state_;
9210 other.state_ = DiscordObjectState::Invalid;
9214ClientCreateOptions::ClientCreateOptions(
const ClientCreateOptions& arg0)
9219 Discord_ClientCreateOptions_Clone(&instance_, arg0.instance());
9221 state_ = DiscordObjectState::Owned;
9224ClientCreateOptions& ClientCreateOptions::operator=(
const ClientCreateOptions& arg0)
9226 if (
this != &arg0) {
9227 if (state_ == DiscordObjectState::Owned) {
9229 state_ = DiscordObjectState::Invalid;
9231 if (arg0.state_ == DiscordObjectState::Owned) {
9232 Discord_ClientCreateOptions_Clone(&instance_, arg0.instance());
9234 state_ = DiscordObjectState::Owned;
9239ClientCreateOptions::ClientCreateOptions(Discord_ClientCreateOptions instance,
9240 DiscordObjectState state)
9241 : instance_(instance)
9245ClientCreateOptions::ClientCreateOptions()
9247 assert(state_ == DiscordObjectState::Invalid);
9248 Discord_ClientCreateOptions_Init(&instance_);
9249 state_ = DiscordObjectState::Owned;
9251void ClientCreateOptions::Drop()
9253 if (state_ != DiscordObjectState::Owned) {
9256 Discord_ClientCreateOptions_Drop(&instance_);
9257 state_ = DiscordObjectState::Invalid;
9259std::string ClientCreateOptions::WebBase()
const
9261 assert(state_ == DiscordObjectState::Owned);
9262 Discord_String returnValueNative__;
9263 Discord_ClientCreateOptions_WebBase(&instance_, &returnValueNative__);
9264 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
9265 returnValueNative__.size);
9266 Discord_Free(returnValueNative__.ptr);
9267 return returnValue__;
9269void ClientCreateOptions::SetWebBase(std::string WebBase)
9271 assert(state_ == DiscordObjectState::Owned);
9272 Discord_String WebBase__str{(uint8_t*)(WebBase.data()), WebBase.size()};
9273 Discord_ClientCreateOptions_SetWebBase(&instance_, WebBase__str);
9275std::string ClientCreateOptions::ApiBase()
const
9277 assert(state_ == DiscordObjectState::Owned);
9278 Discord_String returnValueNative__;
9279 Discord_ClientCreateOptions_ApiBase(&instance_, &returnValueNative__);
9280 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
9281 returnValueNative__.size);
9282 Discord_Free(returnValueNative__.ptr);
9283 return returnValue__;
9285void ClientCreateOptions::SetApiBase(std::string ApiBase)
9287 assert(state_ == DiscordObjectState::Owned);
9288 Discord_String ApiBase__str{(uint8_t*)(ApiBase.data()), ApiBase.size()};
9289 Discord_ClientCreateOptions_SetApiBase(&instance_, ApiBase__str);
9293 assert(state_ == DiscordObjectState::Owned);
9294 Discord_AudioSystem returnValue__;
9295 returnValue__ = Discord_ClientCreateOptions_ExperimentalAudioSystem(&instance_);
9300 assert(state_ == DiscordObjectState::Owned);
9301 Discord_ClientCreateOptions_SetExperimentalAudioSystem(
9302 &instance_,
static_cast<Discord_AudioSystem
>(ExperimentalAudioSystem));
9304const Client Client::nullobj{{}, DiscordObjectState::Invalid};
9307 if (state_ == DiscordObjectState::Owned) {
9309 state_ = DiscordObjectState::Invalid;
9312Client::Client(Client&& other) noexcept
9313 : instance_(other.instance_)
9314 , state_(other.state_)
9316 other.state_ = DiscordObjectState::Invalid;
9318Client& Client::operator=(Client&& other)
noexcept
9320 if (
this != &other) {
9321 if (state_ == DiscordObjectState::Owned) {
9324 instance_ = other.instance_;
9325 state_ = other.state_;
9326 other.state_ = DiscordObjectState::Invalid;
9330Client::Client(Discord_Client instance, DiscordObjectState state)
9331 : instance_(instance)
9337 assert(state_ == DiscordObjectState::Invalid);
9338 Discord_Client_Init(&instance_);
9339 state_ = DiscordObjectState::Owned;
9341Client::Client(std::string apiBase, std::string webBase)
9343 assert(state_ == DiscordObjectState::Invalid);
9344 Discord_String apiBase__str{(uint8_t*)(apiBase.data()), apiBase.size()};
9345 Discord_String webBase__str{(uint8_t*)(webBase.data()), webBase.size()};
9346 Discord_Client_InitWithBases(&instance_, apiBase__str, webBase__str);
9347 state_ = DiscordObjectState::Owned;
9351 assert(state_ == DiscordObjectState::Invalid);
9352 Discord_Client_InitWithOptions(&instance_, options.instance());
9353 state_ = DiscordObjectState::Owned;
9357 if (state_ != DiscordObjectState::Owned) {
9360 Discord_Client_Drop(&instance_);
9361 state_ = DiscordObjectState::Invalid;
9365 Discord_String returnValueNative__;
9366 Discord_Client_ErrorToString(
static_cast<Discord_Client_Error
>(type), &returnValueNative__);
9367 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
9368 returnValueNative__.size);
9369 Discord_Free(returnValueNative__.ptr);
9370 return returnValue__;
9372uint64_t Client::GetApplicationId()
9374 assert(state_ == DiscordObjectState::Owned);
9375 uint64_t returnValue__;
9376 returnValue__ = Discord_Client_GetApplicationId(&instance_);
9377 return returnValue__;
9379std::string Client::GetDefaultAudioDeviceId()
9381 Discord_String returnValueNative__;
9382 Discord_Client_GetDefaultAudioDeviceId(&returnValueNative__);
9383 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
9384 returnValueNative__.size);
9385 Discord_Free(returnValueNative__.ptr);
9386 return returnValue__;
9388std::string Client::GetDefaultCommunicationScopes()
9390 Discord_String returnValueNative__;
9391 Discord_Client_GetDefaultCommunicationScopes(&returnValueNative__);
9392 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
9393 returnValueNative__.size);
9394 Discord_Free(returnValueNative__.ptr);
9395 return returnValue__;
9397std::string Client::GetDefaultPresenceScopes()
9399 Discord_String returnValueNative__;
9400 Discord_Client_GetDefaultPresenceScopes(&returnValueNative__);
9401 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
9402 returnValueNative__.size);
9403 Discord_Free(returnValueNative__.ptr);
9404 return returnValue__;
9406std::string Client::GetVersionHash()
9408 Discord_String returnValueNative__;
9409 Discord_Client_GetVersionHash(&returnValueNative__);
9410 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
9411 returnValueNative__.size);
9412 Discord_Free(returnValueNative__.ptr);
9413 return returnValue__;
9415int32_t Client::GetVersionMajor()
9417 int32_t returnValue__;
9418 returnValue__ = Discord_Client_GetVersionMajor();
9419 return returnValue__;
9421int32_t Client::GetVersionMinor()
9423 int32_t returnValue__;
9424 returnValue__ = Discord_Client_GetVersionMinor();
9425 return returnValue__;
9427int32_t Client::GetVersionPatch()
9429 int32_t returnValue__;
9430 returnValue__ = Discord_Client_GetVersionPatch();
9431 return returnValue__;
9433void Client::SetHttpRequestTimeout(int32_t httpTimeoutInMilliseconds)
9435 assert(state_ == DiscordObjectState::Owned);
9436 Discord_Client_SetHttpRequestTimeout(&instance_, httpTimeoutInMilliseconds);
9440 Discord_String returnValueNative__;
9441 Discord_Client_StatusToString(
static_cast<Discord_Client_Status
>(type), &returnValueNative__);
9442 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
9443 returnValueNative__.size);
9444 Discord_Free(returnValueNative__.ptr);
9445 return returnValue__;
9449 Discord_String returnValueNative__;
9450 Discord_Client_ThreadToString(
static_cast<Discord_Client_Thread
>(type), &returnValueNative__);
9451 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
9452 returnValueNative__.size);
9453 Discord_Free(returnValueNative__.ptr);
9454 return returnValue__;
9458 assert(state_ == DiscordObjectState::Owned);
9459 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
9460 auto callback__userData =
new Tcallback__UserData(callback);
9461 Discord_Client_EndCallCallback callback__native = [](
void* userData__) {
9462 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
9463 userData__typed->delegate();
9465 Discord_Client_EndCall(
9466 &instance_, channelId, callback__native, Tcallback__UserData::Free, callback__userData);
9470 assert(state_ == DiscordObjectState::Owned);
9471 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
9472 auto callback__userData =
new Tcallback__UserData(callback);
9473 Discord_Client_EndCallsCallback callback__native = [](
void* userData__) {
9474 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
9475 userData__typed->delegate();
9477 Discord_Client_EndCalls(
9478 &instance_, callback__native, Tcallback__UserData::Free, callback__userData);
9482 assert(state_ == DiscordObjectState::Owned);
9483 bool returnIsNonNull__;
9484 Discord_Call returnValueNative__{};
9485 returnIsNonNull__ = Discord_Client_GetCall(&instance_, channelId, &returnValueNative__);
9487 returnValueNative__,
9488 returnIsNonNull__ ? DiscordObjectState::Owned : DiscordObjectState::Invalid);
9489 return returnValue__;
9491std::vector<discordpp::Call> Client::GetCalls()
9493 assert(state_ == DiscordObjectState::Owned);
9494 Discord_CallSpan returnValueNative__;
9495 Discord_Client_GetCalls(&instance_, &returnValueNative__);
9496 std::vector<discordpp::Call> returnValue__;
9497 returnValue__.reserve(returnValueNative__.size);
9498 for (
size_t i__ = 0; i__ < returnValueNative__.size; ++i__) {
9499 returnValue__.emplace_back(returnValueNative__.ptr[i__], DiscordObjectState::Owned);
9501 Discord_Free(returnValueNative__.ptr);
9502 return returnValue__;
9506 assert(state_ == DiscordObjectState::Owned);
9507 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
9508 auto cb__userData =
new Tcb__UserData(cb);
9509 Discord_Client_GetCurrentInputDeviceCallback cb__native = [](
auto device,
void* userData__) {
9510 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
9512 userData__typed->delegate(std::move(device__obj));
9514 Discord_Client_GetCurrentInputDevice(&instance_, cb__native, Tcb__UserData::Free, cb__userData);
9518 assert(state_ == DiscordObjectState::Owned);
9519 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
9520 auto cb__userData =
new Tcb__UserData(cb);
9521 Discord_Client_GetCurrentOutputDeviceCallback cb__native = [](
auto device,
void* userData__) {
9522 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
9524 userData__typed->delegate(std::move(device__obj));
9526 Discord_Client_GetCurrentOutputDevice(
9527 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
9531 assert(state_ == DiscordObjectState::Owned);
9532 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
9533 auto cb__userData =
new Tcb__UserData(cb);
9534 Discord_Client_GetInputDevicesCallback cb__native = [](
auto devices,
void* userData__) {
9535 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
9536 std::vector<discordpp::AudioDevice> devices__vec;
9537 devices__vec.reserve(devices.size);
9538 for (
size_t i__ = 0; i__ < devices.size; ++i__) {
9539 devices__vec.emplace_back(devices.ptr[i__], DiscordObjectState::Owned);
9541 Discord_Free(devices.ptr);
9542 userData__typed->delegate(std::move(devices__vec));
9544 Discord_Client_GetInputDevices(&instance_, cb__native, Tcb__UserData::Free, cb__userData);
9546float Client::GetInputVolume()
9548 assert(state_ == DiscordObjectState::Owned);
9549 float returnValue__;
9550 returnValue__ = Discord_Client_GetInputVolume(&instance_);
9551 return returnValue__;
9555 assert(state_ == DiscordObjectState::Owned);
9556 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
9557 auto cb__userData =
new Tcb__UserData(cb);
9558 Discord_Client_GetOutputDevicesCallback cb__native = [](
auto devices,
void* userData__) {
9559 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
9560 std::vector<discordpp::AudioDevice> devices__vec;
9561 devices__vec.reserve(devices.size);
9562 for (
size_t i__ = 0; i__ < devices.size; ++i__) {
9563 devices__vec.emplace_back(devices.ptr[i__], DiscordObjectState::Owned);
9565 Discord_Free(devices.ptr);
9566 userData__typed->delegate(std::move(devices__vec));
9568 Discord_Client_GetOutputDevices(&instance_, cb__native, Tcb__UserData::Free, cb__userData);
9570float Client::GetOutputVolume()
9572 assert(state_ == DiscordObjectState::Owned);
9573 float returnValue__;
9574 returnValue__ = Discord_Client_GetOutputVolume(&instance_);
9575 return returnValue__;
9577bool Client::GetSelfDeafAll()
const
9579 assert(state_ == DiscordObjectState::Owned);
9581 returnValue__ = Discord_Client_GetSelfDeafAll(&instance_);
9582 return returnValue__;
9584bool Client::GetSelfMuteAll()
const
9586 assert(state_ == DiscordObjectState::Owned);
9588 returnValue__ = Discord_Client_GetSelfMuteAll(&instance_);
9589 return returnValue__;
9591void Client::SetAecDump(
bool on)
9593 assert(state_ == DiscordObjectState::Owned);
9594 Discord_Client_SetAecDump(&instance_, on);
9596void Client::SetAutomaticGainControl(
bool on)
9598 assert(state_ == DiscordObjectState::Owned);
9599 Discord_Client_SetAutomaticGainControl(&instance_, on);
9603 assert(state_ == DiscordObjectState::Owned);
9604 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
9605 auto callback__userData =
new Tcallback__UserData(callback);
9606 Discord_Client_DeviceChangeCallback callback__native =
9607 [](
auto inputDevices,
auto outputDevices,
void* userData__) {
9608 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
9609 std::vector<discordpp::AudioDevice> inputDevices__vec;
9610 inputDevices__vec.reserve(inputDevices.size);
9611 for (
size_t i__ = 0; i__ < inputDevices.size; ++i__) {
9612 inputDevices__vec.emplace_back(inputDevices.ptr[i__], DiscordObjectState::Owned);
9614 Discord_Free(inputDevices.ptr);
9615 std::vector<discordpp::AudioDevice> outputDevices__vec;
9616 outputDevices__vec.reserve(outputDevices.size);
9617 for (
size_t i__ = 0; i__ < outputDevices.size; ++i__) {
9618 outputDevices__vec.emplace_back(outputDevices.ptr[i__], DiscordObjectState::Owned);
9620 Discord_Free(outputDevices.ptr);
9621 userData__typed->delegate(std::move(inputDevices__vec), std::move(outputDevices__vec));
9623 Discord_Client_SetDeviceChangeCallback(
9624 &instance_, callback__native, Tcallback__UserData::Free, callback__userData);
9626void Client::SetEchoCancellation(
bool on)
9628 assert(state_ == DiscordObjectState::Owned);
9629 Discord_Client_SetEchoCancellation(&instance_, on);
9631void Client::SetEngineManagedAudioSession(
bool isEngineManaged)
9633 assert(state_ == DiscordObjectState::Owned);
9634 Discord_Client_SetEngineManagedAudioSession(&instance_, isEngineManaged);
9638 assert(state_ == DiscordObjectState::Owned);
9639 Discord_String deviceId__str{(uint8_t*)(deviceId.data()), deviceId.size()};
9640 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
9641 auto cb__userData =
new Tcb__UserData(cb);
9642 Discord_Client_SetInputDeviceCallback cb__native = [](
auto result,
void* userData__) {
9643 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
9645 userData__typed->delegate(std::move(result__obj));
9647 Discord_Client_SetInputDevice(
9648 &instance_, deviceId__str, cb__native, Tcb__UserData::Free, cb__userData);
9650void Client::SetInputVolume(
float inputVolume)
9652 assert(state_ == DiscordObjectState::Owned);
9653 Discord_Client_SetInputVolume(&instance_, inputVolume);
9657 assert(state_ == DiscordObjectState::Owned);
9658 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
9659 auto callback__userData =
new Tcallback__UserData(callback);
9660 Discord_Client_NoAudioInputCallback callback__native = [](
auto inputDetected,
9662 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
9663 userData__typed->delegate(inputDetected);
9665 Discord_Client_SetNoAudioInputCallback(
9666 &instance_, callback__native, Tcallback__UserData::Free, callback__userData);
9668void Client::SetNoAudioInputThreshold(
float dBFSThreshold)
9670 assert(state_ == DiscordObjectState::Owned);
9671 Discord_Client_SetNoAudioInputThreshold(&instance_, dBFSThreshold);
9673void Client::SetNoiseSuppression(
bool on)
9675 assert(state_ == DiscordObjectState::Owned);
9676 Discord_Client_SetNoiseSuppression(&instance_, on);
9678void Client::SetOpusHardwareCoding(
bool encode,
bool decode)
9680 assert(state_ == DiscordObjectState::Owned);
9681 Discord_Client_SetOpusHardwareCoding(&instance_, encode, decode);
9685 assert(state_ == DiscordObjectState::Owned);
9686 Discord_String deviceId__str{(uint8_t*)(deviceId.data()), deviceId.size()};
9687 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
9688 auto cb__userData =
new Tcb__UserData(cb);
9689 Discord_Client_SetOutputDeviceCallback cb__native = [](
auto result,
void* userData__) {
9690 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
9692 userData__typed->delegate(std::move(result__obj));
9694 Discord_Client_SetOutputDevice(
9695 &instance_, deviceId__str, cb__native, Tcb__UserData::Free, cb__userData);
9697void Client::SetOutputVolume(
float outputVolume)
9699 assert(state_ == DiscordObjectState::Owned);
9700 Discord_Client_SetOutputVolume(&instance_, outputVolume);
9702void Client::SetSelfDeafAll(
bool deaf)
9704 assert(state_ == DiscordObjectState::Owned);
9705 Discord_Client_SetSelfDeafAll(&instance_, deaf);
9707void Client::SetSelfMuteAll(
bool mute)
9709 assert(state_ == DiscordObjectState::Owned);
9710 Discord_Client_SetSelfMuteAll(&instance_, mute);
9712bool Client::SetSpeakerMode(
bool speakerMode)
9714 assert(state_ == DiscordObjectState::Owned);
9716 returnValue__ = Discord_Client_SetSpeakerMode(&instance_, speakerMode);
9717 return returnValue__;
9721 assert(state_ == DiscordObjectState::Owned);
9722 Discord_Client_SetThreadPriority(
9723 &instance_,
static_cast<Discord_Client_Thread
>(thread), priority);
9725void Client::SetVoiceParticipantChangedCallback(
9728 assert(state_ == DiscordObjectState::Owned);
9729 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
9730 auto cb__userData =
new Tcb__UserData(cb);
9731 Discord_Client_VoiceParticipantChangedCallback cb__native =
9732 [](
auto lobbyId,
auto memberId,
auto added,
void* userData__) {
9733 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
9734 userData__typed->delegate(lobbyId, memberId, added);
9736 Discord_Client_SetVoiceParticipantChangedCallback(
9737 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
9739bool Client::ShowAudioRoutePicker()
9741 assert(state_ == DiscordObjectState::Owned);
9743 returnValue__ = Discord_Client_ShowAudioRoutePicker(&instance_);
9744 return returnValue__;
9748 assert(state_ == DiscordObjectState::Owned);
9749 bool returnIsNonNull__;
9750 Discord_Call returnValueNative__{};
9751 returnIsNonNull__ = Discord_Client_StartCall(&instance_, channelId, &returnValueNative__);
9753 returnValueNative__,
9754 returnIsNonNull__ ? DiscordObjectState::Owned : DiscordObjectState::Invalid);
9755 return returnValue__;
9762 assert(state_ == DiscordObjectState::Owned);
9763 bool returnIsNonNull__;
9764 Discord_Call returnValueNative__{};
9765 using TreceivedCb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(receivedCb)>>;
9766 auto receivedCb__userData =
new TreceivedCb__UserData(receivedCb);
9767 Discord_Client_UserAudioReceivedCallback receivedCb__native = [](
auto userId,
9769 auto samplesPerChannel,
9774 auto userData__typed =
static_cast<TreceivedCb__UserData*
>(userData__);
9775 userData__typed->delegate(
9776 userId, data, samplesPerChannel, sampleRate, channels, *outShouldMute);
9778 using TcapturedCb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(capturedCb)>>;
9779 auto capturedCb__userData =
new TcapturedCb__UserData(capturedCb);
9780 Discord_Client_UserAudioCapturedCallback capturedCb__native =
9781 [](
auto data,
auto samplesPerChannel,
auto sampleRate,
auto channels,
void* userData__) {
9782 auto userData__typed =
static_cast<TcapturedCb__UserData*
>(userData__);
9783 userData__typed->delegate(data, samplesPerChannel, sampleRate, channels);
9785 returnIsNonNull__ = Discord_Client_StartCallWithAudioCallbacks(&instance_,
9788 TreceivedCb__UserData::Free,
9789 receivedCb__userData,
9791 TcapturedCb__UserData::Free,
9792 capturedCb__userData,
9793 &returnValueNative__);
9795 returnValueNative__,
9796 returnIsNonNull__ ? DiscordObjectState::Owned : DiscordObjectState::Invalid);
9797 return returnValue__;
9799void Client::AbortAuthorize()
9801 assert(state_ == DiscordObjectState::Owned);
9802 Discord_Client_AbortAuthorize(&instance_);
9804void Client::AbortGetTokenFromDevice()
9806 assert(state_ == DiscordObjectState::Owned);
9807 Discord_Client_AbortGetTokenFromDevice(&instance_);
9812 assert(state_ == DiscordObjectState::Owned);
9813 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
9814 auto callback__userData =
new Tcallback__UserData(callback);
9815 Discord_Client_AuthorizationCallback callback__native =
9816 [](
auto result,
auto code,
auto redirectUri,
void* userData__) {
9817 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
9819 std::string code__str(
reinterpret_cast<char*
>(code.ptr), code.size);
9820 std::string redirectUri__str(
reinterpret_cast<char*
>(redirectUri.ptr), redirectUri.size);
9821 userData__typed->delegate(
9822 std::move(result__obj), std::move(code__str), std::move(redirectUri__str));
9823 Discord_Free(redirectUri.ptr);
9824 Discord_Free(code.ptr);
9826 Discord_Client_Authorize(
9827 &instance_, args.instance(), callback__native, Tcallback__UserData::Free, callback__userData);
9829void Client::CloseAuthorizeDeviceScreen()
9831 assert(state_ == DiscordObjectState::Owned);
9832 Discord_Client_CloseAuthorizeDeviceScreen(&instance_);
9836 assert(state_ == DiscordObjectState::Owned);
9837 Discord_AuthorizationCodeVerifier returnValueNative__{};
9838 Discord_Client_CreateAuthorizationCodeVerifier(&instance_, &returnValueNative__);
9840 DiscordObjectState::Owned);
9841 return returnValue__;
9843void Client::ExchangeChildToken(std::string
const& parentApplicationToken,
9844 uint64_t childApplicationId,
9847 assert(state_ == DiscordObjectState::Owned);
9848 Discord_String parentApplicationToken__str{(uint8_t*)(parentApplicationToken.data()),
9849 parentApplicationToken.size()};
9850 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
9851 auto callback__userData =
new Tcallback__UserData(callback);
9852 Discord_Client_ExchangeChildTokenCallback callback__native = [](
auto result,
9858 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
9860 std::string accessToken__str(
reinterpret_cast<char*
>(accessToken.ptr), accessToken.size);
9861 std::string scopes__str(
reinterpret_cast<char*
>(scopes.ptr), scopes.size);
9862 userData__typed->delegate(std::move(result__obj),
9863 std::move(accessToken__str),
9866 std::move(scopes__str));
9867 Discord_Free(scopes.ptr);
9868 Discord_Free(accessToken.ptr);
9870 Discord_Client_ExchangeChildToken(&instance_,
9871 parentApplicationToken__str,
9874 Tcallback__UserData::Free,
9875 callback__userData);
9878 std::string
const& token,
9881 assert(state_ == DiscordObjectState::Owned);
9882 Discord_String token__str{(uint8_t*)(token.data()), token.size()};
9883 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
9884 auto callback__userData =
new Tcallback__UserData(callback);
9885 Discord_Client_FetchCurrentUserCallback callback__native =
9886 [](
auto result,
auto id,
auto name,
void* userData__) {
9887 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
9889 std::string name__str(
reinterpret_cast<char*
>(name.ptr), name.size);
9890 userData__typed->delegate(std::move(result__obj),
id, std::move(name__str));
9891 Discord_Free(name.ptr);
9893 Discord_Client_FetchCurrentUser(&instance_,
9894 static_cast<Discord_AuthorizationTokenType
>(tokenType),
9897 Tcallback__UserData::Free,
9898 callback__userData);
9900void Client::GetProvisionalToken(uint64_t applicationId,
9902 std::string
const& externalAuthToken,
9905 assert(state_ == DiscordObjectState::Owned);
9906 Discord_String externalAuthToken__str{(uint8_t*)(externalAuthToken.data()),
9907 externalAuthToken.size()};
9908 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
9909 auto callback__userData =
new Tcallback__UserData(callback);
9910 Discord_Client_TokenExchangeCallback callback__native = [](
auto result,
9917 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
9919 std::string accessToken__str(
reinterpret_cast<char*
>(accessToken.ptr), accessToken.size);
9920 std::string refreshToken__str(
reinterpret_cast<char*
>(refreshToken.ptr), refreshToken.size);
9921 std::string scopes__str(
reinterpret_cast<char*
>(scopes.ptr), scopes.size);
9922 userData__typed->delegate(std::move(result__obj),
9923 std::move(accessToken__str),
9924 std::move(refreshToken__str),
9927 std::move(scopes__str));
9928 Discord_Free(scopes.ptr);
9929 Discord_Free(refreshToken.ptr);
9930 Discord_Free(accessToken.ptr);
9932 Discord_Client_GetProvisionalToken(
9935 static_cast<Discord_AuthenticationExternalAuthType
>(externalAuthType),
9936 externalAuthToken__str,
9938 Tcallback__UserData::Free,
9939 callback__userData);
9941void Client::GetToken(uint64_t applicationId,
9942 std::string
const& code,
9943 std::string
const& codeVerifier,
9944 std::string
const& redirectUri,
9947 assert(state_ == DiscordObjectState::Owned);
9948 Discord_String code__str{(uint8_t*)(code.data()), code.size()};
9949 Discord_String codeVerifier__str{(uint8_t*)(codeVerifier.data()), codeVerifier.size()};
9950 Discord_String redirectUri__str{(uint8_t*)(redirectUri.data()), redirectUri.size()};
9951 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
9952 auto callback__userData =
new Tcallback__UserData(callback);
9953 Discord_Client_TokenExchangeCallback callback__native = [](
auto result,
9960 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
9962 std::string accessToken__str(
reinterpret_cast<char*
>(accessToken.ptr), accessToken.size);
9963 std::string refreshToken__str(
reinterpret_cast<char*
>(refreshToken.ptr), refreshToken.size);
9964 std::string scopes__str(
reinterpret_cast<char*
>(scopes.ptr), scopes.size);
9965 userData__typed->delegate(std::move(result__obj),
9966 std::move(accessToken__str),
9967 std::move(refreshToken__str),
9970 std::move(scopes__str));
9971 Discord_Free(scopes.ptr);
9972 Discord_Free(refreshToken.ptr);
9973 Discord_Free(accessToken.ptr);
9975 Discord_Client_GetToken(&instance_,
9981 Tcallback__UserData::Free,
9982 callback__userData);
9987 assert(state_ == DiscordObjectState::Owned);
9988 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
9989 auto callback__userData =
new Tcallback__UserData(callback);
9990 Discord_Client_TokenExchangeCallback callback__native = [](
auto result,
9997 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
9999 std::string accessToken__str(
reinterpret_cast<char*
>(accessToken.ptr), accessToken.size);
10000 std::string refreshToken__str(
reinterpret_cast<char*
>(refreshToken.ptr), refreshToken.size);
10001 std::string scopes__str(
reinterpret_cast<char*
>(scopes.ptr), scopes.size);
10002 userData__typed->delegate(std::move(result__obj),
10003 std::move(accessToken__str),
10004 std::move(refreshToken__str),
10007 std::move(scopes__str));
10008 Discord_Free(scopes.ptr);
10009 Discord_Free(refreshToken.ptr);
10010 Discord_Free(accessToken.ptr);
10012 Discord_Client_GetTokenFromDevice(
10013 &instance_, args.instance(), callback__native, Tcallback__UserData::Free, callback__userData);
10015void Client::GetTokenFromDeviceProvisionalMerge(
10018 std::string
const& externalAuthToken,
10021 assert(state_ == DiscordObjectState::Owned);
10022 Discord_String externalAuthToken__str{(uint8_t*)(externalAuthToken.data()),
10023 externalAuthToken.size()};
10024 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
10025 auto callback__userData =
new Tcallback__UserData(callback);
10026 Discord_Client_TokenExchangeCallback callback__native = [](
auto result,
10032 void* userData__) {
10033 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
10035 std::string accessToken__str(
reinterpret_cast<char*
>(accessToken.ptr), accessToken.size);
10036 std::string refreshToken__str(
reinterpret_cast<char*
>(refreshToken.ptr), refreshToken.size);
10037 std::string scopes__str(
reinterpret_cast<char*
>(scopes.ptr), scopes.size);
10038 userData__typed->delegate(std::move(result__obj),
10039 std::move(accessToken__str),
10040 std::move(refreshToken__str),
10043 std::move(scopes__str));
10044 Discord_Free(scopes.ptr);
10045 Discord_Free(refreshToken.ptr);
10046 Discord_Free(accessToken.ptr);
10048 Discord_Client_GetTokenFromDeviceProvisionalMerge(
10051 static_cast<Discord_AuthenticationExternalAuthType
>(externalAuthType),
10052 externalAuthToken__str,
10054 Tcallback__UserData::Free,
10055 callback__userData);
10057void Client::GetTokenFromProvisionalMerge(
10058 uint64_t applicationId,
10059 std::string
const& code,
10060 std::string
const& codeVerifier,
10061 std::string
const& redirectUri,
10063 std::string
const& externalAuthToken,
10066 assert(state_ == DiscordObjectState::Owned);
10067 Discord_String code__str{(uint8_t*)(code.data()), code.size()};
10068 Discord_String codeVerifier__str{(uint8_t*)(codeVerifier.data()), codeVerifier.size()};
10069 Discord_String redirectUri__str{(uint8_t*)(redirectUri.data()), redirectUri.size()};
10070 Discord_String externalAuthToken__str{(uint8_t*)(externalAuthToken.data()),
10071 externalAuthToken.size()};
10072 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
10073 auto callback__userData =
new Tcallback__UserData(callback);
10074 Discord_Client_TokenExchangeCallback callback__native = [](
auto result,
10080 void* userData__) {
10081 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
10083 std::string accessToken__str(
reinterpret_cast<char*
>(accessToken.ptr), accessToken.size);
10084 std::string refreshToken__str(
reinterpret_cast<char*
>(refreshToken.ptr), refreshToken.size);
10085 std::string scopes__str(
reinterpret_cast<char*
>(scopes.ptr), scopes.size);
10086 userData__typed->delegate(std::move(result__obj),
10087 std::move(accessToken__str),
10088 std::move(refreshToken__str),
10091 std::move(scopes__str));
10092 Discord_Free(scopes.ptr);
10093 Discord_Free(refreshToken.ptr);
10094 Discord_Free(accessToken.ptr);
10096 Discord_Client_GetTokenFromProvisionalMerge(
10102 static_cast<Discord_AuthenticationExternalAuthType
>(externalAuthType),
10103 externalAuthToken__str,
10105 Tcallback__UserData::Free,
10106 callback__userData);
10108bool Client::IsAuthenticated()
10110 assert(state_ == DiscordObjectState::Owned);
10111 bool returnValue__;
10112 returnValue__ = Discord_Client_IsAuthenticated(&instance_);
10113 return returnValue__;
10115void Client::OpenAuthorizeDeviceScreen(uint64_t clientId, std::string
const& userCode)
10117 assert(state_ == DiscordObjectState::Owned);
10118 Discord_String userCode__str{(uint8_t*)(userCode.data()), userCode.size()};
10119 Discord_Client_OpenAuthorizeDeviceScreen(&instance_, clientId, userCode__str);
10121void Client::ProvisionalUserMergeCompleted(
bool success)
10123 assert(state_ == DiscordObjectState::Owned);
10124 Discord_Client_ProvisionalUserMergeCompleted(&instance_, success);
10126void Client::RefreshToken(uint64_t applicationId,
10127 std::string
const& refreshToken,
10130 assert(state_ == DiscordObjectState::Owned);
10131 Discord_String refreshToken__str{(uint8_t*)(refreshToken.data()), refreshToken.size()};
10132 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
10133 auto callback__userData =
new Tcallback__UserData(callback);
10134 Discord_Client_TokenExchangeCallback callback__native = [](
auto result,
10140 void* userData__) {
10141 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
10143 std::string accessToken__str(
reinterpret_cast<char*
>(accessToken.ptr), accessToken.size);
10144 std::string refreshToken__str(
reinterpret_cast<char*
>(refreshToken.ptr), refreshToken.size);
10145 std::string scopes__str(
reinterpret_cast<char*
>(scopes.ptr), scopes.size);
10146 userData__typed->delegate(std::move(result__obj),
10147 std::move(accessToken__str),
10148 std::move(refreshToken__str),
10151 std::move(scopes__str));
10152 Discord_Free(scopes.ptr);
10153 Discord_Free(refreshToken.ptr);
10154 Discord_Free(accessToken.ptr);
10156 Discord_Client_RefreshToken(&instance_,
10160 Tcallback__UserData::Free,
10161 callback__userData);
10163void Client::RevokeToken(uint64_t applicationId,
10164 std::string
const& token,
10167 assert(state_ == DiscordObjectState::Owned);
10168 Discord_String token__str{(uint8_t*)(token.data()), token.size()};
10169 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
10170 auto callback__userData =
new Tcallback__UserData(callback);
10171 Discord_Client_RevokeTokenCallback callback__native = [](
auto result,
void* userData__) {
10172 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
10174 userData__typed->delegate(std::move(result__obj));
10176 Discord_Client_RevokeToken(&instance_,
10180 Tcallback__UserData::Free,
10181 callback__userData);
10183void Client::SetAuthorizeDeviceScreenClosedCallback(
10186 assert(state_ == DiscordObjectState::Owned);
10187 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10188 auto cb__userData =
new Tcb__UserData(cb);
10189 Discord_Client_AuthorizeDeviceScreenClosedCallback cb__native = [](
void* userData__) {
10190 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10191 userData__typed->delegate();
10193 Discord_Client_SetAuthorizeDeviceScreenClosedCallback(
10194 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
10196void Client::SetGameWindowPid(int32_t pid)
10198 assert(state_ == DiscordObjectState::Owned);
10199 Discord_Client_SetGameWindowPid(&instance_, pid);
10203 assert(state_ == DiscordObjectState::Owned);
10204 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
10205 auto callback__userData =
new Tcallback__UserData(callback);
10206 Discord_Client_TokenExpirationCallback callback__native = [](
void* userData__) {
10207 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
10208 userData__typed->delegate();
10210 Discord_Client_SetTokenExpirationCallback(
10211 &instance_, callback__native, Tcallback__UserData::Free, callback__userData);
10213void Client::UnmergeIntoProvisionalAccount(
10214 uint64_t applicationId,
10216 std::string
const& externalAuthToken,
10219 assert(state_ == DiscordObjectState::Owned);
10220 Discord_String externalAuthToken__str{(uint8_t*)(externalAuthToken.data()),
10221 externalAuthToken.size()};
10222 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
10223 auto callback__userData =
new Tcallback__UserData(callback);
10224 Discord_Client_UnmergeIntoProvisionalAccountCallback callback__native = [](
auto result,
10225 void* userData__) {
10226 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
10228 userData__typed->delegate(std::move(result__obj));
10230 Discord_Client_UnmergeIntoProvisionalAccount(
10233 static_cast<Discord_AuthenticationExternalAuthType
>(externalAuthType),
10234 externalAuthToken__str,
10236 Tcallback__UserData::Free,
10237 callback__userData);
10239void Client::UpdateProvisionalAccountDisplayName(
10240 std::string
const& name,
10243 assert(state_ == DiscordObjectState::Owned);
10244 Discord_String name__str{(uint8_t*)(name.data()), name.size()};
10245 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
10246 auto callback__userData =
new Tcallback__UserData(callback);
10247 Discord_Client_UpdateProvisionalAccountDisplayNameCallback callback__native =
10248 [](
auto result,
void* userData__) {
10249 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
10251 userData__typed->delegate(std::move(result__obj));
10253 Discord_Client_UpdateProvisionalAccountDisplayName(
10254 &instance_, name__str, callback__native, Tcallback__UserData::Free, callback__userData);
10260 assert(state_ == DiscordObjectState::Owned);
10261 Discord_String token__str{(uint8_t*)(token.data()), token.size()};
10262 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
10263 auto callback__userData =
new Tcallback__UserData(callback);
10264 Discord_Client_UpdateTokenCallback callback__native = [](
auto result,
void* userData__) {
10265 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
10267 userData__typed->delegate(std::move(result__obj));
10269 Discord_Client_UpdateToken(&instance_,
10270 static_cast<Discord_AuthorizationTokenType
>(tokenType),
10273 Tcallback__UserData::Free,
10274 callback__userData);
10276bool Client::CanOpenMessageInDiscord(uint64_t messageId)
10278 assert(state_ == DiscordObjectState::Owned);
10279 bool returnValue__;
10280 returnValue__ = Discord_Client_CanOpenMessageInDiscord(&instance_, messageId);
10281 return returnValue__;
10283void Client::DeleteUserMessage(uint64_t recipientId,
10284 uint64_t messageId,
10287 assert(state_ == DiscordObjectState::Owned);
10288 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10289 auto cb__userData =
new Tcb__UserData(cb);
10290 Discord_Client_DeleteUserMessageCallback cb__native = [](
auto result,
void* userData__) {
10291 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10293 userData__typed->delegate(std::move(result__obj));
10295 Discord_Client_DeleteUserMessage(
10296 &instance_, recipientId, messageId, cb__native, Tcb__UserData::Free, cb__userData);
10298void Client::EditUserMessage(uint64_t recipientId,
10299 uint64_t messageId,
10300 std::string
const& content,
10303 assert(state_ == DiscordObjectState::Owned);
10304 Discord_String content__str{(uint8_t*)(content.data()), content.size()};
10305 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10306 auto cb__userData =
new Tcb__UserData(cb);
10307 Discord_Client_EditUserMessageCallback cb__native = [](
auto result,
void* userData__) {
10308 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10310 userData__typed->delegate(std::move(result__obj));
10312 Discord_Client_EditUserMessage(&instance_,
10317 Tcb__UserData::Free,
10320std::optional<discordpp::ChannelHandle> Client::GetChannelHandle(uint64_t channelId)
const
10322 assert(state_ == DiscordObjectState::Owned);
10323 bool returnIsNonNull__;
10324 Discord_ChannelHandle returnValueNative__;
10325 returnIsNonNull__ =
10326 Discord_Client_GetChannelHandle(&instance_, channelId, &returnValueNative__);
10327 if (!returnIsNonNull__) {
10331 return returnValue__;
10333void Client::GetLobbyMessagesWithLimit(uint64_t lobbyId,
10337 assert(state_ == DiscordObjectState::Owned);
10338 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10339 auto cb__userData =
new Tcb__UserData(cb);
10340 Discord_Client_GetLobbyMessagesCallback cb__native =
10341 [](
auto result,
auto messages,
void* userData__) {
10342 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10344 std::vector<discordpp::MessageHandle> messages__vec;
10345 messages__vec.reserve(messages.size);
10346 for (
size_t i__ = 0; i__ < messages.size; ++i__) {
10347 messages__vec.emplace_back(messages.ptr[i__], DiscordObjectState::Owned);
10349 Discord_Free(messages.ptr);
10350 userData__typed->delegate(std::move(result__obj), std::move(messages__vec));
10352 Discord_Client_GetLobbyMessagesWithLimit(
10353 &instance_, lobbyId, limit, cb__native, Tcb__UserData::Free, cb__userData);
10355std::optional<discordpp::MessageHandle> Client::GetMessageHandle(uint64_t messageId)
const
10357 assert(state_ == DiscordObjectState::Owned);
10358 bool returnIsNonNull__;
10359 Discord_MessageHandle returnValueNative__;
10360 returnIsNonNull__ =
10361 Discord_Client_GetMessageHandle(&instance_, messageId, &returnValueNative__);
10362 if (!returnIsNonNull__) {
10366 return returnValue__;
10368void Client::OpenMessageInDiscord(
10369 uint64_t messageId,
10373 assert(state_ == DiscordObjectState::Owned);
10374 using TprovisionalUserMergeRequiredCallback__UserData =
10375 TDelegateUserData<std::remove_reference_t<
decltype(provisionalUserMergeRequiredCallback)>>;
10376 auto provisionalUserMergeRequiredCallback__userData =
10377 new TprovisionalUserMergeRequiredCallback__UserData(provisionalUserMergeRequiredCallback);
10378 Discord_Client_ProvisionalUserMergeRequiredCallback
10379 provisionalUserMergeRequiredCallback__native = [](
void* userData__) {
10380 auto userData__typed =
10381 static_cast<TprovisionalUserMergeRequiredCallback__UserData*
>(userData__);
10382 userData__typed->delegate();
10384 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
10385 auto callback__userData =
new Tcallback__UserData(callback);
10386 Discord_Client_OpenMessageInDiscordCallback callback__native = [](
auto result,
10387 void* userData__) {
10388 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
10390 userData__typed->delegate(std::move(result__obj));
10392 Discord_Client_OpenMessageInDiscord(&instance_,
10394 provisionalUserMergeRequiredCallback__native,
10395 TprovisionalUserMergeRequiredCallback__UserData::Free,
10396 provisionalUserMergeRequiredCallback__userData,
10398 Tcallback__UserData::Free,
10399 callback__userData);
10401void Client::SendLobbyMessage(uint64_t lobbyId,
10402 std::string
const& content,
10405 assert(state_ == DiscordObjectState::Owned);
10406 Discord_String content__str{(uint8_t*)(content.data()), content.size()};
10407 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10408 auto cb__userData =
new Tcb__UserData(cb);
10409 Discord_Client_SendUserMessageCallback cb__native =
10410 [](
auto result,
auto messageId,
void* userData__) {
10411 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10413 userData__typed->delegate(std::move(result__obj), messageId);
10415 Discord_Client_SendLobbyMessage(
10416 &instance_, lobbyId, content__str, cb__native, Tcb__UserData::Free, cb__userData);
10418void Client::SendLobbyMessageWithMetadata(
10420 std::string
const& content,
10421 std::unordered_map<std::string, std::string>
const& metadata,
10424 assert(state_ == DiscordObjectState::Owned);
10425 Discord_String content__str{(uint8_t*)(content.data()), content.size()};
10426 ConvertedProperties metadata__convert(metadata);
10427 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10428 auto cb__userData =
new Tcb__UserData(cb);
10429 Discord_Client_SendUserMessageCallback cb__native =
10430 [](
auto result,
auto messageId,
void* userData__) {
10431 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10433 userData__typed->delegate(std::move(result__obj), messageId);
10435 Discord_Client_SendLobbyMessageWithMetadata(&instance_,
10438 metadata__convert.Properties,
10440 Tcb__UserData::Free,
10443void Client::SendUserMessage(uint64_t recipientId,
10444 std::string
const& content,
10447 assert(state_ == DiscordObjectState::Owned);
10448 Discord_String content__str{(uint8_t*)(content.data()), content.size()};
10449 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10450 auto cb__userData =
new Tcb__UserData(cb);
10451 Discord_Client_SendUserMessageCallback cb__native =
10452 [](
auto result,
auto messageId,
void* userData__) {
10453 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10455 userData__typed->delegate(std::move(result__obj), messageId);
10457 Discord_Client_SendUserMessage(
10458 &instance_, recipientId, content__str, cb__native, Tcb__UserData::Free, cb__userData);
10460void Client::SendUserMessageWithMetadata(
10461 uint64_t recipientId,
10462 std::string
const& content,
10463 std::unordered_map<std::string, std::string>
const& metadata,
10466 assert(state_ == DiscordObjectState::Owned);
10467 Discord_String content__str{(uint8_t*)(content.data()), content.size()};
10468 ConvertedProperties metadata__convert(metadata);
10469 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10470 auto cb__userData =
new Tcb__UserData(cb);
10471 Discord_Client_SendUserMessageCallback cb__native =
10472 [](
auto result,
auto messageId,
void* userData__) {
10473 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10475 userData__typed->delegate(std::move(result__obj), messageId);
10477 Discord_Client_SendUserMessageWithMetadata(&instance_,
10480 metadata__convert.Properties,
10482 Tcb__UserData::Free,
10487 assert(state_ == DiscordObjectState::Owned);
10488 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10489 auto cb__userData =
new Tcb__UserData(cb);
10490 Discord_Client_MessageCreatedCallback cb__native = [](
auto messageId,
void* userData__) {
10491 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10492 userData__typed->delegate(messageId);
10494 Discord_Client_SetMessageCreatedCallback(
10495 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
10499 assert(state_ == DiscordObjectState::Owned);
10500 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10501 auto cb__userData =
new Tcb__UserData(cb);
10502 Discord_Client_MessageDeletedCallback cb__native =
10503 [](
auto messageId,
auto channelId,
void* userData__) {
10504 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10505 userData__typed->delegate(messageId, channelId);
10507 Discord_Client_SetMessageDeletedCallback(
10508 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
10512 assert(state_ == DiscordObjectState::Owned);
10513 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10514 auto cb__userData =
new Tcb__UserData(cb);
10515 Discord_Client_MessageUpdatedCallback cb__native = [](
auto messageId,
void* userData__) {
10516 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10517 userData__typed->delegate(messageId);
10519 Discord_Client_SetMessageUpdatedCallback(
10520 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
10522void Client::SetShowingChat(
bool showingChat)
10524 assert(state_ == DiscordObjectState::Owned);
10525 Discord_Client_SetShowingChat(&instance_, showingChat);
10530 assert(state_ == DiscordObjectState::Owned);
10531 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
10532 auto callback__userData =
new Tcallback__UserData(callback);
10533 Discord_Client_LogCallback callback__native = [](
10534 auto message,
auto severity,
void* userData__) {
10535 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
10536 std::string message__str(
reinterpret_cast<char*
>(message.ptr), message.size);
10537 userData__typed->delegate(std::move(message__str),
10539 Discord_Free(message.ptr);
10541 Discord_Client_AddLogCallback(&instance_,
10543 Tcallback__UserData::Free,
10544 callback__userData,
10545 static_cast<Discord_LoggingSeverity
>(minSeverity));
10550 assert(state_ == DiscordObjectState::Owned);
10551 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
10552 auto callback__userData =
new Tcallback__UserData(callback);
10553 Discord_Client_LogCallback callback__native = [](
10554 auto message,
auto severity,
void* userData__) {
10555 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
10556 std::string message__str(
reinterpret_cast<char*
>(message.ptr), message.size);
10557 userData__typed->delegate(std::move(message__str),
10559 Discord_Free(message.ptr);
10561 Discord_Client_AddVoiceLogCallback(&instance_,
10563 Tcallback__UserData::Free,
10564 callback__userData,
10565 static_cast<Discord_LoggingSeverity
>(minSeverity));
10567void Client::Connect()
10569 assert(state_ == DiscordObjectState::Owned);
10570 Discord_Client_Connect(&instance_);
10572void Client::Disconnect()
10574 assert(state_ == DiscordObjectState::Owned);
10575 Discord_Client_Disconnect(&instance_);
10579 assert(state_ == DiscordObjectState::Owned);
10580 Discord_Client_Status returnValue__;
10581 returnValue__ = Discord_Client_GetStatus(&instance_);
10584void Client::OpenConnectedGamesSettingsInDiscord(
10587 assert(state_ == DiscordObjectState::Owned);
10588 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
10589 auto callback__userData =
new Tcallback__UserData(callback);
10590 Discord_Client_OpenConnectedGamesSettingsInDiscordCallback callback__native =
10591 [](
auto result,
void* userData__) {
10592 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
10594 userData__typed->delegate(std::move(result__obj));
10596 Discord_Client_OpenConnectedGamesSettingsInDiscord(
10597 &instance_, callback__native, Tcallback__UserData::Free, callback__userData);
10599void Client::SetApplicationId(uint64_t applicationId)
10601 assert(state_ == DiscordObjectState::Owned);
10602 Discord_Client_SetApplicationId(&instance_, applicationId);
10606 assert(state_ == DiscordObjectState::Owned);
10607 bool returnValue__;
10608 Discord_String path__str{(uint8_t*)(path.data()), path.size()};
10609 returnValue__ = Discord_Client_SetLogDir(
10610 &instance_, path__str,
static_cast<Discord_LoggingSeverity
>(minSeverity));
10611 return returnValue__;
10615 assert(state_ == DiscordObjectState::Owned);
10616 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10617 auto cb__userData =
new Tcb__UserData(cb);
10618 Discord_Client_OnStatusChanged cb__native =
10619 [](
auto status,
auto error,
auto errorDetail,
void* userData__) {
10620 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10625 Discord_Client_SetStatusChangedCallback(
10626 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
10630 assert(state_ == DiscordObjectState::Owned);
10631 Discord_String path__str{(uint8_t*)(path.data()), path.size()};
10632 Discord_Client_SetVoiceLogDir(
10633 &instance_, path__str,
static_cast<Discord_LoggingSeverity
>(minSeverity));
10635void Client::CreateOrJoinLobby(std::string
const& secret,
10638 assert(state_ == DiscordObjectState::Owned);
10639 Discord_String secret__str{(uint8_t*)(secret.data()), secret.size()};
10640 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
10641 auto callback__userData =
new Tcallback__UserData(callback);
10642 Discord_Client_CreateOrJoinLobbyCallback callback__native =
10643 [](
auto result,
auto lobbyId,
void* userData__) {
10644 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
10646 userData__typed->delegate(std::move(result__obj), lobbyId);
10648 Discord_Client_CreateOrJoinLobby(
10649 &instance_, secret__str, callback__native, Tcallback__UserData::Free, callback__userData);
10651void Client::CreateOrJoinLobbyWithMetadata(
10652 std::string
const& secret,
10653 std::unordered_map<std::string, std::string>
const& lobbyMetadata,
10654 std::unordered_map<std::string, std::string>
const& memberMetadata,
10657 assert(state_ == DiscordObjectState::Owned);
10658 Discord_String secret__str{(uint8_t*)(secret.data()), secret.size()};
10659 ConvertedProperties lobbyMetadata__convert(lobbyMetadata);
10660 ConvertedProperties memberMetadata__convert(memberMetadata);
10661 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
10662 auto callback__userData =
new Tcallback__UserData(callback);
10663 Discord_Client_CreateOrJoinLobbyCallback callback__native =
10664 [](
auto result,
auto lobbyId,
void* userData__) {
10665 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
10667 userData__typed->delegate(std::move(result__obj), lobbyId);
10669 Discord_Client_CreateOrJoinLobbyWithMetadata(&instance_,
10671 lobbyMetadata__convert.Properties,
10672 memberMetadata__convert.Properties,
10674 Tcallback__UserData::Free,
10675 callback__userData);
10679 assert(state_ == DiscordObjectState::Owned);
10680 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10681 auto cb__userData =
new Tcb__UserData(cb);
10682 Discord_Client_GetGuildChannelsCallback cb__native =
10683 [](
auto result,
auto guildChannels,
void* userData__) {
10684 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10686 std::vector<discordpp::GuildChannel> guildChannels__vec;
10687 guildChannels__vec.reserve(guildChannels.size);
10688 for (
size_t i__ = 0; i__ < guildChannels.size; ++i__) {
10689 guildChannels__vec.emplace_back(guildChannels.ptr[i__], DiscordObjectState::Owned);
10691 Discord_Free(guildChannels.ptr);
10692 userData__typed->delegate(std::move(result__obj), std::move(guildChannels__vec));
10694 Discord_Client_GetGuildChannels(
10695 &instance_, guildId, cb__native, Tcb__UserData::Free, cb__userData);
10697std::optional<discordpp::LobbyHandle> Client::GetLobbyHandle(uint64_t lobbyId)
const
10699 assert(state_ == DiscordObjectState::Owned);
10700 bool returnIsNonNull__;
10701 Discord_LobbyHandle returnValueNative__;
10702 returnIsNonNull__ = Discord_Client_GetLobbyHandle(&instance_, lobbyId, &returnValueNative__);
10703 if (!returnIsNonNull__) {
10707 return returnValue__;
10709std::vector<uint64_t> Client::GetLobbyIds()
const
10711 assert(state_ == DiscordObjectState::Owned);
10712 Discord_UInt64Span returnValueNative__;
10713 Discord_Client_GetLobbyIds(&instance_, &returnValueNative__);
10714 std::vector<uint64_t> returnValue__(returnValueNative__.ptr,
10715 returnValueNative__.ptr + returnValueNative__.size);
10716 Discord_Free(returnValueNative__.ptr);
10717 return returnValue__;
10721 assert(state_ == DiscordObjectState::Owned);
10722 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10723 auto cb__userData =
new Tcb__UserData(cb);
10724 Discord_Client_GetUserGuildsCallback cb__native =
10725 [](
auto result,
auto guilds,
void* userData__) {
10726 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10728 std::vector<discordpp::GuildMinimal> guilds__vec;
10729 guilds__vec.reserve(guilds.size);
10730 for (
size_t i__ = 0; i__ < guilds.size; ++i__) {
10731 guilds__vec.emplace_back(guilds.ptr[i__], DiscordObjectState::Owned);
10733 Discord_Free(guilds.ptr);
10734 userData__typed->delegate(std::move(result__obj), std::move(guilds__vec));
10736 Discord_Client_GetUserGuilds(&instance_, cb__native, Tcb__UserData::Free, cb__userData);
10740 assert(state_ == DiscordObjectState::Owned);
10741 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
10742 auto callback__userData =
new Tcallback__UserData(callback);
10743 Discord_Client_LeaveLobbyCallback callback__native = [](
auto result,
void* userData__) {
10744 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
10746 userData__typed->delegate(std::move(result__obj));
10748 Discord_Client_LeaveLobby(
10749 &instance_, lobbyId, callback__native, Tcallback__UserData::Free, callback__userData);
10751void Client::LinkChannelToLobby(uint64_t lobbyId,
10752 uint64_t channelId,
10755 assert(state_ == DiscordObjectState::Owned);
10756 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
10757 auto callback__userData =
new Tcallback__UserData(callback);
10758 Discord_Client_LinkOrUnlinkChannelCallback callback__native = [](
auto result,
10759 void* userData__) {
10760 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
10762 userData__typed->delegate(std::move(result__obj));
10764 Discord_Client_LinkChannelToLobby(&instance_,
10768 Tcallback__UserData::Free,
10769 callback__userData);
10773 assert(state_ == DiscordObjectState::Owned);
10774 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10775 auto cb__userData =
new Tcb__UserData(cb);
10776 Discord_Client_LobbyCreatedCallback cb__native = [](
auto lobbyId,
void* userData__) {
10777 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10778 userData__typed->delegate(lobbyId);
10780 Discord_Client_SetLobbyCreatedCallback(
10781 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
10785 assert(state_ == DiscordObjectState::Owned);
10786 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10787 auto cb__userData =
new Tcb__UserData(cb);
10788 Discord_Client_LobbyDeletedCallback cb__native = [](
auto lobbyId,
void* userData__) {
10789 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10790 userData__typed->delegate(lobbyId);
10792 Discord_Client_SetLobbyDeletedCallback(
10793 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
10797 assert(state_ == DiscordObjectState::Owned);
10798 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10799 auto cb__userData =
new Tcb__UserData(cb);
10800 Discord_Client_LobbyMemberAddedCallback cb__native =
10801 [](
auto lobbyId,
auto memberId,
void* userData__) {
10802 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10803 userData__typed->delegate(lobbyId, memberId);
10805 Discord_Client_SetLobbyMemberAddedCallback(
10806 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
10810 assert(state_ == DiscordObjectState::Owned);
10811 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10812 auto cb__userData =
new Tcb__UserData(cb);
10813 Discord_Client_LobbyMemberRemovedCallback cb__native =
10814 [](
auto lobbyId,
auto memberId,
void* userData__) {
10815 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10816 userData__typed->delegate(lobbyId, memberId);
10818 Discord_Client_SetLobbyMemberRemovedCallback(
10819 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
10823 assert(state_ == DiscordObjectState::Owned);
10824 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10825 auto cb__userData =
new Tcb__UserData(cb);
10826 Discord_Client_LobbyMemberUpdatedCallback cb__native =
10827 [](
auto lobbyId,
auto memberId,
void* userData__) {
10828 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10829 userData__typed->delegate(lobbyId, memberId);
10831 Discord_Client_SetLobbyMemberUpdatedCallback(
10832 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
10836 assert(state_ == DiscordObjectState::Owned);
10837 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10838 auto cb__userData =
new Tcb__UserData(cb);
10839 Discord_Client_LobbyUpdatedCallback cb__native = [](
auto lobbyId,
void* userData__) {
10840 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10841 userData__typed->delegate(lobbyId);
10843 Discord_Client_SetLobbyUpdatedCallback(
10844 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
10846void Client::UnlinkChannelFromLobby(uint64_t lobbyId,
10849 assert(state_ == DiscordObjectState::Owned);
10850 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
10851 auto callback__userData =
new Tcallback__UserData(callback);
10852 Discord_Client_LinkOrUnlinkChannelCallback callback__native = [](
auto result,
10853 void* userData__) {
10854 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
10856 userData__typed->delegate(std::move(result__obj));
10858 Discord_Client_UnlinkChannelFromLobby(
10859 &instance_, lobbyId, callback__native, Tcallback__UserData::Free, callback__userData);
10864 assert(state_ == DiscordObjectState::Owned);
10865 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10866 auto cb__userData =
new Tcb__UserData(cb);
10867 Discord_Client_AcceptActivityInviteCallback cb__native =
10868 [](
auto result,
auto joinSecret,
void* userData__) {
10869 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10871 std::string joinSecret__str(
reinterpret_cast<char*
>(joinSecret.ptr), joinSecret.size);
10872 userData__typed->delegate(std::move(result__obj), std::move(joinSecret__str));
10873 Discord_Free(joinSecret.ptr);
10875 Discord_Client_AcceptActivityInvite(
10876 &instance_, invite.instance(), cb__native, Tcb__UserData::Free, cb__userData);
10878void Client::ClearRichPresence()
10880 assert(state_ == DiscordObjectState::Owned);
10881 Discord_Client_ClearRichPresence(&instance_);
10883bool Client::RegisterLaunchCommand(uint64_t applicationId, std::string command)
10885 assert(state_ == DiscordObjectState::Owned);
10886 bool returnValue__;
10887 Discord_String command__str{(uint8_t*)(command.data()), command.size()};
10888 returnValue__ = Discord_Client_RegisterLaunchCommand(&instance_, applicationId, command__str);
10889 return returnValue__;
10891bool Client::RegisterLaunchSteamApplication(uint64_t applicationId, uint32_t steamAppId)
10893 assert(state_ == DiscordObjectState::Owned);
10894 bool returnValue__;
10896 Discord_Client_RegisterLaunchSteamApplication(&instance_, applicationId, steamAppId);
10897 return returnValue__;
10899void Client::SendActivityInvite(uint64_t userId,
10900 std::string
const& content,
10903 assert(state_ == DiscordObjectState::Owned);
10904 Discord_String content__str{(uint8_t*)(content.data()), content.size()};
10905 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10906 auto cb__userData =
new Tcb__UserData(cb);
10907 Discord_Client_SendActivityInviteCallback cb__native = [](
auto result,
void* userData__) {
10908 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10910 userData__typed->delegate(std::move(result__obj));
10912 Discord_Client_SendActivityInvite(
10913 &instance_, userId, content__str, cb__native, Tcb__UserData::Free, cb__userData);
10915void Client::SendActivityJoinRequest(uint64_t userId,
10918 assert(state_ == DiscordObjectState::Owned);
10919 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10920 auto cb__userData =
new Tcb__UserData(cb);
10921 Discord_Client_SendActivityInviteCallback cb__native = [](
auto result,
void* userData__) {
10922 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10924 userData__typed->delegate(std::move(result__obj));
10926 Discord_Client_SendActivityJoinRequest(
10927 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
10932 assert(state_ == DiscordObjectState::Owned);
10933 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10934 auto cb__userData =
new Tcb__UserData(cb);
10935 Discord_Client_SendActivityInviteCallback cb__native = [](
auto result,
void* userData__) {
10936 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10938 userData__typed->delegate(std::move(result__obj));
10940 Discord_Client_SendActivityJoinRequestReply(
10941 &instance_, invite.instance(), cb__native, Tcb__UserData::Free, cb__userData);
10945 assert(state_ == DiscordObjectState::Owned);
10946 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10947 auto cb__userData =
new Tcb__UserData(cb);
10948 Discord_Client_ActivityInviteCallback cb__native = [](
auto invite,
void* userData__) {
10949 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10951 userData__typed->delegate(std::move(invite__obj));
10953 Discord_Client_SetActivityInviteCreatedCallback(
10954 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
10958 assert(state_ == DiscordObjectState::Owned);
10959 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10960 auto cb__userData =
new Tcb__UserData(cb);
10961 Discord_Client_ActivityInviteCallback cb__native = [](
auto invite,
void* userData__) {
10962 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10964 userData__typed->delegate(std::move(invite__obj));
10966 Discord_Client_SetActivityInviteUpdatedCallback(
10967 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
10971 assert(state_ == DiscordObjectState::Owned);
10972 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10973 auto cb__userData =
new Tcb__UserData(cb);
10974 Discord_Client_ActivityJoinCallback cb__native = [](
auto joinSecret,
void* userData__) {
10975 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10976 std::string joinSecret__str(
reinterpret_cast<char*
>(joinSecret.ptr), joinSecret.size);
10977 userData__typed->delegate(std::move(joinSecret__str));
10978 Discord_Free(joinSecret.ptr);
10980 Discord_Client_SetActivityJoinCallback(
10981 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
10986 assert(state_ == DiscordObjectState::Owned);
10987 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
10988 auto callback__userData =
new Tcallback__UserData(callback);
10989 Discord_Client_UpdateStatusCallback callback__native = [](
auto result,
void* userData__) {
10990 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
10992 userData__typed->delegate(std::move(result__obj));
10994 Discord_Client_SetOnlineStatus(&instance_,
10995 static_cast<Discord_StatusType
>(status),
10997 Tcallback__UserData::Free,
10998 callback__userData);
11003 assert(state_ == DiscordObjectState::Owned);
11004 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11005 auto cb__userData =
new Tcb__UserData(cb);
11006 Discord_Client_UpdateRichPresenceCallback cb__native = [](
auto result,
void* userData__) {
11007 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11009 userData__typed->delegate(std::move(result__obj));
11011 Discord_Client_UpdateRichPresence(
11012 &instance_, activity.instance(), cb__native, Tcb__UserData::Free, cb__userData);
11014void Client::AcceptDiscordFriendRequest(uint64_t userId,
11017 assert(state_ == DiscordObjectState::Owned);
11018 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11019 auto cb__userData =
new Tcb__UserData(cb);
11020 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
11021 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11023 userData__typed->delegate(std::move(result__obj));
11025 Discord_Client_AcceptDiscordFriendRequest(
11026 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
11028void Client::AcceptGameFriendRequest(uint64_t userId,
11031 assert(state_ == DiscordObjectState::Owned);
11032 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11033 auto cb__userData =
new Tcb__UserData(cb);
11034 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
11035 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11037 userData__typed->delegate(std::move(result__obj));
11039 Discord_Client_AcceptGameFriendRequest(
11040 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
11044 assert(state_ == DiscordObjectState::Owned);
11045 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11046 auto cb__userData =
new Tcb__UserData(cb);
11047 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
11048 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11050 userData__typed->delegate(std::move(result__obj));
11052 Discord_Client_BlockUser(&instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
11054void Client::CancelDiscordFriendRequest(uint64_t userId,
11057 assert(state_ == DiscordObjectState::Owned);
11058 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11059 auto cb__userData =
new Tcb__UserData(cb);
11060 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
11061 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11063 userData__typed->delegate(std::move(result__obj));
11065 Discord_Client_CancelDiscordFriendRequest(
11066 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
11068void Client::CancelGameFriendRequest(uint64_t userId,
11071 assert(state_ == DiscordObjectState::Owned);
11072 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11073 auto cb__userData =
new Tcb__UserData(cb);
11074 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
11075 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11077 userData__typed->delegate(std::move(result__obj));
11079 Discord_Client_CancelGameFriendRequest(
11080 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
11084 assert(state_ == DiscordObjectState::Owned);
11085 Discord_RelationshipHandle returnValueNative__{};
11086 Discord_Client_GetRelationshipHandle(&instance_, userId, &returnValueNative__);
11088 return returnValue__;
11090std::vector<discordpp::RelationshipHandle> Client::GetRelationships()
const
11092 assert(state_ == DiscordObjectState::Owned);
11093 Discord_RelationshipHandleSpan returnValueNative__;
11094 Discord_Client_GetRelationships(&instance_, &returnValueNative__);
11095 std::vector<discordpp::RelationshipHandle> returnValue__;
11096 returnValue__.reserve(returnValueNative__.size);
11097 for (
size_t i__ = 0; i__ < returnValueNative__.size; ++i__) {
11098 returnValue__.emplace_back(returnValueNative__.ptr[i__], DiscordObjectState::Owned);
11100 Discord_Free(returnValueNative__.ptr);
11101 return returnValue__;
11103std::vector<discordpp::RelationshipHandle> Client::GetRelationshipsByGroup(
11106 assert(state_ == DiscordObjectState::Owned);
11107 Discord_RelationshipHandleSpan returnValueNative__;
11108 Discord_Client_GetRelationshipsByGroup(
11109 &instance_,
static_cast<Discord_RelationshipGroupType
>(groupType), &returnValueNative__);
11110 std::vector<discordpp::RelationshipHandle> returnValue__;
11111 returnValue__.reserve(returnValueNative__.size);
11112 for (
size_t i__ = 0; i__ < returnValueNative__.size; ++i__) {
11113 returnValue__.emplace_back(returnValueNative__.ptr[i__], DiscordObjectState::Owned);
11115 Discord_Free(returnValueNative__.ptr);
11116 return returnValue__;
11118void Client::RejectDiscordFriendRequest(uint64_t userId,
11121 assert(state_ == DiscordObjectState::Owned);
11122 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11123 auto cb__userData =
new Tcb__UserData(cb);
11124 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
11125 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11127 userData__typed->delegate(std::move(result__obj));
11129 Discord_Client_RejectDiscordFriendRequest(
11130 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
11132void Client::RejectGameFriendRequest(uint64_t userId,
11135 assert(state_ == DiscordObjectState::Owned);
11136 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11137 auto cb__userData =
new Tcb__UserData(cb);
11138 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
11139 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11141 userData__typed->delegate(std::move(result__obj));
11143 Discord_Client_RejectGameFriendRequest(
11144 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
11146void Client::RemoveDiscordAndGameFriend(uint64_t userId,
11149 assert(state_ == DiscordObjectState::Owned);
11150 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11151 auto cb__userData =
new Tcb__UserData(cb);
11152 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
11153 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11155 userData__typed->delegate(std::move(result__obj));
11157 Discord_Client_RemoveDiscordAndGameFriend(
11158 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
11162 assert(state_ == DiscordObjectState::Owned);
11163 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11164 auto cb__userData =
new Tcb__UserData(cb);
11165 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
11166 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11168 userData__typed->delegate(std::move(result__obj));
11170 Discord_Client_RemoveGameFriend(
11171 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
11173std::vector<discordpp::UserHandle> Client::SearchFriendsByUsername(std::string searchStr)
const
11175 assert(state_ == DiscordObjectState::Owned);
11176 Discord_UserHandleSpan returnValueNative__;
11177 Discord_String searchStr__str{(uint8_t*)(searchStr.data()), searchStr.size()};
11178 Discord_Client_SearchFriendsByUsername(&instance_, searchStr__str, &returnValueNative__);
11179 std::vector<discordpp::UserHandle> returnValue__;
11180 returnValue__.reserve(returnValueNative__.size);
11181 for (
size_t i__ = 0; i__ < returnValueNative__.size; ++i__) {
11182 returnValue__.emplace_back(returnValueNative__.ptr[i__], DiscordObjectState::Owned);
11184 Discord_Free(returnValueNative__.ptr);
11185 return returnValue__;
11187void Client::SendDiscordFriendRequest(std::string
const& username,
11190 assert(state_ == DiscordObjectState::Owned);
11191 Discord_String username__str{(uint8_t*)(username.data()), username.size()};
11192 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11193 auto cb__userData =
new Tcb__UserData(cb);
11194 Discord_Client_SendFriendRequestCallback cb__native = [](
auto result,
void* userData__) {
11195 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11197 userData__typed->delegate(std::move(result__obj));
11199 Discord_Client_SendDiscordFriendRequest(
11200 &instance_, username__str, cb__native, Tcb__UserData::Free, cb__userData);
11202void Client::SendDiscordFriendRequestById(uint64_t userId,
11205 assert(state_ == DiscordObjectState::Owned);
11206 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11207 auto cb__userData =
new Tcb__UserData(cb);
11208 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
11209 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11211 userData__typed->delegate(std::move(result__obj));
11213 Discord_Client_SendDiscordFriendRequestById(
11214 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
11216void Client::SendGameFriendRequest(std::string
const& username,
11219 assert(state_ == DiscordObjectState::Owned);
11220 Discord_String username__str{(uint8_t*)(username.data()), username.size()};
11221 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11222 auto cb__userData =
new Tcb__UserData(cb);
11223 Discord_Client_SendFriendRequestCallback cb__native = [](
auto result,
void* userData__) {
11224 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11226 userData__typed->delegate(std::move(result__obj));
11228 Discord_Client_SendGameFriendRequest(
11229 &instance_, username__str, cb__native, Tcb__UserData::Free, cb__userData);
11231void Client::SendGameFriendRequestById(uint64_t userId,
11234 assert(state_ == DiscordObjectState::Owned);
11235 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11236 auto cb__userData =
new Tcb__UserData(cb);
11237 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
11238 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11240 userData__typed->delegate(std::move(result__obj));
11242 Discord_Client_SendGameFriendRequestById(
11243 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
11247 assert(state_ == DiscordObjectState::Owned);
11248 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11249 auto cb__userData =
new Tcb__UserData(cb);
11250 Discord_Client_RelationshipCreatedCallback cb__native =
11251 [](
auto userId,
auto isDiscordRelationshipUpdate,
void* userData__) {
11252 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11253 userData__typed->delegate(userId, isDiscordRelationshipUpdate);
11255 Discord_Client_SetRelationshipCreatedCallback(
11256 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11260 assert(state_ == DiscordObjectState::Owned);
11261 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11262 auto cb__userData =
new Tcb__UserData(cb);
11263 Discord_Client_RelationshipDeletedCallback cb__native =
11264 [](
auto userId,
auto isDiscordRelationshipUpdate,
void* userData__) {
11265 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11266 userData__typed->delegate(userId, isDiscordRelationshipUpdate);
11268 Discord_Client_SetRelationshipDeletedCallback(
11269 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11273 assert(state_ == DiscordObjectState::Owned);
11274 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11275 auto cb__userData =
new Tcb__UserData(cb);
11276 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
11277 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11279 userData__typed->delegate(std::move(result__obj));
11281 Discord_Client_UnblockUser(&instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
11285 assert(state_ == DiscordObjectState::Owned);
11286 Discord_UserHandle returnValueNative__{};
11287 Discord_Client_GetCurrentUser(&instance_, &returnValueNative__);
11289 return returnValue__;
11291void Client::GetDiscordClientConnectedUser(
11292 uint64_t applicationId,
11295 assert(state_ == DiscordObjectState::Owned);
11296 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
11297 auto callback__userData =
new Tcallback__UserData(callback);
11298 Discord_Client_GetDiscordClientConnectedUserCallback callback__native =
11299 [](
auto result,
auto user,
void* userData__) {
11300 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
11302 std::optional<discordpp::UserHandle> user__opt{};
11306 userData__typed->delegate(std::move(result__obj), std::move(user__opt));
11308 Discord_Client_GetDiscordClientConnectedUser(
11309 &instance_, applicationId, callback__native, Tcallback__UserData::Free, callback__userData);
11311std::optional<discordpp::UserHandle> Client::GetUser(uint64_t userId)
const
11313 assert(state_ == DiscordObjectState::Owned);
11314 bool returnIsNonNull__;
11315 Discord_UserHandle returnValueNative__;
11316 returnIsNonNull__ = Discord_Client_GetUser(&instance_, userId, &returnValueNative__);
11317 if (!returnIsNonNull__) {
11321 return returnValue__;
11323void Client::SetRelationshipGroupsUpdatedCallback(
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_RelationshipGroupsUpdatedCallback cb__native = [](
auto userId,
11330 void* userData__) {
11331 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11332 userData__typed->delegate(userId);
11334 Discord_Client_SetRelationshipGroupsUpdatedCallback(
11335 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11339 assert(state_ == DiscordObjectState::Owned);
11340 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
11341 auto cb__userData =
new Tcb__UserData(cb);
11342 Discord_Client_UserUpdatedCallback cb__native = [](
auto userId,
void* userData__) {
11343 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
11344 userData__typed->delegate(userId);
11346 Discord_Client_SetUserUpdatedCallback(
11347 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
11349const CallInfoHandle CallInfoHandle::nullobj{{}, DiscordObjectState::Invalid};
11350CallInfoHandle::~CallInfoHandle()
11352 if (state_ == DiscordObjectState::Owned) {
11354 state_ = DiscordObjectState::Invalid;
11357CallInfoHandle::CallInfoHandle(CallInfoHandle&& other) noexcept
11358 : instance_(other.instance_)
11359 , state_(other.state_)
11361 other.state_ = DiscordObjectState::Invalid;
11363CallInfoHandle& CallInfoHandle::operator=(CallInfoHandle&& other)
noexcept
11365 if (
this != &other) {
11366 if (state_ == DiscordObjectState::Owned) {
11369 instance_ = other.instance_;
11370 state_ = other.state_;
11371 other.state_ = DiscordObjectState::Invalid;
11375CallInfoHandle::CallInfoHandle(
const CallInfoHandle& other)
11380 Discord_CallInfoHandle_Clone(&instance_, other.instance());
11382 state_ = DiscordObjectState::Owned;
11385CallInfoHandle& CallInfoHandle::operator=(
const CallInfoHandle& other)
11387 if (
this != &other) {
11388 if (state_ == DiscordObjectState::Owned) {
11390 state_ = DiscordObjectState::Invalid;
11392 if (other.state_ == DiscordObjectState::Owned) {
11393 Discord_CallInfoHandle_Clone(&instance_, other.instance());
11395 state_ = DiscordObjectState::Owned;
11400CallInfoHandle::CallInfoHandle(Discord_CallInfoHandle instance, DiscordObjectState state)
11401 : instance_(instance)
11405void CallInfoHandle::Drop()
11407 if (state_ != DiscordObjectState::Owned) {
11410 Discord_CallInfoHandle_Drop(&instance_);
11411 state_ = DiscordObjectState::Invalid;
11413uint64_t CallInfoHandle::ChannelId()
const
11415 assert(state_ == DiscordObjectState::Owned);
11416 uint64_t returnValue__;
11417 returnValue__ = Discord_CallInfoHandle_ChannelId(&instance_);
11418 return returnValue__;
11420std::vector<uint64_t> CallInfoHandle::GetParticipants()
const
11422 assert(state_ == DiscordObjectState::Owned);
11423 Discord_UInt64Span returnValueNative__;
11424 Discord_CallInfoHandle_GetParticipants(&instance_, &returnValueNative__);
11425 std::vector<uint64_t> returnValue__(returnValueNative__.ptr,
11426 returnValueNative__.ptr + returnValueNative__.size);
11427 Discord_Free(returnValueNative__.ptr);
11428 return returnValue__;
11430std::optional<discordpp::VoiceStateHandle> CallInfoHandle::GetVoiceStateHandle(
11431 uint64_t userId)
const
11433 assert(state_ == DiscordObjectState::Owned);
11434 bool returnIsNonNull__;
11435 Discord_VoiceStateHandle returnValueNative__;
11436 returnIsNonNull__ =
11437 Discord_CallInfoHandle_GetVoiceStateHandle(&instance_, userId, &returnValueNative__);
11438 if (!returnIsNonNull__) {
11442 return returnValue__;
11444uint64_t CallInfoHandle::GuildId()
const
11446 assert(state_ == DiscordObjectState::Owned);
11447 uint64_t returnValue__;
11448 returnValue__ = Discord_CallInfoHandle_GuildId(&instance_);
11449 return returnValue__;
Struct which controls what your rich presence looks like in the Discord client. If you don't specify ...
Definition discordpp.h:762
void SetLargeImage(std::optional< std::string > LargeImage)
Setter for ActivityAssets::LargeImage.
std::optional< std::string > SmallText() const
A tooltip string that is shown when the user hovers over the small image.
void SetLargeText(std::optional< std::string > LargeText)
Setter for ActivityAssets::LargeText.
ActivityAssets(ActivityAssets &&other) noexcept
Move constructor for ActivityAssets.
std::optional< std::string > SmallImage() const
The secondary image, rendered as a small circle over the largeImage.
ActivityAssets(const ActivityAssets &arg0)
Copy constructor for ActivityAssets.
std::optional< std::string > LargeText() const
A tooltip string that is shown when the user hovers over the large image.
void SetSmallImage(std::optional< std::string > SmallImage)
Setter for ActivityAssets::SmallImage.
ActivityAssets & operator=(const ActivityAssets &arg0)
Copy assignment operator for ActivityAssets.
static const ActivityAssets nullobj
Uninitialized instance of ActivityAssets.
Definition discordpp.h:781
std::optional< std::string > LargeImage() const
The primary image identifier or URL, rendered as a large square icon on a user's rich presence.
void SetSmallText(std::optional< std::string > SmallText)
Setter for ActivityAssets::SmallText.
ActivityAssets & operator=(ActivityAssets &&other) noexcept
Move assignment operator for ActivityAssets.
When one user invites another to join their game on Discord, it will send a message to that user....
Definition discordpp.h:664
static const ActivityInvite nullobj
Uninitialized instance of ActivityInvite.
Definition discordpp.h:683
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:881
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:900
ActivityParty & operator=(const ActivityParty &arg0)
Copy assignment operator for ActivityParty.
Definition discordpp.h:943
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:962
Definition discordpp.h:827
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:846
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:1212
std::vector< discordpp::ActivityButton > GetButtons() const
Returns the custom buttons for the rich presence.
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:1231
std::optional< uint64_t > ApplicationId() const
The application ID of the game that the activity is associated with.
std::string Name() const
The name of the game or application that the activity is associated with.
void SetDetails(std::optional< std::string > Details)
Setter for Activity::Details.
Activity & operator=(Activity &&other) noexcept
Move assignment operator for Activity.
void 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::ActivityTimestamps > Timestamps() const
The timestamps struct can be used to render either:
void SetParty(std::optional< discordpp::ActivityParty > Party)
Setter for Activity::Party.
Activity & operator=(const Activity &arg0)
Copy assignment operator for Activity.
std::optional< discordpp::ActivityParty > Party() const
The party struct is used to indicate the size and members of the people the current user is playing w...
void AddButton(discordpp::ActivityButton button)
Adds a custom button to the rich presence.
void SetSupportedPlatforms(discordpp::ActivityGamePlatforms SupportedPlatforms)
Setter for Activity::SupportedPlatforms.
std::optional< std::string > Details() const
The state of the what the user is doing for this activity.
void SetState(std::optional< std::string > State)
Setter for Activity::State.
Activity(Activity &&other) noexcept
Move constructor for Activity.
discordpp::ActivityGamePlatforms SupportedPlatforms() const
If an activity is joinable, but only on certain platforms, this field can be used to indicate which p...
std::optional< discordpp::ActivitySecrets > Secrets() const
The secrets struct is used in combination with the party struct to make an Activity joinable.
std::optional< std::string > State() const
The state of the party for this activity.
discordpp::ActivityTypes Type() const
The type of activity this is.
Contains information about non-text content in a message that likely cannot be rendered in game such ...
Definition discordpp.h:2698
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:2717
Represents a single input or output audio device available to the user.
Definition discordpp.h:2923
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:2942
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:1530
void SetIntegrationType(std::optional< discordpp::IntegrationType > IntegrationType)
Setter for AuthorizationArgs::IntegrationType.
std::optional< std::string > State() const
See https://discord.com/developers/docs/topics/oauth2#state-and-security for details on this field.
AuthorizationArgs & operator=(AuthorizationArgs &&other) noexcept
Move assignment operator for AuthorizationArgs.
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:1549
void SetClientId(uint64_t ClientId)
Setter for AuthorizationArgs::ClientId.
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:1438
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:1458
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:1485
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:1505
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:4835
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:4854
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:1775
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:1836
static const Call nullobj
Uninitialized instance of Call.
Definition discordpp.h:1853
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:1783
@ None
None.
Definition discordpp.h:1786
@ Forbidden
Forbidden.
Definition discordpp.h:1801
@ SignalingConnectionFailed
SignalingConnectionFailed.
Definition discordpp.h:1789
@ SignalingUnexpectedClose
SignalingUnexpectedClose.
Definition discordpp.h:1792
@ JoinTimeout
JoinTimeout.
Definition discordpp.h:1798
@ VoiceConnectionFailed
VoiceConnectionFailed.
Definition discordpp.h:1795
Status
Enum that respresents the state of the Call's network connection.
Definition discordpp.h:1805
@ Disconnecting
Disconnecting.
Definition discordpp.h:1826
@ Connected
Connected.
Definition discordpp.h:1820
@ Reconnecting
Reconnecting.
Definition discordpp.h:1823
@ Connecting
Connecting.
Definition discordpp.h:1814
@ SignalingConnected
SignalingConnected.
Definition discordpp.h:1817
@ Disconnected
Disconnected.
Definition discordpp.h:1808
@ Joining
Joining.
Definition discordpp.h:1811
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:1839
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:1833
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:1830
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:2002
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:2021
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:2977
discordpp::AudioSystem ExperimentalAudioSystem() const
The audio system to use. Defaults to AudioSystem::Standard.
static const ClientCreateOptions nullobj
Uninitialized instance of ClientCreateOptions.
Definition discordpp.h:2996
ClientCreateOptions & operator=(const ClientCreateOptions &arg0)
Copy assignment operator for ClientCreateOptions.
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.
void SetWebBase(std::string WebBase)
Setter for ClientCreateOptions::WebBase.
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:1345
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:1364
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:3039
std::function< void(discordpp::ClientResult result)> UnmergeIntoProvisionalAccountCallback
Callback function for the Client::UnmergeIntoProvisionalAccount method.
Definition discordpp.h:3212
std::function< void(std::vector< discordpp::AudioDevice > devices)> GetOutputDevicesCallback
Callback function for Client::GetOutputDevices.
Definition discordpp.h:3136
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 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:3247
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:3356
std::function< void(discordpp::ClientResult result)> UpdateRelationshipCallback
Callback function for most other Relationship functions such as Client::SendDiscordFriendRequestById.
Definition discordpp.h:3330
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:3216
std::function< void(bool inputDetected)> NoAudioInputCallback
Callback function for Client::SetNoAudioInputCallback.
Definition discordpp.h:3148
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:3235
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:3280
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:3293
std::function< void(std::string message, discordpp::LoggingSeverity severity)> LogCallback
Callback function invoked when a new log message is generated.
Definition discordpp.h:3256
void SetDeviceChangeCallback(discordpp::Client::DeviceChangeCallback callback)
Sets a callback function to be invoked when Discord detects a change in the available audio devices.
std::function< void(discordpp::ClientResult result)> LinkOrUnlinkChannelCallback
Callback function for Client::LinkChannelToLobby.
Definition discordpp.h:3287
std::function< void(discordpp::AudioDevice device)> GetCurrentOutputDeviceCallback
Callback function for Client::GetCurrentOutputDevice.
Definition discordpp.h:3129
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:3209
std::function< void(discordpp::ClientResult result)> SetOutputDeviceCallback
Callback function for Client::SetOutputDevice.
Definition discordpp.h:3151
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:3351
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:3302
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:3160
std::function< void(discordpp::ClientResult result)> LeaveLobbyCallback
Callback function for Client::LeaveLobby.
Definition discordpp.h:3284
std::function< void(uint64_t lobbyId)> LobbyUpdatedCallback
Callback function for Client::SetLobbyUpdatedCallback.
Definition discordpp.h:3305
void GetTokenFromDevice(discordpp::DeviceAuthorizationArgs args, discordpp::Client::TokenExchangeCallback callback)
This function is a combination of Client::Authorize and Client::GetToken, but is used for the case wh...
void CloseAuthorizeDeviceScreen()
This function is used to hide the device authorization screen and is used for the case where the user...
void SetOpusHardwareCoding(bool encode, bool decode)
Enables or disables hardware encoding and decoding for audio, if it is available.
bool ShowAudioRoutePicker()
On iOS devices, show the system audio route picker.
void SetActivityJoinCallback(discordpp::Client::ActivityJoinCallback cb)
Sets a callback function that is invoked when the current user also has Discord running on their comp...
void GetOutputDevices(discordpp::Client::GetOutputDevicesCallback cb)
Asynchronously fetches the list of audio output devices available to the user.
std::function< void()> AuthorizeDeviceScreenClosedCallback
Callback function for Client::SetAuthorizeDeviceScreenClosedCallback.
Definition discordpp.h:3206
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(discordpp::ClientResult result)> UpdateRichPresenceCallback
Callback function for when Client::UpdateRichPresence completes.
Definition discordpp.h:3326
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:3334
std::function< void(discordpp::ClientResult result, std::vector< discordpp::MessageHandle > messages)> GetLobbyMessagesCallback
Callback function for Client::GetLobbyMessagesWithLimit.
Definition discordpp.h:3230
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:3267
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:3123
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:3203
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:3308
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:3082
@ Disconnecting
Disconnecting.
Definition discordpp.h:3100
@ Connected
Connected.
Definition discordpp.h:3091
@ HttpWait
HttpWait.
Definition discordpp.h:3103
@ Reconnecting
Reconnecting.
Definition discordpp.h:3097
@ Connecting
Connecting.
Definition discordpp.h:3088
@ Ready
Ready.
Definition discordpp.h:3094
@ Disconnected
Disconnected.
Definition discordpp.h:3085
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:3195
void SetThreadPriority(discordpp::Client::Thread thread, int32_t priority)
Allows setting the priority of various SDK threads.
discordpp::UserHandle GetCurrentUser() const
Returns the user associated with the current client.
std::function< void(discordpp::ClientResult result)> OpenMessageInDiscordCallback
Callback function for when Client::OpenMessageInDiscord completes.
Definition discordpp.h:3238
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:3120
std::function< void(discordpp::ClientResult result)> EditUserMessageCallback
Callback function for Client::EditUserMessage.
Definition discordpp.h:3227
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:3145
void SetLobbyMemberRemovedCallback(discordpp::Client::LobbyMemberRemovedCallback cb)
Sets a callback function to be invoked whenever a member of a lobby is removed and can no longer conn...
Client(Client &&other) noexcept
Move constructor for Client.
static std::string GetDefaultAudioDeviceId()
Returns the ID of the system default audio device if the user has not explicitly chosen one.
void CancelDiscordFriendRequest(uint64_t userId, discordpp::Client::UpdateRelationshipCallback cb)
Cancels an outgoing Discord friend request to the target user.
std::function< void(uint64_t lobbyId, uint64_t memberId)> LobbyMemberAddedCallback
Callback function for Client::SetLobbyMemberAddedCallback.
Definition discordpp.h:3296
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:3317
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:3221
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:3290
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:3299
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:3179
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:3320
static std::string ErrorToString(discordpp::Client::Error type)
Converts the Error enum to a string.
std::optional< discordpp::UserHandle > GetUser(uint64_t userId) const
Returns the UserHandle associated with the given user ID.
discordpp::RelationshipHandle GetRelationshipHandle(uint64_t userId) const
Returns the RelationshipHandle that corresponds to the relationship between the current user and the ...
std::function< void(discordpp::ClientResult result)> SendActivityInviteCallback
Callback function for Client::SendActivityInvite, Client::SendActivityJoinRequest,...
Definition discordpp.h:3313
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:3154
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:3347
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:3053
@ None
None.
Definition discordpp.h:3056
@ ConnectionCanceled
ConnectionCanceled.
Definition discordpp.h:3065
@ ConnectionFailed
ConnectionFailed.
Definition discordpp.h:3059
@ UnexpectedClose
UnexpectedClose.
Definition discordpp.h:3062
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:3243
std::function< void(discordpp::AudioDevice device)> GetCurrentInputDeviceCallback
Callback function for Client::GetCurrentInputDevice.
Definition discordpp.h:3126
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:3359
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:3250
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:3260
Thread
Represents the type of thread to control thread priority on.
Definition discordpp.h:3107
@ Client
Client.
Definition discordpp.h:3110
@ Voice
Voice.
Definition discordpp.h:3113
@ Network
Network.
Definition discordpp.h:3116
void SendActivityJoinRequestReply(discordpp::ActivityInvite invite, discordpp::Client::SendActivityInviteCallback cb)
When another user requests to join the current user's party, this function is called to to allow that...
void GetGuildChannels(uint64_t guildId, discordpp::Client::GetGuildChannelsCallback cb)
Fetches all of the channels that the current user can access in the given guild.
static std::string ThreadToString(discordpp::Client::Thread type)
Converts the Thread enum to a string.
void BlockUser(uint64_t userId, discordpp::Client::UpdateRelationshipCallback cb)
Blocks the target user so that they cannot send the user friend or activity invites and cannot messag...
std::function< void(uint64_t messageId)> MessageUpdatedCallback
Callback function for Client::SetMessageUpdatedCallback.
Definition discordpp.h:3253
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.
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:3340
std::function< void(discordpp::ClientResult result)> DeleteUserMessageCallback
Callback function for Client::DeleteUserMessage.
Definition discordpp.h:3224
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:3183
bool CanOpenMessageInDiscord(uint64_t messageId)
Returns true if the given message is able to be viewed in a Discord client.
void SetNoiseSuppression(bool on)
Enables basic background noise suppression.
void SetLobbyMemberAddedCallback(discordpp::Client::LobbyMemberAddedCallback cb)
Sets a callback function to be invoked whenever a user is added to a lobby.
void GetCurrentOutputDevice(discordpp::Client::GetCurrentOutputDeviceCallback cb)
Asynchronously fetches the current audio output device in use by the client.
void 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:3191
std::function< void(discordpp::ClientResult result, std::vector< discordpp::GuildChannel > guildChannels)> GetGuildChannelsCallback
Callback function for Client::GetGuildChannels.
Definition discordpp.h:3275
std::function< void(discordpp::ClientResult result)> UpdateStatusCallback
Callback function for when Client::SetOnlineStatus completes.
Definition discordpp.h:3323
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:3271
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:3170
std::function< void(std::vector< discordpp::AudioDevice > inputDevices, std::vector< discordpp::AudioDevice > outputDevices)> DeviceChangeCallback
Callback function for Client::SetDeviceChangeCallback.
Definition discordpp.h:3140
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:3132
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:3372
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:1621
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:1641
void SetClientId(uint64_t ClientId)
Setter for DeviceAuthorizationArgs::ClientId.
void SetScopes(std::string Scopes)
Setter for DeviceAuthorizationArgs::Scopes.
DeviceAuthorizationArgs & operator=(const DeviceAuthorizationArgs &arg0)
Copy assignment operator for DeviceAuthorizationArgs.
std::string Scopes() const
Scopes is a space separated string of the oauth scopes your game is requesting.
DeviceAuthorizationArgs & operator=(DeviceAuthorizationArgs &&other) noexcept
Move assignment operator for DeviceAuthorizationArgs.
void SetIsLinkable(bool IsLinkable)
Setter for GuildChannel::IsLinkable.
bool IsViewableAndWriteableByAllMembers() const
Whether the channel is "fully public" which means every member of the guild is able to view and send ...
std::optional< discordpp::LinkedLobby > LinkedLobby() const
Information about the currently linked lobby, if any. Currently Discord enforces that a channel can o...
uint64_t Id() const
The id of the channel.
void SetName(std::string Name)
Setter for GuildChannel::Name.
GuildChannel(const GuildChannel &arg0)
Copy constructor for GuildChannel.
void SetId(uint64_t Id)
Setter for GuildChannel::Id.
std::string Name() const
The name of the channel.
GuildChannel & operator=(const GuildChannel &arg0)
Copy assignment operator for GuildChannel.
GuildChannel & operator=(GuildChannel &&other) noexcept
Move assignment operator for GuildChannel.
GuildChannel(GuildChannel &&other) noexcept
Move constructor for GuildChannel.
bool IsLinkable() const
Whether the current user is able to link this channel to a lobby.
void SetLinkedLobby(std::optional< discordpp::LinkedLobby > LinkedLobby)
Setter for GuildChannel::LinkedLobby.
void SetIsViewableAndWriteableByAllMembers(bool IsViewableAndWriteableByAllMembers)
Setter for GuildChannel::IsViewableAndWriteableByAllMembers.
static const GuildChannel nullobj
Uninitialized instance of GuildChannel.
Definition discordpp.h:2117
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:2072
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:2225
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:2244
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:2179
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:2198
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:2634
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:2653
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:2491
LobbyMemberHandle & operator=(const LobbyMemberHandle &other)
Copy assignment operator for LobbyMemberHandle.
static const LobbyMemberHandle nullobj
Uninitialized instance of LobbyMemberHandle.
Definition discordpp.h:2510
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:2810
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:2829
std::optional< discordpp::UserHandle > Recipient() const
Returns the UserHandle for the other participant in a DM, if this message was sent in a DM.
std::optional< uint64_t > ApplicationId() const
Returns the application ID associated with this message, if any. You can use this to identify if the ...
MessageHandle & operator=(const MessageHandle &other)
Copy assignment operator for MessageHandle.
uint64_t Id() const
Returns the ID of this message.
std::optional< discordpp::UserHandle > Author() const
Returns the UserHandle for the author of this message.
MessageHandle & operator=(MessageHandle &&other) noexcept
Move assignment operator for MessageHandle.
uint64_t EditedTimestamp() const
The timestamp in millis since the epoch when the message was most recently edited.
MessageHandle(const MessageHandle &other)
Copy constructor for MessageHandle.
std::string Content() const
Returns the content of this message, if any.
std::unordered_map< std::string, std::string > Metadata() const
Returns any metadata the developer included with this message.
std::string RawContent() const
Returns the content of this message, if any, but without replacing any markup from emojis and mention...
std::optional< discordpp::LobbyHandle > Lobby() const
Returns the LobbyHandle this message was sent in, if it was sent in a lobby.
uint64_t RecipientId() const
When this message was sent in a DM or Ephemeral DM, this method will return the ID of the other user ...
uint64_t SentTimestamp() const
The timestamp in millis since the epoch when the message was sent.
std::optional< discordpp::DisclosureTypes > DisclosureType() const
If this is an auto-generated message that is explaining some integration behavior to users,...
uint64_t ChannelId() const
Returns the channel ID this message was sent in.
MessageHandle(MessageHandle &&other) noexcept
Move constructor for MessageHandle.
bool SentFromGame() const
Returns true if this message was sent in-game, otherwise false (i.e. from Discord itself)....
std::optional< discordpp::AdditionalContent > AdditionalContent() const
If the message contains non-text content, such as images, videos, embeds, polls, etc,...
A RelationshipHandle represents the relationship between the current user and a target user on Discor...
Definition discordpp.h:2307
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:2326
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.
A UserHandle represents a single user on Discord that the SDK knows about and contains basic account ...
Definition discordpp.h:2366
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:2400
std::optional< std::string > Avatar() const
Returns the hash of the user's Discord profile avatar, if one is set.
UserHandle(const UserHandle &arg0)
Copy constructor for UserHandle.
discordpp::StatusType Status() const
Returns the user's online/offline/idle status.
UserHandle(UserHandle &&other) noexcept
Move constructor for UserHandle.
std::string AvatarUrl(discordpp::UserHandle::AvatarType animatedType, discordpp::UserHandle::AvatarType staticType) const
Returns a CDN url to the user's Discord profile avatar.
AvatarType
The desired type of avatar url to generate for a User.
Definition discordpp.h:2374
@ Jpeg
Jpeg.
Definition discordpp.h:2386
@ Gif
Gif.
Definition discordpp.h:2377
@ Webp
Webp.
Definition discordpp.h:2380
@ Png
Png.
Definition discordpp.h:2383
bool IsProvisional() const
Returns true if this user is a provisional account.
std::optional< std::string > GlobalName() const
Returns the preferred display name of this user, if one is set.
std::optional< discordpp::Activity > GameActivity() const
Returns the user's rich presence activity that is associated with the current game,...
UserHandle & operator=(const UserHandle &arg0)
Copy assignment operator for UserHandle.
static std::string AvatarTypeToString(discordpp::UserHandle::AvatarType type)
Converts the AvatarType enum to a string.
std::string DisplayName() const
Returns the user's preferred name, if one is set, otherwise returns their unique username.
discordpp::RelationshipHandle Relationship() const
Returns a reference to the RelationshipHandle between the currently authenticated user and this user,...
Settings for the void auto detection threshold for picking up activity from a user's mic.
Definition discordpp.h:1731
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:1750
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:1689
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:1708
bool SelfDeaf() const
Returns true if the given user has deafened themselves so that no one else in the call can hear them ...
VoiceStateHandle(VoiceStateHandle &&other) noexcept
Move constructor for VoiceStateHandle.
VoiceStateHandle & operator=(const VoiceStateHandle &other)
Copy assignment operator for VoiceStateHandle.
VoiceStateHandle(const VoiceStateHandle &other)
Copy constructor for VoiceStateHandle.
The namespace for the generated Discord SDK bindings.
Definition discordpp.h:16
ActivityPartyPrivacy
Allows your game to control the privacy of the party the user is in.
Definition discordpp.h:51
@ Public
The party is public, which means that the user is in a party which could be joinable by either friend...
Definition discordpp.h:65
@ Private
The party is private (or unknown), which means that the user is in a party but it is not joinable wit...
Definition discordpp.h:59
DisclosureTypes
Enum that represents various informational disclosures that Discord may make to users,...
Definition discordpp.h:558
@ MessageDataVisibleOnDiscord
This disclosure type happens the first time a user sends a message in game, and that message will be ...
Definition discordpp.h:564
const char * EnumToString(discordpp::ActivityActionTypes value)
Converts a discordpp::ActivityActionTypes to a string.
Definition discordpp.h:4881
HttpStatusCode
Enum that represents the various HTTP status codes that can be returned.
Definition discordpp.h:189
@ RequestHeaderFieldsTooLarge
RequestHeaderFieldsTooLarge.
Definition discordpp.h:336
@ PayloadTooLarge
PayloadTooLarge.
Definition discordpp.h:297
@ MultiStatus
MultiStatus.
Definition discordpp.h:228
@ VariantAlsoNegotiates
VariantAlsoNegotiates.
Definition discordpp.h:357
@ Gone
Gone.
Definition discordpp.h:288
@ BadGateway
BadGateway.
Definition discordpp.h:345
@ Created
Created.
Definition discordpp.h:210
@ TemporaryRedirect
TemporaryRedirect.
Definition discordpp.h:252
@ ServiceUnavailable
ServiceUnavailable.
Definition discordpp.h:348
@ MovedPermanently
MovedPermanently.
Definition discordpp.h:240
@ PreconditionFailed
PreconditionFailed.
Definition discordpp.h:294
@ RequestTimeout
RequestTimeout.
Definition discordpp.h:282
@ Accepted
Accepted.
Definition discordpp.h:213
@ NonAuthoritativeInfo
NonAuthoritativeInfo.
Definition discordpp.h:216
@ NotFound
NotFound.
Definition discordpp.h:270
@ FailedDependency
FailedDependency.
Definition discordpp.h:321
@ PaymentRequired
PaymentRequired.
Definition discordpp.h:264
@ PreconditionRequired
PreconditionRequired.
Definition discordpp.h:330
@ ResetContent
ResetContent.
Definition discordpp.h:222
@ SwitchingProtocols
SwitchingProtocols.
Definition discordpp.h:198
@ HttpVersionNotSupported
HttpVersionNotSupported.
Definition discordpp.h:354
@ Found
Found.
Definition discordpp.h:243
@ Processing
Processing.
Definition discordpp.h:201
@ None
None.
Definition discordpp.h:192
@ ExpectationFailed
ExpectationFailed.
Definition discordpp.h:309
@ Forbidden
Forbidden.
Definition discordpp.h:267
@ PartialContent
PartialContent.
Definition discordpp.h:225
@ SeeOther
SeeOther.
Definition discordpp.h:246
@ EarlyHints
EarlyHints.
Definition discordpp.h:204
@ LengthRequired
LengthRequired.
Definition discordpp.h:291
@ MethodNotAllowed
MethodNotAllowed.
Definition discordpp.h:273
@ NotExtended
NotExtended.
Definition discordpp.h:366
@ RangeNotSatisfiable
RangeNotSatisfiable.
Definition discordpp.h:306
@ NotImplemented
NotImplemented.
Definition discordpp.h:342
@ BadRequest
BadRequest.
Definition discordpp.h:258
@ Continue
Continue.
Definition discordpp.h:195
@ LoopDetected
LoopDetected.
Definition discordpp.h:363
@ UnsupportedMediaType
UnsupportedMediaType.
Definition discordpp.h:303
@ NetworkAuthorizationRequired
NetworkAuthorizationRequired.
Definition discordpp.h:369
@ ImUsed
ImUsed.
Definition discordpp.h:234
@ MultipleChoices
MultipleChoices.
Definition discordpp.h:237
@ Ok
Ok.
Definition discordpp.h:207
@ TooManyRequests
TooManyRequests.
Definition discordpp.h:333
@ ProxyAuthRequired
ProxyAuthRequired.
Definition discordpp.h:279
@ UnprocessableEntity
UnprocessableEntity.
Definition discordpp.h:315
@ MisdirectedRequest
MisdirectedRequest.
Definition discordpp.h:312
@ PermanentRedirect
PermanentRedirect.
Definition discordpp.h:255
@ NotModified
NotModified.
Definition discordpp.h:249
@ AlreadyReported
AlreadyReported.
Definition discordpp.h:231
@ NoContent
NoContent.
Definition discordpp.h:219
@ Locked
Locked.
Definition discordpp.h:318
@ GatewayTimeout
GatewayTimeout.
Definition discordpp.h:351
@ Unauthorized
Unauthorized.
Definition discordpp.h:261
@ UpgradeRequired
UpgradeRequired.
Definition discordpp.h:327
@ InsufficientStorage
InsufficientStorage.
Definition discordpp.h:360
@ InternalServerError
InternalServerError.
Definition discordpp.h:339
@ TooEarly
TooEarly.
Definition discordpp.h:324
@ Conflict
Conflict.
Definition discordpp.h:285
@ UriTooLong
UriTooLong.
Definition discordpp.h:300
@ NotAcceptable
NotAcceptable.
Definition discordpp.h:276
AuthorizationTokenType
Represents the type of auth token used by the SDK, either the normal tokens produced by the Discord d...
Definition discordpp.h:569
@ Bearer
Bearer.
Definition discordpp.h:575
@ User
User.
Definition discordpp.h:572
ChannelType
Enum that represents the various channel types on Discord.
Definition discordpp.h:442
@ GuildForum
GuildForum.
Definition discordpp.h:481
@ Dm
Dm.
Definition discordpp.h:448
@ Lobby
Lobby.
Definition discordpp.h:487
@ GuildNews
GuildNews.
Definition discordpp.h:460
@ GuildVoice
GuildVoice.
Definition discordpp.h:451
@ GuildPublicThread
GuildPublicThread.
Definition discordpp.h:469
@ GuildNewsThread
GuildNewsThread.
Definition discordpp.h:466
@ GuildDirectory
GuildDirectory.
Definition discordpp.h:478
@ GuildCategory
GuildCategory.
Definition discordpp.h:457
@ GuildStageVoice
GuildStageVoice.
Definition discordpp.h:475
@ GuildMedia
GuildMedia.
Definition discordpp.h:484
@ GuildStore
GuildStore.
Definition discordpp.h:463
@ GuildText
GuildText.
Definition discordpp.h:445
@ GroupDm
GroupDm.
Definition discordpp.h:454
@ EphemeralDm
EphemeralDm.
Definition discordpp.h:490
@ GuildPrivateThread
GuildPrivateThread.
Definition discordpp.h:472
AuthenticationCodeChallengeMethod
Represents the crypto method used to generate a code challenge.
Definition discordpp.h:375
@ S256
S256.
Definition discordpp.h:378
RelationshipType
Enum that represents the possible types of relationships that can exist between two users.
Definition discordpp.h:494
@ PendingIncoming
The current user has received a friend request from the target user, but it is not yet accepted.
Definition discordpp.h:509
@ Implicit
The Implicit type is documented for visibility, but should be unused in the SDK.
Definition discordpp.h:516
@ Suggestion
The Suggestion type is documented for visibility, but should be unused in the SDK.
Definition discordpp.h:519
@ PendingOutgoing
The current user has sent a friend request to the target user, but it is not yet accepted.
Definition discordpp.h:513
@ Blocked
The current user has blocked the target user, and so certain actions such as sending messages between...
Definition discordpp.h:504
@ None
The user has no relationship with the other user.
Definition discordpp.h:497
@ Friend
The user is friends with the other user.
Definition discordpp.h:500
AuthenticationExternalAuthType
Represents the various identity providers that can be used to authenticate a provisional account user...
Definition discordpp.h:580
@ EpicOnlineServicesIdToken
EpicOnlineServicesIdToken.
Definition discordpp.h:589
@ EpicOnlineServicesAccessToken
EpicOnlineServicesAccessToken.
Definition discordpp.h:586
@ SteamSessionTicket
SteamSessionTicket.
Definition discordpp.h:592
@ OIDC
OIDC.
Definition discordpp.h:583
@ UnityServicesIdToken
UnityServicesIdToken.
Definition discordpp.h:595
LoggingSeverity
Enum that represents the various log levels supported by the SDK.
Definition discordpp.h:599
@ Warning
Warning.
Definition discordpp.h:608
@ Info
Info.
Definition discordpp.h:605
@ None
None.
Definition discordpp.h:614
@ Error
Error.
Definition discordpp.h:611
@ Verbose
Verbose.
Definition discordpp.h:602
RelationshipGroupType
Enum that represents the logical groups of relationships based on online status and game activity.
Definition discordpp.h:619
@ OnlinePlayingGame
Users who are online and currently playing the game.
Definition discordpp.h:622
@ Offline
Users who are offline.
Definition discordpp.h:628
@ OnlineElsewhere
Users who are online but not playing the game.
Definition discordpp.h:625
IntegrationType
Represents the type of integration the app will be installed as.
Definition discordpp.h:382
@ GuildInstall
GuildInstall.
Definition discordpp.h:385
@ UserInstall
UserInstall.
Definition discordpp.h:388
AudioSystem
The Discord Voice audio system to use.
Definition discordpp.h:417
@ Game
Use the game audio system.
Definition discordpp.h:423
@ Standard
Use the standard audio system.
Definition discordpp.h:420
ActivityGamePlatforms
Represents the type of platforms that an activity invite can be accepted on.
Definition discordpp.h:99
@ Embedded
Embedded.
Definition discordpp.h:117
@ Xbox
Xbox.
Definition discordpp.h:105
@ Desktop
Desktop.
Definition discordpp.h:102
@ Samsung
Samsung.
Definition discordpp.h:108
@ PS5
PS5.
Definition discordpp.h:123
@ PS4
PS4.
Definition discordpp.h:120
@ IOS
IOS.
Definition discordpp.h:111
@ Android
Android.
Definition discordpp.h:114
ActivityTypes
Discord RichPresence supports multiple types of activities that a user can be doing.
Definition discordpp.h:74
@ Watching
Watching.
Definition discordpp.h:86
@ Competing
Competing.
Definition discordpp.h:92
@ HangStatus
HangStatus.
Definition discordpp.h:95
@ Listening
Listening.
Definition discordpp.h:83
@ Streaming
Streaming.
Definition discordpp.h:80
@ CustomStatus
CustomStatus.
Definition discordpp.h:89
@ Playing
Playing.
Definition discordpp.h:77
StatusType
Enum that specifies the various online statuses for a user.
Definition discordpp.h:526
@ Blocked
Blocked.
Definition discordpp.h:535
@ Online
The user is online and recently active.
Definition discordpp.h:529
@ Dnd
The user is online, but wishes to suppress notifications for the time being.
Definition discordpp.h:542
@ Unknown
Unknown.
Definition discordpp.h:551
@ Invisible
The user is online, but wishes to appear as if they are offline to other users.
Definition discordpp.h:545
@ Offline
The user is offline and not connected to Discord.
Definition discordpp.h:532
@ Streaming
The user is online and is actively streaming content.
Definition discordpp.h:548
@ Idle
The user is online, but has not been active for a while and may be away from their computer.
Definition discordpp.h:539
void RunCallbacks()
Definition discordpp.h:29
AudioModeType
Represents whether a voice call is using push to talk or auto voice detection.
Definition discordpp.h:427
@ MODE_PTT
MODE_PTT.
Definition discordpp.h:436
@ MODE_VAD
MODE_VAD.
Definition discordpp.h:433
@ MODE_UNINIT
MODE_UNINIT.
Definition discordpp.h:430
ErrorType
Enum representing various types of errors the SDK returns.
Definition discordpp.h:127
@ HTTPError
An HTTP call was made to Discord's servers but a non success HTTP status code was returned....
Definition discordpp.h:142
@ NetworkError
The user is offline or there was some network issue that prevented an underlying HTTP call from succe...
Definition discordpp.h:134
@ AuthorizationFailed
An authorization function failed, but not necessarily as the result of an HTTP call that returned an ...
Definition discordpp.h:176
@ ClientNotReady
An operation such as sending a friend request or joining a lobby was attempted but the Client is not ...
Definition discordpp.h:152
@ None
No error, the operation was successful.
Definition discordpp.h:130
@ Aborted
The user or developer aborted an operation, such as an authorization flow.
Definition discordpp.h:171
@ RPCError
An RPC call was made to Discord's desktop application, but it returned a non-success result....
Definition discordpp.h:181
@ ValidationError
Used when an SDK method is called but the inputs don't pass local validation. For example if one atte...
Definition discordpp.h:168
@ ClientDestroyed
The Client has been destroyed and so this operation cannot complete.
Definition discordpp.h:158
@ Disabled
An operation was temporarily disabled for stability reasons.
Definition discordpp.h:155
DiscordObjectState
Represents the memory state of a Discord object.
Definition discordpp.h:19
@ Invalid
The object has been freed.
Definition discordpp.h:21
@ Owned
The object is owned by the C++ wrapper and methods can be called on it.
Definition discordpp.h:23
AdditionalContentType
Represents the type of additional content contained in a message.
Definition discordpp.h:392
@ Sticker
Sticker.
Definition discordpp.h:413
@ VoiceMessage
VoiceMessage.
Definition discordpp.h:404
@ Other
Other.
Definition discordpp.h:395
@ Poll
Poll.
Definition discordpp.h:401
@ Thread
Thread.
Definition discordpp.h:407
@ Attachment
Attachment.
Definition discordpp.h:398
@ Embed
Embed.
Definition discordpp.h:410
ActivityActionTypes
ActivityActionTypes represents the type of invite being sent to a user.
Definition discordpp.h:41
@ Join
Join.
Definition discordpp.h:44
@ JoinRequest
JoinRequest.
Definition discordpp.h:47