2#ifndef DISCORD_HEADER_DISCORDPP_H_
3#define DISCORD_HEADER_DISCORDPP_H_
12#include <unordered_map>
31 Discord_RunCallbacks();
598class ActivityTimestamps;
600class ActivitySecrets;
604class AuthorizationCodeChallenge;
605class AuthorizationCodeVerifier;
606class AuthorizationArgs;
607class DeviceAuthorizationArgs;
608class VoiceStateHandle;
609class VADThresholdSettings;
616class RelationshipHandle;
618class LobbyMemberHandle;
620class AdditionalContent;
631 mutable Discord_ActivityInvite instance_{};
637 Discord_ActivityInvite* instance()
const {
return &instance_; }
723 mutable Discord_ActivityAssets instance_{};
729 Discord_ActivityAssets* instance()
const {
return &instance_; }
788 mutable Discord_ActivityTimestamps instance_{};
794 Discord_ActivityTimestamps* instance()
const {
return &instance_; }
842 mutable Discord_ActivityParty instance_{};
848 Discord_ActivityParty* instance()
const {
return &instance_; }
880 std::string
Id()
const;
904 mutable Discord_ActivitySecrets instance_{};
910 Discord_ActivitySecrets* instance()
const {
return &instance_; }
948 mutable Discord_ActivityButton instance_{};
954 Discord_ActivityButton* instance()
const {
return &instance_; }
1173 mutable Discord_Activity instance_{};
1179 Discord_Activity* instance()
const {
return &instance_; }
1232 std::optional<std::string>
State()
const;
1253 std::optional<discordpp::ActivityAssets>
Assets()
const;
1266 std::optional<discordpp::ActivityParty>
Party()
const;
1272 std::optional<discordpp::ActivitySecrets>
Secrets()
const;
1297 mutable Discord_ClientResult instance_{};
1303 Discord_ClientResult* instance()
const {
return &instance_; }
1390 mutable Discord_AuthorizationCodeChallenge instance_{};
1396 Discord_AuthorizationCodeChallenge* instance()
const {
return &instance_; }
1437 mutable Discord_AuthorizationCodeVerifier instance_{};
1443 Discord_AuthorizationCodeVerifier* instance()
const {
return &instance_; }
1482 mutable Discord_AuthorizationArgs instance_{};
1488 Discord_AuthorizationArgs* instance()
const {
return &instance_; }
1541 std::optional<std::string>
State()
const;
1549 std::optional<std::string>
Nonce()
const;
1566 mutable Discord_DeviceAuthorizationArgs instance_{};
1572 Discord_DeviceAuthorizationArgs* instance()
const {
return &instance_; }
1634 mutable Discord_VoiceStateHandle instance_{};
1640 Discord_VoiceStateHandle* instance()
const {
return &instance_; }
1676 mutable Discord_VADThresholdSettings instance_{};
1682 Discord_VADThresholdSettings* instance()
const {
return &instance_; }
1720 mutable Discord_Call instance_{};
1785 Discord_Call* instance()
const {
return &instance_; }
1947 mutable Discord_ChannelHandle instance_{};
1953 Discord_ChannelHandle* instance()
const {
return &instance_; }
1998 mutable Discord_GuildMinimal instance_{};
2004 Discord_GuildMinimal* instance()
const {
return &instance_; }
2043 mutable Discord_GuildChannel instance_{};
2049 Discord_GuildChannel* instance()
const {
return &instance_; }
2124 mutable Discord_LinkedLobby instance_{};
2130 Discord_LinkedLobby* instance()
const {
return &instance_; }
2170 mutable Discord_LinkedChannel instance_{};
2176 Discord_LinkedChannel* instance()
const {
return &instance_; }
2252 mutable Discord_RelationshipHandle instance_{};
2258 Discord_RelationshipHandle* instance()
const {
return &instance_; }
2293 std::optional<discordpp::UserHandle>
User()
const;
2308 mutable Discord_UserHandle instance_{};
2329 Discord_UserHandle* instance()
const {
return &instance_; }
2433 mutable Discord_LobbyMemberHandle instance_{};
2439 Discord_LobbyMemberHandle* instance()
const {
return &instance_; }
2482 std::unordered_map<std::string, std::string>
Metadata()
const;
2485 std::optional<discordpp::UserHandle>
User()
const;
2576 mutable Discord_LobbyHandle instance_{};
2582 Discord_LobbyHandle* instance()
const {
return &instance_; }
2633 std::unordered_map<std::string, std::string>
Metadata()
const;
2640 mutable Discord_AdditionalContent instance_{};
2646 Discord_AdditionalContent* instance()
const {
return &instance_; }
2685 std::optional<std::string>
Title()
const;
2752 mutable Discord_MessageHandle instance_{};
2758 Discord_MessageHandle* instance()
const {
return &instance_; }
2787 std::optional<discordpp::UserHandle>
Author()
const;
2793 std::optional<discordpp::ChannelHandle>
Channel()
const;
2818 std::optional<discordpp::LobbyHandle>
Lobby()
const;
2825 std::unordered_map<std::string, std::string>
Metadata()
const;
2856 mutable Discord_AudioDevice instance_{};
2862 Discord_AudioDevice* instance()
const {
return &instance_; }
2911 mutable Discord_Client instance_{};
3003 std::function<void(std::vector<discordpp::AudioDevice> devices)>;
3007 std::function<void(std::vector<discordpp::AudioDevice> devices)>;
3011 std::function<void(std::vector<discordpp::AudioDevice> inputDevices,
3012 std::vector<discordpp::AudioDevice> outputDevices)>;
3025 std::function<void(uint64_t lobbyId, uint64_t memberId,
bool added)>;
3032 uint64_t samplesPerChannel,
3035 bool& outShouldMute)>;
3041 void(int16_t* data, uint64_t samplesPerChannel, int32_t sampleRate, uint64_t channels)>;
3058 std::string accessToken,
3059 std::string refreshToken,
3062 std::string scopes)>;
3127 std::vector<discordpp::GuildChannel> guildChannels)>;
3131 std::vector<discordpp::GuildMinimal> guilds)>;
3191 std::function<void(uint64_t userId,
bool isDiscordRelationshipUpdate)>;
3198 std::function<void(uint64_t userId,
bool isDiscordRelationshipUpdate)>;
3203 std::optional<discordpp::UserHandle> user)>;
3208 Discord_Client* instance()
const {
return &instance_; }
3230 explicit Client(std::string apiBase, std::string webBase);
3626 std::string
const& token,
3664 std::string
const& externalAuthToken,
3691 std::string
const& code,
3692 std::string
const& codeVerifier,
3693 std::string
const& redirectUri,
3763 std::string
const& externalAuthToken,
3797 std::string
const& code,
3798 std::string
const& codeVerifier,
3799 std::string
const& redirectUri,
3801 std::string
const& externalAuthToken,
3837 std::string
const& refreshToken,
3872 std::string
const& name,
3906 std::string
const& content,
3944 std::string
const& content,
3954 std::string
const& content,
3955 std::unordered_map<std::string, std::string>
const& metadata,
3971 std::string
const& content,
3981 std::string
const& content,
3982 std::unordered_map<std::string, std::string>
const& metadata,
4149 std::string
const& secret,
4150 std::unordered_map<std::string, std::string>
const& lobbyMetadata,
4151 std::unordered_map<std::string, std::string>
const& memberMetadata,
4311 std::string
const& content,
4564 uint64_t applicationId,
4572 std::optional<discordpp::UserHandle>
GetUser(uint64_t userId)
const;
4585 mutable Discord_CallInfoHandle instance_{};
4591 Discord_CallInfoHandle* instance()
const {
return &instance_; }
4635 return "JoinRequest";
4665 return "CustomStatus";
4669 return "HangStatus";
4705 return "NetworkError";
4709 return "ClientNotReady";
4713 return "ClientDestroyed";
4715 return "ValidationError";
4719 return "AuthorizationFailed";
4735 return "SwitchingProtocols";
4737 return "Processing";
4739 return "EarlyHints";
4747 return "NonAuthoritativeInfo";
4751 return "ResetContent";
4753 return "PartialContent";
4755 return "MultiStatus";
4757 return "AlreadyReported";
4761 return "MultipleChoices";
4763 return "MovedPermanently";
4769 return "NotModified";
4771 return "TemporaryRedirect";
4773 return "PermanentRedirect";
4775 return "BadRequest";
4777 return "Unauthorized";
4779 return "PaymentRequired";
4785 return "MethodNotAllowed";
4787 return "NotAcceptable";
4789 return "ProxyAuthRequired";
4791 return "RequestTimeout";
4797 return "LengthRequired";
4799 return "PreconditionFailed";
4801 return "PayloadTooLarge";
4803 return "UriTooLong";
4805 return "UnsupportedMediaType";
4807 return "RangeNotSatisfiable";
4809 return "ExpectationFailed";
4811 return "MisdirectedRequest";
4813 return "UnprocessableEntity";
4817 return "FailedDependency";
4821 return "UpgradeRequired";
4823 return "PreconditionRequired";
4825 return "TooManyRequests";
4827 return "RequestHeaderFieldsTooLarge";
4829 return "InternalServerError";
4831 return "NotImplemented";
4833 return "BadGateway";
4835 return "ServiceUnavailable";
4837 return "GatewayTimeout";
4839 return "HttpVersionNotSupported";
4841 return "VariantAlsoNegotiates";
4843 return "InsufficientStorage";
4845 return "LoopDetected";
4847 return "NotExtended";
4849 return "NetworkAuthorizationRequired";
4871 return "Attachment";
4875 return "VoiceMessage";
4893 return "SignalingConnectionFailed";
4895 return "SignalingUnexpectedClose";
4897 return "VoiceConnectionFailed";
4899 return "JoinTimeout";
4911 return "MODE_UNINIT";
4925 return "Disconnected";
4929 return "Connecting";
4931 return "SignalingConnected";
4935 return "Reconnecting";
4937 return "Disconnecting";
4951 return "GuildVoice";
4955 return "GuildCategory";
4959 return "GuildStore";
4961 return "GuildNewsThread";
4963 return "GuildPublicThread";
4965 return "GuildPrivateThread";
4967 return "GuildStageVoice";
4969 return "GuildDirectory";
4971 return "GuildForum";
4973 return "GuildMedia";
4977 return "EphemeralDm";
4993 return "PendingIncoming";
4995 return "PendingOutgoing";
4999 return "Suggestion";
5049 return "MessageDataVisibleOnDiscord";
5061 return "ConnectionFailed";
5063 return "UnexpectedClose";
5065 return "ConnectionCanceled";
5075 return "Disconnected";
5077 return "Connecting";
5083 return "Reconnecting";
5085 return "Disconnecting";
5125 return "EpicOnlineServicesAccessToken";
5127 return "EpicOnlineServicesIdToken";
5129 return "SteamSessionTicket";
5131 return "UnityServicesIdToken";
5156#ifdef DISCORDPP_IMPLEMENTATION
5157#undef DISCORDPP_IMPLEMENTATION
5159#pragma clang diagnostic push
5160#pragma clang diagnostic ignored "-Wunused-parameter"
5163std::function<void(std::function<
void()>)> s_synchronizationContext;
5165inline bool HasSynchronizationContext()
5167 return !!s_synchronizationContext;
5170inline void PostTask(std::function<
void()> task)
5172 assert(s_synchronizationContext);
5173 s_synchronizationContext(std::move(task));
5176void SetSynchronizationContext(std::function<
void(std::function<
void()>)> executor)
5178 s_synchronizationContext = std::move(executor);
5181template <
typename T>
5182struct TDelegateUserData {
5184 TDelegateUserData(T delegate)
5185 : delegate{delegate}
5189 static void Free(
void* ptr) {
delete reinterpret_cast<TDelegateUserData*
>(ptr); }
5191 static T& Get(
void* userData)
5193 return reinterpret_cast<TDelegateUserData*
>(userData)->delegate;
5197struct ConvertedProperties {
5198 ConvertedProperties(std::unordered_map<std::string, std::string>
const& PropertyMap)
5200 Properties.size = PropertyMap.size();
5201 Properties.keys =
reinterpret_cast<Discord_String*
>(
5202 Discord_Alloc(Properties.size *
sizeof(Discord_String)));
5203 Properties.values =
reinterpret_cast<Discord_String*
>(
5204 Discord_Alloc(Properties.size *
sizeof(Discord_String)));
5206 for (
auto& pair : PropertyMap) {
5207 Properties.keys[i] = AllocateString(pair.first);
5208 Properties.values[i] = AllocateString(pair.second);
5212 ~ConvertedProperties() { Discord_FreeProperties(Properties); }
5213 Discord_Properties Properties{};
5216 Discord_String AllocateString(std::string
const& str)
5218 Discord_String result;
5219 result.ptr =
reinterpret_cast<uint8_t*
>(Discord_Alloc(str.size()));
5220 result.size = str.size();
5221 std::memcpy(result.ptr, str.data(), result.size);
5226std::unordered_map<std::string, std::string> ConvertReturnedProperties(
5227 Discord_Properties
const& Properties)
5229 std::unordered_map<std::string, std::string> result;
5230 for (
size_t i = 0; i < Properties.size; ++i) {
5231 std::string key(
reinterpret_cast<char*
>(Properties.keys[i].ptr), Properties.keys[i].size);
5232 std::string value(
reinterpret_cast<char*
>(Properties.values[i].ptr),
5233 Properties.values[i].size);
5234 result.emplace(std::move(key), std::move(value));
5239ActivityInvite::~ActivityInvite()
5247 : instance_(other.instance_)
5248 , state_(other.state_)
5254 if (
this != &other) {
5258 instance_ = other.instance_;
5259 state_ = other.state_;
5269 Discord_ActivityInvite_Clone(&instance_, rhs.instance());
5271 state_ = DiscordObjectState::Owned;
5274ActivityInvite& ActivityInvite::operator=(
const ActivityInvite& rhs)
5277 if (state_ == DiscordObjectState::Owned) {
5279 state_ = DiscordObjectState::Invalid;
5281 if (rhs.state_ == DiscordObjectState::Owned) {
5282 Discord_ActivityInvite_Clone(&instance_, rhs.instance());
5284 state_ = DiscordObjectState::Owned;
5289ActivityInvite::ActivityInvite(Discord_ActivityInvite instance, DiscordObjectState state)
5290 : instance_(instance)
5294ActivityInvite::ActivityInvite()
5296 assert(state_ == DiscordObjectState::Invalid);
5297 Discord_ActivityInvite_Init(&instance_);
5298 state_ = DiscordObjectState::Owned;
5300void ActivityInvite::Drop()
5302 if (state_ != DiscordObjectState::Owned) {
5305 Discord_ActivityInvite_Drop(&instance_);
5306 state_ = DiscordObjectState::Invalid;
5308uint64_t ActivityInvite::SenderId()
const
5310 assert(state_ == DiscordObjectState::Owned);
5311 uint64_t returnValue__;
5312 returnValue__ = Discord_ActivityInvite_SenderId(&instance_);
5313 return returnValue__;
5315void ActivityInvite::SetSenderId(uint64_t SenderId)
5317 assert(state_ == DiscordObjectState::Owned);
5318 Discord_ActivityInvite_SetSenderId(&instance_, SenderId);
5320uint64_t ActivityInvite::ChannelId()
const
5322 assert(state_ == DiscordObjectState::Owned);
5323 uint64_t returnValue__;
5324 returnValue__ = Discord_ActivityInvite_ChannelId(&instance_);
5325 return returnValue__;
5327void ActivityInvite::SetChannelId(uint64_t ChannelId)
5329 assert(state_ == DiscordObjectState::Owned);
5330 Discord_ActivityInvite_SetChannelId(&instance_, ChannelId);
5332uint64_t ActivityInvite::MessageId()
const
5334 assert(state_ == DiscordObjectState::Owned);
5335 uint64_t returnValue__;
5336 returnValue__ = Discord_ActivityInvite_MessageId(&instance_);
5337 return returnValue__;
5339void ActivityInvite::SetMessageId(uint64_t MessageId)
5341 assert(state_ == DiscordObjectState::Owned);
5342 Discord_ActivityInvite_SetMessageId(&instance_, MessageId);
5346 assert(state_ == DiscordObjectState::Owned);
5347 Discord_ActivityActionTypes returnValue__;
5348 returnValue__ = Discord_ActivityInvite_Type(&instance_);
5353 assert(state_ == DiscordObjectState::Owned);
5354 Discord_ActivityInvite_SetType(&instance_,
static_cast<Discord_ActivityActionTypes
>(Type));
5356uint64_t ActivityInvite::ApplicationId()
const
5358 assert(state_ == DiscordObjectState::Owned);
5359 uint64_t returnValue__;
5360 returnValue__ = Discord_ActivityInvite_ApplicationId(&instance_);
5361 return returnValue__;
5363void ActivityInvite::SetApplicationId(uint64_t ApplicationId)
5365 assert(state_ == DiscordObjectState::Owned);
5366 Discord_ActivityInvite_SetApplicationId(&instance_, ApplicationId);
5368std::string ActivityInvite::PartyId()
const
5370 assert(state_ == DiscordObjectState::Owned);
5371 Discord_String returnValueNative__;
5372 Discord_ActivityInvite_PartyId(&instance_, &returnValueNative__);
5373 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
5374 returnValueNative__.size);
5375 Discord_Free(returnValueNative__.ptr);
5376 return returnValue__;
5378void ActivityInvite::SetPartyId(std::string PartyId)
5380 assert(state_ == DiscordObjectState::Owned);
5381 Discord_String PartyId__str{(uint8_t*)(PartyId.data()), PartyId.size()};
5382 Discord_ActivityInvite_SetPartyId(&instance_, PartyId__str);
5384std::string ActivityInvite::SessionId()
const
5386 assert(state_ == DiscordObjectState::Owned);
5387 Discord_String returnValueNative__;
5388 Discord_ActivityInvite_SessionId(&instance_, &returnValueNative__);
5389 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
5390 returnValueNative__.size);
5391 Discord_Free(returnValueNative__.ptr);
5392 return returnValue__;
5394void ActivityInvite::SetSessionId(std::string SessionId)
5396 assert(state_ == DiscordObjectState::Owned);
5397 Discord_String SessionId__str{(uint8_t*)(SessionId.data()), SessionId.size()};
5398 Discord_ActivityInvite_SetSessionId(&instance_, SessionId__str);
5400bool ActivityInvite::IsValid()
const
5402 assert(state_ == DiscordObjectState::Owned);
5404 returnValue__ = Discord_ActivityInvite_IsValid(&instance_);
5405 return returnValue__;
5407void ActivityInvite::SetIsValid(
bool IsValid)
5409 assert(state_ == DiscordObjectState::Owned);
5410 Discord_ActivityInvite_SetIsValid(&instance_, IsValid);
5412const ActivityAssets ActivityAssets::nullobj{{}, DiscordObjectState::Invalid};
5413ActivityAssets::~ActivityAssets()
5415 if (state_ == DiscordObjectState::Owned) {
5417 state_ = DiscordObjectState::Invalid;
5420ActivityAssets::ActivityAssets(ActivityAssets&& other) noexcept
5421 : instance_(other.instance_)
5422 , state_(other.state_)
5424 other.state_ = DiscordObjectState::Invalid;
5426ActivityAssets& ActivityAssets::operator=(ActivityAssets&& other)
noexcept
5428 if (
this != &other) {
5429 if (state_ == DiscordObjectState::Owned) {
5432 instance_ = other.instance_;
5433 state_ = other.state_;
5434 other.state_ = DiscordObjectState::Invalid;
5438ActivityAssets::ActivityAssets(
const ActivityAssets& arg0)
5443 Discord_ActivityAssets_Clone(&instance_, arg0.instance());
5445 state_ = DiscordObjectState::Owned;
5448ActivityAssets& ActivityAssets::operator=(
const ActivityAssets& arg0)
5450 if (
this != &arg0) {
5451 if (state_ == DiscordObjectState::Owned) {
5453 state_ = DiscordObjectState::Invalid;
5455 if (arg0.state_ == DiscordObjectState::Owned) {
5456 Discord_ActivityAssets_Clone(&instance_, arg0.instance());
5458 state_ = DiscordObjectState::Owned;
5463ActivityAssets::ActivityAssets(Discord_ActivityAssets instance, DiscordObjectState state)
5464 : instance_(instance)
5468ActivityAssets::ActivityAssets()
5470 assert(state_ == DiscordObjectState::Invalid);
5471 Discord_ActivityAssets_Init(&instance_);
5472 state_ = DiscordObjectState::Owned;
5474void ActivityAssets::Drop()
5476 if (state_ != DiscordObjectState::Owned) {
5479 Discord_ActivityAssets_Drop(&instance_);
5480 state_ = DiscordObjectState::Invalid;
5482std::optional<std::string> ActivityAssets::LargeImage()
const
5484 assert(state_ == DiscordObjectState::Owned);
5485 bool returnIsNonNull__;
5486 Discord_String returnValueNative__;
5487 returnIsNonNull__ = Discord_ActivityAssets_LargeImage(&instance_, &returnValueNative__);
5488 if (!returnIsNonNull__) {
5491 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
5492 returnValueNative__.size);
5493 Discord_Free(returnValueNative__.ptr);
5494 return returnValue__;
5496void ActivityAssets::SetLargeImage(std::optional<std::string> LargeImage)
5498 assert(state_ == DiscordObjectState::Owned);
5499 Discord_String LargeImage__str{};
5500 if (LargeImage.has_value()) {
5501 LargeImage__str.ptr =
reinterpret_cast<uint8_t*
>(LargeImage->data());
5502 LargeImage__str.size = LargeImage->size();
5504 Discord_ActivityAssets_SetLargeImage(&instance_,
5505 (LargeImage.has_value() ? &LargeImage__str :
nullptr));
5507std::optional<std::string> ActivityAssets::LargeText()
const
5509 assert(state_ == DiscordObjectState::Owned);
5510 bool returnIsNonNull__;
5511 Discord_String returnValueNative__;
5512 returnIsNonNull__ = Discord_ActivityAssets_LargeText(&instance_, &returnValueNative__);
5513 if (!returnIsNonNull__) {
5516 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
5517 returnValueNative__.size);
5518 Discord_Free(returnValueNative__.ptr);
5519 return returnValue__;
5521void ActivityAssets::SetLargeText(std::optional<std::string> LargeText)
5523 assert(state_ == DiscordObjectState::Owned);
5524 Discord_String LargeText__str{};
5525 if (LargeText.has_value()) {
5526 LargeText__str.ptr =
reinterpret_cast<uint8_t*
>(LargeText->data());
5527 LargeText__str.size = LargeText->size();
5529 Discord_ActivityAssets_SetLargeText(&instance_,
5530 (LargeText.has_value() ? &LargeText__str :
nullptr));
5532std::optional<std::string> ActivityAssets::SmallImage()
const
5534 assert(state_ == DiscordObjectState::Owned);
5535 bool returnIsNonNull__;
5536 Discord_String returnValueNative__;
5537 returnIsNonNull__ = Discord_ActivityAssets_SmallImage(&instance_, &returnValueNative__);
5538 if (!returnIsNonNull__) {
5541 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
5542 returnValueNative__.size);
5543 Discord_Free(returnValueNative__.ptr);
5544 return returnValue__;
5546void ActivityAssets::SetSmallImage(std::optional<std::string> SmallImage)
5548 assert(state_ == DiscordObjectState::Owned);
5549 Discord_String SmallImage__str{};
5550 if (SmallImage.has_value()) {
5551 SmallImage__str.ptr =
reinterpret_cast<uint8_t*
>(SmallImage->data());
5552 SmallImage__str.size = SmallImage->size();
5554 Discord_ActivityAssets_SetSmallImage(&instance_,
5555 (SmallImage.has_value() ? &SmallImage__str :
nullptr));
5557std::optional<std::string> ActivityAssets::SmallText()
const
5559 assert(state_ == DiscordObjectState::Owned);
5560 bool returnIsNonNull__;
5561 Discord_String returnValueNative__;
5562 returnIsNonNull__ = Discord_ActivityAssets_SmallText(&instance_, &returnValueNative__);
5563 if (!returnIsNonNull__) {
5566 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
5567 returnValueNative__.size);
5568 Discord_Free(returnValueNative__.ptr);
5569 return returnValue__;
5571void ActivityAssets::SetSmallText(std::optional<std::string> SmallText)
5573 assert(state_ == DiscordObjectState::Owned);
5574 Discord_String SmallText__str{};
5575 if (SmallText.has_value()) {
5576 SmallText__str.ptr =
reinterpret_cast<uint8_t*
>(SmallText->data());
5577 SmallText__str.size = SmallText->size();
5579 Discord_ActivityAssets_SetSmallText(&instance_,
5580 (SmallText.has_value() ? &SmallText__str :
nullptr));
5582const ActivityTimestamps ActivityTimestamps::nullobj{{}, DiscordObjectState::Invalid};
5583ActivityTimestamps::~ActivityTimestamps()
5585 if (state_ == DiscordObjectState::Owned) {
5587 state_ = DiscordObjectState::Invalid;
5590ActivityTimestamps::ActivityTimestamps(ActivityTimestamps&& other) noexcept
5591 : instance_(other.instance_)
5592 , state_(other.state_)
5594 other.state_ = DiscordObjectState::Invalid;
5596ActivityTimestamps& ActivityTimestamps::operator=(ActivityTimestamps&& other)
noexcept
5598 if (
this != &other) {
5599 if (state_ == DiscordObjectState::Owned) {
5602 instance_ = other.instance_;
5603 state_ = other.state_;
5604 other.state_ = DiscordObjectState::Invalid;
5608ActivityTimestamps::ActivityTimestamps(
const ActivityTimestamps& arg0)
5613 Discord_ActivityTimestamps_Clone(&instance_, arg0.instance());
5615 state_ = DiscordObjectState::Owned;
5618ActivityTimestamps& ActivityTimestamps::operator=(
const ActivityTimestamps& arg0)
5620 if (
this != &arg0) {
5621 if (state_ == DiscordObjectState::Owned) {
5623 state_ = DiscordObjectState::Invalid;
5625 if (arg0.state_ == DiscordObjectState::Owned) {
5626 Discord_ActivityTimestamps_Clone(&instance_, arg0.instance());
5628 state_ = DiscordObjectState::Owned;
5633ActivityTimestamps::ActivityTimestamps(Discord_ActivityTimestamps instance,
5634 DiscordObjectState state)
5635 : instance_(instance)
5639ActivityTimestamps::ActivityTimestamps()
5641 assert(state_ == DiscordObjectState::Invalid);
5642 Discord_ActivityTimestamps_Init(&instance_);
5643 state_ = DiscordObjectState::Owned;
5645void ActivityTimestamps::Drop()
5647 if (state_ != DiscordObjectState::Owned) {
5650 Discord_ActivityTimestamps_Drop(&instance_);
5651 state_ = DiscordObjectState::Invalid;
5653uint64_t ActivityTimestamps::Start()
const
5655 assert(state_ == DiscordObjectState::Owned);
5656 uint64_t returnValue__;
5657 returnValue__ = Discord_ActivityTimestamps_Start(&instance_);
5658 return returnValue__;
5660void ActivityTimestamps::SetStart(uint64_t Start)
5662 assert(state_ == DiscordObjectState::Owned);
5663 Discord_ActivityTimestamps_SetStart(&instance_, Start);
5665uint64_t ActivityTimestamps::End()
const
5667 assert(state_ == DiscordObjectState::Owned);
5668 uint64_t returnValue__;
5669 returnValue__ = Discord_ActivityTimestamps_End(&instance_);
5670 return returnValue__;
5672void ActivityTimestamps::SetEnd(uint64_t End)
5674 assert(state_ == DiscordObjectState::Owned);
5675 Discord_ActivityTimestamps_SetEnd(&instance_, End);
5677const ActivityParty ActivityParty::nullobj{{}, DiscordObjectState::Invalid};
5678ActivityParty::~ActivityParty()
5680 if (state_ == DiscordObjectState::Owned) {
5682 state_ = DiscordObjectState::Invalid;
5685ActivityParty::ActivityParty(ActivityParty&& other) noexcept
5686 : instance_(other.instance_)
5687 , state_(other.state_)
5689 other.state_ = DiscordObjectState::Invalid;
5691ActivityParty& ActivityParty::operator=(ActivityParty&& other)
noexcept
5693 if (
this != &other) {
5694 if (state_ == DiscordObjectState::Owned) {
5697 instance_ = other.instance_;
5698 state_ = other.state_;
5699 other.state_ = DiscordObjectState::Invalid;
5703ActivityParty::ActivityParty(
const ActivityParty& arg0)
5708 Discord_ActivityParty_Clone(&instance_, arg0.instance());
5710 state_ = DiscordObjectState::Owned;
5713ActivityParty& ActivityParty::operator=(
const ActivityParty& arg0)
5715 if (
this != &arg0) {
5716 if (state_ == DiscordObjectState::Owned) {
5718 state_ = DiscordObjectState::Invalid;
5720 if (arg0.state_ == DiscordObjectState::Owned) {
5721 Discord_ActivityParty_Clone(&instance_, arg0.instance());
5723 state_ = DiscordObjectState::Owned;
5728ActivityParty::ActivityParty(Discord_ActivityParty instance, DiscordObjectState state)
5729 : instance_(instance)
5733ActivityParty::ActivityParty()
5735 assert(state_ == DiscordObjectState::Invalid);
5736 Discord_ActivityParty_Init(&instance_);
5737 state_ = DiscordObjectState::Owned;
5739void ActivityParty::Drop()
5741 if (state_ != DiscordObjectState::Owned) {
5744 Discord_ActivityParty_Drop(&instance_);
5745 state_ = DiscordObjectState::Invalid;
5747std::string ActivityParty::Id()
const
5749 assert(state_ == DiscordObjectState::Owned);
5750 Discord_String returnValueNative__;
5751 Discord_ActivityParty_Id(&instance_, &returnValueNative__);
5752 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
5753 returnValueNative__.size);
5754 Discord_Free(returnValueNative__.ptr);
5755 return returnValue__;
5757void ActivityParty::SetId(std::string Id)
5759 assert(state_ == DiscordObjectState::Owned);
5760 Discord_String Id__str{(uint8_t*)(Id.data()), Id.size()};
5761 Discord_ActivityParty_SetId(&instance_, Id__str);
5763int32_t ActivityParty::CurrentSize()
const
5765 assert(state_ == DiscordObjectState::Owned);
5766 int32_t returnValue__;
5767 returnValue__ = Discord_ActivityParty_CurrentSize(&instance_);
5768 return returnValue__;
5770void ActivityParty::SetCurrentSize(int32_t CurrentSize)
5772 assert(state_ == DiscordObjectState::Owned);
5773 Discord_ActivityParty_SetCurrentSize(&instance_, CurrentSize);
5775int32_t ActivityParty::MaxSize()
const
5777 assert(state_ == DiscordObjectState::Owned);
5778 int32_t returnValue__;
5779 returnValue__ = Discord_ActivityParty_MaxSize(&instance_);
5780 return returnValue__;
5782void ActivityParty::SetMaxSize(int32_t MaxSize)
5784 assert(state_ == DiscordObjectState::Owned);
5785 Discord_ActivityParty_SetMaxSize(&instance_, MaxSize);
5789 assert(state_ == DiscordObjectState::Owned);
5790 Discord_ActivityPartyPrivacy returnValue__;
5791 returnValue__ = Discord_ActivityParty_Privacy(&instance_);
5796 assert(state_ == DiscordObjectState::Owned);
5797 Discord_ActivityParty_SetPrivacy(&instance_,
5798 static_cast<Discord_ActivityPartyPrivacy
>(Privacy));
5800const ActivitySecrets ActivitySecrets::nullobj{{}, DiscordObjectState::Invalid};
5801ActivitySecrets::~ActivitySecrets()
5803 if (state_ == DiscordObjectState::Owned) {
5805 state_ = DiscordObjectState::Invalid;
5808ActivitySecrets::ActivitySecrets(ActivitySecrets&& other) noexcept
5809 : instance_(other.instance_)
5810 , state_(other.state_)
5812 other.state_ = DiscordObjectState::Invalid;
5814ActivitySecrets& ActivitySecrets::operator=(ActivitySecrets&& other)
noexcept
5816 if (
this != &other) {
5817 if (state_ == DiscordObjectState::Owned) {
5820 instance_ = other.instance_;
5821 state_ = other.state_;
5822 other.state_ = DiscordObjectState::Invalid;
5826ActivitySecrets::ActivitySecrets(
const ActivitySecrets& arg0)
5831 Discord_ActivitySecrets_Clone(&instance_, arg0.instance());
5833 state_ = DiscordObjectState::Owned;
5836ActivitySecrets& ActivitySecrets::operator=(
const ActivitySecrets& arg0)
5838 if (
this != &arg0) {
5839 if (state_ == DiscordObjectState::Owned) {
5841 state_ = DiscordObjectState::Invalid;
5843 if (arg0.state_ == DiscordObjectState::Owned) {
5844 Discord_ActivitySecrets_Clone(&instance_, arg0.instance());
5846 state_ = DiscordObjectState::Owned;
5851ActivitySecrets::ActivitySecrets(Discord_ActivitySecrets instance, DiscordObjectState state)
5852 : instance_(instance)
5856ActivitySecrets::ActivitySecrets()
5858 assert(state_ == DiscordObjectState::Invalid);
5859 Discord_ActivitySecrets_Init(&instance_);
5860 state_ = DiscordObjectState::Owned;
5862void ActivitySecrets::Drop()
5864 if (state_ != DiscordObjectState::Owned) {
5867 Discord_ActivitySecrets_Drop(&instance_);
5868 state_ = DiscordObjectState::Invalid;
5870std::string ActivitySecrets::Join()
const
5872 assert(state_ == DiscordObjectState::Owned);
5873 Discord_String returnValueNative__;
5874 Discord_ActivitySecrets_Join(&instance_, &returnValueNative__);
5875 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
5876 returnValueNative__.size);
5877 Discord_Free(returnValueNative__.ptr);
5878 return returnValue__;
5880void ActivitySecrets::SetJoin(std::string Join)
5882 assert(state_ == DiscordObjectState::Owned);
5883 Discord_String Join__str{(uint8_t*)(
Join.data()),
Join.size()};
5884 Discord_ActivitySecrets_SetJoin(&instance_, Join__str);
5886const ActivityButton ActivityButton::nullobj{{}, DiscordObjectState::Invalid};
5887ActivityButton::~ActivityButton()
5889 if (state_ == DiscordObjectState::Owned) {
5891 state_ = DiscordObjectState::Invalid;
5894ActivityButton::ActivityButton(ActivityButton&& other) noexcept
5895 : instance_(other.instance_)
5896 , state_(other.state_)
5898 other.state_ = DiscordObjectState::Invalid;
5900ActivityButton& ActivityButton::operator=(ActivityButton&& other)
noexcept
5902 if (
this != &other) {
5903 if (state_ == DiscordObjectState::Owned) {
5906 instance_ = other.instance_;
5907 state_ = other.state_;
5908 other.state_ = DiscordObjectState::Invalid;
5912ActivityButton::ActivityButton(
const ActivityButton& arg0)
5917 Discord_ActivityButton_Clone(&instance_, arg0.instance());
5919 state_ = DiscordObjectState::Owned;
5922ActivityButton& ActivityButton::operator=(
const ActivityButton& arg0)
5924 if (
this != &arg0) {
5925 if (state_ == DiscordObjectState::Owned) {
5927 state_ = DiscordObjectState::Invalid;
5929 if (arg0.state_ == DiscordObjectState::Owned) {
5930 Discord_ActivityButton_Clone(&instance_, arg0.instance());
5932 state_ = DiscordObjectState::Owned;
5937ActivityButton::ActivityButton(Discord_ActivityButton instance, DiscordObjectState state)
5938 : instance_(instance)
5942ActivityButton::ActivityButton()
5944 assert(state_ == DiscordObjectState::Invalid);
5945 Discord_ActivityButton_Init(&instance_);
5946 state_ = DiscordObjectState::Owned;
5948void ActivityButton::Drop()
5950 if (state_ != DiscordObjectState::Owned) {
5953 Discord_ActivityButton_Drop(&instance_);
5954 state_ = DiscordObjectState::Invalid;
5956std::string ActivityButton::Label()
const
5958 assert(state_ == DiscordObjectState::Owned);
5959 Discord_String returnValueNative__;
5960 Discord_ActivityButton_Label(&instance_, &returnValueNative__);
5961 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
5962 returnValueNative__.size);
5963 Discord_Free(returnValueNative__.ptr);
5964 return returnValue__;
5966void ActivityButton::SetLabel(std::string Label)
5968 assert(state_ == DiscordObjectState::Owned);
5969 Discord_String Label__str{(uint8_t*)(Label.data()), Label.size()};
5970 Discord_ActivityButton_SetLabel(&instance_, Label__str);
5972std::string ActivityButton::Url()
const
5974 assert(state_ == DiscordObjectState::Owned);
5975 Discord_String returnValueNative__;
5976 Discord_ActivityButton_Url(&instance_, &returnValueNative__);
5977 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
5978 returnValueNative__.size);
5979 Discord_Free(returnValueNative__.ptr);
5980 return returnValue__;
5982void ActivityButton::SetUrl(std::string Url)
5984 assert(state_ == DiscordObjectState::Owned);
5985 Discord_String Url__str{(uint8_t*)(Url.data()), Url.size()};
5986 Discord_ActivityButton_SetUrl(&instance_, Url__str);
5988const Activity Activity::nullobj{{}, DiscordObjectState::Invalid};
5989Activity::~Activity()
5991 if (state_ == DiscordObjectState::Owned) {
5993 state_ = DiscordObjectState::Invalid;
5996Activity::Activity(Activity&& other) noexcept
5997 : instance_(other.instance_)
5998 , state_(other.state_)
6000 other.state_ = DiscordObjectState::Invalid;
6002Activity& Activity::operator=(Activity&& other)
noexcept
6004 if (
this != &other) {
6005 if (state_ == DiscordObjectState::Owned) {
6008 instance_ = other.instance_;
6009 state_ = other.state_;
6010 other.state_ = DiscordObjectState::Invalid;
6014Activity::Activity(
const Activity& arg0)
6019 Discord_Activity_Clone(&instance_, arg0.instance());
6021 state_ = DiscordObjectState::Owned;
6024Activity& Activity::operator=(
const Activity& arg0)
6026 if (
this != &arg0) {
6027 if (state_ == DiscordObjectState::Owned) {
6029 state_ = DiscordObjectState::Invalid;
6031 if (arg0.state_ == DiscordObjectState::Owned) {
6032 Discord_Activity_Clone(&instance_, arg0.instance());
6034 state_ = DiscordObjectState::Owned;
6039Activity::Activity(Discord_Activity instance, DiscordObjectState state)
6040 : instance_(instance)
6046 assert(state_ == DiscordObjectState::Invalid);
6047 Discord_Activity_Init(&instance_);
6048 state_ = DiscordObjectState::Owned;
6050void Activity::Drop()
6052 if (state_ != DiscordObjectState::Owned) {
6055 Discord_Activity_Drop(&instance_);
6056 state_ = DiscordObjectState::Invalid;
6060 assert(state_ == DiscordObjectState::Owned);
6061 Discord_Activity_AddButton(&instance_, button.instance());
6065 assert(state_ == DiscordObjectState::Owned);
6067 returnValue__ = Discord_Activity_Equals(&instance_, other.instance());
6068 return returnValue__;
6070std::vector<discordpp::ActivityButton> Activity::GetButtons()
const
6072 assert(state_ == DiscordObjectState::Owned);
6073 Discord_ActivityButtonSpan returnValueNative__;
6074 Discord_Activity_GetButtons(&instance_, &returnValueNative__);
6075 std::vector<discordpp::ActivityButton> returnValue__;
6076 returnValue__.reserve(returnValueNative__.size);
6077 for (
size_t i__ = 0; i__ < returnValueNative__.size; ++i__) {
6078 returnValue__.emplace_back(returnValueNative__.ptr[i__], DiscordObjectState::Owned);
6080 Discord_Free(returnValueNative__.ptr);
6081 return returnValue__;
6083std::string Activity::Name()
const
6085 assert(state_ == DiscordObjectState::Owned);
6086 Discord_String returnValueNative__;
6087 Discord_Activity_Name(&instance_, &returnValueNative__);
6088 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6089 returnValueNative__.size);
6090 Discord_Free(returnValueNative__.ptr);
6091 return returnValue__;
6093void Activity::SetName(std::string Name)
6095 assert(state_ == DiscordObjectState::Owned);
6096 Discord_String Name__str{(uint8_t*)(Name.data()), Name.size()};
6097 Discord_Activity_SetName(&instance_, Name__str);
6101 assert(state_ == DiscordObjectState::Owned);
6102 Discord_ActivityTypes returnValue__;
6103 returnValue__ = Discord_Activity_Type(&instance_);
6108 assert(state_ == DiscordObjectState::Owned);
6109 Discord_Activity_SetType(&instance_,
static_cast<Discord_ActivityTypes
>(Type));
6111std::optional<std::string> Activity::State()
const
6113 assert(state_ == DiscordObjectState::Owned);
6114 bool returnIsNonNull__;
6115 Discord_String returnValueNative__;
6116 returnIsNonNull__ = Discord_Activity_State(&instance_, &returnValueNative__);
6117 if (!returnIsNonNull__) {
6120 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6121 returnValueNative__.size);
6122 Discord_Free(returnValueNative__.ptr);
6123 return returnValue__;
6125void Activity::SetState(std::optional<std::string> State)
6127 assert(state_ == DiscordObjectState::Owned);
6128 Discord_String State__str{};
6129 if (State.has_value()) {
6130 State__str.ptr =
reinterpret_cast<uint8_t*
>(State->data());
6131 State__str.size = State->size();
6133 Discord_Activity_SetState(&instance_, (State.has_value() ? &State__str :
nullptr));
6135std::optional<std::string> Activity::Details()
const
6137 assert(state_ == DiscordObjectState::Owned);
6138 bool returnIsNonNull__;
6139 Discord_String returnValueNative__;
6140 returnIsNonNull__ = Discord_Activity_Details(&instance_, &returnValueNative__);
6141 if (!returnIsNonNull__) {
6144 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6145 returnValueNative__.size);
6146 Discord_Free(returnValueNative__.ptr);
6147 return returnValue__;
6149void Activity::SetDetails(std::optional<std::string> Details)
6151 assert(state_ == DiscordObjectState::Owned);
6152 Discord_String Details__str{};
6153 if (Details.has_value()) {
6154 Details__str.ptr =
reinterpret_cast<uint8_t*
>(Details->data());
6155 Details__str.size = Details->size();
6157 Discord_Activity_SetDetails(&instance_, (Details.has_value() ? &Details__str :
nullptr));
6159std::optional<uint64_t> Activity::ApplicationId()
const
6161 assert(state_ == DiscordObjectState::Owned);
6162 bool returnIsNonNull__;
6163 uint64_t returnValue__;
6164 returnIsNonNull__ = Discord_Activity_ApplicationId(&instance_, &returnValue__);
6165 if (!returnIsNonNull__) {
6166 return std::nullopt;
6168 return returnValue__;
6170void Activity::SetApplicationId(std::optional<uint64_t> ApplicationId)
6172 assert(state_ == DiscordObjectState::Owned);
6173 Discord_Activity_SetApplicationId(&instance_,
6174 (ApplicationId.has_value() ? &*ApplicationId :
nullptr));
6176std::optional<discordpp::ActivityAssets> Activity::Assets()
const
6178 assert(state_ == DiscordObjectState::Owned);
6179 bool returnIsNonNull__;
6180 Discord_ActivityAssets returnValueNative__;
6181 returnIsNonNull__ = Discord_Activity_Assets(&instance_, &returnValueNative__);
6182 if (!returnIsNonNull__) {
6186 return returnValue__;
6188void Activity::SetAssets(std::optional<discordpp::ActivityAssets> Assets)
6190 assert(state_ == DiscordObjectState::Owned);
6191 Discord_Activity_SetAssets(&instance_, (Assets.has_value() ? Assets->instance() :
nullptr));
6193std::optional<discordpp::ActivityTimestamps> Activity::Timestamps()
const
6195 assert(state_ == DiscordObjectState::Owned);
6196 bool returnIsNonNull__;
6197 Discord_ActivityTimestamps returnValueNative__;
6198 returnIsNonNull__ = Discord_Activity_Timestamps(&instance_, &returnValueNative__);
6199 if (!returnIsNonNull__) {
6203 return returnValue__;
6205void Activity::SetTimestamps(std::optional<discordpp::ActivityTimestamps> Timestamps)
6207 assert(state_ == DiscordObjectState::Owned);
6208 Discord_Activity_SetTimestamps(&instance_,
6209 (Timestamps.has_value() ? Timestamps->instance() :
nullptr));
6211std::optional<discordpp::ActivityParty> Activity::Party()
const
6213 assert(state_ == DiscordObjectState::Owned);
6214 bool returnIsNonNull__;
6215 Discord_ActivityParty returnValueNative__;
6216 returnIsNonNull__ = Discord_Activity_Party(&instance_, &returnValueNative__);
6217 if (!returnIsNonNull__) {
6221 return returnValue__;
6223void Activity::SetParty(std::optional<discordpp::ActivityParty> Party)
6225 assert(state_ == DiscordObjectState::Owned);
6226 Discord_Activity_SetParty(&instance_, (Party.has_value() ? Party->instance() :
nullptr));
6228std::optional<discordpp::ActivitySecrets> Activity::Secrets()
const
6230 assert(state_ == DiscordObjectState::Owned);
6231 bool returnIsNonNull__;
6232 Discord_ActivitySecrets returnValueNative__;
6233 returnIsNonNull__ = Discord_Activity_Secrets(&instance_, &returnValueNative__);
6234 if (!returnIsNonNull__) {
6238 return returnValue__;
6240void Activity::SetSecrets(std::optional<discordpp::ActivitySecrets> Secrets)
6242 assert(state_ == DiscordObjectState::Owned);
6243 Discord_Activity_SetSecrets(&instance_, (Secrets.has_value() ? Secrets->instance() :
nullptr));
6247 assert(state_ == DiscordObjectState::Owned);
6248 Discord_ActivityGamePlatforms returnValue__;
6249 returnValue__ = Discord_Activity_SupportedPlatforms(&instance_);
6254 assert(state_ == DiscordObjectState::Owned);
6255 Discord_Activity_SetSupportedPlatforms(
6256 &instance_,
static_cast<Discord_ActivityGamePlatforms
>(SupportedPlatforms));
6258const ClientResult ClientResult::nullobj{{}, DiscordObjectState::Invalid};
6259ClientResult::~ClientResult()
6261 if (state_ == DiscordObjectState::Owned) {
6263 state_ = DiscordObjectState::Invalid;
6266ClientResult::ClientResult(ClientResult&& other) noexcept
6267 : instance_(other.instance_)
6268 , state_(other.state_)
6270 other.state_ = DiscordObjectState::Invalid;
6272ClientResult& ClientResult::operator=(ClientResult&& other)
noexcept
6274 if (
this != &other) {
6275 if (state_ == DiscordObjectState::Owned) {
6278 instance_ = other.instance_;
6279 state_ = other.state_;
6280 other.state_ = DiscordObjectState::Invalid;
6284ClientResult::ClientResult(
const ClientResult& arg0)
6289 Discord_ClientResult_Clone(&instance_, arg0.instance());
6291 state_ = DiscordObjectState::Owned;
6294ClientResult& ClientResult::operator=(
const ClientResult& arg0)
6296 if (
this != &arg0) {
6297 if (state_ == DiscordObjectState::Owned) {
6299 state_ = DiscordObjectState::Invalid;
6301 if (arg0.state_ == DiscordObjectState::Owned) {
6302 Discord_ClientResult_Clone(&instance_, arg0.instance());
6304 state_ = DiscordObjectState::Owned;
6309ClientResult::ClientResult(Discord_ClientResult instance, DiscordObjectState state)
6310 : instance_(instance)
6314void ClientResult::Drop()
6316 if (state_ != DiscordObjectState::Owned) {
6319 Discord_ClientResult_Drop(&instance_);
6320 state_ = DiscordObjectState::Invalid;
6322std::string ClientResult::ToString()
const
6324 assert(state_ == DiscordObjectState::Owned);
6325 Discord_String returnValueNative__;
6326 Discord_ClientResult_ToString(&instance_, &returnValueNative__);
6327 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6328 returnValueNative__.size);
6329 Discord_Free(returnValueNative__.ptr);
6330 return returnValue__;
6334 assert(state_ == DiscordObjectState::Owned);
6335 Discord_ErrorType returnValue__;
6336 returnValue__ = Discord_ClientResult_Type(&instance_);
6341 assert(state_ == DiscordObjectState::Owned);
6342 Discord_ClientResult_SetType(&instance_,
static_cast<Discord_ErrorType
>(Type));
6344std::string ClientResult::Error()
const
6346 assert(state_ == DiscordObjectState::Owned);
6347 Discord_String returnValueNative__;
6348 Discord_ClientResult_Error(&instance_, &returnValueNative__);
6349 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6350 returnValueNative__.size);
6351 Discord_Free(returnValueNative__.ptr);
6352 return returnValue__;
6354void ClientResult::SetError(std::string Error)
6356 assert(state_ == DiscordObjectState::Owned);
6357 Discord_String Error__str{(uint8_t*)(
Error.data()),
Error.size()};
6358 Discord_ClientResult_SetError(&instance_, Error__str);
6360int32_t ClientResult::ErrorCode()
const
6362 assert(state_ == DiscordObjectState::Owned);
6363 int32_t returnValue__;
6364 returnValue__ = Discord_ClientResult_ErrorCode(&instance_);
6365 return returnValue__;
6367void ClientResult::SetErrorCode(int32_t ErrorCode)
6369 assert(state_ == DiscordObjectState::Owned);
6370 Discord_ClientResult_SetErrorCode(&instance_, ErrorCode);
6374 assert(state_ == DiscordObjectState::Owned);
6375 Discord_HttpStatusCode returnValue__;
6376 returnValue__ = Discord_ClientResult_Status(&instance_);
6381 assert(state_ == DiscordObjectState::Owned);
6382 Discord_ClientResult_SetStatus(&instance_,
static_cast<Discord_HttpStatusCode
>(Status));
6384std::string ClientResult::ResponseBody()
const
6386 assert(state_ == DiscordObjectState::Owned);
6387 Discord_String returnValueNative__;
6388 Discord_ClientResult_ResponseBody(&instance_, &returnValueNative__);
6389 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6390 returnValueNative__.size);
6391 Discord_Free(returnValueNative__.ptr);
6392 return returnValue__;
6394void ClientResult::SetResponseBody(std::string ResponseBody)
6396 assert(state_ == DiscordObjectState::Owned);
6397 Discord_String ResponseBody__str{(uint8_t*)(ResponseBody.data()), ResponseBody.size()};
6398 Discord_ClientResult_SetResponseBody(&instance_, ResponseBody__str);
6400bool ClientResult::Successful()
const
6402 assert(state_ == DiscordObjectState::Owned);
6404 returnValue__ = Discord_ClientResult_Successful(&instance_);
6405 return returnValue__;
6407void ClientResult::SetSuccessful(
bool Successful)
6409 assert(state_ == DiscordObjectState::Owned);
6410 Discord_ClientResult_SetSuccessful(&instance_, Successful);
6412bool ClientResult::Retryable()
const
6414 assert(state_ == DiscordObjectState::Owned);
6416 returnValue__ = Discord_ClientResult_Retryable(&instance_);
6417 return returnValue__;
6419void ClientResult::SetRetryable(
bool Retryable)
6421 assert(state_ == DiscordObjectState::Owned);
6422 Discord_ClientResult_SetRetryable(&instance_, Retryable);
6424float ClientResult::RetryAfter()
const
6426 assert(state_ == DiscordObjectState::Owned);
6427 float returnValue__;
6428 returnValue__ = Discord_ClientResult_RetryAfter(&instance_);
6429 return returnValue__;
6431void ClientResult::SetRetryAfter(
float RetryAfter)
6433 assert(state_ == DiscordObjectState::Owned);
6434 Discord_ClientResult_SetRetryAfter(&instance_, RetryAfter);
6436const AuthorizationCodeChallenge AuthorizationCodeChallenge::nullobj{{},
6437 DiscordObjectState::Invalid};
6438AuthorizationCodeChallenge::~AuthorizationCodeChallenge()
6440 if (state_ == DiscordObjectState::Owned) {
6442 state_ = DiscordObjectState::Invalid;
6445AuthorizationCodeChallenge::AuthorizationCodeChallenge(AuthorizationCodeChallenge&& other) noexcept
6446 : instance_(other.instance_)
6447 , state_(other.state_)
6449 other.state_ = DiscordObjectState::Invalid;
6451AuthorizationCodeChallenge& AuthorizationCodeChallenge::operator=(
6452 AuthorizationCodeChallenge&& other)
noexcept
6454 if (
this != &other) {
6455 if (state_ == DiscordObjectState::Owned) {
6458 instance_ = other.instance_;
6459 state_ = other.state_;
6460 other.state_ = DiscordObjectState::Invalid;
6464AuthorizationCodeChallenge::AuthorizationCodeChallenge(
const AuthorizationCodeChallenge& arg0)
6469 Discord_AuthorizationCodeChallenge_Clone(&instance_, arg0.instance());
6471 state_ = DiscordObjectState::Owned;
6474AuthorizationCodeChallenge& AuthorizationCodeChallenge::operator=(
6475 const AuthorizationCodeChallenge& arg0)
6477 if (
this != &arg0) {
6478 if (state_ == DiscordObjectState::Owned) {
6480 state_ = DiscordObjectState::Invalid;
6482 if (arg0.state_ == DiscordObjectState::Owned) {
6483 Discord_AuthorizationCodeChallenge_Clone(&instance_, arg0.instance());
6485 state_ = DiscordObjectState::Owned;
6490AuthorizationCodeChallenge::AuthorizationCodeChallenge(Discord_AuthorizationCodeChallenge instance,
6491 DiscordObjectState state)
6492 : instance_(instance)
6496AuthorizationCodeChallenge::AuthorizationCodeChallenge()
6498 assert(state_ == DiscordObjectState::Invalid);
6499 Discord_AuthorizationCodeChallenge_Init(&instance_);
6500 state_ = DiscordObjectState::Owned;
6502void AuthorizationCodeChallenge::Drop()
6504 if (state_ != DiscordObjectState::Owned) {
6507 Discord_AuthorizationCodeChallenge_Drop(&instance_);
6508 state_ = DiscordObjectState::Invalid;
6512 assert(state_ == DiscordObjectState::Owned);
6513 Discord_AuthenticationCodeChallengeMethod returnValue__;
6514 returnValue__ = Discord_AuthorizationCodeChallenge_Method(&instance_);
6519 assert(state_ == DiscordObjectState::Owned);
6520 Discord_AuthorizationCodeChallenge_SetMethod(
6521 &instance_,
static_cast<Discord_AuthenticationCodeChallengeMethod
>(Method));
6523std::string AuthorizationCodeChallenge::Challenge()
const
6525 assert(state_ == DiscordObjectState::Owned);
6526 Discord_String returnValueNative__;
6527 Discord_AuthorizationCodeChallenge_Challenge(&instance_, &returnValueNative__);
6528 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6529 returnValueNative__.size);
6530 Discord_Free(returnValueNative__.ptr);
6531 return returnValue__;
6533void AuthorizationCodeChallenge::SetChallenge(std::string Challenge)
6535 assert(state_ == DiscordObjectState::Owned);
6536 Discord_String Challenge__str{(uint8_t*)(Challenge.data()), Challenge.size()};
6537 Discord_AuthorizationCodeChallenge_SetChallenge(&instance_, Challenge__str);
6539const AuthorizationCodeVerifier AuthorizationCodeVerifier::nullobj{{}, DiscordObjectState::Invalid};
6540AuthorizationCodeVerifier::~AuthorizationCodeVerifier()
6542 if (state_ == DiscordObjectState::Owned) {
6544 state_ = DiscordObjectState::Invalid;
6547AuthorizationCodeVerifier::AuthorizationCodeVerifier(AuthorizationCodeVerifier&& other) noexcept
6548 : instance_(other.instance_)
6549 , state_(other.state_)
6551 other.state_ = DiscordObjectState::Invalid;
6553AuthorizationCodeVerifier& AuthorizationCodeVerifier::operator=(
6554 AuthorizationCodeVerifier&& other)
noexcept
6556 if (
this != &other) {
6557 if (state_ == DiscordObjectState::Owned) {
6560 instance_ = other.instance_;
6561 state_ = other.state_;
6562 other.state_ = DiscordObjectState::Invalid;
6566AuthorizationCodeVerifier::AuthorizationCodeVerifier(
const AuthorizationCodeVerifier& arg0)
6571 Discord_AuthorizationCodeVerifier_Clone(&instance_, arg0.instance());
6573 state_ = DiscordObjectState::Owned;
6576AuthorizationCodeVerifier& AuthorizationCodeVerifier::operator=(
6577 const AuthorizationCodeVerifier& arg0)
6579 if (
this != &arg0) {
6580 if (state_ == DiscordObjectState::Owned) {
6582 state_ = DiscordObjectState::Invalid;
6584 if (arg0.state_ == DiscordObjectState::Owned) {
6585 Discord_AuthorizationCodeVerifier_Clone(&instance_, arg0.instance());
6587 state_ = DiscordObjectState::Owned;
6592AuthorizationCodeVerifier::AuthorizationCodeVerifier(Discord_AuthorizationCodeVerifier instance,
6593 DiscordObjectState state)
6594 : instance_(instance)
6598void AuthorizationCodeVerifier::Drop()
6600 if (state_ != DiscordObjectState::Owned) {
6603 Discord_AuthorizationCodeVerifier_Drop(&instance_);
6604 state_ = DiscordObjectState::Invalid;
6608 assert(state_ == DiscordObjectState::Owned);
6609 Discord_AuthorizationCodeChallenge returnValueNative__{};
6610 Discord_AuthorizationCodeVerifier_Challenge(&instance_, &returnValueNative__);
6612 DiscordObjectState::Owned);
6613 return returnValue__;
6617 assert(state_ == DiscordObjectState::Owned);
6618 Discord_AuthorizationCodeVerifier_SetChallenge(&instance_, Challenge.instance());
6620std::string AuthorizationCodeVerifier::Verifier()
const
6622 assert(state_ == DiscordObjectState::Owned);
6623 Discord_String returnValueNative__;
6624 Discord_AuthorizationCodeVerifier_Verifier(&instance_, &returnValueNative__);
6625 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6626 returnValueNative__.size);
6627 Discord_Free(returnValueNative__.ptr);
6628 return returnValue__;
6630void AuthorizationCodeVerifier::SetVerifier(std::string Verifier)
6632 assert(state_ == DiscordObjectState::Owned);
6633 Discord_String Verifier__str{(uint8_t*)(Verifier.data()), Verifier.size()};
6634 Discord_AuthorizationCodeVerifier_SetVerifier(&instance_, Verifier__str);
6636const AuthorizationArgs AuthorizationArgs::nullobj{{}, DiscordObjectState::Invalid};
6637AuthorizationArgs::~AuthorizationArgs()
6639 if (state_ == DiscordObjectState::Owned) {
6641 state_ = DiscordObjectState::Invalid;
6644AuthorizationArgs::AuthorizationArgs(AuthorizationArgs&& other) noexcept
6645 : instance_(other.instance_)
6646 , state_(other.state_)
6648 other.state_ = DiscordObjectState::Invalid;
6650AuthorizationArgs& AuthorizationArgs::operator=(AuthorizationArgs&& other)
noexcept
6652 if (
this != &other) {
6653 if (state_ == DiscordObjectState::Owned) {
6656 instance_ = other.instance_;
6657 state_ = other.state_;
6658 other.state_ = DiscordObjectState::Invalid;
6662AuthorizationArgs::AuthorizationArgs(
const AuthorizationArgs& arg0)
6667 Discord_AuthorizationArgs_Clone(&instance_, arg0.instance());
6669 state_ = DiscordObjectState::Owned;
6672AuthorizationArgs& AuthorizationArgs::operator=(
const AuthorizationArgs& arg0)
6674 if (
this != &arg0) {
6675 if (state_ == DiscordObjectState::Owned) {
6677 state_ = DiscordObjectState::Invalid;
6679 if (arg0.state_ == DiscordObjectState::Owned) {
6680 Discord_AuthorizationArgs_Clone(&instance_, arg0.instance());
6682 state_ = DiscordObjectState::Owned;
6687AuthorizationArgs::AuthorizationArgs(Discord_AuthorizationArgs instance, DiscordObjectState state)
6688 : instance_(instance)
6692AuthorizationArgs::AuthorizationArgs()
6694 assert(state_ == DiscordObjectState::Invalid);
6695 Discord_AuthorizationArgs_Init(&instance_);
6696 state_ = DiscordObjectState::Owned;
6698void AuthorizationArgs::Drop()
6700 if (state_ != DiscordObjectState::Owned) {
6703 Discord_AuthorizationArgs_Drop(&instance_);
6704 state_ = DiscordObjectState::Invalid;
6706uint64_t AuthorizationArgs::ClientId()
const
6708 assert(state_ == DiscordObjectState::Owned);
6709 uint64_t returnValue__;
6710 returnValue__ = Discord_AuthorizationArgs_ClientId(&instance_);
6711 return returnValue__;
6713void AuthorizationArgs::SetClientId(uint64_t ClientId)
6715 assert(state_ == DiscordObjectState::Owned);
6716 Discord_AuthorizationArgs_SetClientId(&instance_, ClientId);
6718std::string AuthorizationArgs::Scopes()
const
6720 assert(state_ == DiscordObjectState::Owned);
6721 Discord_String returnValueNative__;
6722 Discord_AuthorizationArgs_Scopes(&instance_, &returnValueNative__);
6723 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6724 returnValueNative__.size);
6725 Discord_Free(returnValueNative__.ptr);
6726 return returnValue__;
6728void AuthorizationArgs::SetScopes(std::string Scopes)
6730 assert(state_ == DiscordObjectState::Owned);
6731 Discord_String Scopes__str{(uint8_t*)(Scopes.data()), Scopes.size()};
6732 Discord_AuthorizationArgs_SetScopes(&instance_, Scopes__str);
6734std::optional<std::string> AuthorizationArgs::State()
const
6736 assert(state_ == DiscordObjectState::Owned);
6737 bool returnIsNonNull__;
6738 Discord_String returnValueNative__;
6739 returnIsNonNull__ = Discord_AuthorizationArgs_State(&instance_, &returnValueNative__);
6740 if (!returnIsNonNull__) {
6743 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6744 returnValueNative__.size);
6745 Discord_Free(returnValueNative__.ptr);
6746 return returnValue__;
6748void AuthorizationArgs::SetState(std::optional<std::string> State)
6750 assert(state_ == DiscordObjectState::Owned);
6751 Discord_String State__str{};
6752 if (State.has_value()) {
6753 State__str.ptr =
reinterpret_cast<uint8_t*
>(State->data());
6754 State__str.size = State->size();
6756 Discord_AuthorizationArgs_SetState(&instance_, (State.has_value() ? &State__str :
nullptr));
6758std::optional<std::string> AuthorizationArgs::Nonce()
const
6760 assert(state_ == DiscordObjectState::Owned);
6761 bool returnIsNonNull__;
6762 Discord_String returnValueNative__;
6763 returnIsNonNull__ = Discord_AuthorizationArgs_Nonce(&instance_, &returnValueNative__);
6764 if (!returnIsNonNull__) {
6767 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6768 returnValueNative__.size);
6769 Discord_Free(returnValueNative__.ptr);
6770 return returnValue__;
6772void AuthorizationArgs::SetNonce(std::optional<std::string> Nonce)
6774 assert(state_ == DiscordObjectState::Owned);
6775 Discord_String Nonce__str{};
6776 if (Nonce.has_value()) {
6777 Nonce__str.ptr =
reinterpret_cast<uint8_t*
>(Nonce->data());
6778 Nonce__str.size = Nonce->size();
6780 Discord_AuthorizationArgs_SetNonce(&instance_, (Nonce.has_value() ? &Nonce__str :
nullptr));
6782std::optional<discordpp::AuthorizationCodeChallenge> AuthorizationArgs::CodeChallenge()
const
6784 assert(state_ == DiscordObjectState::Owned);
6785 bool returnIsNonNull__;
6786 Discord_AuthorizationCodeChallenge returnValueNative__;
6787 returnIsNonNull__ = Discord_AuthorizationArgs_CodeChallenge(&instance_, &returnValueNative__);
6788 if (!returnIsNonNull__) {
6792 DiscordObjectState::Owned);
6793 return returnValue__;
6795void AuthorizationArgs::SetCodeChallenge(
6796 std::optional<discordpp::AuthorizationCodeChallenge> CodeChallenge)
6798 assert(state_ == DiscordObjectState::Owned);
6799 Discord_AuthorizationArgs_SetCodeChallenge(
6800 &instance_, (CodeChallenge.has_value() ? CodeChallenge->instance() :
nullptr));
6802const DeviceAuthorizationArgs DeviceAuthorizationArgs::nullobj{{}, DiscordObjectState::Invalid};
6803DeviceAuthorizationArgs::~DeviceAuthorizationArgs()
6805 if (state_ == DiscordObjectState::Owned) {
6807 state_ = DiscordObjectState::Invalid;
6810DeviceAuthorizationArgs::DeviceAuthorizationArgs(DeviceAuthorizationArgs&& other) noexcept
6811 : instance_(other.instance_)
6812 , state_(other.state_)
6814 other.state_ = DiscordObjectState::Invalid;
6816DeviceAuthorizationArgs& DeviceAuthorizationArgs::operator=(
6817 DeviceAuthorizationArgs&& other)
noexcept
6819 if (
this != &other) {
6820 if (state_ == DiscordObjectState::Owned) {
6823 instance_ = other.instance_;
6824 state_ = other.state_;
6825 other.state_ = DiscordObjectState::Invalid;
6829DeviceAuthorizationArgs::DeviceAuthorizationArgs(
const DeviceAuthorizationArgs& arg0)
6834 Discord_DeviceAuthorizationArgs_Clone(&instance_, arg0.instance());
6836 state_ = DiscordObjectState::Owned;
6839DeviceAuthorizationArgs& DeviceAuthorizationArgs::operator=(
const DeviceAuthorizationArgs& arg0)
6841 if (
this != &arg0) {
6842 if (state_ == DiscordObjectState::Owned) {
6844 state_ = DiscordObjectState::Invalid;
6846 if (arg0.state_ == DiscordObjectState::Owned) {
6847 Discord_DeviceAuthorizationArgs_Clone(&instance_, arg0.instance());
6849 state_ = DiscordObjectState::Owned;
6854DeviceAuthorizationArgs::DeviceAuthorizationArgs(Discord_DeviceAuthorizationArgs instance,
6855 DiscordObjectState state)
6856 : instance_(instance)
6860DeviceAuthorizationArgs::DeviceAuthorizationArgs()
6862 assert(state_ == DiscordObjectState::Invalid);
6863 Discord_DeviceAuthorizationArgs_Init(&instance_);
6864 state_ = DiscordObjectState::Owned;
6866void DeviceAuthorizationArgs::Drop()
6868 if (state_ != DiscordObjectState::Owned) {
6871 Discord_DeviceAuthorizationArgs_Drop(&instance_);
6872 state_ = DiscordObjectState::Invalid;
6874uint64_t DeviceAuthorizationArgs::ClientId()
const
6876 assert(state_ == DiscordObjectState::Owned);
6877 uint64_t returnValue__;
6878 returnValue__ = Discord_DeviceAuthorizationArgs_ClientId(&instance_);
6879 return returnValue__;
6881void DeviceAuthorizationArgs::SetClientId(uint64_t ClientId)
6883 assert(state_ == DiscordObjectState::Owned);
6884 Discord_DeviceAuthorizationArgs_SetClientId(&instance_, ClientId);
6886std::string DeviceAuthorizationArgs::Scopes()
const
6888 assert(state_ == DiscordObjectState::Owned);
6889 Discord_String returnValueNative__;
6890 Discord_DeviceAuthorizationArgs_Scopes(&instance_, &returnValueNative__);
6891 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
6892 returnValueNative__.size);
6893 Discord_Free(returnValueNative__.ptr);
6894 return returnValue__;
6896void DeviceAuthorizationArgs::SetScopes(std::string Scopes)
6898 assert(state_ == DiscordObjectState::Owned);
6899 Discord_String Scopes__str{(uint8_t*)(Scopes.data()), Scopes.size()};
6900 Discord_DeviceAuthorizationArgs_SetScopes(&instance_, Scopes__str);
6902const VoiceStateHandle VoiceStateHandle::nullobj{{}, DiscordObjectState::Invalid};
6903VoiceStateHandle::~VoiceStateHandle()
6905 if (state_ == DiscordObjectState::Owned) {
6907 state_ = DiscordObjectState::Invalid;
6910VoiceStateHandle::VoiceStateHandle(VoiceStateHandle&& other) noexcept
6911 : instance_(other.instance_)
6912 , state_(other.state_)
6914 other.state_ = DiscordObjectState::Invalid;
6916VoiceStateHandle& VoiceStateHandle::operator=(VoiceStateHandle&& other)
noexcept
6918 if (
this != &other) {
6919 if (state_ == DiscordObjectState::Owned) {
6922 instance_ = other.instance_;
6923 state_ = other.state_;
6924 other.state_ = DiscordObjectState::Invalid;
6928VoiceStateHandle::VoiceStateHandle(
const VoiceStateHandle& other)
6933 Discord_VoiceStateHandle_Clone(&instance_, other.instance());
6935 state_ = DiscordObjectState::Owned;
6938VoiceStateHandle& VoiceStateHandle::operator=(
const VoiceStateHandle& other)
6940 if (
this != &other) {
6941 if (state_ == DiscordObjectState::Owned) {
6943 state_ = DiscordObjectState::Invalid;
6945 if (other.state_ == DiscordObjectState::Owned) {
6946 Discord_VoiceStateHandle_Clone(&instance_, other.instance());
6948 state_ = DiscordObjectState::Owned;
6953VoiceStateHandle::VoiceStateHandle(Discord_VoiceStateHandle instance, DiscordObjectState state)
6954 : instance_(instance)
6958void VoiceStateHandle::Drop()
6960 if (state_ != DiscordObjectState::Owned) {
6963 Discord_VoiceStateHandle_Drop(&instance_);
6964 state_ = DiscordObjectState::Invalid;
6966bool VoiceStateHandle::SelfDeaf()
const
6968 assert(state_ == DiscordObjectState::Owned);
6970 returnValue__ = Discord_VoiceStateHandle_SelfDeaf(&instance_);
6971 return returnValue__;
6973bool VoiceStateHandle::SelfMute()
const
6975 assert(state_ == DiscordObjectState::Owned);
6977 returnValue__ = Discord_VoiceStateHandle_SelfMute(&instance_);
6978 return returnValue__;
6980const VADThresholdSettings VADThresholdSettings::nullobj{{}, DiscordObjectState::Invalid};
6981VADThresholdSettings::~VADThresholdSettings()
6983 if (state_ == DiscordObjectState::Owned) {
6985 state_ = DiscordObjectState::Invalid;
6988VADThresholdSettings::VADThresholdSettings(VADThresholdSettings&& other) noexcept
6989 : instance_(other.instance_)
6990 , state_(other.state_)
6992 other.state_ = DiscordObjectState::Invalid;
6994VADThresholdSettings& VADThresholdSettings::operator=(VADThresholdSettings&& other)
noexcept
6996 if (
this != &other) {
6997 if (state_ == DiscordObjectState::Owned) {
7000 instance_ = other.instance_;
7001 state_ = other.state_;
7002 other.state_ = DiscordObjectState::Invalid;
7006VADThresholdSettings::VADThresholdSettings(Discord_VADThresholdSettings instance,
7007 DiscordObjectState state)
7008 : instance_(instance)
7012void VADThresholdSettings::Drop()
7014 if (state_ != DiscordObjectState::Owned) {
7017 Discord_VADThresholdSettings_Drop(&instance_);
7018 state_ = DiscordObjectState::Invalid;
7020float VADThresholdSettings::VadThreshold()
const
7022 assert(state_ == DiscordObjectState::Owned);
7023 float returnValue__;
7024 returnValue__ = Discord_VADThresholdSettings_VadThreshold(&instance_);
7025 return returnValue__;
7027void VADThresholdSettings::SetVadThreshold(
float VadThreshold)
7029 assert(state_ == DiscordObjectState::Owned);
7030 Discord_VADThresholdSettings_SetVadThreshold(&instance_, VadThreshold);
7032bool VADThresholdSettings::Automatic()
const
7034 assert(state_ == DiscordObjectState::Owned);
7036 returnValue__ = Discord_VADThresholdSettings_Automatic(&instance_);
7037 return returnValue__;
7039void VADThresholdSettings::SetAutomatic(
bool Automatic)
7041 assert(state_ == DiscordObjectState::Owned);
7042 Discord_VADThresholdSettings_SetAutomatic(&instance_, Automatic);
7044const Call Call::nullobj{{}, DiscordObjectState::Invalid};
7047 if (state_ == DiscordObjectState::Owned) {
7049 state_ = DiscordObjectState::Invalid;
7052Call::Call(Call&& other) noexcept
7053 : instance_(other.instance_)
7054 , state_(other.state_)
7056 other.state_ = DiscordObjectState::Invalid;
7058Call& Call::operator=(Call&& other)
noexcept
7060 if (
this != &other) {
7061 if (state_ == DiscordObjectState::Owned) {
7064 instance_ = other.instance_;
7065 state_ = other.state_;
7066 other.state_ = DiscordObjectState::Invalid;
7070Call::Call(
const Call& other)
7075 Discord_Call_Clone(&instance_, other.instance());
7077 state_ = DiscordObjectState::Owned;
7080Call& Call::operator=(
const Call& other)
7082 if (
this != &other) {
7083 if (state_ == DiscordObjectState::Owned) {
7085 state_ = DiscordObjectState::Invalid;
7087 if (other.state_ == DiscordObjectState::Owned) {
7088 Discord_Call_Clone(&instance_, other.instance());
7090 state_ = DiscordObjectState::Owned;
7095Call::Call(Discord_Call instance, DiscordObjectState state)
7096 : instance_(instance)
7102 if (state_ != DiscordObjectState::Owned) {
7105 Discord_Call_Drop(&instance_);
7106 state_ = DiscordObjectState::Invalid;
7110 Discord_String returnValueNative__;
7111 Discord_Call_ErrorToString(
static_cast<Discord_Call_Error
>(type), &returnValueNative__);
7112 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7113 returnValueNative__.size);
7114 Discord_Free(returnValueNative__.ptr);
7115 return returnValue__;
7119 assert(state_ == DiscordObjectState::Owned);
7120 Discord_AudioModeType returnValue__;
7121 returnValue__ = Discord_Call_GetAudioMode(&instance_);
7124uint64_t Call::GetChannelId()
const
7126 assert(state_ == DiscordObjectState::Owned);
7127 uint64_t returnValue__;
7128 returnValue__ = Discord_Call_GetChannelId(&instance_);
7129 return returnValue__;
7131uint64_t Call::GetGuildId()
const
7133 assert(state_ == DiscordObjectState::Owned);
7134 uint64_t returnValue__;
7135 returnValue__ = Discord_Call_GetGuildId(&instance_);
7136 return returnValue__;
7138bool Call::GetLocalMute(uint64_t userId)
7140 assert(state_ == DiscordObjectState::Owned);
7142 returnValue__ = Discord_Call_GetLocalMute(&instance_, userId);
7143 return returnValue__;
7145std::vector<uint64_t> Call::GetParticipants()
const
7147 assert(state_ == DiscordObjectState::Owned);
7148 Discord_UInt64Span returnValueNative__;
7149 Discord_Call_GetParticipants(&instance_, &returnValueNative__);
7150 std::vector<uint64_t> returnValue__(returnValueNative__.ptr,
7151 returnValueNative__.ptr + returnValueNative__.size);
7152 Discord_Free(returnValueNative__.ptr);
7153 return returnValue__;
7155float Call::GetParticipantVolume(uint64_t userId)
7157 assert(state_ == DiscordObjectState::Owned);
7158 float returnValue__;
7159 returnValue__ = Discord_Call_GetParticipantVolume(&instance_, userId);
7160 return returnValue__;
7162bool Call::GetPTTActive()
7164 assert(state_ == DiscordObjectState::Owned);
7166 returnValue__ = Discord_Call_GetPTTActive(&instance_);
7167 return returnValue__;
7169uint32_t Call::GetPTTReleaseDelay()
7171 assert(state_ == DiscordObjectState::Owned);
7172 uint32_t returnValue__;
7173 returnValue__ = Discord_Call_GetPTTReleaseDelay(&instance_);
7174 return returnValue__;
7176bool Call::GetSelfDeaf()
7178 assert(state_ == DiscordObjectState::Owned);
7180 returnValue__ = Discord_Call_GetSelfDeaf(&instance_);
7181 return returnValue__;
7183bool Call::GetSelfMute()
7185 assert(state_ == DiscordObjectState::Owned);
7187 returnValue__ = Discord_Call_GetSelfMute(&instance_);
7188 return returnValue__;
7192 assert(state_ == DiscordObjectState::Owned);
7193 Discord_Call_Status returnValue__;
7194 returnValue__ = Discord_Call_GetStatus(&instance_);
7199 assert(state_ == DiscordObjectState::Owned);
7200 Discord_VADThresholdSettings returnValueNative__{};
7201 Discord_Call_GetVADThreshold(&instance_, &returnValueNative__);
7203 return returnValue__;
7205std::optional<discordpp::VoiceStateHandle> Call::GetVoiceStateHandle(uint64_t userId)
const
7207 assert(state_ == DiscordObjectState::Owned);
7208 bool returnIsNonNull__;
7209 Discord_VoiceStateHandle returnValueNative__;
7210 returnIsNonNull__ = Discord_Call_GetVoiceStateHandle(&instance_, userId, &returnValueNative__);
7211 if (!returnIsNonNull__) {
7215 return returnValue__;
7219 assert(state_ == DiscordObjectState::Owned);
7220 Discord_Call_SetAudioMode(&instance_,
static_cast<Discord_AudioModeType
>(audioMode));
7222void Call::SetLocalMute(uint64_t userId,
bool mute)
7224 assert(state_ == DiscordObjectState::Owned);
7225 Discord_Call_SetLocalMute(&instance_, userId, mute);
7229 assert(state_ == DiscordObjectState::Owned);
7230 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
7231 auto cb__userData =
new Tcb__UserData(cb);
7232 Discord_Call_OnVoiceStateChanged cb__native = [](
auto userId,
void* userData__) {
7233 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
7234 userData__typed->delegate(userId);
7236 Discord_Call_SetOnVoiceStateChangedCallback(
7237 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
7241 assert(state_ == DiscordObjectState::Owned);
7242 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
7243 auto cb__userData =
new Tcb__UserData(cb);
7244 Discord_Call_OnParticipantChanged cb__native = [](
auto userId,
auto added,
void* userData__) {
7245 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
7246 userData__typed->delegate(userId, added);
7248 Discord_Call_SetParticipantChangedCallback(
7249 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
7251void Call::SetParticipantVolume(uint64_t userId,
float volume)
7253 assert(state_ == DiscordObjectState::Owned);
7254 Discord_Call_SetParticipantVolume(&instance_, userId, volume);
7256void Call::SetPTTActive(
bool active)
7258 assert(state_ == DiscordObjectState::Owned);
7259 Discord_Call_SetPTTActive(&instance_, active);
7261void Call::SetPTTReleaseDelay(uint32_t releaseDelayMs)
7263 assert(state_ == DiscordObjectState::Owned);
7264 Discord_Call_SetPTTReleaseDelay(&instance_, releaseDelayMs);
7266void Call::SetSelfDeaf(
bool deaf)
7268 assert(state_ == DiscordObjectState::Owned);
7269 Discord_Call_SetSelfDeaf(&instance_, deaf);
7271void Call::SetSelfMute(
bool mute)
7273 assert(state_ == DiscordObjectState::Owned);
7274 Discord_Call_SetSelfMute(&instance_, mute);
7278 assert(state_ == DiscordObjectState::Owned);
7279 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
7280 auto cb__userData =
new Tcb__UserData(cb);
7281 Discord_Call_OnSpeakingStatusChanged cb__native =
7282 [](
auto userId,
auto isPlayingSound,
void* userData__) {
7283 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
7284 userData__typed->delegate(userId, isPlayingSound);
7286 Discord_Call_SetSpeakingStatusChangedCallback(
7287 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
7291 assert(state_ == DiscordObjectState::Owned);
7292 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
7293 auto cb__userData =
new Tcb__UserData(cb);
7294 Discord_Call_OnStatusChanged cb__native =
7295 [](
auto status,
auto error,
auto errorDetail,
void* userData__) {
7296 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
7301 Discord_Call_SetStatusChangedCallback(
7302 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
7304void Call::SetVADThreshold(
bool automatic,
float threshold)
7306 assert(state_ == DiscordObjectState::Owned);
7307 Discord_Call_SetVADThreshold(&instance_, automatic, threshold);
7311 Discord_String returnValueNative__;
7312 Discord_Call_StatusToString(
static_cast<Discord_Call_Status
>(type), &returnValueNative__);
7313 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7314 returnValueNative__.size);
7315 Discord_Free(returnValueNative__.ptr);
7316 return returnValue__;
7318const ChannelHandle ChannelHandle::nullobj{{}, DiscordObjectState::Invalid};
7319ChannelHandle::~ChannelHandle()
7321 if (state_ == DiscordObjectState::Owned) {
7323 state_ = DiscordObjectState::Invalid;
7326ChannelHandle::ChannelHandle(ChannelHandle&& other) noexcept
7327 : instance_(other.instance_)
7328 , state_(other.state_)
7330 other.state_ = DiscordObjectState::Invalid;
7332ChannelHandle& ChannelHandle::operator=(ChannelHandle&& other)
noexcept
7334 if (
this != &other) {
7335 if (state_ == DiscordObjectState::Owned) {
7338 instance_ = other.instance_;
7339 state_ = other.state_;
7340 other.state_ = DiscordObjectState::Invalid;
7344ChannelHandle::ChannelHandle(
const ChannelHandle& other)
7349 Discord_ChannelHandle_Clone(&instance_, other.instance());
7351 state_ = DiscordObjectState::Owned;
7354ChannelHandle& ChannelHandle::operator=(
const ChannelHandle& other)
7356 if (
this != &other) {
7357 if (state_ == DiscordObjectState::Owned) {
7359 state_ = DiscordObjectState::Invalid;
7361 if (other.state_ == DiscordObjectState::Owned) {
7362 Discord_ChannelHandle_Clone(&instance_, other.instance());
7364 state_ = DiscordObjectState::Owned;
7369ChannelHandle::ChannelHandle(Discord_ChannelHandle instance, DiscordObjectState state)
7370 : instance_(instance)
7374void ChannelHandle::Drop()
7376 if (state_ != DiscordObjectState::Owned) {
7379 Discord_ChannelHandle_Drop(&instance_);
7380 state_ = DiscordObjectState::Invalid;
7382uint64_t ChannelHandle::Id()
const
7384 assert(state_ == DiscordObjectState::Owned);
7385 uint64_t returnValue__;
7386 returnValue__ = Discord_ChannelHandle_Id(&instance_);
7387 return returnValue__;
7389std::string ChannelHandle::Name()
const
7391 assert(state_ == DiscordObjectState::Owned);
7392 Discord_String returnValueNative__;
7393 Discord_ChannelHandle_Name(&instance_, &returnValueNative__);
7394 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7395 returnValueNative__.size);
7396 Discord_Free(returnValueNative__.ptr);
7397 return returnValue__;
7399std::vector<uint64_t> ChannelHandle::Recipients()
const
7401 assert(state_ == DiscordObjectState::Owned);
7402 Discord_UInt64Span returnValueNative__;
7403 Discord_ChannelHandle_Recipients(&instance_, &returnValueNative__);
7404 std::vector<uint64_t> returnValue__(returnValueNative__.ptr,
7405 returnValueNative__.ptr + returnValueNative__.size);
7406 Discord_Free(returnValueNative__.ptr);
7407 return returnValue__;
7411 assert(state_ == DiscordObjectState::Owned);
7412 Discord_ChannelType returnValue__;
7413 returnValue__ = Discord_ChannelHandle_Type(&instance_);
7416const GuildMinimal GuildMinimal::nullobj{{}, DiscordObjectState::Invalid};
7417GuildMinimal::~GuildMinimal()
7419 if (state_ == DiscordObjectState::Owned) {
7421 state_ = DiscordObjectState::Invalid;
7424GuildMinimal::GuildMinimal(GuildMinimal&& other) noexcept
7425 : instance_(other.instance_)
7426 , state_(other.state_)
7428 other.state_ = DiscordObjectState::Invalid;
7430GuildMinimal& GuildMinimal::operator=(GuildMinimal&& other)
noexcept
7432 if (
this != &other) {
7433 if (state_ == DiscordObjectState::Owned) {
7436 instance_ = other.instance_;
7437 state_ = other.state_;
7438 other.state_ = DiscordObjectState::Invalid;
7442GuildMinimal::GuildMinimal(
const GuildMinimal& arg0)
7447 Discord_GuildMinimal_Clone(&instance_, arg0.instance());
7449 state_ = DiscordObjectState::Owned;
7452GuildMinimal& GuildMinimal::operator=(
const GuildMinimal& arg0)
7454 if (
this != &arg0) {
7455 if (state_ == DiscordObjectState::Owned) {
7457 state_ = DiscordObjectState::Invalid;
7459 if (arg0.state_ == DiscordObjectState::Owned) {
7460 Discord_GuildMinimal_Clone(&instance_, arg0.instance());
7462 state_ = DiscordObjectState::Owned;
7467GuildMinimal::GuildMinimal(Discord_GuildMinimal instance, DiscordObjectState state)
7468 : instance_(instance)
7472void GuildMinimal::Drop()
7474 if (state_ != DiscordObjectState::Owned) {
7477 Discord_GuildMinimal_Drop(&instance_);
7478 state_ = DiscordObjectState::Invalid;
7480uint64_t GuildMinimal::Id()
const
7482 assert(state_ == DiscordObjectState::Owned);
7483 uint64_t returnValue__;
7484 returnValue__ = Discord_GuildMinimal_Id(&instance_);
7485 return returnValue__;
7487void GuildMinimal::SetId(uint64_t Id)
7489 assert(state_ == DiscordObjectState::Owned);
7490 Discord_GuildMinimal_SetId(&instance_, Id);
7492std::string GuildMinimal::Name()
const
7494 assert(state_ == DiscordObjectState::Owned);
7495 Discord_String returnValueNative__;
7496 Discord_GuildMinimal_Name(&instance_, &returnValueNative__);
7497 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7498 returnValueNative__.size);
7499 Discord_Free(returnValueNative__.ptr);
7500 return returnValue__;
7502void GuildMinimal::SetName(std::string Name)
7504 assert(state_ == DiscordObjectState::Owned);
7505 Discord_String Name__str{(uint8_t*)(Name.data()), Name.size()};
7506 Discord_GuildMinimal_SetName(&instance_, Name__str);
7508const GuildChannel GuildChannel::nullobj{{}, DiscordObjectState::Invalid};
7509GuildChannel::~GuildChannel()
7511 if (state_ == DiscordObjectState::Owned) {
7513 state_ = DiscordObjectState::Invalid;
7516GuildChannel::GuildChannel(GuildChannel&& other) noexcept
7517 : instance_(other.instance_)
7518 , state_(other.state_)
7520 other.state_ = DiscordObjectState::Invalid;
7522GuildChannel& GuildChannel::operator=(GuildChannel&& other)
noexcept
7524 if (
this != &other) {
7525 if (state_ == DiscordObjectState::Owned) {
7528 instance_ = other.instance_;
7529 state_ = other.state_;
7530 other.state_ = DiscordObjectState::Invalid;
7534GuildChannel::GuildChannel(
const GuildChannel& arg0)
7539 Discord_GuildChannel_Clone(&instance_, arg0.instance());
7541 state_ = DiscordObjectState::Owned;
7544GuildChannel& GuildChannel::operator=(
const GuildChannel& arg0)
7546 if (
this != &arg0) {
7547 if (state_ == DiscordObjectState::Owned) {
7549 state_ = DiscordObjectState::Invalid;
7551 if (arg0.state_ == DiscordObjectState::Owned) {
7552 Discord_GuildChannel_Clone(&instance_, arg0.instance());
7554 state_ = DiscordObjectState::Owned;
7559GuildChannel::GuildChannel(Discord_GuildChannel instance, DiscordObjectState state)
7560 : instance_(instance)
7564void GuildChannel::Drop()
7566 if (state_ != DiscordObjectState::Owned) {
7569 Discord_GuildChannel_Drop(&instance_);
7570 state_ = DiscordObjectState::Invalid;
7572uint64_t GuildChannel::Id()
const
7574 assert(state_ == DiscordObjectState::Owned);
7575 uint64_t returnValue__;
7576 returnValue__ = Discord_GuildChannel_Id(&instance_);
7577 return returnValue__;
7579void GuildChannel::SetId(uint64_t Id)
7581 assert(state_ == DiscordObjectState::Owned);
7582 Discord_GuildChannel_SetId(&instance_, Id);
7584std::string GuildChannel::Name()
const
7586 assert(state_ == DiscordObjectState::Owned);
7587 Discord_String returnValueNative__;
7588 Discord_GuildChannel_Name(&instance_, &returnValueNative__);
7589 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7590 returnValueNative__.size);
7591 Discord_Free(returnValueNative__.ptr);
7592 return returnValue__;
7594void GuildChannel::SetName(std::string Name)
7596 assert(state_ == DiscordObjectState::Owned);
7597 Discord_String Name__str{(uint8_t*)(Name.data()), Name.size()};
7598 Discord_GuildChannel_SetName(&instance_, Name__str);
7600bool GuildChannel::IsLinkable()
const
7602 assert(state_ == DiscordObjectState::Owned);
7604 returnValue__ = Discord_GuildChannel_IsLinkable(&instance_);
7605 return returnValue__;
7607void GuildChannel::SetIsLinkable(
bool IsLinkable)
7609 assert(state_ == DiscordObjectState::Owned);
7610 Discord_GuildChannel_SetIsLinkable(&instance_, IsLinkable);
7612bool GuildChannel::IsViewableAndWriteableByAllMembers()
const
7614 assert(state_ == DiscordObjectState::Owned);
7616 returnValue__ = Discord_GuildChannel_IsViewableAndWriteableByAllMembers(&instance_);
7617 return returnValue__;
7619void GuildChannel::SetIsViewableAndWriteableByAllMembers(
bool IsViewableAndWriteableByAllMembers)
7621 assert(state_ == DiscordObjectState::Owned);
7622 Discord_GuildChannel_SetIsViewableAndWriteableByAllMembers(&instance_,
7623 IsViewableAndWriteableByAllMembers);
7625std::optional<discordpp::LinkedLobby> GuildChannel::LinkedLobby()
const
7627 assert(state_ == DiscordObjectState::Owned);
7628 bool returnIsNonNull__;
7629 Discord_LinkedLobby returnValueNative__;
7630 returnIsNonNull__ = Discord_GuildChannel_LinkedLobby(&instance_, &returnValueNative__);
7631 if (!returnIsNonNull__) {
7635 return returnValue__;
7637void GuildChannel::SetLinkedLobby(std::optional<discordpp::LinkedLobby> LinkedLobby)
7639 assert(state_ == DiscordObjectState::Owned);
7640 Discord_GuildChannel_SetLinkedLobby(
7641 &instance_, (LinkedLobby.has_value() ? LinkedLobby->instance() :
nullptr));
7643const LinkedLobby LinkedLobby::nullobj{{}, DiscordObjectState::Invalid};
7644LinkedLobby::~LinkedLobby()
7646 if (state_ == DiscordObjectState::Owned) {
7648 state_ = DiscordObjectState::Invalid;
7651LinkedLobby::LinkedLobby(LinkedLobby&& other) noexcept
7652 : instance_(other.instance_)
7653 , state_(other.state_)
7655 other.state_ = DiscordObjectState::Invalid;
7657LinkedLobby& LinkedLobby::operator=(LinkedLobby&& other)
noexcept
7659 if (
this != &other) {
7660 if (state_ == DiscordObjectState::Owned) {
7663 instance_ = other.instance_;
7664 state_ = other.state_;
7665 other.state_ = DiscordObjectState::Invalid;
7669LinkedLobby::LinkedLobby(
const LinkedLobby& arg0)
7674 Discord_LinkedLobby_Clone(&instance_, arg0.instance());
7676 state_ = DiscordObjectState::Owned;
7679LinkedLobby& LinkedLobby::operator=(
const LinkedLobby& arg0)
7681 if (
this != &arg0) {
7682 if (state_ == DiscordObjectState::Owned) {
7684 state_ = DiscordObjectState::Invalid;
7686 if (arg0.state_ == DiscordObjectState::Owned) {
7687 Discord_LinkedLobby_Clone(&instance_, arg0.instance());
7689 state_ = DiscordObjectState::Owned;
7694LinkedLobby::LinkedLobby(Discord_LinkedLobby instance, DiscordObjectState state)
7695 : instance_(instance)
7699LinkedLobby::LinkedLobby()
7701 assert(state_ == DiscordObjectState::Invalid);
7702 Discord_LinkedLobby_Init(&instance_);
7703 state_ = DiscordObjectState::Owned;
7705void LinkedLobby::Drop()
7707 if (state_ != DiscordObjectState::Owned) {
7710 Discord_LinkedLobby_Drop(&instance_);
7711 state_ = DiscordObjectState::Invalid;
7713uint64_t LinkedLobby::ApplicationId()
const
7715 assert(state_ == DiscordObjectState::Owned);
7716 uint64_t returnValue__;
7717 returnValue__ = Discord_LinkedLobby_ApplicationId(&instance_);
7718 return returnValue__;
7720void LinkedLobby::SetApplicationId(uint64_t ApplicationId)
7722 assert(state_ == DiscordObjectState::Owned);
7723 Discord_LinkedLobby_SetApplicationId(&instance_, ApplicationId);
7725uint64_t LinkedLobby::LobbyId()
const
7727 assert(state_ == DiscordObjectState::Owned);
7728 uint64_t returnValue__;
7729 returnValue__ = Discord_LinkedLobby_LobbyId(&instance_);
7730 return returnValue__;
7732void LinkedLobby::SetLobbyId(uint64_t LobbyId)
7734 assert(state_ == DiscordObjectState::Owned);
7735 Discord_LinkedLobby_SetLobbyId(&instance_, LobbyId);
7737const LinkedChannel LinkedChannel::nullobj{{}, DiscordObjectState::Invalid};
7738LinkedChannel::~LinkedChannel()
7740 if (state_ == DiscordObjectState::Owned) {
7742 state_ = DiscordObjectState::Invalid;
7745LinkedChannel::LinkedChannel(LinkedChannel&& other) noexcept
7746 : instance_(other.instance_)
7747 , state_(other.state_)
7749 other.state_ = DiscordObjectState::Invalid;
7751LinkedChannel& LinkedChannel::operator=(LinkedChannel&& other)
noexcept
7753 if (
this != &other) {
7754 if (state_ == DiscordObjectState::Owned) {
7757 instance_ = other.instance_;
7758 state_ = other.state_;
7759 other.state_ = DiscordObjectState::Invalid;
7763LinkedChannel::LinkedChannel(
const LinkedChannel& arg0)
7768 Discord_LinkedChannel_Clone(&instance_, arg0.instance());
7770 state_ = DiscordObjectState::Owned;
7773LinkedChannel& LinkedChannel::operator=(
const LinkedChannel& arg0)
7775 if (
this != &arg0) {
7776 if (state_ == DiscordObjectState::Owned) {
7778 state_ = DiscordObjectState::Invalid;
7780 if (arg0.state_ == DiscordObjectState::Owned) {
7781 Discord_LinkedChannel_Clone(&instance_, arg0.instance());
7783 state_ = DiscordObjectState::Owned;
7788LinkedChannel::LinkedChannel(Discord_LinkedChannel instance, DiscordObjectState state)
7789 : instance_(instance)
7793void LinkedChannel::Drop()
7795 if (state_ != DiscordObjectState::Owned) {
7798 Discord_LinkedChannel_Drop(&instance_);
7799 state_ = DiscordObjectState::Invalid;
7801uint64_t LinkedChannel::Id()
const
7803 assert(state_ == DiscordObjectState::Owned);
7804 uint64_t returnValue__;
7805 returnValue__ = Discord_LinkedChannel_Id(&instance_);
7806 return returnValue__;
7808void LinkedChannel::SetId(uint64_t Id)
7810 assert(state_ == DiscordObjectState::Owned);
7811 Discord_LinkedChannel_SetId(&instance_, Id);
7813std::string LinkedChannel::Name()
const
7815 assert(state_ == DiscordObjectState::Owned);
7816 Discord_String returnValueNative__;
7817 Discord_LinkedChannel_Name(&instance_, &returnValueNative__);
7818 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7819 returnValueNative__.size);
7820 Discord_Free(returnValueNative__.ptr);
7821 return returnValue__;
7823void LinkedChannel::SetName(std::string Name)
7825 assert(state_ == DiscordObjectState::Owned);
7826 Discord_String Name__str{(uint8_t*)(Name.data()), Name.size()};
7827 Discord_LinkedChannel_SetName(&instance_, Name__str);
7829uint64_t LinkedChannel::GuildId()
const
7831 assert(state_ == DiscordObjectState::Owned);
7832 uint64_t returnValue__;
7833 returnValue__ = Discord_LinkedChannel_GuildId(&instance_);
7834 return returnValue__;
7836void LinkedChannel::SetGuildId(uint64_t GuildId)
7838 assert(state_ == DiscordObjectState::Owned);
7839 Discord_LinkedChannel_SetGuildId(&instance_, GuildId);
7841const RelationshipHandle RelationshipHandle::nullobj{{}, DiscordObjectState::Invalid};
7842RelationshipHandle::~RelationshipHandle()
7844 if (state_ == DiscordObjectState::Owned) {
7846 state_ = DiscordObjectState::Invalid;
7849RelationshipHandle::RelationshipHandle(RelationshipHandle&& other) noexcept
7850 : instance_(other.instance_)
7851 , state_(other.state_)
7853 other.state_ = DiscordObjectState::Invalid;
7855RelationshipHandle& RelationshipHandle::operator=(RelationshipHandle&& other)
noexcept
7857 if (
this != &other) {
7858 if (state_ == DiscordObjectState::Owned) {
7861 instance_ = other.instance_;
7862 state_ = other.state_;
7863 other.state_ = DiscordObjectState::Invalid;
7867RelationshipHandle::RelationshipHandle(
const RelationshipHandle& other)
7872 Discord_RelationshipHandle_Clone(&instance_, other.instance());
7874 state_ = DiscordObjectState::Owned;
7877RelationshipHandle& RelationshipHandle::operator=(
const RelationshipHandle& other)
7879 if (
this != &other) {
7880 if (state_ == DiscordObjectState::Owned) {
7882 state_ = DiscordObjectState::Invalid;
7884 if (other.state_ == DiscordObjectState::Owned) {
7885 Discord_RelationshipHandle_Clone(&instance_, other.instance());
7887 state_ = DiscordObjectState::Owned;
7892RelationshipHandle::RelationshipHandle(Discord_RelationshipHandle instance,
7893 DiscordObjectState state)
7894 : instance_(instance)
7898void RelationshipHandle::Drop()
7900 if (state_ != DiscordObjectState::Owned) {
7903 Discord_RelationshipHandle_Drop(&instance_);
7904 state_ = DiscordObjectState::Invalid;
7908 assert(state_ == DiscordObjectState::Owned);
7909 Discord_RelationshipType returnValue__;
7910 returnValue__ = Discord_RelationshipHandle_DiscordRelationshipType(&instance_);
7915 assert(state_ == DiscordObjectState::Owned);
7916 Discord_RelationshipType returnValue__;
7917 returnValue__ = Discord_RelationshipHandle_GameRelationshipType(&instance_);
7920uint64_t RelationshipHandle::Id()
const
7922 assert(state_ == DiscordObjectState::Owned);
7923 uint64_t returnValue__;
7924 returnValue__ = Discord_RelationshipHandle_Id(&instance_);
7925 return returnValue__;
7927std::optional<discordpp::UserHandle> RelationshipHandle::User()
const
7929 assert(state_ == DiscordObjectState::Owned);
7930 bool returnIsNonNull__;
7931 Discord_UserHandle returnValueNative__;
7932 returnIsNonNull__ = Discord_RelationshipHandle_User(&instance_, &returnValueNative__);
7933 if (!returnIsNonNull__) {
7937 return returnValue__;
7939const UserHandle UserHandle::nullobj{{}, DiscordObjectState::Invalid};
7940UserHandle::~UserHandle()
7942 if (state_ == DiscordObjectState::Owned) {
7944 state_ = DiscordObjectState::Invalid;
7947UserHandle::UserHandle(UserHandle&& other) noexcept
7948 : instance_(other.instance_)
7949 , state_(other.state_)
7951 other.state_ = DiscordObjectState::Invalid;
7953UserHandle& UserHandle::operator=(UserHandle&& other)
noexcept
7955 if (
this != &other) {
7956 if (state_ == DiscordObjectState::Owned) {
7959 instance_ = other.instance_;
7960 state_ = other.state_;
7961 other.state_ = DiscordObjectState::Invalid;
7965UserHandle::UserHandle(
const UserHandle& arg0)
7970 Discord_UserHandle_Clone(&instance_, arg0.instance());
7972 state_ = DiscordObjectState::Owned;
7975UserHandle& UserHandle::operator=(
const UserHandle& arg0)
7977 if (
this != &arg0) {
7978 if (state_ == DiscordObjectState::Owned) {
7980 state_ = DiscordObjectState::Invalid;
7982 if (arg0.state_ == DiscordObjectState::Owned) {
7983 Discord_UserHandle_Clone(&instance_, arg0.instance());
7985 state_ = DiscordObjectState::Owned;
7990UserHandle::UserHandle(Discord_UserHandle instance, DiscordObjectState state)
7991 : instance_(instance)
7995void UserHandle::Drop()
7997 if (state_ != DiscordObjectState::Owned) {
8000 Discord_UserHandle_Drop(&instance_);
8001 state_ = DiscordObjectState::Invalid;
8003std::optional<std::string> UserHandle::Avatar()
const
8005 assert(state_ == DiscordObjectState::Owned);
8006 bool returnIsNonNull__;
8007 Discord_String returnValueNative__;
8008 returnIsNonNull__ = Discord_UserHandle_Avatar(&instance_, &returnValueNative__);
8009 if (!returnIsNonNull__) {
8012 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
8013 returnValueNative__.size);
8014 Discord_Free(returnValueNative__.ptr);
8015 return returnValue__;
8019 Discord_String returnValueNative__;
8020 Discord_UserHandle_AvatarTypeToString(
static_cast<Discord_UserHandle_AvatarType
>(type),
8021 &returnValueNative__);
8022 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
8023 returnValueNative__.size);
8024 Discord_Free(returnValueNative__.ptr);
8025 return returnValue__;
8030 assert(state_ == DiscordObjectState::Owned);
8031 Discord_String returnValueNative__;
8032 Discord_UserHandle_AvatarUrl(&instance_,
8033 static_cast<Discord_UserHandle_AvatarType
>(animatedType),
8034 static_cast<Discord_UserHandle_AvatarType
>(staticType),
8035 &returnValueNative__);
8036 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
8037 returnValueNative__.size);
8038 Discord_Free(returnValueNative__.ptr);
8039 return returnValue__;
8041std::string UserHandle::DisplayName()
const
8043 assert(state_ == DiscordObjectState::Owned);
8044 Discord_String returnValueNative__;
8045 Discord_UserHandle_DisplayName(&instance_, &returnValueNative__);
8046 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
8047 returnValueNative__.size);
8048 Discord_Free(returnValueNative__.ptr);
8049 return returnValue__;
8051std::optional<discordpp::Activity> UserHandle::GameActivity()
const
8053 assert(state_ == DiscordObjectState::Owned);
8054 bool returnIsNonNull__;
8055 Discord_Activity returnValueNative__;
8056 returnIsNonNull__ = Discord_UserHandle_GameActivity(&instance_, &returnValueNative__);
8057 if (!returnIsNonNull__) {
8061 return returnValue__;
8063std::optional<std::string> UserHandle::GlobalName()
const
8065 assert(state_ == DiscordObjectState::Owned);
8066 bool returnIsNonNull__;
8067 Discord_String returnValueNative__;
8068 returnIsNonNull__ = Discord_UserHandle_GlobalName(&instance_, &returnValueNative__);
8069 if (!returnIsNonNull__) {
8072 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
8073 returnValueNative__.size);
8074 Discord_Free(returnValueNative__.ptr);
8075 return returnValue__;
8077uint64_t UserHandle::Id()
const
8079 assert(state_ == DiscordObjectState::Owned);
8080 uint64_t returnValue__;
8081 returnValue__ = Discord_UserHandle_Id(&instance_);
8082 return returnValue__;
8084bool UserHandle::IsProvisional()
const
8086 assert(state_ == DiscordObjectState::Owned);
8088 returnValue__ = Discord_UserHandle_IsProvisional(&instance_);
8089 return returnValue__;
8093 assert(state_ == DiscordObjectState::Owned);
8094 Discord_RelationshipHandle returnValueNative__{};
8095 Discord_UserHandle_Relationship(&instance_, &returnValueNative__);
8097 return returnValue__;
8101 assert(state_ == DiscordObjectState::Owned);
8102 Discord_StatusType returnValue__;
8103 returnValue__ = Discord_UserHandle_Status(&instance_);
8106std::string UserHandle::Username()
const
8108 assert(state_ == DiscordObjectState::Owned);
8109 Discord_String returnValueNative__;
8110 Discord_UserHandle_Username(&instance_, &returnValueNative__);
8111 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
8112 returnValueNative__.size);
8113 Discord_Free(returnValueNative__.ptr);
8114 return returnValue__;
8116const LobbyMemberHandle LobbyMemberHandle::nullobj{{}, DiscordObjectState::Invalid};
8117LobbyMemberHandle::~LobbyMemberHandle()
8119 if (state_ == DiscordObjectState::Owned) {
8121 state_ = DiscordObjectState::Invalid;
8124LobbyMemberHandle::LobbyMemberHandle(LobbyMemberHandle&& other) noexcept
8125 : instance_(other.instance_)
8126 , state_(other.state_)
8128 other.state_ = DiscordObjectState::Invalid;
8130LobbyMemberHandle& LobbyMemberHandle::operator=(LobbyMemberHandle&& other)
noexcept
8132 if (
this != &other) {
8133 if (state_ == DiscordObjectState::Owned) {
8136 instance_ = other.instance_;
8137 state_ = other.state_;
8138 other.state_ = DiscordObjectState::Invalid;
8142LobbyMemberHandle::LobbyMemberHandle(
const LobbyMemberHandle& other)
8147 Discord_LobbyMemberHandle_Clone(&instance_, other.instance());
8149 state_ = DiscordObjectState::Owned;
8152LobbyMemberHandle& LobbyMemberHandle::operator=(
const LobbyMemberHandle& other)
8154 if (
this != &other) {
8155 if (state_ == DiscordObjectState::Owned) {
8157 state_ = DiscordObjectState::Invalid;
8159 if (other.state_ == DiscordObjectState::Owned) {
8160 Discord_LobbyMemberHandle_Clone(&instance_, other.instance());
8162 state_ = DiscordObjectState::Owned;
8167LobbyMemberHandle::LobbyMemberHandle(Discord_LobbyMemberHandle instance, DiscordObjectState state)
8168 : instance_(instance)
8172void LobbyMemberHandle::Drop()
8174 if (state_ != DiscordObjectState::Owned) {
8177 Discord_LobbyMemberHandle_Drop(&instance_);
8178 state_ = DiscordObjectState::Invalid;
8180bool LobbyMemberHandle::CanLinkLobby()
const
8182 assert(state_ == DiscordObjectState::Owned);
8184 returnValue__ = Discord_LobbyMemberHandle_CanLinkLobby(&instance_);
8185 return returnValue__;
8187bool LobbyMemberHandle::Connected()
const
8189 assert(state_ == DiscordObjectState::Owned);
8191 returnValue__ = Discord_LobbyMemberHandle_Connected(&instance_);
8192 return returnValue__;
8194uint64_t LobbyMemberHandle::Id()
const
8196 assert(state_ == DiscordObjectState::Owned);
8197 uint64_t returnValue__;
8198 returnValue__ = Discord_LobbyMemberHandle_Id(&instance_);
8199 return returnValue__;
8201std::unordered_map<std::string, std::string> LobbyMemberHandle::Metadata()
const
8203 assert(state_ == DiscordObjectState::Owned);
8204 Discord_Properties returnValueNative__;
8205 Discord_LobbyMemberHandle_Metadata(&instance_, &returnValueNative__);
8206 std::unordered_map<std::string, std::string> returnValue__ =
8207 ConvertReturnedProperties(returnValueNative__);
8208 Discord_FreeProperties(returnValueNative__);
8209 return returnValue__;
8211std::optional<discordpp::UserHandle> LobbyMemberHandle::User()
const
8213 assert(state_ == DiscordObjectState::Owned);
8214 bool returnIsNonNull__;
8215 Discord_UserHandle returnValueNative__;
8216 returnIsNonNull__ = Discord_LobbyMemberHandle_User(&instance_, &returnValueNative__);
8217 if (!returnIsNonNull__) {
8221 return returnValue__;
8223const LobbyHandle LobbyHandle::nullobj{{}, DiscordObjectState::Invalid};
8224LobbyHandle::~LobbyHandle()
8226 if (state_ == DiscordObjectState::Owned) {
8228 state_ = DiscordObjectState::Invalid;
8231LobbyHandle::LobbyHandle(LobbyHandle&& other) noexcept
8232 : instance_(other.instance_)
8233 , state_(other.state_)
8235 other.state_ = DiscordObjectState::Invalid;
8237LobbyHandle& LobbyHandle::operator=(LobbyHandle&& other)
noexcept
8239 if (
this != &other) {
8240 if (state_ == DiscordObjectState::Owned) {
8243 instance_ = other.instance_;
8244 state_ = other.state_;
8245 other.state_ = DiscordObjectState::Invalid;
8249LobbyHandle::LobbyHandle(
const LobbyHandle& other)
8254 Discord_LobbyHandle_Clone(&instance_, other.instance());
8256 state_ = DiscordObjectState::Owned;
8259LobbyHandle& LobbyHandle::operator=(
const LobbyHandle& other)
8261 if (
this != &other) {
8262 if (state_ == DiscordObjectState::Owned) {
8264 state_ = DiscordObjectState::Invalid;
8266 if (other.state_ == DiscordObjectState::Owned) {
8267 Discord_LobbyHandle_Clone(&instance_, other.instance());
8269 state_ = DiscordObjectState::Owned;
8274LobbyHandle::LobbyHandle(Discord_LobbyHandle instance, DiscordObjectState state)
8275 : instance_(instance)
8279void LobbyHandle::Drop()
8281 if (state_ != DiscordObjectState::Owned) {
8284 Discord_LobbyHandle_Drop(&instance_);
8285 state_ = DiscordObjectState::Invalid;
8287std::optional<discordpp::CallInfoHandle> LobbyHandle::GetCallInfoHandle()
const
8289 assert(state_ == DiscordObjectState::Owned);
8290 bool returnIsNonNull__;
8291 Discord_CallInfoHandle returnValueNative__;
8292 returnIsNonNull__ = Discord_LobbyHandle_GetCallInfoHandle(&instance_, &returnValueNative__);
8293 if (!returnIsNonNull__) {
8297 return returnValue__;
8299std::optional<discordpp::LobbyMemberHandle> LobbyHandle::GetLobbyMemberHandle(
8300 uint64_t memberId)
const
8302 assert(state_ == DiscordObjectState::Owned);
8303 bool returnIsNonNull__;
8304 Discord_LobbyMemberHandle returnValueNative__;
8306 Discord_LobbyHandle_GetLobbyMemberHandle(&instance_, memberId, &returnValueNative__);
8307 if (!returnIsNonNull__) {
8311 return returnValue__;
8313uint64_t LobbyHandle::Id()
const
8315 assert(state_ == DiscordObjectState::Owned);
8316 uint64_t returnValue__;
8317 returnValue__ = Discord_LobbyHandle_Id(&instance_);
8318 return returnValue__;
8320std::optional<discordpp::LinkedChannel> LobbyHandle::LinkedChannel()
const
8322 assert(state_ == DiscordObjectState::Owned);
8323 bool returnIsNonNull__;
8324 Discord_LinkedChannel returnValueNative__;
8325 returnIsNonNull__ = Discord_LobbyHandle_LinkedChannel(&instance_, &returnValueNative__);
8326 if (!returnIsNonNull__) {
8330 return returnValue__;
8332std::vector<uint64_t> LobbyHandle::LobbyMemberIds()
const
8334 assert(state_ == DiscordObjectState::Owned);
8335 Discord_UInt64Span returnValueNative__;
8336 Discord_LobbyHandle_LobbyMemberIds(&instance_, &returnValueNative__);
8337 std::vector<uint64_t> returnValue__(returnValueNative__.ptr,
8338 returnValueNative__.ptr + returnValueNative__.size);
8339 Discord_Free(returnValueNative__.ptr);
8340 return returnValue__;
8342std::vector<discordpp::LobbyMemberHandle> LobbyHandle::LobbyMembers()
const
8344 assert(state_ == DiscordObjectState::Owned);
8345 Discord_LobbyMemberHandleSpan returnValueNative__;
8346 Discord_LobbyHandle_LobbyMembers(&instance_, &returnValueNative__);
8347 std::vector<discordpp::LobbyMemberHandle> returnValue__;
8348 returnValue__.reserve(returnValueNative__.size);
8349 for (
size_t i__ = 0; i__ < returnValueNative__.size; ++i__) {
8350 returnValue__.emplace_back(returnValueNative__.ptr[i__], DiscordObjectState::Owned);
8352 Discord_Free(returnValueNative__.ptr);
8353 return returnValue__;
8355std::unordered_map<std::string, std::string> LobbyHandle::Metadata()
const
8357 assert(state_ == DiscordObjectState::Owned);
8358 Discord_Properties returnValueNative__;
8359 Discord_LobbyHandle_Metadata(&instance_, &returnValueNative__);
8360 std::unordered_map<std::string, std::string> returnValue__ =
8361 ConvertReturnedProperties(returnValueNative__);
8362 Discord_FreeProperties(returnValueNative__);
8363 return returnValue__;
8365const AdditionalContent AdditionalContent::nullobj{{}, DiscordObjectState::Invalid};
8366AdditionalContent::~AdditionalContent()
8368 if (state_ == DiscordObjectState::Owned) {
8370 state_ = DiscordObjectState::Invalid;
8373AdditionalContent::AdditionalContent(AdditionalContent&& other) noexcept
8374 : instance_(other.instance_)
8375 , state_(other.state_)
8377 other.state_ = DiscordObjectState::Invalid;
8379AdditionalContent& AdditionalContent::operator=(AdditionalContent&& other)
noexcept
8381 if (
this != &other) {
8382 if (state_ == DiscordObjectState::Owned) {
8385 instance_ = other.instance_;
8386 state_ = other.state_;
8387 other.state_ = DiscordObjectState::Invalid;
8391AdditionalContent::AdditionalContent(
const AdditionalContent& arg0)
8396 Discord_AdditionalContent_Clone(&instance_, arg0.instance());
8398 state_ = DiscordObjectState::Owned;
8401AdditionalContent& AdditionalContent::operator=(
const AdditionalContent& arg0)
8403 if (
this != &arg0) {
8404 if (state_ == DiscordObjectState::Owned) {
8406 state_ = DiscordObjectState::Invalid;
8408 if (arg0.state_ == DiscordObjectState::Owned) {
8409 Discord_AdditionalContent_Clone(&instance_, arg0.instance());
8411 state_ = DiscordObjectState::Owned;
8416AdditionalContent::AdditionalContent(Discord_AdditionalContent instance, DiscordObjectState state)
8417 : instance_(instance)
8421AdditionalContent::AdditionalContent()
8423 assert(state_ == DiscordObjectState::Invalid);
8424 Discord_AdditionalContent_Init(&instance_);
8425 state_ = DiscordObjectState::Owned;
8427void AdditionalContent::Drop()
8429 if (state_ != DiscordObjectState::Owned) {
8432 Discord_AdditionalContent_Drop(&instance_);
8433 state_ = DiscordObjectState::Invalid;
8437 assert(state_ == DiscordObjectState::Owned);
8439 returnValue__ = Discord_AdditionalContent_Equals(&instance_, rhs.instance());
8440 return returnValue__;
8444 Discord_String returnValueNative__;
8445 Discord_AdditionalContent_TypeToString(
static_cast<Discord_AdditionalContentType
>(type),
8446 &returnValueNative__);
8447 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
8448 returnValueNative__.size);
8449 Discord_Free(returnValueNative__.ptr);
8450 return returnValue__;
8454 assert(state_ == DiscordObjectState::Owned);
8455 Discord_AdditionalContentType returnValue__;
8456 returnValue__ = Discord_AdditionalContent_Type(&instance_);
8461 assert(state_ == DiscordObjectState::Owned);
8462 Discord_AdditionalContent_SetType(&instance_,
static_cast<Discord_AdditionalContentType
>(Type));
8464std::optional<std::string> AdditionalContent::Title()
const
8466 assert(state_ == DiscordObjectState::Owned);
8467 bool returnIsNonNull__;
8468 Discord_String returnValueNative__;
8469 returnIsNonNull__ = Discord_AdditionalContent_Title(&instance_, &returnValueNative__);
8470 if (!returnIsNonNull__) {
8473 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
8474 returnValueNative__.size);
8475 Discord_Free(returnValueNative__.ptr);
8476 return returnValue__;
8478void AdditionalContent::SetTitle(std::optional<std::string> Title)
8480 assert(state_ == DiscordObjectState::Owned);
8481 Discord_String Title__str{};
8482 if (Title.has_value()) {
8483 Title__str.ptr =
reinterpret_cast<uint8_t*
>(Title->data());
8484 Title__str.size = Title->size();
8486 Discord_AdditionalContent_SetTitle(&instance_, (Title.has_value() ? &Title__str :
nullptr));
8488uint8_t AdditionalContent::Count()
const
8490 assert(state_ == DiscordObjectState::Owned);
8491 uint8_t returnValue__;
8492 returnValue__ = Discord_AdditionalContent_Count(&instance_);
8493 return returnValue__;
8495void AdditionalContent::SetCount(uint8_t Count)
8497 assert(state_ == DiscordObjectState::Owned);
8498 Discord_AdditionalContent_SetCount(&instance_, Count);
8500const MessageHandle MessageHandle::nullobj{{}, DiscordObjectState::Invalid};
8501MessageHandle::~MessageHandle()
8503 if (state_ == DiscordObjectState::Owned) {
8505 state_ = DiscordObjectState::Invalid;
8508MessageHandle::MessageHandle(MessageHandle&& other) noexcept
8509 : instance_(other.instance_)
8510 , state_(other.state_)
8512 other.state_ = DiscordObjectState::Invalid;
8514MessageHandle& MessageHandle::operator=(MessageHandle&& other)
noexcept
8516 if (
this != &other) {
8517 if (state_ == DiscordObjectState::Owned) {
8520 instance_ = other.instance_;
8521 state_ = other.state_;
8522 other.state_ = DiscordObjectState::Invalid;
8526MessageHandle::MessageHandle(
const MessageHandle& other)
8531 Discord_MessageHandle_Clone(&instance_, other.instance());
8533 state_ = DiscordObjectState::Owned;
8536MessageHandle& MessageHandle::operator=(
const MessageHandle& other)
8538 if (
this != &other) {
8539 if (state_ == DiscordObjectState::Owned) {
8541 state_ = DiscordObjectState::Invalid;
8543 if (other.state_ == DiscordObjectState::Owned) {
8544 Discord_MessageHandle_Clone(&instance_, other.instance());
8546 state_ = DiscordObjectState::Owned;
8551MessageHandle::MessageHandle(Discord_MessageHandle instance, DiscordObjectState state)
8552 : instance_(instance)
8556void MessageHandle::Drop()
8558 if (state_ != DiscordObjectState::Owned) {
8561 Discord_MessageHandle_Drop(&instance_);
8562 state_ = DiscordObjectState::Invalid;
8564std::optional<discordpp::AdditionalContent> MessageHandle::AdditionalContent()
const
8566 assert(state_ == DiscordObjectState::Owned);
8567 bool returnIsNonNull__;
8568 Discord_AdditionalContent returnValueNative__;
8569 returnIsNonNull__ = Discord_MessageHandle_AdditionalContent(&instance_, &returnValueNative__);
8570 if (!returnIsNonNull__) {
8574 return returnValue__;
8576std::optional<discordpp::UserHandle> MessageHandle::Author()
const
8578 assert(state_ == DiscordObjectState::Owned);
8579 bool returnIsNonNull__;
8580 Discord_UserHandle returnValueNative__;
8581 returnIsNonNull__ = Discord_MessageHandle_Author(&instance_, &returnValueNative__);
8582 if (!returnIsNonNull__) {
8586 return returnValue__;
8588uint64_t MessageHandle::AuthorId()
const
8590 assert(state_ == DiscordObjectState::Owned);
8591 uint64_t returnValue__;
8592 returnValue__ = Discord_MessageHandle_AuthorId(&instance_);
8593 return returnValue__;
8595std::optional<discordpp::ChannelHandle> MessageHandle::Channel()
const
8597 assert(state_ == DiscordObjectState::Owned);
8598 bool returnIsNonNull__;
8599 Discord_ChannelHandle returnValueNative__;
8600 returnIsNonNull__ = Discord_MessageHandle_Channel(&instance_, &returnValueNative__);
8601 if (!returnIsNonNull__) {
8605 return returnValue__;
8607uint64_t MessageHandle::ChannelId()
const
8609 assert(state_ == DiscordObjectState::Owned);
8610 uint64_t returnValue__;
8611 returnValue__ = Discord_MessageHandle_ChannelId(&instance_);
8612 return returnValue__;
8614std::string MessageHandle::Content()
const
8616 assert(state_ == DiscordObjectState::Owned);
8617 Discord_String returnValueNative__;
8618 Discord_MessageHandle_Content(&instance_, &returnValueNative__);
8619 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
8620 returnValueNative__.size);
8621 Discord_Free(returnValueNative__.ptr);
8622 return returnValue__;
8624std::optional<discordpp::DisclosureTypes> MessageHandle::DisclosureType()
const
8626 assert(state_ == DiscordObjectState::Owned);
8627 bool returnIsNonNull__;
8628 Discord_DisclosureTypes returnValueNative__;
8629 returnIsNonNull__ = Discord_MessageHandle_DisclosureType(&instance_, &returnValueNative__);
8630 if (!returnIsNonNull__) {
8634 return returnValue__;
8636uint64_t MessageHandle::EditedTimestamp()
const
8638 assert(state_ == DiscordObjectState::Owned);
8639 uint64_t returnValue__;
8640 returnValue__ = Discord_MessageHandle_EditedTimestamp(&instance_);
8641 return returnValue__;
8643uint64_t MessageHandle::Id()
const
8645 assert(state_ == DiscordObjectState::Owned);
8646 uint64_t returnValue__;
8647 returnValue__ = Discord_MessageHandle_Id(&instance_);
8648 return returnValue__;
8650std::optional<discordpp::LobbyHandle> MessageHandle::Lobby()
const
8652 assert(state_ == DiscordObjectState::Owned);
8653 bool returnIsNonNull__;
8654 Discord_LobbyHandle returnValueNative__;
8655 returnIsNonNull__ = Discord_MessageHandle_Lobby(&instance_, &returnValueNative__);
8656 if (!returnIsNonNull__) {
8660 return returnValue__;
8662std::unordered_map<std::string, std::string> MessageHandle::Metadata()
const
8664 assert(state_ == DiscordObjectState::Owned);
8665 Discord_Properties returnValueNative__;
8666 Discord_MessageHandle_Metadata(&instance_, &returnValueNative__);
8667 std::unordered_map<std::string, std::string> returnValue__ =
8668 ConvertReturnedProperties(returnValueNative__);
8669 Discord_FreeProperties(returnValueNative__);
8670 return returnValue__;
8672std::string MessageHandle::RawContent()
const
8674 assert(state_ == DiscordObjectState::Owned);
8675 Discord_String returnValueNative__;
8676 Discord_MessageHandle_RawContent(&instance_, &returnValueNative__);
8677 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
8678 returnValueNative__.size);
8679 Discord_Free(returnValueNative__.ptr);
8680 return returnValue__;
8682std::optional<discordpp::UserHandle> MessageHandle::Recipient()
const
8684 assert(state_ == DiscordObjectState::Owned);
8685 bool returnIsNonNull__;
8686 Discord_UserHandle returnValueNative__;
8687 returnIsNonNull__ = Discord_MessageHandle_Recipient(&instance_, &returnValueNative__);
8688 if (!returnIsNonNull__) {
8692 return returnValue__;
8694uint64_t MessageHandle::RecipientId()
const
8696 assert(state_ == DiscordObjectState::Owned);
8697 uint64_t returnValue__;
8698 returnValue__ = Discord_MessageHandle_RecipientId(&instance_);
8699 return returnValue__;
8701bool MessageHandle::SentFromGame()
const
8703 assert(state_ == DiscordObjectState::Owned);
8705 returnValue__ = Discord_MessageHandle_SentFromGame(&instance_);
8706 return returnValue__;
8708uint64_t MessageHandle::SentTimestamp()
const
8710 assert(state_ == DiscordObjectState::Owned);
8711 uint64_t returnValue__;
8712 returnValue__ = Discord_MessageHandle_SentTimestamp(&instance_);
8713 return returnValue__;
8715const AudioDevice AudioDevice::nullobj{{}, DiscordObjectState::Invalid};
8716AudioDevice::~AudioDevice()
8718 if (state_ == DiscordObjectState::Owned) {
8720 state_ = DiscordObjectState::Invalid;
8723AudioDevice::AudioDevice(AudioDevice&& other) noexcept
8724 : instance_(other.instance_)
8725 , state_(other.state_)
8727 other.state_ = DiscordObjectState::Invalid;
8729AudioDevice& AudioDevice::operator=(AudioDevice&& other)
noexcept
8731 if (
this != &other) {
8732 if (state_ == DiscordObjectState::Owned) {
8735 instance_ = other.instance_;
8736 state_ = other.state_;
8737 other.state_ = DiscordObjectState::Invalid;
8741AudioDevice::AudioDevice(
const AudioDevice& arg0)
8746 Discord_AudioDevice_Clone(&instance_, arg0.instance());
8748 state_ = DiscordObjectState::Owned;
8751AudioDevice& AudioDevice::operator=(
const AudioDevice& arg0)
8753 if (
this != &arg0) {
8754 if (state_ == DiscordObjectState::Owned) {
8756 state_ = DiscordObjectState::Invalid;
8758 if (arg0.state_ == DiscordObjectState::Owned) {
8759 Discord_AudioDevice_Clone(&instance_, arg0.instance());
8761 state_ = DiscordObjectState::Owned;
8766AudioDevice::AudioDevice(Discord_AudioDevice instance, DiscordObjectState state)
8767 : instance_(instance)
8771void AudioDevice::Drop()
8773 if (state_ != DiscordObjectState::Owned) {
8776 Discord_AudioDevice_Drop(&instance_);
8777 state_ = DiscordObjectState::Invalid;
8781 assert(state_ == DiscordObjectState::Owned);
8783 returnValue__ = Discord_AudioDevice_Equals(&instance_, rhs.instance());
8784 return returnValue__;
8786std::string AudioDevice::Id()
const
8788 assert(state_ == DiscordObjectState::Owned);
8789 Discord_String returnValueNative__;
8790 Discord_AudioDevice_Id(&instance_, &returnValueNative__);
8791 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
8792 returnValueNative__.size);
8793 Discord_Free(returnValueNative__.ptr);
8794 return returnValue__;
8796void AudioDevice::SetId(std::string Id)
8798 assert(state_ == DiscordObjectState::Owned);
8799 Discord_String Id__str{(uint8_t*)(Id.data()), Id.size()};
8800 Discord_AudioDevice_SetId(&instance_, Id__str);
8802std::string AudioDevice::Name()
const
8804 assert(state_ == DiscordObjectState::Owned);
8805 Discord_String returnValueNative__;
8806 Discord_AudioDevice_Name(&instance_, &returnValueNative__);
8807 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
8808 returnValueNative__.size);
8809 Discord_Free(returnValueNative__.ptr);
8810 return returnValue__;
8812void AudioDevice::SetName(std::string Name)
8814 assert(state_ == DiscordObjectState::Owned);
8815 Discord_String Name__str{(uint8_t*)(Name.data()), Name.size()};
8816 Discord_AudioDevice_SetName(&instance_, Name__str);
8818bool AudioDevice::IsDefault()
const
8820 assert(state_ == DiscordObjectState::Owned);
8822 returnValue__ = Discord_AudioDevice_IsDefault(&instance_);
8823 return returnValue__;
8825void AudioDevice::SetIsDefault(
bool IsDefault)
8827 assert(state_ == DiscordObjectState::Owned);
8828 Discord_AudioDevice_SetIsDefault(&instance_, IsDefault);
8830const Client Client::nullobj{{}, DiscordObjectState::Invalid};
8833 if (state_ == DiscordObjectState::Owned) {
8835 state_ = DiscordObjectState::Invalid;
8838Client::Client(Client&& other) noexcept
8839 : instance_(other.instance_)
8840 , state_(other.state_)
8842 other.state_ = DiscordObjectState::Invalid;
8844Client& Client::operator=(Client&& other)
noexcept
8846 if (
this != &other) {
8847 if (state_ == DiscordObjectState::Owned) {
8850 instance_ = other.instance_;
8851 state_ = other.state_;
8852 other.state_ = DiscordObjectState::Invalid;
8856Client::Client(Discord_Client instance, DiscordObjectState state)
8857 : instance_(instance)
8863 assert(state_ == DiscordObjectState::Invalid);
8864 Discord_Client_Init(&instance_);
8865 state_ = DiscordObjectState::Owned;
8867Client::Client(std::string apiBase, std::string webBase)
8869 assert(state_ == DiscordObjectState::Invalid);
8870 Discord_String apiBase__str{(uint8_t*)(apiBase.data()), apiBase.size()};
8871 Discord_String webBase__str{(uint8_t*)(webBase.data()), webBase.size()};
8872 Discord_Client_InitWithBases(&instance_, apiBase__str, webBase__str);
8873 state_ = DiscordObjectState::Owned;
8877 if (state_ != DiscordObjectState::Owned) {
8880 Discord_Client_Drop(&instance_);
8881 state_ = DiscordObjectState::Invalid;
8885 Discord_String returnValueNative__;
8886 Discord_Client_ErrorToString(
static_cast<Discord_Client_Error
>(type), &returnValueNative__);
8887 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
8888 returnValueNative__.size);
8889 Discord_Free(returnValueNative__.ptr);
8890 return returnValue__;
8892uint64_t Client::GetApplicationId()
8894 assert(state_ == DiscordObjectState::Owned);
8895 uint64_t returnValue__;
8896 returnValue__ = Discord_Client_GetApplicationId(&instance_);
8897 return returnValue__;
8899std::string Client::GetDefaultAudioDeviceId()
8901 Discord_String returnValueNative__;
8902 Discord_Client_GetDefaultAudioDeviceId(&returnValueNative__);
8903 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
8904 returnValueNative__.size);
8905 Discord_Free(returnValueNative__.ptr);
8906 return returnValue__;
8908std::string Client::GetDefaultCommunicationScopes()
8910 Discord_String returnValueNative__;
8911 Discord_Client_GetDefaultCommunicationScopes(&returnValueNative__);
8912 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
8913 returnValueNative__.size);
8914 Discord_Free(returnValueNative__.ptr);
8915 return returnValue__;
8917std::string Client::GetDefaultPresenceScopes()
8919 Discord_String returnValueNative__;
8920 Discord_Client_GetDefaultPresenceScopes(&returnValueNative__);
8921 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
8922 returnValueNative__.size);
8923 Discord_Free(returnValueNative__.ptr);
8924 return returnValue__;
8926std::string Client::GetVersionHash()
8928 Discord_String returnValueNative__;
8929 Discord_Client_GetVersionHash(&returnValueNative__);
8930 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
8931 returnValueNative__.size);
8932 Discord_Free(returnValueNative__.ptr);
8933 return returnValue__;
8935int32_t Client::GetVersionMajor()
8937 int32_t returnValue__;
8938 returnValue__ = Discord_Client_GetVersionMajor();
8939 return returnValue__;
8941int32_t Client::GetVersionMinor()
8943 int32_t returnValue__;
8944 returnValue__ = Discord_Client_GetVersionMinor();
8945 return returnValue__;
8947int32_t Client::GetVersionPatch()
8949 int32_t returnValue__;
8950 returnValue__ = Discord_Client_GetVersionPatch();
8951 return returnValue__;
8953void Client::SetHttpRequestTimeout(int32_t httpTimeoutInMilliseconds)
8955 assert(state_ == DiscordObjectState::Owned);
8956 Discord_Client_SetHttpRequestTimeout(&instance_, httpTimeoutInMilliseconds);
8960 Discord_String returnValueNative__;
8961 Discord_Client_StatusToString(
static_cast<Discord_Client_Status
>(type), &returnValueNative__);
8962 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
8963 returnValueNative__.size);
8964 Discord_Free(returnValueNative__.ptr);
8965 return returnValue__;
8969 Discord_String returnValueNative__;
8970 Discord_Client_ThreadToString(
static_cast<Discord_Client_Thread
>(type), &returnValueNative__);
8971 std::string returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
8972 returnValueNative__.size);
8973 Discord_Free(returnValueNative__.ptr);
8974 return returnValue__;
8978 assert(state_ == DiscordObjectState::Owned);
8979 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
8980 auto callback__userData =
new Tcallback__UserData(callback);
8981 Discord_Client_EndCallCallback callback__native = [](
void* userData__) {
8982 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
8983 userData__typed->delegate();
8985 Discord_Client_EndCall(
8986 &instance_, channelId, callback__native, Tcallback__UserData::Free, callback__userData);
8990 assert(state_ == DiscordObjectState::Owned);
8991 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
8992 auto callback__userData =
new Tcallback__UserData(callback);
8993 Discord_Client_EndCallsCallback callback__native = [](
void* userData__) {
8994 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
8995 userData__typed->delegate();
8997 Discord_Client_EndCalls(
8998 &instance_, callback__native, Tcallback__UserData::Free, callback__userData);
9002 assert(state_ == DiscordObjectState::Owned);
9003 bool returnIsNonNull__;
9004 Discord_Call returnValueNative__{};
9005 returnIsNonNull__ = Discord_Client_GetCall(&instance_, channelId, &returnValueNative__);
9007 returnValueNative__,
9008 returnIsNonNull__ ? DiscordObjectState::Owned : DiscordObjectState::Invalid);
9009 return returnValue__;
9011std::vector<discordpp::Call> Client::GetCalls()
9013 assert(state_ == DiscordObjectState::Owned);
9014 Discord_CallSpan returnValueNative__;
9015 Discord_Client_GetCalls(&instance_, &returnValueNative__);
9016 std::vector<discordpp::Call> returnValue__;
9017 returnValue__.reserve(returnValueNative__.size);
9018 for (
size_t i__ = 0; i__ < returnValueNative__.size; ++i__) {
9019 returnValue__.emplace_back(returnValueNative__.ptr[i__], DiscordObjectState::Owned);
9021 Discord_Free(returnValueNative__.ptr);
9022 return returnValue__;
9026 assert(state_ == DiscordObjectState::Owned);
9027 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
9028 auto cb__userData =
new Tcb__UserData(cb);
9029 Discord_Client_GetCurrentInputDeviceCallback cb__native = [](
auto device,
void* userData__) {
9030 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
9032 userData__typed->delegate(std::move(device__obj));
9034 Discord_Client_GetCurrentInputDevice(&instance_, cb__native, Tcb__UserData::Free, cb__userData);
9038 assert(state_ == DiscordObjectState::Owned);
9039 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
9040 auto cb__userData =
new Tcb__UserData(cb);
9041 Discord_Client_GetCurrentOutputDeviceCallback cb__native = [](
auto device,
void* userData__) {
9042 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
9044 userData__typed->delegate(std::move(device__obj));
9046 Discord_Client_GetCurrentOutputDevice(
9047 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
9051 assert(state_ == DiscordObjectState::Owned);
9052 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
9053 auto cb__userData =
new Tcb__UserData(cb);
9054 Discord_Client_GetInputDevicesCallback cb__native = [](
auto devices,
void* userData__) {
9055 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
9056 std::vector<discordpp::AudioDevice> devices__vec;
9057 devices__vec.reserve(devices.size);
9058 for (
size_t i__ = 0; i__ < devices.size; ++i__) {
9059 devices__vec.emplace_back(devices.ptr[i__], DiscordObjectState::Owned);
9061 Discord_Free(devices.ptr);
9062 userData__typed->delegate(std::move(devices__vec));
9064 Discord_Client_GetInputDevices(&instance_, cb__native, Tcb__UserData::Free, cb__userData);
9066float Client::GetInputVolume()
9068 assert(state_ == DiscordObjectState::Owned);
9069 float returnValue__;
9070 returnValue__ = Discord_Client_GetInputVolume(&instance_);
9071 return returnValue__;
9075 assert(state_ == DiscordObjectState::Owned);
9076 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
9077 auto cb__userData =
new Tcb__UserData(cb);
9078 Discord_Client_GetOutputDevicesCallback cb__native = [](
auto devices,
void* userData__) {
9079 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
9080 std::vector<discordpp::AudioDevice> devices__vec;
9081 devices__vec.reserve(devices.size);
9082 for (
size_t i__ = 0; i__ < devices.size; ++i__) {
9083 devices__vec.emplace_back(devices.ptr[i__], DiscordObjectState::Owned);
9085 Discord_Free(devices.ptr);
9086 userData__typed->delegate(std::move(devices__vec));
9088 Discord_Client_GetOutputDevices(&instance_, cb__native, Tcb__UserData::Free, cb__userData);
9090float Client::GetOutputVolume()
9092 assert(state_ == DiscordObjectState::Owned);
9093 float returnValue__;
9094 returnValue__ = Discord_Client_GetOutputVolume(&instance_);
9095 return returnValue__;
9097bool Client::GetSelfDeafAll()
const
9099 assert(state_ == DiscordObjectState::Owned);
9101 returnValue__ = Discord_Client_GetSelfDeafAll(&instance_);
9102 return returnValue__;
9104bool Client::GetSelfMuteAll()
const
9106 assert(state_ == DiscordObjectState::Owned);
9108 returnValue__ = Discord_Client_GetSelfMuteAll(&instance_);
9109 return returnValue__;
9111void Client::SetAutomaticGainControl(
bool on)
9113 assert(state_ == DiscordObjectState::Owned);
9114 Discord_Client_SetAutomaticGainControl(&instance_, on);
9118 assert(state_ == DiscordObjectState::Owned);
9119 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
9120 auto callback__userData =
new Tcallback__UserData(callback);
9121 Discord_Client_DeviceChangeCallback callback__native =
9122 [](
auto inputDevices,
auto outputDevices,
void* userData__) {
9123 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
9124 std::vector<discordpp::AudioDevice> inputDevices__vec;
9125 inputDevices__vec.reserve(inputDevices.size);
9126 for (
size_t i__ = 0; i__ < inputDevices.size; ++i__) {
9127 inputDevices__vec.emplace_back(inputDevices.ptr[i__], DiscordObjectState::Owned);
9129 Discord_Free(inputDevices.ptr);
9130 std::vector<discordpp::AudioDevice> outputDevices__vec;
9131 outputDevices__vec.reserve(outputDevices.size);
9132 for (
size_t i__ = 0; i__ < outputDevices.size; ++i__) {
9133 outputDevices__vec.emplace_back(outputDevices.ptr[i__], DiscordObjectState::Owned);
9135 Discord_Free(outputDevices.ptr);
9136 userData__typed->delegate(std::move(inputDevices__vec), std::move(outputDevices__vec));
9138 Discord_Client_SetDeviceChangeCallback(
9139 &instance_, callback__native, Tcallback__UserData::Free, callback__userData);
9141void Client::SetEchoCancellation(
bool on)
9143 assert(state_ == DiscordObjectState::Owned);
9144 Discord_Client_SetEchoCancellation(&instance_, on);
9146void Client::SetEngineManagedAudioSession(
bool isEngineManaged)
9148 assert(state_ == DiscordObjectState::Owned);
9149 Discord_Client_SetEngineManagedAudioSession(&instance_, isEngineManaged);
9153 assert(state_ == DiscordObjectState::Owned);
9154 Discord_String deviceId__str{(uint8_t*)(deviceId.data()), deviceId.size()};
9155 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
9156 auto cb__userData =
new Tcb__UserData(cb);
9157 Discord_Client_SetInputDeviceCallback cb__native = [](
auto result,
void* userData__) {
9158 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
9160 userData__typed->delegate(std::move(result__obj));
9162 Discord_Client_SetInputDevice(
9163 &instance_, deviceId__str, cb__native, Tcb__UserData::Free, cb__userData);
9165void Client::SetInputVolume(
float inputVolume)
9167 assert(state_ == DiscordObjectState::Owned);
9168 Discord_Client_SetInputVolume(&instance_, inputVolume);
9172 assert(state_ == DiscordObjectState::Owned);
9173 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
9174 auto callback__userData =
new Tcallback__UserData(callback);
9175 Discord_Client_NoAudioInputCallback callback__native = [](
auto inputDetected,
9177 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
9178 userData__typed->delegate(inputDetected);
9180 Discord_Client_SetNoAudioInputCallback(
9181 &instance_, callback__native, Tcallback__UserData::Free, callback__userData);
9183void Client::SetNoAudioInputThreshold(
float dBFSThreshold)
9185 assert(state_ == DiscordObjectState::Owned);
9186 Discord_Client_SetNoAudioInputThreshold(&instance_, dBFSThreshold);
9188void Client::SetNoiseSuppression(
bool on)
9190 assert(state_ == DiscordObjectState::Owned);
9191 Discord_Client_SetNoiseSuppression(&instance_, on);
9193void Client::SetOpusHardwareCoding(
bool encode,
bool decode)
9195 assert(state_ == DiscordObjectState::Owned);
9196 Discord_Client_SetOpusHardwareCoding(&instance_, encode, decode);
9200 assert(state_ == DiscordObjectState::Owned);
9201 Discord_String deviceId__str{(uint8_t*)(deviceId.data()), deviceId.size()};
9202 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
9203 auto cb__userData =
new Tcb__UserData(cb);
9204 Discord_Client_SetOutputDeviceCallback cb__native = [](
auto result,
void* userData__) {
9205 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
9207 userData__typed->delegate(std::move(result__obj));
9209 Discord_Client_SetOutputDevice(
9210 &instance_, deviceId__str, cb__native, Tcb__UserData::Free, cb__userData);
9212void Client::SetOutputVolume(
float outputVolume)
9214 assert(state_ == DiscordObjectState::Owned);
9215 Discord_Client_SetOutputVolume(&instance_, outputVolume);
9217void Client::SetSelfDeafAll(
bool deaf)
9219 assert(state_ == DiscordObjectState::Owned);
9220 Discord_Client_SetSelfDeafAll(&instance_, deaf);
9222void Client::SetSelfMuteAll(
bool mute)
9224 assert(state_ == DiscordObjectState::Owned);
9225 Discord_Client_SetSelfMuteAll(&instance_, mute);
9227bool Client::SetSpeakerMode(
bool speakerMode)
9229 assert(state_ == DiscordObjectState::Owned);
9231 returnValue__ = Discord_Client_SetSpeakerMode(&instance_, speakerMode);
9232 return returnValue__;
9236 assert(state_ == DiscordObjectState::Owned);
9237 Discord_Client_SetThreadPriority(
9238 &instance_,
static_cast<Discord_Client_Thread
>(thread), priority);
9240void Client::SetVoiceParticipantChangedCallback(
9243 assert(state_ == DiscordObjectState::Owned);
9244 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
9245 auto cb__userData =
new Tcb__UserData(cb);
9246 Discord_Client_VoiceParticipantChangedCallback cb__native =
9247 [](
auto lobbyId,
auto memberId,
auto added,
void* userData__) {
9248 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
9249 userData__typed->delegate(lobbyId, memberId, added);
9251 Discord_Client_SetVoiceParticipantChangedCallback(
9252 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
9254bool Client::ShowAudioRoutePicker()
9256 assert(state_ == DiscordObjectState::Owned);
9258 returnValue__ = Discord_Client_ShowAudioRoutePicker(&instance_);
9259 return returnValue__;
9263 assert(state_ == DiscordObjectState::Owned);
9264 bool returnIsNonNull__;
9265 Discord_Call returnValueNative__{};
9266 returnIsNonNull__ = Discord_Client_StartCall(&instance_, channelId, &returnValueNative__);
9268 returnValueNative__,
9269 returnIsNonNull__ ? DiscordObjectState::Owned : DiscordObjectState::Invalid);
9270 return returnValue__;
9277 assert(state_ == DiscordObjectState::Owned);
9278 bool returnIsNonNull__;
9279 Discord_Call returnValueNative__{};
9280 using TreceivedCb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(receivedCb)>>;
9281 auto receivedCb__userData =
new TreceivedCb__UserData(receivedCb);
9282 Discord_Client_UserAudioReceivedCallback receivedCb__native = [](
auto userId,
9284 auto samplesPerChannel,
9289 auto userData__typed =
static_cast<TreceivedCb__UserData*
>(userData__);
9290 userData__typed->delegate(
9291 userId, data, samplesPerChannel, sampleRate, channels, *outShouldMute);
9293 using TcapturedCb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(capturedCb)>>;
9294 auto capturedCb__userData =
new TcapturedCb__UserData(capturedCb);
9295 Discord_Client_UserAudioCapturedCallback capturedCb__native =
9296 [](
auto data,
auto samplesPerChannel,
auto sampleRate,
auto channels,
void* userData__) {
9297 auto userData__typed =
static_cast<TcapturedCb__UserData*
>(userData__);
9298 userData__typed->delegate(data, samplesPerChannel, sampleRate, channels);
9300 returnIsNonNull__ = Discord_Client_StartCallWithAudioCallbacks(&instance_,
9303 TreceivedCb__UserData::Free,
9304 receivedCb__userData,
9306 TcapturedCb__UserData::Free,
9307 capturedCb__userData,
9308 &returnValueNative__);
9310 returnValueNative__,
9311 returnIsNonNull__ ? DiscordObjectState::Owned : DiscordObjectState::Invalid);
9312 return returnValue__;
9314void Client::AbortAuthorize()
9316 assert(state_ == DiscordObjectState::Owned);
9317 Discord_Client_AbortAuthorize(&instance_);
9319void Client::AbortGetTokenFromDevice()
9321 assert(state_ == DiscordObjectState::Owned);
9322 Discord_Client_AbortGetTokenFromDevice(&instance_);
9327 assert(state_ == DiscordObjectState::Owned);
9328 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
9329 auto callback__userData =
new Tcallback__UserData(callback);
9330 Discord_Client_AuthorizationCallback callback__native =
9331 [](
auto result,
auto code,
auto redirectUri,
void* userData__) {
9332 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
9334 std::string code__str(
reinterpret_cast<char*
>(code.ptr), code.size);
9335 std::string redirectUri__str(
reinterpret_cast<char*
>(redirectUri.ptr), redirectUri.size);
9336 userData__typed->delegate(
9337 std::move(result__obj), std::move(code__str), std::move(redirectUri__str));
9338 Discord_Free(redirectUri.ptr);
9339 Discord_Free(code.ptr);
9341 Discord_Client_Authorize(
9342 &instance_, args.instance(), callback__native, Tcallback__UserData::Free, callback__userData);
9344void Client::CloseAuthorizeDeviceScreen()
9346 assert(state_ == DiscordObjectState::Owned);
9347 Discord_Client_CloseAuthorizeDeviceScreen(&instance_);
9351 assert(state_ == DiscordObjectState::Owned);
9352 Discord_AuthorizationCodeVerifier returnValueNative__{};
9353 Discord_Client_CreateAuthorizationCodeVerifier(&instance_, &returnValueNative__);
9355 DiscordObjectState::Owned);
9356 return returnValue__;
9359 std::string
const& token,
9362 assert(state_ == DiscordObjectState::Owned);
9363 Discord_String token__str{(uint8_t*)(token.data()), token.size()};
9364 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
9365 auto callback__userData =
new Tcallback__UserData(callback);
9366 Discord_Client_FetchCurrentUserCallback callback__native =
9367 [](
auto result,
auto id,
auto name,
void* userData__) {
9368 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
9370 std::string name__str(
reinterpret_cast<char*
>(name.ptr), name.size);
9371 userData__typed->delegate(std::move(result__obj),
id, std::move(name__str));
9372 Discord_Free(name.ptr);
9374 Discord_Client_FetchCurrentUser(&instance_,
9375 static_cast<Discord_AuthorizationTokenType
>(tokenType),
9378 Tcallback__UserData::Free,
9379 callback__userData);
9381void Client::GetProvisionalToken(uint64_t applicationId,
9383 std::string
const& externalAuthToken,
9386 assert(state_ == DiscordObjectState::Owned);
9387 Discord_String externalAuthToken__str{(uint8_t*)(externalAuthToken.data()),
9388 externalAuthToken.size()};
9389 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
9390 auto callback__userData =
new Tcallback__UserData(callback);
9391 Discord_Client_TokenExchangeCallback callback__native = [](
auto result,
9398 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
9400 std::string accessToken__str(
reinterpret_cast<char*
>(accessToken.ptr), accessToken.size);
9401 std::string refreshToken__str(
reinterpret_cast<char*
>(refreshToken.ptr), refreshToken.size);
9402 std::string scopes__str(
reinterpret_cast<char*
>(scopes.ptr), scopes.size);
9403 userData__typed->delegate(std::move(result__obj),
9404 std::move(accessToken__str),
9405 std::move(refreshToken__str),
9408 std::move(scopes__str));
9409 Discord_Free(scopes.ptr);
9410 Discord_Free(refreshToken.ptr);
9411 Discord_Free(accessToken.ptr);
9413 Discord_Client_GetProvisionalToken(
9416 static_cast<Discord_AuthenticationExternalAuthType
>(externalAuthType),
9417 externalAuthToken__str,
9419 Tcallback__UserData::Free,
9420 callback__userData);
9422void Client::GetToken(uint64_t applicationId,
9423 std::string
const& code,
9424 std::string
const& codeVerifier,
9425 std::string
const& redirectUri,
9428 assert(state_ == DiscordObjectState::Owned);
9429 Discord_String code__str{(uint8_t*)(code.data()), code.size()};
9430 Discord_String codeVerifier__str{(uint8_t*)(codeVerifier.data()), codeVerifier.size()};
9431 Discord_String redirectUri__str{(uint8_t*)(redirectUri.data()), redirectUri.size()};
9432 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
9433 auto callback__userData =
new Tcallback__UserData(callback);
9434 Discord_Client_TokenExchangeCallback callback__native = [](
auto result,
9441 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
9443 std::string accessToken__str(
reinterpret_cast<char*
>(accessToken.ptr), accessToken.size);
9444 std::string refreshToken__str(
reinterpret_cast<char*
>(refreshToken.ptr), refreshToken.size);
9445 std::string scopes__str(
reinterpret_cast<char*
>(scopes.ptr), scopes.size);
9446 userData__typed->delegate(std::move(result__obj),
9447 std::move(accessToken__str),
9448 std::move(refreshToken__str),
9451 std::move(scopes__str));
9452 Discord_Free(scopes.ptr);
9453 Discord_Free(refreshToken.ptr);
9454 Discord_Free(accessToken.ptr);
9456 Discord_Client_GetToken(&instance_,
9462 Tcallback__UserData::Free,
9463 callback__userData);
9468 assert(state_ == DiscordObjectState::Owned);
9469 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
9470 auto callback__userData =
new Tcallback__UserData(callback);
9471 Discord_Client_TokenExchangeCallback callback__native = [](
auto result,
9478 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
9480 std::string accessToken__str(
reinterpret_cast<char*
>(accessToken.ptr), accessToken.size);
9481 std::string refreshToken__str(
reinterpret_cast<char*
>(refreshToken.ptr), refreshToken.size);
9482 std::string scopes__str(
reinterpret_cast<char*
>(scopes.ptr), scopes.size);
9483 userData__typed->delegate(std::move(result__obj),
9484 std::move(accessToken__str),
9485 std::move(refreshToken__str),
9488 std::move(scopes__str));
9489 Discord_Free(scopes.ptr);
9490 Discord_Free(refreshToken.ptr);
9491 Discord_Free(accessToken.ptr);
9493 Discord_Client_GetTokenFromDevice(
9494 &instance_, args.instance(), callback__native, Tcallback__UserData::Free, callback__userData);
9496void Client::GetTokenFromDeviceProvisionalMerge(
9499 std::string
const& externalAuthToken,
9502 assert(state_ == DiscordObjectState::Owned);
9503 Discord_String externalAuthToken__str{(uint8_t*)(externalAuthToken.data()),
9504 externalAuthToken.size()};
9505 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
9506 auto callback__userData =
new Tcallback__UserData(callback);
9507 Discord_Client_TokenExchangeCallback callback__native = [](
auto result,
9514 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
9516 std::string accessToken__str(
reinterpret_cast<char*
>(accessToken.ptr), accessToken.size);
9517 std::string refreshToken__str(
reinterpret_cast<char*
>(refreshToken.ptr), refreshToken.size);
9518 std::string scopes__str(
reinterpret_cast<char*
>(scopes.ptr), scopes.size);
9519 userData__typed->delegate(std::move(result__obj),
9520 std::move(accessToken__str),
9521 std::move(refreshToken__str),
9524 std::move(scopes__str));
9525 Discord_Free(scopes.ptr);
9526 Discord_Free(refreshToken.ptr);
9527 Discord_Free(accessToken.ptr);
9529 Discord_Client_GetTokenFromDeviceProvisionalMerge(
9532 static_cast<Discord_AuthenticationExternalAuthType
>(externalAuthType),
9533 externalAuthToken__str,
9535 Tcallback__UserData::Free,
9536 callback__userData);
9538void Client::GetTokenFromProvisionalMerge(
9539 uint64_t applicationId,
9540 std::string
const& code,
9541 std::string
const& codeVerifier,
9542 std::string
const& redirectUri,
9544 std::string
const& externalAuthToken,
9547 assert(state_ == DiscordObjectState::Owned);
9548 Discord_String code__str{(uint8_t*)(code.data()), code.size()};
9549 Discord_String codeVerifier__str{(uint8_t*)(codeVerifier.data()), codeVerifier.size()};
9550 Discord_String redirectUri__str{(uint8_t*)(redirectUri.data()), redirectUri.size()};
9551 Discord_String externalAuthToken__str{(uint8_t*)(externalAuthToken.data()),
9552 externalAuthToken.size()};
9553 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
9554 auto callback__userData =
new Tcallback__UserData(callback);
9555 Discord_Client_TokenExchangeCallback callback__native = [](
auto result,
9562 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
9564 std::string accessToken__str(
reinterpret_cast<char*
>(accessToken.ptr), accessToken.size);
9565 std::string refreshToken__str(
reinterpret_cast<char*
>(refreshToken.ptr), refreshToken.size);
9566 std::string scopes__str(
reinterpret_cast<char*
>(scopes.ptr), scopes.size);
9567 userData__typed->delegate(std::move(result__obj),
9568 std::move(accessToken__str),
9569 std::move(refreshToken__str),
9572 std::move(scopes__str));
9573 Discord_Free(scopes.ptr);
9574 Discord_Free(refreshToken.ptr);
9575 Discord_Free(accessToken.ptr);
9577 Discord_Client_GetTokenFromProvisionalMerge(
9583 static_cast<Discord_AuthenticationExternalAuthType
>(externalAuthType),
9584 externalAuthToken__str,
9586 Tcallback__UserData::Free,
9587 callback__userData);
9589bool Client::IsAuthenticated()
9591 assert(state_ == DiscordObjectState::Owned);
9593 returnValue__ = Discord_Client_IsAuthenticated(&instance_);
9594 return returnValue__;
9596void Client::OpenAuthorizeDeviceScreen(uint64_t clientId, std::string
const& userCode)
9598 assert(state_ == DiscordObjectState::Owned);
9599 Discord_String userCode__str{(uint8_t*)(userCode.data()), userCode.size()};
9600 Discord_Client_OpenAuthorizeDeviceScreen(&instance_, clientId, userCode__str);
9602void Client::ProvisionalUserMergeCompleted(
bool success)
9604 assert(state_ == DiscordObjectState::Owned);
9605 Discord_Client_ProvisionalUserMergeCompleted(&instance_, success);
9607void Client::RefreshToken(uint64_t applicationId,
9608 std::string
const& refreshToken,
9611 assert(state_ == DiscordObjectState::Owned);
9612 Discord_String refreshToken__str{(uint8_t*)(refreshToken.data()), refreshToken.size()};
9613 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
9614 auto callback__userData =
new Tcallback__UserData(callback);
9615 Discord_Client_TokenExchangeCallback callback__native = [](
auto result,
9622 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
9624 std::string accessToken__str(
reinterpret_cast<char*
>(accessToken.ptr), accessToken.size);
9625 std::string refreshToken__str(
reinterpret_cast<char*
>(refreshToken.ptr), refreshToken.size);
9626 std::string scopes__str(
reinterpret_cast<char*
>(scopes.ptr), scopes.size);
9627 userData__typed->delegate(std::move(result__obj),
9628 std::move(accessToken__str),
9629 std::move(refreshToken__str),
9632 std::move(scopes__str));
9633 Discord_Free(scopes.ptr);
9634 Discord_Free(refreshToken.ptr);
9635 Discord_Free(accessToken.ptr);
9637 Discord_Client_RefreshToken(&instance_,
9641 Tcallback__UserData::Free,
9642 callback__userData);
9644void Client::SetAuthorizeDeviceScreenClosedCallback(
9647 assert(state_ == DiscordObjectState::Owned);
9648 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
9649 auto cb__userData =
new Tcb__UserData(cb);
9650 Discord_Client_AuthorizeDeviceScreenClosedCallback cb__native = [](
void* userData__) {
9651 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
9652 userData__typed->delegate();
9654 Discord_Client_SetAuthorizeDeviceScreenClosedCallback(
9655 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
9657void Client::SetGameWindowPid(int32_t pid)
9659 assert(state_ == DiscordObjectState::Owned);
9660 Discord_Client_SetGameWindowPid(&instance_, pid);
9664 assert(state_ == DiscordObjectState::Owned);
9665 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
9666 auto callback__userData =
new Tcallback__UserData(callback);
9667 Discord_Client_TokenExpirationCallback callback__native = [](
void* userData__) {
9668 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
9669 userData__typed->delegate();
9671 Discord_Client_SetTokenExpirationCallback(
9672 &instance_, callback__native, Tcallback__UserData::Free, callback__userData);
9674void Client::UpdateProvisionalAccountDisplayName(
9675 std::string
const& name,
9678 assert(state_ == DiscordObjectState::Owned);
9679 Discord_String name__str{(uint8_t*)(name.data()), name.size()};
9680 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
9681 auto callback__userData =
new Tcallback__UserData(callback);
9682 Discord_Client_UpdateProvisionalAccountDisplayNameCallback callback__native =
9683 [](
auto result,
void* userData__) {
9684 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
9686 userData__typed->delegate(std::move(result__obj));
9688 Discord_Client_UpdateProvisionalAccountDisplayName(
9689 &instance_, name__str, callback__native, Tcallback__UserData::Free, callback__userData);
9695 assert(state_ == DiscordObjectState::Owned);
9696 Discord_String token__str{(uint8_t*)(token.data()), token.size()};
9697 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
9698 auto callback__userData =
new Tcallback__UserData(callback);
9699 Discord_Client_UpdateTokenCallback callback__native = [](
auto result,
void* userData__) {
9700 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
9702 userData__typed->delegate(std::move(result__obj));
9704 Discord_Client_UpdateToken(&instance_,
9705 static_cast<Discord_AuthorizationTokenType
>(tokenType),
9708 Tcallback__UserData::Free,
9709 callback__userData);
9711bool Client::CanOpenMessageInDiscord(uint64_t messageId)
9713 assert(state_ == DiscordObjectState::Owned);
9715 returnValue__ = Discord_Client_CanOpenMessageInDiscord(&instance_, messageId);
9716 return returnValue__;
9718void Client::DeleteUserMessage(uint64_t recipientId,
9722 assert(state_ == DiscordObjectState::Owned);
9723 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
9724 auto cb__userData =
new Tcb__UserData(cb);
9725 Discord_Client_DeleteUserMessageCallback cb__native = [](
auto result,
void* userData__) {
9726 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
9728 userData__typed->delegate(std::move(result__obj));
9730 Discord_Client_DeleteUserMessage(
9731 &instance_, recipientId, messageId, cb__native, Tcb__UserData::Free, cb__userData);
9733void Client::EditUserMessage(uint64_t recipientId,
9735 std::string
const& content,
9738 assert(state_ == DiscordObjectState::Owned);
9739 Discord_String content__str{(uint8_t*)(content.data()), content.size()};
9740 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
9741 auto cb__userData =
new Tcb__UserData(cb);
9742 Discord_Client_EditUserMessageCallback cb__native = [](
auto result,
void* userData__) {
9743 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
9745 userData__typed->delegate(std::move(result__obj));
9747 Discord_Client_EditUserMessage(&instance_,
9752 Tcb__UserData::Free,
9755std::optional<discordpp::ChannelHandle> Client::GetChannelHandle(uint64_t channelId)
const
9757 assert(state_ == DiscordObjectState::Owned);
9758 bool returnIsNonNull__;
9759 Discord_ChannelHandle returnValueNative__;
9761 Discord_Client_GetChannelHandle(&instance_, channelId, &returnValueNative__);
9762 if (!returnIsNonNull__) {
9766 return returnValue__;
9768std::optional<discordpp::MessageHandle> Client::GetMessageHandle(uint64_t messageId)
const
9770 assert(state_ == DiscordObjectState::Owned);
9771 bool returnIsNonNull__;
9772 Discord_MessageHandle returnValueNative__;
9774 Discord_Client_GetMessageHandle(&instance_, messageId, &returnValueNative__);
9775 if (!returnIsNonNull__) {
9779 return returnValue__;
9781void Client::OpenMessageInDiscord(
9786 assert(state_ == DiscordObjectState::Owned);
9787 using TprovisionalUserMergeRequiredCallback__UserData =
9788 TDelegateUserData<std::remove_reference_t<
decltype(provisionalUserMergeRequiredCallback)>>;
9789 auto provisionalUserMergeRequiredCallback__userData =
9790 new TprovisionalUserMergeRequiredCallback__UserData(provisionalUserMergeRequiredCallback);
9791 Discord_Client_ProvisionalUserMergeRequiredCallback
9792 provisionalUserMergeRequiredCallback__native = [](
void* userData__) {
9793 auto userData__typed =
9794 static_cast<TprovisionalUserMergeRequiredCallback__UserData*
>(userData__);
9795 userData__typed->delegate();
9797 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
9798 auto callback__userData =
new Tcallback__UserData(callback);
9799 Discord_Client_OpenMessageInDiscordCallback callback__native = [](
auto result,
9801 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
9803 userData__typed->delegate(std::move(result__obj));
9805 Discord_Client_OpenMessageInDiscord(&instance_,
9807 provisionalUserMergeRequiredCallback__native,
9808 TprovisionalUserMergeRequiredCallback__UserData::Free,
9809 provisionalUserMergeRequiredCallback__userData,
9811 Tcallback__UserData::Free,
9812 callback__userData);
9814void Client::SendLobbyMessage(uint64_t lobbyId,
9815 std::string
const& content,
9818 assert(state_ == DiscordObjectState::Owned);
9819 Discord_String content__str{(uint8_t*)(content.data()), content.size()};
9820 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
9821 auto cb__userData =
new Tcb__UserData(cb);
9822 Discord_Client_SendUserMessageCallback cb__native =
9823 [](
auto result,
auto messageId,
void* userData__) {
9824 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
9826 userData__typed->delegate(std::move(result__obj), messageId);
9828 Discord_Client_SendLobbyMessage(
9829 &instance_, lobbyId, content__str, cb__native, Tcb__UserData::Free, cb__userData);
9831void Client::SendLobbyMessageWithMetadata(
9833 std::string
const& content,
9834 std::unordered_map<std::string, std::string>
const& metadata,
9837 assert(state_ == DiscordObjectState::Owned);
9838 Discord_String content__str{(uint8_t*)(content.data()), content.size()};
9839 ConvertedProperties metadata__convert(metadata);
9840 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
9841 auto cb__userData =
new Tcb__UserData(cb);
9842 Discord_Client_SendUserMessageCallback cb__native =
9843 [](
auto result,
auto messageId,
void* userData__) {
9844 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
9846 userData__typed->delegate(std::move(result__obj), messageId);
9848 Discord_Client_SendLobbyMessageWithMetadata(&instance_,
9851 metadata__convert.Properties,
9853 Tcb__UserData::Free,
9856void Client::SendUserMessage(uint64_t recipientId,
9857 std::string
const& content,
9860 assert(state_ == DiscordObjectState::Owned);
9861 Discord_String content__str{(uint8_t*)(content.data()), content.size()};
9862 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
9863 auto cb__userData =
new Tcb__UserData(cb);
9864 Discord_Client_SendUserMessageCallback cb__native =
9865 [](
auto result,
auto messageId,
void* userData__) {
9866 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
9868 userData__typed->delegate(std::move(result__obj), messageId);
9870 Discord_Client_SendUserMessage(
9871 &instance_, recipientId, content__str, cb__native, Tcb__UserData::Free, cb__userData);
9873void Client::SendUserMessageWithMetadata(
9874 uint64_t recipientId,
9875 std::string
const& content,
9876 std::unordered_map<std::string, std::string>
const& metadata,
9879 assert(state_ == DiscordObjectState::Owned);
9880 Discord_String content__str{(uint8_t*)(content.data()), content.size()};
9881 ConvertedProperties metadata__convert(metadata);
9882 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
9883 auto cb__userData =
new Tcb__UserData(cb);
9884 Discord_Client_SendUserMessageCallback cb__native =
9885 [](
auto result,
auto messageId,
void* userData__) {
9886 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
9888 userData__typed->delegate(std::move(result__obj), messageId);
9890 Discord_Client_SendUserMessageWithMetadata(&instance_,
9893 metadata__convert.Properties,
9895 Tcb__UserData::Free,
9900 assert(state_ == DiscordObjectState::Owned);
9901 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
9902 auto cb__userData =
new Tcb__UserData(cb);
9903 Discord_Client_MessageCreatedCallback cb__native = [](
auto messageId,
void* userData__) {
9904 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
9905 userData__typed->delegate(messageId);
9907 Discord_Client_SetMessageCreatedCallback(
9908 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
9912 assert(state_ == DiscordObjectState::Owned);
9913 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
9914 auto cb__userData =
new Tcb__UserData(cb);
9915 Discord_Client_MessageDeletedCallback cb__native =
9916 [](
auto messageId,
auto channelId,
void* userData__) {
9917 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
9918 userData__typed->delegate(messageId, channelId);
9920 Discord_Client_SetMessageDeletedCallback(
9921 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
9925 assert(state_ == DiscordObjectState::Owned);
9926 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
9927 auto cb__userData =
new Tcb__UserData(cb);
9928 Discord_Client_MessageUpdatedCallback cb__native = [](
auto messageId,
void* userData__) {
9929 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
9930 userData__typed->delegate(messageId);
9932 Discord_Client_SetMessageUpdatedCallback(
9933 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
9935void Client::SetShowingChat(
bool showingChat)
9937 assert(state_ == DiscordObjectState::Owned);
9938 Discord_Client_SetShowingChat(&instance_, showingChat);
9943 assert(state_ == DiscordObjectState::Owned);
9944 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
9945 auto callback__userData =
new Tcallback__UserData(callback);
9946 Discord_Client_LogCallback callback__native = [](
9947 auto message,
auto severity,
void* userData__) {
9948 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
9949 std::string message__str(
reinterpret_cast<char*
>(message.ptr), message.size);
9950 userData__typed->delegate(std::move(message__str),
9952 Discord_Free(message.ptr);
9954 Discord_Client_AddLogCallback(&instance_,
9956 Tcallback__UserData::Free,
9958 static_cast<Discord_LoggingSeverity
>(minSeverity));
9963 assert(state_ == DiscordObjectState::Owned);
9964 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
9965 auto callback__userData =
new Tcallback__UserData(callback);
9966 Discord_Client_LogCallback callback__native = [](
9967 auto message,
auto severity,
void* userData__) {
9968 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
9969 std::string message__str(
reinterpret_cast<char*
>(message.ptr), message.size);
9970 userData__typed->delegate(std::move(message__str),
9972 Discord_Free(message.ptr);
9974 Discord_Client_AddVoiceLogCallback(&instance_,
9976 Tcallback__UserData::Free,
9978 static_cast<Discord_LoggingSeverity
>(minSeverity));
9980void Client::Connect()
9982 assert(state_ == DiscordObjectState::Owned);
9983 Discord_Client_Connect(&instance_);
9985void Client::Disconnect()
9987 assert(state_ == DiscordObjectState::Owned);
9988 Discord_Client_Disconnect(&instance_);
9992 assert(state_ == DiscordObjectState::Owned);
9993 Discord_Client_Status returnValue__;
9994 returnValue__ = Discord_Client_GetStatus(&instance_);
9997void Client::OpenConnectedGamesSettingsInDiscord(
10000 assert(state_ == DiscordObjectState::Owned);
10001 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
10002 auto callback__userData =
new Tcallback__UserData(callback);
10003 Discord_Client_OpenConnectedGamesSettingsInDiscordCallback callback__native =
10004 [](
auto result,
void* userData__) {
10005 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
10007 userData__typed->delegate(std::move(result__obj));
10009 Discord_Client_OpenConnectedGamesSettingsInDiscord(
10010 &instance_, callback__native, Tcallback__UserData::Free, callback__userData);
10012void Client::SetApplicationId(uint64_t applicationId)
10014 assert(state_ == DiscordObjectState::Owned);
10015 Discord_Client_SetApplicationId(&instance_, applicationId);
10019 assert(state_ == DiscordObjectState::Owned);
10020 bool returnValue__;
10021 Discord_String path__str{(uint8_t*)(path.data()), path.size()};
10022 returnValue__ = Discord_Client_SetLogDir(
10023 &instance_, path__str,
static_cast<Discord_LoggingSeverity
>(minSeverity));
10024 return returnValue__;
10028 assert(state_ == DiscordObjectState::Owned);
10029 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10030 auto cb__userData =
new Tcb__UserData(cb);
10031 Discord_Client_OnStatusChanged cb__native =
10032 [](
auto status,
auto error,
auto errorDetail,
void* userData__) {
10033 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10038 Discord_Client_SetStatusChangedCallback(
10039 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
10043 assert(state_ == DiscordObjectState::Owned);
10044 Discord_String path__str{(uint8_t*)(path.data()), path.size()};
10045 Discord_Client_SetVoiceLogDir(
10046 &instance_, path__str,
static_cast<Discord_LoggingSeverity
>(minSeverity));
10048void Client::CreateOrJoinLobby(std::string
const& secret,
10051 assert(state_ == DiscordObjectState::Owned);
10052 Discord_String secret__str{(uint8_t*)(secret.data()), secret.size()};
10053 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
10054 auto callback__userData =
new Tcallback__UserData(callback);
10055 Discord_Client_CreateOrJoinLobbyCallback callback__native =
10056 [](
auto result,
auto lobbyId,
void* userData__) {
10057 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
10059 userData__typed->delegate(std::move(result__obj), lobbyId);
10061 Discord_Client_CreateOrJoinLobby(
10062 &instance_, secret__str, callback__native, Tcallback__UserData::Free, callback__userData);
10064void Client::CreateOrJoinLobbyWithMetadata(
10065 std::string
const& secret,
10066 std::unordered_map<std::string, std::string>
const& lobbyMetadata,
10067 std::unordered_map<std::string, std::string>
const& memberMetadata,
10070 assert(state_ == DiscordObjectState::Owned);
10071 Discord_String secret__str{(uint8_t*)(secret.data()), secret.size()};
10072 ConvertedProperties lobbyMetadata__convert(lobbyMetadata);
10073 ConvertedProperties memberMetadata__convert(memberMetadata);
10074 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
10075 auto callback__userData =
new Tcallback__UserData(callback);
10076 Discord_Client_CreateOrJoinLobbyCallback callback__native =
10077 [](
auto result,
auto lobbyId,
void* userData__) {
10078 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
10080 userData__typed->delegate(std::move(result__obj), lobbyId);
10082 Discord_Client_CreateOrJoinLobbyWithMetadata(&instance_,
10084 lobbyMetadata__convert.Properties,
10085 memberMetadata__convert.Properties,
10087 Tcallback__UserData::Free,
10088 callback__userData);
10092 assert(state_ == DiscordObjectState::Owned);
10093 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10094 auto cb__userData =
new Tcb__UserData(cb);
10095 Discord_Client_GetGuildChannelsCallback cb__native =
10096 [](
auto result,
auto guildChannels,
void* userData__) {
10097 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10099 std::vector<discordpp::GuildChannel> guildChannels__vec;
10100 guildChannels__vec.reserve(guildChannels.size);
10101 for (
size_t i__ = 0; i__ < guildChannels.size; ++i__) {
10102 guildChannels__vec.emplace_back(guildChannels.ptr[i__], DiscordObjectState::Owned);
10104 Discord_Free(guildChannels.ptr);
10105 userData__typed->delegate(std::move(result__obj), std::move(guildChannels__vec));
10107 Discord_Client_GetGuildChannels(
10108 &instance_, guildId, cb__native, Tcb__UserData::Free, cb__userData);
10110std::optional<discordpp::LobbyHandle> Client::GetLobbyHandle(uint64_t lobbyId)
const
10112 assert(state_ == DiscordObjectState::Owned);
10113 bool returnIsNonNull__;
10114 Discord_LobbyHandle returnValueNative__;
10115 returnIsNonNull__ = Discord_Client_GetLobbyHandle(&instance_, lobbyId, &returnValueNative__);
10116 if (!returnIsNonNull__) {
10120 return returnValue__;
10122std::vector<uint64_t> Client::GetLobbyIds()
const
10124 assert(state_ == DiscordObjectState::Owned);
10125 Discord_UInt64Span returnValueNative__;
10126 Discord_Client_GetLobbyIds(&instance_, &returnValueNative__);
10127 std::vector<uint64_t> returnValue__(returnValueNative__.ptr,
10128 returnValueNative__.ptr + returnValueNative__.size);
10129 Discord_Free(returnValueNative__.ptr);
10130 return returnValue__;
10134 assert(state_ == DiscordObjectState::Owned);
10135 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10136 auto cb__userData =
new Tcb__UserData(cb);
10137 Discord_Client_GetUserGuildsCallback cb__native =
10138 [](
auto result,
auto guilds,
void* userData__) {
10139 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10141 std::vector<discordpp::GuildMinimal> guilds__vec;
10142 guilds__vec.reserve(guilds.size);
10143 for (
size_t i__ = 0; i__ < guilds.size; ++i__) {
10144 guilds__vec.emplace_back(guilds.ptr[i__], DiscordObjectState::Owned);
10146 Discord_Free(guilds.ptr);
10147 userData__typed->delegate(std::move(result__obj), std::move(guilds__vec));
10149 Discord_Client_GetUserGuilds(&instance_, cb__native, Tcb__UserData::Free, cb__userData);
10153 assert(state_ == DiscordObjectState::Owned);
10154 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
10155 auto callback__userData =
new Tcallback__UserData(callback);
10156 Discord_Client_LeaveLobbyCallback callback__native = [](
auto result,
void* userData__) {
10157 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
10159 userData__typed->delegate(std::move(result__obj));
10161 Discord_Client_LeaveLobby(
10162 &instance_, lobbyId, callback__native, Tcallback__UserData::Free, callback__userData);
10164void Client::LinkChannelToLobby(uint64_t lobbyId,
10165 uint64_t channelId,
10168 assert(state_ == DiscordObjectState::Owned);
10169 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
10170 auto callback__userData =
new Tcallback__UserData(callback);
10171 Discord_Client_LinkOrUnlinkChannelCallback callback__native = [](
auto result,
10172 void* userData__) {
10173 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
10175 userData__typed->delegate(std::move(result__obj));
10177 Discord_Client_LinkChannelToLobby(&instance_,
10181 Tcallback__UserData::Free,
10182 callback__userData);
10186 assert(state_ == DiscordObjectState::Owned);
10187 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10188 auto cb__userData =
new Tcb__UserData(cb);
10189 Discord_Client_LobbyCreatedCallback cb__native = [](
auto lobbyId,
void* userData__) {
10190 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10191 userData__typed->delegate(lobbyId);
10193 Discord_Client_SetLobbyCreatedCallback(
10194 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
10198 assert(state_ == DiscordObjectState::Owned);
10199 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10200 auto cb__userData =
new Tcb__UserData(cb);
10201 Discord_Client_LobbyDeletedCallback cb__native = [](
auto lobbyId,
void* userData__) {
10202 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10203 userData__typed->delegate(lobbyId);
10205 Discord_Client_SetLobbyDeletedCallback(
10206 &instance_, 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_LobbyMemberAddedCallback cb__native =
10214 [](
auto lobbyId,
auto memberId,
void* userData__) {
10215 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10216 userData__typed->delegate(lobbyId, memberId);
10218 Discord_Client_SetLobbyMemberAddedCallback(
10219 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
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_LobbyMemberRemovedCallback cb__native =
10227 [](
auto lobbyId,
auto memberId,
void* userData__) {
10228 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10229 userData__typed->delegate(lobbyId, memberId);
10231 Discord_Client_SetLobbyMemberRemovedCallback(
10232 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
10236 assert(state_ == DiscordObjectState::Owned);
10237 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10238 auto cb__userData =
new Tcb__UserData(cb);
10239 Discord_Client_LobbyMemberUpdatedCallback cb__native =
10240 [](
auto lobbyId,
auto memberId,
void* userData__) {
10241 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10242 userData__typed->delegate(lobbyId, memberId);
10244 Discord_Client_SetLobbyMemberUpdatedCallback(
10245 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
10249 assert(state_ == DiscordObjectState::Owned);
10250 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10251 auto cb__userData =
new Tcb__UserData(cb);
10252 Discord_Client_LobbyUpdatedCallback cb__native = [](
auto lobbyId,
void* userData__) {
10253 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10254 userData__typed->delegate(lobbyId);
10256 Discord_Client_SetLobbyUpdatedCallback(
10257 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
10259void Client::UnlinkChannelFromLobby(uint64_t lobbyId,
10262 assert(state_ == DiscordObjectState::Owned);
10263 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
10264 auto callback__userData =
new Tcallback__UserData(callback);
10265 Discord_Client_LinkOrUnlinkChannelCallback callback__native = [](
auto result,
10266 void* userData__) {
10267 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
10269 userData__typed->delegate(std::move(result__obj));
10271 Discord_Client_UnlinkChannelFromLobby(
10272 &instance_, lobbyId, callback__native, Tcallback__UserData::Free, callback__userData);
10277 assert(state_ == DiscordObjectState::Owned);
10278 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10279 auto cb__userData =
new Tcb__UserData(cb);
10280 Discord_Client_AcceptActivityInviteCallback cb__native =
10281 [](
auto result,
auto joinSecret,
void* userData__) {
10282 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10284 std::string joinSecret__str(
reinterpret_cast<char*
>(joinSecret.ptr), joinSecret.size);
10285 userData__typed->delegate(std::move(result__obj), std::move(joinSecret__str));
10286 Discord_Free(joinSecret.ptr);
10288 Discord_Client_AcceptActivityInvite(
10289 &instance_, invite.instance(), cb__native, Tcb__UserData::Free, cb__userData);
10291void Client::ClearRichPresence()
10293 assert(state_ == DiscordObjectState::Owned);
10294 Discord_Client_ClearRichPresence(&instance_);
10296bool Client::RegisterLaunchCommand(uint64_t applicationId, std::string command)
10298 assert(state_ == DiscordObjectState::Owned);
10299 bool returnValue__;
10300 Discord_String command__str{(uint8_t*)(command.data()), command.size()};
10301 returnValue__ = Discord_Client_RegisterLaunchCommand(&instance_, applicationId, command__str);
10302 return returnValue__;
10304bool Client::RegisterLaunchSteamApplication(uint64_t applicationId, uint32_t steamAppId)
10306 assert(state_ == DiscordObjectState::Owned);
10307 bool returnValue__;
10309 Discord_Client_RegisterLaunchSteamApplication(&instance_, applicationId, steamAppId);
10310 return returnValue__;
10312void Client::SendActivityInvite(uint64_t userId,
10313 std::string
const& content,
10316 assert(state_ == DiscordObjectState::Owned);
10317 Discord_String content__str{(uint8_t*)(content.data()), content.size()};
10318 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10319 auto cb__userData =
new Tcb__UserData(cb);
10320 Discord_Client_SendActivityInviteCallback cb__native = [](
auto result,
void* userData__) {
10321 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10323 userData__typed->delegate(std::move(result__obj));
10325 Discord_Client_SendActivityInvite(
10326 &instance_, userId, content__str, cb__native, Tcb__UserData::Free, cb__userData);
10328void Client::SendActivityJoinRequest(uint64_t userId,
10331 assert(state_ == DiscordObjectState::Owned);
10332 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10333 auto cb__userData =
new Tcb__UserData(cb);
10334 Discord_Client_SendActivityInviteCallback cb__native = [](
auto result,
void* userData__) {
10335 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10337 userData__typed->delegate(std::move(result__obj));
10339 Discord_Client_SendActivityJoinRequest(
10340 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
10345 assert(state_ == DiscordObjectState::Owned);
10346 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10347 auto cb__userData =
new Tcb__UserData(cb);
10348 Discord_Client_SendActivityInviteCallback cb__native = [](
auto result,
void* userData__) {
10349 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10351 userData__typed->delegate(std::move(result__obj));
10353 Discord_Client_SendActivityJoinRequestReply(
10354 &instance_, invite.instance(), cb__native, Tcb__UserData::Free, cb__userData);
10358 assert(state_ == DiscordObjectState::Owned);
10359 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10360 auto cb__userData =
new Tcb__UserData(cb);
10361 Discord_Client_ActivityInviteCallback cb__native = [](
auto invite,
void* userData__) {
10362 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10364 userData__typed->delegate(std::move(invite__obj));
10366 Discord_Client_SetActivityInviteCreatedCallback(
10367 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
10371 assert(state_ == DiscordObjectState::Owned);
10372 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10373 auto cb__userData =
new Tcb__UserData(cb);
10374 Discord_Client_ActivityInviteCallback cb__native = [](
auto invite,
void* userData__) {
10375 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10377 userData__typed->delegate(std::move(invite__obj));
10379 Discord_Client_SetActivityInviteUpdatedCallback(
10380 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
10384 assert(state_ == DiscordObjectState::Owned);
10385 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10386 auto cb__userData =
new Tcb__UserData(cb);
10387 Discord_Client_ActivityJoinCallback cb__native = [](
auto joinSecret,
void* userData__) {
10388 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10389 std::string joinSecret__str(
reinterpret_cast<char*
>(joinSecret.ptr), joinSecret.size);
10390 userData__typed->delegate(std::move(joinSecret__str));
10391 Discord_Free(joinSecret.ptr);
10393 Discord_Client_SetActivityJoinCallback(
10394 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
10399 assert(state_ == DiscordObjectState::Owned);
10400 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
10401 auto callback__userData =
new Tcallback__UserData(callback);
10402 Discord_Client_UpdateStatusCallback callback__native = [](
auto result,
void* userData__) {
10403 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
10405 userData__typed->delegate(std::move(result__obj));
10407 Discord_Client_SetOnlineStatus(&instance_,
10408 static_cast<Discord_StatusType
>(status),
10410 Tcallback__UserData::Free,
10411 callback__userData);
10416 assert(state_ == DiscordObjectState::Owned);
10417 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10418 auto cb__userData =
new Tcb__UserData(cb);
10419 Discord_Client_UpdateRichPresenceCallback cb__native = [](
auto result,
void* userData__) {
10420 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10422 userData__typed->delegate(std::move(result__obj));
10424 Discord_Client_UpdateRichPresence(
10425 &instance_, activity.instance(), cb__native, Tcb__UserData::Free, cb__userData);
10427void Client::AcceptDiscordFriendRequest(uint64_t userId,
10430 assert(state_ == DiscordObjectState::Owned);
10431 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10432 auto cb__userData =
new Tcb__UserData(cb);
10433 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
10434 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10436 userData__typed->delegate(std::move(result__obj));
10438 Discord_Client_AcceptDiscordFriendRequest(
10439 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
10441void Client::AcceptGameFriendRequest(uint64_t userId,
10444 assert(state_ == DiscordObjectState::Owned);
10445 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10446 auto cb__userData =
new Tcb__UserData(cb);
10447 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
10448 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10450 userData__typed->delegate(std::move(result__obj));
10452 Discord_Client_AcceptGameFriendRequest(
10453 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
10457 assert(state_ == DiscordObjectState::Owned);
10458 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10459 auto cb__userData =
new Tcb__UserData(cb);
10460 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
10461 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10463 userData__typed->delegate(std::move(result__obj));
10465 Discord_Client_BlockUser(&instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
10467void Client::CancelDiscordFriendRequest(uint64_t userId,
10470 assert(state_ == DiscordObjectState::Owned);
10471 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10472 auto cb__userData =
new Tcb__UserData(cb);
10473 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
10474 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10476 userData__typed->delegate(std::move(result__obj));
10478 Discord_Client_CancelDiscordFriendRequest(
10479 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
10481void Client::CancelGameFriendRequest(uint64_t userId,
10484 assert(state_ == DiscordObjectState::Owned);
10485 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10486 auto cb__userData =
new Tcb__UserData(cb);
10487 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
10488 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10490 userData__typed->delegate(std::move(result__obj));
10492 Discord_Client_CancelGameFriendRequest(
10493 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
10497 assert(state_ == DiscordObjectState::Owned);
10498 Discord_RelationshipHandle returnValueNative__{};
10499 Discord_Client_GetRelationshipHandle(&instance_, userId, &returnValueNative__);
10501 return returnValue__;
10503std::vector<discordpp::RelationshipHandle> Client::GetRelationships()
const
10505 assert(state_ == DiscordObjectState::Owned);
10506 Discord_RelationshipHandleSpan returnValueNative__;
10507 Discord_Client_GetRelationships(&instance_, &returnValueNative__);
10508 std::vector<discordpp::RelationshipHandle> returnValue__;
10509 returnValue__.reserve(returnValueNative__.size);
10510 for (
size_t i__ = 0; i__ < returnValueNative__.size; ++i__) {
10511 returnValue__.emplace_back(returnValueNative__.ptr[i__], DiscordObjectState::Owned);
10513 Discord_Free(returnValueNative__.ptr);
10514 return returnValue__;
10516void Client::RejectDiscordFriendRequest(uint64_t userId,
10519 assert(state_ == DiscordObjectState::Owned);
10520 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10521 auto cb__userData =
new Tcb__UserData(cb);
10522 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
10523 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10525 userData__typed->delegate(std::move(result__obj));
10527 Discord_Client_RejectDiscordFriendRequest(
10528 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
10530void Client::RejectGameFriendRequest(uint64_t userId,
10533 assert(state_ == DiscordObjectState::Owned);
10534 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10535 auto cb__userData =
new Tcb__UserData(cb);
10536 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
10537 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10539 userData__typed->delegate(std::move(result__obj));
10541 Discord_Client_RejectGameFriendRequest(
10542 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
10544void Client::RemoveDiscordAndGameFriend(uint64_t userId,
10547 assert(state_ == DiscordObjectState::Owned);
10548 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10549 auto cb__userData =
new Tcb__UserData(cb);
10550 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
10551 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10553 userData__typed->delegate(std::move(result__obj));
10555 Discord_Client_RemoveDiscordAndGameFriend(
10556 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
10560 assert(state_ == DiscordObjectState::Owned);
10561 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10562 auto cb__userData =
new Tcb__UserData(cb);
10563 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
10564 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10566 userData__typed->delegate(std::move(result__obj));
10568 Discord_Client_RemoveGameFriend(
10569 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
10571std::vector<discordpp::UserHandle> Client::SearchFriendsByUsername(std::string searchStr)
const
10573 assert(state_ == DiscordObjectState::Owned);
10574 Discord_UserHandleSpan returnValueNative__;
10575 Discord_String searchStr__str{(uint8_t*)(searchStr.data()), searchStr.size()};
10576 Discord_Client_SearchFriendsByUsername(&instance_, searchStr__str, &returnValueNative__);
10577 std::vector<discordpp::UserHandle> returnValue__;
10578 returnValue__.reserve(returnValueNative__.size);
10579 for (
size_t i__ = 0; i__ < returnValueNative__.size; ++i__) {
10580 returnValue__.emplace_back(returnValueNative__.ptr[i__], DiscordObjectState::Owned);
10582 Discord_Free(returnValueNative__.ptr);
10583 return returnValue__;
10585void Client::SendDiscordFriendRequest(std::string
const& username,
10588 assert(state_ == DiscordObjectState::Owned);
10589 Discord_String username__str{(uint8_t*)(username.data()), username.size()};
10590 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10591 auto cb__userData =
new Tcb__UserData(cb);
10592 Discord_Client_SendFriendRequestCallback cb__native = [](
auto result,
void* userData__) {
10593 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10595 userData__typed->delegate(std::move(result__obj));
10597 Discord_Client_SendDiscordFriendRequest(
10598 &instance_, username__str, cb__native, Tcb__UserData::Free, cb__userData);
10600void Client::SendDiscordFriendRequestById(uint64_t userId,
10603 assert(state_ == DiscordObjectState::Owned);
10604 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10605 auto cb__userData =
new Tcb__UserData(cb);
10606 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
10607 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10609 userData__typed->delegate(std::move(result__obj));
10611 Discord_Client_SendDiscordFriendRequestById(
10612 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
10614void Client::SendGameFriendRequest(std::string
const& username,
10617 assert(state_ == DiscordObjectState::Owned);
10618 Discord_String username__str{(uint8_t*)(username.data()), username.size()};
10619 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10620 auto cb__userData =
new Tcb__UserData(cb);
10621 Discord_Client_SendFriendRequestCallback cb__native = [](
auto result,
void* userData__) {
10622 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10624 userData__typed->delegate(std::move(result__obj));
10626 Discord_Client_SendGameFriendRequest(
10627 &instance_, username__str, cb__native, Tcb__UserData::Free, cb__userData);
10629void Client::SendGameFriendRequestById(uint64_t userId,
10632 assert(state_ == DiscordObjectState::Owned);
10633 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10634 auto cb__userData =
new Tcb__UserData(cb);
10635 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
10636 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10638 userData__typed->delegate(std::move(result__obj));
10640 Discord_Client_SendGameFriendRequestById(
10641 &instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
10645 assert(state_ == DiscordObjectState::Owned);
10646 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10647 auto cb__userData =
new Tcb__UserData(cb);
10648 Discord_Client_RelationshipCreatedCallback cb__native =
10649 [](
auto userId,
auto isDiscordRelationshipUpdate,
void* userData__) {
10650 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10651 userData__typed->delegate(userId, isDiscordRelationshipUpdate);
10653 Discord_Client_SetRelationshipCreatedCallback(
10654 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
10658 assert(state_ == DiscordObjectState::Owned);
10659 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10660 auto cb__userData =
new Tcb__UserData(cb);
10661 Discord_Client_RelationshipDeletedCallback cb__native =
10662 [](
auto userId,
auto isDiscordRelationshipUpdate,
void* userData__) {
10663 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10664 userData__typed->delegate(userId, isDiscordRelationshipUpdate);
10666 Discord_Client_SetRelationshipDeletedCallback(
10667 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
10671 assert(state_ == DiscordObjectState::Owned);
10672 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10673 auto cb__userData =
new Tcb__UserData(cb);
10674 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
10675 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10677 userData__typed->delegate(std::move(result__obj));
10679 Discord_Client_UnblockUser(&instance_, userId, cb__native, Tcb__UserData::Free, cb__userData);
10683 assert(state_ == DiscordObjectState::Owned);
10684 Discord_UserHandle returnValueNative__{};
10685 Discord_Client_GetCurrentUser(&instance_, &returnValueNative__);
10687 return returnValue__;
10689void Client::GetDiscordClientConnectedUser(
10690 uint64_t applicationId,
10693 assert(state_ == DiscordObjectState::Owned);
10694 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
10695 auto callback__userData =
new Tcallback__UserData(callback);
10696 Discord_Client_GetDiscordClientConnectedUserCallback callback__native =
10697 [](
auto result,
auto user,
void* userData__) {
10698 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
10700 std::optional<discordpp::UserHandle> user__opt{};
10704 userData__typed->delegate(std::move(result__obj), std::move(user__opt));
10706 Discord_Client_GetDiscordClientConnectedUser(
10707 &instance_, applicationId, callback__native, Tcallback__UserData::Free, callback__userData);
10709std::optional<discordpp::UserHandle> Client::GetUser(uint64_t userId)
const
10711 assert(state_ == DiscordObjectState::Owned);
10712 bool returnIsNonNull__;
10713 Discord_UserHandle returnValueNative__;
10714 returnIsNonNull__ = Discord_Client_GetUser(&instance_, userId, &returnValueNative__);
10715 if (!returnIsNonNull__) {
10719 return returnValue__;
10723 assert(state_ == DiscordObjectState::Owned);
10724 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
10725 auto cb__userData =
new Tcb__UserData(cb);
10726 Discord_Client_UserUpdatedCallback cb__native = [](
auto userId,
void* userData__) {
10727 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
10728 userData__typed->delegate(userId);
10730 Discord_Client_SetUserUpdatedCallback(
10731 &instance_, cb__native, Tcb__UserData::Free, cb__userData);
10733const CallInfoHandle CallInfoHandle::nullobj{{}, DiscordObjectState::Invalid};
10734CallInfoHandle::~CallInfoHandle()
10736 if (state_ == DiscordObjectState::Owned) {
10738 state_ = DiscordObjectState::Invalid;
10741CallInfoHandle::CallInfoHandle(CallInfoHandle&& other) noexcept
10742 : instance_(other.instance_)
10743 , state_(other.state_)
10745 other.state_ = DiscordObjectState::Invalid;
10747CallInfoHandle& CallInfoHandle::operator=(CallInfoHandle&& other)
noexcept
10749 if (
this != &other) {
10750 if (state_ == DiscordObjectState::Owned) {
10753 instance_ = other.instance_;
10754 state_ = other.state_;
10755 other.state_ = DiscordObjectState::Invalid;
10759CallInfoHandle::CallInfoHandle(
const CallInfoHandle& other)
10764 Discord_CallInfoHandle_Clone(&instance_, other.instance());
10766 state_ = DiscordObjectState::Owned;
10769CallInfoHandle& CallInfoHandle::operator=(
const CallInfoHandle& other)
10771 if (
this != &other) {
10772 if (state_ == DiscordObjectState::Owned) {
10774 state_ = DiscordObjectState::Invalid;
10776 if (other.state_ == DiscordObjectState::Owned) {
10777 Discord_CallInfoHandle_Clone(&instance_, other.instance());
10779 state_ = DiscordObjectState::Owned;
10784CallInfoHandle::CallInfoHandle(Discord_CallInfoHandle instance, DiscordObjectState state)
10785 : instance_(instance)
10789void CallInfoHandle::Drop()
10791 if (state_ != DiscordObjectState::Owned) {
10794 Discord_CallInfoHandle_Drop(&instance_);
10795 state_ = DiscordObjectState::Invalid;
10797uint64_t CallInfoHandle::ChannelId()
const
10799 assert(state_ == DiscordObjectState::Owned);
10800 uint64_t returnValue__;
10801 returnValue__ = Discord_CallInfoHandle_ChannelId(&instance_);
10802 return returnValue__;
10804std::vector<uint64_t> CallInfoHandle::GetParticipants()
const
10806 assert(state_ == DiscordObjectState::Owned);
10807 Discord_UInt64Span returnValueNative__;
10808 Discord_CallInfoHandle_GetParticipants(&instance_, &returnValueNative__);
10809 std::vector<uint64_t> returnValue__(returnValueNative__.ptr,
10810 returnValueNative__.ptr + returnValueNative__.size);
10811 Discord_Free(returnValueNative__.ptr);
10812 return returnValue__;
10814std::optional<discordpp::VoiceStateHandle> CallInfoHandle::GetVoiceStateHandle(
10815 uint64_t userId)
const
10817 assert(state_ == DiscordObjectState::Owned);
10818 bool returnIsNonNull__;
10819 Discord_VoiceStateHandle returnValueNative__;
10820 returnIsNonNull__ =
10821 Discord_CallInfoHandle_GetVoiceStateHandle(&instance_, userId, &returnValueNative__);
10822 if (!returnIsNonNull__) {
10826 return returnValue__;
10828uint64_t CallInfoHandle::GuildId()
const
10830 assert(state_ == DiscordObjectState::Owned);
10831 uint64_t returnValue__;
10832 returnValue__ = Discord_CallInfoHandle_GuildId(&instance_);
10833 return returnValue__;
Struct which controls what your rich presence looks like in the Discord client. If you don't specify ...
Definition discordpp.h:721
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:740
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:629
static const ActivityInvite nullobj
Uninitialized instance of ActivityInvite.
Definition discordpp.h:648
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:840
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:859
ActivityParty & operator=(const ActivityParty &arg0)
Copy assignment operator for ActivityParty.
Definition discordpp.h:902
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:921
Definition discordpp.h:786
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:805
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:1171
std::vector< discordpp::ActivityButton > GetButtons() const
Returns the custom buttons for the rich presence.
static const Activity nullobj
Uninitialized instance of Activity.
Definition discordpp.h:1190
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 AddButton(discordpp::ActivityButton button)
Adds a custom button to the rich presence.
void SetSupportedPlatforms(discordpp::ActivityGamePlatforms SupportedPlatforms)
Setter for Activity::SupportedPlatforms.
std::optional< std::string > Details() const
The state of the what the user is doing for this activity.
void SetState(std::optional< std::string > State)
Setter for Activity::State.
Activity(Activity &&other) noexcept
Move constructor for Activity.
discordpp::ActivityGamePlatforms SupportedPlatforms() const
If an activity is joinable, but only on certain platforms, this field can be used to indicate which p...
std::optional< discordpp::ActivitySecrets > Secrets() const
The secrets struct is used in combination with the party struct to make an Activity joinable.
std::optional< std::string > State() const
The state of the party for this activity.
discordpp::ActivityTypes Type() const
The type of activity this is.
Contains information about non-text content in a message that likely cannot be rendered in game such ...
Definition discordpp.h:2638
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:2657
Represents a single input or output audio device available to the user.
Definition discordpp.h:2854
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:2873
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:1480
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:1499
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:1388
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:1408
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:1435
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:1455
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:4583
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:4602
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:1718
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:1779
static const Call nullobj
Uninitialized instance of Call.
Definition discordpp.h:1796
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:1726
@ None
None.
Definition discordpp.h:1729
@ Forbidden
Forbidden.
Definition discordpp.h:1744
@ SignalingConnectionFailed
SignalingConnectionFailed.
Definition discordpp.h:1732
@ SignalingUnexpectedClose
SignalingUnexpectedClose.
Definition discordpp.h:1735
@ JoinTimeout
JoinTimeout.
Definition discordpp.h:1741
@ VoiceConnectionFailed
VoiceConnectionFailed.
Definition discordpp.h:1738
Status
Enum that respresents the state of the Call's network connection.
Definition discordpp.h:1748
@ Disconnecting
Disconnecting.
Definition discordpp.h:1769
@ Connected
Connected.
Definition discordpp.h:1763
@ Reconnecting
Reconnecting.
Definition discordpp.h:1766
@ Connecting
Connecting.
Definition discordpp.h:1757
@ SignalingConnected
SignalingConnected.
Definition discordpp.h:1760
@ Disconnected
Disconnected.
Definition discordpp.h:1751
@ Joining
Joining.
Definition discordpp.h:1754
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:1782
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:1776
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:1773
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:1945
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:1964
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:1295
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:1314
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:2909
std::function< void(std::vector< discordpp::AudioDevice > devices)> GetOutputDevicesCallback
Callback function for Client::GetOutputDevices.
Definition discordpp.h:3006
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:3097
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:3180
void EndCalls(discordpp::Client::EndCallsCallback callback)
Ends any active call, if any. Any references you have to Call objects are invalid after they are ende...
static std::string StatusToString(discordpp::Client::Status type)
Converts the Status enum to a string.
void Disconnect()
Asynchronously disconnects the client.
void SendDiscordFriendRequest(std::string const &username, discordpp::Client::SendFriendRequestCallback cb)
Sends a Discord friend request to the target user.
void RefreshToken(uint64_t applicationId, std::string const &refreshToken, discordpp::Client::TokenExchangeCallback callback)
Generates a new access token for the current user from a refresh token.
void SendLobbyMessageWithMetadata(uint64_t lobbyId, std::string const &content, std::unordered_map< std::string, std::string > const &metadata, discordpp::Client::SendUserMessageCallback cb)
Variant of Client::SendLobbyMessage that also accepts metadata to be sent with the message.
void SetEchoCancellation(bool on)
Enables or disables the basic echo cancellation provided by the WebRTC library.
void GetInputDevices(discordpp::Client::GetInputDevicesCallback cb)
Asynchronously fetches the list of audio input devices available to the user.
void CancelGameFriendRequest(uint64_t userId, discordpp::Client::UpdateRelationshipCallback cb)
Cancels an outgoing game friend request to the target user.
void AbortGetTokenFromDevice()
This function is used to abort/cleanup the device authorization flow.
bool SetLogDir(std::string const &path, discordpp::LoggingSeverity minSeverity)
Causes logs generated by the SDK to be written to disk in the specified directory.
void OpenConnectedGamesSettingsInDiscord(discordpp::Client::OpenConnectedGamesSettingsInDiscordCallback callback)
Opens the Connected Games settings in the Discord client, which is where users can manage their setti...
void SetAuthorizeDeviceScreenClosedCallback(discordpp::Client::AuthorizeDeviceScreenClosedCallback cb)
Sets a callback function to be invoked when the device authorization screen is closed.
void SetMessageCreatedCallback(discordpp::Client::MessageCreatedCallback cb)
Sets a callback to be invoked whenever a new message is received in either a lobby or a DM.
std::function< void(discordpp::ClientResult result)> UpdateProvisionalAccountDisplayNameCallback
Callback function for Client::UpdateProvisionalAccountDisplayName.
Definition discordpp.h:3071
std::function< void(bool inputDetected)> NoAudioInputCallback
Callback function for Client::SetNoAudioInputCallback.
Definition discordpp.h:3018
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:3085
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:3130
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:3143
std::function< void(std::string message, discordpp::LoggingSeverity severity)> LogCallback
Callback function invoked when a new log message is generated.
Definition discordpp.h:3106
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:3137
std::function< void(discordpp::AudioDevice device)> GetCurrentOutputDeviceCallback
Callback function for Client::GetCurrentOutputDevice.
Definition discordpp.h:2999
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:3068
std::function< void(discordpp::ClientResult result)> SetOutputDeviceCallback
Callback function for Client::SetOutputDevice.
Definition discordpp.h:3021
std::function< void(discordpp::ClientResult result, std::optional< discordpp::UserHandle > user)> GetDiscordClientConnectedUserCallback
Callback function for when Client::GetDiscordClientConnectedUser completes.
Definition discordpp.h:3201
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:3152
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:3030
std::function< void(discordpp::ClientResult result)> LeaveLobbyCallback
Callback function for Client::LeaveLobby.
Definition discordpp.h:3134
std::function< void(uint64_t lobbyId)> LobbyUpdatedCallback
Callback function for Client::SetLobbyUpdatedCallback.
Definition discordpp.h:3155
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:3065
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:3176
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:3184
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:3117
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:2993
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:3158
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:2952
@ Disconnecting
Disconnecting.
Definition discordpp.h:2970
@ Connected
Connected.
Definition discordpp.h:2961
@ HttpWait
HttpWait.
Definition discordpp.h:2973
@ Reconnecting
Reconnecting.
Definition discordpp.h:2967
@ Connecting
Connecting.
Definition discordpp.h:2958
@ Ready
Ready.
Definition discordpp.h:2964
@ Disconnected
Disconnected.
Definition discordpp.h:2955
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:3057
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:3088
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:2990
std::function< void(discordpp::ClientResult result)> EditUserMessageCallback
Callback function for Client::EditUserMessage.
Definition discordpp.h:3082
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:3015
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:3146
void SetOnlineStatus(discordpp::StatusType status, discordpp::Client::UpdateStatusCallback callback)
Sets whether a user is online/invisible/idle/dnd on Discord.
void ClearRichPresence()
Clears the right presence for the current user.
void SetSelfMuteAll(bool mute)
Mutes the current user's microphone so that no other participant in their active calls can hear them ...
void SetStatusChangedCallback(discordpp::Client::OnStatusChanged cb)
Sets a callback function to be invoked whenever the SDKs status changes.
std::function< void(discordpp::ActivityInvite invite)> ActivityInviteCallback
Callback function for Client::SetActivityInviteCreatedCallback and Client::SetActivityInviteUpdatedCa...
Definition discordpp.h:3167
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:3076
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:3140
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:3149
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:3049
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:3170
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:3163
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:3024
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:3197
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:2923
@ None
None.
Definition discordpp.h:2926
@ ConnectionCanceled
ConnectionCanceled.
Definition discordpp.h:2935
@ ConnectionFailed
ConnectionFailed.
Definition discordpp.h:2929
@ UnexpectedClose
UnexpectedClose.
Definition discordpp.h:2932
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:3093
std::function< void(discordpp::AudioDevice device)> GetCurrentInputDeviceCallback
Callback function for Client::GetCurrentInputDevice.
Definition discordpp.h:2996
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:3206
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:3100
void SetLobbyUpdatedCallback(discordpp::Client::LobbyUpdatedCallback cb)
Sets a callback to be invoked when a lobby is edited, for example if the lobby's metadata is changed.
std::function< void(discordpp::ClientResult result)> OpenConnectedGamesSettingsInDiscordCallback
Callback function for when Client::OpenConnectedGamesSettingsInDiscord completes.
Definition discordpp.h:3110
Thread
Represents the type of thread to control thread priority on.
Definition discordpp.h:2977
@ Client
Client.
Definition discordpp.h:2980
@ Voice
Voice.
Definition discordpp.h:2983
@ Network
Network.
Definition discordpp.h:2986
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:3103
void SetEngineManagedAudioSession(bool isEngineManaged)
On mobile devices, set whether the audio environment is managed by the engine or the SDK....
void SetLobbyMemberUpdatedCallback(discordpp::Client::LobbyMemberUpdatedCallback cb)
Sets a callback function to be invoked whenever a member of a lobby is changed.
bool GetSelfMuteAll() const
Returns whether the current user's microphone is muted in all calls.
std::function< void(uint64_t userId, bool isDiscordRelationshipUpdate)> RelationshipCreatedCallback
Callback function for Client::SetRelationshipCreatedCallback.
Definition discordpp.h:3190
std::function< void(discordpp::ClientResult result)> DeleteUserMessageCallback
Callback function for Client::DeleteUserMessage.
Definition discordpp.h:3079
bool CanOpenMessageInDiscord(uint64_t messageId)
Returns true if the given message is able to be viewed in a Discord client.
void SetNoiseSuppression(bool on)
Enables basic background noise suppression.
void SetLobbyMemberAddedCallback(discordpp::Client::LobbyMemberAddedCallback cb)
Sets a callback function to be invoked whenever a user is added to a lobby.
void GetCurrentOutputDevice(discordpp::Client::GetCurrentOutputDeviceCallback cb)
Asynchronously fetches the current audio output device in use by the client.
void SetHttpRequestTimeout(int32_t httpTimeoutInMilliseconds)
This function is used to override the default HTTP timeout for the websocket client.
void EndCall(uint64_t channelId, discordpp::Client::EndCallCallback callback)
Ends any active call, if any. Any references you have to Call objects are invalid after they are ende...
void AcceptGameFriendRequest(uint64_t userId, discordpp::Client::UpdateRelationshipCallback cb)
Accepts an incoming game friend request from the target user.
std::function< void(discordpp::ClientResult result, uint64_t id, std::string name)> FetchCurrentUserCallback
Callback function for Client::FetchCurrentUser.
Definition discordpp.h:3053
std::function< void(discordpp::ClientResult result, std::vector< discordpp::GuildChannel > guildChannels)> GetGuildChannelsCallback
Callback function for Client::GetGuildChannels.
Definition discordpp.h:3125
std::function< void(discordpp::ClientResult result)> UpdateStatusCallback
Callback function for when Client::SetOnlineStatus completes.
Definition discordpp.h:3173
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:3121
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:3040
std::function< void(std::vector< discordpp::AudioDevice > inputDevices, std::vector< discordpp::AudioDevice > outputDevices)> DeviceChangeCallback
Callback function for Client::SetDeviceChangeCallback.
Definition discordpp.h:3010
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:3002
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:3219
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:1564
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:1584
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:2060
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:2015
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:2168
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:2187
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:2122
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:2141
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:2574
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:2593
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:2431
LobbyMemberHandle & operator=(const LobbyMemberHandle &other)
Copy assignment operator for LobbyMemberHandle.
static const LobbyMemberHandle nullobj
Uninitialized instance of LobbyMemberHandle.
Definition discordpp.h:2450
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:2750
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:2769
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:2250
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:2269
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:2306
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:2340
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:2314
@ Jpeg
Jpeg.
Definition discordpp.h:2326
@ Gif
Gif.
Definition discordpp.h:2317
@ Webp
Webp.
Definition discordpp.h:2320
@ Png
Png.
Definition discordpp.h:2323
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:1674
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:1693
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:1632
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:1651
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:4629
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