2#ifndef DISCORD_HEADER_DISCORDPP_H_
3#define DISCORD_HEADER_DISCORDPP_H_
12#include <unordered_map>
31 Discord_RunCallbacks();
598class ActivityTimestamps;
600class ActivitySecrets;
603class AuthorizationCodeChallenge;
604class AuthorizationCodeVerifier;
605class AuthorizationArgs;
606class DeviceAuthorizationArgs;
607class VoiceStateHandle;
608class VADThresholdSettings;
615class RelationshipHandle;
617class LobbyMemberHandle;
619class AdditionalContent;
630 mutable Discord_ActivityInvite instance_{};
636 Discord_ActivityInvite* instance()
const {
return &instance_; }
722 mutable Discord_ActivityAssets instance_{};
728 Discord_ActivityAssets* instance()
const {
return &instance_; }
787 mutable Discord_ActivityTimestamps instance_{};
793 Discord_ActivityTimestamps* instance()
const {
return &instance_; }
841 mutable Discord_ActivityParty instance_{};
847 Discord_ActivityParty* instance()
const {
return &instance_; }
879 std::string
Id()
const;
903 mutable Discord_ActivitySecrets instance_{};
909 Discord_ActivitySecrets* instance()
const {
return &instance_; }
1114 mutable Discord_Activity instance_{};
1120 Discord_Activity* instance()
const {
return &instance_; }
1167 std::optional<std::string>
State()
const;
1188 std::optional<discordpp::ActivityAssets>
Assets()
const;
1201 std::optional<discordpp::ActivityParty>
Party()
const;
1207 std::optional<discordpp::ActivitySecrets>
Secrets()
const;
1232 mutable Discord_ClientResult instance_{};
1238 Discord_ClientResult* instance()
const {
return &instance_; }
1325 mutable Discord_AuthorizationCodeChallenge instance_{};
1331 Discord_AuthorizationCodeChallenge* instance()
const {
return &instance_; }
1372 mutable Discord_AuthorizationCodeVerifier instance_{};
1378 Discord_AuthorizationCodeVerifier* instance()
const {
return &instance_; }
1417 mutable Discord_AuthorizationArgs instance_{};
1423 Discord_AuthorizationArgs* instance()
const {
return &instance_; }
1476 std::optional<std::string>
State()
const;
1484 std::optional<std::string>
Nonce()
const;
1501 mutable Discord_DeviceAuthorizationArgs instance_{};
1507 Discord_DeviceAuthorizationArgs* instance()
const {
return &instance_; }
1569 mutable Discord_VoiceStateHandle instance_{};
1575 Discord_VoiceStateHandle* instance()
const {
return &instance_; }
1611 mutable Discord_VADThresholdSettings instance_{};
1617 Discord_VADThresholdSettings* instance()
const {
return &instance_; }
1655 mutable Discord_Call instance_{};
1720 Discord_Call* instance()
const {
return &instance_; }
1882 mutable Discord_ChannelHandle instance_{};
1888 Discord_ChannelHandle* instance()
const {
return &instance_; }
1933 mutable Discord_GuildMinimal instance_{};
1939 Discord_GuildMinimal* instance()
const {
return &instance_; }
1978 mutable Discord_GuildChannel instance_{};
1984 Discord_GuildChannel* instance()
const {
return &instance_; }
2059 mutable Discord_LinkedLobby instance_{};
2065 Discord_LinkedLobby* instance()
const {
return &instance_; }
2105 mutable Discord_LinkedChannel instance_{};
2111 Discord_LinkedChannel* instance()
const {
return &instance_; }
2187 mutable Discord_RelationshipHandle instance_{};
2193 Discord_RelationshipHandle* instance()
const {
return &instance_; }
2228 std::optional<discordpp::UserHandle>
User()
const;
2243 mutable Discord_UserHandle instance_{};
2264 Discord_UserHandle* instance()
const {
return &instance_; }
2368 mutable Discord_LobbyMemberHandle instance_{};
2374 Discord_LobbyMemberHandle* instance()
const {
return &instance_; }
2417 std::unordered_map<std::string, std::string>
Metadata()
const;
2420 std::optional<discordpp::UserHandle>
User()
const;
2511 mutable Discord_LobbyHandle instance_{};
2517 Discord_LobbyHandle* instance()
const {
return &instance_; }
2568 std::unordered_map<std::string, std::string>
Metadata()
const;
2575 mutable Discord_AdditionalContent instance_{};
2581 Discord_AdditionalContent* instance()
const {
return &instance_; }
2620 std::optional<std::string>
Title()
const;
2687 mutable Discord_MessageHandle instance_{};
2693 Discord_MessageHandle* instance()
const {
return &instance_; }
2722 std::optional<discordpp::UserHandle>
Author()
const;
2728 std::optional<discordpp::ChannelHandle>
Channel()
const;
2753 std::optional<discordpp::LobbyHandle>
Lobby()
const;
2760 std::unordered_map<std::string, std::string>
Metadata()
const;
2791 mutable Discord_AudioDevice instance_{};
2797 Discord_AudioDevice* instance()
const {
return &instance_; }
2846 mutable Discord_Client instance_{};
2938 std::function<void(std::vector<discordpp::AudioDevice> devices)>;
2942 std::function<void(std::vector<discordpp::AudioDevice> devices)>;
2946 std::function<void(std::vector<discordpp::AudioDevice> inputDevices,
2947 std::vector<discordpp::AudioDevice> outputDevices)>;
2960 std::function<void(uint64_t lobbyId, uint64_t memberId,
bool added)>;
2967 uint64_t samplesPerChannel,
2970 bool& outShouldMute)>;
2976 void(int16_t* data, uint64_t samplesPerChannel, int32_t sampleRate, uint64_t channels)>;
2993 std::string accessToken,
2994 std::string refreshToken,
2997 std::string scopes)>;
3058 std::vector<discordpp::GuildChannel> guildChannels)>;
3062 std::vector<discordpp::GuildMinimal> guilds)>;
3119 std::function<void(uint64_t userId,
bool isDiscordRelationshipUpdate)>;
3123 std::function<void(uint64_t userId,
bool isDiscordRelationshipUpdate)>;
3128 std::optional<discordpp::UserHandle> user)>;
3133 Discord_Client* instance()
const {
return &instance_; }
3155 explicit Client(std::string apiBase, std::string webBase);
3534 std::string
const& token,
3572 std::string
const& externalAuthToken,
3599 std::string
const& code,
3600 std::string
const& codeVerifier,
3601 std::string
const& redirectUri,
3671 std::string
const& externalAuthToken,
3705 std::string
const& code,
3706 std::string
const& codeVerifier,
3707 std::string
const& redirectUri,
3709 std::string
const& externalAuthToken,
3745 std::string
const& refreshToken,
3780 std::string
const& name,
3814 std::string
const& content,
3852 std::string
const& content,
3862 std::string
const& content,
3863 std::unordered_map<std::string, std::string>
const& metadata,
3879 std::string
const& content,
3889 std::string
const& content,
3890 std::unordered_map<std::string, std::string>
const& metadata,
4047 std::string
const& secret,
4048 std::unordered_map<std::string, std::string>
const& lobbyMetadata,
4049 std::unordered_map<std::string, std::string>
const& memberMetadata,
4209 std::string
const& content,
4462 uint64_t applicationId,
4470 std::optional<discordpp::UserHandle>
GetUser(uint64_t userId)
const;
4483 mutable Discord_CallInfoHandle instance_{};
4489 Discord_CallInfoHandle* instance()
const {
return &instance_; }
4533 return "JoinRequest";
4563 return "CustomStatus";
4567 return "HangStatus";
4603 return "NetworkError";
4607 return "ClientNotReady";
4611 return "ClientDestroyed";
4613 return "ValidationError";
4617 return "AuthorizationFailed";
4633 return "SwitchingProtocols";
4635 return "Processing";
4637 return "EarlyHints";
4645 return "NonAuthoritativeInfo";
4649 return "ResetContent";
4651 return "PartialContent";
4653 return "MultiStatus";
4655 return "AlreadyReported";
4659 return "MultipleChoices";
4661 return "MovedPermanently";
4667 return "NotModified";
4669 return "TemporaryRedirect";
4671 return "PermanentRedirect";
4673 return "BadRequest";
4675 return "Unauthorized";
4677 return "PaymentRequired";
4683 return "MethodNotAllowed";
4685 return "NotAcceptable";
4687 return "ProxyAuthRequired";
4689 return "RequestTimeout";
4695 return "LengthRequired";
4697 return "PreconditionFailed";
4699 return "PayloadTooLarge";
4701 return "UriTooLong";
4703 return "UnsupportedMediaType";
4705 return "RangeNotSatisfiable";
4707 return "ExpectationFailed";
4709 return "MisdirectedRequest";
4711 return "UnprocessableEntity";
4715 return "FailedDependency";
4719 return "UpgradeRequired";
4721 return "PreconditionRequired";
4723 return "TooManyRequests";
4725 return "RequestHeaderFieldsTooLarge";
4727 return "InternalServerError";
4729 return "NotImplemented";
4731 return "BadGateway";
4733 return "ServiceUnavailable";
4735 return "GatewayTimeout";
4737 return "HttpVersionNotSupported";
4739 return "VariantAlsoNegotiates";
4741 return "InsufficientStorage";
4743 return "LoopDetected";
4745 return "NotExtended";
4747 return "NetworkAuthorizationRequired";
4769 return "Attachment";
4773 return "VoiceMessage";
4791 return "SignalingConnectionFailed";
4793 return "SignalingUnexpectedClose";
4795 return "VoiceConnectionFailed";
4797 return "JoinTimeout";
4809 return "MODE_UNINIT";
4823 return "Disconnected";
4827 return "Connecting";
4829 return "SignalingConnected";
4833 return "Reconnecting";
4835 return "Disconnecting";
4849 return "GuildVoice";
4853 return "GuildCategory";
4857 return "GuildStore";
4859 return "GuildNewsThread";
4861 return "GuildPublicThread";
4863 return "GuildPrivateThread";
4865 return "GuildStageVoice";
4867 return "GuildDirectory";
4869 return "GuildForum";
4871 return "GuildMedia";
4875 return "EphemeralDm";
4891 return "PendingIncoming";
4893 return "PendingOutgoing";
4897 return "Suggestion";
4947 return "MessageDataVisibleOnDiscord";
4959 return "ConnectionFailed";
4961 return "UnexpectedClose";
4963 return "ConnectionCanceled";
4973 return "Disconnected";
4975 return "Connecting";
4981 return "Reconnecting";
4983 return "Disconnecting";
5023 return "EpicOnlineServicesAccessToken";
5025 return "EpicOnlineServicesIdToken";
5027 return "SteamSessionTicket";
5029 return "UnityServicesIdToken";
5054#ifdef DISCORDPP_IMPLEMENTATION
5055#undef DISCORDPP_IMPLEMENTATION
5057#pragma clang diagnostic push
5058#pragma clang diagnostic ignored "-Wunused-parameter"
5061std::function<void(std::function<
void()>)> s_synchronizationContext;
5063inline bool HasSynchronizationContext()
5065 return !!s_synchronizationContext;
5068inline void PostTask(std::function<
void()> task)
5070 assert(s_synchronizationContext);
5071 s_synchronizationContext(std::move(task));
5074void SetSynchronizationContext(std::function<
void(std::function<
void()>)> executor)
5076 s_synchronizationContext = std::move(executor);
5079template <
typename T>
5080struct TDelegateUserData {
5082 TDelegateUserData(T delegate)
5083 : delegate{delegate}
5087 static void Free(
void* ptr) {
delete reinterpret_cast<TDelegateUserData*
>(ptr); }
5089 static T& Get(
void* userData)
5091 return reinterpret_cast<TDelegateUserData*
>(userData)->delegate;
5095struct ConvertedProperties {
5096 ConvertedProperties(std::unordered_map<std::string, std::string>
const& PropertyMap)
5098 Properties.size = PropertyMap.size();
5099 Properties.keys =
reinterpret_cast<Discord_String*
>(
5100 Discord_Alloc(Properties.size *
sizeof(Discord_String)));
5101 Properties.values =
reinterpret_cast<Discord_String*
>(
5102 Discord_Alloc(Properties.size *
sizeof(Discord_String)));
5104 for (
auto& pair : PropertyMap) {
5105 Properties.keys[i] = AllocateString(pair.first);
5106 Properties.values[i] = AllocateString(pair.second);
5110 ~ConvertedProperties() { Discord_FreeProperties(Properties); }
5111 Discord_Properties Properties{};
5114 Discord_String AllocateString(std::string
const& str)
5116 Discord_String result;
5117 result.ptr =
reinterpret_cast<uint8_t*
>(Discord_Alloc(str.size()));
5118 result.size = str.size();
5119 std::memcpy(result.ptr, str.data(), result.size);
5124std::unordered_map<std::string, std::string> ConvertReturnedProperties(
5125 Discord_Properties
const& Properties)
5127 std::unordered_map<std::string, std::string> result;
5128 for (
size_t i = 0; i < Properties.size; ++i) {
5129 std::string key(
reinterpret_cast<char*
>(Properties.keys[i].ptr), Properties.keys[i].size);
5130 std::string value(
reinterpret_cast<char*
>(Properties.values[i].ptr),
5131 Properties.values[i].size);
5132 result.emplace(std::move(key), std::move(value));
5137ActivityInvite::~ActivityInvite()
5145 : instance_(other.instance_)
5146 , state_(other.state_)
5152 if (
this != &other) {
5156 instance_ = other.instance_;
5157 state_ = other.state_;
5167 Discord_ActivityInvite_Clone(&instance_, rhs.instance());
5169 state_ = DiscordObjectState::Owned;
5172ActivityInvite& ActivityInvite::operator=(
const ActivityInvite& rhs)
5175 if (state_ == DiscordObjectState::Owned) {
5177 state_ = DiscordObjectState::Invalid;
5179 if (rhs.state_ == DiscordObjectState::Owned) {
5180 Discord_ActivityInvite_Clone(&instance_, rhs.instance());
5182 state_ = DiscordObjectState::Owned;
5187ActivityInvite::ActivityInvite(Discord_ActivityInvite instance, DiscordObjectState state)
5188 : instance_(instance)
5192ActivityInvite::ActivityInvite()
5194 assert(state_ == DiscordObjectState::Invalid);
5195 Discord_ActivityInvite_Init(&instance_);
5196 state_ = DiscordObjectState::Owned;
5198void ActivityInvite::Drop()
5200 if (state_ != DiscordObjectState::Owned) {
5203 Discord_ActivityInvite_Drop(&instance_);
5204 state_ = DiscordObjectState::Invalid;
5206uint64_t ActivityInvite::SenderId()
const
5208 assert(state_ == DiscordObjectState::Owned);
5209 uint64_t returnValue__;
5210 returnValue__ = Discord_ActivityInvite_SenderId(&instance_);
5211 return returnValue__;
5213void ActivityInvite::SetSenderId(uint64_t SenderId)
5215 assert(state_ == DiscordObjectState::Owned);
5216 Discord_ActivityInvite_SetSenderId(&instance_, SenderId);
5218uint64_t ActivityInvite::ChannelId()
const
5220 assert(state_ == DiscordObjectState::Owned);
5221 uint64_t returnValue__;
5222 returnValue__ = Discord_ActivityInvite_ChannelId(&instance_);
5223 return returnValue__;
5225void ActivityInvite::SetChannelId(uint64_t ChannelId)
5227 assert(state_ == DiscordObjectState::Owned);
5228 Discord_ActivityInvite_SetChannelId(&instance_, ChannelId);
5230uint64_t ActivityInvite::MessageId()
const
5232 assert(state_ == DiscordObjectState::Owned);
5233 uint64_t returnValue__;
5234 returnValue__ = Discord_ActivityInvite_MessageId(&instance_);
5235 return returnValue__;
5237void ActivityInvite::SetMessageId(uint64_t MessageId)
5239 assert(state_ == DiscordObjectState::Owned);
5240 Discord_ActivityInvite_SetMessageId(&instance_, MessageId);
5244 assert(state_ == DiscordObjectState::Owned);
5245 Discord_ActivityActionTypes returnValue__;
5246 returnValue__ = Discord_ActivityInvite_Type(&instance_);
5251 assert(state_ == DiscordObjectState::Owned);
5252 Discord_ActivityInvite_SetType(&instance_,
static_cast<Discord_ActivityActionTypes
>(Type));
5254uint64_t ActivityInvite::ApplicationId()
const
5256 assert(state_ == DiscordObjectState::Owned);
5257 uint64_t returnValue__;
5258 returnValue__ = Discord_ActivityInvite_ApplicationId(&instance_);
5259 return returnValue__;
5261void ActivityInvite::SetApplicationId(uint64_t ApplicationId)
5263 assert(state_ == DiscordObjectState::Owned);
5264 Discord_ActivityInvite_SetApplicationId(&instance_, ApplicationId);
5266std::string ActivityInvite::PartyId()
const
5268 assert(state_ == DiscordObjectState::Owned);
5269 Discord_String returnValueNative__;
5270 Discord_ActivityInvite_PartyId(&instance_, &returnValueNative__);
5271 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
5272 returnValueNative__.size);
5273 Discord_Free(returnValueNative__.ptr);
5274 return returnValue__;
5276void ActivityInvite::SetPartyId(std::string PartyId)
5278 assert(state_ == DiscordObjectState::Owned);
5279 Discord_String PartyId__str{(uint8_t*)(PartyId.data()), PartyId.size()};
5280 Discord_ActivityInvite_SetPartyId(&instance_, PartyId__str);
5282std::string ActivityInvite::SessionId()
const
5284 assert(state_ == DiscordObjectState::Owned);
5285 Discord_String returnValueNative__;
5286 Discord_ActivityInvite_SessionId(&instance_, &returnValueNative__);
5287 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
5288 returnValueNative__.size);
5289 Discord_Free(returnValueNative__.ptr);
5290 return returnValue__;
5292void ActivityInvite::SetSessionId(std::string SessionId)
5294 assert(state_ == DiscordObjectState::Owned);
5295 Discord_String SessionId__str{(uint8_t*)(SessionId.data()), SessionId.size()};
5296 Discord_ActivityInvite_SetSessionId(&instance_, SessionId__str);
5298bool ActivityInvite::IsValid()
const
5300 assert(state_ == DiscordObjectState::Owned);
5302 returnValue__ = Discord_ActivityInvite_IsValid(&instance_);
5303 return returnValue__;
5305void ActivityInvite::SetIsValid(
bool IsValid)
5307 assert(state_ == DiscordObjectState::Owned);
5308 Discord_ActivityInvite_SetIsValid(&instance_, IsValid);
5310const ActivityAssets ActivityAssets::nullobj{{}, DiscordObjectState::Invalid};
5311ActivityAssets::~ActivityAssets()
5313 if (state_ == DiscordObjectState::Owned) {
5315 state_ = DiscordObjectState::Invalid;
5318ActivityAssets::ActivityAssets(ActivityAssets&& other) noexcept
5319 : instance_(other.instance_)
5320 , state_(other.state_)
5322 other.state_ = DiscordObjectState::Invalid;
5324ActivityAssets& ActivityAssets::operator=(ActivityAssets&& other)
noexcept
5326 if (
this != &other) {
5327 if (state_ == DiscordObjectState::Owned) {
5330 instance_ = other.instance_;
5331 state_ = other.state_;
5332 other.state_ = DiscordObjectState::Invalid;
5336ActivityAssets::ActivityAssets(
const ActivityAssets& arg0)
5341 Discord_ActivityAssets_Clone(&instance_, arg0.instance());
5343 state_ = DiscordObjectState::Owned;
5346ActivityAssets& ActivityAssets::operator=(
const ActivityAssets& arg0)
5348 if (
this != &arg0) {
5349 if (state_ == DiscordObjectState::Owned) {
5351 state_ = DiscordObjectState::Invalid;
5353 if (arg0.state_ == DiscordObjectState::Owned) {
5354 Discord_ActivityAssets_Clone(&instance_, arg0.instance());
5356 state_ = DiscordObjectState::Owned;
5361ActivityAssets::ActivityAssets(Discord_ActivityAssets instance, DiscordObjectState state)
5362 : instance_(instance)
5366ActivityAssets::ActivityAssets()
5368 assert(state_ == DiscordObjectState::Invalid);
5369 Discord_ActivityAssets_Init(&instance_);
5370 state_ = DiscordObjectState::Owned;
5372void ActivityAssets::Drop()
5374 if (state_ != DiscordObjectState::Owned) {
5377 Discord_ActivityAssets_Drop(&instance_);
5378 state_ = DiscordObjectState::Invalid;
5380std::optional<std::string> ActivityAssets::LargeImage()
const
5382 assert(state_ == DiscordObjectState::Owned);
5383 bool returnIsNonNull__;
5384 Discord_String returnValueNative__;
5385 returnIsNonNull__ = Discord_ActivityAssets_LargeImage(&instance_, &returnValueNative__);
5386 if (!returnIsNonNull__) {
5389 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
5390 returnValueNative__.size);
5391 Discord_Free(returnValueNative__.ptr);
5392 return returnValue__;
5394void ActivityAssets::SetLargeImage(std::optional<std::string> LargeImage)
5396 assert(state_ == DiscordObjectState::Owned);
5397 Discord_String LargeImage__str{};
5398 if (LargeImage.has_value()) {
5399 LargeImage__str.ptr =
reinterpret_cast<uint8_t*
>(LargeImage->data());
5400 LargeImage__str.size = LargeImage->size();
5402 Discord_ActivityAssets_SetLargeImage(&instance_,
5403 (LargeImage.has_value() ? &LargeImage__str :
nullptr));
5405std::optional<std::string> ActivityAssets::LargeText()
const
5407 assert(state_ == DiscordObjectState::Owned);
5408 bool returnIsNonNull__;
5409 Discord_String returnValueNative__;
5410 returnIsNonNull__ = Discord_ActivityAssets_LargeText(&instance_, &returnValueNative__);
5411 if (!returnIsNonNull__) {
5414 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
5415 returnValueNative__.size);
5416 Discord_Free(returnValueNative__.ptr);
5417 return returnValue__;
5419void ActivityAssets::SetLargeText(std::optional<std::string> LargeText)
5421 assert(state_ == DiscordObjectState::Owned);
5422 Discord_String LargeText__str{};
5423 if (LargeText.has_value()) {
5424 LargeText__str.ptr =
reinterpret_cast<uint8_t*
>(LargeText->data());
5425 LargeText__str.size = LargeText->size();
5427 Discord_ActivityAssets_SetLargeText(&instance_,
5428 (LargeText.has_value() ? &LargeText__str :
nullptr));
5430std::optional<std::string> ActivityAssets::SmallImage()
const
5432 assert(state_ == DiscordObjectState::Owned);
5433 bool returnIsNonNull__;
5434 Discord_String returnValueNative__;
5435 returnIsNonNull__ = Discord_ActivityAssets_SmallImage(&instance_, &returnValueNative__);
5436 if (!returnIsNonNull__) {
5439 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
5440 returnValueNative__.size);
5441 Discord_Free(returnValueNative__.ptr);
5442 return returnValue__;
5444void ActivityAssets::SetSmallImage(std::optional<std::string> SmallImage)
5446 assert(state_ == DiscordObjectState::Owned);
5447 Discord_String SmallImage__str{};
5448 if (SmallImage.has_value()) {
5449 SmallImage__str.ptr =
reinterpret_cast<uint8_t*
>(SmallImage->data());
5450 SmallImage__str.size = SmallImage->size();
5452 Discord_ActivityAssets_SetSmallImage(&instance_,
5453 (SmallImage.has_value() ? &SmallImage__str :
nullptr));
5455std::optional<std::string> ActivityAssets::SmallText()
const
5457 assert(state_ == DiscordObjectState::Owned);
5458 bool returnIsNonNull__;
5459 Discord_String returnValueNative__;
5460 returnIsNonNull__ = Discord_ActivityAssets_SmallText(&instance_, &returnValueNative__);
5461 if (!returnIsNonNull__) {
5464 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
5465 returnValueNative__.size);
5466 Discord_Free(returnValueNative__.ptr);
5467 return returnValue__;
5469void ActivityAssets::SetSmallText(std::optional<std::string> SmallText)
5471 assert(state_ == DiscordObjectState::Owned);
5472 Discord_String SmallText__str{};
5473 if (SmallText.has_value()) {
5474 SmallText__str.ptr =
reinterpret_cast<uint8_t*
>(SmallText->data());
5475 SmallText__str.size = SmallText->size();
5477 Discord_ActivityAssets_SetSmallText(&instance_,
5478 (SmallText.has_value() ? &SmallText__str :
nullptr));
5480const ActivityTimestamps ActivityTimestamps::nullobj{{}, DiscordObjectState::Invalid};
5481ActivityTimestamps::~ActivityTimestamps()
5483 if (state_ == DiscordObjectState::Owned) {
5485 state_ = DiscordObjectState::Invalid;
5488ActivityTimestamps::ActivityTimestamps(ActivityTimestamps&& other) noexcept
5489 : instance_(other.instance_)
5490 , state_(other.state_)
5492 other.state_ = DiscordObjectState::Invalid;
5494ActivityTimestamps& ActivityTimestamps::operator=(ActivityTimestamps&& other)
noexcept
5496 if (
this != &other) {
5497 if (state_ == DiscordObjectState::Owned) {
5500 instance_ = other.instance_;
5501 state_ = other.state_;
5502 other.state_ = DiscordObjectState::Invalid;
5506ActivityTimestamps::ActivityTimestamps(
const ActivityTimestamps& arg0)
5511 Discord_ActivityTimestamps_Clone(&instance_, arg0.instance());
5513 state_ = DiscordObjectState::Owned;
5516ActivityTimestamps& ActivityTimestamps::operator=(
const ActivityTimestamps& arg0)
5518 if (
this != &arg0) {
5519 if (state_ == DiscordObjectState::Owned) {
5521 state_ = DiscordObjectState::Invalid;
5523 if (arg0.state_ == DiscordObjectState::Owned) {
5524 Discord_ActivityTimestamps_Clone(&instance_, arg0.instance());
5526 state_ = DiscordObjectState::Owned;
5531ActivityTimestamps::ActivityTimestamps(Discord_ActivityTimestamps instance,
5532 DiscordObjectState state)
5533 : instance_(instance)
5537ActivityTimestamps::ActivityTimestamps()
5539 assert(state_ == DiscordObjectState::Invalid);
5540 Discord_ActivityTimestamps_Init(&instance_);
5541 state_ = DiscordObjectState::Owned;
5543void ActivityTimestamps::Drop()
5545 if (state_ != DiscordObjectState::Owned) {
5548 Discord_ActivityTimestamps_Drop(&instance_);
5549 state_ = DiscordObjectState::Invalid;
5551uint64_t ActivityTimestamps::Start()
const
5553 assert(state_ == DiscordObjectState::Owned);
5554 uint64_t returnValue__;
5555 returnValue__ = Discord_ActivityTimestamps_Start(&instance_);
5556 return returnValue__;
5558void ActivityTimestamps::SetStart(uint64_t Start)
5560 assert(state_ == DiscordObjectState::Owned);
5561 Discord_ActivityTimestamps_SetStart(&instance_, Start);
5563uint64_t ActivityTimestamps::End()
const
5565 assert(state_ == DiscordObjectState::Owned);
5566 uint64_t returnValue__;
5567 returnValue__ = Discord_ActivityTimestamps_End(&instance_);
5568 return returnValue__;
5570void ActivityTimestamps::SetEnd(uint64_t End)
5572 assert(state_ == DiscordObjectState::Owned);
5573 Discord_ActivityTimestamps_SetEnd(&instance_, End);
5575const ActivityParty ActivityParty::nullobj{{}, DiscordObjectState::Invalid};
5576ActivityParty::~ActivityParty()
5578 if (state_ == DiscordObjectState::Owned) {
5580 state_ = DiscordObjectState::Invalid;
5583ActivityParty::ActivityParty(ActivityParty&& other) noexcept
5584 : instance_(other.instance_)
5585 , state_(other.state_)
5587 other.state_ = DiscordObjectState::Invalid;
5589ActivityParty& ActivityParty::operator=(ActivityParty&& other)
noexcept
5591 if (
this != &other) {
5592 if (state_ == DiscordObjectState::Owned) {
5595 instance_ = other.instance_;
5596 state_ = other.state_;
5597 other.state_ = DiscordObjectState::Invalid;
5601ActivityParty::ActivityParty(
const ActivityParty& arg0)
5606 Discord_ActivityParty_Clone(&instance_, arg0.instance());
5608 state_ = DiscordObjectState::Owned;
5611ActivityParty& ActivityParty::operator=(
const ActivityParty& arg0)
5613 if (
this != &arg0) {
5614 if (state_ == DiscordObjectState::Owned) {
5616 state_ = DiscordObjectState::Invalid;
5618 if (arg0.state_ == DiscordObjectState::Owned) {
5619 Discord_ActivityParty_Clone(&instance_, arg0.instance());
5621 state_ = DiscordObjectState::Owned;
5626ActivityParty::ActivityParty(Discord_ActivityParty instance, DiscordObjectState state)
5627 : instance_(instance)
5631ActivityParty::ActivityParty()
5633 assert(state_ == DiscordObjectState::Invalid);
5634 Discord_ActivityParty_Init(&instance_);
5635 state_ = DiscordObjectState::Owned;
5637void ActivityParty::Drop()
5639 if (state_ != DiscordObjectState::Owned) {
5642 Discord_ActivityParty_Drop(&instance_);
5643 state_ = DiscordObjectState::Invalid;
5645std::string ActivityParty::Id()
const
5647 assert(state_ == DiscordObjectState::Owned);
5648 Discord_String returnValueNative__;
5649 Discord_ActivityParty_Id(&instance_, &returnValueNative__);
5650 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
5651 returnValueNative__.size);
5652 Discord_Free(returnValueNative__.ptr);
5653 return returnValue__;
5655void ActivityParty::SetId(std::string Id)
5657 assert(state_ == DiscordObjectState::Owned);
5658 Discord_String Id__str{(uint8_t*)(Id.data()), Id.size()};
5659 Discord_ActivityParty_SetId(&instance_, Id__str);
5661int32_t ActivityParty::CurrentSize()
const
5663 assert(state_ == DiscordObjectState::Owned);
5664 int32_t returnValue__;
5665 returnValue__ = Discord_ActivityParty_CurrentSize(&instance_);
5666 return returnValue__;
5668void ActivityParty::SetCurrentSize(int32_t CurrentSize)
5670 assert(state_ == DiscordObjectState::Owned);
5671 Discord_ActivityParty_SetCurrentSize(&instance_, CurrentSize);
5673int32_t ActivityParty::MaxSize()
const
5675 assert(state_ == DiscordObjectState::Owned);
5676 int32_t returnValue__;
5677 returnValue__ = Discord_ActivityParty_MaxSize(&instance_);
5678 return returnValue__;
5680void ActivityParty::SetMaxSize(int32_t MaxSize)
5682 assert(state_ == DiscordObjectState::Owned);
5683 Discord_ActivityParty_SetMaxSize(&instance_, MaxSize);
5687 assert(state_ == DiscordObjectState::Owned);
5688 Discord_ActivityPartyPrivacy returnValue__;
5689 returnValue__ = Discord_ActivityParty_Privacy(&instance_);
5694 assert(state_ == DiscordObjectState::Owned);
5695 Discord_ActivityParty_SetPrivacy(&instance_,
5696 static_cast<Discord_ActivityPartyPrivacy
>(Privacy));
5698const ActivitySecrets ActivitySecrets::nullobj{{}, DiscordObjectState::Invalid};
5699ActivitySecrets::~ActivitySecrets()
5701 if (state_ == DiscordObjectState::Owned) {
5703 state_ = DiscordObjectState::Invalid;
5706ActivitySecrets::ActivitySecrets(ActivitySecrets&& other) noexcept
5707 : instance_(other.instance_)
5708 , state_(other.state_)
5710 other.state_ = DiscordObjectState::Invalid;
5712ActivitySecrets& ActivitySecrets::operator=(ActivitySecrets&& other)
noexcept
5714 if (
this != &other) {
5715 if (state_ == DiscordObjectState::Owned) {
5718 instance_ = other.instance_;
5719 state_ = other.state_;
5720 other.state_ = DiscordObjectState::Invalid;
5724ActivitySecrets::ActivitySecrets(
const ActivitySecrets& arg0)
5729 Discord_ActivitySecrets_Clone(&instance_, arg0.instance());
5731 state_ = DiscordObjectState::Owned;
5734ActivitySecrets& ActivitySecrets::operator=(
const ActivitySecrets& arg0)
5736 if (
this != &arg0) {
5737 if (state_ == DiscordObjectState::Owned) {
5739 state_ = DiscordObjectState::Invalid;
5741 if (arg0.state_ == DiscordObjectState::Owned) {
5742 Discord_ActivitySecrets_Clone(&instance_, arg0.instance());
5744 state_ = DiscordObjectState::Owned;
5749ActivitySecrets::ActivitySecrets(Discord_ActivitySecrets instance, DiscordObjectState state)
5750 : instance_(instance)
5754ActivitySecrets::ActivitySecrets()
5756 assert(state_ == DiscordObjectState::Invalid);
5757 Discord_ActivitySecrets_Init(&instance_);
5758 state_ = DiscordObjectState::Owned;
5760void ActivitySecrets::Drop()
5762 if (state_ != DiscordObjectState::Owned) {
5765 Discord_ActivitySecrets_Drop(&instance_);
5766 state_ = DiscordObjectState::Invalid;
5768std::string ActivitySecrets::Join()
const
5770 assert(state_ == DiscordObjectState::Owned);
5771 Discord_String returnValueNative__;
5772 Discord_ActivitySecrets_Join(&instance_, &returnValueNative__);
5773 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
5774 returnValueNative__.size);
5775 Discord_Free(returnValueNative__.ptr);
5776 return returnValue__;
5778void ActivitySecrets::SetJoin(std::string Join)
5780 assert(state_ == DiscordObjectState::Owned);
5781 Discord_String Join__str{(uint8_t*)(
Join.data()),
Join.size()};
5782 Discord_ActivitySecrets_SetJoin(&instance_, Join__str);
5784const Activity Activity::nullobj{{}, DiscordObjectState::Invalid};
5785Activity::~Activity()
5787 if (state_ == DiscordObjectState::Owned) {
5789 state_ = DiscordObjectState::Invalid;
5792Activity::Activity(Activity&& other) noexcept
5793 : instance_(other.instance_)
5794 , state_(other.state_)
5796 other.state_ = DiscordObjectState::Invalid;
5798Activity& Activity::operator=(Activity&& other)
noexcept
5800 if (
this != &other) {
5801 if (state_ == DiscordObjectState::Owned) {
5804 instance_ = other.instance_;
5805 state_ = other.state_;
5806 other.state_ = DiscordObjectState::Invalid;
5810Activity::Activity(
const Activity& arg0)
5815 Discord_Activity_Clone(&instance_, arg0.instance());
5817 state_ = DiscordObjectState::Owned;
5820Activity& Activity::operator=(
const Activity& arg0)
5822 if (
this != &arg0) {
5823 if (state_ == DiscordObjectState::Owned) {
5825 state_ = DiscordObjectState::Invalid;
5827 if (arg0.state_ == DiscordObjectState::Owned) {
5828 Discord_Activity_Clone(&instance_, arg0.instance());
5830 state_ = DiscordObjectState::Owned;
5835Activity::Activity(Discord_Activity instance, DiscordObjectState state)
5836 : instance_(instance)
5842 assert(state_ == DiscordObjectState::Invalid);
5843 Discord_Activity_Init(&instance_);
5844 state_ = DiscordObjectState::Owned;
5846void Activity::Drop()
5848 if (state_ != DiscordObjectState::Owned) {
5851 Discord_Activity_Drop(&instance_);
5852 state_ = DiscordObjectState::Invalid;
5856 assert(state_ == DiscordObjectState::Owned);
5858 returnValue__ = Discord_Activity_Equals(&instance_, other.instance());
5859 return returnValue__;
5861std::string Activity::Name()
const
5863 assert(state_ == DiscordObjectState::Owned);
5864 Discord_String returnValueNative__;
5865 Discord_Activity_Name(&instance_, &returnValueNative__);
5866 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
5867 returnValueNative__.size);
5868 Discord_Free(returnValueNative__.ptr);
5869 return returnValue__;
5871void Activity::SetName(std::string Name)
5873 assert(state_ == DiscordObjectState::Owned);
5874 Discord_String Name__str{(uint8_t*)(Name.data()), Name.size()};
5875 Discord_Activity_SetName(&instance_, Name__str);
5879 assert(state_ == DiscordObjectState::Owned);
5880 Discord_ActivityTypes returnValue__;
5881 returnValue__ = Discord_Activity_Type(&instance_);
5886 assert(state_ == DiscordObjectState::Owned);
5887 Discord_Activity_SetType(&instance_,
static_cast<Discord_ActivityTypes
>(Type));
5889std::optional<std::string> Activity::State()
const
5891 assert(state_ == DiscordObjectState::Owned);
5892 bool returnIsNonNull__;
5893 Discord_String returnValueNative__;
5894 returnIsNonNull__ = Discord_Activity_State(&instance_, &returnValueNative__);
5895 if (!returnIsNonNull__) {
5898 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
5899 returnValueNative__.size);
5900 Discord_Free(returnValueNative__.ptr);
5901 return returnValue__;
5903void Activity::SetState(std::optional<std::string> State)
5905 assert(state_ == DiscordObjectState::Owned);
5906 Discord_String State__str{};
5907 if (State.has_value()) {
5908 State__str.ptr =
reinterpret_cast<uint8_t*
>(State->data());
5909 State__str.size = State->size();
5911 Discord_Activity_SetState(&instance_, (State.has_value() ? &State__str :
nullptr));
5913std::optional<std::string> Activity::Details()
const
5915 assert(state_ == DiscordObjectState::Owned);
5916 bool returnIsNonNull__;
5917 Discord_String returnValueNative__;
5918 returnIsNonNull__ = Discord_Activity_Details(&instance_, &returnValueNative__);
5919 if (!returnIsNonNull__) {
5922 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
5923 returnValueNative__.size);
5924 Discord_Free(returnValueNative__.ptr);
5925 return returnValue__;
5927void Activity::SetDetails(std::optional<std::string> Details)
5929 assert(state_ == DiscordObjectState::Owned);
5930 Discord_String Details__str{};
5931 if (Details.has_value()) {
5932 Details__str.ptr =
reinterpret_cast<uint8_t*
>(Details->data());
5933 Details__str.size = Details->size();
5935 Discord_Activity_SetDetails(&instance_, (Details.has_value() ? &Details__str :
nullptr));
5937std::optional<uint64_t> Activity::ApplicationId()
const
5939 assert(state_ == DiscordObjectState::Owned);
5940 bool returnIsNonNull__;
5941 uint64_t returnValue__;
5942 returnIsNonNull__ = Discord_Activity_ApplicationId(&instance_, &returnValue__);
5943 if (!returnIsNonNull__) {
5944 return std::nullopt;
5946 return returnValue__;
5948void Activity::SetApplicationId(std::optional<uint64_t> ApplicationId)
5950 assert(state_ == DiscordObjectState::Owned);
5951 Discord_Activity_SetApplicationId(&instance_,
5952 (ApplicationId.has_value() ? &*ApplicationId :
nullptr));
5954std::optional<discordpp::ActivityAssets> Activity::Assets()
const
5956 assert(state_ == DiscordObjectState::Owned);
5957 bool returnIsNonNull__;
5958 Discord_ActivityAssets returnValueNative__;
5959 returnIsNonNull__ = Discord_Activity_Assets(&instance_, &returnValueNative__);
5960 if (!returnIsNonNull__) {
5964 return returnValue__;
5966void Activity::SetAssets(std::optional<discordpp::ActivityAssets> Assets)
5968 assert(state_ == DiscordObjectState::Owned);
5969 Discord_Activity_SetAssets(&instance_, (Assets.has_value() ? Assets->instance() :
nullptr));
5971std::optional<discordpp::ActivityTimestamps> Activity::Timestamps()
const
5973 assert(state_ == DiscordObjectState::Owned);
5974 bool returnIsNonNull__;
5975 Discord_ActivityTimestamps returnValueNative__;
5976 returnIsNonNull__ = Discord_Activity_Timestamps(&instance_, &returnValueNative__);
5977 if (!returnIsNonNull__) {
5981 return returnValue__;
5983void Activity::SetTimestamps(std::optional<discordpp::ActivityTimestamps> Timestamps)
5985 assert(state_ == DiscordObjectState::Owned);
5986 Discord_Activity_SetTimestamps(&instance_,
5987 (Timestamps.has_value() ? Timestamps->instance() :
nullptr));
5989std::optional<discordpp::ActivityParty> Activity::Party()
const
5991 assert(state_ == DiscordObjectState::Owned);
5992 bool returnIsNonNull__;
5993 Discord_ActivityParty returnValueNative__;
5994 returnIsNonNull__ = Discord_Activity_Party(&instance_, &returnValueNative__);
5995 if (!returnIsNonNull__) {
5999 return returnValue__;
6001void Activity::SetParty(std::optional<discordpp::ActivityParty> Party)
6003 assert(state_ == DiscordObjectState::Owned);
6004 Discord_Activity_SetParty(&instance_, (Party.has_value() ? Party->instance() :
nullptr));
6006std::optional<discordpp::ActivitySecrets> Activity::Secrets()
const
6008 assert(state_ == DiscordObjectState::Owned);
6009 bool returnIsNonNull__;
6010 Discord_ActivitySecrets returnValueNative__;
6011 returnIsNonNull__ = Discord_Activity_Secrets(&instance_, &returnValueNative__);
6012 if (!returnIsNonNull__) {
6016 return returnValue__;
6018void Activity::SetSecrets(std::optional<discordpp::ActivitySecrets> Secrets)
6020 assert(state_ == DiscordObjectState::Owned);
6021 Discord_Activity_SetSecrets(&instance_, (Secrets.has_value() ? Secrets->instance() :
nullptr));
6025 assert(state_ == DiscordObjectState::Owned);
6026 Discord_ActivityGamePlatforms returnValue__;
6027 returnValue__ = Discord_Activity_SupportedPlatforms(&instance_);
6032 assert(state_ == DiscordObjectState::Owned);
6033 Discord_Activity_SetSupportedPlatforms(
6034 &instance_,
static_cast<Discord_ActivityGamePlatforms
>(SupportedPlatforms));
6036const ClientResult ClientResult::nullobj{{}, DiscordObjectState::Invalid};
6037ClientResult::~ClientResult()
6039 if (state_ == DiscordObjectState::Owned) {
6041 state_ = DiscordObjectState::Invalid;
6044ClientResult::ClientResult(ClientResult&& other) noexcept
6045 : instance_(other.instance_)
6046 , state_(other.state_)
6048 other.state_ = DiscordObjectState::Invalid;
6050ClientResult& ClientResult::operator=(ClientResult&& other)
noexcept
6052 if (
this != &other) {
6053 if (state_ == DiscordObjectState::Owned) {
6056 instance_ = other.instance_;
6057 state_ = other.state_;
6058 other.state_ = DiscordObjectState::Invalid;
6062ClientResult::ClientResult(
const ClientResult& arg0)
6067 Discord_ClientResult_Clone(&instance_, arg0.instance());
6069 state_ = DiscordObjectState::Owned;
6072ClientResult& ClientResult::operator=(
const ClientResult& arg0)
6074 if (
this != &arg0) {
6075 if (state_ == DiscordObjectState::Owned) {
6077 state_ = DiscordObjectState::Invalid;
6079 if (arg0.state_ == DiscordObjectState::Owned) {
6080 Discord_ClientResult_Clone(&instance_, arg0.instance());
6082 state_ = DiscordObjectState::Owned;
6087ClientResult::ClientResult(Discord_ClientResult instance, DiscordObjectState state)
6088 : instance_(instance)
6092void ClientResult::Drop()
6094 if (state_ != DiscordObjectState::Owned) {
6097 Discord_ClientResult_Drop(&instance_);
6098 state_ = DiscordObjectState::Invalid;
6100std::string ClientResult::ToString()
const
6102 assert(state_ == DiscordObjectState::Owned);
6103 Discord_String returnValueNative__;
6104 Discord_ClientResult_ToString(&instance_, &returnValueNative__);
6105 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6106 returnValueNative__.size);
6107 Discord_Free(returnValueNative__.ptr);
6108 return returnValue__;
6112 assert(state_ == DiscordObjectState::Owned);
6113 Discord_ErrorType returnValue__;
6114 returnValue__ = Discord_ClientResult_Type(&instance_);
6119 assert(state_ == DiscordObjectState::Owned);
6120 Discord_ClientResult_SetType(&instance_,
static_cast<Discord_ErrorType
>(Type));
6122std::string ClientResult::Error()
const
6124 assert(state_ == DiscordObjectState::Owned);
6125 Discord_String returnValueNative__;
6126 Discord_ClientResult_Error(&instance_, &returnValueNative__);
6127 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6128 returnValueNative__.size);
6129 Discord_Free(returnValueNative__.ptr);
6130 return returnValue__;
6132void ClientResult::SetError(std::string Error)
6134 assert(state_ == DiscordObjectState::Owned);
6135 Discord_String Error__str{(uint8_t*)(
Error.data()),
Error.size()};
6136 Discord_ClientResult_SetError(&instance_, Error__str);
6138int32_t ClientResult::ErrorCode()
const
6140 assert(state_ == DiscordObjectState::Owned);
6141 int32_t returnValue__;
6142 returnValue__ = Discord_ClientResult_ErrorCode(&instance_);
6143 return returnValue__;
6145void ClientResult::SetErrorCode(int32_t ErrorCode)
6147 assert(state_ == DiscordObjectState::Owned);
6148 Discord_ClientResult_SetErrorCode(&instance_, ErrorCode);
6152 assert(state_ == DiscordObjectState::Owned);
6153 Discord_HttpStatusCode returnValue__;
6154 returnValue__ = Discord_ClientResult_Status(&instance_);
6159 assert(state_ == DiscordObjectState::Owned);
6160 Discord_ClientResult_SetStatus(&instance_,
static_cast<Discord_HttpStatusCode
>(Status));
6162std::string ClientResult::ResponseBody()
const
6164 assert(state_ == DiscordObjectState::Owned);
6165 Discord_String returnValueNative__;
6166 Discord_ClientResult_ResponseBody(&instance_, &returnValueNative__);
6167 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6168 returnValueNative__.size);
6169 Discord_Free(returnValueNative__.ptr);
6170 return returnValue__;
6172void ClientResult::SetResponseBody(std::string ResponseBody)
6174 assert(state_ == DiscordObjectState::Owned);
6175 Discord_String ResponseBody__str{(uint8_t*)(ResponseBody.data()), ResponseBody.size()};
6176 Discord_ClientResult_SetResponseBody(&instance_, ResponseBody__str);
6178bool ClientResult::Successful()
const
6180 assert(state_ == DiscordObjectState::Owned);
6182 returnValue__ = Discord_ClientResult_Successful(&instance_);
6183 return returnValue__;
6185void ClientResult::SetSuccessful(
bool Successful)
6187 assert(state_ == DiscordObjectState::Owned);
6188 Discord_ClientResult_SetSuccessful(&instance_, Successful);
6190bool ClientResult::Retryable()
const
6192 assert(state_ == DiscordObjectState::Owned);
6194 returnValue__ = Discord_ClientResult_Retryable(&instance_);
6195 return returnValue__;
6197void ClientResult::SetRetryable(
bool Retryable)
6199 assert(state_ == DiscordObjectState::Owned);
6200 Discord_ClientResult_SetRetryable(&instance_, Retryable);
6202float ClientResult::RetryAfter()
const
6204 assert(state_ == DiscordObjectState::Owned);
6205 float returnValue__;
6206 returnValue__ = Discord_ClientResult_RetryAfter(&instance_);
6207 return returnValue__;
6209void ClientResult::SetRetryAfter(
float RetryAfter)
6211 assert(state_ == DiscordObjectState::Owned);
6212 Discord_ClientResult_SetRetryAfter(&instance_, RetryAfter);
6214const AuthorizationCodeChallenge AuthorizationCodeChallenge::nullobj{{},
6215 DiscordObjectState::Invalid};
6216AuthorizationCodeChallenge::~AuthorizationCodeChallenge()
6218 if (state_ == DiscordObjectState::Owned) {
6220 state_ = DiscordObjectState::Invalid;
6223AuthorizationCodeChallenge::AuthorizationCodeChallenge(AuthorizationCodeChallenge&& other) noexcept
6224 : instance_(other.instance_)
6225 , state_(other.state_)
6227 other.state_ = DiscordObjectState::Invalid;
6229AuthorizationCodeChallenge& AuthorizationCodeChallenge::operator=(
6230 AuthorizationCodeChallenge&& other)
noexcept
6232 if (
this != &other) {
6233 if (state_ == DiscordObjectState::Owned) {
6236 instance_ = other.instance_;
6237 state_ = other.state_;
6238 other.state_ = DiscordObjectState::Invalid;
6242AuthorizationCodeChallenge::AuthorizationCodeChallenge(
const AuthorizationCodeChallenge& arg0)
6247 Discord_AuthorizationCodeChallenge_Clone(&instance_, arg0.instance());
6249 state_ = DiscordObjectState::Owned;
6252AuthorizationCodeChallenge& AuthorizationCodeChallenge::operator=(
6253 const AuthorizationCodeChallenge& arg0)
6255 if (
this != &arg0) {
6256 if (state_ == DiscordObjectState::Owned) {
6258 state_ = DiscordObjectState::Invalid;
6260 if (arg0.state_ == DiscordObjectState::Owned) {
6261 Discord_AuthorizationCodeChallenge_Clone(&instance_, arg0.instance());
6263 state_ = DiscordObjectState::Owned;
6268AuthorizationCodeChallenge::AuthorizationCodeChallenge(Discord_AuthorizationCodeChallenge instance,
6269 DiscordObjectState state)
6270 : instance_(instance)
6274AuthorizationCodeChallenge::AuthorizationCodeChallenge()
6276 assert(state_ == DiscordObjectState::Invalid);
6277 Discord_AuthorizationCodeChallenge_Init(&instance_);
6278 state_ = DiscordObjectState::Owned;
6280void AuthorizationCodeChallenge::Drop()
6282 if (state_ != DiscordObjectState::Owned) {
6285 Discord_AuthorizationCodeChallenge_Drop(&instance_);
6286 state_ = DiscordObjectState::Invalid;
6290 assert(state_ == DiscordObjectState::Owned);
6291 Discord_AuthenticationCodeChallengeMethod returnValue__;
6292 returnValue__ = Discord_AuthorizationCodeChallenge_Method(&instance_);
6297 assert(state_ == DiscordObjectState::Owned);
6298 Discord_AuthorizationCodeChallenge_SetMethod(
6299 &instance_,
static_cast<Discord_AuthenticationCodeChallengeMethod
>(Method));
6301std::string AuthorizationCodeChallenge::Challenge()
const
6303 assert(state_ == DiscordObjectState::Owned);
6304 Discord_String returnValueNative__;
6305 Discord_AuthorizationCodeChallenge_Challenge(&instance_, &returnValueNative__);
6306 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6307 returnValueNative__.size);
6308 Discord_Free(returnValueNative__.ptr);
6309 return returnValue__;
6311void AuthorizationCodeChallenge::SetChallenge(std::string Challenge)
6313 assert(state_ == DiscordObjectState::Owned);
6314 Discord_String Challenge__str{(uint8_t*)(Challenge.data()), Challenge.size()};
6315 Discord_AuthorizationCodeChallenge_SetChallenge(&instance_, Challenge__str);
6317const AuthorizationCodeVerifier AuthorizationCodeVerifier::nullobj{{}, DiscordObjectState::Invalid};
6318AuthorizationCodeVerifier::~AuthorizationCodeVerifier()
6320 if (state_ == DiscordObjectState::Owned) {
6322 state_ = DiscordObjectState::Invalid;
6325AuthorizationCodeVerifier::AuthorizationCodeVerifier(AuthorizationCodeVerifier&& other) noexcept
6326 : instance_(other.instance_)
6327 , state_(other.state_)
6329 other.state_ = DiscordObjectState::Invalid;
6331AuthorizationCodeVerifier& AuthorizationCodeVerifier::operator=(
6332 AuthorizationCodeVerifier&& other)
noexcept
6334 if (
this != &other) {
6335 if (state_ == DiscordObjectState::Owned) {
6338 instance_ = other.instance_;
6339 state_ = other.state_;
6340 other.state_ = DiscordObjectState::Invalid;
6344AuthorizationCodeVerifier::AuthorizationCodeVerifier(
const AuthorizationCodeVerifier& arg0)
6349 Discord_AuthorizationCodeVerifier_Clone(&instance_, arg0.instance());
6351 state_ = DiscordObjectState::Owned;
6354AuthorizationCodeVerifier& AuthorizationCodeVerifier::operator=(
6355 const AuthorizationCodeVerifier& arg0)
6357 if (
this != &arg0) {
6358 if (state_ == DiscordObjectState::Owned) {
6360 state_ = DiscordObjectState::Invalid;
6362 if (arg0.state_ == DiscordObjectState::Owned) {
6363 Discord_AuthorizationCodeVerifier_Clone(&instance_, arg0.instance());
6365 state_ = DiscordObjectState::Owned;
6370AuthorizationCodeVerifier::AuthorizationCodeVerifier(Discord_AuthorizationCodeVerifier instance,
6371 DiscordObjectState state)
6372 : instance_(instance)
6376void AuthorizationCodeVerifier::Drop()
6378 if (state_ != DiscordObjectState::Owned) {
6381 Discord_AuthorizationCodeVerifier_Drop(&instance_);
6382 state_ = DiscordObjectState::Invalid;
6386 assert(state_ == DiscordObjectState::Owned);
6387 Discord_AuthorizationCodeChallenge returnValueNative__{};
6388 Discord_AuthorizationCodeVerifier_Challenge(&instance_, &returnValueNative__);
6390 DiscordObjectState::Owned);
6391 return returnValue__;
6395 assert(state_ == DiscordObjectState::Owned);
6396 Discord_AuthorizationCodeVerifier_SetChallenge(&instance_, Challenge.instance());
6398std::string AuthorizationCodeVerifier::Verifier()
const
6400 assert(state_ == DiscordObjectState::Owned);
6401 Discord_String returnValueNative__;
6402 Discord_AuthorizationCodeVerifier_Verifier(&instance_, &returnValueNative__);
6403 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6404 returnValueNative__.size);
6405 Discord_Free(returnValueNative__.ptr);
6406 return returnValue__;
6408void AuthorizationCodeVerifier::SetVerifier(std::string Verifier)
6410 assert(state_ == DiscordObjectState::Owned);
6411 Discord_String Verifier__str{(uint8_t*)(Verifier.data()), Verifier.size()};
6412 Discord_AuthorizationCodeVerifier_SetVerifier(&instance_, Verifier__str);
6414const AuthorizationArgs AuthorizationArgs::nullobj{{}, DiscordObjectState::Invalid};
6415AuthorizationArgs::~AuthorizationArgs()
6417 if (state_ == DiscordObjectState::Owned) {
6419 state_ = DiscordObjectState::Invalid;
6422AuthorizationArgs::AuthorizationArgs(AuthorizationArgs&& other) noexcept
6423 : instance_(other.instance_)
6424 , state_(other.state_)
6426 other.state_ = DiscordObjectState::Invalid;
6428AuthorizationArgs& AuthorizationArgs::operator=(AuthorizationArgs&& other)
noexcept
6430 if (
this != &other) {
6431 if (state_ == DiscordObjectState::Owned) {
6434 instance_ = other.instance_;
6435 state_ = other.state_;
6436 other.state_ = DiscordObjectState::Invalid;
6440AuthorizationArgs::AuthorizationArgs(
const AuthorizationArgs& arg0)
6445 Discord_AuthorizationArgs_Clone(&instance_, arg0.instance());
6447 state_ = DiscordObjectState::Owned;
6450AuthorizationArgs& AuthorizationArgs::operator=(
const AuthorizationArgs& arg0)
6452 if (
this != &arg0) {
6453 if (state_ == DiscordObjectState::Owned) {
6455 state_ = DiscordObjectState::Invalid;
6457 if (arg0.state_ == DiscordObjectState::Owned) {
6458 Discord_AuthorizationArgs_Clone(&instance_, arg0.instance());
6460 state_ = DiscordObjectState::Owned;
6465AuthorizationArgs::AuthorizationArgs(Discord_AuthorizationArgs instance, DiscordObjectState state)
6466 : instance_(instance)
6470AuthorizationArgs::AuthorizationArgs()
6472 assert(state_ == DiscordObjectState::Invalid);
6473 Discord_AuthorizationArgs_Init(&instance_);
6474 state_ = DiscordObjectState::Owned;
6476void AuthorizationArgs::Drop()
6478 if (state_ != DiscordObjectState::Owned) {
6481 Discord_AuthorizationArgs_Drop(&instance_);
6482 state_ = DiscordObjectState::Invalid;
6484uint64_t AuthorizationArgs::ClientId()
const
6486 assert(state_ == DiscordObjectState::Owned);
6487 uint64_t returnValue__;
6488 returnValue__ = Discord_AuthorizationArgs_ClientId(&instance_);
6489 return returnValue__;
6491void AuthorizationArgs::SetClientId(uint64_t ClientId)
6493 assert(state_ == DiscordObjectState::Owned);
6494 Discord_AuthorizationArgs_SetClientId(&instance_, ClientId);
6496std::string AuthorizationArgs::Scopes()
const
6498 assert(state_ == DiscordObjectState::Owned);
6499 Discord_String returnValueNative__;
6500 Discord_AuthorizationArgs_Scopes(&instance_, &returnValueNative__);
6501 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6502 returnValueNative__.size);
6503 Discord_Free(returnValueNative__.ptr);
6504 return returnValue__;
6506void AuthorizationArgs::SetScopes(std::string Scopes)
6508 assert(state_ == DiscordObjectState::Owned);
6509 Discord_String Scopes__str{(uint8_t*)(Scopes.data()), Scopes.size()};
6510 Discord_AuthorizationArgs_SetScopes(&instance_, Scopes__str);
6512std::optional<std::string> AuthorizationArgs::State()
const
6514 assert(state_ == DiscordObjectState::Owned);
6515 bool returnIsNonNull__;
6516 Discord_String returnValueNative__;
6517 returnIsNonNull__ = Discord_AuthorizationArgs_State(&instance_, &returnValueNative__);
6518 if (!returnIsNonNull__) {
6521 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6522 returnValueNative__.size);
6523 Discord_Free(returnValueNative__.ptr);
6524 return returnValue__;
6526void AuthorizationArgs::SetState(std::optional<std::string> State)
6528 assert(state_ == DiscordObjectState::Owned);
6529 Discord_String State__str{};
6530 if (State.has_value()) {
6531 State__str.ptr =
reinterpret_cast<uint8_t*
>(State->data());
6532 State__str.size = State->size();
6534 Discord_AuthorizationArgs_SetState(&instance_, (State.has_value() ? &State__str :
nullptr));
6536std::optional<std::string> AuthorizationArgs::Nonce()
const
6538 assert(state_ == DiscordObjectState::Owned);
6539 bool returnIsNonNull__;
6540 Discord_String returnValueNative__;
6541 returnIsNonNull__ = Discord_AuthorizationArgs_Nonce(&instance_, &returnValueNative__);
6542 if (!returnIsNonNull__) {
6545 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6546 returnValueNative__.size);
6547 Discord_Free(returnValueNative__.ptr);
6548 return returnValue__;
6550void AuthorizationArgs::SetNonce(std::optional<std::string> Nonce)
6552 assert(state_ == DiscordObjectState::Owned);
6553 Discord_String Nonce__str{};
6554 if (Nonce.has_value()) {
6555 Nonce__str.ptr =
reinterpret_cast<uint8_t*
>(Nonce->data());
6556 Nonce__str.size = Nonce->size();
6558 Discord_AuthorizationArgs_SetNonce(&instance_, (Nonce.has_value() ? &Nonce__str :
nullptr));
6560std::optional<discordpp::AuthorizationCodeChallenge> AuthorizationArgs::CodeChallenge()
const
6562 assert(state_ == DiscordObjectState::Owned);
6563 bool returnIsNonNull__;
6564 Discord_AuthorizationCodeChallenge returnValueNative__;
6565 returnIsNonNull__ = Discord_AuthorizationArgs_CodeChallenge(&instance_, &returnValueNative__);
6566 if (!returnIsNonNull__) {
6570 DiscordObjectState::Owned);
6571 return returnValue__;
6573void AuthorizationArgs::SetCodeChallenge(
6574 std::optional<discordpp::AuthorizationCodeChallenge> CodeChallenge)
6576 assert(state_ == DiscordObjectState::Owned);
6577 Discord_AuthorizationArgs_SetCodeChallenge(
6578 &instance_, (CodeChallenge.has_value() ? CodeChallenge->instance() :
nullptr));
6580const DeviceAuthorizationArgs DeviceAuthorizationArgs::nullobj{{}, DiscordObjectState::Invalid};
6581DeviceAuthorizationArgs::~DeviceAuthorizationArgs()
6583 if (state_ == DiscordObjectState::Owned) {
6585 state_ = DiscordObjectState::Invalid;
6588DeviceAuthorizationArgs::DeviceAuthorizationArgs(DeviceAuthorizationArgs&& other) noexcept
6589 : instance_(other.instance_)
6590 , state_(other.state_)
6592 other.state_ = DiscordObjectState::Invalid;
6594DeviceAuthorizationArgs& DeviceAuthorizationArgs::operator=(
6595 DeviceAuthorizationArgs&& other)
noexcept
6597 if (
this != &other) {
6598 if (state_ == DiscordObjectState::Owned) {
6601 instance_ = other.instance_;
6602 state_ = other.state_;
6603 other.state_ = DiscordObjectState::Invalid;
6607DeviceAuthorizationArgs::DeviceAuthorizationArgs(
const DeviceAuthorizationArgs& arg0)
6612 Discord_DeviceAuthorizationArgs_Clone(&instance_, arg0.instance());
6614 state_ = DiscordObjectState::Owned;
6617DeviceAuthorizationArgs& DeviceAuthorizationArgs::operator=(
const DeviceAuthorizationArgs& arg0)
6619 if (
this != &arg0) {
6620 if (state_ == DiscordObjectState::Owned) {
6622 state_ = DiscordObjectState::Invalid;
6624 if (arg0.state_ == DiscordObjectState::Owned) {
6625 Discord_DeviceAuthorizationArgs_Clone(&instance_, arg0.instance());
6627 state_ = DiscordObjectState::Owned;
6632DeviceAuthorizationArgs::DeviceAuthorizationArgs(Discord_DeviceAuthorizationArgs instance,
6633 DiscordObjectState state)
6634 : instance_(instance)
6638DeviceAuthorizationArgs::DeviceAuthorizationArgs()
6640 assert(state_ == DiscordObjectState::Invalid);
6641 Discord_DeviceAuthorizationArgs_Init(&instance_);
6642 state_ = DiscordObjectState::Owned;
6644void DeviceAuthorizationArgs::Drop()
6646 if (state_ != DiscordObjectState::Owned) {
6649 Discord_DeviceAuthorizationArgs_Drop(&instance_);
6650 state_ = DiscordObjectState::Invalid;
6652uint64_t DeviceAuthorizationArgs::ClientId()
const
6654 assert(state_ == DiscordObjectState::Owned);
6655 uint64_t returnValue__;
6656 returnValue__ = Discord_DeviceAuthorizationArgs_ClientId(&instance_);
6657 return returnValue__;
6659void DeviceAuthorizationArgs::SetClientId(uint64_t ClientId)
6661 assert(state_ == DiscordObjectState::Owned);
6662 Discord_DeviceAuthorizationArgs_SetClientId(&instance_, ClientId);
6664std::string DeviceAuthorizationArgs::Scopes()
const
6666 assert(state_ == DiscordObjectState::Owned);
6667 Discord_String returnValueNative__;
6668 Discord_DeviceAuthorizationArgs_Scopes(&instance_, &returnValueNative__);
6669 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6670 returnValueNative__.size);
6671 Discord_Free(returnValueNative__.ptr);
6672 return returnValue__;
6674void DeviceAuthorizationArgs::SetScopes(std::string Scopes)
6676 assert(state_ == DiscordObjectState::Owned);
6677 Discord_String Scopes__str{(uint8_t*)(Scopes.data()), Scopes.size()};
6678 Discord_DeviceAuthorizationArgs_SetScopes(&instance_, Scopes__str);
6680const VoiceStateHandle VoiceStateHandle::nullobj{{}, DiscordObjectState::Invalid};
6681VoiceStateHandle::~VoiceStateHandle()
6683 if (state_ == DiscordObjectState::Owned) {
6685 state_ = DiscordObjectState::Invalid;
6688VoiceStateHandle::VoiceStateHandle(VoiceStateHandle&& other) noexcept
6689 : instance_(other.instance_)
6690 , state_(other.state_)
6692 other.state_ = DiscordObjectState::Invalid;
6694VoiceStateHandle& VoiceStateHandle::operator=(VoiceStateHandle&& other)
noexcept
6696 if (
this != &other) {
6697 if (state_ == DiscordObjectState::Owned) {
6700 instance_ = other.instance_;
6701 state_ = other.state_;
6702 other.state_ = DiscordObjectState::Invalid;
6706VoiceStateHandle::VoiceStateHandle(
const VoiceStateHandle& other)
6711 Discord_VoiceStateHandle_Clone(&instance_, other.instance());
6713 state_ = DiscordObjectState::Owned;
6716VoiceStateHandle& VoiceStateHandle::operator=(
const VoiceStateHandle& other)
6718 if (
this != &other) {
6719 if (state_ == DiscordObjectState::Owned) {
6721 state_ = DiscordObjectState::Invalid;
6723 if (other.state_ == DiscordObjectState::Owned) {
6724 Discord_VoiceStateHandle_Clone(&instance_, other.instance());
6726 state_ = DiscordObjectState::Owned;
6731VoiceStateHandle::VoiceStateHandle(Discord_VoiceStateHandle instance, DiscordObjectState state)
6732 : instance_(instance)
6736void VoiceStateHandle::Drop()
6738 if (state_ != DiscordObjectState::Owned) {
6741 Discord_VoiceStateHandle_Drop(&instance_);
6742 state_ = DiscordObjectState::Invalid;
6744bool VoiceStateHandle::SelfDeaf()
const
6746 assert(state_ == DiscordObjectState::Owned);
6748 returnValue__ = Discord_VoiceStateHandle_SelfDeaf(&instance_);
6749 return returnValue__;
6751bool VoiceStateHandle::SelfMute()
const
6753 assert(state_ == DiscordObjectState::Owned);
6755 returnValue__ = Discord_VoiceStateHandle_SelfMute(&instance_);
6756 return returnValue__;
6758const VADThresholdSettings VADThresholdSettings::nullobj{{}, DiscordObjectState::Invalid};
6759VADThresholdSettings::~VADThresholdSettings()
6761 if (state_ == DiscordObjectState::Owned) {
6763 state_ = DiscordObjectState::Invalid;
6766VADThresholdSettings::VADThresholdSettings(VADThresholdSettings&& other) noexcept
6767 : instance_(other.instance_)
6768 , state_(other.state_)
6770 other.state_ = DiscordObjectState::Invalid;
6772VADThresholdSettings& VADThresholdSettings::operator=(VADThresholdSettings&& other)
noexcept
6774 if (
this != &other) {
6775 if (state_ == DiscordObjectState::Owned) {
6778 instance_ = other.instance_;
6779 state_ = other.state_;
6780 other.state_ = DiscordObjectState::Invalid;
6784VADThresholdSettings::VADThresholdSettings(Discord_VADThresholdSettings instance,
6785 DiscordObjectState state)
6786 : instance_(instance)
6790void VADThresholdSettings::Drop()
6792 if (state_ != DiscordObjectState::Owned) {
6795 Discord_VADThresholdSettings_Drop(&instance_);
6796 state_ = DiscordObjectState::Invalid;
6798float VADThresholdSettings::VadThreshold()
const
6800 assert(state_ == DiscordObjectState::Owned);
6801 float returnValue__;
6802 returnValue__ = Discord_VADThresholdSettings_VadThreshold(&instance_);
6803 return returnValue__;
6805void VADThresholdSettings::SetVadThreshold(
float VadThreshold)
6807 assert(state_ == DiscordObjectState::Owned);
6808 Discord_VADThresholdSettings_SetVadThreshold(&instance_, VadThreshold);
6810bool VADThresholdSettings::Automatic()
const
6812 assert(state_ == DiscordObjectState::Owned);
6814 returnValue__ = Discord_VADThresholdSettings_Automatic(&instance_);
6815 return returnValue__;
6817void VADThresholdSettings::SetAutomatic(
bool Automatic)
6819 assert(state_ == DiscordObjectState::Owned);
6820 Discord_VADThresholdSettings_SetAutomatic(&instance_, Automatic);
6822const Call Call::nullobj{{}, DiscordObjectState::Invalid};
6825 if (state_ == DiscordObjectState::Owned) {
6827 state_ = DiscordObjectState::Invalid;
6830Call::Call(Call&& other) noexcept
6831 : instance_(other.instance_)
6832 , state_(other.state_)
6834 other.state_ = DiscordObjectState::Invalid;
6836Call& Call::operator=(Call&& other)
noexcept
6838 if (
this != &other) {
6839 if (state_ == DiscordObjectState::Owned) {
6842 instance_ = other.instance_;
6843 state_ = other.state_;
6844 other.state_ = DiscordObjectState::Invalid;
6848Call::Call(
const Call& other)
6853 Discord_Call_Clone(&instance_, other.instance());
6855 state_ = DiscordObjectState::Owned;
6858Call& Call::operator=(
const Call& other)
6860 if (
this != &other) {
6861 if (state_ == DiscordObjectState::Owned) {
6863 state_ = DiscordObjectState::Invalid;
6865 if (other.state_ == DiscordObjectState::Owned) {
6866 Discord_Call_Clone(&instance_, other.instance());
6868 state_ = DiscordObjectState::Owned;
6873Call::Call(Discord_Call instance, DiscordObjectState state)
6874 : instance_(instance)
6880 if (state_ != DiscordObjectState::Owned) {
6883 Discord_Call_Drop(&instance_);
6884 state_ = DiscordObjectState::Invalid;
6888 Discord_String returnValueNative__;
6889 Discord_Call_ErrorToString(
static_cast<Discord_Call_Error
>(type), &returnValueNative__);
6890 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6891 returnValueNative__.size);
6892 Discord_Free(returnValueNative__.ptr);
6893 return returnValue__;
6897 assert(state_ == DiscordObjectState::Owned);
6898 Discord_AudioModeType returnValue__;
6899 returnValue__ = Discord_Call_GetAudioMode(&instance_);
6902uint64_t Call::GetChannelId()
const
6904 assert(state_ == DiscordObjectState::Owned);
6905 uint64_t returnValue__;
6906 returnValue__ = Discord_Call_GetChannelId(&instance_);
6907 return returnValue__;
6909uint64_t Call::GetGuildId()
const
6911 assert(state_ == DiscordObjectState::Owned);
6912 uint64_t returnValue__;
6913 returnValue__ = Discord_Call_GetGuildId(&instance_);
6914 return returnValue__;
6916bool Call::GetLocalMute(uint64_t userId)
6918 assert(state_ == DiscordObjectState::Owned);
6920 returnValue__ = Discord_Call_GetLocalMute(&instance_, userId);
6921 return returnValue__;
6923std::vector<uint64_t> Call::GetParticipants()
const
6925 assert(state_ == DiscordObjectState::Owned);
6926 Discord_UInt64Span returnValueNative__;
6927 Discord_Call_GetParticipants(&instance_, &returnValueNative__);
6928 std::vector<uint64_t> returnValue__(returnValueNative__.ptr,
6929 returnValueNative__.ptr + returnValueNative__.size);
6930 Discord_Free(returnValueNative__.ptr);
6931 return returnValue__;
6933float Call::GetParticipantVolume(uint64_t userId)
6935 assert(state_ == DiscordObjectState::Owned);
6936 float returnValue__;
6937 returnValue__ = Discord_Call_GetParticipantVolume(&instance_, userId);
6938 return returnValue__;
6940bool Call::GetPTTActive()
6942 assert(state_ == DiscordObjectState::Owned);
6944 returnValue__ = Discord_Call_GetPTTActive(&instance_);
6945 return returnValue__;
6947uint32_t Call::GetPTTReleaseDelay()
6949 assert(state_ == DiscordObjectState::Owned);
6950 uint32_t returnValue__;
6951 returnValue__ = Discord_Call_GetPTTReleaseDelay(&instance_);
6952 return returnValue__;
6954bool Call::GetSelfDeaf()
6956 assert(state_ == DiscordObjectState::Owned);
6958 returnValue__ = Discord_Call_GetSelfDeaf(&instance_);
6959 return returnValue__;
6961bool Call::GetSelfMute()
6963 assert(state_ == DiscordObjectState::Owned);
6965 returnValue__ = Discord_Call_GetSelfMute(&instance_);
6966 return returnValue__;
6970 assert(state_ == DiscordObjectState::Owned);
6971 Discord_Call_Status returnValue__;
6972 returnValue__ = Discord_Call_GetStatus(&instance_);
6977 assert(state_ == DiscordObjectState::Owned);
6978 Discord_VADThresholdSettings returnValueNative__{};
6979 Discord_Call_GetVADThreshold(&instance_, &returnValueNative__);
6981 return returnValue__;
6983std::optional<discordpp::VoiceStateHandle> Call::GetVoiceStateHandle(uint64_t userId)
const
6985 assert(state_ == DiscordObjectState::Owned);
6986 bool returnIsNonNull__;
6987 Discord_VoiceStateHandle returnValueNative__;
6988 returnIsNonNull__ = Discord_Call_GetVoiceStateHandle(&instance_, userId, &returnValueNative__);
6989 if (!returnIsNonNull__) {
6993 return returnValue__;
6997 assert(state_ == DiscordObjectState::Owned);
6998 Discord_Call_SetAudioMode(&instance_,
static_cast<Discord_AudioModeType
>(audioMode));
7000void Call::SetLocalMute(uint64_t userId,
bool mute)
7002 assert(state_ == DiscordObjectState::Owned);
7003 Discord_Call_SetLocalMute(&instance_, userId, mute);
7007 assert(state_ == DiscordObjectState::Owned);
7008 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
7009 auto cb__userData =
new Tcb__UserData(cb);
7010 Discord_Call_OnVoiceStateChanged cb__native = [](
auto userId,
void* userData__) {
7011 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
7012 userData__typed->delegate(userId);
7014 Discord_Call_SetOnVoiceStateChangedCallback(
7015 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
7019 assert(state_ == DiscordObjectState::Owned);
7020 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
7021 auto cb__userData =
new Tcb__UserData(cb);
7022 Discord_Call_OnParticipantChanged cb__native = [](
auto userId,
auto added,
void* userData__) {
7023 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
7024 userData__typed->delegate(userId, added);
7026 Discord_Call_SetParticipantChangedCallback(
7027 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
7029void Call::SetParticipantVolume(uint64_t userId,
float volume)
7031 assert(state_ == DiscordObjectState::Owned);
7032 Discord_Call_SetParticipantVolume(&instance_, userId, volume);
7034void Call::SetPTTActive(
bool active)
7036 assert(state_ == DiscordObjectState::Owned);
7037 Discord_Call_SetPTTActive(&instance_, active);
7039void Call::SetPTTReleaseDelay(uint32_t releaseDelayMs)
7041 assert(state_ == DiscordObjectState::Owned);
7042 Discord_Call_SetPTTReleaseDelay(&instance_, releaseDelayMs);
7044void Call::SetSelfDeaf(
bool deaf)
7046 assert(state_ == DiscordObjectState::Owned);
7047 Discord_Call_SetSelfDeaf(&instance_, deaf);
7049void Call::SetSelfMute(
bool mute)
7051 assert(state_ == DiscordObjectState::Owned);
7052 Discord_Call_SetSelfMute(&instance_, mute);
7056 assert(state_ == DiscordObjectState::Owned);
7057 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
7058 auto cb__userData =
new Tcb__UserData(cb);
7059 Discord_Call_OnSpeakingStatusChanged cb__native =
7060 [](
auto userId,
auto isPlayingSound,
void* userData__) {
7061 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
7062 userData__typed->delegate(userId, isPlayingSound);
7064 Discord_Call_SetSpeakingStatusChangedCallback(
7065 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
7069 assert(state_ == DiscordObjectState::Owned);
7070 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
7071 auto cb__userData =
new Tcb__UserData(cb);
7072 Discord_Call_OnStatusChanged cb__native =
7073 [](
auto status,
auto error,
auto errorDetail,
void* userData__) {
7074 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
7079 Discord_Call_SetStatusChangedCallback(
7080 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
7082void Call::SetVADThreshold(
bool automatic,
float threshold)
7084 assert(state_ == DiscordObjectState::Owned);
7085 Discord_Call_SetVADThreshold(&instance_, automatic, threshold);
7089 Discord_String returnValueNative__;
7090 Discord_Call_StatusToString(
static_cast<Discord_Call_Status
>(type), &returnValueNative__);
7091 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7092 returnValueNative__.size);
7093 Discord_Free(returnValueNative__.ptr);
7094 return returnValue__;
7096const ChannelHandle ChannelHandle::nullobj{{}, DiscordObjectState::Invalid};
7097ChannelHandle::~ChannelHandle()
7099 if (state_ == DiscordObjectState::Owned) {
7101 state_ = DiscordObjectState::Invalid;
7104ChannelHandle::ChannelHandle(ChannelHandle&& other) noexcept
7105 : instance_(other.instance_)
7106 , state_(other.state_)
7108 other.state_ = DiscordObjectState::Invalid;
7110ChannelHandle& ChannelHandle::operator=(ChannelHandle&& other)
noexcept
7112 if (
this != &other) {
7113 if (state_ == DiscordObjectState::Owned) {
7116 instance_ = other.instance_;
7117 state_ = other.state_;
7118 other.state_ = DiscordObjectState::Invalid;
7122ChannelHandle::ChannelHandle(
const ChannelHandle& other)
7127 Discord_ChannelHandle_Clone(&instance_, other.instance());
7129 state_ = DiscordObjectState::Owned;
7132ChannelHandle& ChannelHandle::operator=(
const ChannelHandle& other)
7134 if (
this != &other) {
7135 if (state_ == DiscordObjectState::Owned) {
7137 state_ = DiscordObjectState::Invalid;
7139 if (other.state_ == DiscordObjectState::Owned) {
7140 Discord_ChannelHandle_Clone(&instance_, other.instance());
7142 state_ = DiscordObjectState::Owned;
7147ChannelHandle::ChannelHandle(Discord_ChannelHandle instance, DiscordObjectState state)
7148 : instance_(instance)
7152void ChannelHandle::Drop()
7154 if (state_ != DiscordObjectState::Owned) {
7157 Discord_ChannelHandle_Drop(&instance_);
7158 state_ = DiscordObjectState::Invalid;
7160uint64_t ChannelHandle::Id()
const
7162 assert(state_ == DiscordObjectState::Owned);
7163 uint64_t returnValue__;
7164 returnValue__ = Discord_ChannelHandle_Id(&instance_);
7165 return returnValue__;
7167std::string ChannelHandle::Name()
const
7169 assert(state_ == DiscordObjectState::Owned);
7170 Discord_String returnValueNative__;
7171 Discord_ChannelHandle_Name(&instance_, &returnValueNative__);
7172 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7173 returnValueNative__.size);
7174 Discord_Free(returnValueNative__.ptr);
7175 return returnValue__;
7177std::vector<uint64_t> ChannelHandle::Recipients()
const
7179 assert(state_ == DiscordObjectState::Owned);
7180 Discord_UInt64Span returnValueNative__;
7181 Discord_ChannelHandle_Recipients(&instance_, &returnValueNative__);
7182 std::vector<uint64_t> returnValue__(returnValueNative__.ptr,
7183 returnValueNative__.ptr + returnValueNative__.size);
7184 Discord_Free(returnValueNative__.ptr);
7185 return returnValue__;
7189 assert(state_ == DiscordObjectState::Owned);
7190 Discord_ChannelType returnValue__;
7191 returnValue__ = Discord_ChannelHandle_Type(&instance_);
7194const GuildMinimal GuildMinimal::nullobj{{}, DiscordObjectState::Invalid};
7195GuildMinimal::~GuildMinimal()
7197 if (state_ == DiscordObjectState::Owned) {
7199 state_ = DiscordObjectState::Invalid;
7202GuildMinimal::GuildMinimal(GuildMinimal&& other) noexcept
7203 : instance_(other.instance_)
7204 , state_(other.state_)
7206 other.state_ = DiscordObjectState::Invalid;
7208GuildMinimal& GuildMinimal::operator=(GuildMinimal&& other)
noexcept
7210 if (
this != &other) {
7211 if (state_ == DiscordObjectState::Owned) {
7214 instance_ = other.instance_;
7215 state_ = other.state_;
7216 other.state_ = DiscordObjectState::Invalid;
7220GuildMinimal::GuildMinimal(
const GuildMinimal& arg0)
7225 Discord_GuildMinimal_Clone(&instance_, arg0.instance());
7227 state_ = DiscordObjectState::Owned;
7230GuildMinimal& GuildMinimal::operator=(
const GuildMinimal& arg0)
7232 if (
this != &arg0) {
7233 if (state_ == DiscordObjectState::Owned) {
7235 state_ = DiscordObjectState::Invalid;
7237 if (arg0.state_ == DiscordObjectState::Owned) {
7238 Discord_GuildMinimal_Clone(&instance_, arg0.instance());
7240 state_ = DiscordObjectState::Owned;
7245GuildMinimal::GuildMinimal(Discord_GuildMinimal instance, DiscordObjectState state)
7246 : instance_(instance)
7250void GuildMinimal::Drop()
7252 if (state_ != DiscordObjectState::Owned) {
7255 Discord_GuildMinimal_Drop(&instance_);
7256 state_ = DiscordObjectState::Invalid;
7258uint64_t GuildMinimal::Id()
const
7260 assert(state_ == DiscordObjectState::Owned);
7261 uint64_t returnValue__;
7262 returnValue__ = Discord_GuildMinimal_Id(&instance_);
7263 return returnValue__;
7265void GuildMinimal::SetId(uint64_t Id)
7267 assert(state_ == DiscordObjectState::Owned);
7268 Discord_GuildMinimal_SetId(&instance_, Id);
7270std::string GuildMinimal::Name()
const
7272 assert(state_ == DiscordObjectState::Owned);
7273 Discord_String returnValueNative__;
7274 Discord_GuildMinimal_Name(&instance_, &returnValueNative__);
7275 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7276 returnValueNative__.size);
7277 Discord_Free(returnValueNative__.ptr);
7278 return returnValue__;
7280void GuildMinimal::SetName(std::string Name)
7282 assert(state_ == DiscordObjectState::Owned);
7283 Discord_String Name__str{(uint8_t*)(Name.data()), Name.size()};
7284 Discord_GuildMinimal_SetName(&instance_, Name__str);
7286const GuildChannel GuildChannel::nullobj{{}, DiscordObjectState::Invalid};
7287GuildChannel::~GuildChannel()
7289 if (state_ == DiscordObjectState::Owned) {
7291 state_ = DiscordObjectState::Invalid;
7294GuildChannel::GuildChannel(GuildChannel&& other) noexcept
7295 : instance_(other.instance_)
7296 , state_(other.state_)
7298 other.state_ = DiscordObjectState::Invalid;
7300GuildChannel& GuildChannel::operator=(GuildChannel&& other)
noexcept
7302 if (
this != &other) {
7303 if (state_ == DiscordObjectState::Owned) {
7306 instance_ = other.instance_;
7307 state_ = other.state_;
7308 other.state_ = DiscordObjectState::Invalid;
7312GuildChannel::GuildChannel(
const GuildChannel& arg0)
7317 Discord_GuildChannel_Clone(&instance_, arg0.instance());
7319 state_ = DiscordObjectState::Owned;
7322GuildChannel& GuildChannel::operator=(
const GuildChannel& arg0)
7324 if (
this != &arg0) {
7325 if (state_ == DiscordObjectState::Owned) {
7327 state_ = DiscordObjectState::Invalid;
7329 if (arg0.state_ == DiscordObjectState::Owned) {
7330 Discord_GuildChannel_Clone(&instance_, arg0.instance());
7332 state_ = DiscordObjectState::Owned;
7337GuildChannel::GuildChannel(Discord_GuildChannel instance, DiscordObjectState state)
7338 : instance_(instance)
7342void GuildChannel::Drop()
7344 if (state_ != DiscordObjectState::Owned) {
7347 Discord_GuildChannel_Drop(&instance_);
7348 state_ = DiscordObjectState::Invalid;
7350uint64_t GuildChannel::Id()
const
7352 assert(state_ == DiscordObjectState::Owned);
7353 uint64_t returnValue__;
7354 returnValue__ = Discord_GuildChannel_Id(&instance_);
7355 return returnValue__;
7357void GuildChannel::SetId(uint64_t Id)
7359 assert(state_ == DiscordObjectState::Owned);
7360 Discord_GuildChannel_SetId(&instance_, Id);
7362std::string GuildChannel::Name()
const
7364 assert(state_ == DiscordObjectState::Owned);
7365 Discord_String returnValueNative__;
7366 Discord_GuildChannel_Name(&instance_, &returnValueNative__);
7367 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7368 returnValueNative__.size);
7369 Discord_Free(returnValueNative__.ptr);
7370 return returnValue__;
7372void GuildChannel::SetName(std::string Name)
7374 assert(state_ == DiscordObjectState::Owned);
7375 Discord_String Name__str{(uint8_t*)(Name.data()), Name.size()};
7376 Discord_GuildChannel_SetName(&instance_, Name__str);
7378bool GuildChannel::IsLinkable()
const
7380 assert(state_ == DiscordObjectState::Owned);
7382 returnValue__ = Discord_GuildChannel_IsLinkable(&instance_);
7383 return returnValue__;
7385void GuildChannel::SetIsLinkable(
bool IsLinkable)
7387 assert(state_ == DiscordObjectState::Owned);
7388 Discord_GuildChannel_SetIsLinkable(&instance_, IsLinkable);
7390bool GuildChannel::IsViewableAndWriteableByAllMembers()
const
7392 assert(state_ == DiscordObjectState::Owned);
7394 returnValue__ = Discord_GuildChannel_IsViewableAndWriteableByAllMembers(&instance_);
7395 return returnValue__;
7397void GuildChannel::SetIsViewableAndWriteableByAllMembers(
bool IsViewableAndWriteableByAllMembers)
7399 assert(state_ == DiscordObjectState::Owned);
7400 Discord_GuildChannel_SetIsViewableAndWriteableByAllMembers(&instance_,
7401 IsViewableAndWriteableByAllMembers);
7403std::optional<discordpp::LinkedLobby> GuildChannel::LinkedLobby()
const
7405 assert(state_ == DiscordObjectState::Owned);
7406 bool returnIsNonNull__;
7407 Discord_LinkedLobby returnValueNative__;
7408 returnIsNonNull__ = Discord_GuildChannel_LinkedLobby(&instance_, &returnValueNative__);
7409 if (!returnIsNonNull__) {
7413 return returnValue__;
7415void GuildChannel::SetLinkedLobby(std::optional<discordpp::LinkedLobby> LinkedLobby)
7417 assert(state_ == DiscordObjectState::Owned);
7418 Discord_GuildChannel_SetLinkedLobby(
7419 &instance_, (LinkedLobby.has_value() ? LinkedLobby->instance() :
nullptr));
7421const LinkedLobby LinkedLobby::nullobj{{}, DiscordObjectState::Invalid};
7422LinkedLobby::~LinkedLobby()
7424 if (state_ == DiscordObjectState::Owned) {
7426 state_ = DiscordObjectState::Invalid;
7429LinkedLobby::LinkedLobby(LinkedLobby&& other) noexcept
7430 : instance_(other.instance_)
7431 , state_(other.state_)
7433 other.state_ = DiscordObjectState::Invalid;
7435LinkedLobby& LinkedLobby::operator=(LinkedLobby&& other)
noexcept
7437 if (
this != &other) {
7438 if (state_ == DiscordObjectState::Owned) {
7441 instance_ = other.instance_;
7442 state_ = other.state_;
7443 other.state_ = DiscordObjectState::Invalid;
7447LinkedLobby::LinkedLobby(
const LinkedLobby& arg0)
7452 Discord_LinkedLobby_Clone(&instance_, arg0.instance());
7454 state_ = DiscordObjectState::Owned;
7457LinkedLobby& LinkedLobby::operator=(
const LinkedLobby& arg0)
7459 if (
this != &arg0) {
7460 if (state_ == DiscordObjectState::Owned) {
7462 state_ = DiscordObjectState::Invalid;
7464 if (arg0.state_ == DiscordObjectState::Owned) {
7465 Discord_LinkedLobby_Clone(&instance_, arg0.instance());
7467 state_ = DiscordObjectState::Owned;
7472LinkedLobby::LinkedLobby(Discord_LinkedLobby instance, DiscordObjectState state)
7473 : instance_(instance)
7477LinkedLobby::LinkedLobby()
7479 assert(state_ == DiscordObjectState::Invalid);
7480 Discord_LinkedLobby_Init(&instance_);
7481 state_ = DiscordObjectState::Owned;
7483void LinkedLobby::Drop()
7485 if (state_ != DiscordObjectState::Owned) {
7488 Discord_LinkedLobby_Drop(&instance_);
7489 state_ = DiscordObjectState::Invalid;
7491uint64_t LinkedLobby::ApplicationId()
const
7493 assert(state_ == DiscordObjectState::Owned);
7494 uint64_t returnValue__;
7495 returnValue__ = Discord_LinkedLobby_ApplicationId(&instance_);
7496 return returnValue__;
7498void LinkedLobby::SetApplicationId(uint64_t ApplicationId)
7500 assert(state_ == DiscordObjectState::Owned);
7501 Discord_LinkedLobby_SetApplicationId(&instance_, ApplicationId);
7503uint64_t LinkedLobby::LobbyId()
const
7505 assert(state_ == DiscordObjectState::Owned);
7506 uint64_t returnValue__;
7507 returnValue__ = Discord_LinkedLobby_LobbyId(&instance_);
7508 return returnValue__;
7510void LinkedLobby::SetLobbyId(uint64_t LobbyId)
7512 assert(state_ == DiscordObjectState::Owned);
7513 Discord_LinkedLobby_SetLobbyId(&instance_, LobbyId);
7515const LinkedChannel LinkedChannel::nullobj{{}, DiscordObjectState::Invalid};
7516LinkedChannel::~LinkedChannel()
7518 if (state_ == DiscordObjectState::Owned) {
7520 state_ = DiscordObjectState::Invalid;
7523LinkedChannel::LinkedChannel(LinkedChannel&& other) noexcept
7524 : instance_(other.instance_)
7525 , state_(other.state_)
7527 other.state_ = DiscordObjectState::Invalid;
7529LinkedChannel& LinkedChannel::operator=(LinkedChannel&& other)
noexcept
7531 if (
this != &other) {
7532 if (state_ == DiscordObjectState::Owned) {
7535 instance_ = other.instance_;
7536 state_ = other.state_;
7537 other.state_ = DiscordObjectState::Invalid;
7541LinkedChannel::LinkedChannel(
const LinkedChannel& arg0)
7546 Discord_LinkedChannel_Clone(&instance_, arg0.instance());
7548 state_ = DiscordObjectState::Owned;
7551LinkedChannel& LinkedChannel::operator=(
const LinkedChannel& arg0)
7553 if (
this != &arg0) {
7554 if (state_ == DiscordObjectState::Owned) {
7556 state_ = DiscordObjectState::Invalid;
7558 if (arg0.state_ == DiscordObjectState::Owned) {
7559 Discord_LinkedChannel_Clone(&instance_, arg0.instance());
7561 state_ = DiscordObjectState::Owned;
7566LinkedChannel::LinkedChannel(Discord_LinkedChannel instance, DiscordObjectState state)
7567 : instance_(instance)
7571void LinkedChannel::Drop()
7573 if (state_ != DiscordObjectState::Owned) {
7576 Discord_LinkedChannel_Drop(&instance_);
7577 state_ = DiscordObjectState::Invalid;
7579uint64_t LinkedChannel::Id()
const
7581 assert(state_ == DiscordObjectState::Owned);
7582 uint64_t returnValue__;
7583 returnValue__ = Discord_LinkedChannel_Id(&instance_);
7584 return returnValue__;
7586void LinkedChannel::SetId(uint64_t Id)
7588 assert(state_ == DiscordObjectState::Owned);
7589 Discord_LinkedChannel_SetId(&instance_, Id);
7591std::string LinkedChannel::Name()
const
7593 assert(state_ == DiscordObjectState::Owned);
7594 Discord_String returnValueNative__;
7595 Discord_LinkedChannel_Name(&instance_, &returnValueNative__);
7596 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7597 returnValueNative__.size);
7598 Discord_Free(returnValueNative__.ptr);
7599 return returnValue__;
7601void LinkedChannel::SetName(std::string Name)
7603 assert(state_ == DiscordObjectState::Owned);
7604 Discord_String Name__str{(uint8_t*)(Name.data()), Name.size()};
7605 Discord_LinkedChannel_SetName(&instance_, Name__str);
7607uint64_t LinkedChannel::GuildId()
const
7609 assert(state_ == DiscordObjectState::Owned);
7610 uint64_t returnValue__;
7611 returnValue__ = Discord_LinkedChannel_GuildId(&instance_);
7612 return returnValue__;
7614void LinkedChannel::SetGuildId(uint64_t GuildId)
7616 assert(state_ == DiscordObjectState::Owned);
7617 Discord_LinkedChannel_SetGuildId(&instance_, GuildId);
7619const RelationshipHandle RelationshipHandle::nullobj{{}, DiscordObjectState::Invalid};
7620RelationshipHandle::~RelationshipHandle()
7622 if (state_ == DiscordObjectState::Owned) {
7624 state_ = DiscordObjectState::Invalid;
7627RelationshipHandle::RelationshipHandle(RelationshipHandle&& other) noexcept
7628 : instance_(other.instance_)
7629 , state_(other.state_)
7631 other.state_ = DiscordObjectState::Invalid;
7633RelationshipHandle& RelationshipHandle::operator=(RelationshipHandle&& other)
noexcept
7635 if (
this != &other) {
7636 if (state_ == DiscordObjectState::Owned) {
7639 instance_ = other.instance_;
7640 state_ = other.state_;
7641 other.state_ = DiscordObjectState::Invalid;
7645RelationshipHandle::RelationshipHandle(
const RelationshipHandle& other)
7650 Discord_RelationshipHandle_Clone(&instance_, other.instance());
7652 state_ = DiscordObjectState::Owned;
7655RelationshipHandle& RelationshipHandle::operator=(
const RelationshipHandle& other)
7657 if (
this != &other) {
7658 if (state_ == DiscordObjectState::Owned) {
7660 state_ = DiscordObjectState::Invalid;
7662 if (other.state_ == DiscordObjectState::Owned) {
7663 Discord_RelationshipHandle_Clone(&instance_, other.instance());
7665 state_ = DiscordObjectState::Owned;
7670RelationshipHandle::RelationshipHandle(Discord_RelationshipHandle instance,
7671 DiscordObjectState state)
7672 : instance_(instance)
7676void RelationshipHandle::Drop()
7678 if (state_ != DiscordObjectState::Owned) {
7681 Discord_RelationshipHandle_Drop(&instance_);
7682 state_ = DiscordObjectState::Invalid;
7686 assert(state_ == DiscordObjectState::Owned);
7687 Discord_RelationshipType returnValue__;
7688 returnValue__ = Discord_RelationshipHandle_DiscordRelationshipType(&instance_);
7693 assert(state_ == DiscordObjectState::Owned);
7694 Discord_RelationshipType returnValue__;
7695 returnValue__ = Discord_RelationshipHandle_GameRelationshipType(&instance_);
7698uint64_t RelationshipHandle::Id()
const
7700 assert(state_ == DiscordObjectState::Owned);
7701 uint64_t returnValue__;
7702 returnValue__ = Discord_RelationshipHandle_Id(&instance_);
7703 return returnValue__;
7705std::optional<discordpp::UserHandle> RelationshipHandle::User()
const
7707 assert(state_ == DiscordObjectState::Owned);
7708 bool returnIsNonNull__;
7709 Discord_UserHandle returnValueNative__;
7710 returnIsNonNull__ = Discord_RelationshipHandle_User(&instance_, &returnValueNative__);
7711 if (!returnIsNonNull__) {
7715 return returnValue__;
7717const UserHandle UserHandle::nullobj{{}, DiscordObjectState::Invalid};
7718UserHandle::~UserHandle()
7720 if (state_ == DiscordObjectState::Owned) {
7722 state_ = DiscordObjectState::Invalid;
7725UserHandle::UserHandle(UserHandle&& other) noexcept
7726 : instance_(other.instance_)
7727 , state_(other.state_)
7729 other.state_ = DiscordObjectState::Invalid;
7731UserHandle& UserHandle::operator=(UserHandle&& other)
noexcept
7733 if (
this != &other) {
7734 if (state_ == DiscordObjectState::Owned) {
7737 instance_ = other.instance_;
7738 state_ = other.state_;
7739 other.state_ = DiscordObjectState::Invalid;
7743UserHandle::UserHandle(
const UserHandle& arg0)
7748 Discord_UserHandle_Clone(&instance_, arg0.instance());
7750 state_ = DiscordObjectState::Owned;
7753UserHandle& UserHandle::operator=(
const UserHandle& arg0)
7755 if (
this != &arg0) {
7756 if (state_ == DiscordObjectState::Owned) {
7758 state_ = DiscordObjectState::Invalid;
7760 if (arg0.state_ == DiscordObjectState::Owned) {
7761 Discord_UserHandle_Clone(&instance_, arg0.instance());
7763 state_ = DiscordObjectState::Owned;
7768UserHandle::UserHandle(Discord_UserHandle instance, DiscordObjectState state)
7769 : instance_(instance)
7773void UserHandle::Drop()
7775 if (state_ != DiscordObjectState::Owned) {
7778 Discord_UserHandle_Drop(&instance_);
7779 state_ = DiscordObjectState::Invalid;
7781std::optional<std::string> UserHandle::Avatar()
const
7783 assert(state_ == DiscordObjectState::Owned);
7784 bool returnIsNonNull__;
7785 Discord_String returnValueNative__;
7786 returnIsNonNull__ = Discord_UserHandle_Avatar(&instance_, &returnValueNative__);
7787 if (!returnIsNonNull__) {
7790 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7791 returnValueNative__.size);
7792 Discord_Free(returnValueNative__.ptr);
7793 return returnValue__;
7797 Discord_String returnValueNative__;
7798 Discord_UserHandle_AvatarTypeToString(
static_cast<Discord_UserHandle_AvatarType
>(type),
7799 &returnValueNative__);
7800 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7801 returnValueNative__.size);
7802 Discord_Free(returnValueNative__.ptr);
7803 return returnValue__;
7808 assert(state_ == DiscordObjectState::Owned);
7809 Discord_String returnValueNative__;
7810 Discord_UserHandle_AvatarUrl(&instance_,
7811 static_cast<Discord_UserHandle_AvatarType
>(animatedType),
7812 static_cast<Discord_UserHandle_AvatarType
>(staticType),
7813 &returnValueNative__);
7814 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7815 returnValueNative__.size);
7816 Discord_Free(returnValueNative__.ptr);
7817 return returnValue__;
7819std::string UserHandle::DisplayName()
const
7821 assert(state_ == DiscordObjectState::Owned);
7822 Discord_String returnValueNative__;
7823 Discord_UserHandle_DisplayName(&instance_, &returnValueNative__);
7824 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7825 returnValueNative__.size);
7826 Discord_Free(returnValueNative__.ptr);
7827 return returnValue__;
7829std::optional<discordpp::Activity> UserHandle::GameActivity()
const
7831 assert(state_ == DiscordObjectState::Owned);
7832 bool returnIsNonNull__;
7833 Discord_Activity returnValueNative__;
7834 returnIsNonNull__ = Discord_UserHandle_GameActivity(&instance_, &returnValueNative__);
7835 if (!returnIsNonNull__) {
7839 return returnValue__;
7841std::optional<std::string> UserHandle::GlobalName()
const
7843 assert(state_ == DiscordObjectState::Owned);
7844 bool returnIsNonNull__;
7845 Discord_String returnValueNative__;
7846 returnIsNonNull__ = Discord_UserHandle_GlobalName(&instance_, &returnValueNative__);
7847 if (!returnIsNonNull__) {
7850 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7851 returnValueNative__.size);
7852 Discord_Free(returnValueNative__.ptr);
7853 return returnValue__;
7855uint64_t UserHandle::Id()
const
7857 assert(state_ == DiscordObjectState::Owned);
7858 uint64_t returnValue__;
7859 returnValue__ = Discord_UserHandle_Id(&instance_);
7860 return returnValue__;
7862bool UserHandle::IsProvisional()
const
7864 assert(state_ == DiscordObjectState::Owned);
7866 returnValue__ = Discord_UserHandle_IsProvisional(&instance_);
7867 return returnValue__;
7871 assert(state_ == DiscordObjectState::Owned);
7872 Discord_RelationshipHandle returnValueNative__{};
7873 Discord_UserHandle_Relationship(&instance_, &returnValueNative__);
7875 return returnValue__;
7879 assert(state_ == DiscordObjectState::Owned);
7880 Discord_StatusType returnValue__;
7881 returnValue__ = Discord_UserHandle_Status(&instance_);
7884std::string UserHandle::Username()
const
7886 assert(state_ == DiscordObjectState::Owned);
7887 Discord_String returnValueNative__;
7888 Discord_UserHandle_Username(&instance_, &returnValueNative__);
7889 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7890 returnValueNative__.size);
7891 Discord_Free(returnValueNative__.ptr);
7892 return returnValue__;
7894const LobbyMemberHandle LobbyMemberHandle::nullobj{{}, DiscordObjectState::Invalid};
7895LobbyMemberHandle::~LobbyMemberHandle()
7897 if (state_ == DiscordObjectState::Owned) {
7899 state_ = DiscordObjectState::Invalid;
7902LobbyMemberHandle::LobbyMemberHandle(LobbyMemberHandle&& other) noexcept
7903 : instance_(other.instance_)
7904 , state_(other.state_)
7906 other.state_ = DiscordObjectState::Invalid;
7908LobbyMemberHandle& LobbyMemberHandle::operator=(LobbyMemberHandle&& other)
noexcept
7910 if (
this != &other) {
7911 if (state_ == DiscordObjectState::Owned) {
7914 instance_ = other.instance_;
7915 state_ = other.state_;
7916 other.state_ = DiscordObjectState::Invalid;
7920LobbyMemberHandle::LobbyMemberHandle(
const LobbyMemberHandle& other)
7925 Discord_LobbyMemberHandle_Clone(&instance_, other.instance());
7927 state_ = DiscordObjectState::Owned;
7930LobbyMemberHandle& LobbyMemberHandle::operator=(
const LobbyMemberHandle& other)
7932 if (
this != &other) {
7933 if (state_ == DiscordObjectState::Owned) {
7935 state_ = DiscordObjectState::Invalid;
7937 if (other.state_ == DiscordObjectState::Owned) {
7938 Discord_LobbyMemberHandle_Clone(&instance_, other.instance());
7940 state_ = DiscordObjectState::Owned;
7945LobbyMemberHandle::LobbyMemberHandle(Discord_LobbyMemberHandle instance, DiscordObjectState state)
7946 : instance_(instance)
7950void LobbyMemberHandle::Drop()
7952 if (state_ != DiscordObjectState::Owned) {
7955 Discord_LobbyMemberHandle_Drop(&instance_);
7956 state_ = DiscordObjectState::Invalid;
7958bool LobbyMemberHandle::CanLinkLobby()
const
7960 assert(state_ == DiscordObjectState::Owned);
7962 returnValue__ = Discord_LobbyMemberHandle_CanLinkLobby(&instance_);
7963 return returnValue__;
7965bool LobbyMemberHandle::Connected()
const
7967 assert(state_ == DiscordObjectState::Owned);
7969 returnValue__ = Discord_LobbyMemberHandle_Connected(&instance_);
7970 return returnValue__;
7972uint64_t LobbyMemberHandle::Id()
const
7974 assert(state_ == DiscordObjectState::Owned);
7975 uint64_t returnValue__;
7976 returnValue__ = Discord_LobbyMemberHandle_Id(&instance_);
7977 return returnValue__;
7979std::unordered_map<std::string, std::string> LobbyMemberHandle::Metadata()
const
7981 assert(state_ == DiscordObjectState::Owned);
7982 Discord_Properties returnValueNative__;
7983 Discord_LobbyMemberHandle_Metadata(&instance_, &returnValueNative__);
7984 std::unordered_map<std::string, std::string> returnValue__ =
7985 ConvertReturnedProperties(returnValueNative__);
7986 Discord_FreeProperties(returnValueNative__);
7987 return returnValue__;
7989std::optional<discordpp::UserHandle> LobbyMemberHandle::User()
const
7991 assert(state_ == DiscordObjectState::Owned);
7992 bool returnIsNonNull__;
7993 Discord_UserHandle returnValueNative__;
7994 returnIsNonNull__ = Discord_LobbyMemberHandle_User(&instance_, &returnValueNative__);
7995 if (!returnIsNonNull__) {
7999 return returnValue__;
8001const LobbyHandle LobbyHandle::nullobj{{}, DiscordObjectState::Invalid};
8002LobbyHandle::~LobbyHandle()
8004 if (state_ == DiscordObjectState::Owned) {
8006 state_ = DiscordObjectState::Invalid;
8009LobbyHandle::LobbyHandle(LobbyHandle&& other) noexcept
8010 : instance_(other.instance_)
8011 , state_(other.state_)
8013 other.state_ = DiscordObjectState::Invalid;
8015LobbyHandle& LobbyHandle::operator=(LobbyHandle&& other)
noexcept
8017 if (
this != &other) {
8018 if (state_ == DiscordObjectState::Owned) {
8021 instance_ = other.instance_;
8022 state_ = other.state_;
8023 other.state_ = DiscordObjectState::Invalid;
8027LobbyHandle::LobbyHandle(
const LobbyHandle& other)
8032 Discord_LobbyHandle_Clone(&instance_, other.instance());
8034 state_ = DiscordObjectState::Owned;
8037LobbyHandle& LobbyHandle::operator=(
const LobbyHandle& other)
8039 if (
this != &other) {
8040 if (state_ == DiscordObjectState::Owned) {
8042 state_ = DiscordObjectState::Invalid;
8044 if (other.state_ == DiscordObjectState::Owned) {
8045 Discord_LobbyHandle_Clone(&instance_, other.instance());
8047 state_ = DiscordObjectState::Owned;
8052LobbyHandle::LobbyHandle(Discord_LobbyHandle instance, DiscordObjectState state)
8053 : instance_(instance)
8057void LobbyHandle::Drop()
8059 if (state_ != DiscordObjectState::Owned) {
8062 Discord_LobbyHandle_Drop(&instance_);
8063 state_ = DiscordObjectState::Invalid;
8065std::optional<discordpp::CallInfoHandle> LobbyHandle::GetCallInfoHandle()
const
8067 assert(state_ == DiscordObjectState::Owned);
8068 bool returnIsNonNull__;
8069 Discord_CallInfoHandle returnValueNative__;
8070 returnIsNonNull__ = Discord_LobbyHandle_GetCallInfoHandle(&instance_, &returnValueNative__);
8071 if (!returnIsNonNull__) {
8075 return returnValue__;
8077std::optional<discordpp::LobbyMemberHandle> LobbyHandle::GetLobbyMemberHandle(
8078 uint64_t memberId)
const
8080 assert(state_ == DiscordObjectState::Owned);
8081 bool returnIsNonNull__;
8082 Discord_LobbyMemberHandle returnValueNative__;
8084 Discord_LobbyHandle_GetLobbyMemberHandle(&instance_, memberId, &returnValueNative__);
8085 if (!returnIsNonNull__) {
8089 return returnValue__;
8091uint64_t LobbyHandle::Id()
const
8093 assert(state_ == DiscordObjectState::Owned);
8094 uint64_t returnValue__;
8095 returnValue__ = Discord_LobbyHandle_Id(&instance_);
8096 return returnValue__;
8098std::optional<discordpp::LinkedChannel> LobbyHandle::LinkedChannel()
const
8100 assert(state_ == DiscordObjectState::Owned);
8101 bool returnIsNonNull__;
8102 Discord_LinkedChannel returnValueNative__;
8103 returnIsNonNull__ = Discord_LobbyHandle_LinkedChannel(&instance_, &returnValueNative__);
8104 if (!returnIsNonNull__) {
8108 return returnValue__;
8110std::vector<uint64_t> LobbyHandle::LobbyMemberIds()
const
8112 assert(state_ == DiscordObjectState::Owned);
8113 Discord_UInt64Span returnValueNative__;
8114 Discord_LobbyHandle_LobbyMemberIds(&instance_, &returnValueNative__);
8115 std::vector<uint64_t> returnValue__(returnValueNative__.ptr,
8116 returnValueNative__.ptr + returnValueNative__.size);
8117 Discord_Free(returnValueNative__.ptr);
8118 return returnValue__;
8120std::vector<discordpp::LobbyMemberHandle> LobbyHandle::LobbyMembers()
const
8122 assert(state_ == DiscordObjectState::Owned);
8123 Discord_LobbyMemberHandleSpan returnValueNative__;
8124 Discord_LobbyHandle_LobbyMembers(&instance_, &returnValueNative__);
8125 std::vector<discordpp::LobbyMemberHandle> returnValue__;
8126 returnValue__.reserve(returnValueNative__.size);
8127 for (
size_t i__ = 0; i__ < returnValueNative__.size; ++i__) {
8128 returnValue__.emplace_back(returnValueNative__.ptr[i__], DiscordObjectState::Owned);
8130 Discord_Free(returnValueNative__.ptr);
8131 return returnValue__;
8133std::unordered_map<std::string, std::string> LobbyHandle::Metadata()
const
8135 assert(state_ == DiscordObjectState::Owned);
8136 Discord_Properties returnValueNative__;
8137 Discord_LobbyHandle_Metadata(&instance_, &returnValueNative__);
8138 std::unordered_map<std::string, std::string> returnValue__ =
8139 ConvertReturnedProperties(returnValueNative__);
8140 Discord_FreeProperties(returnValueNative__);
8141 return returnValue__;
8143const AdditionalContent AdditionalContent::nullobj{{}, DiscordObjectState::Invalid};
8144AdditionalContent::~AdditionalContent()
8146 if (state_ == DiscordObjectState::Owned) {
8148 state_ = DiscordObjectState::Invalid;
8151AdditionalContent::AdditionalContent(AdditionalContent&& other) noexcept
8152 : instance_(other.instance_)
8153 , state_(other.state_)
8155 other.state_ = DiscordObjectState::Invalid;
8157AdditionalContent& AdditionalContent::operator=(AdditionalContent&& other)
noexcept
8159 if (
this != &other) {
8160 if (state_ == DiscordObjectState::Owned) {
8163 instance_ = other.instance_;
8164 state_ = other.state_;
8165 other.state_ = DiscordObjectState::Invalid;
8169AdditionalContent::AdditionalContent(
const AdditionalContent& arg0)
8174 Discord_AdditionalContent_Clone(&instance_, arg0.instance());
8176 state_ = DiscordObjectState::Owned;
8179AdditionalContent& AdditionalContent::operator=(
const AdditionalContent& arg0)
8181 if (
this != &arg0) {
8182 if (state_ == DiscordObjectState::Owned) {
8184 state_ = DiscordObjectState::Invalid;
8186 if (arg0.state_ == DiscordObjectState::Owned) {
8187 Discord_AdditionalContent_Clone(&instance_, arg0.instance());
8189 state_ = DiscordObjectState::Owned;
8194AdditionalContent::AdditionalContent(Discord_AdditionalContent instance, DiscordObjectState state)
8195 : instance_(instance)
8199AdditionalContent::AdditionalContent()
8201 assert(state_ == DiscordObjectState::Invalid);
8202 Discord_AdditionalContent_Init(&instance_);
8203 state_ = DiscordObjectState::Owned;
8205void AdditionalContent::Drop()
8207 if (state_ != DiscordObjectState::Owned) {
8210 Discord_AdditionalContent_Drop(&instance_);
8211 state_ = DiscordObjectState::Invalid;
8215 assert(state_ == DiscordObjectState::Owned);
8217 returnValue__ = Discord_AdditionalContent_Equals(&instance_, rhs.instance());
8218 return returnValue__;
8222 Discord_String returnValueNative__;
8223 Discord_AdditionalContent_TypeToString(
static_cast<Discord_AdditionalContentType
>(type),
8224 &returnValueNative__);
8225 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
8226 returnValueNative__.size);
8227 Discord_Free(returnValueNative__.ptr);
8228 return returnValue__;
8232 assert(state_ == DiscordObjectState::Owned);
8233 Discord_AdditionalContentType returnValue__;
8234 returnValue__ = Discord_AdditionalContent_Type(&instance_);
8239 assert(state_ == DiscordObjectState::Owned);
8240 Discord_AdditionalContent_SetType(&instance_,
static_cast<Discord_AdditionalContentType
>(Type));
8242std::optional<std::string> AdditionalContent::Title()
const
8244 assert(state_ == DiscordObjectState::Owned);
8245 bool returnIsNonNull__;
8246 Discord_String returnValueNative__;
8247 returnIsNonNull__ = Discord_AdditionalContent_Title(&instance_, &returnValueNative__);
8248 if (!returnIsNonNull__) {
8251 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
8252 returnValueNative__.size);
8253 Discord_Free(returnValueNative__.ptr);
8254 return returnValue__;
8256void AdditionalContent::SetTitle(std::optional<std::string> Title)
8258 assert(state_ == DiscordObjectState::Owned);
8259 Discord_String Title__str{};
8260 if (Title.has_value()) {
8261 Title__str.ptr =
reinterpret_cast<uint8_t*
>(Title->data());
8262 Title__str.size = Title->size();
8264 Discord_AdditionalContent_SetTitle(&instance_, (Title.has_value() ? &Title__str :
nullptr));
8266uint8_t AdditionalContent::Count()
const
8268 assert(state_ == DiscordObjectState::Owned);
8269 uint8_t returnValue__;
8270 returnValue__ = Discord_AdditionalContent_Count(&instance_);
8271 return returnValue__;
8273void AdditionalContent::SetCount(uint8_t Count)
8275 assert(state_ == DiscordObjectState::Owned);
8276 Discord_AdditionalContent_SetCount(&instance_, Count);
8278const MessageHandle MessageHandle::nullobj{{}, DiscordObjectState::Invalid};
8279MessageHandle::~MessageHandle()
8281 if (state_ == DiscordObjectState::Owned) {
8283 state_ = DiscordObjectState::Invalid;
8286MessageHandle::MessageHandle(MessageHandle&& other) noexcept
8287 : instance_(other.instance_)
8288 , state_(other.state_)
8290 other.state_ = DiscordObjectState::Invalid;
8292MessageHandle& MessageHandle::operator=(MessageHandle&& other)
noexcept
8294 if (
this != &other) {
8295 if (state_ == DiscordObjectState::Owned) {
8298 instance_ = other.instance_;
8299 state_ = other.state_;
8300 other.state_ = DiscordObjectState::Invalid;
8304MessageHandle::MessageHandle(
const MessageHandle& other)
8309 Discord_MessageHandle_Clone(&instance_, other.instance());
8311 state_ = DiscordObjectState::Owned;
8314MessageHandle& MessageHandle::operator=(
const MessageHandle& other)
8316 if (
this != &other) {
8317 if (state_ == DiscordObjectState::Owned) {
8319 state_ = DiscordObjectState::Invalid;
8321 if (other.state_ == DiscordObjectState::Owned) {
8322 Discord_MessageHandle_Clone(&instance_, other.instance());
8324 state_ = DiscordObjectState::Owned;
8329MessageHandle::MessageHandle(Discord_MessageHandle instance, DiscordObjectState state)
8330 : instance_(instance)
8334void MessageHandle::Drop()
8336 if (state_ != DiscordObjectState::Owned) {
8339 Discord_MessageHandle_Drop(&instance_);
8340 state_ = DiscordObjectState::Invalid;
8342std::optional<discordpp::AdditionalContent> MessageHandle::AdditionalContent()
const
8344 assert(state_ == DiscordObjectState::Owned);
8345 bool returnIsNonNull__;
8346 Discord_AdditionalContent returnValueNative__;
8347 returnIsNonNull__ = Discord_MessageHandle_AdditionalContent(&instance_, &returnValueNative__);
8348 if (!returnIsNonNull__) {
8352 return returnValue__;
8354std::optional<discordpp::UserHandle> MessageHandle::Author()
const
8356 assert(state_ == DiscordObjectState::Owned);
8357 bool returnIsNonNull__;
8358 Discord_UserHandle returnValueNative__;
8359 returnIsNonNull__ = Discord_MessageHandle_Author(&instance_, &returnValueNative__);
8360 if (!returnIsNonNull__) {
8364 return returnValue__;
8366uint64_t MessageHandle::AuthorId()
const
8368 assert(state_ == DiscordObjectState::Owned);
8369 uint64_t returnValue__;
8370 returnValue__ = Discord_MessageHandle_AuthorId(&instance_);
8371 return returnValue__;
8373std::optional<discordpp::ChannelHandle> MessageHandle::Channel()
const
8375 assert(state_ == DiscordObjectState::Owned);
8376 bool returnIsNonNull__;
8377 Discord_ChannelHandle returnValueNative__;
8378 returnIsNonNull__ = Discord_MessageHandle_Channel(&instance_, &returnValueNative__);
8379 if (!returnIsNonNull__) {
8383 return returnValue__;
8385uint64_t MessageHandle::ChannelId()
const
8387 assert(state_ == DiscordObjectState::Owned);
8388 uint64_t returnValue__;
8389 returnValue__ = Discord_MessageHandle_ChannelId(&instance_);
8390 return returnValue__;
8392std::string MessageHandle::Content()
const
8394 assert(state_ == DiscordObjectState::Owned);
8395 Discord_String returnValueNative__;
8396 Discord_MessageHandle_Content(&instance_, &returnValueNative__);
8397 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
8398 returnValueNative__.size);
8399 Discord_Free(returnValueNative__.ptr);
8400 return returnValue__;
8402std::optional<discordpp::DisclosureTypes> MessageHandle::DisclosureType()
const
8404 assert(state_ == DiscordObjectState::Owned);
8405 bool returnIsNonNull__;
8406 Discord_DisclosureTypes returnValueNative__;
8407 returnIsNonNull__ = Discord_MessageHandle_DisclosureType(&instance_, &returnValueNative__);
8408 if (!returnIsNonNull__) {
8412 return returnValue__;
8414uint64_t MessageHandle::EditedTimestamp()
const
8416 assert(state_ == DiscordObjectState::Owned);
8417 uint64_t returnValue__;
8418 returnValue__ = Discord_MessageHandle_EditedTimestamp(&instance_);
8419 return returnValue__;
8421uint64_t MessageHandle::Id()
const
8423 assert(state_ == DiscordObjectState::Owned);
8424 uint64_t returnValue__;
8425 returnValue__ = Discord_MessageHandle_Id(&instance_);
8426 return returnValue__;
8428std::optional<discordpp::LobbyHandle> MessageHandle::Lobby()
const
8430 assert(state_ == DiscordObjectState::Owned);
8431 bool returnIsNonNull__;
8432 Discord_LobbyHandle returnValueNative__;
8433 returnIsNonNull__ = Discord_MessageHandle_Lobby(&instance_, &returnValueNative__);
8434 if (!returnIsNonNull__) {
8438 return returnValue__;
8440std::unordered_map<std::string, std::string> MessageHandle::Metadata()
const
8442 assert(state_ == DiscordObjectState::Owned);
8443 Discord_Properties returnValueNative__;
8444 Discord_MessageHandle_Metadata(&instance_, &returnValueNative__);
8445 std::unordered_map<std::string, std::string> returnValue__ =
8446 ConvertReturnedProperties(returnValueNative__);
8447 Discord_FreeProperties(returnValueNative__);
8448 return returnValue__;
8450std::string MessageHandle::RawContent()
const
8452 assert(state_ == DiscordObjectState::Owned);
8453 Discord_String returnValueNative__;
8454 Discord_MessageHandle_RawContent(&instance_, &returnValueNative__);
8455 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
8456 returnValueNative__.size);
8457 Discord_Free(returnValueNative__.ptr);
8458 return returnValue__;
8460std::optional<discordpp::UserHandle> MessageHandle::Recipient()
const
8462 assert(state_ == DiscordObjectState::Owned);
8463 bool returnIsNonNull__;
8464 Discord_UserHandle returnValueNative__;
8465 returnIsNonNull__ = Discord_MessageHandle_Recipient(&instance_, &returnValueNative__);
8466 if (!returnIsNonNull__) {
8470 return returnValue__;
8472uint64_t MessageHandle::RecipientId()
const
8474 assert(state_ == DiscordObjectState::Owned);
8475 uint64_t returnValue__;
8476 returnValue__ = Discord_MessageHandle_RecipientId(&instance_);
8477 return returnValue__;
8479bool MessageHandle::SentFromGame()
const
8481 assert(state_ == DiscordObjectState::Owned);
8483 returnValue__ = Discord_MessageHandle_SentFromGame(&instance_);
8484 return returnValue__;
8486uint64_t MessageHandle::SentTimestamp()
const
8488 assert(state_ == DiscordObjectState::Owned);
8489 uint64_t returnValue__;
8490 returnValue__ = Discord_MessageHandle_SentTimestamp(&instance_);
8491 return returnValue__;
8493const AudioDevice AudioDevice::nullobj{{}, DiscordObjectState::Invalid};
8494AudioDevice::~AudioDevice()
8496 if (state_ == DiscordObjectState::Owned) {
8498 state_ = DiscordObjectState::Invalid;
8501AudioDevice::AudioDevice(AudioDevice&& other) noexcept
8502 : instance_(other.instance_)
8503 , state_(other.state_)
8505 other.state_ = DiscordObjectState::Invalid;
8507AudioDevice& AudioDevice::operator=(AudioDevice&& other)
noexcept
8509 if (
this != &other) {
8510 if (state_ == DiscordObjectState::Owned) {
8513 instance_ = other.instance_;
8514 state_ = other.state_;
8515 other.state_ = DiscordObjectState::Invalid;
8519AudioDevice::AudioDevice(
const AudioDevice& arg0)
8524 Discord_AudioDevice_Clone(&instance_, arg0.instance());
8526 state_ = DiscordObjectState::Owned;
8529AudioDevice& AudioDevice::operator=(
const AudioDevice& arg0)
8531 if (
this != &arg0) {
8532 if (state_ == DiscordObjectState::Owned) {
8534 state_ = DiscordObjectState::Invalid;
8536 if (arg0.state_ == DiscordObjectState::Owned) {
8537 Discord_AudioDevice_Clone(&instance_, arg0.instance());
8539 state_ = DiscordObjectState::Owned;
8544AudioDevice::AudioDevice(Discord_AudioDevice instance, DiscordObjectState state)
8545 : instance_(instance)
8549void AudioDevice::Drop()
8551 if (state_ != DiscordObjectState::Owned) {
8554 Discord_AudioDevice_Drop(&instance_);
8555 state_ = DiscordObjectState::Invalid;
8559 assert(state_ == DiscordObjectState::Owned);
8561 returnValue__ = Discord_AudioDevice_Equals(&instance_, rhs.instance());
8562 return returnValue__;
8564std::string AudioDevice::Id()
const
8566 assert(state_ == DiscordObjectState::Owned);
8567 Discord_String returnValueNative__;
8568 Discord_AudioDevice_Id(&instance_, &returnValueNative__);
8569 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
8570 returnValueNative__.size);
8571 Discord_Free(returnValueNative__.ptr);
8572 return returnValue__;
8574void AudioDevice::SetId(std::string Id)
8576 assert(state_ == DiscordObjectState::Owned);
8577 Discord_String Id__str{(uint8_t*)(Id.data()), Id.size()};
8578 Discord_AudioDevice_SetId(&instance_, Id__str);
8580std::string AudioDevice::Name()
const
8582 assert(state_ == DiscordObjectState::Owned);
8583 Discord_String returnValueNative__;
8584 Discord_AudioDevice_Name(&instance_, &returnValueNative__);
8585 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
8586 returnValueNative__.size);
8587 Discord_Free(returnValueNative__.ptr);
8588 return returnValue__;
8590void AudioDevice::SetName(std::string Name)
8592 assert(state_ == DiscordObjectState::Owned);
8593 Discord_String Name__str{(uint8_t*)(Name.data()), Name.size()};
8594 Discord_AudioDevice_SetName(&instance_, Name__str);
8596bool AudioDevice::IsDefault()
const
8598 assert(state_ == DiscordObjectState::Owned);
8600 returnValue__ = Discord_AudioDevice_IsDefault(&instance_);
8601 return returnValue__;
8603void AudioDevice::SetIsDefault(
bool IsDefault)
8605 assert(state_ == DiscordObjectState::Owned);
8606 Discord_AudioDevice_SetIsDefault(&instance_, IsDefault);
8608const Client Client::nullobj{{}, DiscordObjectState::Invalid};
8611 if (state_ == DiscordObjectState::Owned) {
8613 state_ = DiscordObjectState::Invalid;
8616Client::Client(Client&& other) noexcept
8617 : instance_(other.instance_)
8618 , state_(other.state_)
8620 other.state_ = DiscordObjectState::Invalid;
8622Client& Client::operator=(Client&& other)
noexcept
8624 if (
this != &other) {
8625 if (state_ == DiscordObjectState::Owned) {
8628 instance_ = other.instance_;
8629 state_ = other.state_;
8630 other.state_ = DiscordObjectState::Invalid;
8634Client::Client(Discord_Client instance, DiscordObjectState state)
8635 : instance_(instance)
8641 assert(state_ == DiscordObjectState::Invalid);
8642 Discord_Client_Init(&instance_);
8643 state_ = DiscordObjectState::Owned;
8645Client::Client(std::string apiBase, std::string webBase)
8647 assert(state_ == DiscordObjectState::Invalid);
8648 Discord_String apiBase__str{(uint8_t*)(apiBase.data()), apiBase.size()};
8649 Discord_String webBase__str{(uint8_t*)(webBase.data()), webBase.size()};
8650 Discord_Client_InitWithBases(&instance_, apiBase__str, webBase__str);
8651 state_ = DiscordObjectState::Owned;
8655 if (state_ != DiscordObjectState::Owned) {
8658 Discord_Client_Drop(&instance_);
8659 state_ = DiscordObjectState::Invalid;
8663 Discord_String returnValueNative__;
8664 Discord_Client_ErrorToString(
static_cast<Discord_Client_Error
>(type), &returnValueNative__);
8665 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
8666 returnValueNative__.size);
8667 Discord_Free(returnValueNative__.ptr);
8668 return returnValue__;
8670uint64_t Client::GetApplicationId()
8672 assert(state_ == DiscordObjectState::Owned);
8673 uint64_t returnValue__;
8674 returnValue__ = Discord_Client_GetApplicationId(&instance_);
8675 return returnValue__;
8677std::string Client::GetDefaultAudioDeviceId()
8679 Discord_String returnValueNative__;
8680 Discord_Client_GetDefaultAudioDeviceId(&returnValueNative__);
8681 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
8682 returnValueNative__.size);
8683 Discord_Free(returnValueNative__.ptr);
8684 return returnValue__;
8686std::string Client::GetDefaultCommunicationScopes()
8688 Discord_String returnValueNative__;
8689 Discord_Client_GetDefaultCommunicationScopes(&returnValueNative__);
8690 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
8691 returnValueNative__.size);
8692 Discord_Free(returnValueNative__.ptr);
8693 return returnValue__;
8695std::string Client::GetDefaultPresenceScopes()
8697 Discord_String returnValueNative__;
8698 Discord_Client_GetDefaultPresenceScopes(&returnValueNative__);
8699 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
8700 returnValueNative__.size);
8701 Discord_Free(returnValueNative__.ptr);
8702 return returnValue__;
8704std::string Client::GetVersionHash()
8706 Discord_String returnValueNative__;
8707 Discord_Client_GetVersionHash(&returnValueNative__);
8708 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
8709 returnValueNative__.size);
8710 Discord_Free(returnValueNative__.ptr);
8711 return returnValue__;
8713int32_t Client::GetVersionMajor()
8715 int32_t returnValue__;
8716 returnValue__ = Discord_Client_GetVersionMajor();
8717 return returnValue__;
8719int32_t Client::GetVersionMinor()
8721 int32_t returnValue__;
8722 returnValue__ = Discord_Client_GetVersionMinor();
8723 return returnValue__;
8725int32_t Client::GetVersionPatch()
8727 int32_t returnValue__;
8728 returnValue__ = Discord_Client_GetVersionPatch();
8729 return returnValue__;
8733 Discord_String returnValueNative__;
8734 Discord_Client_StatusToString(
static_cast<Discord_Client_Status
>(type), &returnValueNative__);
8735 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
8736 returnValueNative__.size);
8737 Discord_Free(returnValueNative__.ptr);
8738 return returnValue__;
8742 Discord_String returnValueNative__;
8743 Discord_Client_ThreadToString(
static_cast<Discord_Client_Thread
>(type), &returnValueNative__);
8744 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
8745 returnValueNative__.size);
8746 Discord_Free(returnValueNative__.ptr);
8747 return returnValue__;
8751 assert(state_ == DiscordObjectState::Owned);
8752 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
8753 auto callback__userData =
new Tcallback__UserData(callback);
8754 Discord_Client_EndCallCallback callback__native = [](
void* userData__) {
8755 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
8756 userData__typed->delegate();
8758 Discord_Client_EndCall(
8759 &instance_, channelId, callback__native, Tcallback__UserData::Free, callback__userData);
8763 assert(state_ == DiscordObjectState::Owned);
8764 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
8765 auto callback__userData =
new Tcallback__UserData(callback);
8766 Discord_Client_EndCallsCallback callback__native = [](
void* userData__) {
8767 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
8768 userData__typed->delegate();
8770 Discord_Client_EndCalls(
8771 &instance_, callback__native, Tcallback__UserData::Free, callback__userData);
8775 assert(state_ == DiscordObjectState::Owned);
8776 bool returnIsNonNull__;
8777 Discord_Call returnValueNative__{};
8778 returnIsNonNull__ = Discord_Client_GetCall(&instance_, channelId, &returnValueNative__);
8780 returnValueNative__,
8781 returnIsNonNull__ ? DiscordObjectState::Owned : DiscordObjectState::Invalid);
8782 return returnValue__;
8784std::vector<discordpp::Call> Client::GetCalls()
8786 assert(state_ == DiscordObjectState::Owned);
8787 Discord_CallSpan returnValueNative__;
8788 Discord_Client_GetCalls(&instance_, &returnValueNative__);
8789 std::vector<discordpp::Call> returnValue__;
8790 returnValue__.reserve(returnValueNative__.size);
8791 for (
size_t i__ = 0; i__ < returnValueNative__.size; ++i__) {
8792 returnValue__.emplace_back(returnValueNative__.ptr[i__], DiscordObjectState::Owned);
8794 Discord_Free(returnValueNative__.ptr);
8795 return returnValue__;
8799 assert(state_ == DiscordObjectState::Owned);
8800 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
8801 auto cb__userData =
new Tcb__UserData(cb);
8802 Discord_Client_GetCurrentInputDeviceCallback cb__native = [](
auto device,
void* userData__) {
8803 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
8805 userData__typed->delegate(std::move(device__obj));
8807 Discord_Client_GetCurrentInputDevice(&instance_, cb__native, Tcb__UserData::Free, cb__userData);
8811 assert(state_ == DiscordObjectState::Owned);
8812 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
8813 auto cb__userData =
new Tcb__UserData(cb);
8814 Discord_Client_GetCurrentOutputDeviceCallback cb__native = [](
auto device,
void* userData__) {
8815 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
8817 userData__typed->delegate(std::move(device__obj));
8819 Discord_Client_GetCurrentOutputDevice(
8820 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
8824 assert(state_ == DiscordObjectState::Owned);
8825 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
8826 auto cb__userData =
new Tcb__UserData(cb);
8827 Discord_Client_GetInputDevicesCallback cb__native = [](
auto devices,
void* userData__) {
8828 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
8829 std::vector<discordpp::AudioDevice> devices__vec;
8830 devices__vec.reserve(devices.size);
8831 for (
size_t i__ = 0; i__ < devices.size; ++i__) {
8832 devices__vec.emplace_back(devices.ptr[i__], DiscordObjectState::Owned);
8834 Discord_Free(devices.ptr);
8835 userData__typed->delegate(std::move(devices__vec));
8837 Discord_Client_GetInputDevices(&instance_, cb__native, Tcb__UserData::Free, cb__userData);
8839float Client::GetInputVolume()
8841 assert(state_ == DiscordObjectState::Owned);
8842 float returnValue__;
8843 returnValue__ = Discord_Client_GetInputVolume(&instance_);
8844 return returnValue__;
8848 assert(state_ == DiscordObjectState::Owned);
8849 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
8850 auto cb__userData =
new Tcb__UserData(cb);
8851 Discord_Client_GetOutputDevicesCallback cb__native = [](
auto devices,
void* userData__) {
8852 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
8853 std::vector<discordpp::AudioDevice> devices__vec;
8854 devices__vec.reserve(devices.size);
8855 for (
size_t i__ = 0; i__ < devices.size; ++i__) {
8856 devices__vec.emplace_back(devices.ptr[i__], DiscordObjectState::Owned);
8858 Discord_Free(devices.ptr);
8859 userData__typed->delegate(std::move(devices__vec));
8861 Discord_Client_GetOutputDevices(&instance_, cb__native, Tcb__UserData::Free, cb__userData);
8863float Client::GetOutputVolume()
8865 assert(state_ == DiscordObjectState::Owned);
8866 float returnValue__;
8867 returnValue__ = Discord_Client_GetOutputVolume(&instance_);
8868 return returnValue__;
8870bool Client::GetSelfDeafAll()
const
8872 assert(state_ == DiscordObjectState::Owned);
8874 returnValue__ = Discord_Client_GetSelfDeafAll(&instance_);
8875 return returnValue__;
8877bool Client::GetSelfMuteAll()
const
8879 assert(state_ == DiscordObjectState::Owned);
8881 returnValue__ = Discord_Client_GetSelfMuteAll(&instance_);
8882 return returnValue__;
8884void Client::SetAutomaticGainControl(
bool on)
8886 assert(state_ == DiscordObjectState::Owned);
8887 Discord_Client_SetAutomaticGainControl(&instance_, on);
8891 assert(state_ == DiscordObjectState::Owned);
8892 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
8893 auto callback__userData =
new Tcallback__UserData(callback);
8894 Discord_Client_DeviceChangeCallback callback__native =
8895 [](
auto inputDevices,
auto outputDevices,
void* userData__) {
8896 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
8897 std::vector<discordpp::AudioDevice> inputDevices__vec;
8898 inputDevices__vec.reserve(inputDevices.size);
8899 for (
size_t i__ = 0; i__ < inputDevices.size; ++i__) {
8900 inputDevices__vec.emplace_back(inputDevices.ptr[i__], DiscordObjectState::Owned);
8902 Discord_Free(inputDevices.ptr);
8903 std::vector<discordpp::AudioDevice> outputDevices__vec;
8904 outputDevices__vec.reserve(outputDevices.size);
8905 for (
size_t i__ = 0; i__ < outputDevices.size; ++i__) {
8906 outputDevices__vec.emplace_back(outputDevices.ptr[i__], DiscordObjectState::Owned);
8908 Discord_Free(outputDevices.ptr);
8909 userData__typed->delegate(std::move(inputDevices__vec), std::move(outputDevices__vec));
8911 Discord_Client_SetDeviceChangeCallback(
8912 &instance_, callback__native, Tcallback__UserData::Free, callback__userData);
8914void Client::SetEchoCancellation(
bool on)
8916 assert(state_ == DiscordObjectState::Owned);
8917 Discord_Client_SetEchoCancellation(&instance_, on);
8921 assert(state_ == DiscordObjectState::Owned);
8922 Discord_String deviceId__str{(uint8_t*)(deviceId.data()), deviceId.size()};
8923 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
8924 auto cb__userData =
new Tcb__UserData(cb);
8925 Discord_Client_SetInputDeviceCallback cb__native = [](
auto result,
void* userData__) {
8926 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
8928 userData__typed->delegate(std::move(result__obj));
8930 Discord_Client_SetInputDevice(
8931 &instance_, deviceId__str, cb__native, Tcb__UserData::Free, cb__userData);
8933void Client::SetInputVolume(
float inputVolume)
8935 assert(state_ == DiscordObjectState::Owned);
8936 Discord_Client_SetInputVolume(&instance_, inputVolume);
8940 assert(state_ == DiscordObjectState::Owned);
8941 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
8942 auto callback__userData =
new Tcallback__UserData(callback);
8943 Discord_Client_NoAudioInputCallback callback__native = [](
auto inputDetected,
8945 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
8946 userData__typed->delegate(inputDetected);
8948 Discord_Client_SetNoAudioInputCallback(
8949 &instance_, callback__native, Tcallback__UserData::Free, callback__userData);
8951void Client::SetNoAudioInputThreshold(
float dBFSThreshold)
8953 assert(state_ == DiscordObjectState::Owned);
8954 Discord_Client_SetNoAudioInputThreshold(&instance_, dBFSThreshold);
8956void Client::SetNoiseSuppression(
bool on)
8958 assert(state_ == DiscordObjectState::Owned);
8959 Discord_Client_SetNoiseSuppression(&instance_, on);
8961void Client::SetOpusHardwareCoding(
bool encode,
bool decode)
8963 assert(state_ == DiscordObjectState::Owned);
8964 Discord_Client_SetOpusHardwareCoding(&instance_, encode, decode);
8968 assert(state_ == DiscordObjectState::Owned);
8969 Discord_String deviceId__str{(uint8_t*)(deviceId.data()), deviceId.size()};
8970 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
8971 auto cb__userData =
new Tcb__UserData(cb);
8972 Discord_Client_SetOutputDeviceCallback cb__native = [](
auto result,
void* userData__) {
8973 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
8975 userData__typed->delegate(std::move(result__obj));
8977 Discord_Client_SetOutputDevice(
8978 &instance_, deviceId__str, cb__native, Tcb__UserData::Free, cb__userData);
8980void Client::SetOutputVolume(
float outputVolume)
8982 assert(state_ == DiscordObjectState::Owned);
8983 Discord_Client_SetOutputVolume(&instance_, outputVolume);
8985void Client::SetSelfDeafAll(
bool deaf)
8987 assert(state_ == DiscordObjectState::Owned);
8988 Discord_Client_SetSelfDeafAll(&instance_, deaf);
8990void Client::SetSelfMuteAll(
bool mute)
8992 assert(state_ == DiscordObjectState::Owned);
8993 Discord_Client_SetSelfMuteAll(&instance_, mute);
8995bool Client::SetSpeakerMode(
bool speakerMode)
8997 assert(state_ == DiscordObjectState::Owned);
8999 returnValue__ = Discord_Client_SetSpeakerMode(&instance_, speakerMode);
9000 return returnValue__;
9004 assert(state_ == DiscordObjectState::Owned);
9005 Discord_Client_SetThreadPriority(
9006 &instance_,
static_cast<Discord_Client_Thread
>(thread), priority);
9008void Client::SetVoiceParticipantChangedCallback(
9011 assert(state_ == DiscordObjectState::Owned);
9012 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
9013 auto cb__userData =
new Tcb__UserData(cb);
9014 Discord_Client_VoiceParticipantChangedCallback cb__native =
9015 [](
auto lobbyId,
auto memberId,
auto added,
void* userData__) {
9016 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
9017 userData__typed->delegate(lobbyId, memberId, added);
9019 Discord_Client_SetVoiceParticipantChangedCallback(
9020 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
9022bool Client::ShowAudioRoutePicker()
9024 assert(state_ == DiscordObjectState::Owned);
9026 returnValue__ = Discord_Client_ShowAudioRoutePicker(&instance_);
9027 return returnValue__;
9031 assert(state_ == DiscordObjectState::Owned);
9032 bool returnIsNonNull__;
9033 Discord_Call returnValueNative__{};
9034 returnIsNonNull__ = Discord_Client_StartCall(&instance_, channelId, &returnValueNative__);
9036 returnValueNative__,
9037 returnIsNonNull__ ? DiscordObjectState::Owned : DiscordObjectState::Invalid);
9038 return returnValue__;
9045 assert(state_ == DiscordObjectState::Owned);
9046 bool returnIsNonNull__;
9047 Discord_Call returnValueNative__{};
9048 using TreceivedCb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(receivedCb)>>;
9049 auto receivedCb__userData =
new TreceivedCb__UserData(receivedCb);
9050 Discord_Client_UserAudioReceivedCallback receivedCb__native = [](
auto userId,
9052 auto samplesPerChannel,
9057 auto userData__typed =
static_cast<TreceivedCb__UserData*
>(userData__);
9058 userData__typed->delegate(
9059 userId, data, samplesPerChannel, sampleRate, channels, *outShouldMute);
9061 using TcapturedCb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(capturedCb)>>;
9062 auto capturedCb__userData =
new TcapturedCb__UserData(capturedCb);
9063 Discord_Client_UserAudioCapturedCallback capturedCb__native =
9064 [](
auto data,
auto samplesPerChannel,
auto sampleRate,
auto channels,
void* userData__) {
9065 auto userData__typed =
static_cast<TcapturedCb__UserData*
>(userData__);
9066 userData__typed->delegate(data, samplesPerChannel, sampleRate, channels);
9068 returnIsNonNull__ = Discord_Client_StartCallWithAudioCallbacks(&instance_,
9071 TreceivedCb__UserData::Free,
9072 receivedCb__userData,
9074 TcapturedCb__UserData::Free,
9075 capturedCb__userData,
9076 &returnValueNative__);
9078 returnValueNative__,
9079 returnIsNonNull__ ? DiscordObjectState::Owned : DiscordObjectState::Invalid);
9080 return returnValue__;
9082void Client::AbortAuthorize()
9084 assert(state_ == DiscordObjectState::Owned);
9085 Discord_Client_AbortAuthorize(&instance_);
9087void Client::AbortGetTokenFromDevice()
9089 assert(state_ == DiscordObjectState::Owned);
9090 Discord_Client_AbortGetTokenFromDevice(&instance_);
9095 assert(state_ == DiscordObjectState::Owned);
9096 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
9097 auto callback__userData =
new Tcallback__UserData(callback);
9098 Discord_Client_AuthorizationCallback callback__native =
9099 [](
auto result,
auto code,
auto redirectUri,
void* userData__) {
9100 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
9102 std::string code__str(
reinterpret_cast<char*
>(code.ptr), code.size);
9103 std::string redirectUri__str(
reinterpret_cast<char*
>(redirectUri.ptr), redirectUri.size);
9104 userData__typed->delegate(
9105 std::move(result__obj), std::move(code__str), std::move(redirectUri__str));
9106 Discord_Free(redirectUri.ptr);
9107 Discord_Free(code.ptr);
9109 Discord_Client_Authorize(
9110 &instance_, args.instance(), callback__native, Tcallback__UserData::Free, callback__userData);
9112void Client::CloseAuthorizeDeviceScreen()
9114 assert(state_ == DiscordObjectState::Owned);
9115 Discord_Client_CloseAuthorizeDeviceScreen(&instance_);
9119 assert(state_ == DiscordObjectState::Owned);
9120 Discord_AuthorizationCodeVerifier returnValueNative__{};
9121 Discord_Client_CreateAuthorizationCodeVerifier(&instance_, &returnValueNative__);
9123 DiscordObjectState::Owned);
9124 return returnValue__;
9127 std::string
const& token,
9130 assert(state_ == DiscordObjectState::Owned);
9131 Discord_String token__str{(uint8_t*)(token.data()), token.size()};
9132 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
9133 auto callback__userData =
new Tcallback__UserData(callback);
9134 Discord_Client_FetchCurrentUserCallback callback__native =
9135 [](
auto result,
auto id,
auto name,
void* userData__) {
9136 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
9138 std::string name__str(
reinterpret_cast<char*
>(name.ptr), name.size);
9139 userData__typed->delegate(std::move(result__obj),
id, std::move(name__str));
9140 Discord_Free(name.ptr);
9142 Discord_Client_FetchCurrentUser(&instance_,
9143 static_cast<Discord_AuthorizationTokenType
>(tokenType),
9146 Tcallback__UserData::Free,
9147 callback__userData);
9149void Client::GetProvisionalToken(uint64_t applicationId,
9151 std::string
const& externalAuthToken,
9154 assert(state_ == DiscordObjectState::Owned);
9155 Discord_String externalAuthToken__str{(uint8_t*)(externalAuthToken.data()),
9156 externalAuthToken.size()};
9157 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
9158 auto callback__userData =
new Tcallback__UserData(callback);
9159 Discord_Client_TokenExchangeCallback callback__native = [](
auto result,
9166 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
9168 std::string accessToken__str(
reinterpret_cast<char*
>(accessToken.ptr), accessToken.size);
9169 std::string refreshToken__str(
reinterpret_cast<char*
>(refreshToken.ptr), refreshToken.size);
9170 std::string scopes__str(
reinterpret_cast<char*
>(scopes.ptr), scopes.size);
9171 userData__typed->delegate(std::move(result__obj),
9172 std::move(accessToken__str),
9173 std::move(refreshToken__str),
9176 std::move(scopes__str));
9177 Discord_Free(scopes.ptr);
9178 Discord_Free(refreshToken.ptr);
9179 Discord_Free(accessToken.ptr);
9181 Discord_Client_GetProvisionalToken(
9184 static_cast<Discord_AuthenticationExternalAuthType
>(externalAuthType),
9185 externalAuthToken__str,
9187 Tcallback__UserData::Free,
9188 callback__userData);
9190void Client::GetToken(uint64_t applicationId,
9191 std::string
const& code,
9192 std::string
const& codeVerifier,
9193 std::string
const& redirectUri,
9196 assert(state_ == DiscordObjectState::Owned);
9197 Discord_String code__str{(uint8_t*)(code.data()), code.size()};
9198 Discord_String codeVerifier__str{(uint8_t*)(codeVerifier.data()), codeVerifier.size()};
9199 Discord_String redirectUri__str{(uint8_t*)(redirectUri.data()), redirectUri.size()};
9200 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
9201 auto callback__userData =
new Tcallback__UserData(callback);
9202 Discord_Client_TokenExchangeCallback callback__native = [](
auto result,
9209 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
9211 std::string accessToken__str(
reinterpret_cast<char*
>(accessToken.ptr), accessToken.size);
9212 std::string refreshToken__str(
reinterpret_cast<char*
>(refreshToken.ptr), refreshToken.size);
9213 std::string scopes__str(
reinterpret_cast<char*
>(scopes.ptr), scopes.size);
9214 userData__typed->delegate(std::move(result__obj),
9215 std::move(accessToken__str),
9216 std::move(refreshToken__str),
9219 std::move(scopes__str));
9220 Discord_Free(scopes.ptr);
9221 Discord_Free(refreshToken.ptr);
9222 Discord_Free(accessToken.ptr);
9224 Discord_Client_GetToken(&instance_,
9230 Tcallback__UserData::Free,
9231 callback__userData);
9236 assert(state_ == DiscordObjectState::Owned);
9237 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
9238 auto callback__userData =
new Tcallback__UserData(callback);
9239 Discord_Client_TokenExchangeCallback callback__native = [](
auto result,
9246 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
9248 std::string accessToken__str(
reinterpret_cast<char*
>(accessToken.ptr), accessToken.size);
9249 std::string refreshToken__str(
reinterpret_cast<char*
>(refreshToken.ptr), refreshToken.size);
9250 std::string scopes__str(
reinterpret_cast<char*
>(scopes.ptr), scopes.size);
9251 userData__typed->delegate(std::move(result__obj),
9252 std::move(accessToken__str),
9253 std::move(refreshToken__str),
9256 std::move(scopes__str));
9257 Discord_Free(scopes.ptr);
9258 Discord_Free(refreshToken.ptr);
9259 Discord_Free(accessToken.ptr);
9261 Discord_Client_GetTokenFromDevice(
9262 &instance_, args.instance(), callback__native, Tcallback__UserData::Free, callback__userData);
9264void Client::GetTokenFromDeviceProvisionalMerge(
9267 std::string
const& externalAuthToken,
9270 assert(state_ == DiscordObjectState::Owned);
9271 Discord_String externalAuthToken__str{(uint8_t*)(externalAuthToken.data()),
9272 externalAuthToken.size()};
9273 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
9274 auto callback__userData =
new Tcallback__UserData(callback);
9275 Discord_Client_TokenExchangeCallback callback__native = [](
auto result,
9282 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
9284 std::string accessToken__str(
reinterpret_cast<char*
>(accessToken.ptr), accessToken.size);
9285 std::string refreshToken__str(
reinterpret_cast<char*
>(refreshToken.ptr), refreshToken.size);
9286 std::string scopes__str(
reinterpret_cast<char*
>(scopes.ptr), scopes.size);
9287 userData__typed->delegate(std::move(result__obj),
9288 std::move(accessToken__str),
9289 std::move(refreshToken__str),
9292 std::move(scopes__str));
9293 Discord_Free(scopes.ptr);
9294 Discord_Free(refreshToken.ptr);
9295 Discord_Free(accessToken.ptr);
9297 Discord_Client_GetTokenFromDeviceProvisionalMerge(
9300 static_cast<Discord_AuthenticationExternalAuthType
>(externalAuthType),
9301 externalAuthToken__str,
9303 Tcallback__UserData::Free,
9304 callback__userData);
9306void Client::GetTokenFromProvisionalMerge(
9307 uint64_t applicationId,
9308 std::string
const& code,
9309 std::string
const& codeVerifier,
9310 std::string
const& redirectUri,
9312 std::string
const& externalAuthToken,
9315 assert(state_ == DiscordObjectState::Owned);
9316 Discord_String code__str{(uint8_t*)(code.data()), code.size()};
9317 Discord_String codeVerifier__str{(uint8_t*)(codeVerifier.data()), codeVerifier.size()};
9318 Discord_String redirectUri__str{(uint8_t*)(redirectUri.data()), redirectUri.size()};
9319 Discord_String externalAuthToken__str{(uint8_t*)(externalAuthToken.data()),
9320 externalAuthToken.size()};
9321 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
9322 auto callback__userData =
new Tcallback__UserData(callback);
9323 Discord_Client_TokenExchangeCallback callback__native = [](
auto result,
9330 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
9332 std::string accessToken__str(
reinterpret_cast<char*
>(accessToken.ptr), accessToken.size);
9333 std::string refreshToken__str(
reinterpret_cast<char*
>(refreshToken.ptr), refreshToken.size);
9334 std::string scopes__str(
reinterpret_cast<char*
>(scopes.ptr), scopes.size);
9335 userData__typed->delegate(std::move(result__obj),
9336 std::move(accessToken__str),
9337 std::move(refreshToken__str),
9340 std::move(scopes__str));
9341 Discord_Free(scopes.ptr);
9342 Discord_Free(refreshToken.ptr);
9343 Discord_Free(accessToken.ptr);
9345 Discord_Client_GetTokenFromProvisionalMerge(
9351 static_cast<Discord_AuthenticationExternalAuthType
>(externalAuthType),
9352 externalAuthToken__str,
9354 Tcallback__UserData::Free,
9355 callback__userData);
9357bool Client::IsAuthenticated()
9359 assert(state_ == DiscordObjectState::Owned);
9361 returnValue__ = Discord_Client_IsAuthenticated(&instance_);
9362 return returnValue__;
9364void Client::OpenAuthorizeDeviceScreen(uint64_t clientId, std::string
const& userCode)
9366 assert(state_ == DiscordObjectState::Owned);
9367 Discord_String userCode__str{(uint8_t*)(userCode.data()), userCode.size()};
9368 Discord_Client_OpenAuthorizeDeviceScreen(&instance_, clientId, userCode__str);
9370void Client::ProvisionalUserMergeCompleted(
bool success)
9372 assert(state_ == DiscordObjectState::Owned);
9373 Discord_Client_ProvisionalUserMergeCompleted(&instance_, success);
9375void Client::RefreshToken(uint64_t applicationId,
9376 std::string
const& refreshToken,
9379 assert(state_ == DiscordObjectState::Owned);
9380 Discord_String refreshToken__str{(uint8_t*)(refreshToken.data()), refreshToken.size()};
9381 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
9382 auto callback__userData =
new Tcallback__UserData(callback);
9383 Discord_Client_TokenExchangeCallback callback__native = [](
auto result,
9390 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
9392 std::string accessToken__str(
reinterpret_cast<char*
>(accessToken.ptr), accessToken.size);
9393 std::string refreshToken__str(
reinterpret_cast<char*
>(refreshToken.ptr), refreshToken.size);
9394 std::string scopes__str(
reinterpret_cast<char*
>(scopes.ptr), scopes.size);
9395 userData__typed->delegate(std::move(result__obj),
9396 std::move(accessToken__str),
9397 std::move(refreshToken__str),
9400 std::move(scopes__str));
9401 Discord_Free(scopes.ptr);
9402 Discord_Free(refreshToken.ptr);
9403 Discord_Free(accessToken.ptr);
9405 Discord_Client_RefreshToken(&instance_,
9409 Tcallback__UserData::Free,
9410 callback__userData);
9412void Client::SetAuthorizeDeviceScreenClosedCallback(
9415 assert(state_ == DiscordObjectState::Owned);
9416 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
9417 auto cb__userData =
new Tcb__UserData(cb);
9418 Discord_Client_AuthorizeDeviceScreenClosedCallback cb__native = [](
void* userData__) {
9419 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
9420 userData__typed->delegate();
9422 Discord_Client_SetAuthorizeDeviceScreenClosedCallback(
9423 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
9425void Client::SetGameWindowPid(int32_t pid)
9427 assert(state_ == DiscordObjectState::Owned);
9428 Discord_Client_SetGameWindowPid(&instance_, pid);
9432 assert(state_ == DiscordObjectState::Owned);
9433 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
9434 auto callback__userData =
new Tcallback__UserData(callback);
9435 Discord_Client_TokenExpirationCallback callback__native = [](
void* userData__) {
9436 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
9437 userData__typed->delegate();
9439 Discord_Client_SetTokenExpirationCallback(
9440 &instance_, callback__native, Tcallback__UserData::Free, callback__userData);
9442void Client::UpdateProvisionalAccountDisplayName(
9443 std::string
const& name,
9446 assert(state_ == DiscordObjectState::Owned);
9447 Discord_String name__str{(uint8_t*)(name.data()), name.size()};
9448 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
9449 auto callback__userData =
new Tcallback__UserData(callback);
9450 Discord_Client_UpdateProvisionalAccountDisplayNameCallback callback__native =
9451 [](
auto result,
void* userData__) {
9452 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
9454 userData__typed->delegate(std::move(result__obj));
9456 Discord_Client_UpdateProvisionalAccountDisplayName(
9457 &instance_, name__str, callback__native, Tcallback__UserData::Free, callback__userData);
9463 assert(state_ == DiscordObjectState::Owned);
9464 Discord_String token__str{(uint8_t*)(token.data()), token.size()};
9465 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
9466 auto callback__userData =
new Tcallback__UserData(callback);
9467 Discord_Client_UpdateTokenCallback callback__native = [](
auto result,
void* userData__) {
9468 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
9470 userData__typed->delegate(std::move(result__obj));
9472 Discord_Client_UpdateToken(&instance_,
9473 static_cast<Discord_AuthorizationTokenType
>(tokenType),
9476 Tcallback__UserData::Free,
9477 callback__userData);
9479bool Client::CanOpenMessageInDiscord(uint64_t messageId)
9481 assert(state_ == DiscordObjectState::Owned);
9483 returnValue__ = Discord_Client_CanOpenMessageInDiscord(&instance_, messageId);
9484 return returnValue__;
9486void Client::DeleteUserMessage(uint64_t recipientId,
9490 assert(state_ == DiscordObjectState::Owned);
9491 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
9492 auto cb__userData =
new Tcb__UserData(cb);
9493 Discord_Client_DeleteUserMessageCallback cb__native = [](
auto result,
void* userData__) {
9494 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
9496 userData__typed->delegate(std::move(result__obj));
9498 Discord_Client_DeleteUserMessage(
9499 &instance_, recipientId, messageId, cb__native, Tcb__UserData::Free, cb__userData);
9501void Client::EditUserMessage(uint64_t recipientId,
9503 std::string
const& content,
9506 assert(state_ == DiscordObjectState::Owned);
9507 Discord_String content__str{(uint8_t*)(content.data()), content.size()};
9508 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
9509 auto cb__userData =
new Tcb__UserData(cb);
9510 Discord_Client_EditUserMessageCallback cb__native = [](
auto result,
void* userData__) {
9511 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
9513 userData__typed->delegate(std::move(result__obj));
9515 Discord_Client_EditUserMessage(&instance_,
9520 Tcb__UserData::Free,
9523std::optional<discordpp::ChannelHandle> Client::GetChannelHandle(uint64_t channelId)
const
9525 assert(state_ == DiscordObjectState::Owned);
9526 bool returnIsNonNull__;
9527 Discord_ChannelHandle returnValueNative__;
9529 Discord_Client_GetChannelHandle(&instance_, channelId, &returnValueNative__);
9530 if (!returnIsNonNull__) {
9534 return returnValue__;
9536std::optional<discordpp::MessageHandle> Client::GetMessageHandle(uint64_t messageId)
const
9538 assert(state_ == DiscordObjectState::Owned);
9539 bool returnIsNonNull__;
9540 Discord_MessageHandle returnValueNative__;
9542 Discord_Client_GetMessageHandle(&instance_, messageId, &returnValueNative__);
9543 if (!returnIsNonNull__) {
9547 return returnValue__;
9549void Client::OpenMessageInDiscord(
9554 assert(state_ == DiscordObjectState::Owned);
9555 using TprovisionalUserMergeRequiredCallback__UserData =
9556 TDelegateUserData<std::remove_reference_t<
decltype(provisionalUserMergeRequiredCallback)>>;
9557 auto provisionalUserMergeRequiredCallback__userData =
9558 new TprovisionalUserMergeRequiredCallback__UserData(provisionalUserMergeRequiredCallback);
9559 Discord_Client_ProvisionalUserMergeRequiredCallback
9560 provisionalUserMergeRequiredCallback__native = [](
void* userData__) {
9561 auto userData__typed =
9562 static_cast<TprovisionalUserMergeRequiredCallback__UserData*
>(userData__);
9563 userData__typed->delegate();
9565 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
9566 auto callback__userData =
new Tcallback__UserData(callback);
9567 Discord_Client_OpenMessageInDiscordCallback callback__native = [](
auto result,
9569 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
9571 userData__typed->delegate(std::move(result__obj));
9573 Discord_Client_OpenMessageInDiscord(&instance_,
9575 provisionalUserMergeRequiredCallback__native,
9576 TprovisionalUserMergeRequiredCallback__UserData::Free,
9577 provisionalUserMergeRequiredCallback__userData,
9579 Tcallback__UserData::Free,
9580 callback__userData);
9582void Client::SendLobbyMessage(uint64_t lobbyId,
9583 std::string
const& content,
9586 assert(state_ == DiscordObjectState::Owned);
9587 Discord_String content__str{(uint8_t*)(content.data()), content.size()};
9588 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
9589 auto cb__userData =
new Tcb__UserData(cb);
9590 Discord_Client_SendUserMessageCallback cb__native =
9591 [](
auto result,
auto messageId,
void* userData__) {
9592 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
9594 userData__typed->delegate(std::move(result__obj), messageId);
9596 Discord_Client_SendLobbyMessage(
9597 &instance_, lobbyId, content__str, cb__native, Tcb__UserData::Free, cb__userData);
9599void Client::SendLobbyMessageWithMetadata(
9601 std::string
const& content,
9602 std::unordered_map<std::string, std::string>
const& metadata,
9605 assert(state_ == DiscordObjectState::Owned);
9606 Discord_String content__str{(uint8_t*)(content.data()), content.size()};
9607 ConvertedProperties metadata__convert(metadata);
9608 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
9609 auto cb__userData =
new Tcb__UserData(cb);
9610 Discord_Client_SendUserMessageCallback cb__native =
9611 [](
auto result,
auto messageId,
void* userData__) {
9612 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
9614 userData__typed->delegate(std::move(result__obj), messageId);
9616 Discord_Client_SendLobbyMessageWithMetadata(&instance_,
9619 metadata__convert.Properties,
9621 Tcb__UserData::Free,
9624void Client::SendUserMessage(uint64_t recipientId,
9625 std::string
const& content,
9628 assert(state_ == DiscordObjectState::Owned);
9629 Discord_String content__str{(uint8_t*)(content.data()), content.size()};
9630 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
9631 auto cb__userData =
new Tcb__UserData(cb);
9632 Discord_Client_SendUserMessageCallback cb__native =
9633 [](
auto result,
auto messageId,
void* userData__) {
9634 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
9636 userData__typed->delegate(std::move(result__obj), messageId);
9638 Discord_Client_SendUserMessage(
9639 &instance_, recipientId, content__str, cb__native, Tcb__UserData::Free, cb__userData);
9641void Client::SendUserMessageWithMetadata(
9642 uint64_t recipientId,
9643 std::string
const& content,
9644 std::unordered_map<std::string, std::string>
const& metadata,
9647 assert(state_ == DiscordObjectState::Owned);
9648 Discord_String content__str{(uint8_t*)(content.data()), content.size()};
9649 ConvertedProperties metadata__convert(metadata);
9650 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
9651 auto cb__userData =
new Tcb__UserData(cb);
9652 Discord_Client_SendUserMessageCallback cb__native =
9653 [](
auto result,
auto messageId,
void* userData__) {
9654 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
9656 userData__typed->delegate(std::move(result__obj), messageId);
9658 Discord_Client_SendUserMessageWithMetadata(&instance_,
9661 metadata__convert.Properties,
9663 Tcb__UserData::Free,
9668 assert(state_ == DiscordObjectState::Owned);
9669 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
9670 auto cb__userData =
new Tcb__UserData(cb);
9671 Discord_Client_MessageCreatedCallback cb__native = [](
auto messageId,
void* userData__) {
9672 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
9673 userData__typed->delegate(messageId);
9675 Discord_Client_SetMessageCreatedCallback(
9676 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
9680 assert(state_ == DiscordObjectState::Owned);
9681 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
9682 auto cb__userData =
new Tcb__UserData(cb);
9683 Discord_Client_MessageDeletedCallback cb__native =
9684 [](
auto messageId,
auto channelId,
void* userData__) {
9685 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
9686 userData__typed->delegate(messageId, channelId);
9688 Discord_Client_SetMessageDeletedCallback(
9689 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
9693 assert(state_ == DiscordObjectState::Owned);
9694 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
9695 auto cb__userData =
new Tcb__UserData(cb);
9696 Discord_Client_MessageUpdatedCallback cb__native = [](
auto messageId,
void* userData__) {
9697 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
9698 userData__typed->delegate(messageId);
9700 Discord_Client_SetMessageUpdatedCallback(
9701 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
9703void Client::SetShowingChat(
bool showingChat)
9705 assert(state_ == DiscordObjectState::Owned);
9706 Discord_Client_SetShowingChat(&instance_, showingChat);
9711 assert(state_ == DiscordObjectState::Owned);
9712 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
9713 auto callback__userData =
new Tcallback__UserData(callback);
9714 Discord_Client_LogCallback callback__native = [](
9715 auto message,
auto severity,
void* userData__) {
9716 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
9717 std::string message__str(
reinterpret_cast<char*
>(message.ptr), message.size);
9718 userData__typed->delegate(std::move(message__str),
9720 Discord_Free(message.ptr);
9722 Discord_Client_AddLogCallback(&instance_,
9724 Tcallback__UserData::Free,
9726 static_cast<Discord_LoggingSeverity
>(minSeverity));
9731 assert(state_ == DiscordObjectState::Owned);
9732 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
9733 auto callback__userData =
new Tcallback__UserData(callback);
9734 Discord_Client_LogCallback callback__native = [](
9735 auto message,
auto severity,
void* userData__) {
9736 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
9737 std::string message__str(
reinterpret_cast<char*
>(message.ptr), message.size);
9738 userData__typed->delegate(std::move(message__str),
9740 Discord_Free(message.ptr);
9742 Discord_Client_AddVoiceLogCallback(&instance_,
9744 Tcallback__UserData::Free,
9746 static_cast<Discord_LoggingSeverity
>(minSeverity));
9748void Client::Connect()
9750 assert(state_ == DiscordObjectState::Owned);
9751 Discord_Client_Connect(&instance_);
9753void Client::Disconnect()
9755 assert(state_ == DiscordObjectState::Owned);
9756 Discord_Client_Disconnect(&instance_);
9760 assert(state_ == DiscordObjectState::Owned);
9761 Discord_Client_Status returnValue__;
9762 returnValue__ = Discord_Client_GetStatus(&instance_);
9765void Client::SetApplicationId(uint64_t applicationId)
9767 assert(state_ == DiscordObjectState::Owned);
9768 Discord_Client_SetApplicationId(&instance_, applicationId);
9772 assert(state_ == DiscordObjectState::Owned);
9774 Discord_String path__str{(uint8_t*)(path.data()), path.size()};
9775 returnValue__ = Discord_Client_SetLogDir(
9776 &instance_, path__str,
static_cast<Discord_LoggingSeverity
>(minSeverity));
9777 return returnValue__;
9781 assert(state_ == DiscordObjectState::Owned);
9782 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
9783 auto cb__userData =
new Tcb__UserData(cb);
9784 Discord_Client_OnStatusChanged cb__native =
9785 [](
auto status,
auto error,
auto errorDetail,
void* userData__) {
9786 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
9791 Discord_Client_SetStatusChangedCallback(
9792 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
9796 assert(state_ == DiscordObjectState::Owned);
9797 Discord_String path__str{(uint8_t*)(path.data()), path.size()};
9798 Discord_Client_SetVoiceLogDir(
9799 &instance_, path__str,
static_cast<Discord_LoggingSeverity
>(minSeverity));
9801void Client::CreateOrJoinLobby(std::string
const& secret,
9804 assert(state_ == DiscordObjectState::Owned);
9805 Discord_String secret__str{(uint8_t*)(secret.data()), secret.size()};
9806 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
9807 auto callback__userData =
new Tcallback__UserData(callback);
9808 Discord_Client_CreateOrJoinLobbyCallback callback__native =
9809 [](
auto result,
auto lobbyId,
void* userData__) {
9810 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
9812 userData__typed->delegate(std::move(result__obj), lobbyId);
9814 Discord_Client_CreateOrJoinLobby(
9815 &instance_, secret__str, callback__native, Tcallback__UserData::Free, callback__userData);
9817void Client::CreateOrJoinLobbyWithMetadata(
9818 std::string
const& secret,
9819 std::unordered_map<std::string, std::string>
const& lobbyMetadata,
9820 std::unordered_map<std::string, std::string>
const& memberMetadata,
9823 assert(state_ == DiscordObjectState::Owned);
9824 Discord_String secret__str{(uint8_t*)(secret.data()), secret.size()};
9825 ConvertedProperties lobbyMetadata__convert(lobbyMetadata);
9826 ConvertedProperties memberMetadata__convert(memberMetadata);
9827 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
9828 auto callback__userData =
new Tcallback__UserData(callback);
9829 Discord_Client_CreateOrJoinLobbyCallback callback__native =
9830 [](
auto result,
auto lobbyId,
void* userData__) {
9831 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
9833 userData__typed->delegate(std::move(result__obj), lobbyId);
9835 Discord_Client_CreateOrJoinLobbyWithMetadata(&instance_,
9837 lobbyMetadata__convert.Properties,
9838 memberMetadata__convert.Properties,
9840 Tcallback__UserData::Free,
9841 callback__userData);
9845 assert(state_ == DiscordObjectState::Owned);
9846 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
9847 auto cb__userData =
new Tcb__UserData(cb);
9848 Discord_Client_GetGuildChannelsCallback cb__native =
9849 [](
auto result,
auto guildChannels,
void* userData__) {
9850 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
9852 std::vector<discordpp::GuildChannel> guildChannels__vec;
9853 guildChannels__vec.reserve(guildChannels.size);
9854 for (
size_t i__ = 0; i__ < guildChannels.size; ++i__) {
9855 guildChannels__vec.emplace_back(guildChannels.ptr[i__], DiscordObjectState::Owned);
9857 Discord_Free(guildChannels.ptr);
9858 userData__typed->delegate(std::move(result__obj), std::move(guildChannels__vec));
9860 Discord_Client_GetGuildChannels(
9861 &instance_, guildId, cb__native, Tcb__UserData::Free, cb__userData);
9863std::optional<discordpp::LobbyHandle> Client::GetLobbyHandle(uint64_t lobbyId)
const
9865 assert(state_ == DiscordObjectState::Owned);
9866 bool returnIsNonNull__;
9867 Discord_LobbyHandle returnValueNative__;
9868 returnIsNonNull__ = Discord_Client_GetLobbyHandle(&instance_, lobbyId, &returnValueNative__);
9869 if (!returnIsNonNull__) {
9873 return returnValue__;
9875std::vector<uint64_t> Client::GetLobbyIds()
const
9877 assert(state_ == DiscordObjectState::Owned);
9878 Discord_UInt64Span returnValueNative__;
9879 Discord_Client_GetLobbyIds(&instance_, &returnValueNative__);
9880 std::vector<uint64_t> returnValue__(returnValueNative__.ptr,
9881 returnValueNative__.ptr + returnValueNative__.size);
9882 Discord_Free(returnValueNative__.ptr);
9883 return returnValue__;
9887 assert(state_ == DiscordObjectState::Owned);
9888 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
9889 auto cb__userData =
new Tcb__UserData(cb);
9890 Discord_Client_GetUserGuildsCallback cb__native =
9891 [](
auto result,
auto guilds,
void* userData__) {
9892 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
9894 std::vector<discordpp::GuildMinimal> guilds__vec;
9895 guilds__vec.reserve(guilds.size);
9896 for (
size_t i__ = 0; i__ < guilds.size; ++i__) {
9897 guilds__vec.emplace_back(guilds.ptr[i__], DiscordObjectState::Owned);
9899 Discord_Free(guilds.ptr);
9900 userData__typed->delegate(std::move(result__obj), std::move(guilds__vec));
9902 Discord_Client_GetUserGuilds(&instance_, cb__native, Tcb__UserData::Free, cb__userData);
9906 assert(state_ == DiscordObjectState::Owned);
9907 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
9908 auto callback__userData =
new Tcallback__UserData(callback);
9909 Discord_Client_LeaveLobbyCallback callback__native = [](
auto result,
void* userData__) {
9910 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
9912 userData__typed->delegate(std::move(result__obj));
9914 Discord_Client_LeaveLobby(
9915 &instance_, lobbyId, callback__native, Tcallback__UserData::Free, callback__userData);
9917void Client::LinkChannelToLobby(uint64_t lobbyId,
9921 assert(state_ == DiscordObjectState::Owned);
9922 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
9923 auto callback__userData =
new Tcallback__UserData(callback);
9924 Discord_Client_LinkOrUnlinkChannelCallback callback__native = [](
auto result,
9926 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
9928 userData__typed->delegate(std::move(result__obj));
9930 Discord_Client_LinkChannelToLobby(&instance_,
9934 Tcallback__UserData::Free,
9935 callback__userData);
9939 assert(state_ == DiscordObjectState::Owned);
9940 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
9941 auto cb__userData =
new Tcb__UserData(cb);
9942 Discord_Client_LobbyCreatedCallback cb__native = [](
auto lobbyId,
void* userData__) {
9943 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
9944 userData__typed->delegate(lobbyId);
9946 Discord_Client_SetLobbyCreatedCallback(
9947 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
9951 assert(state_ == DiscordObjectState::Owned);
9952 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
9953 auto cb__userData =
new Tcb__UserData(cb);
9954 Discord_Client_LobbyDeletedCallback cb__native = [](
auto lobbyId,
void* userData__) {
9955 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
9956 userData__typed->delegate(lobbyId);
9958 Discord_Client_SetLobbyDeletedCallback(
9959 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
9963 assert(state_ == DiscordObjectState::Owned);
9964 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
9965 auto cb__userData =
new Tcb__UserData(cb);
9966 Discord_Client_LobbyMemberAddedCallback cb__native =
9967 [](
auto lobbyId,
auto memberId,
void* userData__) {
9968 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
9969 userData__typed->delegate(lobbyId, memberId);
9971 Discord_Client_SetLobbyMemberAddedCallback(
9972 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
9976 assert(state_ == DiscordObjectState::Owned);
9977 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
9978 auto cb__userData =
new Tcb__UserData(cb);
9979 Discord_Client_LobbyMemberRemovedCallback cb__native =
9980 [](
auto lobbyId,
auto memberId,
void* userData__) {
9981 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
9982 userData__typed->delegate(lobbyId, memberId);
9984 Discord_Client_SetLobbyMemberRemovedCallback(
9985 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
9989 assert(state_ == DiscordObjectState::Owned);
9990 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
9991 auto cb__userData =
new Tcb__UserData(cb);
9992 Discord_Client_LobbyMemberUpdatedCallback cb__native =
9993 [](
auto lobbyId,
auto memberId,
void* userData__) {
9994 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
9995 userData__typed->delegate(lobbyId, memberId);
9997 Discord_Client_SetLobbyMemberUpdatedCallback(
9998 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
10002 assert(state_ == DiscordObjectState::Owned);
10003 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10004 auto cb__userData =
new Tcb__UserData(cb);
10005 Discord_Client_LobbyUpdatedCallback cb__native = [](
auto lobbyId,
void* userData__) {
10006 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10007 userData__typed->delegate(lobbyId);
10009 Discord_Client_SetLobbyUpdatedCallback(
10010 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
10012void Client::UnlinkChannelFromLobby(uint64_t lobbyId,
10015 assert(state_ == DiscordObjectState::Owned);
10016 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
10017 auto callback__userData =
new Tcallback__UserData(callback);
10018 Discord_Client_LinkOrUnlinkChannelCallback callback__native = [](
auto result,
10019 void* userData__) {
10020 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
10022 userData__typed->delegate(std::move(result__obj));
10024 Discord_Client_UnlinkChannelFromLobby(
10025 &instance_, lobbyId, callback__native, Tcallback__UserData::Free, callback__userData);
10030 assert(state_ == DiscordObjectState::Owned);
10031 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10032 auto cb__userData =
new Tcb__UserData(cb);
10033 Discord_Client_AcceptActivityInviteCallback cb__native =
10034 [](
auto result,
auto joinSecret,
void* userData__) {
10035 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10037 std::string joinSecret__str(
reinterpret_cast<char*
>(joinSecret.ptr), joinSecret.size);
10038 userData__typed->delegate(std::move(result__obj), std::move(joinSecret__str));
10039 Discord_Free(joinSecret.ptr);
10041 Discord_Client_AcceptActivityInvite(
10042 &instance_, invite.instance(), cb__native, Tcb__UserData::Free, cb__userData);
10044void Client::ClearRichPresence()
10046 assert(state_ == DiscordObjectState::Owned);
10047 Discord_Client_ClearRichPresence(&instance_);
10049bool Client::RegisterLaunchCommand(uint64_t applicationId, std::string command)
10051 assert(state_ == DiscordObjectState::Owned);
10052 bool returnValue__;
10053 Discord_String command__str{(uint8_t*)(command.data()), command.size()};
10054 returnValue__ = Discord_Client_RegisterLaunchCommand(&instance_, applicationId, command__str);
10055 return returnValue__;
10057bool Client::RegisterLaunchSteamApplication(uint64_t applicationId, uint32_t steamAppId)
10059 assert(state_ == DiscordObjectState::Owned);
10060 bool returnValue__;
10062 Discord_Client_RegisterLaunchSteamApplication(&instance_, applicationId, steamAppId);
10063 return returnValue__;
10065void Client::SendActivityInvite(uint64_t userId,
10066 std::string
const& content,
10069 assert(state_ == DiscordObjectState::Owned);
10070 Discord_String content__str{(uint8_t*)(content.data()), content.size()};
10071 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10072 auto cb__userData =
new Tcb__UserData(cb);
10073 Discord_Client_SendActivityInviteCallback cb__native = [](
auto result,
void* userData__) {
10074 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10076 userData__typed->delegate(std::move(result__obj));
10078 Discord_Client_SendActivityInvite(
10079 &instance_, userId, content__str, cb__native, Tcb__UserData::Free, cb__userData);
10081void Client::SendActivityJoinRequest(uint64_t userId,
10084 assert(state_ == DiscordObjectState::Owned);
10085 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10086 auto cb__userData =
new Tcb__UserData(cb);
10087 Discord_Client_SendActivityInviteCallback cb__native = [](
auto result,
void* userData__) {
10088 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10090 userData__typed->delegate(std::move(result__obj));
10092 Discord_Client_SendActivityJoinRequest(
10093 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
10098 assert(state_ == DiscordObjectState::Owned);
10099 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10100 auto cb__userData =
new Tcb__UserData(cb);
10101 Discord_Client_SendActivityInviteCallback cb__native = [](
auto result,
void* userData__) {
10102 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10104 userData__typed->delegate(std::move(result__obj));
10106 Discord_Client_SendActivityJoinRequestReply(
10107 &instance_, invite.instance(), cb__native, Tcb__UserData::Free, cb__userData);
10111 assert(state_ == DiscordObjectState::Owned);
10112 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10113 auto cb__userData =
new Tcb__UserData(cb);
10114 Discord_Client_ActivityInviteCallback cb__native = [](
auto invite,
void* userData__) {
10115 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10117 userData__typed->delegate(std::move(invite__obj));
10119 Discord_Client_SetActivityInviteCreatedCallback(
10120 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
10124 assert(state_ == DiscordObjectState::Owned);
10125 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10126 auto cb__userData =
new Tcb__UserData(cb);
10127 Discord_Client_ActivityInviteCallback cb__native = [](
auto invite,
void* userData__) {
10128 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10130 userData__typed->delegate(std::move(invite__obj));
10132 Discord_Client_SetActivityInviteUpdatedCallback(
10133 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
10137 assert(state_ == DiscordObjectState::Owned);
10138 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10139 auto cb__userData =
new Tcb__UserData(cb);
10140 Discord_Client_ActivityJoinCallback cb__native = [](
auto joinSecret,
void* userData__) {
10141 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10142 std::string joinSecret__str(
reinterpret_cast<char*
>(joinSecret.ptr), joinSecret.size);
10143 userData__typed->delegate(std::move(joinSecret__str));
10144 Discord_Free(joinSecret.ptr);
10146 Discord_Client_SetActivityJoinCallback(
10147 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
10152 assert(state_ == DiscordObjectState::Owned);
10153 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
10154 auto callback__userData =
new Tcallback__UserData(callback);
10155 Discord_Client_UpdateStatusCallback callback__native = [](
auto result,
void* userData__) {
10156 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
10158 userData__typed->delegate(std::move(result__obj));
10160 Discord_Client_SetOnlineStatus(&instance_,
10161 static_cast<Discord_StatusType
>(status),
10163 Tcallback__UserData::Free,
10164 callback__userData);
10169 assert(state_ == DiscordObjectState::Owned);
10170 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10171 auto cb__userData =
new Tcb__UserData(cb);
10172 Discord_Client_UpdateRichPresenceCallback cb__native = [](
auto result,
void* userData__) {
10173 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10175 userData__typed->delegate(std::move(result__obj));
10177 Discord_Client_UpdateRichPresence(
10178 &instance_, activity.instance(), cb__native, Tcb__UserData::Free, cb__userData);
10180void Client::AcceptDiscordFriendRequest(uint64_t userId,
10183 assert(state_ == DiscordObjectState::Owned);
10184 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10185 auto cb__userData =
new Tcb__UserData(cb);
10186 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
10187 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10189 userData__typed->delegate(std::move(result__obj));
10191 Discord_Client_AcceptDiscordFriendRequest(
10192 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
10194void Client::AcceptGameFriendRequest(uint64_t userId,
10197 assert(state_ == DiscordObjectState::Owned);
10198 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10199 auto cb__userData =
new Tcb__UserData(cb);
10200 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
10201 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10203 userData__typed->delegate(std::move(result__obj));
10205 Discord_Client_AcceptGameFriendRequest(
10206 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
10210 assert(state_ == DiscordObjectState::Owned);
10211 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10212 auto cb__userData =
new Tcb__UserData(cb);
10213 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
10214 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10216 userData__typed->delegate(std::move(result__obj));
10218 Discord_Client_BlockUser(&instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
10220void Client::CancelDiscordFriendRequest(uint64_t userId,
10223 assert(state_ == DiscordObjectState::Owned);
10224 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10225 auto cb__userData =
new Tcb__UserData(cb);
10226 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
10227 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10229 userData__typed->delegate(std::move(result__obj));
10231 Discord_Client_CancelDiscordFriendRequest(
10232 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
10234void Client::CancelGameFriendRequest(uint64_t userId,
10237 assert(state_ == DiscordObjectState::Owned);
10238 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10239 auto cb__userData =
new Tcb__UserData(cb);
10240 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
10241 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10243 userData__typed->delegate(std::move(result__obj));
10245 Discord_Client_CancelGameFriendRequest(
10246 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
10250 assert(state_ == DiscordObjectState::Owned);
10251 Discord_RelationshipHandle returnValueNative__{};
10252 Discord_Client_GetRelationshipHandle(&instance_, userId, &returnValueNative__);
10254 return returnValue__;
10256std::vector<discordpp::RelationshipHandle> Client::GetRelationships()
const
10258 assert(state_ == DiscordObjectState::Owned);
10259 Discord_RelationshipHandleSpan returnValueNative__;
10260 Discord_Client_GetRelationships(&instance_, &returnValueNative__);
10261 std::vector<discordpp::RelationshipHandle> returnValue__;
10262 returnValue__.reserve(returnValueNative__.size);
10263 for (
size_t i__ = 0; i__ < returnValueNative__.size; ++i__) {
10264 returnValue__.emplace_back(returnValueNative__.ptr[i__], DiscordObjectState::Owned);
10266 Discord_Free(returnValueNative__.ptr);
10267 return returnValue__;
10269void Client::RejectDiscordFriendRequest(uint64_t userId,
10272 assert(state_ == DiscordObjectState::Owned);
10273 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10274 auto cb__userData =
new Tcb__UserData(cb);
10275 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
10276 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10278 userData__typed->delegate(std::move(result__obj));
10280 Discord_Client_RejectDiscordFriendRequest(
10281 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
10283void Client::RejectGameFriendRequest(uint64_t userId,
10286 assert(state_ == DiscordObjectState::Owned);
10287 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10288 auto cb__userData =
new Tcb__UserData(cb);
10289 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
10290 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10292 userData__typed->delegate(std::move(result__obj));
10294 Discord_Client_RejectGameFriendRequest(
10295 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
10297void Client::RemoveDiscordAndGameFriend(uint64_t userId,
10300 assert(state_ == DiscordObjectState::Owned);
10301 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10302 auto cb__userData =
new Tcb__UserData(cb);
10303 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
10304 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10306 userData__typed->delegate(std::move(result__obj));
10308 Discord_Client_RemoveDiscordAndGameFriend(
10309 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
10313 assert(state_ == DiscordObjectState::Owned);
10314 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10315 auto cb__userData =
new Tcb__UserData(cb);
10316 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
10317 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10319 userData__typed->delegate(std::move(result__obj));
10321 Discord_Client_RemoveGameFriend(
10322 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
10324std::vector<discordpp::UserHandle> Client::SearchFriendsByUsername(std::string searchStr)
const
10326 assert(state_ == DiscordObjectState::Owned);
10327 Discord_UserHandleSpan returnValueNative__;
10328 Discord_String searchStr__str{(uint8_t*)(searchStr.data()), searchStr.size()};
10329 Discord_Client_SearchFriendsByUsername(&instance_, searchStr__str, &returnValueNative__);
10330 std::vector<discordpp::UserHandle> returnValue__;
10331 returnValue__.reserve(returnValueNative__.size);
10332 for (
size_t i__ = 0; i__ < returnValueNative__.size; ++i__) {
10333 returnValue__.emplace_back(returnValueNative__.ptr[i__], DiscordObjectState::Owned);
10335 Discord_Free(returnValueNative__.ptr);
10336 return returnValue__;
10338void Client::SendDiscordFriendRequest(std::string
const& username,
10341 assert(state_ == DiscordObjectState::Owned);
10342 Discord_String username__str{(uint8_t*)(username.data()), username.size()};
10343 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10344 auto cb__userData =
new Tcb__UserData(cb);
10345 Discord_Client_SendFriendRequestCallback cb__native = [](
auto result,
void* userData__) {
10346 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10348 userData__typed->delegate(std::move(result__obj));
10350 Discord_Client_SendDiscordFriendRequest(
10351 &instance_, username__str, cb__native, Tcb__UserData::Free, cb__userData);
10353void Client::SendDiscordFriendRequestById(uint64_t userId,
10356 assert(state_ == DiscordObjectState::Owned);
10357 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10358 auto cb__userData =
new Tcb__UserData(cb);
10359 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
10360 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10362 userData__typed->delegate(std::move(result__obj));
10364 Discord_Client_SendDiscordFriendRequestById(
10365 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
10367void Client::SendGameFriendRequest(std::string
const& username,
10370 assert(state_ == DiscordObjectState::Owned);
10371 Discord_String username__str{(uint8_t*)(username.data()), username.size()};
10372 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10373 auto cb__userData =
new Tcb__UserData(cb);
10374 Discord_Client_SendFriendRequestCallback cb__native = [](
auto result,
void* userData__) {
10375 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10377 userData__typed->delegate(std::move(result__obj));
10379 Discord_Client_SendGameFriendRequest(
10380 &instance_, username__str, cb__native, Tcb__UserData::Free, cb__userData);
10382void Client::SendGameFriendRequestById(uint64_t userId,
10385 assert(state_ == DiscordObjectState::Owned);
10386 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10387 auto cb__userData =
new Tcb__UserData(cb);
10388 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
10389 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10391 userData__typed->delegate(std::move(result__obj));
10393 Discord_Client_SendGameFriendRequestById(
10394 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
10398 assert(state_ == DiscordObjectState::Owned);
10399 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10400 auto cb__userData =
new Tcb__UserData(cb);
10401 Discord_Client_RelationshipCreatedCallback cb__native =
10402 [](
auto userId,
auto isDiscordRelationshipUpdate,
void* userData__) {
10403 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10404 userData__typed->delegate(userId, isDiscordRelationshipUpdate);
10406 Discord_Client_SetRelationshipCreatedCallback(
10407 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
10411 assert(state_ == DiscordObjectState::Owned);
10412 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10413 auto cb__userData =
new Tcb__UserData(cb);
10414 Discord_Client_RelationshipDeletedCallback cb__native =
10415 [](
auto userId,
auto isDiscordRelationshipUpdate,
void* userData__) {
10416 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10417 userData__typed->delegate(userId, isDiscordRelationshipUpdate);
10419 Discord_Client_SetRelationshipDeletedCallback(
10420 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
10424 assert(state_ == DiscordObjectState::Owned);
10425 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10426 auto cb__userData =
new Tcb__UserData(cb);
10427 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
10428 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10430 userData__typed->delegate(std::move(result__obj));
10432 Discord_Client_UnblockUser(&instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
10436 assert(state_ == DiscordObjectState::Owned);
10437 Discord_UserHandle returnValueNative__{};
10438 Discord_Client_GetCurrentUser(&instance_, &returnValueNative__);
10440 return returnValue__;
10442void Client::GetDiscordClientConnectedUser(
10443 uint64_t applicationId,
10446 assert(state_ == DiscordObjectState::Owned);
10447 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
10448 auto callback__userData =
new Tcallback__UserData(callback);
10449 Discord_Client_GetDiscordClientConnectedUserCallback callback__native =
10450 [](
auto result,
auto user,
void* userData__) {
10451 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
10453 std::optional<discordpp::UserHandle> user__opt{};
10457 userData__typed->delegate(std::move(result__obj), std::move(user__opt));
10459 Discord_Client_GetDiscordClientConnectedUser(
10460 &instance_, applicationId, callback__native, Tcallback__UserData::Free, callback__userData);
10462std::optional<discordpp::UserHandle> Client::GetUser(uint64_t userId)
const
10464 assert(state_ == DiscordObjectState::Owned);
10465 bool returnIsNonNull__;
10466 Discord_UserHandle returnValueNative__;
10467 returnIsNonNull__ = Discord_Client_GetUser(&instance_, userId, &returnValueNative__);
10468 if (!returnIsNonNull__) {
10472 return returnValue__;
10476 assert(state_ == DiscordObjectState::Owned);
10477 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10478 auto cb__userData =
new Tcb__UserData(cb);
10479 Discord_Client_UserUpdatedCallback cb__native = [](
auto userId,
void* userData__) {
10480 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10481 userData__typed->delegate(userId);
10483 Discord_Client_SetUserUpdatedCallback(
10484 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
10486const CallInfoHandle CallInfoHandle::nullobj{{}, DiscordObjectState::Invalid};
10487CallInfoHandle::~CallInfoHandle()
10489 if (state_ == DiscordObjectState::Owned) {
10491 state_ = DiscordObjectState::Invalid;
10494CallInfoHandle::CallInfoHandle(CallInfoHandle&& other) noexcept
10495 : instance_(other.instance_)
10496 , state_(other.state_)
10498 other.state_ = DiscordObjectState::Invalid;
10500CallInfoHandle& CallInfoHandle::operator=(CallInfoHandle&& other)
noexcept
10502 if (
this != &other) {
10503 if (state_ == DiscordObjectState::Owned) {
10506 instance_ = other.instance_;
10507 state_ = other.state_;
10508 other.state_ = DiscordObjectState::Invalid;
10512CallInfoHandle::CallInfoHandle(
const CallInfoHandle& other)
10517 Discord_CallInfoHandle_Clone(&instance_, other.instance());
10519 state_ = DiscordObjectState::Owned;
10522CallInfoHandle& CallInfoHandle::operator=(
const CallInfoHandle& other)
10524 if (
this != &other) {
10525 if (state_ == DiscordObjectState::Owned) {
10527 state_ = DiscordObjectState::Invalid;
10529 if (other.state_ == DiscordObjectState::Owned) {
10530 Discord_CallInfoHandle_Clone(&instance_, other.instance());
10532 state_ = DiscordObjectState::Owned;
10537CallInfoHandle::CallInfoHandle(Discord_CallInfoHandle instance, DiscordObjectState state)
10538 : instance_(instance)
10542void CallInfoHandle::Drop()
10544 if (state_ != DiscordObjectState::Owned) {
10547 Discord_CallInfoHandle_Drop(&instance_);
10548 state_ = DiscordObjectState::Invalid;
10550uint64_t CallInfoHandle::ChannelId()
const
10552 assert(state_ == DiscordObjectState::Owned);
10553 uint64_t returnValue__;
10554 returnValue__ = Discord_CallInfoHandle_ChannelId(&instance_);
10555 return returnValue__;
10557std::vector<uint64_t> CallInfoHandle::GetParticipants()
const
10559 assert(state_ == DiscordObjectState::Owned);
10560 Discord_UInt64Span returnValueNative__;
10561 Discord_CallInfoHandle_GetParticipants(&instance_, &returnValueNative__);
10562 std::vector<uint64_t> returnValue__(returnValueNative__.ptr,
10563 returnValueNative__.ptr + returnValueNative__.size);
10564 Discord_Free(returnValueNative__.ptr);
10565 return returnValue__;
10567std::optional<discordpp::VoiceStateHandle> CallInfoHandle::GetVoiceStateHandle(
10568 uint64_t userId)
const
10570 assert(state_ == DiscordObjectState::Owned);
10571 bool returnIsNonNull__;
10572 Discord_VoiceStateHandle returnValueNative__;
10573 returnIsNonNull__ =
10574 Discord_CallInfoHandle_GetVoiceStateHandle(&instance_, userId, &returnValueNative__);
10575 if (!returnIsNonNull__) {
10579 return returnValue__;
10581uint64_t CallInfoHandle::GuildId()
const
10583 assert(state_ == DiscordObjectState::Owned);
10584 uint64_t returnValue__;
10585 returnValue__ = Discord_CallInfoHandle_GuildId(&instance_);
10586 return returnValue__;
Struct which controls what your rich presence looks like in the Discord client. If you don't specify ...
Definition discordpp.h:720
void SetLargeImage(std::optional< std::string > LargeImage)
Setter for ActivityAssets::LargeImage.
std::optional< std::string > SmallText() const
A tooltip string that is shown when the user hovers over the small image.
void SetLargeText(std::optional< std::string > LargeText)
Setter for ActivityAssets::LargeText.
ActivityAssets(ActivityAssets &&other) noexcept
Move constructor for ActivityAssets.
std::optional< std::string > SmallImage() const
The secondary image, rendered as a small circle over the largeImage.
ActivityAssets(const ActivityAssets &arg0)
Copy constructor for ActivityAssets.
std::optional< std::string > LargeText() const
A tooltip string that is shown when the user hovers over the large image.
void SetSmallImage(std::optional< std::string > SmallImage)
Setter for ActivityAssets::SmallImage.
ActivityAssets & operator=(const ActivityAssets &arg0)
Copy assignment operator for ActivityAssets.
static const ActivityAssets nullobj
Uninitialized instance of ActivityAssets.
Definition discordpp.h:739
std::optional< std::string > LargeImage() const
The primary image identifier or URL, rendered as a large square icon on a user's rich presence.
void SetSmallText(std::optional< std::string > SmallText)
Setter for ActivityAssets::SmallText.
ActivityAssets & operator=(ActivityAssets &&other) noexcept
Move assignment operator for ActivityAssets.
When one user invites another to join their game on Discord, it will send a message to that user....
Definition discordpp.h:628
static const ActivityInvite nullobj
Uninitialized instance of ActivityInvite.
Definition discordpp.h:647
std::string SessionId() const
The session id of the user who sent the invite.
void SetIsValid(bool IsValid)
Setter for ActivityInvite::IsValid.
void SetSessionId(std::string SessionId)
Setter for ActivityInvite::SessionId.
uint64_t ApplicationId() const
The target application of the invite.
uint64_t MessageId() const
The id of the Discord message that contains the invite.
uint64_t SenderId() const
The user id of the user who sent the invite.
void SetApplicationId(uint64_t ApplicationId)
Setter for ActivityInvite::ApplicationId.
void SetSenderId(uint64_t SenderId)
Setter for ActivityInvite::SenderId.
bool IsValid() const
Whether or not this invite is currently joinable. An invite becomes invalid if it was sent more than ...
void SetChannelId(uint64_t ChannelId)
Setter for ActivityInvite::ChannelId.
uint64_t ChannelId() const
The id of the Discord channel in which the invite was sent.
void SetMessageId(uint64_t MessageId)
Setter for ActivityInvite::MessageId.
std::string PartyId() const
The id of the party the invite was sent for.
ActivityInvite & operator=(ActivityInvite &&other) noexcept
Move assignment operator for ActivityInvite.
ActivityInvite(const ActivityInvite &rhs)
Copy constructor for ActivityInvite.
void SetType(discordpp::ActivityActionTypes Type)
Setter for ActivityInvite::Type.
void SetPartyId(std::string PartyId)
Setter for ActivityInvite::PartyId.
ActivityInvite & operator=(const ActivityInvite &rhs)
Copy assignment operator for ActivityInvite.
discordpp::ActivityActionTypes Type() const
The type of invite that was sent.
ActivityInvite(ActivityInvite &&other) noexcept
Move constructor for ActivityInvite.
Definition discordpp.h:839
void SetMaxSize(int32_t MaxSize)
Setter for ActivityParty::MaxSize.
ActivityParty(ActivityParty &&other) noexcept
Move constructor for ActivityParty.
void SetCurrentSize(int32_t CurrentSize)
Setter for ActivityParty::CurrentSize.
void SetId(std::string Id)
Setter for ActivityParty::Id.
int32_t CurrentSize() const
The number of people currently in the party, must be at least 1.
int32_t MaxSize() const
The maximum number of people that can be in the party, must be at least 0. When 0,...
ActivityParty(const ActivityParty &arg0)
Copy constructor for ActivityParty.
ActivityParty & operator=(ActivityParty &&other) noexcept
Move assignment operator for ActivityParty.
void SetPrivacy(discordpp::ActivityPartyPrivacy Privacy)
Setter for ActivityParty::Privacy.
discordpp::ActivityPartyPrivacy Privacy() const
The privacy of the party.
std::string Id() const
Specifies the id of the party. "Party" is used colloquially to refer to a group of players in a share...
static const ActivityParty nullobj
Uninitialized instance of ActivityParty.
Definition discordpp.h:858
ActivityParty & operator=(const ActivityParty &arg0)
Copy assignment operator for ActivityParty.
Definition discordpp.h:901
ActivitySecrets & operator=(ActivitySecrets &&other) noexcept
Move assignment operator for ActivitySecrets.
std::string Join() const
A secret string that is shared with users who are accepted into the party so the game knows how to jo...
ActivitySecrets & operator=(const ActivitySecrets &arg0)
Copy assignment operator for ActivitySecrets.
ActivitySecrets(ActivitySecrets &&other) noexcept
Move constructor for ActivitySecrets.
ActivitySecrets(const ActivitySecrets &arg0)
Copy constructor for ActivitySecrets.
void SetJoin(std::string Join)
Setter for ActivitySecrets::Join.
static const ActivitySecrets nullobj
Uninitialized instance of ActivitySecrets.
Definition discordpp.h:920
Definition discordpp.h:785
ActivityTimestamps(ActivityTimestamps &&other) noexcept
Move constructor for ActivityTimestamps.
ActivityTimestamps(const ActivityTimestamps &arg0)
Copy constructor for ActivityTimestamps.
uint64_t Start() const
The time the activity started, in milliseconds since Unix epoch.
void SetStart(uint64_t Start)
Setter for ActivityTimestamps::Start.
static const ActivityTimestamps nullobj
Uninitialized instance of ActivityTimestamps.
Definition discordpp.h:804
ActivityTimestamps & operator=(ActivityTimestamps &&other) noexcept
Move assignment operator for ActivityTimestamps.
void SetEnd(uint64_t End)
Setter for ActivityTimestamps::End.
uint64_t End() const
The time the activity will end at, in milliseconds since Unix epoch.
ActivityTimestamps & operator=(const ActivityTimestamps &arg0)
Copy assignment operator for ActivityTimestamps.
An Activity represents one "thing" a user is doing on Discord and is part of their rich presence.
Definition discordpp.h:1112
static const Activity nullobj
Uninitialized instance of Activity.
Definition discordpp.h:1131
std::optional< uint64_t > ApplicationId() const
The application ID of the game that the activity is associated with.
std::string Name() const
The name of the game or application that the activity is associated with.
void SetDetails(std::optional< std::string > Details)
Setter for Activity::Details.
Activity & operator=(Activity &&other) noexcept
Move assignment operator for Activity.
void SetType(discordpp::ActivityTypes Type)
Setter for Activity::Type.
std::optional< discordpp::ActivityAssets > Assets() const
Images used to customize how the Activity is displayed in the Discord client.
void SetTimestamps(std::optional< discordpp::ActivityTimestamps > Timestamps)
Setter for Activity::Timestamps.
bool Equals(discordpp::Activity other) const
Compares each field of the Activity struct for equality.
void SetApplicationId(std::optional< uint64_t > ApplicationId)
Setter for Activity::ApplicationId.
void SetName(std::string Name)
Setter for Activity::Name.
void SetSecrets(std::optional< discordpp::ActivitySecrets > Secrets)
Setter for Activity::Secrets.
Activity(const Activity &arg0)
Copy constructor for Activity.
void SetAssets(std::optional< discordpp::ActivityAssets > Assets)
Setter for Activity::Assets.
std::optional< discordpp::ActivityTimestamps > Timestamps() const
The timestamps struct can be used to render either:
void SetParty(std::optional< discordpp::ActivityParty > Party)
Setter for Activity::Party.
Activity & operator=(const Activity &arg0)
Copy assignment operator for Activity.
std::optional< discordpp::ActivityParty > Party() const
The party struct is used to indicate the size and members of the people the current user is playing w...
void SetSupportedPlatforms(discordpp::ActivityGamePlatforms SupportedPlatforms)
Setter for Activity::SupportedPlatforms.
std::optional< std::string > Details() const
The state of the what the user is doing for this activity.
void SetState(std::optional< std::string > State)
Setter for Activity::State.
Activity(Activity &&other) noexcept
Move constructor for Activity.
discordpp::ActivityGamePlatforms SupportedPlatforms() const
If an activity is joinable, but only on certain platforms, this field can be used to indicate which p...
std::optional< discordpp::ActivitySecrets > Secrets() const
The secrets struct is used in combination with the party struct to make an Activity joinable.
std::optional< std::string > State() const
The state of the party for this activity.
discordpp::ActivityTypes Type() const
The type of activity this is.
Contains information about non-text content in a message that likely cannot be rendered in game such ...
Definition discordpp.h:2573
static std::string TypeToString(discordpp::AdditionalContentType type)
Converts the AdditionalContentType enum to a string.
AdditionalContent & operator=(AdditionalContent &&other) noexcept
Move assignment operator for AdditionalContent.
void SetCount(uint8_t Count)
Setter for AdditionalContent::Count.
void SetType(discordpp::AdditionalContentType Type)
Setter for AdditionalContent::Type.
std::optional< std::string > Title() const
When the additional content is a poll or thread, this field will contain the name of the poll or thre...
discordpp::AdditionalContentType Type() const
Represents the type of additional content in the message.
uint8_t Count() const
Represents the number of pieces of additional content so you could for example renders "2 additional ...
bool Equals(discordpp::AdditionalContent rhs) const
Compares each field of the AdditionalContent struct for equality.
AdditionalContent(AdditionalContent &&other) noexcept
Move constructor for AdditionalContent.
AdditionalContent & operator=(const AdditionalContent &arg0)
Copy assignment operator for AdditionalContent.
AdditionalContent(const AdditionalContent &arg0)
Copy constructor for AdditionalContent.
void SetTitle(std::optional< std::string > Title)
Setter for AdditionalContent::Title.
static const AdditionalContent nullobj
Uninitialized instance of AdditionalContent.
Definition discordpp.h:2592
Represents a single input or output audio device available to the user.
Definition discordpp.h:2789
AudioDevice & operator=(const AudioDevice &arg0)
Copy assignment operator for AudioDevice.
bool Equals(discordpp::AudioDevice rhs)
Compares the ID of two AudioDevice objects for equality.
std::string Name() const
The display name of the audio device.
bool IsDefault() const
Whether the audio device is the system default device.
std::string Id() const
The ID of the audio device.
AudioDevice(AudioDevice &&other) noexcept
Move constructor for AudioDevice.
AudioDevice & operator=(AudioDevice &&other) noexcept
Move assignment operator for AudioDevice.
static const AudioDevice nullobj
Uninitialized instance of AudioDevice.
Definition discordpp.h:2808
void SetId(std::string Id)
Setter for AudioDevice::Id.
void SetIsDefault(bool IsDefault)
Setter for AudioDevice::IsDefault.
void SetName(std::string Name)
Setter for AudioDevice::Name.
AudioDevice(const AudioDevice &arg0)
Copy constructor for AudioDevice.
Arguments to the Client::Authorize function.
Definition discordpp.h:1415
std::optional< std::string > State() const
See https://discord.com/developers/docs/topics/oauth2#state-and-security for details on this field.
AuthorizationArgs & operator=(AuthorizationArgs &&other) noexcept
Move assignment operator for AuthorizationArgs.
std::optional< std::string > Nonce() const
The nonce field is generally only useful for backend integrations using ID tokens.
std::optional< discordpp::AuthorizationCodeChallenge > CodeChallenge() const
If using the Client::GetToken flow, you will need to generate a code challenge and verifier.
uint64_t ClientId() const
Optional. The Discord application ID for your game. Defaults to the value set by Client::SetApplicati...
AuthorizationArgs(const AuthorizationArgs &arg0)
Copy constructor for AuthorizationArgs.
void SetScopes(std::string Scopes)
Setter for AuthorizationArgs::Scopes.
static const AuthorizationArgs nullobj
Uninitialized instance of AuthorizationArgs.
Definition discordpp.h:1434
void SetClientId(uint64_t ClientId)
Setter for AuthorizationArgs::ClientId.
void SetCodeChallenge(std::optional< discordpp::AuthorizationCodeChallenge > CodeChallenge)
Setter for AuthorizationArgs::CodeChallenge.
AuthorizationArgs(AuthorizationArgs &&other) noexcept
Move constructor for AuthorizationArgs.
AuthorizationArgs & operator=(const AuthorizationArgs &arg0)
Copy assignment operator for AuthorizationArgs.
std::string Scopes() const
Scopes is a space separated string of the oauth scopes your game is requesting.
void SetNonce(std::optional< std::string > Nonce)
Setter for AuthorizationArgs::Nonce.
void SetState(std::optional< std::string > State)
Setter for AuthorizationArgs::State.
Struct that encapsulates the challenge part of the code verification flow.
Definition discordpp.h:1323
discordpp::AuthenticationCodeChallengeMethod Method() const
The method used to generate the challenge. The only method used by the SDK is sha256.
AuthorizationCodeChallenge(const AuthorizationCodeChallenge &arg0)
Copy constructor for AuthorizationCodeChallenge.
std::string Challenge() const
The challenge value.
AuthorizationCodeChallenge & operator=(AuthorizationCodeChallenge &&other) noexcept
Move assignment operator for AuthorizationCodeChallenge.
void SetMethod(discordpp::AuthenticationCodeChallengeMethod Method)
Setter for AuthorizationCodeChallenge::Method.
static const AuthorizationCodeChallenge nullobj
Uninitialized instance of AuthorizationCodeChallenge.
Definition discordpp.h:1343
AuthorizationCodeChallenge & operator=(const AuthorizationCodeChallenge &arg0)
Copy assignment operator for AuthorizationCodeChallenge.
AuthorizationCodeChallenge(AuthorizationCodeChallenge &&other) noexcept
Move constructor for AuthorizationCodeChallenge.
void SetChallenge(std::string Challenge)
Setter for AuthorizationCodeChallenge::Challenge.
Struct that encapsulates both parts of the code verification flow.
Definition discordpp.h:1370
AuthorizationCodeVerifier(const AuthorizationCodeVerifier &arg0)
Copy constructor for AuthorizationCodeVerifier.
AuthorizationCodeVerifier & operator=(const AuthorizationCodeVerifier &arg0)
Copy assignment operator for AuthorizationCodeVerifier.
void SetVerifier(std::string Verifier)
Setter for AuthorizationCodeVerifier::Verifier.
AuthorizationCodeVerifier(AuthorizationCodeVerifier &&other) noexcept
Move constructor for AuthorizationCodeVerifier.
std::string Verifier() const
The verifier part of the code verification flow.
void SetChallenge(discordpp::AuthorizationCodeChallenge Challenge)
Setter for AuthorizationCodeVerifier::Challenge.
static const AuthorizationCodeVerifier nullobj
Uninitialized instance of AuthorizationCodeVerifier.
Definition discordpp.h:1390
discordpp::AuthorizationCodeChallenge Challenge() const
The challenge part of the code verification flow.
AuthorizationCodeVerifier & operator=(AuthorizationCodeVerifier &&other) noexcept
Move assignment operator for AuthorizationCodeVerifier.
Convenience class that represents the state of a single Discord call in a lobby.
Definition discordpp.h:4481
std::optional< discordpp::VoiceStateHandle > GetVoiceStateHandle(uint64_t userId) const
Accesses the voice state for a single user so you can know if they have muted or deafened themselves.
std::vector< uint64_t > GetParticipants() const
Returns a list of the user IDs of the participants in the call.
CallInfoHandle & operator=(const CallInfoHandle &other)
Copy assignment operator for CallInfoHandle.
CallInfoHandle(const CallInfoHandle &other)
Copy constructor for CallInfoHandle.
CallInfoHandle & operator=(CallInfoHandle &&other) noexcept
Move assignment operator for CallInfoHandle.
uint64_t GuildId() const
Returns the lobby ID of the call.
static const CallInfoHandle nullobj
Uninitialized instance of CallInfoHandle.
Definition discordpp.h:4500
CallInfoHandle(CallInfoHandle &&other) noexcept
Move constructor for CallInfoHandle.
uint64_t ChannelId() const
Returns the lobby ID of the call.
Class that manages an active voice session in a Lobby.
Definition discordpp.h:1653
static std::string ErrorToString(discordpp::Call::Error type)
Converts the Error enum to a string.
Call & operator=(const Call &other)
Copy assignment operator for Call.
void SetSelfDeaf(bool deaf)
Mutes all audio from the currently active call for the current user. They will not be able to hear an...
std::function< void(uint64_t userId, bool isPlayingSound)> OnSpeakingStatusChanged
Callback function for Call::SetSpeakingStatusChangedCallback.
Definition discordpp.h:1714
static const Call nullobj
Uninitialized instance of Call.
Definition discordpp.h:1731
Call(Call &&other) noexcept
Move constructor for Call.
void SetOnVoiceStateChangedCallback(discordpp::Call::OnVoiceStateChanged cb)
Sets a callback function to generally be invoked whenever a field on a VoiceStateHandle object for a ...
Call & operator=(Call &&other) noexcept
Move assignment operator for Call.
discordpp::AudioModeType GetAudioMode()
Returns whether the call is configured to use voice auto detection or push to talk for the current us...
bool GetPTTActive()
Returns whether push to talk is currently active, meaning the user is currently pressing their config...
discordpp::VADThresholdSettings GetVADThreshold() const
Returns the current configuration for void auto detection thresholds. See the description of the VADT...
std::optional< discordpp::VoiceStateHandle > GetVoiceStateHandle(uint64_t userId) const
Returns a reference to the VoiceStateHandle for the user ID of the given call participant.
static std::string StatusToString(discordpp::Call::Status type)
Converts the Status enum to a string.
void SetVADThreshold(bool automatic, float threshold)
Customizes the void auto detection thresholds for picking up activity from a user's mic.
bool GetSelfDeaf()
Returns whether the current user is deafened.
Error
Enum that represents any network errors with the Call.
Definition discordpp.h:1661
@ None
None.
Definition discordpp.h:1664
@ Forbidden
Forbidden.
Definition discordpp.h:1679
@ SignalingConnectionFailed
SignalingConnectionFailed.
Definition discordpp.h:1667
@ SignalingUnexpectedClose
SignalingUnexpectedClose.
Definition discordpp.h:1670
@ JoinTimeout
JoinTimeout.
Definition discordpp.h:1676
@ VoiceConnectionFailed
VoiceConnectionFailed.
Definition discordpp.h:1673
Status
Enum that respresents the state of the Call's network connection.
Definition discordpp.h:1683
@ Disconnecting
Disconnecting.
Definition discordpp.h:1704
@ Connected
Connected.
Definition discordpp.h:1698
@ Reconnecting
Reconnecting.
Definition discordpp.h:1701
@ Connecting
Connecting.
Definition discordpp.h:1692
@ SignalingConnected
SignalingConnected.
Definition discordpp.h:1695
@ Disconnected
Disconnected.
Definition discordpp.h:1686
@ Joining
Joining.
Definition discordpp.h:1689
void SetLocalMute(uint64_t userId, bool mute)
Locally mutes the given userId, so that the current user cannot hear them anymore.
void SetSpeakingStatusChangedCallback(discordpp::Call::OnSpeakingStatusChanged cb)
Sets a callback function to be invoked whenever a user starts or stops speaking and is passed in the ...
std::function< void(discordpp::Call::Status status, discordpp::Call::Error error, int32_t errorDetail)> OnStatusChanged
Callback function for Call::SetStatusChangedCallback.
Definition discordpp.h:1717
uint32_t GetPTTReleaseDelay()
Returns the time that PTT is active after the user releases the PTT key and SetPTTActive(false) is ca...
uint64_t GetGuildId() const
Returns the ID of the lobby with which this call is associated.
Call(const Call &other)
Copy constructor for Call.
void SetPTTActive(bool active)
When push to talk is enabled, this should be called whenever the user pushes or releases their config...
void SetParticipantChangedCallback(discordpp::Call::OnParticipantChanged cb)
Sets a callback function to be invoked whenever some joins or leaves a voice call.
std::vector< uint64_t > GetParticipants() const
Returns a list of all of the user IDs of the participants in the call.
bool GetSelfMute()
Returns whether the current user's microphone is muted.
void SetPTTReleaseDelay(uint32_t releaseDelayMs)
If set, extends the time that PTT is active after the user releases the PTT key and SetPTTActive(fals...
discordpp::Call::Status GetStatus() const
Returns the current call status.
std::function< void(uint64_t userId, bool added)> OnParticipantChanged
Callback function for Call::SetParticipantChangedCallback.
Definition discordpp.h:1711
void SetParticipantVolume(uint64_t userId, float volume)
Locally changes the playout volume of the given userId.
void SetStatusChangedCallback(discordpp::Call::OnStatusChanged cb)
Sets a callback function to be invoked when the call status changes, such as when it fully connects o...
void SetAudioMode(discordpp::AudioModeType audioMode)
Sets whether to use voice auto detection or push to talk for the current user on this call.
bool GetLocalMute(uint64_t userId)
Returns whether the current user has locally muted the given userId for themselves.
float GetParticipantVolume(uint64_t userId)
Returns the locally set playout volume of the given userId.
void SetSelfMute(bool mute)
Mutes the current user's microphone so that no other participant in their active calls can hear them.
std::function< void(uint64_t userId)> OnVoiceStateChanged
Callback function for Call::SetOnVoiceStateChangedCallback.
Definition discordpp.h:1708
uint64_t GetChannelId() const
Returns the ID of the lobby with which this call is associated.
All messages sent on Discord are done so in a Channel. MessageHandle::ChannelId will contain the ID o...
Definition discordpp.h:1880
ChannelHandle(const ChannelHandle &other)
Copy constructor for ChannelHandle.
ChannelHandle & operator=(const ChannelHandle &other)
Copy assignment operator for ChannelHandle.
static const ChannelHandle nullobj
Uninitialized instance of ChannelHandle.
Definition discordpp.h:1899
uint64_t Id() const
Returns the ID of the channel.
ChannelHandle & operator=(ChannelHandle &&other) noexcept
Move assignment operator for ChannelHandle.
ChannelHandle(ChannelHandle &&other) noexcept
Move constructor for ChannelHandle.
std::vector< uint64_t > Recipients() const
For DMs and GroupDMs, returns the user IDs of the members of the channel. For all other channels retu...
std::string Name() const
Returns the name of the channel.
discordpp::ChannelType Type() const
Returns the type of the channel.
Struct that stores information about the result of an SDK function call.
Definition discordpp.h:1230
void SetRetryable(bool Retryable)
Setter for ClientResult::Retryable.
bool Retryable() const
Indicates if, although an API request failed, it is safe and recommended to retry it.
void SetErrorCode(int32_t ErrorCode)
Setter for ClientResult::ErrorCode.
ClientResult & operator=(const ClientResult &arg0)
Copy assignment operator for ClientResult.
void SetStatus(discordpp::HttpStatusCode Status)
Setter for ClientResult::Status.
std::string Error() const
A description of the error that occurred.
discordpp::ErrorType Type() const
The type of error that occurred. See ErrorType for more information.
void SetResponseBody(std::string ResponseBody)
Setter for ClientResult::ResponseBody.
ClientResult(ClientResult &&other) noexcept
Move constructor for ClientResult.
void SetSuccessful(bool Successful)
Setter for ClientResult::Successful.
std::string ToString() const
Returns the error message if any of the ClientResult.
static const ClientResult nullobj
Uninitialized instance of ClientResult.
Definition discordpp.h:1249
ClientResult & operator=(ClientResult &&other) noexcept
Move assignment operator for ClientResult.
int32_t ErrorCode() const
A more detailed error code for this failure. Currently the only use of this is when an API request is...
void SetRetryAfter(float RetryAfter)
Setter for ClientResult::RetryAfter.
float RetryAfter() const
When a user is being rate limited by Discord (and so status == 429), this field should be set and is ...
std::string ResponseBody() const
The full HTTP response body, which will usually be a JSON string.
discordpp::HttpStatusCode Status() const
The HTTP status code of the API call.
void SetError(std::string Error)
Setter for ClientResult::Error.
ClientResult(const ClientResult &arg0)
Copy constructor for ClientResult.
bool Successful() const
Equivalent to type == ErrorType::None.
void SetType(discordpp::ErrorType Type)
Setter for ClientResult::Type.
The Client class is the main entry point for the Discord SDK. All functionality is exposed through th...
Definition discordpp.h:2844
std::function< void(std::vector< discordpp::AudioDevice > devices)> GetOutputDevicesCallback
Callback function for Client::GetOutputDevices.
Definition discordpp.h:2941
bool RegisterLaunchCommand(uint64_t applicationId, std::string command)
When a user accepts an activity invite for your game within the Discord client, Discord needs to know...
void SetRelationshipCreatedCallback(discordpp::Client::RelationshipCreatedCallback cb)
Sets a callback to be invoked whenever a relationship for this user is established or changes type.
std::function< void(uint64_t messageId)> MessageCreatedCallback
Callback function for Client::SetMessageCreatedCallback.
Definition discordpp.h:3032
discordpp::Call GetCall(uint64_t channelId)
Returns a reference to the currently active call, if any.
std::function< void(discordpp::ClientResult result)> UpdateRelationshipCallback
Callback function for most other Relationship functions such as Client::SendDiscordFriendRequestById.
Definition discordpp.h:3110
void EndCalls(discordpp::Client::EndCallsCallback callback)
Ends any active call, if any. Any references you have to Call objects are invalid after they are ende...
static std::string StatusToString(discordpp::Client::Status type)
Converts the Status enum to a string.
void Disconnect()
Asynchronously disconnects the client.
void SendDiscordFriendRequest(std::string const &username, discordpp::Client::SendFriendRequestCallback cb)
Sends a Discord friend request to the target user.
void RefreshToken(uint64_t applicationId, std::string const &refreshToken, discordpp::Client::TokenExchangeCallback callback)
Generates a new access token for the current user from a refresh token.
void SendLobbyMessageWithMetadata(uint64_t lobbyId, std::string const &content, std::unordered_map< std::string, std::string > const &metadata, discordpp::Client::SendUserMessageCallback cb)
Variant of Client::SendLobbyMessage that also accepts metadata to be sent with the message.
void SetEchoCancellation(bool on)
Enables or disables the basic echo cancellation provided by the WebRTC library.
void GetInputDevices(discordpp::Client::GetInputDevicesCallback cb)
Asynchronously fetches the list of audio input devices available to the user.
void CancelGameFriendRequest(uint64_t userId, discordpp::Client::UpdateRelationshipCallback cb)
Cancels an outgoing game friend request to the target user.
void AbortGetTokenFromDevice()
This function is used to abort/cleanup the device authorization flow.
bool SetLogDir(std::string const &path, discordpp::LoggingSeverity minSeverity)
Causes logs generated by the SDK to be written to disk in the specified directory.
void SetAuthorizeDeviceScreenClosedCallback(discordpp::Client::AuthorizeDeviceScreenClosedCallback cb)
Sets a callback function to be invoked when the device authorization screen is closed.
void SetMessageCreatedCallback(discordpp::Client::MessageCreatedCallback cb)
Sets a callback to be invoked whenever a new message is received in either a lobby or a DM.
std::function< void(discordpp::ClientResult result)> UpdateProvisionalAccountDisplayNameCallback
Callback function for Client::UpdateProvisionalAccountDisplayName.
Definition discordpp.h:3006
std::function< void(bool inputDetected)> NoAudioInputCallback
Callback function for Client::SetNoAudioInputCallback.
Definition discordpp.h:2953
void UnlinkChannelFromLobby(uint64_t lobbyId, discordpp::Client::LinkOrUnlinkChannelCallback callback)
Removes any existing channel link from the specified lobby.
std::function< void()> ProvisionalUserMergeRequiredCallback
Callback function for when Client::ProvisionalUserMergeCompleted completes.
Definition discordpp.h:3020
void SetMessageDeletedCallback(discordpp::Client::MessageDeletedCallback cb)
Sets a callback to be invoked whenever a message is deleted.
void DeleteUserMessage(uint64_t recipientId, uint64_t messageId, discordpp::Client::DeleteUserMessageCallback cb)
Deletes the specified message sent by the current user to the specified recipient.
void SetVoiceParticipantChangedCallback(discordpp::Client::VoiceParticipantChangedCallback cb)
Callback invoked whenever a user in a lobby joins or leaves a voice call.
std::function< void(discordpp::ClientResult result, std::vector< discordpp::GuildMinimal > guilds)> GetUserGuildsCallback
Callback function for Client::GetUserGuilds.
Definition discordpp.h:3061
Client(std::string apiBase, std::string webBase)
Creates a new instance of the Client but allows customizing the Discord URL to use.
void LinkChannelToLobby(uint64_t lobbyId, uint64_t channelId, discordpp::Client::LinkOrUnlinkChannelCallback callback)
Links the specified channel on Discord to the specified in-game lobby.
std::function< void(uint64_t lobbyId)> LobbyDeletedCallback
Callback function for Client::SetLobbyDeletedCallback.
Definition discordpp.h:3074
std::function< void(std::string message, discordpp::LoggingSeverity severity)> LogCallback
Callback function invoked when a new log message is generated.
Definition discordpp.h:3041
void SetDeviceChangeCallback(discordpp::Client::DeviceChangeCallback callback)
Sets a callback function to be invoked when Discord detects a change in the available audio devices.
std::function< void(discordpp::ClientResult result)> LinkOrUnlinkChannelCallback
Callback function for Client::LinkChannelToLobby.
Definition discordpp.h:3068
std::function< void(discordpp::AudioDevice device)> GetCurrentOutputDeviceCallback
Callback function for Client::GetCurrentOutputDevice.
Definition discordpp.h:2934
std::vector< uint64_t > GetLobbyIds() const
Returns a list of all the lobbies that the user is a member of and the SDK has loaded.
void SetUserUpdatedCallback(discordpp::Client::UserUpdatedCallback cb)
The UserUpdatedCallback is invoked whenever any user the current session knows about changes,...
std::function< void()> TokenExpirationCallback
Callback function for Client::SetTokenExpirationCallback.
Definition discordpp.h:3003
std::function< void(discordpp::ClientResult result)> SetOutputDeviceCallback
Callback function for Client::SetOutputDevice.
Definition discordpp.h:2956
std::function< void(discordpp::ClientResult result, std::optional< discordpp::UserHandle > user)> GetDiscordClientConnectedUserCallback
Callback function for when Client::GetDiscordClientConnectedUser completes.
Definition discordpp.h:3126
void SetActivityInviteCreatedCallback(discordpp::Client::ActivityInviteCallback cb)
Sets a callback function that is invoked when the current user receives an activity invite from anoth...
std::function< void(uint64_t lobbyId, uint64_t memberId)> LobbyMemberUpdatedCallback
Callback function for Client::SetLobbyMemberUpdatedCallback.
Definition discordpp.h:3083
void SendUserMessage(uint64_t recipientId, std::string const &content, discordpp::Client::SendUserMessageCallback cb)
Sends a direct message to the specified user.
Client & operator=(Client &&other) noexcept
Move assignment operator for Client.
void GetTokenFromProvisionalMerge(uint64_t applicationId, std::string const &code, std::string const &codeVerifier, std::string const &redirectUri, discordpp::AuthenticationExternalAuthType externalAuthType, std::string const &externalAuthToken, discordpp::Client::TokenExchangeCallback callback)
This function should be used with the Client::Authorize function whenever a user with a provisional a...
static std::string GetVersionHash()
Returns the git commit hash this version was built from.
bool RegisterLaunchSteamApplication(uint64_t applicationId, uint32_t steamAppId)
When a user accepts an activity invite for your game within the Discord client, Discord needs to know...
void FetchCurrentUser(discordpp::AuthorizationTokenType tokenType, std::string const &token, discordpp::Client::FetchCurrentUserCallback callback)
Fetches basic information about the user associated with the given auth token.
void SetNoAudioInputCallback(discordpp::Client::NoAudioInputCallback callback)
Callback function invoked when the above threshold is set and there is a change in whether audio is b...
std::vector< discordpp::UserHandle > SearchFriendsByUsername(std::string searchStr) const
Searches all of your friends by both username and display name, returning a list of all friends that ...
void SetVoiceLogDir(std::string const &path, discordpp::LoggingSeverity minSeverity)
Causes logs generated by the voice subsystem of the SDK to be written to disk in the specified direct...
std::function< void(uint64_t userId, int16_t *data, uint64_t samplesPerChannel, int32_t sampleRate, uint64_t channels, bool &outShouldMute)> UserAudioReceivedCallback
Callback function for Client::StartCallWithAudioCallbacks.
Definition discordpp.h:2965
std::function< void(discordpp::ClientResult result)> LeaveLobbyCallback
Callback function for Client::LeaveLobby.
Definition discordpp.h:3065
std::function< void(uint64_t lobbyId)> LobbyUpdatedCallback
Callback function for Client::SetLobbyUpdatedCallback.
Definition discordpp.h:3086
void GetTokenFromDevice(discordpp::DeviceAuthorizationArgs args, discordpp::Client::TokenExchangeCallback callback)
This function is a combination of Client::Authorize and Client::GetToken, but is used for the case wh...
void CloseAuthorizeDeviceScreen()
This function is used to hide the device authorization screen and is used for the case where the user...
void SetOpusHardwareCoding(bool encode, bool decode)
Enables or disables hardware encoding and decoding for audio, if it is available.
bool ShowAudioRoutePicker()
On iOS devices, show the system audio route picker.
void SetActivityJoinCallback(discordpp::Client::ActivityJoinCallback cb)
Sets a callback function that is invoked when the current user also has Discord running on their comp...
void GetOutputDevices(discordpp::Client::GetOutputDevicesCallback cb)
Asynchronously fetches the list of audio output devices available to the user.
std::function< void()> AuthorizeDeviceScreenClosedCallback
Callback function for Client::SetAuthorizeDeviceScreenClosedCallback.
Definition discordpp.h:3000
void SetSelfDeafAll(bool deaf)
Mutes all audio from the currently active call for the current user in all calls. They will not be ab...
std::function< void(discordpp::ClientResult result)> UpdateRichPresenceCallback
Callback function for when Client::UpdateRichPresence completes.
Definition discordpp.h:3106
void CreateOrJoinLobbyWithMetadata(std::string const &secret, std::unordered_map< std::string, std::string > const &lobbyMetadata, std::unordered_map< std::string, std::string > const &memberMetadata, discordpp::Client::CreateOrJoinLobbyCallback callback)
Variant of Client::CreateOrJoinLobby that also accepts developer-supplied metadata.
Client()
Creates a new instance of the Client.
std::function< void(discordpp::ClientResult result)> SendFriendRequestCallback
Callback function for Client::SendDiscordFriendRequest and Client::SendGameFriendRequest.
Definition discordpp.h:3114
void UpdateToken(discordpp::AuthorizationTokenType tokenType, std::string token, discordpp::Client::UpdateTokenCallback callback)
Asynchronously sets a new auth token for this client to use.
std::function< void(discordpp::Client::Status status, discordpp::Client::Error error, int32_t errorDetail)> OnStatusChanged
Callback function for Client::SetStatusChangedCallback.
Definition discordpp.h:3048
void SetOutputVolume(float outputVolume)
Sets the speaker volume for the current user.
std::function< void()> EndCallsCallback
Callback invoked when Client::EndCalls completes.
Definition discordpp.h:2928
void SendGameFriendRequestById(uint64_t userId, discordpp::Client::UpdateRelationshipCallback cb)
Sends (or accepts) a game friend request to the target user.
void OpenMessageInDiscord(uint64_t messageId, discordpp::Client::ProvisionalUserMergeRequiredCallback provisionalUserMergeRequiredCallback, discordpp::Client::OpenMessageInDiscordCallback callback)
Opens the given message in the Discord client.
void RemoveGameFriend(uint64_t userId, discordpp::Client::UpdateRelationshipCallback cb)
Removes any game friendship between the current user and the target user.
std::vector< discordpp::Call > GetCalls()
Returns a reference to all currently active calls, if any.
std::optional< discordpp::ChannelHandle > GetChannelHandle(uint64_t channelId) const
Returns a reference to the Discord channel object for the given ID.
void SendActivityJoinRequest(uint64_t userId, discordpp::Client::SendActivityInviteCallback cb)
Requests to join the activity of the specified user.
std::function< void(discordpp::ClientResult result, std::string joinSecret)> AcceptActivityInviteCallback
Callback function for Client::AcceptActivityInvite.
Definition discordpp.h:3089
void RejectDiscordFriendRequest(uint64_t userId, discordpp::Client::UpdateRelationshipCallback cb)
Declines an incoming Discord friend request from the target user.
Status
This enum refers to the status of the internal websocket the SDK uses to communicate with Discord The...
Definition discordpp.h:2887
@ Disconnecting
Disconnecting.
Definition discordpp.h:2905
@ Connected
Connected.
Definition discordpp.h:2896
@ HttpWait
HttpWait.
Definition discordpp.h:2908
@ Reconnecting
Reconnecting.
Definition discordpp.h:2902
@ Connecting
Connecting.
Definition discordpp.h:2893
@ Ready
Ready.
Definition discordpp.h:2899
@ Disconnected
Disconnected.
Definition discordpp.h:2890
static std::string GetDefaultCommunicationScopes()
Returns the default set of OAuth2 scopes that should be used with the Discord SDK when making use of ...
void SetRelationshipDeletedCallback(discordpp::Client::RelationshipDeletedCallback cb)
Sets a callback to be invoked whenever a relationship for this user is removed, such as when the user...
void UpdateProvisionalAccountDisplayName(std::string const &name, discordpp::Client::UpdateProvisionalAccountDisplayNameCallback callback)
Updates the display name of a provisional account to the specified name.
static std::string GetDefaultPresenceScopes()
Returns the default set of OAuth2 scopes that should be used with the Discord SDK when leveraging bas...
void SendLobbyMessage(uint64_t lobbyId, std::string const &content, discordpp::Client::SendUserMessageCallback cb)
Sends a message in a lobby chat to all members of the lobby.
std::optional< discordpp::MessageHandle > GetMessageHandle(uint64_t messageId) const
Returns a reference to the Discord message object for the given ID.
float GetOutputVolume()
Returns the output volume for the current user.
std::function< void(discordpp::ClientResult result, std::string accessToken, std::string refreshToken, discordpp::AuthorizationTokenType tokenType, int32_t expiresIn, std::string scopes)> TokenExchangeCallback
Callback function for the token exchange APIs such as Client::GetToken.
Definition discordpp.h:2992
void SetThreadPriority(discordpp::Client::Thread thread, int32_t priority)
Allows setting the priority of various SDK threads.
discordpp::UserHandle GetCurrentUser() const
Returns the user associated with the current client.
std::function< void(discordpp::ClientResult result)> OpenMessageInDiscordCallback
Callback function for when Client::OpenMessageInDiscord completes.
Definition discordpp.h:3023
void GetProvisionalToken(uint64_t applicationId, discordpp::AuthenticationExternalAuthType externalAuthType, std::string const &externalAuthToken, discordpp::Client::TokenExchangeCallback callback)
Provisional accounts are a way for users that have not signed up for Discord to still access SDK func...
void GetCurrentInputDevice(discordpp::Client::GetCurrentInputDeviceCallback cb)
Asynchronously fetches the current audio input device in use by the client.
void SetAutomaticGainControl(bool on)
When enabled, automatically adjusts the microphone volume to keep it clear and consistent.
void EditUserMessage(uint64_t recipientId, uint64_t messageId, std::string const &content, discordpp::Client::EditUserMessageCallback cb)
Edits the specified message sent by the current user to the specified recipient.
std::function< void()> EndCallCallback
Callback invoked when Client::EndCall completes.
Definition discordpp.h:2925
std::function< void(discordpp::ClientResult result)> EditUserMessageCallback
Callback function for Client::EditUserMessage.
Definition discordpp.h:3017
void Connect()
Asynchronously connects the client to Discord.
void SetLobbyDeletedCallback(discordpp::Client::LobbyDeletedCallback cb)
Sets a callback to be invoked when a lobby is no longer available.
void GetDiscordClientConnectedUser(uint64_t applicationId, discordpp::Client::GetDiscordClientConnectedUserCallback callback) const
If the Discord app is running on the user's computer and the SDK establishes a connection to it,...
static int32_t GetVersionPatch()
Returns the patch version of the Discord Social SDK.
void CreateOrJoinLobby(std::string const &secret, discordpp::Client::CreateOrJoinLobbyCallback callback)
Joins the user to the specified lobby, creating one if it does not exist.
void LeaveLobby(uint64_t lobbyId, discordpp::Client::LeaveLobbyCallback callback)
Removes the current user from the specified lobby.
float GetInputVolume()
Returns the input volume for the current user's microphone.
std::function< void(discordpp::ClientResult result)> SetInputDeviceCallback
Callback function for Client::SetInputDevice.
Definition discordpp.h:2950
void SetLobbyMemberRemovedCallback(discordpp::Client::LobbyMemberRemovedCallback cb)
Sets a callback function to be invoked whenever a member of a lobby is removed and can no longer conn...
Client(Client &&other) noexcept
Move constructor for Client.
static std::string GetDefaultAudioDeviceId()
Returns the ID of the system default audio device if the user has not explicitly chosen one.
void CancelDiscordFriendRequest(uint64_t userId, discordpp::Client::UpdateRelationshipCallback cb)
Cancels an outgoing Discord friend request to the target user.
std::function< void(uint64_t lobbyId, uint64_t memberId)> LobbyMemberAddedCallback
Callback function for Client::SetLobbyMemberAddedCallback.
Definition discordpp.h:3077
void SetOnlineStatus(discordpp::StatusType status, discordpp::Client::UpdateStatusCallback callback)
Sets whether a user is online/invisible/idle/dnd on Discord.
void ClearRichPresence()
Clears the right presence for the current user.
void SetSelfMuteAll(bool mute)
Mutes the current user's microphone so that no other participant in their active calls can hear them ...
void SetStatusChangedCallback(discordpp::Client::OnStatusChanged cb)
Sets a callback function to be invoked whenever the SDKs status changes.
std::function< void(discordpp::ActivityInvite invite)> ActivityInviteCallback
Callback function for Client::SetActivityInviteCallback.
Definition discordpp.h:3097
std::function< void(discordpp::ClientResult result)> UpdateTokenCallback
Callback invoked when Client::UpdateToken completes. Once this is done it is safe to call Client::Con...
Definition discordpp.h:3011
void SetMessageUpdatedCallback(discordpp::Client::MessageUpdatedCallback cb)
Sets a callback to be invoked whenever a message is edited.
void SetOutputDevice(std::string deviceId, discordpp::Client::SetOutputDeviceCallback cb)
Asynchronously changes the audio output device in use by the client to the specified device....
void SendUserMessageWithMetadata(uint64_t recipientId, std::string const &content, std::unordered_map< std::string, std::string > const &metadata, discordpp::Client::SendUserMessageCallback cb)
Variant of Client::SendUserMessage that also accepts metadata to be sent with the message.
std::function< void(uint64_t lobbyId)> LobbyCreatedCallback
Callback function for Client::SetLobbyCreatedCallback.
Definition discordpp.h:3071
void RemoveDiscordAndGameFriend(uint64_t userId, discordpp::Client::UpdateRelationshipCallback cb)
Removes any friendship between the current user and the target user. This function will remove BOTH a...
std::function< void(uint64_t lobbyId, uint64_t memberId)> LobbyMemberRemovedCallback
Callback function for Client::SetLobbyMemberRemovedCallback.
Definition discordpp.h:3080
void SetTokenExpirationCallback(discordpp::Client::TokenExpirationCallback callback)
Get a notification when the current token is about to expire or expired.
void GetUserGuilds(discordpp::Client::GetUserGuildsCallback cb)
Fetches all of the guilds (also known as Discord servers) that the current user is a member of.
void SetGameWindowPid(int32_t pid)
When users are linking their account with Discord, which involves an OAuth2 flow, the SDK can streaml...
void GetToken(uint64_t applicationId, std::string const &code, std::string const &codeVerifier, std::string const &redirectUri, discordpp::Client::TokenExchangeCallback callback)
Exchanges an authorization code that was returned from the Client::Authorize function for an access t...
std::function< void(discordpp::ClientResult result, std::string code, std::string redirectUri)> AuthorizationCallback
Callback invoked when the Authorize function completes.
Definition discordpp.h:2984
void SetActivityInviteUpdatedCallback(discordpp::Client::ActivityInviteCallback cb)
Sets a callback function that is invoked when an existing activity invite changes....
void SetNoAudioInputThreshold(float dBFSThreshold)
Threshold that can be set to indicate when no audio is being received by the user's mic.
std::function< void(std::string joinSecret)> ActivityJoinCallback
Callback function for Client::SetActivityJoinCallback.
Definition discordpp.h:3100
static std::string ErrorToString(discordpp::Client::Error type)
Converts the Error enum to a string.
std::optional< discordpp::UserHandle > GetUser(uint64_t userId) const
Returns the UserHandle associated with the given user ID.
discordpp::RelationshipHandle GetRelationshipHandle(uint64_t userId) const
Returns the RelationshipHandle that corresponds to the relationship between the current user and the ...
std::function< void(discordpp::ClientResult result)> SendActivityInviteCallback
Callback function for Client::SendActivityInvite, Client::SendActivityJoinRequest,...
Definition discordpp.h:3094
discordpp::AuthorizationCodeVerifier CreateAuthorizationCodeVerifier()
Helper function that can create a code challenge and verifier for use in the Client::Authorize + Clie...
std::function< void(uint64_t lobbyId, uint64_t memberId, bool added)> VoiceParticipantChangedCallback
Callback function for Client::SetVoiceParticipantChangedCallback.
Definition discordpp.h:2959
discordpp::Call StartCallWithAudioCallbacks(uint64_t lobbyId, discordpp::Client::UserAudioReceivedCallback receivedCb, discordpp::Client::UserAudioCapturedCallback capturedCb)
Starts or joins a call in the specified lobby.
uint64_t GetApplicationId()
This function is used to get the application ID for the client. This is used to identify the applicat...
std::function< void(uint64_t userId, bool isDiscordRelationshipUpdate)> RelationshipDeletedCallback
Callback function for Client::SetRelationshipDeletedCallback.
Definition discordpp.h:3122
bool GetSelfDeafAll() const
Returns whether the current user is deafened in all calls.
bool SetSpeakerMode(bool speakerMode)
On mobile devices, enable speakerphone mode.
static int32_t GetVersionMinor()
Returns the minor version of the Discord Social SDK.
void AddVoiceLogCallback(discordpp::Client::LogCallback callback, discordpp::LoggingSeverity minSeverity)
Adds a callback function to be invoked for each new log message generated by the voice subsystem of t...
void AbortAuthorize()
This will abort the authorize flow if it is in progress and tear down any associated state.
Error
Represents an error state for the socket connection that the Discord SDK maintains with the Discord b...
Definition discordpp.h:2858
@ None
None.
Definition discordpp.h:2861
@ ConnectionCanceled
ConnectionCanceled.
Definition discordpp.h:2870
@ ConnectionFailed
ConnectionFailed.
Definition discordpp.h:2864
@ UnexpectedClose
UnexpectedClose.
Definition discordpp.h:2867
void UnblockUser(uint64_t userId, discordpp::Client::UpdateRelationshipCallback cb)
Unblocks the target user. Does not restore any old relationship between the users though.
void SetShowingChat(bool showingChat)
Sets whether chat messages are currently being shown in the game.
static int32_t GetVersionMajor()
Returns the major version of the Discord Social SDK.
std::function< void(discordpp::ClientResult result, uint64_t messageId)> SendUserMessageCallback
This is used for all kinds of 'send message' calls despite the name, to make sure engine bindings use...
Definition discordpp.h:3028
std::function< void(discordpp::AudioDevice device)> GetCurrentInputDeviceCallback
Callback function for Client::GetCurrentInputDevice.
Definition discordpp.h:2931
void SetLobbyCreatedCallback(discordpp::Client::LobbyCreatedCallback cb)
Sets a callback to be invoked when a lobby "becomes available" to the client.
void Authorize(discordpp::AuthorizationArgs args, discordpp::Client::AuthorizationCallback callback)
Initiates an OAuth2 flow for a user to "sign in with Discord". This flow is intended for desktop and ...
std::function< void(uint64_t userId)> UserUpdatedCallback
Callback function for Client::SetUserUpdatedCallback.
Definition discordpp.h:3131
void AcceptActivityInvite(discordpp::ActivityInvite invite, discordpp::Client::AcceptActivityInviteCallback cb)
Accepts an activity invite that the current user has received.
void SetInputDevice(std::string deviceId, discordpp::Client::SetInputDeviceCallback cb)
Asynchronously changes the audio input device in use by the client to the specified device....
void RejectGameFriendRequest(uint64_t userId, discordpp::Client::UpdateRelationshipCallback cb)
Declines an incoming game friend request from the target user.
void SetInputVolume(float inputVolume)
Sets the microphone volume for the current user.
void SetApplicationId(uint64_t applicationId)
This function is used to set the application ID for the client. This is used to identify the applicat...
std::vector< discordpp::RelationshipHandle > GetRelationships() const
Returns a list of all of the relationships the current user has with others, including all Discord re...
std::function< void(uint64_t messageId, uint64_t channelId)> MessageDeletedCallback
Callback function for Client::SetMessageDeletedCallback.
Definition discordpp.h:3035
void SetLobbyUpdatedCallback(discordpp::Client::LobbyUpdatedCallback cb)
Sets a callback to be invoked when a lobby is edited, for example if the lobby's metadata is changed.
Thread
Represents the type of thread to control thread priority on.
Definition discordpp.h:2912
@ Client
Client.
Definition discordpp.h:2915
@ Voice
Voice.
Definition discordpp.h:2918
@ Network
Network.
Definition discordpp.h:2921
void SendActivityJoinRequestReply(discordpp::ActivityInvite invite, discordpp::Client::SendActivityInviteCallback cb)
When another user requests to join the current user's party, this function is called to to allow that...
void GetGuildChannels(uint64_t guildId, discordpp::Client::GetGuildChannelsCallback cb)
Fetches all of the channels that the current user can access in the given guild.
static std::string ThreadToString(discordpp::Client::Thread type)
Converts the Thread enum to a string.
void BlockUser(uint64_t userId, discordpp::Client::UpdateRelationshipCallback cb)
Blocks the target user so that they cannot send the user friend or activity invites and cannot messag...
std::function< void(uint64_t messageId)> MessageUpdatedCallback
Callback function for Client::SetMessageUpdatedCallback.
Definition discordpp.h:3038
void SetLobbyMemberUpdatedCallback(discordpp::Client::LobbyMemberUpdatedCallback cb)
Sets a callback function to be invoked whenever a member of a lobby is changed.
bool GetSelfMuteAll() const
Returns whether the current user's microphone is muted in all calls.
std::function< void(uint64_t userId, bool isDiscordRelationshipUpdate)> RelationshipCreatedCallback
Callback function for Client::SetRelationshipCreatedCallback, and Client::SetRelationshipDeletedCallb...
Definition discordpp.h:3118
std::function< void(discordpp::ClientResult result)> DeleteUserMessageCallback
Callback function for Client::DeleteUserMessage.
Definition discordpp.h:3014
bool CanOpenMessageInDiscord(uint64_t messageId)
Returns true if the given message is able to be viewed in a Discord client.
void SetNoiseSuppression(bool on)
Enables basic background noise suppression.
void SetLobbyMemberAddedCallback(discordpp::Client::LobbyMemberAddedCallback cb)
Sets a callback function to be invoked whenever a user is added to a lobby.
void GetCurrentOutputDevice(discordpp::Client::GetCurrentOutputDeviceCallback cb)
Asynchronously fetches the current audio output device in use by the client.
void EndCall(uint64_t channelId, discordpp::Client::EndCallCallback callback)
Ends any active call, if any. Any references you have to Call objects are invalid after they are ende...
void AcceptGameFriendRequest(uint64_t userId, discordpp::Client::UpdateRelationshipCallback cb)
Accepts an incoming game friend request from the target user.
std::function< void(discordpp::ClientResult result, uint64_t id, std::string name)> FetchCurrentUserCallback
Callback function for Client::FetchCurrentUser.
Definition discordpp.h:2988
std::function< void(discordpp::ClientResult result, std::vector< discordpp::GuildChannel > guildChannels)> GetGuildChannelsCallback
Callback function for Client::GetGuildChannels.
Definition discordpp.h:3056
std::function< void(discordpp::ClientResult result)> UpdateStatusCallback
Callback function for when Client::SetOnlineStatus completes.
Definition discordpp.h:3103
std::optional< discordpp::LobbyHandle > GetLobbyHandle(uint64_t lobbyId) const
Returns a reference to the Discord lobby object for the given ID.
std::function< void(discordpp::ClientResult result, uint64_t lobbyId)> CreateOrJoinLobbyCallback
Callback function for Client::CreateOrJoinLobby.
Definition discordpp.h:3052
discordpp::Call StartCall(uint64_t channelId)
Starts or joins a call in the lobby specified by channelId (For a lobby, simply pass in the lobbyId).
void UpdateRichPresence(discordpp::Activity activity, discordpp::Client::UpdateRichPresenceCallback cb)
Updates the rich presence for the current user.
void OpenAuthorizeDeviceScreen(uint64_t clientId, std::string const &userCode)
This function is used to show the device authorization screen and is used for the case where the user...
std::function< void(int16_t *data, uint64_t samplesPerChannel, int32_t sampleRate, uint64_t channels)> UserAudioCapturedCallback
Callback function for Client::StartCallWithAudioCallbacks.
Definition discordpp.h:2975
std::function< void(std::vector< discordpp::AudioDevice > inputDevices, std::vector< discordpp::AudioDevice > outputDevices)> DeviceChangeCallback
Callback function for Client::SetDeviceChangeCallback.
Definition discordpp.h:2945
void AddLogCallback(discordpp::Client::LogCallback callback, discordpp::LoggingSeverity minSeverity)
Adds a callback function to be invoked for each new log message generated by the SDK.
void ProvisionalUserMergeCompleted(bool success)
Some functions don't work for provisional accounts, and require the user merge their account into a f...
void AcceptDiscordFriendRequest(uint64_t userId, discordpp::Client::UpdateRelationshipCallback cb)
Accepts an incoming Discord friend request from the target user.
void SendDiscordFriendRequestById(uint64_t userId, discordpp::Client::UpdateRelationshipCallback cb)
Sends a Discord friend request to the target user.
void SendGameFriendRequest(std::string const &username, discordpp::Client::SendFriendRequestCallback cb)
Sends (or accepts) a game friend request to the target user.
void SendActivityInvite(uint64_t userId, std::string const &content, discordpp::Client::SendActivityInviteCallback cb)
Sends a Discord activity invite to the specified user.
std::function< void(std::vector< discordpp::AudioDevice > devices)> GetInputDevicesCallback
Callback function for Client::GetInputDevices.
Definition discordpp.h:2937
void GetTokenFromDeviceProvisionalMerge(discordpp::DeviceAuthorizationArgs args, discordpp::AuthenticationExternalAuthType externalAuthType, std::string const &externalAuthToken, discordpp::Client::TokenExchangeCallback callback)
This function is a combination of Client::Authorize and Client::GetTokenFromProvisionalMerge,...
bool IsAuthenticated()
Returns true if the SDK has a non-empty OAuth2 token set, regardless of whether that token is valid o...
static const Client nullobj
Uninitialized instance of Client.
Definition discordpp.h:3144
discordpp::Client::Status GetStatus() const
Returns the current status of the client, see the Status enum for an explanation of the possible valu...
Arguments to the Client::GetTokenFromDevice function.
Definition discordpp.h:1499
DeviceAuthorizationArgs(DeviceAuthorizationArgs &&other) noexcept
Move constructor for DeviceAuthorizationArgs.
DeviceAuthorizationArgs(const DeviceAuthorizationArgs &arg0)
Copy constructor for DeviceAuthorizationArgs.
uint64_t ClientId() const
Optional. The Discord application ID for your game. Defaults to the value set by Client::SetApplicati...
static const DeviceAuthorizationArgs nullobj
Uninitialized instance of DeviceAuthorizationArgs.
Definition discordpp.h:1519
void SetClientId(uint64_t ClientId)
Setter for DeviceAuthorizationArgs::ClientId.
void SetScopes(std::string Scopes)
Setter for DeviceAuthorizationArgs::Scopes.
DeviceAuthorizationArgs & operator=(const DeviceAuthorizationArgs &arg0)
Copy assignment operator for DeviceAuthorizationArgs.
std::string Scopes() const
Scopes is a space separated string of the oauth scopes your game is requesting.
DeviceAuthorizationArgs & operator=(DeviceAuthorizationArgs &&other) noexcept
Move assignment operator for DeviceAuthorizationArgs.
void SetIsLinkable(bool IsLinkable)
Setter for GuildChannel::IsLinkable.
bool IsViewableAndWriteableByAllMembers() const
Whether the channel is "fully public" which means every member of the guild is able to view and send ...
std::optional< discordpp::LinkedLobby > LinkedLobby() const
Information about the currently linked lobby, if any. Currently Discord enforces that a channel can o...
uint64_t Id() const
The id of the channel.
void SetName(std::string Name)
Setter for GuildChannel::Name.
GuildChannel(const GuildChannel &arg0)
Copy constructor for GuildChannel.
void SetId(uint64_t Id)
Setter for GuildChannel::Id.
std::string Name() const
The name of the channel.
GuildChannel & operator=(const GuildChannel &arg0)
Copy assignment operator for GuildChannel.
GuildChannel & operator=(GuildChannel &&other) noexcept
Move assignment operator for GuildChannel.
GuildChannel(GuildChannel &&other) noexcept
Move constructor for GuildChannel.
bool IsLinkable() const
Whether the current user is able to link this channel to a lobby.
void SetLinkedLobby(std::optional< discordpp::LinkedLobby > LinkedLobby)
Setter for GuildChannel::LinkedLobby.
void SetIsViewableAndWriteableByAllMembers(bool IsViewableAndWriteableByAllMembers)
Setter for GuildChannel::IsViewableAndWriteableByAllMembers.
static const GuildChannel nullobj
Uninitialized instance of GuildChannel.
Definition discordpp.h:1995
void SetName(std::string Name)
Setter for GuildMinimal::Name.
std::string Name() const
The name of the guild.
void SetId(uint64_t Id)
Setter for GuildMinimal::Id.
static const GuildMinimal nullobj
Uninitialized instance of GuildMinimal.
Definition discordpp.h:1950
GuildMinimal & operator=(GuildMinimal &&other) noexcept
Move assignment operator for GuildMinimal.
GuildMinimal & operator=(const GuildMinimal &arg0)
Copy assignment operator for GuildMinimal.
GuildMinimal(const GuildMinimal &arg0)
Copy constructor for GuildMinimal.
GuildMinimal(GuildMinimal &&other) noexcept
Move constructor for GuildMinimal.
uint64_t Id() const
The id of the guild.
Struct that stores information about the channel that a lobby is linked to.
Definition discordpp.h:2103
uint64_t GuildId() const
The id of the guild (aka server) that owns the linked channel.
void SetName(std::string Name)
Setter for LinkedChannel::Name.
LinkedChannel & operator=(LinkedChannel &&other) noexcept
Move assignment operator for LinkedChannel.
LinkedChannel & operator=(const LinkedChannel &arg0)
Copy assignment operator for LinkedChannel.
std::string Name() const
The name of the linked channel.
void SetGuildId(uint64_t GuildId)
Setter for LinkedChannel::GuildId.
static const LinkedChannel nullobj
Uninitialized instance of LinkedChannel.
Definition discordpp.h:2122
LinkedChannel(const LinkedChannel &arg0)
Copy constructor for LinkedChannel.
void SetId(uint64_t Id)
Setter for LinkedChannel::Id.
uint64_t Id() const
The id of the linked channel.
LinkedChannel(LinkedChannel &&other) noexcept
Move constructor for LinkedChannel.
Struct that stores information about the lobby linked to a channel.
Definition discordpp.h:2057
LinkedLobby & operator=(const LinkedLobby &arg0)
Copy assignment operator for LinkedLobby.
LinkedLobby(const LinkedLobby &arg0)
Copy constructor for LinkedLobby.
uint64_t ApplicationId() const
The ID of the application that owns the lobby.
void SetLobbyId(uint64_t LobbyId)
Setter for LinkedLobby::LobbyId.
static const LinkedLobby nullobj
Uninitialized instance of LinkedLobby.
Definition discordpp.h:2076
void SetApplicationId(uint64_t ApplicationId)
Setter for LinkedLobby::ApplicationId.
LinkedLobby & operator=(LinkedLobby &&other) noexcept
Move assignment operator for LinkedLobby.
uint64_t LobbyId() const
The ID of the lobby.
LinkedLobby(LinkedLobby &&other) noexcept
Move constructor for LinkedLobby.
A LobbyHandle represents a single lobby in the SDK. A lobby can be thought of as just an arbitrary,...
Definition discordpp.h:2509
LobbyHandle(LobbyHandle &&other) noexcept
Move constructor for LobbyHandle.
std::optional< discordpp::LinkedChannel > LinkedChannel() const
Returns information about the channel linked to this lobby, if any.
static const LobbyHandle nullobj
Uninitialized instance of LobbyHandle.
Definition discordpp.h:2528
LobbyHandle & operator=(const LobbyHandle &other)
Copy assignment operator for LobbyHandle.
std::optional< discordpp::CallInfoHandle > GetCallInfoHandle() const
Returns a reference to the CallInfoHandle if there is an active voice call in this lobby.
std::unordered_map< std::string, std::string > Metadata() const
Returns any developer supplied metadata for this lobby.
std::optional< discordpp::LobbyMemberHandle > GetLobbyMemberHandle(uint64_t memberId) const
Returns a reference to the LobbyMemberHandle for the given user ID, if they are a member of this lobb...
LobbyHandle(const LobbyHandle &other)
Copy constructor for LobbyHandle.
std::vector< discordpp::LobbyMemberHandle > LobbyMembers() const
Returns a list of the LobbyMemberHandle objects for each member of this lobby.
uint64_t Id() const
Returns the id of the lobby.
std::vector< uint64_t > LobbyMemberIds() const
Returns a list of the user IDs that are members of this lobby.
LobbyHandle & operator=(LobbyHandle &&other) noexcept
Move assignment operator for LobbyHandle.
A LobbyMemberHandle represents the state of a single user in a Lobby.
Definition discordpp.h:2366
LobbyMemberHandle & operator=(const LobbyMemberHandle &other)
Copy assignment operator for LobbyMemberHandle.
static const LobbyMemberHandle nullobj
Uninitialized instance of LobbyMemberHandle.
Definition discordpp.h:2385
uint64_t Id() const
The user id of the lobby member.
LobbyMemberHandle(const LobbyMemberHandle &other)
Copy constructor for LobbyMemberHandle.
bool Connected() const
Returns true if the user is currently connected to the lobby.
LobbyMemberHandle & operator=(LobbyMemberHandle &&other) noexcept
Move assignment operator for LobbyMemberHandle.
std::optional< discordpp::UserHandle > User() const
The UserHandle of the lobby member.
bool CanLinkLobby() const
Returns true if the user is allowed to link a channel to this lobby.
LobbyMemberHandle(LobbyMemberHandle &&other) noexcept
Move constructor for LobbyMemberHandle.
std::unordered_map< std::string, std::string > Metadata() const
Metadata is a set of string key/value pairs that the game developer can use.
A MessageHandle represents a single message received by the SDK.
Definition discordpp.h:2685
uint64_t AuthorId() const
Returns the user ID of the user who sent this message.
std::optional< discordpp::ChannelHandle > Channel() const
Returns the ChannelHandle for the channel this message was sent in.
static const MessageHandle nullobj
Uninitialized instance of MessageHandle.
Definition discordpp.h:2704
std::optional< discordpp::UserHandle > Recipient() const
Returns the UserHandle for the other participant in a DM, if this message was sent in a DM.
MessageHandle & operator=(const MessageHandle &other)
Copy assignment operator for MessageHandle.
uint64_t Id() const
Returns the ID of this message.
std::optional< discordpp::UserHandle > Author() const
Returns the UserHandle for the author of this message.
MessageHandle & operator=(MessageHandle &&other) noexcept
Move assignment operator for MessageHandle.
uint64_t EditedTimestamp() const
The timestamp in millis since the epoch when the message was most recently edited.
MessageHandle(const MessageHandle &other)
Copy constructor for MessageHandle.
std::string Content() const
Returns the content of this message, if any.
std::unordered_map< std::string, std::string > Metadata() const
Returns any metadata the developer included with this message.
std::string RawContent() const
Returns the content of this message, if any, but without replacing any markup from emojis and mention...
std::optional< discordpp::LobbyHandle > Lobby() const
Returns the LobbyHandle this message was sent in, if it was sent in a lobby.
uint64_t RecipientId() const
When this message was sent in a DM or Ephemeral DM, this method will return the ID of the other user ...
uint64_t SentTimestamp() const
The timestamp in millis since the epoch when the message was sent.
std::optional< discordpp::DisclosureTypes > DisclosureType() const
If this is an auto-generated message that is explaining some integration behavior to users,...
uint64_t ChannelId() const
Returns the channel ID this message was sent in.
MessageHandle(MessageHandle &&other) noexcept
Move constructor for MessageHandle.
bool SentFromGame() const
Returns true if this message was sent in-game, otherwise false (i.e. from Discord itself).
std::optional< discordpp::AdditionalContent > AdditionalContent() const
If the message contains non-text content, such as images, videos, embeds, polls, etc,...
A RelationshipHandle represents the relationship between the current user and a target user on Discor...
Definition discordpp.h:2185
RelationshipHandle & operator=(const RelationshipHandle &other)
Copy assignment operator for RelationshipHandle.
RelationshipHandle(const RelationshipHandle &other)
Copy constructor for RelationshipHandle.
uint64_t Id() const
Returns the ID of the target user in this relationship.
discordpp::RelationshipType DiscordRelationshipType() const
Returns the type of the Discord relationship.
RelationshipHandle(RelationshipHandle &&other) noexcept
Move constructor for RelationshipHandle.
discordpp::RelationshipType GameRelationshipType() const
Returns the type of the Game relationship.
static const RelationshipHandle nullobj
Uninitialized instance of RelationshipHandle.
Definition discordpp.h:2204
std::optional< discordpp::UserHandle > User() const
Returns a handle to the target user in this relationship, if one is available. This would be the user...
RelationshipHandle & operator=(RelationshipHandle &&other) noexcept
Move assignment operator for RelationshipHandle.
A UserHandle represents a single user on Discord that the SDK knows about and contains basic account ...
Definition discordpp.h:2241
uint64_t Id() const
Returns the ID of this user.
UserHandle & operator=(UserHandle &&other) noexcept
Move assignment operator for UserHandle.
std::string Username() const
Returns the globally unique username of this user.
static const UserHandle nullobj
Uninitialized instance of UserHandle.
Definition discordpp.h:2275
std::optional< std::string > Avatar() const
Returns the hash of the user's Discord profile avatar, if one is set.
UserHandle(const UserHandle &arg0)
Copy constructor for UserHandle.
discordpp::StatusType Status() const
Returns the user's online/offline/idle status.
UserHandle(UserHandle &&other) noexcept
Move constructor for UserHandle.
std::string AvatarUrl(discordpp::UserHandle::AvatarType animatedType, discordpp::UserHandle::AvatarType staticType) const
Returns a CDN url to the user's Discord profile avatar.
AvatarType
The desired type of avatar url to generate for a User.
Definition discordpp.h:2249
@ Jpeg
Jpeg.
Definition discordpp.h:2261
@ Gif
Gif.
Definition discordpp.h:2252
@ Webp
Webp.
Definition discordpp.h:2255
@ Png
Png.
Definition discordpp.h:2258
bool IsProvisional() const
Returns true if this user is a provisional account.
std::optional< std::string > GlobalName() const
Returns the preferred display name of this user, if one is set.
std::optional< discordpp::Activity > GameActivity() const
Returns the user's rich presence activity that is associated with the current game,...
UserHandle & operator=(const UserHandle &arg0)
Copy assignment operator for UserHandle.
static std::string AvatarTypeToString(discordpp::UserHandle::AvatarType type)
Converts the AvatarType enum to a string.
std::string DisplayName() const
Returns the user's preferred name, if one is set, otherwise returns their unique username.
discordpp::RelationshipHandle Relationship() const
Returns a reference to the RelationshipHandle between the currently authenticated user and this user,...
Settings for the void auto detection threshold for picking up activity from a user's mic.
Definition discordpp.h:1609
VADThresholdSettings & operator=(VADThresholdSettings &&other) noexcept
Move assignment operator for VADThresholdSettings.
VADThresholdSettings(VADThresholdSettings &&other) noexcept
Move constructor for VADThresholdSettings.
static const VADThresholdSettings nullobj
Uninitialized instance of VADThresholdSettings.
Definition discordpp.h:1628
bool Automatic() const
Whether or not Discord is currently automatically setting and detecting the appropriate threshold to ...
float VadThreshold() const
The current void auto detection threshold value, has a range of -100, 0 and defaults to -60.
void SetAutomatic(bool Automatic)
Setter for VADThresholdSettings::Automatic.
void SetVadThreshold(float VadThreshold)
Setter for VADThresholdSettings::VadThreshold.
A VoiceStateHandle represents the state of a single participant in a Discord voice call.
Definition discordpp.h:1567
VoiceStateHandle & operator=(VoiceStateHandle &&other) noexcept
Move assignment operator for VoiceStateHandle.
bool SelfMute() const
Returns true if the given user has muted themselves so that no one else in the call can hear them.
static const VoiceStateHandle nullobj
Uninitialized instance of VoiceStateHandle.
Definition discordpp.h:1586
bool SelfDeaf() const
Returns true if the given user has deafened themselves so that no one else in the call can hear them ...
VoiceStateHandle(VoiceStateHandle &&other) noexcept
Move constructor for VoiceStateHandle.
VoiceStateHandle & operator=(const VoiceStateHandle &other)
Copy assignment operator for VoiceStateHandle.
VoiceStateHandle(const VoiceStateHandle &other)
Copy constructor for VoiceStateHandle.
The namespace for the generated Discord SDK bindings.
Definition discordpp.h:16
ActivityPartyPrivacy
Allows your game to control the privacy of the party the user is in.
Definition discordpp.h:51
@ Public
The party is public, which means that the user is in a party which could be joinable by either friend...
Definition discordpp.h:65
@ Private
The party is private (or unknown), which means that the user is in a party but it is not joinable wit...
Definition discordpp.h:59
DisclosureTypes
Enum that represents various informational disclosures that Discord may make to users,...
Definition discordpp.h:538
@ MessageDataVisibleOnDiscord
This disclosure type happens the first time a user sends a message in game, and that message will be ...
Definition discordpp.h:544
const char * EnumToString(discordpp::ActivityActionTypes value)
Converts a discordpp::ActivityActionTypes to a string.
Definition discordpp.h:4527
HttpStatusCode
Enum that represents the various HTTP status codes that can be returned.
Definition discordpp.h:189
@ RequestHeaderFieldsTooLarge
RequestHeaderFieldsTooLarge.
Definition discordpp.h:336
@ PayloadTooLarge
PayloadTooLarge.
Definition discordpp.h:297
@ MultiStatus
MultiStatus.
Definition discordpp.h:228
@ VariantAlsoNegotiates
VariantAlsoNegotiates.
Definition discordpp.h:357
@ Gone
Gone.
Definition discordpp.h:288
@ BadGateway
BadGateway.
Definition discordpp.h:345
@ Created
Created.
Definition discordpp.h:210
@ TemporaryRedirect
TemporaryRedirect.
Definition discordpp.h:252
@ ServiceUnavailable
ServiceUnavailable.
Definition discordpp.h:348
@ MovedPermanently
MovedPermanently.
Definition discordpp.h:240
@ PreconditionFailed
PreconditionFailed.
Definition discordpp.h:294
@ RequestTimeout
RequestTimeout.
Definition discordpp.h:282
@ Accepted
Accepted.
Definition discordpp.h:213
@ NonAuthoritativeInfo
NonAuthoritativeInfo.
Definition discordpp.h:216
@ NotFound
NotFound.
Definition discordpp.h:270
@ FailedDependency
FailedDependency.
Definition discordpp.h:321
@ PaymentRequired
PaymentRequired.
Definition discordpp.h:264
@ PreconditionRequired
PreconditionRequired.
Definition discordpp.h:330
@ ResetContent
ResetContent.
Definition discordpp.h:222
@ SwitchingProtocols
SwitchingProtocols.
Definition discordpp.h:198
@ HttpVersionNotSupported
HttpVersionNotSupported.
Definition discordpp.h:354
@ Found
Found.
Definition discordpp.h:243
@ Processing
Processing.
Definition discordpp.h:201
@ None
None.
Definition discordpp.h:192
@ ExpectationFailed
ExpectationFailed.
Definition discordpp.h:309
@ Forbidden
Forbidden.
Definition discordpp.h:267
@ PartialContent
PartialContent.
Definition discordpp.h:225
@ SeeOther
SeeOther.
Definition discordpp.h:246
@ EarlyHints
EarlyHints.
Definition discordpp.h:204
@ LengthRequired
LengthRequired.
Definition discordpp.h:291
@ MethodNotAllowed
MethodNotAllowed.
Definition discordpp.h:273
@ NotExtended
NotExtended.
Definition discordpp.h:366
@ RangeNotSatisfiable
RangeNotSatisfiable.
Definition discordpp.h:306
@ NotImplemented
NotImplemented.
Definition discordpp.h:342
@ BadRequest
BadRequest.
Definition discordpp.h:258
@ Continue
Continue.
Definition discordpp.h:195
@ LoopDetected
LoopDetected.
Definition discordpp.h:363
@ UnsupportedMediaType
UnsupportedMediaType.
Definition discordpp.h:303
@ NetworkAuthorizationRequired
NetworkAuthorizationRequired.
Definition discordpp.h:369
@ ImUsed
ImUsed.
Definition discordpp.h:234
@ MultipleChoices
MultipleChoices.
Definition discordpp.h:237
@ Ok
Ok.
Definition discordpp.h:207
@ TooManyRequests
TooManyRequests.
Definition discordpp.h:333
@ ProxyAuthRequired
ProxyAuthRequired.
Definition discordpp.h:279
@ UnprocessableEntity
UnprocessableEntity.
Definition discordpp.h:315
@ MisdirectedRequest
MisdirectedRequest.
Definition discordpp.h:312
@ PermanentRedirect
PermanentRedirect.
Definition discordpp.h:255
@ NotModified
NotModified.
Definition discordpp.h:249
@ AlreadyReported
AlreadyReported.
Definition discordpp.h:231
@ NoContent
NoContent.
Definition discordpp.h:219
@ Locked
Locked.
Definition discordpp.h:318
@ GatewayTimeout
GatewayTimeout.
Definition discordpp.h:351
@ Unauthorized
Unauthorized.
Definition discordpp.h:261
@ UpgradeRequired
UpgradeRequired.
Definition discordpp.h:327
@ InsufficientStorage
InsufficientStorage.
Definition discordpp.h:360
@ InternalServerError
InternalServerError.
Definition discordpp.h:339
@ TooEarly
TooEarly.
Definition discordpp.h:324
@ Conflict
Conflict.
Definition discordpp.h:285
@ UriTooLong
UriTooLong.
Definition discordpp.h:300
@ NotAcceptable
NotAcceptable.
Definition discordpp.h:276
AuthorizationTokenType
Represents the type of auth token used by the SDK, either the normal tokens produced by the Discord d...
Definition discordpp.h:549
@ Bearer
Bearer.
Definition discordpp.h:555
@ User
User.
Definition discordpp.h:552
ChannelType
Enum that represents the various channel types on Discord.
Definition discordpp.h:422
@ GuildForum
GuildForum.
Definition discordpp.h:461
@ Dm
Dm.
Definition discordpp.h:428
@ Lobby
Lobby.
Definition discordpp.h:467
@ GuildNews
GuildNews.
Definition discordpp.h:440
@ GuildVoice
GuildVoice.
Definition discordpp.h:431
@ GuildPublicThread
GuildPublicThread.
Definition discordpp.h:449
@ GuildNewsThread
GuildNewsThread.
Definition discordpp.h:446
@ GuildDirectory
GuildDirectory.
Definition discordpp.h:458
@ GuildCategory
GuildCategory.
Definition discordpp.h:437
@ GuildStageVoice
GuildStageVoice.
Definition discordpp.h:455
@ GuildMedia
GuildMedia.
Definition discordpp.h:464
@ GuildStore
GuildStore.
Definition discordpp.h:443
@ GuildText
GuildText.
Definition discordpp.h:425
@ GroupDm
GroupDm.
Definition discordpp.h:434
@ EphemeralDm
EphemeralDm.
Definition discordpp.h:470
@ GuildPrivateThread
GuildPrivateThread.
Definition discordpp.h:452
AuthenticationCodeChallengeMethod
Represents the crypto method used to generate a code challenge.
Definition discordpp.h:375
@ S256
S256.
Definition discordpp.h:378
RelationshipType
Enum that represents the possible types of relationships that can exist between two users.
Definition discordpp.h:474
@ PendingIncoming
The current user has received a friend request from the target user, but it is not yet accepted.
Definition discordpp.h:489
@ Implicit
The Implicit type is documented for visibility, but should be unused in the SDK.
Definition discordpp.h:496
@ Suggestion
The Suggestion type is documented for visibility, but should be unused in the SDK.
Definition discordpp.h:499
@ PendingOutgoing
The current user has sent a friend request to the target user, but it is not yet accepted.
Definition discordpp.h:493
@ Blocked
The current user has blocked the target user, and so certain actions such as sending messages between...
Definition discordpp.h:484
@ None
The user has no relationship with the other user.
Definition discordpp.h:477
@ Friend
The user is friends with the other user.
Definition discordpp.h:480
AuthenticationExternalAuthType
Represents the various identity providers that can be used to authenticate a provisional account user...
Definition discordpp.h:560
@ EpicOnlineServicesIdToken
EpicOnlineServicesIdToken.
Definition discordpp.h:569
@ EpicOnlineServicesAccessToken
EpicOnlineServicesAccessToken.
Definition discordpp.h:566
@ SteamSessionTicket
SteamSessionTicket.
Definition discordpp.h:572
@ OIDC
OIDC.
Definition discordpp.h:563
@ UnityServicesIdToken
UnityServicesIdToken.
Definition discordpp.h:575
LoggingSeverity
Enum that represents the various log levels supported by the SDK.
Definition discordpp.h:579
@ Warning
Warning.
Definition discordpp.h:588
@ Info
Info.
Definition discordpp.h:585
@ None
None.
Definition discordpp.h:594
@ Error
Error.
Definition discordpp.h:591
@ Verbose
Verbose.
Definition discordpp.h:582
ActivityGamePlatforms
Represents the type of platforms that an activity invite can be accepted on.
Definition discordpp.h:99
@ Embedded
Embedded.
Definition discordpp.h:117
@ Xbox
Xbox.
Definition discordpp.h:105
@ Desktop
Desktop.
Definition discordpp.h:102
@ Samsung
Samsung.
Definition discordpp.h:108
@ PS5
PS5.
Definition discordpp.h:123
@ PS4
PS4.
Definition discordpp.h:120
@ IOS
IOS.
Definition discordpp.h:111
@ Android
Android.
Definition discordpp.h:114
ActivityTypes
Discord RichPresence supports multiple types of activities that a user can be doing.
Definition discordpp.h:74
@ Watching
Watching.
Definition discordpp.h:86
@ Competing
Competing.
Definition discordpp.h:92
@ HangStatus
HangStatus.
Definition discordpp.h:95
@ Listening
Listening.
Definition discordpp.h:83
@ Streaming
Streaming.
Definition discordpp.h:80
@ CustomStatus
CustomStatus.
Definition discordpp.h:89
@ Playing
Playing.
Definition discordpp.h:77
StatusType
Enum that specifies the various online statuses for a user.
Definition discordpp.h:506
@ Blocked
Blocked.
Definition discordpp.h:515
@ Online
The user is online and recently active.
Definition discordpp.h:509
@ Dnd
The user is online, but wishes to suppress notifications for the time being.
Definition discordpp.h:522
@ Unknown
Unknown.
Definition discordpp.h:531
@ Invisible
The user is online, but wishes to appear as if they are offline to other users.
Definition discordpp.h:525
@ Offline
The user is offline and not connected to Discord.
Definition discordpp.h:512
@ Streaming
The user is online and is actively streaming content.
Definition discordpp.h:528
@ Idle
The user is online, but has not been active for a while and may be away from their computer.
Definition discordpp.h:519
void RunCallbacks()
Definition discordpp.h:29
AudioModeType
Represents whether a voice call is using push to talk or auto voice detection.
Definition discordpp.h:407
@ MODE_PTT
MODE_PTT.
Definition discordpp.h:416
@ MODE_VAD
MODE_VAD.
Definition discordpp.h:413
@ MODE_UNINIT
MODE_UNINIT.
Definition discordpp.h:410
ErrorType
Enum representing various types of errors the SDK returns.
Definition discordpp.h:127
@ HTTPError
An HTTP call was made to Discord's servers but a non success HTTP status code was returned....
Definition discordpp.h:142
@ NetworkError
The user is offline or there was some network issue that prevented an underlying HTTP call from succe...
Definition discordpp.h:134
@ AuthorizationFailed
An authorization function failed, but not necessarily as the result of an HTTP call that returned an ...
Definition discordpp.h:176
@ ClientNotReady
An operation such as sending a friend request or joining a lobby was attempted but the Client is not ...
Definition discordpp.h:152
@ None
No error, the operation was successful.
Definition discordpp.h:130
@ Aborted
The user or developer aborted an operation, such as an authorization flow.
Definition discordpp.h:171
@ RPCError
An RPC call was made to Discord's desktop application, but it returned a non-success result....
Definition discordpp.h:181
@ ValidationError
Used when an SDK method is called but the inputs don't pass local validation. For example if one atte...
Definition discordpp.h:168
@ ClientDestroyed
The Client has been destroyed and so this operation cannot complete.
Definition discordpp.h:158
@ Disabled
An operation was temporarily disabled for stability reasons.
Definition discordpp.h:155
DiscordObjectState
Represents the memory state of a Discord object.
Definition discordpp.h:19
@ Invalid
The object has been freed.
Definition discordpp.h:21
@ Owned
The object is owned by the C++ wrapper and methods can be called on it.
Definition discordpp.h:23
AdditionalContentType
Represents the type of additional content contained in a message.
Definition discordpp.h:382
@ Sticker
Sticker.
Definition discordpp.h:403
@ VoiceMessage
VoiceMessage.
Definition discordpp.h:394
@ Other
Other.
Definition discordpp.h:385
@ Poll
Poll.
Definition discordpp.h:391
@ Thread
Thread.
Definition discordpp.h:397
@ Attachment
Attachment.
Definition discordpp.h:388
@ Embed
Embed.
Definition discordpp.h:400
ActivityActionTypes
ActivityActionTypes represents the type of invite being sent to a user.
Definition discordpp.h:41
@ Join
Join.
Definition discordpp.h:44
@ JoinRequest
JoinRequest.
Definition discordpp.h:47