2#ifndef DISCORD_HEADER_DISCORDPP_H_
3#define DISCORD_HEADER_DISCORDPP_H_
17#include <unordered_map>
37 Discord_RunCallbacks();
48inline Discord_AllocatorInstallStatus
InstallAllocator(
const Discord_Allocator& allocator)
50 return Discord_InstallAllocator(&allocator);
56 Discord_AllocatorAllocFn fnAlloc,
57 Discord_AllocatorFreeFn fnFree)
59 Discord_Allocator allocator{};
60 allocator.structSize =
sizeof(Discord_Allocator);
61 allocator.version = DISCORD_ALLOCATOR_VERSION;
62 allocator.userData = userData;
63 allocator.fnAlloc = fnAlloc;
64 allocator.fnFree = fnFree;
65 return Discord_InstallAllocator(&allocator);
70[[noreturn]]
inline void FailAllocation()
72#if defined(__cpp_exceptions) || defined(_CPPUNWIND)
73 throw std::bad_alloc();
79inline void* AllocateOrFail(
size_t size)
81 void* ptr = Discord_Alloc(size);
100 template <typename U>
108 static_assert(
alignof(T) <=
alignof(std::max_align_t),
109 "Discord_Alloc only guarantees max_align_t alignment");
110 if (count >
static_cast<size_t>(-1) /
sizeof(T)) {
111 detail::FailAllocation();
113 return static_cast<T*
>(detail::AllocateOrFail(count *
sizeof(T)));
117 void deallocate(T* ptr,
size_t)
noexcept { Discord_Free(ptr); }
121template <
typename T,
typename U>
128template <
typename T,
typename U>
146 return std::hash<std::string_view>{}(std::string_view(value.data(), value.size()));
154 std::equal_to<SdkString>,
158template <
typename Signature>
163template <
typename R,
typename... Args>
173 template <
typename F,
174 typename = std::enable_if_t<!std::is_same_v<std::decay_t<F>,
SdkFunction> &&
175 std::is_invocable_r_v<R, std::decay_t<F>&, Args...>>>
178 using Target = std::decay_t<F>;
179 if constexpr (std::is_pointer_v<Target> || std::is_member_pointer_v<Target>) {
180 if (function ==
nullptr) {
184 callable_ = Holder<Target>::Create(std::forward<F>(function));
189 : callable_(other.callable_ != nullptr ? other.callable_->Clone() : nullptr)
195 : callable_(other.callable_)
197 other.callable_ =
nullptr;
206 if (
this != &other) {
208 std::swap(callable_, copy.callable_);
216 if (
this != &other) {
218 callable_ = other.callable_;
219 other.callable_ =
nullptr;
232 explicit operator bool() const noexcept {
return callable_ !=
nullptr; }
237 assert(callable_ !=
nullptr);
238 return callable_->Invoke(std::forward<Args>(args)...);
254 return static_cast<bool>(function);
259 return static_cast<bool>(function);
265 virtual R Invoke(Args&&... args) = 0;
266 virtual Callable* Clone()
const = 0;
267 virtual void Destroy()
noexcept = 0;
270 template <
typename F>
274 template <
typename G>
275 explicit Holder(G&& source)
276 : function(std::forward<G>(source))
280 template <
typename G>
281 static Holder* Create(G&& source)
283 void* storage = detail::AllocateOrFail(
sizeof(Holder));
284#if defined(__cpp_exceptions) || defined(_CPPUNWIND)
286 return ::new (storage) Holder(std::forward<G>(source));
289 Discord_Free(storage);
293 return ::new (storage) Holder(std::forward<G>(source));
297 R Invoke(Args&&... args)
override
299 if constexpr (std::is_void_v<R>) {
300 std::invoke(function, std::forward<Args>(args)...);
303 return std::invoke(function, std::forward<Args>(args)...);
307 Callable* Clone()
const override {
return Create(function); }
309 void Destroy()
noexcept override
316 void Reset() noexcept
318 if (callable_ !=
nullptr) {
319 callable_->Destroy();
324 Callable* callable_ =
nullptr;
327#ifdef DISCORDPP_USE_SDK_ALLOCATOR
336template <
typename Signature>
348using StringMap = std::unordered_map<std::string, std::string>;
350template <
typename Signature>
1025class ActivityInvite;
1026class ActivityAssets;
1027class ActivityTimestamps;
1029class ActivitySecrets;
1030class ActivityButton;
1033class AuthorizationCodeChallenge;
1034class AuthorizationCodeVerifier;
1035class AuthorizationArgs;
1036class DeviceAuthorizationArgs;
1037class VoiceStateHandle;
1038class VADThresholdSettings;
1043class LinkedGameOrganization;
1047class RelationshipHandle;
1048class UserApplicationProfileHandle;
1050class LobbyMemberHandle;
1052class AdditionalContent;
1056class DiscordClientGuildVoiceMember;
1057class DiscordClientGuildVoiceSnapshot;
1058class UserMessageSummary;
1059class ClientCreateOptions;
1061class CallInfoHandle;
1068 mutable Discord_ActivityInvite instance_{};
1074 Discord_ActivityInvite* instance()
const {
return &instance_; }
1166 mutable Discord_ActivityAssets instance_{};
1172 Discord_ActivityAssets* instance()
const {
return &instance_; }
1253 mutable Discord_ActivityTimestamps instance_{};
1259 Discord_ActivityTimestamps* instance()
const {
return &instance_; }
1307 mutable Discord_ActivityParty instance_{};
1313 Discord_ActivityParty* instance()
const {
return &instance_; }
1369 mutable Discord_ActivitySecrets instance_{};
1375 Discord_ActivitySecrets* instance()
const {
return &instance_; }
1413 mutable Discord_ActivityButton instance_{};
1419 Discord_ActivityButton* instance()
const {
return &instance_; }
1638 mutable Discord_Activity instance_{};
1644 Discord_Activity* instance()
const {
return &instance_; }
1704 std::optional<discordpp::String>
State()
const;
1750 std::optional<discordpp::ActivityAssets>
Assets()
const;
1763 std::optional<discordpp::ActivityParty>
Party()
const;
1769 std::optional<discordpp::ActivitySecrets>
Secrets()
const;
1794 mutable Discord_ClientResult instance_{};
1800 Discord_ClientResult* instance()
const {
return &instance_; }
1887 mutable Discord_AuthorizationCodeChallenge instance_{};
1893 Discord_AuthorizationCodeChallenge* instance()
const {
return &instance_; }
1934 mutable Discord_AuthorizationCodeVerifier instance_{};
1940 Discord_AuthorizationCodeVerifier* instance()
const {
return &instance_; }
1979 mutable Discord_AuthorizationArgs instance_{};
1985 Discord_AuthorizationArgs* instance()
const {
return &instance_; }
2038 std::optional<discordpp::String>
State()
const;
2046 std::optional<discordpp::String>
Nonce()
const;
2085 mutable Discord_DeviceAuthorizationArgs instance_{};
2091 Discord_DeviceAuthorizationArgs* instance()
const {
return &instance_; }
2153 mutable Discord_VoiceStateHandle instance_{};
2159 Discord_VoiceStateHandle* instance()
const {
return &instance_; }
2195 mutable Discord_VADThresholdSettings instance_{};
2201 Discord_VADThresholdSettings* instance()
const {
return &instance_; }
2239 mutable Discord_Call instance_{};
2304 Discord_Call* instance()
const {
return &instance_; }
2466 mutable Discord_ChannelHandle instance_{};
2472 Discord_ChannelHandle* instance()
const {
return &instance_; }
2517 mutable Discord_GuildMinimal instance_{};
2523 Discord_GuildMinimal* instance()
const {
return &instance_; }
2562 mutable Discord_UserGuild instance_{};
2568 Discord_UserGuild* instance()
const {
return &instance_; }
2603 std::optional<discordpp::String>
Icon()
const;
2608 std::optional<discordpp::String>
Banner()
const;
2638 mutable Discord_LinkedGameOrganization instance_{};
2644 Discord_LinkedGameOrganization* instance()
const {
return &instance_; }
2686 mutable Discord_GuildChannel instance_{};
2692 Discord_GuildChannel* instance()
const {
return &instance_; }
2782 mutable Discord_LinkedLobby instance_{};
2788 Discord_LinkedLobby* instance()
const {
return &instance_; }
2828 mutable Discord_LinkedChannel instance_{};
2834 Discord_LinkedChannel* instance()
const {
return &instance_; }
2911 mutable Discord_RelationshipHandle instance_{};
2917 Discord_RelationshipHandle* instance()
const {
return &instance_; }
2955 std::optional<discordpp::UserHandle>
User()
const;
2968 mutable Discord_UserApplicationProfileHandle instance_{};
2974 Discord_UserApplicationProfileHandle* instance()
const {
return &instance_; }
3030 mutable Discord_UserHandle instance_{};
3051 Discord_UserHandle* instance()
const {
return &instance_; }
3076 std::optional<discordpp::String>
Avatar()
const;
3160 mutable Discord_LobbyMemberHandle instance_{};
3166 Discord_LobbyMemberHandle* instance()
const {
return &instance_; }
3212 std::optional<discordpp::UserHandle>
User()
const;
3305 mutable Discord_LobbyHandle instance_{};
3311 Discord_LobbyHandle* instance()
const {
return &instance_; }
3369 mutable Discord_AdditionalContent instance_{};
3375 Discord_AdditionalContent* instance()
const {
return &instance_; }
3414 std::optional<discordpp::String>
Title()
const;
3481 mutable Discord_MessageHandle instance_{};
3487 Discord_MessageHandle* instance()
const {
return &instance_; }
3530 std::optional<discordpp::UserHandle>
Author()
const;
3536 std::optional<discordpp::ChannelHandle>
Channel()
const;
3561 std::optional<discordpp::LobbyHandle>
Lobby()
const;
3608 mutable Discord_AudioDevice instance_{};
3614 Discord_AudioDevice* instance()
const {
return &instance_; }
3663 mutable Discord_VoiceSettings instance_{};
3669 Discord_VoiceSettings* instance()
const {
return &instance_; }
3748 mutable Discord_DiscordClientGuildVoiceMember instance_{};
3754 Discord_DiscordClientGuildVoiceMember* instance()
const {
return &instance_; }
3830 mutable Discord_DiscordClientGuildVoiceSnapshot instance_{};
3836 Discord_DiscordClientGuildVoiceSnapshot* instance()
const {
return &instance_; }
3883 mutable Discord_UserMessageSummary instance_{};
3889 Discord_UserMessageSummary* instance()
const {
return &instance_; }
3925 mutable Discord_ClientCreateOptions instance_{};
3931 Discord_ClientCreateOptions* instance()
const {
return &instance_; }
4006 mutable Discord_Client instance_{};
4180 uint64_t samplesPerChannel,
4183 bool& outShouldMute)>;
4189 void(int16_t* data, uint64_t samplesPerChannel, int32_t sampleRate, uint64_t channels)>;
4416 std::optional<discordpp::UserHandle> user)>;
4424 Discord_Client* instance()
const {
return &instance_; }
4446 explicit Client(std::string_view apiBase, std::string_view webBase);
4467 [[deprecated(
"Please use GetCurrentUserV2 instead. This will be removed in a future version.")]]
4763 [[deprecated(
"Calling Client::SetSpeakerMode is DEPRECATED.")]]
4964 uint64_t childApplicationId,
4973 std::string_view token,
5011 std::string_view externalAuthToken,
5038 std::string_view code,
5039 std::string_view codeVerifier,
5040 std::string_view redirectUri,
5110 std::string_view externalAuthToken,
5144 std::string_view code,
5145 std::string_view codeVerifier,
5146 std::string_view redirectUri,
5148 std::string_view externalAuthToken,
5184 std::string_view refreshToken,
5218 std::string_view token,
5264 uint64_t applicationId,
5266 std::string_view externalAuthToken,
5275 std::string_view name,
5285 std::string_view token,
5312 std::string_view content,
5395 std::string_view content,
5405 std::string_view content,
5422 std::string_view content,
5432 std::string_view content,
5584 std::string_view gameOrganizationId,
5815 std::string_view content,
5978 std::string_view searchStr)
const;
6085 uint64_t applicationId,
6093 std::optional<discordpp::UserHandle>
GetUser(uint64_t userId)
const;
6115 mutable Discord_CallInfoHandle instance_{};
6121 Discord_CallInfoHandle* instance()
const {
return &instance_; }
6167 return "JoinRequest";
6197 return "CustomStatus";
6201 return "HangStatus";
6251 return "NetworkError";
6255 return "ClientNotReady";
6259 return "ClientDestroyed";
6261 return "ValidationError";
6265 return "AuthorizationFailed";
6281 return "SwitchingProtocols";
6283 return "Processing";
6285 return "EarlyHints";
6293 return "NonAuthoritativeInfo";
6297 return "ResetContent";
6299 return "PartialContent";
6301 return "MultiStatus";
6303 return "AlreadyReported";
6307 return "MultipleChoices";
6309 return "MovedPermanently";
6315 return "NotModified";
6317 return "TemporaryRedirect";
6319 return "PermanentRedirect";
6321 return "BadRequest";
6323 return "Unauthorized";
6325 return "PaymentRequired";
6331 return "MethodNotAllowed";
6333 return "NotAcceptable";
6335 return "ProxyAuthRequired";
6337 return "RequestTimeout";
6343 return "LengthRequired";
6345 return "PreconditionFailed";
6347 return "PayloadTooLarge";
6349 return "UriTooLong";
6351 return "UnsupportedMediaType";
6353 return "RangeNotSatisfiable";
6355 return "ExpectationFailed";
6357 return "MisdirectedRequest";
6359 return "UnprocessableEntity";
6363 return "FailedDependency";
6367 return "UpgradeRequired";
6369 return "PreconditionRequired";
6371 return "TooManyRequests";
6373 return "RequestHeaderFieldsTooLarge";
6375 return "InternalServerError";
6377 return "NotImplemented";
6379 return "BadGateway";
6381 return "ServiceUnavailable";
6383 return "GatewayTimeout";
6385 return "HttpVersionNotSupported";
6387 return "VariantAlsoNegotiates";
6389 return "InsufficientStorage";
6391 return "LoopDetected";
6393 return "NotExtended";
6395 return "NetworkAuthorizationRequired";
6415 return "GuildInstall";
6417 return "UserInstall";
6431 return "GuildVoice";
6435 return "GuildCategory";
6439 return "GuildStore";
6441 return "GuildNewsThread";
6443 return "GuildPublicThread";
6445 return "GuildPrivateThread";
6447 return "GuildStageVoice";
6449 return "GuildDirectory";
6451 return "GuildForum";
6453 return "GuildMedia";
6457 return "EphemeralDm";
6469 return "Attachment";
6473 return "VoiceMessage";
6489 return "VoiceActivity";
6491 return "PushToTalk";
6501 return "Unavailable";
6529 return "SignalingConnectionFailed";
6531 return "SignalingUnexpectedClose";
6533 return "VoiceConnectionFailed";
6535 return "JoinTimeout";
6547 return "MODE_UNINIT";
6561 return "Disconnected";
6565 return "Connecting";
6567 return "SignalingConnected";
6571 return "Reconnecting";
6573 return "Disconnecting";
6589 return "PendingIncoming";
6591 return "PendingOutgoing";
6595 return "Suggestion";
6607 return "EpicOnlineServices";
6613 return "DiscordBot";
6667 return "MessageDataVisibleOnDiscord";
6679 return "ConnectionFailed";
6681 return "UnexpectedClose";
6683 return "ConnectionCanceled";
6693 return "Disconnected";
6695 return "Connecting";
6701 return "Reconnecting";
6703 return "Disconnecting";
6743 return "EpicOnlineServicesAccessToken";
6745 return "EpicOnlineServicesIdToken";
6747 return "SteamSessionTicket";
6749 return "UnityServicesIdToken";
6751 return "DiscordBotIssuedAccessToken";
6753 return "AppleIdToken";
6755 return "PlayStationNetworkIdToken";
6783 return "OnlinePlayingGame";
6785 return "OnlineElsewhere";
6794#ifdef DISCORDPP_IMPLEMENTATION
6795#undef DISCORDPP_IMPLEMENTATION
6797#pragma clang diagnostic push
6798#pragma clang diagnostic ignored "-Wunused-parameter"
6803inline bool HasSynchronizationContext()
6805 return !!s_synchronizationContext;
6808inline void PostTask(
Function<
void()> task)
6810 assert(s_synchronizationContext);
6811 s_synchronizationContext(std::move(task));
6816 s_synchronizationContext = std::move(executor);
6819template <
typename T>
6820struct TDelegateUserData {
6822 explicit TDelegateUserData(T delegate)
6823 : delegate{std::move(delegate)}
6827 static TDelegateUserData* Create(T delegate)
6829 void* storage = detail::AllocateOrFail(
sizeof(TDelegateUserData));
6830 return ::new (storage) TDelegateUserData(std::move(delegate));
6833 static void Free(
void* ptr)
6835 reinterpret_cast<TDelegateUserData*
>(ptr)->~TDelegateUserData();
6839 static T& Get(
void* userData)
6841 return reinterpret_cast<TDelegateUserData*
>(userData)->delegate;
6845struct ConvertedProperties {
6846 ConvertedProperties(StringMap
const& PropertyMap)
6848 Properties.size = PropertyMap.size();
6849 Properties.keys =
reinterpret_cast<Discord_String*
>(
6850 Discord_Alloc(Properties.size *
sizeof(Discord_String)));
6851 Properties.values =
reinterpret_cast<Discord_String*
>(
6852 Discord_Alloc(Properties.size *
sizeof(Discord_String)));
6854 for (
auto& pair : PropertyMap) {
6855 Properties.keys[i] = AllocateString(pair.first);
6856 Properties.values[i] = AllocateString(pair.second);
6860 ~ConvertedProperties() { Discord_FreeProperties(Properties); }
6861 Discord_Properties Properties{};
6864 Discord_String AllocateString(String
const& str)
6866 Discord_String result;
6867 result.ptr =
reinterpret_cast<uint8_t*
>(Discord_Alloc(str.size()));
6868 result.size = str.size();
6869 std::memcpy(result.ptr, str.data(), result.size);
6874StringMap ConvertReturnedProperties(Discord_Properties
const& Properties)
6877 for (
size_t i = 0; i < Properties.size; ++i) {
6878 String key(
reinterpret_cast<char*
>(Properties.keys[i].ptr), Properties.keys[i].size);
6879 String value(
reinterpret_cast<char*
>(Properties.values[i].ptr), Properties.values[i].size);
6880 result.emplace(std::move(key), std::move(value));
6885ActivityInvite::~ActivityInvite()
6893 : instance_(other.instance_)
6894 , state_(other.state_)
6900 if (
this != &other) {
6904 instance_ = other.instance_;
6905 state_ = other.state_;
6915 Discord_ActivityInvite_Clone(&instance_, rhs.instance());
6917 state_ = DiscordObjectState::Owned;
6920ActivityInvite& ActivityInvite::operator=(
const ActivityInvite& rhs)
6923 if (state_ == DiscordObjectState::Owned) {
6925 state_ = DiscordObjectState::Invalid;
6927 if (rhs.state_ == DiscordObjectState::Owned) {
6928 Discord_ActivityInvite_Clone(&instance_, rhs.instance());
6930 state_ = DiscordObjectState::Owned;
6935ActivityInvite::ActivityInvite(Discord_ActivityInvite instance, DiscordObjectState state)
6936 : instance_(instance)
6940ActivityInvite::ActivityInvite()
6942 assert(state_ == DiscordObjectState::Invalid);
6943 Discord_ActivityInvite_Init(&instance_);
6944 state_ = DiscordObjectState::Owned;
6946void ActivityInvite::Drop()
6948 if (state_ != DiscordObjectState::Owned) {
6951 Discord_ActivityInvite_Drop(&instance_);
6952 state_ = DiscordObjectState::Invalid;
6954uint64_t ActivityInvite::SenderId()
const
6956 assert(state_ == DiscordObjectState::Owned);
6957 uint64_t returnValue__;
6958 returnValue__ = Discord_ActivityInvite_SenderId(&instance_);
6959 return returnValue__;
6961void ActivityInvite::SetSenderId(uint64_t SenderId)
6963 assert(state_ == DiscordObjectState::Owned);
6964 Discord_ActivityInvite_SetSenderId(&instance_, SenderId);
6966uint64_t ActivityInvite::ChannelId()
const
6968 assert(state_ == DiscordObjectState::Owned);
6969 uint64_t returnValue__;
6970 returnValue__ = Discord_ActivityInvite_ChannelId(&instance_);
6971 return returnValue__;
6973void ActivityInvite::SetChannelId(uint64_t ChannelId)
6975 assert(state_ == DiscordObjectState::Owned);
6976 Discord_ActivityInvite_SetChannelId(&instance_, ChannelId);
6978uint64_t ActivityInvite::MessageId()
const
6980 assert(state_ == DiscordObjectState::Owned);
6981 uint64_t returnValue__;
6982 returnValue__ = Discord_ActivityInvite_MessageId(&instance_);
6983 return returnValue__;
6985void ActivityInvite::SetMessageId(uint64_t MessageId)
6987 assert(state_ == DiscordObjectState::Owned);
6988 Discord_ActivityInvite_SetMessageId(&instance_, MessageId);
6992 assert(state_ == DiscordObjectState::Owned);
6993 Discord_ActivityActionTypes returnValue__;
6994 returnValue__ = Discord_ActivityInvite_Type(&instance_);
6999 assert(state_ == DiscordObjectState::Owned);
7000 Discord_ActivityInvite_SetType(&instance_,
static_cast<Discord_ActivityActionTypes
>(Type));
7002uint64_t ActivityInvite::ApplicationId()
const
7004 assert(state_ == DiscordObjectState::Owned);
7005 uint64_t returnValue__;
7006 returnValue__ = Discord_ActivityInvite_ApplicationId(&instance_);
7007 return returnValue__;
7009void ActivityInvite::SetApplicationId(uint64_t ApplicationId)
7011 assert(state_ == DiscordObjectState::Owned);
7012 Discord_ActivityInvite_SetApplicationId(&instance_, ApplicationId);
7014uint64_t ActivityInvite::ParentApplicationId()
const
7016 assert(state_ == DiscordObjectState::Owned);
7017 uint64_t returnValue__;
7018 returnValue__ = Discord_ActivityInvite_ParentApplicationId(&instance_);
7019 return returnValue__;
7021void ActivityInvite::SetParentApplicationId(uint64_t ParentApplicationId)
7023 assert(state_ == DiscordObjectState::Owned);
7024 Discord_ActivityInvite_SetParentApplicationId(&instance_, ParentApplicationId);
7028 assert(state_ == DiscordObjectState::Owned);
7029 Discord_String returnValueNative__;
7030 Discord_ActivityInvite_PartyId(&instance_, &returnValueNative__);
7031 discordpp::String returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7032 returnValueNative__.size);
7033 Discord_Free(returnValueNative__.ptr);
7034 return returnValue__;
7036void ActivityInvite::SetPartyId(std::string_view PartyId)
7038 assert(state_ == DiscordObjectState::Owned);
7039 Discord_String PartyId__str{(uint8_t*)(PartyId.data() !=
nullptr ? PartyId.data() :
""),
7041 Discord_ActivityInvite_SetPartyId(&instance_, PartyId__str);
7045 assert(state_ == DiscordObjectState::Owned);
7046 Discord_String returnValueNative__;
7047 Discord_ActivityInvite_SessionId(&instance_, &returnValueNative__);
7048 discordpp::String returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7049 returnValueNative__.size);
7050 Discord_Free(returnValueNative__.ptr);
7051 return returnValue__;
7053void ActivityInvite::SetSessionId(std::string_view SessionId)
7055 assert(state_ == DiscordObjectState::Owned);
7056 Discord_String SessionId__str{(uint8_t*)(SessionId.data() !=
nullptr ? SessionId.data() :
""),
7058 Discord_ActivityInvite_SetSessionId(&instance_, SessionId__str);
7060bool ActivityInvite::IsValid()
const
7062 assert(state_ == DiscordObjectState::Owned);
7064 returnValue__ = Discord_ActivityInvite_IsValid(&instance_);
7065 return returnValue__;
7067void ActivityInvite::SetIsValid(
bool IsValid)
7069 assert(state_ == DiscordObjectState::Owned);
7070 Discord_ActivityInvite_SetIsValid(&instance_, IsValid);
7072const ActivityAssets ActivityAssets::nullobj{{}, DiscordObjectState::Invalid};
7073ActivityAssets::~ActivityAssets()
7075 if (state_ == DiscordObjectState::Owned) {
7077 state_ = DiscordObjectState::Invalid;
7080ActivityAssets::ActivityAssets(ActivityAssets&& other) noexcept
7081 : instance_(other.instance_)
7082 , state_(other.state_)
7084 other.state_ = DiscordObjectState::Invalid;
7086ActivityAssets& ActivityAssets::operator=(ActivityAssets&& other)
noexcept
7088 if (
this != &other) {
7089 if (state_ == DiscordObjectState::Owned) {
7092 instance_ = other.instance_;
7093 state_ = other.state_;
7094 other.state_ = DiscordObjectState::Invalid;
7098ActivityAssets::ActivityAssets(
const ActivityAssets& arg0)
7103 Discord_ActivityAssets_Clone(&instance_, arg0.instance());
7105 state_ = DiscordObjectState::Owned;
7108ActivityAssets& ActivityAssets::operator=(
const ActivityAssets& arg0)
7110 if (
this != &arg0) {
7111 if (state_ == DiscordObjectState::Owned) {
7113 state_ = DiscordObjectState::Invalid;
7115 if (arg0.state_ == DiscordObjectState::Owned) {
7116 Discord_ActivityAssets_Clone(&instance_, arg0.instance());
7118 state_ = DiscordObjectState::Owned;
7123ActivityAssets::ActivityAssets(Discord_ActivityAssets instance, DiscordObjectState state)
7124 : instance_(instance)
7128ActivityAssets::ActivityAssets()
7130 assert(state_ == DiscordObjectState::Invalid);
7131 Discord_ActivityAssets_Init(&instance_);
7132 state_ = DiscordObjectState::Owned;
7134void ActivityAssets::Drop()
7136 if (state_ != DiscordObjectState::Owned) {
7139 Discord_ActivityAssets_Drop(&instance_);
7140 state_ = DiscordObjectState::Invalid;
7142std::optional<discordpp::String> ActivityAssets::LargeImage()
const
7144 assert(state_ == DiscordObjectState::Owned);
7145 bool returnIsNonNull__;
7146 Discord_String returnValueNative__;
7147 returnIsNonNull__ = Discord_ActivityAssets_LargeImage(&instance_, &returnValueNative__);
7148 if (!returnIsNonNull__) {
7151 discordpp::String returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7152 returnValueNative__.size);
7153 Discord_Free(returnValueNative__.ptr);
7154 return returnValue__;
7156void ActivityAssets::SetLargeImage(std::optional<std::string_view> LargeImage)
7158 assert(state_ == DiscordObjectState::Owned);
7159 Discord_String LargeImage__str{};
7160 if (LargeImage.has_value()) {
7161 LargeImage__str.ptr = (uint8_t*)(LargeImage->data() !=
nullptr ? LargeImage->data() :
"");
7162 LargeImage__str.size = LargeImage->size();
7164 Discord_ActivityAssets_SetLargeImage(&instance_,
7165 (LargeImage.has_value() ? &LargeImage__str :
nullptr));
7167std::optional<discordpp::String> ActivityAssets::LargeText()
const
7169 assert(state_ == DiscordObjectState::Owned);
7170 bool returnIsNonNull__;
7171 Discord_String returnValueNative__;
7172 returnIsNonNull__ = Discord_ActivityAssets_LargeText(&instance_, &returnValueNative__);
7173 if (!returnIsNonNull__) {
7176 discordpp::String returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7177 returnValueNative__.size);
7178 Discord_Free(returnValueNative__.ptr);
7179 return returnValue__;
7181void ActivityAssets::SetLargeText(std::optional<std::string_view> LargeText)
7183 assert(state_ == DiscordObjectState::Owned);
7184 Discord_String LargeText__str{};
7185 if (LargeText.has_value()) {
7186 LargeText__str.ptr = (uint8_t*)(LargeText->data() !=
nullptr ? LargeText->data() :
"");
7187 LargeText__str.size = LargeText->size();
7189 Discord_ActivityAssets_SetLargeText(&instance_,
7190 (LargeText.has_value() ? &LargeText__str :
nullptr));
7192std::optional<discordpp::String> ActivityAssets::LargeUrl()
const
7194 assert(state_ == DiscordObjectState::Owned);
7195 bool returnIsNonNull__;
7196 Discord_String returnValueNative__;
7197 returnIsNonNull__ = Discord_ActivityAssets_LargeUrl(&instance_, &returnValueNative__);
7198 if (!returnIsNonNull__) {
7201 discordpp::String returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7202 returnValueNative__.size);
7203 Discord_Free(returnValueNative__.ptr);
7204 return returnValue__;
7206void ActivityAssets::SetLargeUrl(std::optional<std::string_view> LargeUrl)
7208 assert(state_ == DiscordObjectState::Owned);
7209 Discord_String LargeUrl__str{};
7210 if (LargeUrl.has_value()) {
7211 LargeUrl__str.ptr = (uint8_t*)(LargeUrl->data() !=
nullptr ? LargeUrl->data() :
"");
7212 LargeUrl__str.size = LargeUrl->size();
7214 Discord_ActivityAssets_SetLargeUrl(&instance_,
7215 (LargeUrl.has_value() ? &LargeUrl__str :
nullptr));
7217std::optional<discordpp::String> ActivityAssets::SmallImage()
const
7219 assert(state_ == DiscordObjectState::Owned);
7220 bool returnIsNonNull__;
7221 Discord_String returnValueNative__;
7222 returnIsNonNull__ = Discord_ActivityAssets_SmallImage(&instance_, &returnValueNative__);
7223 if (!returnIsNonNull__) {
7226 discordpp::String returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7227 returnValueNative__.size);
7228 Discord_Free(returnValueNative__.ptr);
7229 return returnValue__;
7231void ActivityAssets::SetSmallImage(std::optional<std::string_view> SmallImage)
7233 assert(state_ == DiscordObjectState::Owned);
7234 Discord_String SmallImage__str{};
7235 if (SmallImage.has_value()) {
7236 SmallImage__str.ptr = (uint8_t*)(SmallImage->data() !=
nullptr ? SmallImage->data() :
"");
7237 SmallImage__str.size = SmallImage->size();
7239 Discord_ActivityAssets_SetSmallImage(&instance_,
7240 (SmallImage.has_value() ? &SmallImage__str :
nullptr));
7242std::optional<discordpp::String> ActivityAssets::SmallText()
const
7244 assert(state_ == DiscordObjectState::Owned);
7245 bool returnIsNonNull__;
7246 Discord_String returnValueNative__;
7247 returnIsNonNull__ = Discord_ActivityAssets_SmallText(&instance_, &returnValueNative__);
7248 if (!returnIsNonNull__) {
7251 discordpp::String returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7252 returnValueNative__.size);
7253 Discord_Free(returnValueNative__.ptr);
7254 return returnValue__;
7256void ActivityAssets::SetSmallText(std::optional<std::string_view> SmallText)
7258 assert(state_ == DiscordObjectState::Owned);
7259 Discord_String SmallText__str{};
7260 if (SmallText.has_value()) {
7261 SmallText__str.ptr = (uint8_t*)(SmallText->data() !=
nullptr ? SmallText->data() :
"");
7262 SmallText__str.size = SmallText->size();
7264 Discord_ActivityAssets_SetSmallText(&instance_,
7265 (SmallText.has_value() ? &SmallText__str :
nullptr));
7267std::optional<discordpp::String> ActivityAssets::SmallUrl()
const
7269 assert(state_ == DiscordObjectState::Owned);
7270 bool returnIsNonNull__;
7271 Discord_String returnValueNative__;
7272 returnIsNonNull__ = Discord_ActivityAssets_SmallUrl(&instance_, &returnValueNative__);
7273 if (!returnIsNonNull__) {
7276 discordpp::String returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7277 returnValueNative__.size);
7278 Discord_Free(returnValueNative__.ptr);
7279 return returnValue__;
7281void ActivityAssets::SetSmallUrl(std::optional<std::string_view> SmallUrl)
7283 assert(state_ == DiscordObjectState::Owned);
7284 Discord_String SmallUrl__str{};
7285 if (SmallUrl.has_value()) {
7286 SmallUrl__str.ptr = (uint8_t*)(SmallUrl->data() !=
nullptr ? SmallUrl->data() :
"");
7287 SmallUrl__str.size = SmallUrl->size();
7289 Discord_ActivityAssets_SetSmallUrl(&instance_,
7290 (SmallUrl.has_value() ? &SmallUrl__str :
nullptr));
7292std::optional<discordpp::String> ActivityAssets::InviteCoverImage()
const
7294 assert(state_ == DiscordObjectState::Owned);
7295 bool returnIsNonNull__;
7296 Discord_String returnValueNative__;
7297 returnIsNonNull__ = Discord_ActivityAssets_InviteCoverImage(&instance_, &returnValueNative__);
7298 if (!returnIsNonNull__) {
7301 discordpp::String returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7302 returnValueNative__.size);
7303 Discord_Free(returnValueNative__.ptr);
7304 return returnValue__;
7306void ActivityAssets::SetInviteCoverImage(std::optional<std::string_view> InviteCoverImage)
7308 assert(state_ == DiscordObjectState::Owned);
7309 Discord_String InviteCoverImage__str{};
7310 if (InviteCoverImage.has_value()) {
7311 InviteCoverImage__str.ptr =
7312 (uint8_t*)(InviteCoverImage->data() !=
nullptr ? InviteCoverImage->data() :
"");
7313 InviteCoverImage__str.size = InviteCoverImage->size();
7315 Discord_ActivityAssets_SetInviteCoverImage(
7316 &instance_, (InviteCoverImage.has_value() ? &InviteCoverImage__str :
nullptr));
7318const ActivityTimestamps ActivityTimestamps::nullobj{{}, DiscordObjectState::Invalid};
7319ActivityTimestamps::~ActivityTimestamps()
7321 if (state_ == DiscordObjectState::Owned) {
7323 state_ = DiscordObjectState::Invalid;
7326ActivityTimestamps::ActivityTimestamps(ActivityTimestamps&& other) noexcept
7327 : instance_(other.instance_)
7328 , state_(other.state_)
7330 other.state_ = DiscordObjectState::Invalid;
7332ActivityTimestamps& ActivityTimestamps::operator=(ActivityTimestamps&& other)
noexcept
7334 if (
this != &other) {
7335 if (state_ == DiscordObjectState::Owned) {
7338 instance_ = other.instance_;
7339 state_ = other.state_;
7340 other.state_ = DiscordObjectState::Invalid;
7344ActivityTimestamps::ActivityTimestamps(
const ActivityTimestamps& arg0)
7349 Discord_ActivityTimestamps_Clone(&instance_, arg0.instance());
7351 state_ = DiscordObjectState::Owned;
7354ActivityTimestamps& ActivityTimestamps::operator=(
const ActivityTimestamps& arg0)
7356 if (
this != &arg0) {
7357 if (state_ == DiscordObjectState::Owned) {
7359 state_ = DiscordObjectState::Invalid;
7361 if (arg0.state_ == DiscordObjectState::Owned) {
7362 Discord_ActivityTimestamps_Clone(&instance_, arg0.instance());
7364 state_ = DiscordObjectState::Owned;
7369ActivityTimestamps::ActivityTimestamps(Discord_ActivityTimestamps instance,
7370 DiscordObjectState state)
7371 : instance_(instance)
7375ActivityTimestamps::ActivityTimestamps()
7377 assert(state_ == DiscordObjectState::Invalid);
7378 Discord_ActivityTimestamps_Init(&instance_);
7379 state_ = DiscordObjectState::Owned;
7381void ActivityTimestamps::Drop()
7383 if (state_ != DiscordObjectState::Owned) {
7386 Discord_ActivityTimestamps_Drop(&instance_);
7387 state_ = DiscordObjectState::Invalid;
7389uint64_t ActivityTimestamps::Start()
const
7391 assert(state_ == DiscordObjectState::Owned);
7392 uint64_t returnValue__;
7393 returnValue__ = Discord_ActivityTimestamps_Start(&instance_);
7394 return returnValue__;
7396void ActivityTimestamps::SetStart(uint64_t Start)
7398 assert(state_ == DiscordObjectState::Owned);
7399 Discord_ActivityTimestamps_SetStart(&instance_, Start);
7401uint64_t ActivityTimestamps::End()
const
7403 assert(state_ == DiscordObjectState::Owned);
7404 uint64_t returnValue__;
7405 returnValue__ = Discord_ActivityTimestamps_End(&instance_);
7406 return returnValue__;
7408void ActivityTimestamps::SetEnd(uint64_t End)
7410 assert(state_ == DiscordObjectState::Owned);
7411 Discord_ActivityTimestamps_SetEnd(&instance_, End);
7413const ActivityParty ActivityParty::nullobj{{}, DiscordObjectState::Invalid};
7414ActivityParty::~ActivityParty()
7416 if (state_ == DiscordObjectState::Owned) {
7418 state_ = DiscordObjectState::Invalid;
7421ActivityParty::ActivityParty(ActivityParty&& other) noexcept
7422 : instance_(other.instance_)
7423 , state_(other.state_)
7425 other.state_ = DiscordObjectState::Invalid;
7427ActivityParty& ActivityParty::operator=(ActivityParty&& other)
noexcept
7429 if (
this != &other) {
7430 if (state_ == DiscordObjectState::Owned) {
7433 instance_ = other.instance_;
7434 state_ = other.state_;
7435 other.state_ = DiscordObjectState::Invalid;
7439ActivityParty::ActivityParty(
const ActivityParty& arg0)
7444 Discord_ActivityParty_Clone(&instance_, arg0.instance());
7446 state_ = DiscordObjectState::Owned;
7449ActivityParty& ActivityParty::operator=(
const ActivityParty& arg0)
7451 if (
this != &arg0) {
7452 if (state_ == DiscordObjectState::Owned) {
7454 state_ = DiscordObjectState::Invalid;
7456 if (arg0.state_ == DiscordObjectState::Owned) {
7457 Discord_ActivityParty_Clone(&instance_, arg0.instance());
7459 state_ = DiscordObjectState::Owned;
7464ActivityParty::ActivityParty(Discord_ActivityParty instance, DiscordObjectState state)
7465 : instance_(instance)
7469ActivityParty::ActivityParty()
7471 assert(state_ == DiscordObjectState::Invalid);
7472 Discord_ActivityParty_Init(&instance_);
7473 state_ = DiscordObjectState::Owned;
7475void ActivityParty::Drop()
7477 if (state_ != DiscordObjectState::Owned) {
7480 Discord_ActivityParty_Drop(&instance_);
7481 state_ = DiscordObjectState::Invalid;
7485 assert(state_ == DiscordObjectState::Owned);
7486 Discord_String returnValueNative__;
7487 Discord_ActivityParty_Id(&instance_, &returnValueNative__);
7488 discordpp::String returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7489 returnValueNative__.size);
7490 Discord_Free(returnValueNative__.ptr);
7491 return returnValue__;
7493void ActivityParty::SetId(std::string_view Id)
7495 assert(state_ == DiscordObjectState::Owned);
7496 Discord_String Id__str{(uint8_t*)(Id.data() !=
nullptr ? Id.data() :
""), Id.size()};
7497 Discord_ActivityParty_SetId(&instance_, Id__str);
7499int32_t ActivityParty::CurrentSize()
const
7501 assert(state_ == DiscordObjectState::Owned);
7502 int32_t returnValue__;
7503 returnValue__ = Discord_ActivityParty_CurrentSize(&instance_);
7504 return returnValue__;
7506void ActivityParty::SetCurrentSize(int32_t CurrentSize)
7508 assert(state_ == DiscordObjectState::Owned);
7509 Discord_ActivityParty_SetCurrentSize(&instance_, CurrentSize);
7511int32_t ActivityParty::MaxSize()
const
7513 assert(state_ == DiscordObjectState::Owned);
7514 int32_t returnValue__;
7515 returnValue__ = Discord_ActivityParty_MaxSize(&instance_);
7516 return returnValue__;
7518void ActivityParty::SetMaxSize(int32_t MaxSize)
7520 assert(state_ == DiscordObjectState::Owned);
7521 Discord_ActivityParty_SetMaxSize(&instance_, MaxSize);
7525 assert(state_ == DiscordObjectState::Owned);
7526 Discord_ActivityPartyPrivacy returnValue__;
7527 returnValue__ = Discord_ActivityParty_Privacy(&instance_);
7532 assert(state_ == DiscordObjectState::Owned);
7533 Discord_ActivityParty_SetPrivacy(&instance_,
7534 static_cast<Discord_ActivityPartyPrivacy
>(Privacy));
7536const ActivitySecrets ActivitySecrets::nullobj{{}, DiscordObjectState::Invalid};
7537ActivitySecrets::~ActivitySecrets()
7539 if (state_ == DiscordObjectState::Owned) {
7541 state_ = DiscordObjectState::Invalid;
7544ActivitySecrets::ActivitySecrets(ActivitySecrets&& other) noexcept
7545 : instance_(other.instance_)
7546 , state_(other.state_)
7548 other.state_ = DiscordObjectState::Invalid;
7550ActivitySecrets& ActivitySecrets::operator=(ActivitySecrets&& other)
noexcept
7552 if (
this != &other) {
7553 if (state_ == DiscordObjectState::Owned) {
7556 instance_ = other.instance_;
7557 state_ = other.state_;
7558 other.state_ = DiscordObjectState::Invalid;
7562ActivitySecrets::ActivitySecrets(
const ActivitySecrets& arg0)
7567 Discord_ActivitySecrets_Clone(&instance_, arg0.instance());
7569 state_ = DiscordObjectState::Owned;
7572ActivitySecrets& ActivitySecrets::operator=(
const ActivitySecrets& arg0)
7574 if (
this != &arg0) {
7575 if (state_ == DiscordObjectState::Owned) {
7577 state_ = DiscordObjectState::Invalid;
7579 if (arg0.state_ == DiscordObjectState::Owned) {
7580 Discord_ActivitySecrets_Clone(&instance_, arg0.instance());
7582 state_ = DiscordObjectState::Owned;
7587ActivitySecrets::ActivitySecrets(Discord_ActivitySecrets instance, DiscordObjectState state)
7588 : instance_(instance)
7592ActivitySecrets::ActivitySecrets()
7594 assert(state_ == DiscordObjectState::Invalid);
7595 Discord_ActivitySecrets_Init(&instance_);
7596 state_ = DiscordObjectState::Owned;
7598void ActivitySecrets::Drop()
7600 if (state_ != DiscordObjectState::Owned) {
7603 Discord_ActivitySecrets_Drop(&instance_);
7604 state_ = DiscordObjectState::Invalid;
7608 assert(state_ == DiscordObjectState::Owned);
7609 Discord_String returnValueNative__;
7610 Discord_ActivitySecrets_Join(&instance_, &returnValueNative__);
7611 discordpp::String returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7612 returnValueNative__.size);
7613 Discord_Free(returnValueNative__.ptr);
7614 return returnValue__;
7616void ActivitySecrets::SetJoin(std::string_view Join)
7618 assert(state_ == DiscordObjectState::Owned);
7619 Discord_String Join__str{(uint8_t*)(
Join.data() !=
nullptr ?
Join.data() :
""),
Join.size()};
7620 Discord_ActivitySecrets_SetJoin(&instance_, Join__str);
7622const ActivityButton ActivityButton::nullobj{{}, DiscordObjectState::Invalid};
7623ActivityButton::~ActivityButton()
7625 if (state_ == DiscordObjectState::Owned) {
7627 state_ = DiscordObjectState::Invalid;
7630ActivityButton::ActivityButton(ActivityButton&& other) noexcept
7631 : instance_(other.instance_)
7632 , state_(other.state_)
7634 other.state_ = DiscordObjectState::Invalid;
7636ActivityButton& ActivityButton::operator=(ActivityButton&& other)
noexcept
7638 if (
this != &other) {
7639 if (state_ == DiscordObjectState::Owned) {
7642 instance_ = other.instance_;
7643 state_ = other.state_;
7644 other.state_ = DiscordObjectState::Invalid;
7648ActivityButton::ActivityButton(
const ActivityButton& arg0)
7653 Discord_ActivityButton_Clone(&instance_, arg0.instance());
7655 state_ = DiscordObjectState::Owned;
7658ActivityButton& ActivityButton::operator=(
const ActivityButton& arg0)
7660 if (
this != &arg0) {
7661 if (state_ == DiscordObjectState::Owned) {
7663 state_ = DiscordObjectState::Invalid;
7665 if (arg0.state_ == DiscordObjectState::Owned) {
7666 Discord_ActivityButton_Clone(&instance_, arg0.instance());
7668 state_ = DiscordObjectState::Owned;
7673ActivityButton::ActivityButton(Discord_ActivityButton instance, DiscordObjectState state)
7674 : instance_(instance)
7678ActivityButton::ActivityButton()
7680 assert(state_ == DiscordObjectState::Invalid);
7681 Discord_ActivityButton_Init(&instance_);
7682 state_ = DiscordObjectState::Owned;
7684void ActivityButton::Drop()
7686 if (state_ != DiscordObjectState::Owned) {
7689 Discord_ActivityButton_Drop(&instance_);
7690 state_ = DiscordObjectState::Invalid;
7694 assert(state_ == DiscordObjectState::Owned);
7695 Discord_String returnValueNative__;
7696 Discord_ActivityButton_Label(&instance_, &returnValueNative__);
7697 discordpp::String returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7698 returnValueNative__.size);
7699 Discord_Free(returnValueNative__.ptr);
7700 return returnValue__;
7702void ActivityButton::SetLabel(std::string_view Label)
7704 assert(state_ == DiscordObjectState::Owned);
7705 Discord_String Label__str{(uint8_t*)(Label.data() !=
nullptr ? Label.data() :
""),
7707 Discord_ActivityButton_SetLabel(&instance_, Label__str);
7711 assert(state_ == DiscordObjectState::Owned);
7712 Discord_String returnValueNative__;
7713 Discord_ActivityButton_Url(&instance_, &returnValueNative__);
7714 discordpp::String returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7715 returnValueNative__.size);
7716 Discord_Free(returnValueNative__.ptr);
7717 return returnValue__;
7719void ActivityButton::SetUrl(std::string_view Url)
7721 assert(state_ == DiscordObjectState::Owned);
7722 Discord_String Url__str{(uint8_t*)(Url.data() !=
nullptr ? Url.data() :
""), Url.size()};
7723 Discord_ActivityButton_SetUrl(&instance_, Url__str);
7725const Activity Activity::nullobj{{}, DiscordObjectState::Invalid};
7726Activity::~Activity()
7728 if (state_ == DiscordObjectState::Owned) {
7730 state_ = DiscordObjectState::Invalid;
7733Activity::Activity(Activity&& other) noexcept
7734 : instance_(other.instance_)
7735 , state_(other.state_)
7737 other.state_ = DiscordObjectState::Invalid;
7739Activity& Activity::operator=(Activity&& other)
noexcept
7741 if (
this != &other) {
7742 if (state_ == DiscordObjectState::Owned) {
7745 instance_ = other.instance_;
7746 state_ = other.state_;
7747 other.state_ = DiscordObjectState::Invalid;
7751Activity::Activity(
const Activity& arg0)
7756 Discord_Activity_Clone(&instance_, arg0.instance());
7758 state_ = DiscordObjectState::Owned;
7761Activity& Activity::operator=(
const Activity& arg0)
7763 if (
this != &arg0) {
7764 if (state_ == DiscordObjectState::Owned) {
7766 state_ = DiscordObjectState::Invalid;
7768 if (arg0.state_ == DiscordObjectState::Owned) {
7769 Discord_Activity_Clone(&instance_, arg0.instance());
7771 state_ = DiscordObjectState::Owned;
7776Activity::Activity(Discord_Activity instance, DiscordObjectState state)
7777 : instance_(instance)
7783 assert(state_ == DiscordObjectState::Invalid);
7784 Discord_Activity_Init(&instance_);
7785 state_ = DiscordObjectState::Owned;
7787void Activity::Drop()
7789 if (state_ != DiscordObjectState::Owned) {
7792 Discord_Activity_Drop(&instance_);
7793 state_ = DiscordObjectState::Invalid;
7797 assert(state_ == DiscordObjectState::Owned);
7798 Discord_Activity_AddButton(&instance_, button.instance());
7802 assert(state_ == DiscordObjectState::Owned);
7804 returnValue__ = Discord_Activity_Equals(&instance_, other.instance());
7805 return returnValue__;
7809 assert(state_ == DiscordObjectState::Owned);
7810 Discord_ActivityButtonSpan returnValueNative__;
7811 Discord_Activity_GetButtons(&instance_, &returnValueNative__);
7813 returnValue__.reserve(returnValueNative__.size);
7814 for (
size_t i__ = 0; i__ < returnValueNative__.size; ++i__) {
7815 returnValue__.emplace_back(returnValueNative__.ptr[i__], DiscordObjectState::Owned);
7817 Discord_Free(returnValueNative__.ptr);
7818 return returnValue__;
7822 assert(state_ == DiscordObjectState::Owned);
7823 Discord_String returnValueNative__;
7824 Discord_Activity_Name(&instance_, &returnValueNative__);
7825 discordpp::String returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7826 returnValueNative__.size);
7827 Discord_Free(returnValueNative__.ptr);
7828 return returnValue__;
7830void Activity::SetName(std::string_view Name)
7832 assert(state_ == DiscordObjectState::Owned);
7833 Discord_String Name__str{(uint8_t*)(
Name.data() !=
nullptr ?
Name.data() :
""),
Name.size()};
7834 Discord_Activity_SetName(&instance_, Name__str);
7838 assert(state_ == DiscordObjectState::Owned);
7839 Discord_ActivityTypes returnValue__;
7840 returnValue__ = Discord_Activity_Type(&instance_);
7845 assert(state_ == DiscordObjectState::Owned);
7846 Discord_Activity_SetType(&instance_,
static_cast<Discord_ActivityTypes
>(Type));
7848std::optional<discordpp::StatusDisplayTypes> Activity::StatusDisplayType()
const
7850 assert(state_ == DiscordObjectState::Owned);
7851 bool returnIsNonNull__;
7852 Discord_StatusDisplayTypes returnValueNative__;
7853 returnIsNonNull__ = Discord_Activity_StatusDisplayType(&instance_, &returnValueNative__);
7854 if (!returnIsNonNull__) {
7858 return returnValue__;
7860void Activity::SetStatusDisplayType(std::optional<discordpp::StatusDisplayTypes> StatusDisplayType)
7862 assert(state_ == DiscordObjectState::Owned);
7863 Discord_Activity_SetStatusDisplayType(
7865 (StatusDisplayType.has_value()
7866 ?
reinterpret_cast<Discord_StatusDisplayTypes*
>(&*StatusDisplayType)
7869std::optional<discordpp::String> Activity::State()
const
7871 assert(state_ == DiscordObjectState::Owned);
7872 bool returnIsNonNull__;
7873 Discord_String returnValueNative__;
7874 returnIsNonNull__ = Discord_Activity_State(&instance_, &returnValueNative__);
7875 if (!returnIsNonNull__) {
7878 discordpp::String returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7879 returnValueNative__.size);
7880 Discord_Free(returnValueNative__.ptr);
7881 return returnValue__;
7883void Activity::SetState(std::optional<std::string_view> State)
7885 assert(state_ == DiscordObjectState::Owned);
7886 Discord_String State__str{};
7887 if (
State.has_value()) {
7888 State__str.ptr = (uint8_t*)(
State->data() !=
nullptr ?
State->data() :
"");
7889 State__str.size =
State->size();
7891 Discord_Activity_SetState(&instance_, (
State.has_value() ? &State__str :
nullptr));
7893std::optional<discordpp::String> Activity::StateUrl()
const
7895 assert(state_ == DiscordObjectState::Owned);
7896 bool returnIsNonNull__;
7897 Discord_String returnValueNative__;
7898 returnIsNonNull__ = Discord_Activity_StateUrl(&instance_, &returnValueNative__);
7899 if (!returnIsNonNull__) {
7902 discordpp::String returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7903 returnValueNative__.size);
7904 Discord_Free(returnValueNative__.ptr);
7905 return returnValue__;
7907void Activity::SetStateUrl(std::optional<std::string_view> StateUrl)
7909 assert(state_ == DiscordObjectState::Owned);
7910 Discord_String StateUrl__str{};
7911 if (StateUrl.has_value()) {
7912 StateUrl__str.ptr = (uint8_t*)(StateUrl->data() !=
nullptr ? StateUrl->data() :
"");
7913 StateUrl__str.size = StateUrl->size();
7915 Discord_Activity_SetStateUrl(&instance_, (StateUrl.has_value() ? &StateUrl__str :
nullptr));
7917std::optional<discordpp::String> Activity::Details()
const
7919 assert(state_ == DiscordObjectState::Owned);
7920 bool returnIsNonNull__;
7921 Discord_String returnValueNative__;
7922 returnIsNonNull__ = Discord_Activity_Details(&instance_, &returnValueNative__);
7923 if (!returnIsNonNull__) {
7926 discordpp::String returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7927 returnValueNative__.size);
7928 Discord_Free(returnValueNative__.ptr);
7929 return returnValue__;
7931void Activity::SetDetails(std::optional<std::string_view> Details)
7933 assert(state_ == DiscordObjectState::Owned);
7934 Discord_String Details__str{};
7936 Details__str.ptr = (uint8_t*)(
Details->data() !=
nullptr ?
Details->data() :
"");
7937 Details__str.size =
Details->size();
7939 Discord_Activity_SetDetails(&instance_, (
Details.has_value() ? &Details__str :
nullptr));
7941std::optional<discordpp::String> Activity::DetailsUrl()
const
7943 assert(state_ == DiscordObjectState::Owned);
7944 bool returnIsNonNull__;
7945 Discord_String returnValueNative__;
7946 returnIsNonNull__ = Discord_Activity_DetailsUrl(&instance_, &returnValueNative__);
7947 if (!returnIsNonNull__) {
7950 discordpp::String returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
7951 returnValueNative__.size);
7952 Discord_Free(returnValueNative__.ptr);
7953 return returnValue__;
7955void Activity::SetDetailsUrl(std::optional<std::string_view> DetailsUrl)
7957 assert(state_ == DiscordObjectState::Owned);
7958 Discord_String DetailsUrl__str{};
7959 if (DetailsUrl.has_value()) {
7960 DetailsUrl__str.ptr = (uint8_t*)(DetailsUrl->data() !=
nullptr ? DetailsUrl->data() :
"");
7961 DetailsUrl__str.size = DetailsUrl->size();
7963 Discord_Activity_SetDetailsUrl(&instance_,
7964 (DetailsUrl.has_value() ? &DetailsUrl__str :
nullptr));
7966std::optional<uint64_t> Activity::ApplicationId()
const
7968 assert(state_ == DiscordObjectState::Owned);
7969 bool returnIsNonNull__;
7970 uint64_t returnValue__;
7971 returnIsNonNull__ = Discord_Activity_ApplicationId(&instance_, &returnValue__);
7972 if (!returnIsNonNull__) {
7973 return std::nullopt;
7975 return returnValue__;
7977void Activity::SetApplicationId(std::optional<uint64_t> ApplicationId)
7979 assert(state_ == DiscordObjectState::Owned);
7980 Discord_Activity_SetApplicationId(&instance_,
7981 (ApplicationId.has_value() ? &*ApplicationId :
nullptr));
7983std::optional<uint64_t> Activity::ParentApplicationId()
const
7985 assert(state_ == DiscordObjectState::Owned);
7986 bool returnIsNonNull__;
7987 uint64_t returnValue__;
7988 returnIsNonNull__ = Discord_Activity_ParentApplicationId(&instance_, &returnValue__);
7989 if (!returnIsNonNull__) {
7990 return std::nullopt;
7992 return returnValue__;
7994void Activity::SetParentApplicationId(std::optional<uint64_t> ParentApplicationId)
7996 assert(state_ == DiscordObjectState::Owned);
7997 Discord_Activity_SetParentApplicationId(
7998 &instance_, (ParentApplicationId.has_value() ? &*ParentApplicationId :
nullptr));
8000std::optional<discordpp::ActivityAssets> Activity::Assets()
const
8002 assert(state_ == DiscordObjectState::Owned);
8003 bool returnIsNonNull__;
8004 Discord_ActivityAssets returnValueNative__;
8005 returnIsNonNull__ = Discord_Activity_Assets(&instance_, &returnValueNative__);
8006 if (!returnIsNonNull__) {
8010 return returnValue__;
8012void Activity::SetAssets(std::optional<discordpp::ActivityAssets> Assets)
8014 assert(state_ == DiscordObjectState::Owned);
8015 Discord_Activity_SetAssets(&instance_, (Assets.has_value() ? Assets->instance() :
nullptr));
8017std::optional<discordpp::ActivityTimestamps> Activity::Timestamps()
const
8019 assert(state_ == DiscordObjectState::Owned);
8020 bool returnIsNonNull__;
8021 Discord_ActivityTimestamps returnValueNative__;
8022 returnIsNonNull__ = Discord_Activity_Timestamps(&instance_, &returnValueNative__);
8023 if (!returnIsNonNull__) {
8027 return returnValue__;
8029void Activity::SetTimestamps(std::optional<discordpp::ActivityTimestamps> Timestamps)
8031 assert(state_ == DiscordObjectState::Owned);
8032 Discord_Activity_SetTimestamps(&instance_,
8033 (Timestamps.has_value() ? Timestamps->instance() :
nullptr));
8035std::optional<discordpp::ActivityParty> Activity::Party()
const
8037 assert(state_ == DiscordObjectState::Owned);
8038 bool returnIsNonNull__;
8039 Discord_ActivityParty returnValueNative__;
8040 returnIsNonNull__ = Discord_Activity_Party(&instance_, &returnValueNative__);
8041 if (!returnIsNonNull__) {
8045 return returnValue__;
8047void Activity::SetParty(std::optional<discordpp::ActivityParty> Party)
8049 assert(state_ == DiscordObjectState::Owned);
8050 Discord_Activity_SetParty(&instance_, (Party.has_value() ? Party->instance() :
nullptr));
8052std::optional<discordpp::ActivitySecrets> Activity::Secrets()
const
8054 assert(state_ == DiscordObjectState::Owned);
8055 bool returnIsNonNull__;
8056 Discord_ActivitySecrets returnValueNative__;
8057 returnIsNonNull__ = Discord_Activity_Secrets(&instance_, &returnValueNative__);
8058 if (!returnIsNonNull__) {
8062 return returnValue__;
8064void Activity::SetSecrets(std::optional<discordpp::ActivitySecrets> Secrets)
8066 assert(state_ == DiscordObjectState::Owned);
8067 Discord_Activity_SetSecrets(&instance_, (Secrets.has_value() ? Secrets->instance() :
nullptr));
8071 assert(state_ == DiscordObjectState::Owned);
8072 Discord_ActivityGamePlatforms returnValue__;
8073 returnValue__ = Discord_Activity_SupportedPlatforms(&instance_);
8078 assert(state_ == DiscordObjectState::Owned);
8079 Discord_Activity_SetSupportedPlatforms(
8080 &instance_,
static_cast<Discord_ActivityGamePlatforms
>(SupportedPlatforms));
8082const ClientResult ClientResult::nullobj{{}, DiscordObjectState::Invalid};
8083ClientResult::~ClientResult()
8085 if (state_ == DiscordObjectState::Owned) {
8087 state_ = DiscordObjectState::Invalid;
8090ClientResult::ClientResult(ClientResult&& other) noexcept
8091 : instance_(other.instance_)
8092 , state_(other.state_)
8094 other.state_ = DiscordObjectState::Invalid;
8096ClientResult& ClientResult::operator=(ClientResult&& other)
noexcept
8098 if (
this != &other) {
8099 if (state_ == DiscordObjectState::Owned) {
8102 instance_ = other.instance_;
8103 state_ = other.state_;
8104 other.state_ = DiscordObjectState::Invalid;
8108ClientResult::ClientResult(
const ClientResult& arg0)
8113 Discord_ClientResult_Clone(&instance_, arg0.instance());
8115 state_ = DiscordObjectState::Owned;
8118ClientResult& ClientResult::operator=(
const ClientResult& arg0)
8120 if (
this != &arg0) {
8121 if (state_ == DiscordObjectState::Owned) {
8123 state_ = DiscordObjectState::Invalid;
8125 if (arg0.state_ == DiscordObjectState::Owned) {
8126 Discord_ClientResult_Clone(&instance_, arg0.instance());
8128 state_ = DiscordObjectState::Owned;
8133ClientResult::ClientResult(Discord_ClientResult instance, DiscordObjectState state)
8134 : instance_(instance)
8138void ClientResult::Drop()
8140 if (state_ != DiscordObjectState::Owned) {
8143 Discord_ClientResult_Drop(&instance_);
8144 state_ = DiscordObjectState::Invalid;
8148 assert(state_ == DiscordObjectState::Owned);
8149 Discord_String returnValueNative__;
8150 Discord_ClientResult_ToString(&instance_, &returnValueNative__);
8151 discordpp::String returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
8152 returnValueNative__.size);
8153 Discord_Free(returnValueNative__.ptr);
8154 return returnValue__;
8158 assert(state_ == DiscordObjectState::Owned);
8159 Discord_ErrorType returnValue__;
8160 returnValue__ = Discord_ClientResult_Type(&instance_);
8165 assert(state_ == DiscordObjectState::Owned);
8166 Discord_ClientResult_SetType(&instance_,
static_cast<Discord_ErrorType
>(Type));
8170 assert(state_ == DiscordObjectState::Owned);
8171 Discord_String returnValueNative__;
8172 Discord_ClientResult_Error(&instance_, &returnValueNative__);
8173 discordpp::String returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
8174 returnValueNative__.size);
8175 Discord_Free(returnValueNative__.ptr);
8176 return returnValue__;
8178void ClientResult::SetError(std::string_view Error)
8180 assert(state_ == DiscordObjectState::Owned);
8181 Discord_String Error__str{(uint8_t*)(
Error.data() !=
nullptr ?
Error.data() :
""),
8183 Discord_ClientResult_SetError(&instance_, Error__str);
8185int32_t ClientResult::ErrorCode()
const
8187 assert(state_ == DiscordObjectState::Owned);
8188 int32_t returnValue__;
8189 returnValue__ = Discord_ClientResult_ErrorCode(&instance_);
8190 return returnValue__;
8192void ClientResult::SetErrorCode(int32_t ErrorCode)
8194 assert(state_ == DiscordObjectState::Owned);
8195 Discord_ClientResult_SetErrorCode(&instance_, ErrorCode);
8199 assert(state_ == DiscordObjectState::Owned);
8200 Discord_HttpStatusCode returnValue__;
8201 returnValue__ = Discord_ClientResult_Status(&instance_);
8206 assert(state_ == DiscordObjectState::Owned);
8207 Discord_ClientResult_SetStatus(&instance_,
static_cast<Discord_HttpStatusCode
>(Status));
8211 assert(state_ == DiscordObjectState::Owned);
8212 Discord_String returnValueNative__;
8213 Discord_ClientResult_ResponseBody(&instance_, &returnValueNative__);
8214 discordpp::String returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
8215 returnValueNative__.size);
8216 Discord_Free(returnValueNative__.ptr);
8217 return returnValue__;
8219void ClientResult::SetResponseBody(std::string_view ResponseBody)
8221 assert(state_ == DiscordObjectState::Owned);
8222 Discord_String ResponseBody__str{
8223 (uint8_t*)(ResponseBody.data() !=
nullptr ? ResponseBody.data() :
""), ResponseBody.size()};
8224 Discord_ClientResult_SetResponseBody(&instance_, ResponseBody__str);
8226bool ClientResult::Successful()
const
8228 assert(state_ == DiscordObjectState::Owned);
8230 returnValue__ = Discord_ClientResult_Successful(&instance_);
8231 return returnValue__;
8233void ClientResult::SetSuccessful(
bool Successful)
8235 assert(state_ == DiscordObjectState::Owned);
8236 Discord_ClientResult_SetSuccessful(&instance_, Successful);
8238bool ClientResult::Retryable()
const
8240 assert(state_ == DiscordObjectState::Owned);
8242 returnValue__ = Discord_ClientResult_Retryable(&instance_);
8243 return returnValue__;
8245void ClientResult::SetRetryable(
bool Retryable)
8247 assert(state_ == DiscordObjectState::Owned);
8248 Discord_ClientResult_SetRetryable(&instance_, Retryable);
8250float ClientResult::RetryAfter()
const
8252 assert(state_ == DiscordObjectState::Owned);
8253 float returnValue__;
8254 returnValue__ = Discord_ClientResult_RetryAfter(&instance_);
8255 return returnValue__;
8257void ClientResult::SetRetryAfter(
float RetryAfter)
8259 assert(state_ == DiscordObjectState::Owned);
8260 Discord_ClientResult_SetRetryAfter(&instance_, RetryAfter);
8262const AuthorizationCodeChallenge AuthorizationCodeChallenge::nullobj{{},
8263 DiscordObjectState::Invalid};
8264AuthorizationCodeChallenge::~AuthorizationCodeChallenge()
8266 if (state_ == DiscordObjectState::Owned) {
8268 state_ = DiscordObjectState::Invalid;
8271AuthorizationCodeChallenge::AuthorizationCodeChallenge(AuthorizationCodeChallenge&& other) noexcept
8272 : instance_(other.instance_)
8273 , state_(other.state_)
8275 other.state_ = DiscordObjectState::Invalid;
8277AuthorizationCodeChallenge& AuthorizationCodeChallenge::operator=(
8278 AuthorizationCodeChallenge&& other)
noexcept
8280 if (
this != &other) {
8281 if (state_ == DiscordObjectState::Owned) {
8284 instance_ = other.instance_;
8285 state_ = other.state_;
8286 other.state_ = DiscordObjectState::Invalid;
8290AuthorizationCodeChallenge::AuthorizationCodeChallenge(
const AuthorizationCodeChallenge& arg0)
8295 Discord_AuthorizationCodeChallenge_Clone(&instance_, arg0.instance());
8297 state_ = DiscordObjectState::Owned;
8300AuthorizationCodeChallenge& AuthorizationCodeChallenge::operator=(
8301 const AuthorizationCodeChallenge& arg0)
8303 if (
this != &arg0) {
8304 if (state_ == DiscordObjectState::Owned) {
8306 state_ = DiscordObjectState::Invalid;
8308 if (arg0.state_ == DiscordObjectState::Owned) {
8309 Discord_AuthorizationCodeChallenge_Clone(&instance_, arg0.instance());
8311 state_ = DiscordObjectState::Owned;
8316AuthorizationCodeChallenge::AuthorizationCodeChallenge(Discord_AuthorizationCodeChallenge instance,
8317 DiscordObjectState state)
8318 : instance_(instance)
8322AuthorizationCodeChallenge::AuthorizationCodeChallenge()
8324 assert(state_ == DiscordObjectState::Invalid);
8325 Discord_AuthorizationCodeChallenge_Init(&instance_);
8326 state_ = DiscordObjectState::Owned;
8328void AuthorizationCodeChallenge::Drop()
8330 if (state_ != DiscordObjectState::Owned) {
8333 Discord_AuthorizationCodeChallenge_Drop(&instance_);
8334 state_ = DiscordObjectState::Invalid;
8338 assert(state_ == DiscordObjectState::Owned);
8339 Discord_AuthenticationCodeChallengeMethod returnValue__;
8340 returnValue__ = Discord_AuthorizationCodeChallenge_Method(&instance_);
8345 assert(state_ == DiscordObjectState::Owned);
8346 Discord_AuthorizationCodeChallenge_SetMethod(
8347 &instance_,
static_cast<Discord_AuthenticationCodeChallengeMethod
>(Method));
8351 assert(state_ == DiscordObjectState::Owned);
8352 Discord_String returnValueNative__;
8353 Discord_AuthorizationCodeChallenge_Challenge(&instance_, &returnValueNative__);
8354 discordpp::String returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
8355 returnValueNative__.size);
8356 Discord_Free(returnValueNative__.ptr);
8357 return returnValue__;
8359void AuthorizationCodeChallenge::SetChallenge(std::string_view Challenge)
8361 assert(state_ == DiscordObjectState::Owned);
8362 Discord_String Challenge__str{(uint8_t*)(Challenge.data() !=
nullptr ? Challenge.data() :
""),
8364 Discord_AuthorizationCodeChallenge_SetChallenge(&instance_, Challenge__str);
8366const AuthorizationCodeVerifier AuthorizationCodeVerifier::nullobj{{}, DiscordObjectState::Invalid};
8367AuthorizationCodeVerifier::~AuthorizationCodeVerifier()
8369 if (state_ == DiscordObjectState::Owned) {
8371 state_ = DiscordObjectState::Invalid;
8374AuthorizationCodeVerifier::AuthorizationCodeVerifier(AuthorizationCodeVerifier&& other) noexcept
8375 : instance_(other.instance_)
8376 , state_(other.state_)
8378 other.state_ = DiscordObjectState::Invalid;
8380AuthorizationCodeVerifier& AuthorizationCodeVerifier::operator=(
8381 AuthorizationCodeVerifier&& other)
noexcept
8383 if (
this != &other) {
8384 if (state_ == DiscordObjectState::Owned) {
8387 instance_ = other.instance_;
8388 state_ = other.state_;
8389 other.state_ = DiscordObjectState::Invalid;
8393AuthorizationCodeVerifier::AuthorizationCodeVerifier(
const AuthorizationCodeVerifier& arg0)
8398 Discord_AuthorizationCodeVerifier_Clone(&instance_, arg0.instance());
8400 state_ = DiscordObjectState::Owned;
8403AuthorizationCodeVerifier& AuthorizationCodeVerifier::operator=(
8404 const AuthorizationCodeVerifier& arg0)
8406 if (
this != &arg0) {
8407 if (state_ == DiscordObjectState::Owned) {
8409 state_ = DiscordObjectState::Invalid;
8411 if (arg0.state_ == DiscordObjectState::Owned) {
8412 Discord_AuthorizationCodeVerifier_Clone(&instance_, arg0.instance());
8414 state_ = DiscordObjectState::Owned;
8419AuthorizationCodeVerifier::AuthorizationCodeVerifier(Discord_AuthorizationCodeVerifier instance,
8420 DiscordObjectState state)
8421 : instance_(instance)
8425void AuthorizationCodeVerifier::Drop()
8427 if (state_ != DiscordObjectState::Owned) {
8430 Discord_AuthorizationCodeVerifier_Drop(&instance_);
8431 state_ = DiscordObjectState::Invalid;
8435 assert(state_ == DiscordObjectState::Owned);
8436 Discord_AuthorizationCodeChallenge returnValueNative__{};
8437 Discord_AuthorizationCodeVerifier_Challenge(&instance_, &returnValueNative__);
8439 DiscordObjectState::Owned);
8440 return returnValue__;
8444 assert(state_ == DiscordObjectState::Owned);
8445 Discord_AuthorizationCodeVerifier_SetChallenge(&instance_, Challenge.instance());
8449 assert(state_ == DiscordObjectState::Owned);
8450 Discord_String returnValueNative__;
8451 Discord_AuthorizationCodeVerifier_Verifier(&instance_, &returnValueNative__);
8452 discordpp::String returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
8453 returnValueNative__.size);
8454 Discord_Free(returnValueNative__.ptr);
8455 return returnValue__;
8457void AuthorizationCodeVerifier::SetVerifier(std::string_view Verifier)
8459 assert(state_ == DiscordObjectState::Owned);
8460 Discord_String Verifier__str{(uint8_t*)(Verifier.data() !=
nullptr ? Verifier.data() :
""),
8462 Discord_AuthorizationCodeVerifier_SetVerifier(&instance_, Verifier__str);
8464const AuthorizationArgs AuthorizationArgs::nullobj{{}, DiscordObjectState::Invalid};
8465AuthorizationArgs::~AuthorizationArgs()
8467 if (state_ == DiscordObjectState::Owned) {
8469 state_ = DiscordObjectState::Invalid;
8472AuthorizationArgs::AuthorizationArgs(AuthorizationArgs&& other) noexcept
8473 : instance_(other.instance_)
8474 , state_(other.state_)
8476 other.state_ = DiscordObjectState::Invalid;
8478AuthorizationArgs& AuthorizationArgs::operator=(AuthorizationArgs&& other)
noexcept
8480 if (
this != &other) {
8481 if (state_ == DiscordObjectState::Owned) {
8484 instance_ = other.instance_;
8485 state_ = other.state_;
8486 other.state_ = DiscordObjectState::Invalid;
8490AuthorizationArgs::AuthorizationArgs(
const AuthorizationArgs& arg0)
8495 Discord_AuthorizationArgs_Clone(&instance_, arg0.instance());
8497 state_ = DiscordObjectState::Owned;
8500AuthorizationArgs& AuthorizationArgs::operator=(
const AuthorizationArgs& arg0)
8502 if (
this != &arg0) {
8503 if (state_ == DiscordObjectState::Owned) {
8505 state_ = DiscordObjectState::Invalid;
8507 if (arg0.state_ == DiscordObjectState::Owned) {
8508 Discord_AuthorizationArgs_Clone(&instance_, arg0.instance());
8510 state_ = DiscordObjectState::Owned;
8515AuthorizationArgs::AuthorizationArgs(Discord_AuthorizationArgs instance, DiscordObjectState state)
8516 : instance_(instance)
8520AuthorizationArgs::AuthorizationArgs()
8522 assert(state_ == DiscordObjectState::Invalid);
8523 Discord_AuthorizationArgs_Init(&instance_);
8524 state_ = DiscordObjectState::Owned;
8526void AuthorizationArgs::Drop()
8528 if (state_ != DiscordObjectState::Owned) {
8531 Discord_AuthorizationArgs_Drop(&instance_);
8532 state_ = DiscordObjectState::Invalid;
8534uint64_t AuthorizationArgs::ClientId()
const
8536 assert(state_ == DiscordObjectState::Owned);
8537 uint64_t returnValue__;
8538 returnValue__ = Discord_AuthorizationArgs_ClientId(&instance_);
8539 return returnValue__;
8541void AuthorizationArgs::SetClientId(uint64_t ClientId)
8543 assert(state_ == DiscordObjectState::Owned);
8544 Discord_AuthorizationArgs_SetClientId(&instance_, ClientId);
8548 assert(state_ == DiscordObjectState::Owned);
8549 Discord_String returnValueNative__;
8550 Discord_AuthorizationArgs_Scopes(&instance_, &returnValueNative__);
8551 discordpp::String returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
8552 returnValueNative__.size);
8553 Discord_Free(returnValueNative__.ptr);
8554 return returnValue__;
8556void AuthorizationArgs::SetScopes(std::string_view Scopes)
8558 assert(state_ == DiscordObjectState::Owned);
8559 Discord_String Scopes__str{(uint8_t*)(Scopes.data() !=
nullptr ? Scopes.data() :
""),
8561 Discord_AuthorizationArgs_SetScopes(&instance_, Scopes__str);
8563std::optional<discordpp::String> AuthorizationArgs::State()
const
8565 assert(state_ == DiscordObjectState::Owned);
8566 bool returnIsNonNull__;
8567 Discord_String returnValueNative__;
8568 returnIsNonNull__ = Discord_AuthorizationArgs_State(&instance_, &returnValueNative__);
8569 if (!returnIsNonNull__) {
8572 discordpp::String returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
8573 returnValueNative__.size);
8574 Discord_Free(returnValueNative__.ptr);
8575 return returnValue__;
8577void AuthorizationArgs::SetState(std::optional<std::string_view> State)
8579 assert(state_ == DiscordObjectState::Owned);
8580 Discord_String State__str{};
8581 if (
State.has_value()) {
8582 State__str.ptr = (uint8_t*)(
State->data() !=
nullptr ?
State->data() :
"");
8583 State__str.size =
State->size();
8585 Discord_AuthorizationArgs_SetState(&instance_, (
State.has_value() ? &State__str :
nullptr));
8587std::optional<discordpp::String> AuthorizationArgs::Nonce()
const
8589 assert(state_ == DiscordObjectState::Owned);
8590 bool returnIsNonNull__;
8591 Discord_String returnValueNative__;
8592 returnIsNonNull__ = Discord_AuthorizationArgs_Nonce(&instance_, &returnValueNative__);
8593 if (!returnIsNonNull__) {
8596 discordpp::String returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
8597 returnValueNative__.size);
8598 Discord_Free(returnValueNative__.ptr);
8599 return returnValue__;
8601void AuthorizationArgs::SetNonce(std::optional<std::string_view> Nonce)
8603 assert(state_ == DiscordObjectState::Owned);
8604 Discord_String Nonce__str{};
8605 if (Nonce.has_value()) {
8606 Nonce__str.ptr = (uint8_t*)(Nonce->data() !=
nullptr ? Nonce->data() :
"");
8607 Nonce__str.size = Nonce->size();
8609 Discord_AuthorizationArgs_SetNonce(&instance_, (Nonce.has_value() ? &Nonce__str :
nullptr));
8611std::optional<discordpp::AuthorizationCodeChallenge> AuthorizationArgs::CodeChallenge()
const
8613 assert(state_ == DiscordObjectState::Owned);
8614 bool returnIsNonNull__;
8615 Discord_AuthorizationCodeChallenge returnValueNative__;
8616 returnIsNonNull__ = Discord_AuthorizationArgs_CodeChallenge(&instance_, &returnValueNative__);
8617 if (!returnIsNonNull__) {
8621 DiscordObjectState::Owned);
8622 return returnValue__;
8624void AuthorizationArgs::SetCodeChallenge(
8625 std::optional<discordpp::AuthorizationCodeChallenge> CodeChallenge)
8627 assert(state_ == DiscordObjectState::Owned);
8628 Discord_AuthorizationArgs_SetCodeChallenge(
8629 &instance_, (CodeChallenge.has_value() ? CodeChallenge->instance() :
nullptr));
8631std::optional<discordpp::IntegrationType> AuthorizationArgs::IntegrationType()
const
8633 assert(state_ == DiscordObjectState::Owned);
8634 bool returnIsNonNull__;
8635 Discord_IntegrationType returnValueNative__;
8636 returnIsNonNull__ = Discord_AuthorizationArgs_IntegrationType(&instance_, &returnValueNative__);
8637 if (!returnIsNonNull__) {
8641 return returnValue__;
8643void AuthorizationArgs::SetIntegrationType(
8644 std::optional<discordpp::IntegrationType> IntegrationType)
8646 assert(state_ == DiscordObjectState::Owned);
8647 Discord_AuthorizationArgs_SetIntegrationType(
8649 (
IntegrationType.has_value() ?
reinterpret_cast<Discord_IntegrationType*
>(&*IntegrationType)
8652std::optional<discordpp::String> AuthorizationArgs::CustomSchemeParam()
const
8654 assert(state_ == DiscordObjectState::Owned);
8655 bool returnIsNonNull__;
8656 Discord_String returnValueNative__;
8658 Discord_AuthorizationArgs_CustomSchemeParam(&instance_, &returnValueNative__);
8659 if (!returnIsNonNull__) {
8662 discordpp::String returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
8663 returnValueNative__.size);
8664 Discord_Free(returnValueNative__.ptr);
8665 return returnValue__;
8667void AuthorizationArgs::SetCustomSchemeParam(std::optional<std::string_view> CustomSchemeParam)
8669 assert(state_ == DiscordObjectState::Owned);
8670 Discord_String CustomSchemeParam__str{};
8671 if (CustomSchemeParam.has_value()) {
8672 CustomSchemeParam__str.ptr =
8673 (uint8_t*)(CustomSchemeParam->data() !=
nullptr ? CustomSchemeParam->data() :
"");
8674 CustomSchemeParam__str.size = CustomSchemeParam->size();
8676 Discord_AuthorizationArgs_SetCustomSchemeParam(
8677 &instance_, (CustomSchemeParam.has_value() ? &CustomSchemeParam__str :
nullptr));
8679const DeviceAuthorizationArgs DeviceAuthorizationArgs::nullobj{{}, DiscordObjectState::Invalid};
8680DeviceAuthorizationArgs::~DeviceAuthorizationArgs()
8682 if (state_ == DiscordObjectState::Owned) {
8684 state_ = DiscordObjectState::Invalid;
8687DeviceAuthorizationArgs::DeviceAuthorizationArgs(DeviceAuthorizationArgs&& other) noexcept
8688 : instance_(other.instance_)
8689 , state_(other.state_)
8691 other.state_ = DiscordObjectState::Invalid;
8693DeviceAuthorizationArgs& DeviceAuthorizationArgs::operator=(
8694 DeviceAuthorizationArgs&& other)
noexcept
8696 if (
this != &other) {
8697 if (state_ == DiscordObjectState::Owned) {
8700 instance_ = other.instance_;
8701 state_ = other.state_;
8702 other.state_ = DiscordObjectState::Invalid;
8706DeviceAuthorizationArgs::DeviceAuthorizationArgs(
const DeviceAuthorizationArgs& arg0)
8711 Discord_DeviceAuthorizationArgs_Clone(&instance_, arg0.instance());
8713 state_ = DiscordObjectState::Owned;
8716DeviceAuthorizationArgs& DeviceAuthorizationArgs::operator=(
const DeviceAuthorizationArgs& arg0)
8718 if (
this != &arg0) {
8719 if (state_ == DiscordObjectState::Owned) {
8721 state_ = DiscordObjectState::Invalid;
8723 if (arg0.state_ == DiscordObjectState::Owned) {
8724 Discord_DeviceAuthorizationArgs_Clone(&instance_, arg0.instance());
8726 state_ = DiscordObjectState::Owned;
8731DeviceAuthorizationArgs::DeviceAuthorizationArgs(Discord_DeviceAuthorizationArgs instance,
8732 DiscordObjectState state)
8733 : instance_(instance)
8737DeviceAuthorizationArgs::DeviceAuthorizationArgs()
8739 assert(state_ == DiscordObjectState::Invalid);
8740 Discord_DeviceAuthorizationArgs_Init(&instance_);
8741 state_ = DiscordObjectState::Owned;
8743void DeviceAuthorizationArgs::Drop()
8745 if (state_ != DiscordObjectState::Owned) {
8748 Discord_DeviceAuthorizationArgs_Drop(&instance_);
8749 state_ = DiscordObjectState::Invalid;
8751uint64_t DeviceAuthorizationArgs::ClientId()
const
8753 assert(state_ == DiscordObjectState::Owned);
8754 uint64_t returnValue__;
8755 returnValue__ = Discord_DeviceAuthorizationArgs_ClientId(&instance_);
8756 return returnValue__;
8758void DeviceAuthorizationArgs::SetClientId(uint64_t ClientId)
8760 assert(state_ == DiscordObjectState::Owned);
8761 Discord_DeviceAuthorizationArgs_SetClientId(&instance_, ClientId);
8765 assert(state_ == DiscordObjectState::Owned);
8766 Discord_String returnValueNative__;
8767 Discord_DeviceAuthorizationArgs_Scopes(&instance_, &returnValueNative__);
8768 discordpp::String returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
8769 returnValueNative__.size);
8770 Discord_Free(returnValueNative__.ptr);
8771 return returnValue__;
8773void DeviceAuthorizationArgs::SetScopes(std::string_view Scopes)
8775 assert(state_ == DiscordObjectState::Owned);
8776 Discord_String Scopes__str{(uint8_t*)(Scopes.data() !=
nullptr ? Scopes.data() :
""),
8778 Discord_DeviceAuthorizationArgs_SetScopes(&instance_, Scopes__str);
8780const VoiceStateHandle VoiceStateHandle::nullobj{{}, DiscordObjectState::Invalid};
8781VoiceStateHandle::~VoiceStateHandle()
8783 if (state_ == DiscordObjectState::Owned) {
8785 state_ = DiscordObjectState::Invalid;
8788VoiceStateHandle::VoiceStateHandle(VoiceStateHandle&& other) noexcept
8789 : instance_(other.instance_)
8790 , state_(other.state_)
8792 other.state_ = DiscordObjectState::Invalid;
8794VoiceStateHandle& VoiceStateHandle::operator=(VoiceStateHandle&& other)
noexcept
8796 if (
this != &other) {
8797 if (state_ == DiscordObjectState::Owned) {
8800 instance_ = other.instance_;
8801 state_ = other.state_;
8802 other.state_ = DiscordObjectState::Invalid;
8806VoiceStateHandle::VoiceStateHandle(
const VoiceStateHandle& other)
8811 Discord_VoiceStateHandle_Clone(&instance_, other.instance());
8813 state_ = DiscordObjectState::Owned;
8816VoiceStateHandle& VoiceStateHandle::operator=(
const VoiceStateHandle& other)
8818 if (
this != &other) {
8819 if (state_ == DiscordObjectState::Owned) {
8821 state_ = DiscordObjectState::Invalid;
8823 if (other.state_ == DiscordObjectState::Owned) {
8824 Discord_VoiceStateHandle_Clone(&instance_, other.instance());
8826 state_ = DiscordObjectState::Owned;
8831VoiceStateHandle::VoiceStateHandle(Discord_VoiceStateHandle instance, DiscordObjectState state)
8832 : instance_(instance)
8836void VoiceStateHandle::Drop()
8838 if (state_ != DiscordObjectState::Owned) {
8841 Discord_VoiceStateHandle_Drop(&instance_);
8842 state_ = DiscordObjectState::Invalid;
8844bool VoiceStateHandle::SelfDeaf()
const
8846 assert(state_ == DiscordObjectState::Owned);
8848 returnValue__ = Discord_VoiceStateHandle_SelfDeaf(&instance_);
8849 return returnValue__;
8851bool VoiceStateHandle::SelfMute()
const
8853 assert(state_ == DiscordObjectState::Owned);
8855 returnValue__ = Discord_VoiceStateHandle_SelfMute(&instance_);
8856 return returnValue__;
8858const VADThresholdSettings VADThresholdSettings::nullobj{{}, DiscordObjectState::Invalid};
8859VADThresholdSettings::~VADThresholdSettings()
8861 if (state_ == DiscordObjectState::Owned) {
8863 state_ = DiscordObjectState::Invalid;
8866VADThresholdSettings::VADThresholdSettings(VADThresholdSettings&& other) noexcept
8867 : instance_(other.instance_)
8868 , state_(other.state_)
8870 other.state_ = DiscordObjectState::Invalid;
8872VADThresholdSettings& VADThresholdSettings::operator=(VADThresholdSettings&& other)
noexcept
8874 if (
this != &other) {
8875 if (state_ == DiscordObjectState::Owned) {
8878 instance_ = other.instance_;
8879 state_ = other.state_;
8880 other.state_ = DiscordObjectState::Invalid;
8884VADThresholdSettings::VADThresholdSettings(Discord_VADThresholdSettings instance,
8885 DiscordObjectState state)
8886 : instance_(instance)
8890void VADThresholdSettings::Drop()
8892 if (state_ != DiscordObjectState::Owned) {
8895 Discord_VADThresholdSettings_Drop(&instance_);
8896 state_ = DiscordObjectState::Invalid;
8898float VADThresholdSettings::VadThreshold()
const
8900 assert(state_ == DiscordObjectState::Owned);
8901 float returnValue__;
8902 returnValue__ = Discord_VADThresholdSettings_VadThreshold(&instance_);
8903 return returnValue__;
8905void VADThresholdSettings::SetVadThreshold(
float VadThreshold)
8907 assert(state_ == DiscordObjectState::Owned);
8908 Discord_VADThresholdSettings_SetVadThreshold(&instance_, VadThreshold);
8910bool VADThresholdSettings::Automatic()
const
8912 assert(state_ == DiscordObjectState::Owned);
8914 returnValue__ = Discord_VADThresholdSettings_Automatic(&instance_);
8915 return returnValue__;
8917void VADThresholdSettings::SetAutomatic(
bool Automatic)
8919 assert(state_ == DiscordObjectState::Owned);
8920 Discord_VADThresholdSettings_SetAutomatic(&instance_, Automatic);
8922const Call Call::nullobj{{}, DiscordObjectState::Invalid};
8925 if (state_ == DiscordObjectState::Owned) {
8927 state_ = DiscordObjectState::Invalid;
8930Call::Call(Call&& other) noexcept
8931 : instance_(other.instance_)
8932 , state_(other.state_)
8934 other.state_ = DiscordObjectState::Invalid;
8936Call& Call::operator=(Call&& other)
noexcept
8938 if (
this != &other) {
8939 if (state_ == DiscordObjectState::Owned) {
8942 instance_ = other.instance_;
8943 state_ = other.state_;
8944 other.state_ = DiscordObjectState::Invalid;
8948Call::Call(
const Call& other)
8953 Discord_Call_Clone(&instance_, other.instance());
8955 state_ = DiscordObjectState::Owned;
8958Call& Call::operator=(
const Call& other)
8960 if (
this != &other) {
8961 if (state_ == DiscordObjectState::Owned) {
8963 state_ = DiscordObjectState::Invalid;
8965 if (other.state_ == DiscordObjectState::Owned) {
8966 Discord_Call_Clone(&instance_, other.instance());
8968 state_ = DiscordObjectState::Owned;
8973Call::Call(Discord_Call instance, DiscordObjectState state)
8974 : instance_(instance)
8980 if (state_ != DiscordObjectState::Owned) {
8983 Discord_Call_Drop(&instance_);
8984 state_ = DiscordObjectState::Invalid;
8988 Discord_String returnValueNative__;
8989 Discord_Call_ErrorToString(
static_cast<Discord_Call_Error
>(type), &returnValueNative__);
8990 discordpp::String returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
8991 returnValueNative__.size);
8992 Discord_Free(returnValueNative__.ptr);
8993 return returnValue__;
8997 assert(state_ == DiscordObjectState::Owned);
8998 Discord_AudioModeType returnValue__;
8999 returnValue__ = Discord_Call_GetAudioMode(&instance_);
9002uint64_t Call::GetChannelId()
const
9004 assert(state_ == DiscordObjectState::Owned);
9005 uint64_t returnValue__;
9006 returnValue__ = Discord_Call_GetChannelId(&instance_);
9007 return returnValue__;
9009uint64_t Call::GetGuildId()
const
9011 assert(state_ == DiscordObjectState::Owned);
9012 uint64_t returnValue__;
9013 returnValue__ = Discord_Call_GetGuildId(&instance_);
9014 return returnValue__;
9016bool Call::GetLocalMute(uint64_t userId)
9018 assert(state_ == DiscordObjectState::Owned);
9020 returnValue__ = Discord_Call_GetLocalMute(&instance_, userId);
9021 return returnValue__;
9025 assert(state_ == DiscordObjectState::Owned);
9026 Discord_UInt64Span returnValueNative__;
9027 Discord_Call_GetParticipants(&instance_, &returnValueNative__);
9029 returnValueNative__.ptr + returnValueNative__.size);
9030 Discord_Free(returnValueNative__.ptr);
9031 return returnValue__;
9033float Call::GetParticipantVolume(uint64_t userId)
9035 assert(state_ == DiscordObjectState::Owned);
9036 float returnValue__;
9037 returnValue__ = Discord_Call_GetParticipantVolume(&instance_, userId);
9038 return returnValue__;
9040bool Call::GetPTTActive()
9042 assert(state_ == DiscordObjectState::Owned);
9044 returnValue__ = Discord_Call_GetPTTActive(&instance_);
9045 return returnValue__;
9047uint32_t Call::GetPTTReleaseDelay()
9049 assert(state_ == DiscordObjectState::Owned);
9050 uint32_t returnValue__;
9051 returnValue__ = Discord_Call_GetPTTReleaseDelay(&instance_);
9052 return returnValue__;
9054bool Call::GetSelfDeaf()
9056 assert(state_ == DiscordObjectState::Owned);
9058 returnValue__ = Discord_Call_GetSelfDeaf(&instance_);
9059 return returnValue__;
9061bool Call::GetSelfMute()
9063 assert(state_ == DiscordObjectState::Owned);
9065 returnValue__ = Discord_Call_GetSelfMute(&instance_);
9066 return returnValue__;
9070 assert(state_ == DiscordObjectState::Owned);
9071 Discord_Call_Status returnValue__;
9072 returnValue__ = Discord_Call_GetStatus(&instance_);
9077 assert(state_ == DiscordObjectState::Owned);
9078 Discord_VADThresholdSettings returnValueNative__{};
9079 Discord_Call_GetVADThreshold(&instance_, &returnValueNative__);
9081 return returnValue__;
9083std::optional<discordpp::VoiceStateHandle> Call::GetVoiceStateHandle(uint64_t userId)
const
9085 assert(state_ == DiscordObjectState::Owned);
9086 bool returnIsNonNull__;
9087 Discord_VoiceStateHandle returnValueNative__;
9088 returnIsNonNull__ = Discord_Call_GetVoiceStateHandle(&instance_, userId, &returnValueNative__);
9089 if (!returnIsNonNull__) {
9093 return returnValue__;
9097 assert(state_ == DiscordObjectState::Owned);
9098 Discord_Call_SetAudioMode(&instance_,
static_cast<Discord_AudioModeType
>(audioMode));
9100void Call::SetLocalMute(uint64_t userId,
bool mute)
9102 assert(state_ == DiscordObjectState::Owned);
9103 Discord_Call_SetLocalMute(&instance_, userId, mute);
9107 assert(state_ == DiscordObjectState::Owned);
9108 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
9109 auto cb__userData = Tcb__UserData::Create(std::move(cb));
9110 Discord_Call_OnVoiceStateChanged cb__native = [](
auto userId,
void* userData__) {
9111 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
9112 userData__typed->delegate(userId);
9114 Discord_Call_SetOnVoiceStateChangedCallback(&instance_,
9115 (cb__userData->delegate ? cb__native :
nullptr),
9116 Tcb__UserData::Free,
9121 assert(state_ == DiscordObjectState::Owned);
9122 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
9123 auto cb__userData = Tcb__UserData::Create(std::move(cb));
9124 Discord_Call_OnParticipantChanged cb__native = [](
auto userId,
auto added,
void* userData__) {
9125 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
9126 userData__typed->delegate(userId, added);
9128 Discord_Call_SetParticipantChangedCallback(&instance_,
9129 (cb__userData->delegate ? cb__native :
nullptr),
9130 Tcb__UserData::Free,
9133void Call::SetParticipantVolume(uint64_t userId,
float volume)
9135 assert(state_ == DiscordObjectState::Owned);
9136 Discord_Call_SetParticipantVolume(&instance_, userId, volume);
9138void Call::SetPTTActive(
bool active)
9140 assert(state_ == DiscordObjectState::Owned);
9141 Discord_Call_SetPTTActive(&instance_, active);
9143void Call::SetPTTReleaseDelay(uint32_t releaseDelayMs)
9145 assert(state_ == DiscordObjectState::Owned);
9146 Discord_Call_SetPTTReleaseDelay(&instance_, releaseDelayMs);
9148void Call::SetSelfDeaf(
bool deaf)
9150 assert(state_ == DiscordObjectState::Owned);
9151 Discord_Call_SetSelfDeaf(&instance_, deaf);
9153void Call::SetSelfMute(
bool mute)
9155 assert(state_ == DiscordObjectState::Owned);
9156 Discord_Call_SetSelfMute(&instance_, mute);
9160 assert(state_ == DiscordObjectState::Owned);
9161 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
9162 auto cb__userData = Tcb__UserData::Create(std::move(cb));
9163 Discord_Call_OnSpeakingStatusChanged cb__native =
9164 [](
auto userId,
auto isPlayingSound,
void* userData__) {
9165 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
9166 userData__typed->delegate(userId, isPlayingSound);
9168 Discord_Call_SetSpeakingStatusChangedCallback(&instance_,
9169 (cb__userData->delegate ? cb__native :
nullptr),
9170 Tcb__UserData::Free,
9175 assert(state_ == DiscordObjectState::Owned);
9176 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
9177 auto cb__userData = Tcb__UserData::Create(std::move(cb));
9178 Discord_Call_OnStatusChanged cb__native =
9179 [](
auto status,
auto error,
auto errorDetail,
void* userData__) {
9180 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
9185 Discord_Call_SetStatusChangedCallback(&instance_,
9186 (cb__userData->delegate ? cb__native :
nullptr),
9187 Tcb__UserData::Free,
9190void Call::SetVADThreshold(
bool automatic,
float threshold)
9192 assert(state_ == DiscordObjectState::Owned);
9193 Discord_Call_SetVADThreshold(&instance_, automatic, threshold);
9197 Discord_String returnValueNative__;
9198 Discord_Call_StatusToString(
static_cast<Discord_Call_Status
>(type), &returnValueNative__);
9199 discordpp::String returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
9200 returnValueNative__.size);
9201 Discord_Free(returnValueNative__.ptr);
9202 return returnValue__;
9204const ChannelHandle ChannelHandle::nullobj{{}, DiscordObjectState::Invalid};
9205ChannelHandle::~ChannelHandle()
9207 if (state_ == DiscordObjectState::Owned) {
9209 state_ = DiscordObjectState::Invalid;
9212ChannelHandle::ChannelHandle(ChannelHandle&& other) noexcept
9213 : instance_(other.instance_)
9214 , state_(other.state_)
9216 other.state_ = DiscordObjectState::Invalid;
9218ChannelHandle& ChannelHandle::operator=(ChannelHandle&& other)
noexcept
9220 if (
this != &other) {
9221 if (state_ == DiscordObjectState::Owned) {
9224 instance_ = other.instance_;
9225 state_ = other.state_;
9226 other.state_ = DiscordObjectState::Invalid;
9230ChannelHandle::ChannelHandle(
const ChannelHandle& other)
9235 Discord_ChannelHandle_Clone(&instance_, other.instance());
9237 state_ = DiscordObjectState::Owned;
9240ChannelHandle& ChannelHandle::operator=(
const ChannelHandle& other)
9242 if (
this != &other) {
9243 if (state_ == DiscordObjectState::Owned) {
9245 state_ = DiscordObjectState::Invalid;
9247 if (other.state_ == DiscordObjectState::Owned) {
9248 Discord_ChannelHandle_Clone(&instance_, other.instance());
9250 state_ = DiscordObjectState::Owned;
9255ChannelHandle::ChannelHandle(Discord_ChannelHandle instance, DiscordObjectState state)
9256 : instance_(instance)
9260void ChannelHandle::Drop()
9262 if (state_ != DiscordObjectState::Owned) {
9265 Discord_ChannelHandle_Drop(&instance_);
9266 state_ = DiscordObjectState::Invalid;
9268uint64_t ChannelHandle::Id()
const
9270 assert(state_ == DiscordObjectState::Owned);
9271 uint64_t returnValue__;
9272 returnValue__ = Discord_ChannelHandle_Id(&instance_);
9273 return returnValue__;
9277 assert(state_ == DiscordObjectState::Owned);
9278 Discord_String returnValueNative__;
9279 Discord_ChannelHandle_Name(&instance_, &returnValueNative__);
9280 discordpp::String returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
9281 returnValueNative__.size);
9282 Discord_Free(returnValueNative__.ptr);
9283 return returnValue__;
9287 assert(state_ == DiscordObjectState::Owned);
9288 Discord_UInt64Span returnValueNative__;
9289 Discord_ChannelHandle_Recipients(&instance_, &returnValueNative__);
9291 returnValueNative__.ptr + returnValueNative__.size);
9292 Discord_Free(returnValueNative__.ptr);
9293 return returnValue__;
9297 assert(state_ == DiscordObjectState::Owned);
9298 Discord_ChannelType returnValue__;
9299 returnValue__ = Discord_ChannelHandle_Type(&instance_);
9302const GuildMinimal GuildMinimal::nullobj{{}, DiscordObjectState::Invalid};
9303GuildMinimal::~GuildMinimal()
9305 if (state_ == DiscordObjectState::Owned) {
9307 state_ = DiscordObjectState::Invalid;
9310GuildMinimal::GuildMinimal(GuildMinimal&& other) noexcept
9311 : instance_(other.instance_)
9312 , state_(other.state_)
9314 other.state_ = DiscordObjectState::Invalid;
9316GuildMinimal& GuildMinimal::operator=(GuildMinimal&& other)
noexcept
9318 if (
this != &other) {
9319 if (state_ == DiscordObjectState::Owned) {
9322 instance_ = other.instance_;
9323 state_ = other.state_;
9324 other.state_ = DiscordObjectState::Invalid;
9328GuildMinimal::GuildMinimal(
const GuildMinimal& arg0)
9333 Discord_GuildMinimal_Clone(&instance_, arg0.instance());
9335 state_ = DiscordObjectState::Owned;
9338GuildMinimal& GuildMinimal::operator=(
const GuildMinimal& arg0)
9340 if (
this != &arg0) {
9341 if (state_ == DiscordObjectState::Owned) {
9343 state_ = DiscordObjectState::Invalid;
9345 if (arg0.state_ == DiscordObjectState::Owned) {
9346 Discord_GuildMinimal_Clone(&instance_, arg0.instance());
9348 state_ = DiscordObjectState::Owned;
9353GuildMinimal::GuildMinimal(Discord_GuildMinimal instance, DiscordObjectState state)
9354 : instance_(instance)
9358void GuildMinimal::Drop()
9360 if (state_ != DiscordObjectState::Owned) {
9363 Discord_GuildMinimal_Drop(&instance_);
9364 state_ = DiscordObjectState::Invalid;
9366uint64_t GuildMinimal::Id()
const
9368 assert(state_ == DiscordObjectState::Owned);
9369 uint64_t returnValue__;
9370 returnValue__ = Discord_GuildMinimal_Id(&instance_);
9371 return returnValue__;
9373void GuildMinimal::SetId(uint64_t Id)
9375 assert(state_ == DiscordObjectState::Owned);
9376 Discord_GuildMinimal_SetId(&instance_, Id);
9380 assert(state_ == DiscordObjectState::Owned);
9381 Discord_String returnValueNative__;
9382 Discord_GuildMinimal_Name(&instance_, &returnValueNative__);
9383 discordpp::String returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
9384 returnValueNative__.size);
9385 Discord_Free(returnValueNative__.ptr);
9386 return returnValue__;
9388void GuildMinimal::SetName(std::string_view Name)
9390 assert(state_ == DiscordObjectState::Owned);
9391 Discord_String Name__str{(uint8_t*)(
Name.data() !=
nullptr ?
Name.data() :
""),
Name.size()};
9392 Discord_GuildMinimal_SetName(&instance_, Name__str);
9394const UserGuild UserGuild::nullobj{{}, DiscordObjectState::Invalid};
9395UserGuild::~UserGuild()
9397 if (state_ == DiscordObjectState::Owned) {
9399 state_ = DiscordObjectState::Invalid;
9402UserGuild::UserGuild(UserGuild&& other) noexcept
9403 : instance_(other.instance_)
9404 , state_(other.state_)
9406 other.state_ = DiscordObjectState::Invalid;
9408UserGuild& UserGuild::operator=(UserGuild&& other)
noexcept
9410 if (
this != &other) {
9411 if (state_ == DiscordObjectState::Owned) {
9414 instance_ = other.instance_;
9415 state_ = other.state_;
9416 other.state_ = DiscordObjectState::Invalid;
9420UserGuild::UserGuild(
const UserGuild& arg0)
9425 Discord_UserGuild_Clone(&instance_, arg0.instance());
9427 state_ = DiscordObjectState::Owned;
9430UserGuild& UserGuild::operator=(
const UserGuild& arg0)
9432 if (
this != &arg0) {
9433 if (state_ == DiscordObjectState::Owned) {
9435 state_ = DiscordObjectState::Invalid;
9437 if (arg0.state_ == DiscordObjectState::Owned) {
9438 Discord_UserGuild_Clone(&instance_, arg0.instance());
9440 state_ = DiscordObjectState::Owned;
9445UserGuild::UserGuild(Discord_UserGuild instance, DiscordObjectState state)
9446 : instance_(instance)
9450void UserGuild::Drop()
9452 if (state_ != DiscordObjectState::Owned) {
9455 Discord_UserGuild_Drop(&instance_);
9456 state_ = DiscordObjectState::Invalid;
9458uint64_t UserGuild::Id()
const
9460 assert(state_ == DiscordObjectState::Owned);
9461 uint64_t returnValue__;
9462 returnValue__ = Discord_UserGuild_Id(&instance_);
9463 return returnValue__;
9465void UserGuild::SetId(uint64_t Id)
9467 assert(state_ == DiscordObjectState::Owned);
9468 Discord_UserGuild_SetId(&instance_, Id);
9472 assert(state_ == DiscordObjectState::Owned);
9473 Discord_String returnValueNative__;
9474 Discord_UserGuild_Name(&instance_, &returnValueNative__);
9475 discordpp::String returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
9476 returnValueNative__.size);
9477 Discord_Free(returnValueNative__.ptr);
9478 return returnValue__;
9480void UserGuild::SetName(std::string_view Name)
9482 assert(state_ == DiscordObjectState::Owned);
9483 Discord_String Name__str{(uint8_t*)(
Name.data() !=
nullptr ?
Name.data() :
""),
Name.size()};
9484 Discord_UserGuild_SetName(&instance_, Name__str);
9486std::optional<discordpp::String> UserGuild::Icon()
const
9488 assert(state_ == DiscordObjectState::Owned);
9489 bool returnIsNonNull__;
9490 Discord_String returnValueNative__;
9491 returnIsNonNull__ = Discord_UserGuild_Icon(&instance_, &returnValueNative__);
9492 if (!returnIsNonNull__) {
9495 discordpp::String returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
9496 returnValueNative__.size);
9497 Discord_Free(returnValueNative__.ptr);
9498 return returnValue__;
9500void UserGuild::SetIcon(std::optional<std::string_view> Icon)
9502 assert(state_ == DiscordObjectState::Owned);
9503 Discord_String Icon__str{};
9504 if (Icon.has_value()) {
9505 Icon__str.ptr = (uint8_t*)(Icon->data() !=
nullptr ? Icon->data() :
"");
9506 Icon__str.size = Icon->size();
9508 Discord_UserGuild_SetIcon(&instance_, (Icon.has_value() ? &Icon__str :
nullptr));
9510std::optional<discordpp::String> UserGuild::Banner()
const
9512 assert(state_ == DiscordObjectState::Owned);
9513 bool returnIsNonNull__;
9514 Discord_String returnValueNative__;
9515 returnIsNonNull__ = Discord_UserGuild_Banner(&instance_, &returnValueNative__);
9516 if (!returnIsNonNull__) {
9519 discordpp::String returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
9520 returnValueNative__.size);
9521 Discord_Free(returnValueNative__.ptr);
9522 return returnValue__;
9524void UserGuild::SetBanner(std::optional<std::string_view> Banner)
9526 assert(state_ == DiscordObjectState::Owned);
9527 Discord_String Banner__str{};
9528 if (Banner.has_value()) {
9529 Banner__str.ptr = (uint8_t*)(Banner->data() !=
nullptr ? Banner->data() :
"");
9530 Banner__str.size = Banner->size();
9532 Discord_UserGuild_SetBanner(&instance_, (Banner.has_value() ? &Banner__str :
nullptr));
9534bool UserGuild::Owner()
const
9536 assert(state_ == DiscordObjectState::Owned);
9538 returnValue__ = Discord_UserGuild_Owner(&instance_);
9539 return returnValue__;
9541void UserGuild::SetOwner(
bool Owner)
9543 assert(state_ == DiscordObjectState::Owned);
9544 Discord_UserGuild_SetOwner(&instance_, Owner);
9546uint64_t UserGuild::Permissions()
const
9548 assert(state_ == DiscordObjectState::Owned);
9549 uint64_t returnValue__;
9550 returnValue__ = Discord_UserGuild_Permissions(&instance_);
9551 return returnValue__;
9553void UserGuild::SetPermissions(uint64_t Permissions)
9555 assert(state_ == DiscordObjectState::Owned);
9556 Discord_UserGuild_SetPermissions(&instance_, Permissions);
9558std::optional<discordpp::LinkedGameOrganization> UserGuild::LinkedGameOrganization()
const
9560 assert(state_ == DiscordObjectState::Owned);
9561 bool returnIsNonNull__;
9562 Discord_LinkedGameOrganization returnValueNative__;
9563 returnIsNonNull__ = Discord_UserGuild_LinkedGameOrganization(&instance_, &returnValueNative__);
9564 if (!returnIsNonNull__) {
9568 return returnValue__;
9570void UserGuild::SetLinkedGameOrganization(
9571 std::optional<discordpp::LinkedGameOrganization> LinkedGameOrganization)
9573 assert(state_ == DiscordObjectState::Owned);
9574 Discord_UserGuild_SetLinkedGameOrganization(
9576 (LinkedGameOrganization.has_value() ? LinkedGameOrganization->instance() :
nullptr));
9578const LinkedGameOrganization LinkedGameOrganization::nullobj{{}, DiscordObjectState::Invalid};
9579LinkedGameOrganization::~LinkedGameOrganization()
9581 if (state_ == DiscordObjectState::Owned) {
9583 state_ = DiscordObjectState::Invalid;
9586LinkedGameOrganization::LinkedGameOrganization(LinkedGameOrganization&& other) noexcept
9587 : instance_(other.instance_)
9588 , state_(other.state_)
9590 other.state_ = DiscordObjectState::Invalid;
9592LinkedGameOrganization& LinkedGameOrganization::operator=(LinkedGameOrganization&& other)
noexcept
9594 if (
this != &other) {
9595 if (state_ == DiscordObjectState::Owned) {
9598 instance_ = other.instance_;
9599 state_ = other.state_;
9600 other.state_ = DiscordObjectState::Invalid;
9604LinkedGameOrganization::LinkedGameOrganization(
const LinkedGameOrganization& arg0)
9609 Discord_LinkedGameOrganization_Clone(&instance_, arg0.instance());
9611 state_ = DiscordObjectState::Owned;
9614LinkedGameOrganization& LinkedGameOrganization::operator=(
const LinkedGameOrganization& arg0)
9616 if (
this != &arg0) {
9617 if (state_ == DiscordObjectState::Owned) {
9619 state_ = DiscordObjectState::Invalid;
9621 if (arg0.state_ == DiscordObjectState::Owned) {
9622 Discord_LinkedGameOrganization_Clone(&instance_, arg0.instance());
9624 state_ = DiscordObjectState::Owned;
9629LinkedGameOrganization::LinkedGameOrganization(Discord_LinkedGameOrganization instance,
9630 DiscordObjectState state)
9631 : instance_(instance)
9635LinkedGameOrganization::LinkedGameOrganization()
9637 assert(state_ == DiscordObjectState::Invalid);
9638 Discord_LinkedGameOrganization_Init(&instance_);
9639 state_ = DiscordObjectState::Owned;
9641void LinkedGameOrganization::Drop()
9643 if (state_ != DiscordObjectState::Owned) {
9646 Discord_LinkedGameOrganization_Drop(&instance_);
9647 state_ = DiscordObjectState::Invalid;
9649std::optional<uint64_t> LinkedGameOrganization::ApplicationId()
const
9651 assert(state_ == DiscordObjectState::Owned);
9652 bool returnIsNonNull__;
9653 uint64_t returnValue__;
9654 returnIsNonNull__ = Discord_LinkedGameOrganization_ApplicationId(&instance_, &returnValue__);
9655 if (!returnIsNonNull__) {
9656 return std::nullopt;
9658 return returnValue__;
9660void LinkedGameOrganization::SetApplicationId(std::optional<uint64_t> ApplicationId)
9662 assert(state_ == DiscordObjectState::Owned);
9663 Discord_LinkedGameOrganization_SetApplicationId(
9664 &instance_, (ApplicationId.has_value() ? &*ApplicationId :
nullptr));
9666std::optional<discordpp::String> LinkedGameOrganization::GameOrganizationId()
const
9668 assert(state_ == DiscordObjectState::Owned);
9669 bool returnIsNonNull__;
9670 Discord_String returnValueNative__;
9672 Discord_LinkedGameOrganization_GameOrganizationId(&instance_, &returnValueNative__);
9673 if (!returnIsNonNull__) {
9676 discordpp::String returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
9677 returnValueNative__.size);
9678 Discord_Free(returnValueNative__.ptr);
9679 return returnValue__;
9681void LinkedGameOrganization::SetGameOrganizationId(
9682 std::optional<std::string_view> GameOrganizationId)
9684 assert(state_ == DiscordObjectState::Owned);
9685 Discord_String GameOrganizationId__str{};
9686 if (GameOrganizationId.has_value()) {
9687 GameOrganizationId__str.ptr =
9688 (uint8_t*)(GameOrganizationId->data() !=
nullptr ? GameOrganizationId->data() :
"");
9689 GameOrganizationId__str.size = GameOrganizationId->size();
9691 Discord_LinkedGameOrganization_SetGameOrganizationId(
9692 &instance_, (GameOrganizationId.has_value() ? &GameOrganizationId__str :
nullptr));
9694const GuildChannel GuildChannel::nullobj{{}, DiscordObjectState::Invalid};
9695GuildChannel::~GuildChannel()
9697 if (state_ == DiscordObjectState::Owned) {
9699 state_ = DiscordObjectState::Invalid;
9702GuildChannel::GuildChannel(GuildChannel&& other) noexcept
9703 : instance_(other.instance_)
9704 , state_(other.state_)
9706 other.state_ = DiscordObjectState::Invalid;
9708GuildChannel& GuildChannel::operator=(GuildChannel&& other)
noexcept
9710 if (
this != &other) {
9711 if (state_ == DiscordObjectState::Owned) {
9714 instance_ = other.instance_;
9715 state_ = other.state_;
9716 other.state_ = DiscordObjectState::Invalid;
9720GuildChannel::GuildChannel(
const GuildChannel& arg0)
9725 Discord_GuildChannel_Clone(&instance_, arg0.instance());
9727 state_ = DiscordObjectState::Owned;
9730GuildChannel& GuildChannel::operator=(
const GuildChannel& arg0)
9732 if (
this != &arg0) {
9733 if (state_ == DiscordObjectState::Owned) {
9735 state_ = DiscordObjectState::Invalid;
9737 if (arg0.state_ == DiscordObjectState::Owned) {
9738 Discord_GuildChannel_Clone(&instance_, arg0.instance());
9740 state_ = DiscordObjectState::Owned;
9745GuildChannel::GuildChannel(Discord_GuildChannel instance, DiscordObjectState state)
9746 : instance_(instance)
9750void GuildChannel::Drop()
9752 if (state_ != DiscordObjectState::Owned) {
9755 Discord_GuildChannel_Drop(&instance_);
9756 state_ = DiscordObjectState::Invalid;
9758uint64_t GuildChannel::Id()
const
9760 assert(state_ == DiscordObjectState::Owned);
9761 uint64_t returnValue__;
9762 returnValue__ = Discord_GuildChannel_Id(&instance_);
9763 return returnValue__;
9765void GuildChannel::SetId(uint64_t Id)
9767 assert(state_ == DiscordObjectState::Owned);
9768 Discord_GuildChannel_SetId(&instance_, Id);
9772 assert(state_ == DiscordObjectState::Owned);
9773 Discord_String returnValueNative__;
9774 Discord_GuildChannel_Name(&instance_, &returnValueNative__);
9775 discordpp::String returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
9776 returnValueNative__.size);
9777 Discord_Free(returnValueNative__.ptr);
9778 return returnValue__;
9780void GuildChannel::SetName(std::string_view Name)
9782 assert(state_ == DiscordObjectState::Owned);
9783 Discord_String Name__str{(uint8_t*)(
Name.data() !=
nullptr ?
Name.data() :
""),
Name.size()};
9784 Discord_GuildChannel_SetName(&instance_, Name__str);
9788 assert(state_ == DiscordObjectState::Owned);
9789 Discord_ChannelType returnValue__;
9790 returnValue__ = Discord_GuildChannel_Type(&instance_);
9795 assert(state_ == DiscordObjectState::Owned);
9796 Discord_GuildChannel_SetType(&instance_,
static_cast<Discord_ChannelType
>(Type));
9798int32_t GuildChannel::Position()
const
9800 assert(state_ == DiscordObjectState::Owned);
9801 int32_t returnValue__;
9802 returnValue__ = Discord_GuildChannel_Position(&instance_);
9803 return returnValue__;
9805void GuildChannel::SetPosition(int32_t Position)
9807 assert(state_ == DiscordObjectState::Owned);
9808 Discord_GuildChannel_SetPosition(&instance_, Position);
9810std::optional<uint64_t> GuildChannel::ParentId()
const
9812 assert(state_ == DiscordObjectState::Owned);
9813 bool returnIsNonNull__;
9814 uint64_t returnValue__;
9815 returnIsNonNull__ = Discord_GuildChannel_ParentId(&instance_, &returnValue__);
9816 if (!returnIsNonNull__) {
9817 return std::nullopt;
9819 return returnValue__;
9821void GuildChannel::SetParentId(std::optional<uint64_t> ParentId)
9823 assert(state_ == DiscordObjectState::Owned);
9824 Discord_GuildChannel_SetParentId(&instance_, (ParentId.has_value() ? &*ParentId :
nullptr));
9826bool GuildChannel::IsLinkable()
const
9828 assert(state_ == DiscordObjectState::Owned);
9830 returnValue__ = Discord_GuildChannel_IsLinkable(&instance_);
9831 return returnValue__;
9833void GuildChannel::SetIsLinkable(
bool IsLinkable)
9835 assert(state_ == DiscordObjectState::Owned);
9836 Discord_GuildChannel_SetIsLinkable(&instance_, IsLinkable);
9838bool GuildChannel::IsViewableAndWriteableByAllMembers()
const
9840 assert(state_ == DiscordObjectState::Owned);
9842 returnValue__ = Discord_GuildChannel_IsViewableAndWriteableByAllMembers(&instance_);
9843 return returnValue__;
9845void GuildChannel::SetIsViewableAndWriteableByAllMembers(
bool IsViewableAndWriteableByAllMembers)
9847 assert(state_ == DiscordObjectState::Owned);
9848 Discord_GuildChannel_SetIsViewableAndWriteableByAllMembers(&instance_,
9849 IsViewableAndWriteableByAllMembers);
9851std::optional<discordpp::LinkedLobby> GuildChannel::LinkedLobby()
const
9853 assert(state_ == DiscordObjectState::Owned);
9854 bool returnIsNonNull__;
9855 Discord_LinkedLobby returnValueNative__;
9856 returnIsNonNull__ = Discord_GuildChannel_LinkedLobby(&instance_, &returnValueNative__);
9857 if (!returnIsNonNull__) {
9861 return returnValue__;
9863void GuildChannel::SetLinkedLobby(std::optional<discordpp::LinkedLobby> LinkedLobby)
9865 assert(state_ == DiscordObjectState::Owned);
9866 Discord_GuildChannel_SetLinkedLobby(
9867 &instance_, (LinkedLobby.has_value() ? LinkedLobby->instance() :
nullptr));
9869const LinkedLobby LinkedLobby::nullobj{{}, DiscordObjectState::Invalid};
9870LinkedLobby::~LinkedLobby()
9872 if (state_ == DiscordObjectState::Owned) {
9874 state_ = DiscordObjectState::Invalid;
9877LinkedLobby::LinkedLobby(LinkedLobby&& other) noexcept
9878 : instance_(other.instance_)
9879 , state_(other.state_)
9881 other.state_ = DiscordObjectState::Invalid;
9883LinkedLobby& LinkedLobby::operator=(LinkedLobby&& other)
noexcept
9885 if (
this != &other) {
9886 if (state_ == DiscordObjectState::Owned) {
9889 instance_ = other.instance_;
9890 state_ = other.state_;
9891 other.state_ = DiscordObjectState::Invalid;
9895LinkedLobby::LinkedLobby(
const LinkedLobby& arg0)
9900 Discord_LinkedLobby_Clone(&instance_, arg0.instance());
9902 state_ = DiscordObjectState::Owned;
9905LinkedLobby& LinkedLobby::operator=(
const LinkedLobby& arg0)
9907 if (
this != &arg0) {
9908 if (state_ == DiscordObjectState::Owned) {
9910 state_ = DiscordObjectState::Invalid;
9912 if (arg0.state_ == DiscordObjectState::Owned) {
9913 Discord_LinkedLobby_Clone(&instance_, arg0.instance());
9915 state_ = DiscordObjectState::Owned;
9920LinkedLobby::LinkedLobby(Discord_LinkedLobby instance, DiscordObjectState state)
9921 : instance_(instance)
9925LinkedLobby::LinkedLobby()
9927 assert(state_ == DiscordObjectState::Invalid);
9928 Discord_LinkedLobby_Init(&instance_);
9929 state_ = DiscordObjectState::Owned;
9931void LinkedLobby::Drop()
9933 if (state_ != DiscordObjectState::Owned) {
9936 Discord_LinkedLobby_Drop(&instance_);
9937 state_ = DiscordObjectState::Invalid;
9939uint64_t LinkedLobby::ApplicationId()
const
9941 assert(state_ == DiscordObjectState::Owned);
9942 uint64_t returnValue__;
9943 returnValue__ = Discord_LinkedLobby_ApplicationId(&instance_);
9944 return returnValue__;
9946void LinkedLobby::SetApplicationId(uint64_t ApplicationId)
9948 assert(state_ == DiscordObjectState::Owned);
9949 Discord_LinkedLobby_SetApplicationId(&instance_, ApplicationId);
9951uint64_t LinkedLobby::LobbyId()
const
9953 assert(state_ == DiscordObjectState::Owned);
9954 uint64_t returnValue__;
9955 returnValue__ = Discord_LinkedLobby_LobbyId(&instance_);
9956 return returnValue__;
9958void LinkedLobby::SetLobbyId(uint64_t LobbyId)
9960 assert(state_ == DiscordObjectState::Owned);
9961 Discord_LinkedLobby_SetLobbyId(&instance_, LobbyId);
9963const LinkedChannel LinkedChannel::nullobj{{}, DiscordObjectState::Invalid};
9964LinkedChannel::~LinkedChannel()
9966 if (state_ == DiscordObjectState::Owned) {
9968 state_ = DiscordObjectState::Invalid;
9971LinkedChannel::LinkedChannel(LinkedChannel&& other) noexcept
9972 : instance_(other.instance_)
9973 , state_(other.state_)
9975 other.state_ = DiscordObjectState::Invalid;
9977LinkedChannel& LinkedChannel::operator=(LinkedChannel&& other)
noexcept
9979 if (
this != &other) {
9980 if (state_ == DiscordObjectState::Owned) {
9983 instance_ = other.instance_;
9984 state_ = other.state_;
9985 other.state_ = DiscordObjectState::Invalid;
9989LinkedChannel::LinkedChannel(
const LinkedChannel& arg0)
9994 Discord_LinkedChannel_Clone(&instance_, arg0.instance());
9996 state_ = DiscordObjectState::Owned;
9999LinkedChannel& LinkedChannel::operator=(
const LinkedChannel& arg0)
10001 if (
this != &arg0) {
10002 if (state_ == DiscordObjectState::Owned) {
10004 state_ = DiscordObjectState::Invalid;
10006 if (arg0.state_ == DiscordObjectState::Owned) {
10007 Discord_LinkedChannel_Clone(&instance_, arg0.instance());
10009 state_ = DiscordObjectState::Owned;
10014LinkedChannel::LinkedChannel(Discord_LinkedChannel instance, DiscordObjectState state)
10015 : instance_(instance)
10019void LinkedChannel::Drop()
10021 if (state_ != DiscordObjectState::Owned) {
10024 Discord_LinkedChannel_Drop(&instance_);
10025 state_ = DiscordObjectState::Invalid;
10027uint64_t LinkedChannel::Id()
const
10029 assert(state_ == DiscordObjectState::Owned);
10030 uint64_t returnValue__;
10031 returnValue__ = Discord_LinkedChannel_Id(&instance_);
10032 return returnValue__;
10034void LinkedChannel::SetId(uint64_t Id)
10036 assert(state_ == DiscordObjectState::Owned);
10037 Discord_LinkedChannel_SetId(&instance_, Id);
10041 assert(state_ == DiscordObjectState::Owned);
10042 Discord_String returnValueNative__;
10043 Discord_LinkedChannel_Name(&instance_, &returnValueNative__);
10044 discordpp::String returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
10045 returnValueNative__.size);
10046 Discord_Free(returnValueNative__.ptr);
10047 return returnValue__;
10049void LinkedChannel::SetName(std::string_view Name)
10051 assert(state_ == DiscordObjectState::Owned);
10052 Discord_String Name__str{(uint8_t*)(
Name.data() !=
nullptr ?
Name.data() :
""),
Name.size()};
10053 Discord_LinkedChannel_SetName(&instance_, Name__str);
10055uint64_t LinkedChannel::GuildId()
const
10057 assert(state_ == DiscordObjectState::Owned);
10058 uint64_t returnValue__;
10059 returnValue__ = Discord_LinkedChannel_GuildId(&instance_);
10060 return returnValue__;
10062void LinkedChannel::SetGuildId(uint64_t GuildId)
10064 assert(state_ == DiscordObjectState::Owned);
10065 Discord_LinkedChannel_SetGuildId(&instance_, GuildId);
10067const RelationshipHandle RelationshipHandle::nullobj{{}, DiscordObjectState::Invalid};
10068RelationshipHandle::~RelationshipHandle()
10070 if (state_ == DiscordObjectState::Owned) {
10072 state_ = DiscordObjectState::Invalid;
10075RelationshipHandle::RelationshipHandle(RelationshipHandle&& other) noexcept
10076 : instance_(other.instance_)
10077 , state_(other.state_)
10079 other.state_ = DiscordObjectState::Invalid;
10081RelationshipHandle& RelationshipHandle::operator=(RelationshipHandle&& other)
noexcept
10083 if (
this != &other) {
10084 if (state_ == DiscordObjectState::Owned) {
10087 instance_ = other.instance_;
10088 state_ = other.state_;
10089 other.state_ = DiscordObjectState::Invalid;
10093RelationshipHandle::RelationshipHandle(
const RelationshipHandle& other)
10098 Discord_RelationshipHandle_Clone(&instance_, other.instance());
10100 state_ = DiscordObjectState::Owned;
10103RelationshipHandle& RelationshipHandle::operator=(
const RelationshipHandle& other)
10105 if (
this != &other) {
10106 if (state_ == DiscordObjectState::Owned) {
10108 state_ = DiscordObjectState::Invalid;
10110 if (other.state_ == DiscordObjectState::Owned) {
10111 Discord_RelationshipHandle_Clone(&instance_, other.instance());
10113 state_ = DiscordObjectState::Owned;
10118RelationshipHandle::RelationshipHandle(Discord_RelationshipHandle instance,
10119 DiscordObjectState state)
10120 : instance_(instance)
10124void RelationshipHandle::Drop()
10126 if (state_ != DiscordObjectState::Owned) {
10129 Discord_RelationshipHandle_Drop(&instance_);
10130 state_ = DiscordObjectState::Invalid;
10134 assert(state_ == DiscordObjectState::Owned);
10135 Discord_RelationshipType returnValue__;
10136 returnValue__ = Discord_RelationshipHandle_DiscordRelationshipType(&instance_);
10141 assert(state_ == DiscordObjectState::Owned);
10142 Discord_RelationshipType returnValue__;
10143 returnValue__ = Discord_RelationshipHandle_GameRelationshipType(&instance_);
10146uint64_t RelationshipHandle::Id()
const
10148 assert(state_ == DiscordObjectState::Owned);
10149 uint64_t returnValue__;
10150 returnValue__ = Discord_RelationshipHandle_Id(&instance_);
10151 return returnValue__;
10153bool RelationshipHandle::IsSpamRequest()
const
10155 assert(state_ == DiscordObjectState::Owned);
10156 bool returnValue__;
10157 returnValue__ = Discord_RelationshipHandle_IsSpamRequest(&instance_);
10158 return returnValue__;
10160std::optional<discordpp::UserHandle> RelationshipHandle::User()
const
10162 assert(state_ == DiscordObjectState::Owned);
10163 bool returnIsNonNull__;
10164 Discord_UserHandle returnValueNative__;
10165 returnIsNonNull__ = Discord_RelationshipHandle_User(&instance_, &returnValueNative__);
10166 if (!returnIsNonNull__) {
10170 return returnValue__;
10172const UserApplicationProfileHandle UserApplicationProfileHandle::nullobj{
10174 DiscordObjectState::Invalid};
10175UserApplicationProfileHandle::~UserApplicationProfileHandle()
10177 if (state_ == DiscordObjectState::Owned) {
10179 state_ = DiscordObjectState::Invalid;
10182UserApplicationProfileHandle::UserApplicationProfileHandle(
10183 UserApplicationProfileHandle&& other) noexcept
10184 : instance_(other.instance_)
10185 , state_(other.state_)
10187 other.state_ = DiscordObjectState::Invalid;
10189UserApplicationProfileHandle& UserApplicationProfileHandle::operator=(
10190 UserApplicationProfileHandle&& other)
noexcept
10192 if (
this != &other) {
10193 if (state_ == DiscordObjectState::Owned) {
10196 instance_ = other.instance_;
10197 state_ = other.state_;
10198 other.state_ = DiscordObjectState::Invalid;
10202UserApplicationProfileHandle::UserApplicationProfileHandle(
10203 const UserApplicationProfileHandle& other)
10208 Discord_UserApplicationProfileHandle_Clone(&instance_, other.instance());
10210 state_ = DiscordObjectState::Owned;
10213UserApplicationProfileHandle& UserApplicationProfileHandle::operator=(
10214 const UserApplicationProfileHandle& other)
10216 if (
this != &other) {
10217 if (state_ == DiscordObjectState::Owned) {
10219 state_ = DiscordObjectState::Invalid;
10221 if (other.state_ == DiscordObjectState::Owned) {
10222 Discord_UserApplicationProfileHandle_Clone(&instance_, other.instance());
10224 state_ = DiscordObjectState::Owned;
10229UserApplicationProfileHandle::UserApplicationProfileHandle(
10230 Discord_UserApplicationProfileHandle instance,
10231 DiscordObjectState state)
10232 : instance_(instance)
10236void UserApplicationProfileHandle::Drop()
10238 if (state_ != DiscordObjectState::Owned) {
10241 Discord_UserApplicationProfileHandle_Drop(&instance_);
10242 state_ = DiscordObjectState::Invalid;
10246 assert(state_ == DiscordObjectState::Owned);
10247 Discord_String returnValueNative__;
10248 Discord_UserApplicationProfileHandle_AvatarHash(&instance_, &returnValueNative__);
10249 discordpp::String returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
10250 returnValueNative__.size);
10251 Discord_Free(returnValueNative__.ptr);
10252 return returnValue__;
10256 assert(state_ == DiscordObjectState::Owned);
10257 Discord_String returnValueNative__;
10258 Discord_UserApplicationProfileHandle_Metadata(&instance_, &returnValueNative__);
10259 discordpp::String returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
10260 returnValueNative__.size);
10261 Discord_Free(returnValueNative__.ptr);
10262 return returnValue__;
10264std::optional<discordpp::String> UserApplicationProfileHandle::ProviderId()
const
10266 assert(state_ == DiscordObjectState::Owned);
10267 bool returnIsNonNull__;
10268 Discord_String returnValueNative__;
10269 returnIsNonNull__ =
10270 Discord_UserApplicationProfileHandle_ProviderId(&instance_, &returnValueNative__);
10271 if (!returnIsNonNull__) {
10274 discordpp::String returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
10275 returnValueNative__.size);
10276 Discord_Free(returnValueNative__.ptr);
10277 return returnValue__;
10281 assert(state_ == DiscordObjectState::Owned);
10282 Discord_String returnValueNative__;
10283 Discord_UserApplicationProfileHandle_ProviderIssuedUserId(&instance_, &returnValueNative__);
10284 discordpp::String returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
10285 returnValueNative__.size);
10286 Discord_Free(returnValueNative__.ptr);
10287 return returnValue__;
10291 assert(state_ == DiscordObjectState::Owned);
10292 Discord_ExternalIdentityProviderType returnValue__;
10293 returnValue__ = Discord_UserApplicationProfileHandle_ProviderType(&instance_);
10298 assert(state_ == DiscordObjectState::Owned);
10299 Discord_String returnValueNative__;
10300 Discord_UserApplicationProfileHandle_Username(&instance_, &returnValueNative__);
10301 discordpp::String returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
10302 returnValueNative__.size);
10303 Discord_Free(returnValueNative__.ptr);
10304 return returnValue__;
10306const UserHandle UserHandle::nullobj{{}, DiscordObjectState::Invalid};
10307UserHandle::~UserHandle()
10309 if (state_ == DiscordObjectState::Owned) {
10311 state_ = DiscordObjectState::Invalid;
10314UserHandle::UserHandle(UserHandle&& other) noexcept
10315 : instance_(other.instance_)
10316 , state_(other.state_)
10318 other.state_ = DiscordObjectState::Invalid;
10320UserHandle& UserHandle::operator=(UserHandle&& other)
noexcept
10322 if (
this != &other) {
10323 if (state_ == DiscordObjectState::Owned) {
10326 instance_ = other.instance_;
10327 state_ = other.state_;
10328 other.state_ = DiscordObjectState::Invalid;
10332UserHandle::UserHandle(
const UserHandle& arg0)
10337 Discord_UserHandle_Clone(&instance_, arg0.instance());
10339 state_ = DiscordObjectState::Owned;
10342UserHandle& UserHandle::operator=(
const UserHandle& arg0)
10344 if (
this != &arg0) {
10345 if (state_ == DiscordObjectState::Owned) {
10347 state_ = DiscordObjectState::Invalid;
10349 if (arg0.state_ == DiscordObjectState::Owned) {
10350 Discord_UserHandle_Clone(&instance_, arg0.instance());
10352 state_ = DiscordObjectState::Owned;
10357UserHandle::UserHandle(Discord_UserHandle instance, DiscordObjectState state)
10358 : instance_(instance)
10362void UserHandle::Drop()
10364 if (state_ != DiscordObjectState::Owned) {
10367 Discord_UserHandle_Drop(&instance_);
10368 state_ = DiscordObjectState::Invalid;
10370std::optional<discordpp::String> UserHandle::Avatar()
const
10372 assert(state_ == DiscordObjectState::Owned);
10373 bool returnIsNonNull__;
10374 Discord_String returnValueNative__;
10375 returnIsNonNull__ = Discord_UserHandle_Avatar(&instance_, &returnValueNative__);
10376 if (!returnIsNonNull__) {
10379 discordpp::String returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
10380 returnValueNative__.size);
10381 Discord_Free(returnValueNative__.ptr);
10382 return returnValue__;
10386 Discord_String returnValueNative__;
10387 Discord_UserHandle_AvatarTypeToString(
static_cast<Discord_UserHandle_AvatarType
>(type),
10388 &returnValueNative__);
10389 discordpp::String returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
10390 returnValueNative__.size);
10391 Discord_Free(returnValueNative__.ptr);
10392 return returnValue__;
10397 assert(state_ == DiscordObjectState::Owned);
10398 Discord_String returnValueNative__;
10399 Discord_UserHandle_AvatarUrl(&instance_,
10400 static_cast<Discord_UserHandle_AvatarType
>(animatedType),
10401 static_cast<Discord_UserHandle_AvatarType
>(staticType),
10402 &returnValueNative__);
10403 discordpp::String returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
10404 returnValueNative__.size);
10405 Discord_Free(returnValueNative__.ptr);
10406 return returnValue__;
10410 assert(state_ == DiscordObjectState::Owned);
10411 Discord_String returnValueNative__;
10412 Discord_UserHandle_DisplayName(&instance_, &returnValueNative__);
10413 discordpp::String returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
10414 returnValueNative__.size);
10415 Discord_Free(returnValueNative__.ptr);
10416 return returnValue__;
10418std::optional<discordpp::Activity> UserHandle::GameActivity()
const
10420 assert(state_ == DiscordObjectState::Owned);
10421 bool returnIsNonNull__;
10422 Discord_Activity returnValueNative__;
10423 returnIsNonNull__ = Discord_UserHandle_GameActivity(&instance_, &returnValueNative__);
10424 if (!returnIsNonNull__) {
10428 return returnValue__;
10430std::optional<discordpp::String> UserHandle::GlobalName()
const
10432 assert(state_ == DiscordObjectState::Owned);
10433 bool returnIsNonNull__;
10434 Discord_String returnValueNative__;
10435 returnIsNonNull__ = Discord_UserHandle_GlobalName(&instance_, &returnValueNative__);
10436 if (!returnIsNonNull__) {
10439 discordpp::String returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
10440 returnValueNative__.size);
10441 Discord_Free(returnValueNative__.ptr);
10442 return returnValue__;
10444uint64_t UserHandle::Id()
const
10446 assert(state_ == DiscordObjectState::Owned);
10447 uint64_t returnValue__;
10448 returnValue__ = Discord_UserHandle_Id(&instance_);
10449 return returnValue__;
10451bool UserHandle::IsProvisional()
const
10453 assert(state_ == DiscordObjectState::Owned);
10454 bool returnValue__;
10455 returnValue__ = Discord_UserHandle_IsProvisional(&instance_);
10456 return returnValue__;
10460 assert(state_ == DiscordObjectState::Owned);
10461 Discord_RelationshipHandle returnValueNative__{};
10462 Discord_UserHandle_Relationship(&instance_, &returnValueNative__);
10464 return returnValue__;
10468 assert(state_ == DiscordObjectState::Owned);
10469 Discord_StatusType returnValue__;
10470 returnValue__ = Discord_UserHandle_Status(&instance_);
10476 assert(state_ == DiscordObjectState::Owned);
10477 Discord_UserApplicationProfileHandleSpan returnValueNative__;
10478 Discord_UserHandle_UserApplicationProfiles(&instance_, &returnValueNative__);
10480 returnValue__.reserve(returnValueNative__.size);
10481 for (
size_t i__ = 0; i__ < returnValueNative__.size; ++i__) {
10482 returnValue__.emplace_back(returnValueNative__.ptr[i__], DiscordObjectState::Owned);
10484 Discord_Free(returnValueNative__.ptr);
10485 return returnValue__;
10489 assert(state_ == DiscordObjectState::Owned);
10490 Discord_String returnValueNative__;
10491 Discord_UserHandle_Username(&instance_, &returnValueNative__);
10492 discordpp::String returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
10493 returnValueNative__.size);
10494 Discord_Free(returnValueNative__.ptr);
10495 return returnValue__;
10497const LobbyMemberHandle LobbyMemberHandle::nullobj{{}, DiscordObjectState::Invalid};
10498LobbyMemberHandle::~LobbyMemberHandle()
10500 if (state_ == DiscordObjectState::Owned) {
10502 state_ = DiscordObjectState::Invalid;
10505LobbyMemberHandle::LobbyMemberHandle(LobbyMemberHandle&& other) noexcept
10506 : instance_(other.instance_)
10507 , state_(other.state_)
10509 other.state_ = DiscordObjectState::Invalid;
10511LobbyMemberHandle& LobbyMemberHandle::operator=(LobbyMemberHandle&& other)
noexcept
10513 if (
this != &other) {
10514 if (state_ == DiscordObjectState::Owned) {
10517 instance_ = other.instance_;
10518 state_ = other.state_;
10519 other.state_ = DiscordObjectState::Invalid;
10523LobbyMemberHandle::LobbyMemberHandle(
const LobbyMemberHandle& other)
10528 Discord_LobbyMemberHandle_Clone(&instance_, other.instance());
10530 state_ = DiscordObjectState::Owned;
10533LobbyMemberHandle& LobbyMemberHandle::operator=(
const LobbyMemberHandle& other)
10535 if (
this != &other) {
10536 if (state_ == DiscordObjectState::Owned) {
10538 state_ = DiscordObjectState::Invalid;
10540 if (other.state_ == DiscordObjectState::Owned) {
10541 Discord_LobbyMemberHandle_Clone(&instance_, other.instance());
10543 state_ = DiscordObjectState::Owned;
10548LobbyMemberHandle::LobbyMemberHandle(Discord_LobbyMemberHandle instance, DiscordObjectState state)
10549 : instance_(instance)
10553void LobbyMemberHandle::Drop()
10555 if (state_ != DiscordObjectState::Owned) {
10558 Discord_LobbyMemberHandle_Drop(&instance_);
10559 state_ = DiscordObjectState::Invalid;
10561bool LobbyMemberHandle::CanLinkLobby()
const
10563 assert(state_ == DiscordObjectState::Owned);
10564 bool returnValue__;
10565 returnValue__ = Discord_LobbyMemberHandle_CanLinkLobby(&instance_);
10566 return returnValue__;
10568bool LobbyMemberHandle::Connected()
const
10570 assert(state_ == DiscordObjectState::Owned);
10571 bool returnValue__;
10572 returnValue__ = Discord_LobbyMemberHandle_Connected(&instance_);
10573 return returnValue__;
10575uint64_t LobbyMemberHandle::Id()
const
10577 assert(state_ == DiscordObjectState::Owned);
10578 uint64_t returnValue__;
10579 returnValue__ = Discord_LobbyMemberHandle_Id(&instance_);
10580 return returnValue__;
10584 assert(state_ == DiscordObjectState::Owned);
10585 Discord_Properties returnValueNative__;
10586 Discord_LobbyMemberHandle_Metadata(&instance_, &returnValueNative__);
10588 Discord_FreeProperties(returnValueNative__);
10589 return returnValue__;
10591std::optional<discordpp::UserHandle> LobbyMemberHandle::User()
const
10593 assert(state_ == DiscordObjectState::Owned);
10594 bool returnIsNonNull__;
10595 Discord_UserHandle returnValueNative__;
10596 returnIsNonNull__ = Discord_LobbyMemberHandle_User(&instance_, &returnValueNative__);
10597 if (!returnIsNonNull__) {
10601 return returnValue__;
10603const LobbyHandle LobbyHandle::nullobj{{}, DiscordObjectState::Invalid};
10604LobbyHandle::~LobbyHandle()
10606 if (state_ == DiscordObjectState::Owned) {
10608 state_ = DiscordObjectState::Invalid;
10611LobbyHandle::LobbyHandle(LobbyHandle&& other) noexcept
10612 : instance_(other.instance_)
10613 , state_(other.state_)
10615 other.state_ = DiscordObjectState::Invalid;
10617LobbyHandle& LobbyHandle::operator=(LobbyHandle&& other)
noexcept
10619 if (
this != &other) {
10620 if (state_ == DiscordObjectState::Owned) {
10623 instance_ = other.instance_;
10624 state_ = other.state_;
10625 other.state_ = DiscordObjectState::Invalid;
10629LobbyHandle::LobbyHandle(
const LobbyHandle& other)
10634 Discord_LobbyHandle_Clone(&instance_, other.instance());
10636 state_ = DiscordObjectState::Owned;
10639LobbyHandle& LobbyHandle::operator=(
const LobbyHandle& other)
10641 if (
this != &other) {
10642 if (state_ == DiscordObjectState::Owned) {
10644 state_ = DiscordObjectState::Invalid;
10646 if (other.state_ == DiscordObjectState::Owned) {
10647 Discord_LobbyHandle_Clone(&instance_, other.instance());
10649 state_ = DiscordObjectState::Owned;
10654LobbyHandle::LobbyHandle(Discord_LobbyHandle instance, DiscordObjectState state)
10655 : instance_(instance)
10659void LobbyHandle::Drop()
10661 if (state_ != DiscordObjectState::Owned) {
10664 Discord_LobbyHandle_Drop(&instance_);
10665 state_ = DiscordObjectState::Invalid;
10667std::optional<discordpp::CallInfoHandle> LobbyHandle::GetCallInfoHandle()
const
10669 assert(state_ == DiscordObjectState::Owned);
10670 bool returnIsNonNull__;
10671 Discord_CallInfoHandle returnValueNative__;
10672 returnIsNonNull__ = Discord_LobbyHandle_GetCallInfoHandle(&instance_, &returnValueNative__);
10673 if (!returnIsNonNull__) {
10677 return returnValue__;
10679std::optional<discordpp::LobbyMemberHandle> LobbyHandle::GetLobbyMemberHandle(
10680 uint64_t memberId)
const
10682 assert(state_ == DiscordObjectState::Owned);
10683 bool returnIsNonNull__;
10684 Discord_LobbyMemberHandle returnValueNative__;
10685 returnIsNonNull__ =
10686 Discord_LobbyHandle_GetLobbyMemberHandle(&instance_, memberId, &returnValueNative__);
10687 if (!returnIsNonNull__) {
10691 return returnValue__;
10693uint64_t LobbyHandle::Id()
const
10695 assert(state_ == DiscordObjectState::Owned);
10696 uint64_t returnValue__;
10697 returnValue__ = Discord_LobbyHandle_Id(&instance_);
10698 return returnValue__;
10700std::optional<discordpp::LinkedChannel> LobbyHandle::LinkedChannel()
const
10702 assert(state_ == DiscordObjectState::Owned);
10703 bool returnIsNonNull__;
10704 Discord_LinkedChannel returnValueNative__;
10705 returnIsNonNull__ = Discord_LobbyHandle_LinkedChannel(&instance_, &returnValueNative__);
10706 if (!returnIsNonNull__) {
10710 return returnValue__;
10714 assert(state_ == DiscordObjectState::Owned);
10715 Discord_UInt64Span returnValueNative__;
10716 Discord_LobbyHandle_LobbyMemberIds(&instance_, &returnValueNative__);
10718 returnValueNative__.ptr + returnValueNative__.size);
10719 Discord_Free(returnValueNative__.ptr);
10720 return returnValue__;
10724 assert(state_ == DiscordObjectState::Owned);
10725 Discord_LobbyMemberHandleSpan returnValueNative__;
10726 Discord_LobbyHandle_LobbyMembers(&instance_, &returnValueNative__);
10728 returnValue__.reserve(returnValueNative__.size);
10729 for (
size_t i__ = 0; i__ < returnValueNative__.size; ++i__) {
10730 returnValue__.emplace_back(returnValueNative__.ptr[i__], DiscordObjectState::Owned);
10732 Discord_Free(returnValueNative__.ptr);
10733 return returnValue__;
10737 assert(state_ == DiscordObjectState::Owned);
10738 Discord_Properties returnValueNative__;
10739 Discord_LobbyHandle_Metadata(&instance_, &returnValueNative__);
10741 Discord_FreeProperties(returnValueNative__);
10742 return returnValue__;
10744const AdditionalContent AdditionalContent::nullobj{{}, DiscordObjectState::Invalid};
10745AdditionalContent::~AdditionalContent()
10747 if (state_ == DiscordObjectState::Owned) {
10749 state_ = DiscordObjectState::Invalid;
10752AdditionalContent::AdditionalContent(AdditionalContent&& other) noexcept
10753 : instance_(other.instance_)
10754 , state_(other.state_)
10756 other.state_ = DiscordObjectState::Invalid;
10758AdditionalContent& AdditionalContent::operator=(AdditionalContent&& other)
noexcept
10760 if (
this != &other) {
10761 if (state_ == DiscordObjectState::Owned) {
10764 instance_ = other.instance_;
10765 state_ = other.state_;
10766 other.state_ = DiscordObjectState::Invalid;
10770AdditionalContent::AdditionalContent(
const AdditionalContent& arg0)
10775 Discord_AdditionalContent_Clone(&instance_, arg0.instance());
10777 state_ = DiscordObjectState::Owned;
10780AdditionalContent& AdditionalContent::operator=(
const AdditionalContent& arg0)
10782 if (
this != &arg0) {
10783 if (state_ == DiscordObjectState::Owned) {
10785 state_ = DiscordObjectState::Invalid;
10787 if (arg0.state_ == DiscordObjectState::Owned) {
10788 Discord_AdditionalContent_Clone(&instance_, arg0.instance());
10790 state_ = DiscordObjectState::Owned;
10795AdditionalContent::AdditionalContent(Discord_AdditionalContent instance, DiscordObjectState state)
10796 : instance_(instance)
10800AdditionalContent::AdditionalContent()
10802 assert(state_ == DiscordObjectState::Invalid);
10803 Discord_AdditionalContent_Init(&instance_);
10804 state_ = DiscordObjectState::Owned;
10806void AdditionalContent::Drop()
10808 if (state_ != DiscordObjectState::Owned) {
10811 Discord_AdditionalContent_Drop(&instance_);
10812 state_ = DiscordObjectState::Invalid;
10816 assert(state_ == DiscordObjectState::Owned);
10817 bool returnValue__;
10818 returnValue__ = Discord_AdditionalContent_Equals(&instance_, rhs.instance());
10819 return returnValue__;
10823 Discord_String returnValueNative__;
10824 Discord_AdditionalContent_TypeToString(
static_cast<Discord_AdditionalContentType
>(type),
10825 &returnValueNative__);
10826 discordpp::String returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
10827 returnValueNative__.size);
10828 Discord_Free(returnValueNative__.ptr);
10829 return returnValue__;
10833 assert(state_ == DiscordObjectState::Owned);
10834 Discord_AdditionalContentType returnValue__;
10835 returnValue__ = Discord_AdditionalContent_Type(&instance_);
10840 assert(state_ == DiscordObjectState::Owned);
10841 Discord_AdditionalContent_SetType(&instance_,
static_cast<Discord_AdditionalContentType
>(Type));
10843std::optional<discordpp::String> AdditionalContent::Title()
const
10845 assert(state_ == DiscordObjectState::Owned);
10846 bool returnIsNonNull__;
10847 Discord_String returnValueNative__;
10848 returnIsNonNull__ = Discord_AdditionalContent_Title(&instance_, &returnValueNative__);
10849 if (!returnIsNonNull__) {
10852 discordpp::String returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
10853 returnValueNative__.size);
10854 Discord_Free(returnValueNative__.ptr);
10855 return returnValue__;
10857void AdditionalContent::SetTitle(std::optional<std::string_view> Title)
10859 assert(state_ == DiscordObjectState::Owned);
10860 Discord_String Title__str{};
10861 if (Title.has_value()) {
10862 Title__str.ptr = (uint8_t*)(Title->data() !=
nullptr ? Title->data() :
"");
10863 Title__str.size = Title->size();
10865 Discord_AdditionalContent_SetTitle(&instance_, (Title.has_value() ? &Title__str :
nullptr));
10867uint8_t AdditionalContent::Count()
const
10869 assert(state_ == DiscordObjectState::Owned);
10870 uint8_t returnValue__;
10871 returnValue__ = Discord_AdditionalContent_Count(&instance_);
10872 return returnValue__;
10874void AdditionalContent::SetCount(uint8_t Count)
10876 assert(state_ == DiscordObjectState::Owned);
10877 Discord_AdditionalContent_SetCount(&instance_, Count);
10879const MessageHandle MessageHandle::nullobj{{}, DiscordObjectState::Invalid};
10880MessageHandle::~MessageHandle()
10882 if (state_ == DiscordObjectState::Owned) {
10884 state_ = DiscordObjectState::Invalid;
10887MessageHandle::MessageHandle(MessageHandle&& other) noexcept
10888 : instance_(other.instance_)
10889 , state_(other.state_)
10891 other.state_ = DiscordObjectState::Invalid;
10893MessageHandle& MessageHandle::operator=(MessageHandle&& other)
noexcept
10895 if (
this != &other) {
10896 if (state_ == DiscordObjectState::Owned) {
10899 instance_ = other.instance_;
10900 state_ = other.state_;
10901 other.state_ = DiscordObjectState::Invalid;
10905MessageHandle::MessageHandle(
const MessageHandle& other)
10910 Discord_MessageHandle_Clone(&instance_, other.instance());
10912 state_ = DiscordObjectState::Owned;
10915MessageHandle& MessageHandle::operator=(
const MessageHandle& other)
10917 if (
this != &other) {
10918 if (state_ == DiscordObjectState::Owned) {
10920 state_ = DiscordObjectState::Invalid;
10922 if (other.state_ == DiscordObjectState::Owned) {
10923 Discord_MessageHandle_Clone(&instance_, other.instance());
10925 state_ = DiscordObjectState::Owned;
10930MessageHandle::MessageHandle(Discord_MessageHandle instance, DiscordObjectState state)
10931 : instance_(instance)
10935void MessageHandle::Drop()
10937 if (state_ != DiscordObjectState::Owned) {
10940 Discord_MessageHandle_Drop(&instance_);
10941 state_ = DiscordObjectState::Invalid;
10943std::optional<discordpp::AdditionalContent> MessageHandle::AdditionalContent()
const
10945 assert(state_ == DiscordObjectState::Owned);
10946 bool returnIsNonNull__;
10947 Discord_AdditionalContent returnValueNative__;
10948 returnIsNonNull__ = Discord_MessageHandle_AdditionalContent(&instance_, &returnValueNative__);
10949 if (!returnIsNonNull__) {
10953 return returnValue__;
10955std::optional<discordpp::String> MessageHandle::AdditionalName()
const
10957 assert(state_ == DiscordObjectState::Owned);
10958 bool returnIsNonNull__;
10959 Discord_String returnValueNative__;
10960 returnIsNonNull__ = Discord_MessageHandle_AdditionalName(&instance_, &returnValueNative__);
10961 if (!returnIsNonNull__) {
10964 discordpp::String returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
10965 returnValueNative__.size);
10966 Discord_Free(returnValueNative__.ptr);
10967 return returnValue__;
10969std::optional<uint64_t> MessageHandle::ApplicationId()
const
10971 assert(state_ == DiscordObjectState::Owned);
10972 bool returnIsNonNull__;
10973 uint64_t returnValue__;
10974 returnIsNonNull__ = Discord_MessageHandle_ApplicationId(&instance_, &returnValue__);
10975 if (!returnIsNonNull__) {
10976 return std::nullopt;
10978 return returnValue__;
10980std::optional<discordpp::UserHandle> MessageHandle::Author()
const
10982 assert(state_ == DiscordObjectState::Owned);
10983 bool returnIsNonNull__;
10984 Discord_UserHandle returnValueNative__;
10985 returnIsNonNull__ = Discord_MessageHandle_Author(&instance_, &returnValueNative__);
10986 if (!returnIsNonNull__) {
10990 return returnValue__;
10992uint64_t MessageHandle::AuthorId()
const
10994 assert(state_ == DiscordObjectState::Owned);
10995 uint64_t returnValue__;
10996 returnValue__ = Discord_MessageHandle_AuthorId(&instance_);
10997 return returnValue__;
10999std::optional<discordpp::ChannelHandle> MessageHandle::Channel()
const
11001 assert(state_ == DiscordObjectState::Owned);
11002 bool returnIsNonNull__;
11003 Discord_ChannelHandle returnValueNative__;
11004 returnIsNonNull__ = Discord_MessageHandle_Channel(&instance_, &returnValueNative__);
11005 if (!returnIsNonNull__) {
11009 return returnValue__;
11011uint64_t MessageHandle::ChannelId()
const
11013 assert(state_ == DiscordObjectState::Owned);
11014 uint64_t returnValue__;
11015 returnValue__ = Discord_MessageHandle_ChannelId(&instance_);
11016 return returnValue__;
11020 assert(state_ == DiscordObjectState::Owned);
11021 Discord_String returnValueNative__;
11022 Discord_MessageHandle_Content(&instance_, &returnValueNative__);
11023 discordpp::String returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
11024 returnValueNative__.size);
11025 Discord_Free(returnValueNative__.ptr);
11026 return returnValue__;
11028std::optional<discordpp::DisclosureTypes> MessageHandle::DisclosureType()
const
11030 assert(state_ == DiscordObjectState::Owned);
11031 bool returnIsNonNull__;
11032 Discord_DisclosureTypes returnValueNative__;
11033 returnIsNonNull__ = Discord_MessageHandle_DisclosureType(&instance_, &returnValueNative__);
11034 if (!returnIsNonNull__) {
11038 return returnValue__;
11040uint64_t MessageHandle::EditedTimestamp()
const
11042 assert(state_ == DiscordObjectState::Owned);
11043 uint64_t returnValue__;
11044 returnValue__ = Discord_MessageHandle_EditedTimestamp(&instance_);
11045 return returnValue__;
11047uint64_t MessageHandle::Id()
const
11049 assert(state_ == DiscordObjectState::Owned);
11050 uint64_t returnValue__;
11051 returnValue__ = Discord_MessageHandle_Id(&instance_);
11052 return returnValue__;
11054std::optional<discordpp::LobbyHandle> MessageHandle::Lobby()
const
11056 assert(state_ == DiscordObjectState::Owned);
11057 bool returnIsNonNull__;
11058 Discord_LobbyHandle returnValueNative__;
11059 returnIsNonNull__ = Discord_MessageHandle_Lobby(&instance_, &returnValueNative__);
11060 if (!returnIsNonNull__) {
11064 return returnValue__;
11068 assert(state_ == DiscordObjectState::Owned);
11069 Discord_Properties returnValueNative__;
11070 Discord_MessageHandle_Metadata(&instance_, &returnValueNative__);
11072 Discord_FreeProperties(returnValueNative__);
11073 return returnValue__;
11077 assert(state_ == DiscordObjectState::Owned);
11078 Discord_Properties returnValueNative__;
11079 Discord_MessageHandle_ModerationMetadata(&instance_, &returnValueNative__);
11081 Discord_FreeProperties(returnValueNative__);
11082 return returnValue__;
11086 assert(state_ == DiscordObjectState::Owned);
11087 Discord_String returnValueNative__;
11088 Discord_MessageHandle_RawContent(&instance_, &returnValueNative__);
11089 discordpp::String returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
11090 returnValueNative__.size);
11091 Discord_Free(returnValueNative__.ptr);
11092 return returnValue__;
11094std::optional<discordpp::UserHandle> MessageHandle::Recipient()
const
11096 assert(state_ == DiscordObjectState::Owned);
11097 bool returnIsNonNull__;
11098 Discord_UserHandle returnValueNative__;
11099 returnIsNonNull__ = Discord_MessageHandle_Recipient(&instance_, &returnValueNative__);
11100 if (!returnIsNonNull__) {
11104 return returnValue__;
11106uint64_t MessageHandle::RecipientId()
const
11108 assert(state_ == DiscordObjectState::Owned);
11109 uint64_t returnValue__;
11110 returnValue__ = Discord_MessageHandle_RecipientId(&instance_);
11111 return returnValue__;
11113bool MessageHandle::SentFromGame()
const
11115 assert(state_ == DiscordObjectState::Owned);
11116 bool returnValue__;
11117 returnValue__ = Discord_MessageHandle_SentFromGame(&instance_);
11118 return returnValue__;
11120uint64_t MessageHandle::SentTimestamp()
const
11122 assert(state_ == DiscordObjectState::Owned);
11123 uint64_t returnValue__;
11124 returnValue__ = Discord_MessageHandle_SentTimestamp(&instance_);
11125 return returnValue__;
11127const AudioDevice AudioDevice::nullobj{{}, DiscordObjectState::Invalid};
11128AudioDevice::~AudioDevice()
11130 if (state_ == DiscordObjectState::Owned) {
11132 state_ = DiscordObjectState::Invalid;
11135AudioDevice::AudioDevice(AudioDevice&& other) noexcept
11136 : instance_(other.instance_)
11137 , state_(other.state_)
11139 other.state_ = DiscordObjectState::Invalid;
11141AudioDevice& AudioDevice::operator=(AudioDevice&& other)
noexcept
11143 if (
this != &other) {
11144 if (state_ == DiscordObjectState::Owned) {
11147 instance_ = other.instance_;
11148 state_ = other.state_;
11149 other.state_ = DiscordObjectState::Invalid;
11153AudioDevice::AudioDevice(
const AudioDevice& arg0)
11158 Discord_AudioDevice_Clone(&instance_, arg0.instance());
11160 state_ = DiscordObjectState::Owned;
11163AudioDevice& AudioDevice::operator=(
const AudioDevice& arg0)
11165 if (
this != &arg0) {
11166 if (state_ == DiscordObjectState::Owned) {
11168 state_ = DiscordObjectState::Invalid;
11170 if (arg0.state_ == DiscordObjectState::Owned) {
11171 Discord_AudioDevice_Clone(&instance_, arg0.instance());
11173 state_ = DiscordObjectState::Owned;
11178AudioDevice::AudioDevice(Discord_AudioDevice instance, DiscordObjectState state)
11179 : instance_(instance)
11183void AudioDevice::Drop()
11185 if (state_ != DiscordObjectState::Owned) {
11188 Discord_AudioDevice_Drop(&instance_);
11189 state_ = DiscordObjectState::Invalid;
11193 assert(state_ == DiscordObjectState::Owned);
11194 bool returnValue__;
11195 returnValue__ = Discord_AudioDevice_Equals(&instance_, rhs.instance());
11196 return returnValue__;
11200 assert(state_ == DiscordObjectState::Owned);
11201 Discord_String returnValueNative__;
11202 Discord_AudioDevice_Id(&instance_, &returnValueNative__);
11203 discordpp::String returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
11204 returnValueNative__.size);
11205 Discord_Free(returnValueNative__.ptr);
11206 return returnValue__;
11208void AudioDevice::SetId(std::string_view Id)
11210 assert(state_ == DiscordObjectState::Owned);
11211 Discord_String Id__str{(uint8_t*)(Id.data() !=
nullptr ? Id.data() :
""), Id.size()};
11212 Discord_AudioDevice_SetId(&instance_, Id__str);
11216 assert(state_ == DiscordObjectState::Owned);
11217 Discord_String returnValueNative__;
11218 Discord_AudioDevice_Name(&instance_, &returnValueNative__);
11219 discordpp::String returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
11220 returnValueNative__.size);
11221 Discord_Free(returnValueNative__.ptr);
11222 return returnValue__;
11224void AudioDevice::SetName(std::string_view Name)
11226 assert(state_ == DiscordObjectState::Owned);
11227 Discord_String Name__str{(uint8_t*)(
Name.data() !=
nullptr ?
Name.data() :
""),
Name.size()};
11228 Discord_AudioDevice_SetName(&instance_, Name__str);
11230bool AudioDevice::IsDefault()
const
11232 assert(state_ == DiscordObjectState::Owned);
11233 bool returnValue__;
11234 returnValue__ = Discord_AudioDevice_IsDefault(&instance_);
11235 return returnValue__;
11237void AudioDevice::SetIsDefault(
bool IsDefault)
11239 assert(state_ == DiscordObjectState::Owned);
11240 Discord_AudioDevice_SetIsDefault(&instance_, IsDefault);
11242const VoiceSettings VoiceSettings::nullobj{{}, DiscordObjectState::Invalid};
11243VoiceSettings::~VoiceSettings()
11245 if (state_ == DiscordObjectState::Owned) {
11247 state_ = DiscordObjectState::Invalid;
11250VoiceSettings::VoiceSettings(VoiceSettings&& other) noexcept
11251 : instance_(other.instance_)
11252 , state_(other.state_)
11254 other.state_ = DiscordObjectState::Invalid;
11256VoiceSettings& VoiceSettings::operator=(VoiceSettings&& other)
noexcept
11258 if (
this != &other) {
11259 if (state_ == DiscordObjectState::Owned) {
11262 instance_ = other.instance_;
11263 state_ = other.state_;
11264 other.state_ = DiscordObjectState::Invalid;
11268VoiceSettings::VoiceSettings(
const VoiceSettings& arg0)
11273 Discord_VoiceSettings_Clone(&instance_, arg0.instance());
11275 state_ = DiscordObjectState::Owned;
11278VoiceSettings& VoiceSettings::operator=(
const VoiceSettings& arg0)
11280 if (
this != &arg0) {
11281 if (state_ == DiscordObjectState::Owned) {
11283 state_ = DiscordObjectState::Invalid;
11285 if (arg0.state_ == DiscordObjectState::Owned) {
11286 Discord_VoiceSettings_Clone(&instance_, arg0.instance());
11288 state_ = DiscordObjectState::Owned;
11293VoiceSettings::VoiceSettings(Discord_VoiceSettings instance, DiscordObjectState state)
11294 : instance_(instance)
11298void VoiceSettings::Drop()
11300 if (state_ != DiscordObjectState::Owned) {
11303 Discord_VoiceSettings_Drop(&instance_);
11304 state_ = DiscordObjectState::Invalid;
11306bool VoiceSettings::SelfMute()
const
11308 assert(state_ == DiscordObjectState::Owned);
11309 bool returnValue__;
11310 returnValue__ = Discord_VoiceSettings_SelfMute(&instance_);
11311 return returnValue__;
11313void VoiceSettings::SetSelfMute(
bool SelfMute)
11315 assert(state_ == DiscordObjectState::Owned);
11316 Discord_VoiceSettings_SetSelfMute(&instance_, SelfMute);
11318bool VoiceSettings::SelfDeaf()
const
11320 assert(state_ == DiscordObjectState::Owned);
11321 bool returnValue__;
11322 returnValue__ = Discord_VoiceSettings_SelfDeaf(&instance_);
11323 return returnValue__;
11325void VoiceSettings::SetSelfDeaf(
bool SelfDeaf)
11327 assert(state_ == DiscordObjectState::Owned);
11328 Discord_VoiceSettings_SetSelfDeaf(&instance_, SelfDeaf);
11332 assert(state_ == DiscordObjectState::Owned);
11333 Discord_VoiceInputModeType returnValue__;
11334 returnValue__ = Discord_VoiceSettings_InputMode(&instance_);
11339 assert(state_ == DiscordObjectState::Owned);
11340 Discord_VoiceSettings_SetInputMode(&instance_,
11341 static_cast<Discord_VoiceInputModeType
>(InputMode));
11345 assert(state_ == DiscordObjectState::Owned);
11346 Discord_String returnValueNative__;
11347 Discord_VoiceSettings_PttKey(&instance_, &returnValueNative__);
11348 discordpp::String returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
11349 returnValueNative__.size);
11350 Discord_Free(returnValueNative__.ptr);
11351 return returnValue__;
11353void VoiceSettings::SetPttKey(std::string_view PttKey)
11355 assert(state_ == DiscordObjectState::Owned);
11356 Discord_String PttKey__str{(uint8_t*)(PttKey.data() !=
nullptr ? PttKey.data() :
""),
11358 Discord_VoiceSettings_SetPttKey(&instance_, PttKey__str);
11360float VoiceSettings::InputVolume()
const
11362 assert(state_ == DiscordObjectState::Owned);
11363 float returnValue__;
11364 returnValue__ = Discord_VoiceSettings_InputVolume(&instance_);
11365 return returnValue__;
11367void VoiceSettings::SetInputVolume(
float InputVolume)
11369 assert(state_ == DiscordObjectState::Owned);
11370 Discord_VoiceSettings_SetInputVolume(&instance_, InputVolume);
11372float VoiceSettings::OutputVolume()
const
11374 assert(state_ == DiscordObjectState::Owned);
11375 float returnValue__;
11376 returnValue__ = Discord_VoiceSettings_OutputVolume(&instance_);
11377 return returnValue__;
11379void VoiceSettings::SetOutputVolume(
float OutputVolume)
11381 assert(state_ == DiscordObjectState::Owned);
11382 Discord_VoiceSettings_SetOutputVolume(&instance_, OutputVolume);
11384bool VoiceSettings::AutomaticGainControl()
const
11386 assert(state_ == DiscordObjectState::Owned);
11387 bool returnValue__;
11388 returnValue__ = Discord_VoiceSettings_AutomaticGainControl(&instance_);
11389 return returnValue__;
11391void VoiceSettings::SetAutomaticGainControl(
bool AutomaticGainControl)
11393 assert(state_ == DiscordObjectState::Owned);
11394 Discord_VoiceSettings_SetAutomaticGainControl(&instance_, AutomaticGainControl);
11396bool VoiceSettings::EchoCancellation()
const
11398 assert(state_ == DiscordObjectState::Owned);
11399 bool returnValue__;
11400 returnValue__ = Discord_VoiceSettings_EchoCancellation(&instance_);
11401 return returnValue__;
11403void VoiceSettings::SetEchoCancellation(
bool EchoCancellation)
11405 assert(state_ == DiscordObjectState::Owned);
11406 Discord_VoiceSettings_SetEchoCancellation(&instance_, EchoCancellation);
11408bool VoiceSettings::NoiseSuppression()
const
11410 assert(state_ == DiscordObjectState::Owned);
11411 bool returnValue__;
11412 returnValue__ = Discord_VoiceSettings_NoiseSuppression(&instance_);
11413 return returnValue__;
11415void VoiceSettings::SetNoiseSuppression(
bool NoiseSuppression)
11417 assert(state_ == DiscordObjectState::Owned);
11418 Discord_VoiceSettings_SetNoiseSuppression(&instance_, NoiseSuppression);
11420bool VoiceSettings::NoiseCancellation()
const
11422 assert(state_ == DiscordObjectState::Owned);
11423 bool returnValue__;
11424 returnValue__ = Discord_VoiceSettings_NoiseCancellation(&instance_);
11425 return returnValue__;
11427void VoiceSettings::SetNoiseCancellation(
bool NoiseCancellation)
11429 assert(state_ == DiscordObjectState::Owned);
11430 Discord_VoiceSettings_SetNoiseCancellation(&instance_, NoiseCancellation);
11432const DiscordClientGuildVoiceMember DiscordClientGuildVoiceMember::nullobj{
11434 DiscordObjectState::Invalid};
11435DiscordClientGuildVoiceMember::~DiscordClientGuildVoiceMember()
11437 if (state_ == DiscordObjectState::Owned) {
11439 state_ = DiscordObjectState::Invalid;
11442DiscordClientGuildVoiceMember::DiscordClientGuildVoiceMember(
11443 DiscordClientGuildVoiceMember&& other) noexcept
11444 : instance_(other.instance_)
11445 , state_(other.state_)
11447 other.state_ = DiscordObjectState::Invalid;
11449DiscordClientGuildVoiceMember& DiscordClientGuildVoiceMember::operator=(
11450 DiscordClientGuildVoiceMember&& other)
noexcept
11452 if (
this != &other) {
11453 if (state_ == DiscordObjectState::Owned) {
11456 instance_ = other.instance_;
11457 state_ = other.state_;
11458 other.state_ = DiscordObjectState::Invalid;
11462DiscordClientGuildVoiceMember::DiscordClientGuildVoiceMember(
11463 const DiscordClientGuildVoiceMember& arg0)
11468 Discord_DiscordClientGuildVoiceMember_Clone(&instance_, arg0.instance());
11470 state_ = DiscordObjectState::Owned;
11473DiscordClientGuildVoiceMember& DiscordClientGuildVoiceMember::operator=(
11474 const DiscordClientGuildVoiceMember& arg0)
11476 if (
this != &arg0) {
11477 if (state_ == DiscordObjectState::Owned) {
11479 state_ = DiscordObjectState::Invalid;
11481 if (arg0.state_ == DiscordObjectState::Owned) {
11482 Discord_DiscordClientGuildVoiceMember_Clone(&instance_, arg0.instance());
11484 state_ = DiscordObjectState::Owned;
11489DiscordClientGuildVoiceMember::DiscordClientGuildVoiceMember(
11490 Discord_DiscordClientGuildVoiceMember instance,
11491 DiscordObjectState state)
11492 : instance_(instance)
11496DiscordClientGuildVoiceMember::DiscordClientGuildVoiceMember()
11498 assert(state_ == DiscordObjectState::Invalid);
11499 Discord_DiscordClientGuildVoiceMember_Init(&instance_);
11500 state_ = DiscordObjectState::Owned;
11502void DiscordClientGuildVoiceMember::Drop()
11504 if (state_ != DiscordObjectState::Owned) {
11507 Discord_DiscordClientGuildVoiceMember_Drop(&instance_);
11508 state_ = DiscordObjectState::Invalid;
11510uint64_t DiscordClientGuildVoiceMember::UserId()
const
11512 assert(state_ == DiscordObjectState::Owned);
11513 uint64_t returnValue__;
11514 returnValue__ = Discord_DiscordClientGuildVoiceMember_UserId(&instance_);
11515 return returnValue__;
11517void DiscordClientGuildVoiceMember::SetUserId(uint64_t UserId)
11519 assert(state_ == DiscordObjectState::Owned);
11520 Discord_DiscordClientGuildVoiceMember_SetUserId(&instance_, UserId);
11524 assert(state_ == DiscordObjectState::Owned);
11525 Discord_String returnValueNative__;
11526 Discord_DiscordClientGuildVoiceMember_DisplayName(&instance_, &returnValueNative__);
11527 discordpp::String returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
11528 returnValueNative__.size);
11529 Discord_Free(returnValueNative__.ptr);
11530 return returnValue__;
11532void DiscordClientGuildVoiceMember::SetDisplayName(std::string_view DisplayName)
11534 assert(state_ == DiscordObjectState::Owned);
11535 Discord_String DisplayName__str{
11536 (uint8_t*)(DisplayName.data() !=
nullptr ? DisplayName.data() :
""), DisplayName.size()};
11537 Discord_DiscordClientGuildVoiceMember_SetDisplayName(&instance_, DisplayName__str);
11541 assert(state_ == DiscordObjectState::Owned);
11542 Discord_String returnValueNative__;
11543 Discord_DiscordClientGuildVoiceMember_Username(&instance_, &returnValueNative__);
11544 discordpp::String returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
11545 returnValueNative__.size);
11546 Discord_Free(returnValueNative__.ptr);
11547 return returnValue__;
11549void DiscordClientGuildVoiceMember::SetUsername(std::string_view Username)
11551 assert(state_ == DiscordObjectState::Owned);
11552 Discord_String Username__str{(uint8_t*)(Username.data() !=
nullptr ? Username.data() :
""),
11554 Discord_DiscordClientGuildVoiceMember_SetUsername(&instance_, Username__str);
11556std::optional<discordpp::String> DiscordClientGuildVoiceMember::AvatarHash()
const
11558 assert(state_ == DiscordObjectState::Owned);
11559 bool returnIsNonNull__;
11560 Discord_String returnValueNative__;
11561 returnIsNonNull__ =
11562 Discord_DiscordClientGuildVoiceMember_AvatarHash(&instance_, &returnValueNative__);
11563 if (!returnIsNonNull__) {
11566 discordpp::String returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
11567 returnValueNative__.size);
11568 Discord_Free(returnValueNative__.ptr);
11569 return returnValue__;
11571void DiscordClientGuildVoiceMember::SetAvatarHash(std::optional<std::string_view> AvatarHash)
11573 assert(state_ == DiscordObjectState::Owned);
11574 Discord_String AvatarHash__str{};
11575 if (AvatarHash.has_value()) {
11576 AvatarHash__str.ptr = (uint8_t*)(AvatarHash->data() !=
nullptr ? AvatarHash->data() :
"");
11577 AvatarHash__str.size = AvatarHash->size();
11579 Discord_DiscordClientGuildVoiceMember_SetAvatarHash(
11580 &instance_, (AvatarHash.has_value() ? &AvatarHash__str :
nullptr));
11582bool DiscordClientGuildVoiceMember::Mute()
const
11584 assert(state_ == DiscordObjectState::Owned);
11585 bool returnValue__;
11586 returnValue__ = Discord_DiscordClientGuildVoiceMember_Mute(&instance_);
11587 return returnValue__;
11589void DiscordClientGuildVoiceMember::SetMute(
bool Mute)
11591 assert(state_ == DiscordObjectState::Owned);
11592 Discord_DiscordClientGuildVoiceMember_SetMute(&instance_, Mute);
11594bool DiscordClientGuildVoiceMember::Deaf()
const
11596 assert(state_ == DiscordObjectState::Owned);
11597 bool returnValue__;
11598 returnValue__ = Discord_DiscordClientGuildVoiceMember_Deaf(&instance_);
11599 return returnValue__;
11601void DiscordClientGuildVoiceMember::SetDeaf(
bool Deaf)
11603 assert(state_ == DiscordObjectState::Owned);
11604 Discord_DiscordClientGuildVoiceMember_SetDeaf(&instance_, Deaf);
11606bool DiscordClientGuildVoiceMember::SelfMute()
const
11608 assert(state_ == DiscordObjectState::Owned);
11609 bool returnValue__;
11610 returnValue__ = Discord_DiscordClientGuildVoiceMember_SelfMute(&instance_);
11611 return returnValue__;
11613void DiscordClientGuildVoiceMember::SetSelfMute(
bool SelfMute)
11615 assert(state_ == DiscordObjectState::Owned);
11616 Discord_DiscordClientGuildVoiceMember_SetSelfMute(&instance_, SelfMute);
11618bool DiscordClientGuildVoiceMember::SelfDeaf()
const
11620 assert(state_ == DiscordObjectState::Owned);
11621 bool returnValue__;
11622 returnValue__ = Discord_DiscordClientGuildVoiceMember_SelfDeaf(&instance_);
11623 return returnValue__;
11625void DiscordClientGuildVoiceMember::SetSelfDeaf(
bool SelfDeaf)
11627 assert(state_ == DiscordObjectState::Owned);
11628 Discord_DiscordClientGuildVoiceMember_SetSelfDeaf(&instance_, SelfDeaf);
11632 assert(state_ == DiscordObjectState::Owned);
11633 Discord_DiscordClientGuildVoiceSpeakingState returnValue__;
11634 returnValue__ = Discord_DiscordClientGuildVoiceMember_Speaking(&instance_);
11637void DiscordClientGuildVoiceMember::SetSpeaking(
11640 assert(state_ == DiscordObjectState::Owned);
11641 Discord_DiscordClientGuildVoiceMember_SetSpeaking(
11642 &instance_,
static_cast<Discord_DiscordClientGuildVoiceSpeakingState
>(Speaking));
11644const DiscordClientGuildVoiceSnapshot DiscordClientGuildVoiceSnapshot::nullobj{
11646 DiscordObjectState::Invalid};
11647DiscordClientGuildVoiceSnapshot::~DiscordClientGuildVoiceSnapshot()
11649 if (state_ == DiscordObjectState::Owned) {
11651 state_ = DiscordObjectState::Invalid;
11654DiscordClientGuildVoiceSnapshot::DiscordClientGuildVoiceSnapshot(
11655 DiscordClientGuildVoiceSnapshot&& other) noexcept
11656 : instance_(other.instance_)
11657 , state_(other.state_)
11659 other.state_ = DiscordObjectState::Invalid;
11661DiscordClientGuildVoiceSnapshot& DiscordClientGuildVoiceSnapshot::operator=(
11662 DiscordClientGuildVoiceSnapshot&& other)
noexcept
11664 if (
this != &other) {
11665 if (state_ == DiscordObjectState::Owned) {
11668 instance_ = other.instance_;
11669 state_ = other.state_;
11670 other.state_ = DiscordObjectState::Invalid;
11674DiscordClientGuildVoiceSnapshot::DiscordClientGuildVoiceSnapshot(
11675 const DiscordClientGuildVoiceSnapshot& arg0)
11680 Discord_DiscordClientGuildVoiceSnapshot_Clone(&instance_, arg0.instance());
11682 state_ = DiscordObjectState::Owned;
11685DiscordClientGuildVoiceSnapshot& DiscordClientGuildVoiceSnapshot::operator=(
11686 const DiscordClientGuildVoiceSnapshot& arg0)
11688 if (
this != &arg0) {
11689 if (state_ == DiscordObjectState::Owned) {
11691 state_ = DiscordObjectState::Invalid;
11693 if (arg0.state_ == DiscordObjectState::Owned) {
11694 Discord_DiscordClientGuildVoiceSnapshot_Clone(&instance_, arg0.instance());
11696 state_ = DiscordObjectState::Owned;
11701DiscordClientGuildVoiceSnapshot::DiscordClientGuildVoiceSnapshot(
11702 Discord_DiscordClientGuildVoiceSnapshot instance,
11703 DiscordObjectState state)
11704 : instance_(instance)
11708void DiscordClientGuildVoiceSnapshot::Drop()
11710 if (state_ != DiscordObjectState::Owned) {
11713 Discord_DiscordClientGuildVoiceSnapshot_Drop(&instance_);
11714 state_ = DiscordObjectState::Invalid;
11719 assert(state_ == DiscordObjectState::Owned);
11720 Discord_DiscordClientGuildVoiceMemberSpan returnValueNative__;
11721 Discord_DiscordClientGuildVoiceSnapshot_Members(&instance_, &returnValueNative__);
11723 returnValue__.reserve(returnValueNative__.size);
11724 for (
size_t i__ = 0; i__ < returnValueNative__.size; ++i__) {
11725 returnValue__.emplace_back(returnValueNative__.ptr[i__], DiscordObjectState::Owned);
11727 Discord_Free(returnValueNative__.ptr);
11728 return returnValue__;
11732 assert(state_ == DiscordObjectState::Owned);
11733 Discord_GuildChannel returnValueNative__{};
11734 Discord_DiscordClientGuildVoiceSnapshot_Channel(&instance_, &returnValueNative__);
11736 return returnValue__;
11740 assert(state_ == DiscordObjectState::Owned);
11741 Discord_DiscordClientGuildVoiceSnapshot_SetChannel(&instance_, Channel.instance());
11743bool DiscordClientGuildVoiceSnapshot::Selected()
const
11745 assert(state_ == DiscordObjectState::Owned);
11746 bool returnValue__;
11747 returnValue__ = Discord_DiscordClientGuildVoiceSnapshot_Selected(&instance_);
11748 return returnValue__;
11750void DiscordClientGuildVoiceSnapshot::SetSelected(
bool Selected)
11752 assert(state_ == DiscordObjectState::Owned);
11753 Discord_DiscordClientGuildVoiceSnapshot_SetSelected(&instance_, Selected);
11755bool DiscordClientGuildVoiceSnapshot::SpeakingAvailable()
const
11757 assert(state_ == DiscordObjectState::Owned);
11758 bool returnValue__;
11759 returnValue__ = Discord_DiscordClientGuildVoiceSnapshot_SpeakingAvailable(&instance_);
11760 return returnValue__;
11762void DiscordClientGuildVoiceSnapshot::SetSpeakingAvailable(
bool SpeakingAvailable)
11764 assert(state_ == DiscordObjectState::Owned);
11765 Discord_DiscordClientGuildVoiceSnapshot_SetSpeakingAvailable(&instance_, SpeakingAvailable);
11767const UserMessageSummary UserMessageSummary::nullobj{{}, DiscordObjectState::Invalid};
11768UserMessageSummary::~UserMessageSummary()
11770 if (state_ == DiscordObjectState::Owned) {
11772 state_ = DiscordObjectState::Invalid;
11775UserMessageSummary::UserMessageSummary(UserMessageSummary&& other) noexcept
11776 : instance_(other.instance_)
11777 , state_(other.state_)
11779 other.state_ = DiscordObjectState::Invalid;
11781UserMessageSummary& UserMessageSummary::operator=(UserMessageSummary&& other)
noexcept
11783 if (
this != &other) {
11784 if (state_ == DiscordObjectState::Owned) {
11787 instance_ = other.instance_;
11788 state_ = other.state_;
11789 other.state_ = DiscordObjectState::Invalid;
11793UserMessageSummary::UserMessageSummary(
const UserMessageSummary& arg0)
11798 Discord_UserMessageSummary_Clone(&instance_, arg0.instance());
11800 state_ = DiscordObjectState::Owned;
11803UserMessageSummary& UserMessageSummary::operator=(
const UserMessageSummary& arg0)
11805 if (
this != &arg0) {
11806 if (state_ == DiscordObjectState::Owned) {
11808 state_ = DiscordObjectState::Invalid;
11810 if (arg0.state_ == DiscordObjectState::Owned) {
11811 Discord_UserMessageSummary_Clone(&instance_, arg0.instance());
11813 state_ = DiscordObjectState::Owned;
11818UserMessageSummary::UserMessageSummary(Discord_UserMessageSummary instance,
11819 DiscordObjectState state)
11820 : instance_(instance)
11824void UserMessageSummary::Drop()
11826 if (state_ != DiscordObjectState::Owned) {
11829 Discord_UserMessageSummary_Drop(&instance_);
11830 state_ = DiscordObjectState::Invalid;
11832uint64_t UserMessageSummary::LastMessageId()
const
11834 assert(state_ == DiscordObjectState::Owned);
11835 uint64_t returnValue__;
11836 returnValue__ = Discord_UserMessageSummary_LastMessageId(&instance_);
11837 return returnValue__;
11839uint64_t UserMessageSummary::UserId()
const
11841 assert(state_ == DiscordObjectState::Owned);
11842 uint64_t returnValue__;
11843 returnValue__ = Discord_UserMessageSummary_UserId(&instance_);
11844 return returnValue__;
11846const ClientCreateOptions ClientCreateOptions::nullobj{{}, DiscordObjectState::Invalid};
11847ClientCreateOptions::~ClientCreateOptions()
11849 if (state_ == DiscordObjectState::Owned) {
11851 state_ = DiscordObjectState::Invalid;
11854ClientCreateOptions::ClientCreateOptions(ClientCreateOptions&& other) noexcept
11855 : instance_(other.instance_)
11856 , state_(other.state_)
11858 other.state_ = DiscordObjectState::Invalid;
11860ClientCreateOptions& ClientCreateOptions::operator=(ClientCreateOptions&& other)
noexcept
11862 if (
this != &other) {
11863 if (state_ == DiscordObjectState::Owned) {
11866 instance_ = other.instance_;
11867 state_ = other.state_;
11868 other.state_ = DiscordObjectState::Invalid;
11872ClientCreateOptions::ClientCreateOptions(
const ClientCreateOptions& arg0)
11877 Discord_ClientCreateOptions_Clone(&instance_, arg0.instance());
11879 state_ = DiscordObjectState::Owned;
11882ClientCreateOptions& ClientCreateOptions::operator=(
const ClientCreateOptions& arg0)
11884 if (
this != &arg0) {
11885 if (state_ == DiscordObjectState::Owned) {
11887 state_ = DiscordObjectState::Invalid;
11889 if (arg0.state_ == DiscordObjectState::Owned) {
11890 Discord_ClientCreateOptions_Clone(&instance_, arg0.instance());
11892 state_ = DiscordObjectState::Owned;
11897ClientCreateOptions::ClientCreateOptions(Discord_ClientCreateOptions instance,
11898 DiscordObjectState state)
11899 : instance_(instance)
11903ClientCreateOptions::ClientCreateOptions()
11905 assert(state_ == DiscordObjectState::Invalid);
11906 Discord_ClientCreateOptions_Init(&instance_);
11907 state_ = DiscordObjectState::Owned;
11909void ClientCreateOptions::Drop()
11911 if (state_ != DiscordObjectState::Owned) {
11914 Discord_ClientCreateOptions_Drop(&instance_);
11915 state_ = DiscordObjectState::Invalid;
11919 assert(state_ == DiscordObjectState::Owned);
11920 Discord_String returnValueNative__;
11921 Discord_ClientCreateOptions_WebBase(&instance_, &returnValueNative__);
11922 discordpp::String returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
11923 returnValueNative__.size);
11924 Discord_Free(returnValueNative__.ptr);
11925 return returnValue__;
11927void ClientCreateOptions::SetWebBase(std::string_view WebBase)
11929 assert(state_ == DiscordObjectState::Owned);
11930 Discord_String WebBase__str{(uint8_t*)(WebBase.data() !=
nullptr ? WebBase.data() :
""),
11932 Discord_ClientCreateOptions_SetWebBase(&instance_, WebBase__str);
11936 assert(state_ == DiscordObjectState::Owned);
11937 Discord_String returnValueNative__;
11938 Discord_ClientCreateOptions_ApiBase(&instance_, &returnValueNative__);
11939 discordpp::String returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
11940 returnValueNative__.size);
11941 Discord_Free(returnValueNative__.ptr);
11942 return returnValue__;
11944void ClientCreateOptions::SetApiBase(std::string_view ApiBase)
11946 assert(state_ == DiscordObjectState::Owned);
11947 Discord_String ApiBase__str{(uint8_t*)(ApiBase.data() !=
nullptr ? ApiBase.data() :
""),
11949 Discord_ClientCreateOptions_SetApiBase(&instance_, ApiBase__str);
11953 assert(state_ == DiscordObjectState::Owned);
11954 Discord_AudioSystem returnValue__;
11955 returnValue__ = Discord_ClientCreateOptions_ExperimentalAudioSystem(&instance_);
11960 assert(state_ == DiscordObjectState::Owned);
11961 Discord_ClientCreateOptions_SetExperimentalAudioSystem(
11962 &instance_,
static_cast<Discord_AudioSystem
>(ExperimentalAudioSystem));
11964bool ClientCreateOptions::ExperimentalAndroidPreventCommsForBluetooth()
const
11966 assert(state_ == DiscordObjectState::Owned);
11967 bool returnValue__;
11969 Discord_ClientCreateOptions_ExperimentalAndroidPreventCommsForBluetooth(&instance_);
11970 return returnValue__;
11972void ClientCreateOptions::SetExperimentalAndroidPreventCommsForBluetooth(
11973 bool ExperimentalAndroidPreventCommsForBluetooth)
11975 assert(state_ == DiscordObjectState::Owned);
11976 Discord_ClientCreateOptions_SetExperimentalAndroidPreventCommsForBluetooth(
11977 &instance_, ExperimentalAndroidPreventCommsForBluetooth);
11979std::optional<uint64_t> ClientCreateOptions::CpuAffinityMask()
const
11981 assert(state_ == DiscordObjectState::Owned);
11982 bool returnIsNonNull__;
11983 uint64_t returnValue__;
11984 returnIsNonNull__ = Discord_ClientCreateOptions_CpuAffinityMask(&instance_, &returnValue__);
11985 if (!returnIsNonNull__) {
11986 return std::nullopt;
11988 return returnValue__;
11990void ClientCreateOptions::SetCpuAffinityMask(std::optional<uint64_t> CpuAffinityMask)
11992 assert(state_ == DiscordObjectState::Owned);
11993 Discord_ClientCreateOptions_SetCpuAffinityMask(
11994 &instance_, (CpuAffinityMask.has_value() ? &*CpuAffinityMask :
nullptr));
11996const Client Client::nullobj{{}, DiscordObjectState::Invalid};
11999 if (state_ == DiscordObjectState::Owned) {
12001 state_ = DiscordObjectState::Invalid;
12004Client::Client(Client&& other) noexcept
12005 : instance_(other.instance_)
12006 , state_(other.state_)
12008 other.state_ = DiscordObjectState::Invalid;
12010Client& Client::operator=(Client&& other)
noexcept
12012 if (
this != &other) {
12013 if (state_ == DiscordObjectState::Owned) {
12016 instance_ = other.instance_;
12017 state_ = other.state_;
12018 other.state_ = DiscordObjectState::Invalid;
12022Client::Client(Discord_Client instance, DiscordObjectState state)
12023 : instance_(instance)
12029 assert(state_ == DiscordObjectState::Invalid);
12030 Discord_Client_Init(&instance_);
12031 state_ = DiscordObjectState::Owned;
12033Client::Client(std::string_view apiBase, std::string_view webBase)
12035 assert(state_ == DiscordObjectState::Invalid);
12036 Discord_String apiBase__str{(uint8_t*)(apiBase.data() !=
nullptr ? apiBase.data() :
""),
12038 Discord_String webBase__str{(uint8_t*)(webBase.data() !=
nullptr ? webBase.data() :
""),
12040 Discord_Client_InitWithBases(&instance_, apiBase__str, webBase__str);
12041 state_ = DiscordObjectState::Owned;
12045 assert(state_ == DiscordObjectState::Invalid);
12046 Discord_Client_InitWithOptions(&instance_, options.instance());
12047 state_ = DiscordObjectState::Owned;
12051 if (state_ != DiscordObjectState::Owned) {
12054 Discord_Client_Drop(&instance_);
12055 state_ = DiscordObjectState::Invalid;
12059 Discord_String returnValueNative__;
12060 Discord_Client_ErrorToString(
static_cast<Discord_Client_Error
>(type), &returnValueNative__);
12061 discordpp::String returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
12062 returnValueNative__.size);
12063 Discord_Free(returnValueNative__.ptr);
12064 return returnValue__;
12066uint64_t Client::GetApplicationId()
12068 assert(state_ == DiscordObjectState::Owned);
12069 uint64_t returnValue__;
12070 returnValue__ = Discord_Client_GetApplicationId(&instance_);
12071 return returnValue__;
12075 assert(state_ == DiscordObjectState::Owned);
12076 Discord_UserHandle returnValueNative__{};
12077 Discord_Client_GetCurrentUser(&instance_, &returnValueNative__);
12079 return returnValue__;
12083 Discord_String returnValueNative__;
12084 Discord_Client_GetDefaultAudioDeviceId(&returnValueNative__);
12085 discordpp::String returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
12086 returnValueNative__.size);
12087 Discord_Free(returnValueNative__.ptr);
12088 return returnValue__;
12092 Discord_String returnValueNative__;
12093 Discord_Client_GetDefaultCommunicationScopes(&returnValueNative__);
12094 discordpp::String returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
12095 returnValueNative__.size);
12096 Discord_Free(returnValueNative__.ptr);
12097 return returnValue__;
12101 Discord_String returnValueNative__;
12102 Discord_Client_GetDefaultPresenceScopes(&returnValueNative__);
12103 discordpp::String returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
12104 returnValueNative__.size);
12105 Discord_Free(returnValueNative__.ptr);
12106 return returnValue__;
12108void Client::GetDiscordClientGuildVoiceChannel(
12109 uint64_t channelId,
12112 assert(state_ == DiscordObjectState::Owned);
12113 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
12114 auto callback__userData = Tcallback__UserData::Create(std::move(callback));
12115 Discord_Client_GetDiscordClientGuildVoiceChannelCallback callback__native =
12116 [](
auto result,
auto snapshot,
void* userData__) {
12117 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
12120 DiscordObjectState::Owned);
12121 userData__typed->delegate(std::move(result__obj), std::move(snapshot__obj));
12123 Discord_Client_GetDiscordClientGuildVoiceChannel(
12126 (callback__userData->delegate ? callback__native :
nullptr),
12127 Tcallback__UserData::Free,
12128 callback__userData);
12130void Client::GetDiscordClientGuildVoiceChannels(
12134 assert(state_ == DiscordObjectState::Owned);
12135 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
12136 auto callback__userData = Tcallback__UserData::Create(std::move(callback));
12137 Discord_Client_GetDiscordClientGuildVoiceChannelsCallback callback__native =
12138 [](
auto result,
auto channels,
void* userData__) {
12139 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
12142 channels__vec.reserve(channels.size);
12143 for (
size_t i__ = 0; i__ < channels.size; ++i__) {
12144 channels__vec.emplace_back(channels.ptr[i__], DiscordObjectState::Owned);
12146 Discord_Free(channels.ptr);
12147 userData__typed->delegate(std::move(result__obj), std::move(channels__vec));
12149 Discord_Client_GetDiscordClientGuildVoiceChannels(
12152 (callback__userData->delegate ? callback__native :
nullptr),
12153 Tcallback__UserData::Free,
12154 callback__userData);
12158 Discord_String returnValueNative__;
12159 Discord_Client_GetVersionHash(&returnValueNative__);
12160 discordpp::String returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
12161 returnValueNative__.size);
12162 Discord_Free(returnValueNative__.ptr);
12163 return returnValue__;
12165int32_t Client::GetVersionMajor()
12167 int32_t returnValue__;
12168 returnValue__ = Discord_Client_GetVersionMajor();
12169 return returnValue__;
12171int32_t Client::GetVersionMinor()
12173 int32_t returnValue__;
12174 returnValue__ = Discord_Client_GetVersionMinor();
12175 return returnValue__;
12177int32_t Client::GetVersionPatch()
12179 int32_t returnValue__;
12180 returnValue__ = Discord_Client_GetVersionPatch();
12181 return returnValue__;
12183void Client::JoinDiscordClientGuildVoiceChannel(
12184 uint64_t channelId,
12188 assert(state_ == DiscordObjectState::Owned);
12189 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
12190 auto callback__userData = Tcallback__UserData::Create(std::move(callback));
12191 Discord_Client_DiscordClientGuildVoiceResultCallback callback__native = [](
auto result,
12192 void* userData__) {
12193 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
12195 userData__typed->delegate(std::move(result__obj));
12197 Discord_Client_JoinDiscordClientGuildVoiceChannel(
12201 (callback__userData->delegate ? callback__native :
nullptr),
12202 Tcallback__UserData::Free,
12203 callback__userData);
12205void Client::LeaveDiscordClientGuildVoiceChannel(
12206 uint64_t channelId,
12209 assert(state_ == DiscordObjectState::Owned);
12210 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
12211 auto callback__userData = Tcallback__UserData::Create(std::move(callback));
12212 Discord_Client_DiscordClientGuildVoiceResultCallback callback__native = [](
auto result,
12213 void* userData__) {
12214 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
12216 userData__typed->delegate(std::move(result__obj));
12218 Discord_Client_LeaveDiscordClientGuildVoiceChannel(
12221 (callback__userData->delegate ? callback__native :
nullptr),
12222 Tcallback__UserData::Free,
12223 callback__userData);
12225void Client::SetDiscordClientGuildVoiceChannelErrorCallback(
12228 assert(state_ == DiscordObjectState::Owned);
12229 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12230 auto cb__userData = Tcb__UserData::Create(std::move(cb));
12231 Discord_Client_DiscordClientGuildVoiceChannelErrorCallback cb__native =
12232 [](
auto channelId,
auto result,
void* userData__) {
12233 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12235 userData__typed->delegate(channelId, std::move(result__obj));
12237 Discord_Client_SetDiscordClientGuildVoiceChannelErrorCallback(
12239 (cb__userData->delegate ? cb__native :
nullptr),
12240 Tcb__UserData::Free,
12243void Client::SetDiscordClientGuildVoiceMemberAddedCallback(
12246 assert(state_ == DiscordObjectState::Owned);
12247 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12248 auto cb__userData = Tcb__UserData::Create(std::move(cb));
12249 Discord_Client_DiscordClientGuildVoiceMemberAddedCallback cb__native =
12250 [](
auto channelId,
auto userId,
void* userData__) {
12251 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12252 userData__typed->delegate(channelId, userId);
12254 Discord_Client_SetDiscordClientGuildVoiceMemberAddedCallback(
12256 (cb__userData->delegate ? cb__native :
nullptr),
12257 Tcb__UserData::Free,
12260void Client::SetDiscordClientGuildVoiceMemberRemovedCallback(
12263 assert(state_ == DiscordObjectState::Owned);
12264 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12265 auto cb__userData = Tcb__UserData::Create(std::move(cb));
12266 Discord_Client_DiscordClientGuildVoiceMemberRemovedCallback cb__native =
12267 [](
auto channelId,
auto userId,
void* userData__) {
12268 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12269 userData__typed->delegate(channelId, userId);
12271 Discord_Client_SetDiscordClientGuildVoiceMemberRemovedCallback(
12273 (cb__userData->delegate ? cb__native :
nullptr),
12274 Tcb__UserData::Free,
12277void Client::SetDiscordClientGuildVoiceMemberUpdatedCallback(
12280 assert(state_ == DiscordObjectState::Owned);
12281 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12282 auto cb__userData = Tcb__UserData::Create(std::move(cb));
12283 Discord_Client_DiscordClientGuildVoiceMemberUpdatedCallback cb__native =
12284 [](
auto channelId,
auto userId,
void* userData__) {
12285 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12286 userData__typed->delegate(channelId, userId);
12288 Discord_Client_SetDiscordClientGuildVoiceMemberUpdatedCallback(
12290 (cb__userData->delegate ? cb__native :
nullptr),
12291 Tcb__UserData::Free,
12294void Client::SetDiscordClientGuildVoiceSpeakingStartedCallback(
12297 assert(state_ == DiscordObjectState::Owned);
12298 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12299 auto cb__userData = Tcb__UserData::Create(std::move(cb));
12300 Discord_Client_DiscordClientGuildVoiceSpeakingStartedCallback cb__native =
12301 [](
auto channelId,
auto userId,
void* userData__) {
12302 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12303 userData__typed->delegate(channelId, userId);
12305 Discord_Client_SetDiscordClientGuildVoiceSpeakingStartedCallback(
12307 (cb__userData->delegate ? cb__native :
nullptr),
12308 Tcb__UserData::Free,
12311void Client::SetDiscordClientGuildVoiceSpeakingStoppedCallback(
12314 assert(state_ == DiscordObjectState::Owned);
12315 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12316 auto cb__userData = Tcb__UserData::Create(std::move(cb));
12317 Discord_Client_DiscordClientGuildVoiceSpeakingStoppedCallback cb__native =
12318 [](
auto channelId,
auto userId,
void* userData__) {
12319 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12320 userData__typed->delegate(channelId, userId);
12322 Discord_Client_SetDiscordClientGuildVoiceSpeakingStoppedCallback(
12324 (cb__userData->delegate ? cb__native :
nullptr),
12325 Tcb__UserData::Free,
12328void Client::SetDiscordClientVoiceChannelSelectedCallback(
12331 assert(state_ == DiscordObjectState::Owned);
12332 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12333 auto cb__userData = Tcb__UserData::Create(std::move(cb));
12334 Discord_Client_DiscordClientVoiceChannelSelectedCallback cb__native = [](
auto channelId,
12335 void* userData__) {
12336 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12337 userData__typed->delegate(channelId);
12339 Discord_Client_SetDiscordClientVoiceChannelSelectedCallback(
12341 (cb__userData->delegate ? cb__native :
nullptr),
12342 Tcb__UserData::Free,
12345void Client::SetDiscordClientVoiceConnectionStatusChangedCallback(
12348 assert(state_ == DiscordObjectState::Owned);
12349 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12350 auto cb__userData = Tcb__UserData::Create(std::move(cb));
12351 Discord_Client_DiscordClientVoiceConnectionStatusChangedCallback cb__native =
12352 [](
auto state,
void* userData__) {
12353 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12355 userData__typed->delegate(std::move(state__str));
12356 Discord_Free(state.ptr);
12358 Discord_Client_SetDiscordClientVoiceConnectionStatusChangedCallback(
12360 (cb__userData->delegate ? cb__native :
nullptr),
12361 Tcb__UserData::Free,
12364void Client::SetHttpRequestTimeout(int32_t httpTimeoutInMilliseconds)
12366 assert(state_ == DiscordObjectState::Owned);
12367 Discord_Client_SetHttpRequestTimeout(&instance_, httpTimeoutInMilliseconds);
12371 Discord_String returnValueNative__;
12372 Discord_Client_StatusToString(
static_cast<Discord_Client_Status
>(type), &returnValueNative__);
12373 discordpp::String returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
12374 returnValueNative__.size);
12375 Discord_Free(returnValueNative__.ptr);
12376 return returnValue__;
12378void Client::SubscribeDiscordClientGuildVoiceChannel(
12379 uint64_t channelId,
12382 assert(state_ == DiscordObjectState::Owned);
12383 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
12384 auto callback__userData = Tcallback__UserData::Create(std::move(callback));
12385 Discord_Client_DiscordClientGuildVoiceResultCallback callback__native = [](
auto result,
12386 void* userData__) {
12387 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
12389 userData__typed->delegate(std::move(result__obj));
12391 Discord_Client_SubscribeDiscordClientGuildVoiceChannel(
12394 (callback__userData->delegate ? callback__native :
nullptr),
12395 Tcallback__UserData::Free,
12396 callback__userData);
12400 Discord_String returnValueNative__;
12401 Discord_Client_ThreadToString(
static_cast<Discord_Client_Thread
>(type), &returnValueNative__);
12402 discordpp::String returnValue__(
reinterpret_cast<char*
>(returnValueNative__.ptr),
12403 returnValueNative__.size);
12404 Discord_Free(returnValueNative__.ptr);
12405 return returnValue__;
12407void Client::UnsubscribeDiscordClientGuildVoiceChannel(uint64_t channelId)
12409 assert(state_ == DiscordObjectState::Owned);
12410 Discord_Client_UnsubscribeDiscordClientGuildVoiceChannel(&instance_, channelId);
12414 assert(state_ == DiscordObjectState::Owned);
12415 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
12416 auto callback__userData = Tcallback__UserData::Create(std::move(callback));
12417 Discord_Client_EndCallCallback callback__native = [](
void* userData__) {
12418 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
12419 userData__typed->delegate();
12421 Discord_Client_EndCall(&instance_,
12423 (callback__userData->delegate ? callback__native :
nullptr),
12424 Tcallback__UserData::Free,
12425 callback__userData);
12429 assert(state_ == DiscordObjectState::Owned);
12430 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
12431 auto callback__userData = Tcallback__UserData::Create(std::move(callback));
12432 Discord_Client_EndCallsCallback callback__native = [](
void* userData__) {
12433 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
12434 userData__typed->delegate();
12436 Discord_Client_EndCalls(&instance_,
12437 (callback__userData->delegate ? callback__native :
nullptr),
12438 Tcallback__UserData::Free,
12439 callback__userData);
12443 assert(state_ == DiscordObjectState::Owned);
12444 bool returnIsNonNull__;
12445 Discord_Call returnValueNative__{};
12446 returnIsNonNull__ = Discord_Client_GetCall(&instance_, channelId, &returnValueNative__);
12448 returnValueNative__,
12449 returnIsNonNull__ ? DiscordObjectState::Owned : DiscordObjectState::Invalid);
12450 return returnValue__;
12454 assert(state_ == DiscordObjectState::Owned);
12455 Discord_CallSpan returnValueNative__;
12456 Discord_Client_GetCalls(&instance_, &returnValueNative__);
12458 returnValue__.reserve(returnValueNative__.size);
12459 for (
size_t i__ = 0; i__ < returnValueNative__.size; ++i__) {
12460 returnValue__.emplace_back(returnValueNative__.ptr[i__], DiscordObjectState::Owned);
12462 Discord_Free(returnValueNative__.ptr);
12463 return returnValue__;
12467 assert(state_ == DiscordObjectState::Owned);
12468 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12469 auto cb__userData = Tcb__UserData::Create(std::move(cb));
12470 Discord_Client_GetCurrentInputDeviceCallback cb__native = [](
auto device,
void* userData__) {
12471 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12473 userData__typed->delegate(std::move(device__obj));
12475 Discord_Client_GetCurrentInputDevice(&instance_,
12476 (cb__userData->delegate ? cb__native :
nullptr),
12477 Tcb__UserData::Free,
12482 assert(state_ == DiscordObjectState::Owned);
12483 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12484 auto cb__userData = Tcb__UserData::Create(std::move(cb));
12485 Discord_Client_GetCurrentOutputDeviceCallback cb__native = [](
auto device,
void* userData__) {
12486 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12488 userData__typed->delegate(std::move(device__obj));
12490 Discord_Client_GetCurrentOutputDevice(&instance_,
12491 (cb__userData->delegate ? cb__native :
nullptr),
12492 Tcb__UserData::Free,
12497 assert(state_ == DiscordObjectState::Owned);
12498 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12499 auto cb__userData = Tcb__UserData::Create(std::move(cb));
12500 Discord_Client_GetInputDevicesCallback cb__native = [](
auto devices,
void* userData__) {
12501 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12503 devices__vec.reserve(devices.size);
12504 for (
size_t i__ = 0; i__ < devices.size; ++i__) {
12505 devices__vec.emplace_back(devices.ptr[i__], DiscordObjectState::Owned);
12507 Discord_Free(devices.ptr);
12508 userData__typed->delegate(std::move(devices__vec));
12510 Discord_Client_GetInputDevices(&instance_,
12511 (cb__userData->delegate ? cb__native :
nullptr),
12512 Tcb__UserData::Free,
12515float Client::GetInputVolume()
12517 assert(state_ == DiscordObjectState::Owned);
12518 float returnValue__;
12519 returnValue__ = Discord_Client_GetInputVolume(&instance_);
12520 return returnValue__;
12524 assert(state_ == DiscordObjectState::Owned);
12525 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12526 auto cb__userData = Tcb__UserData::Create(std::move(cb));
12527 Discord_Client_GetOutputDevicesCallback cb__native = [](
auto devices,
void* userData__) {
12528 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12530 devices__vec.reserve(devices.size);
12531 for (
size_t i__ = 0; i__ < devices.size; ++i__) {
12532 devices__vec.emplace_back(devices.ptr[i__], DiscordObjectState::Owned);
12534 Discord_Free(devices.ptr);
12535 userData__typed->delegate(std::move(devices__vec));
12537 Discord_Client_GetOutputDevices(&instance_,
12538 (cb__userData->delegate ? cb__native :
nullptr),
12539 Tcb__UserData::Free,
12542float Client::GetOutputVolume()
12544 assert(state_ == DiscordObjectState::Owned);
12545 float returnValue__;
12546 returnValue__ = Discord_Client_GetOutputVolume(&instance_);
12547 return returnValue__;
12549bool Client::GetSelfDeafAll()
const
12551 assert(state_ == DiscordObjectState::Owned);
12552 bool returnValue__;
12553 returnValue__ = Discord_Client_GetSelfDeafAll(&instance_);
12554 return returnValue__;
12556bool Client::GetSelfMuteAll()
const
12558 assert(state_ == DiscordObjectState::Owned);
12559 bool returnValue__;
12560 returnValue__ = Discord_Client_GetSelfMuteAll(&instance_);
12561 return returnValue__;
12565 assert(state_ == DiscordObjectState::Owned);
12566 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12567 auto cb__userData = Tcb__UserData::Create(std::move(cb));
12568 Discord_Client_GetVoiceSettingsCallback cb__native =
12569 [](
auto result,
auto settings,
void* userData__) {
12570 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12573 userData__typed->delegate(std::move(result__obj), std::move(settings__obj));
12575 Discord_Client_GetVoiceSettings(&instance_,
12576 (cb__userData->delegate ? cb__native :
nullptr),
12577 Tcb__UserData::Free,
12580void Client::SetAecDump(
bool on)
12582 assert(state_ == DiscordObjectState::Owned);
12583 Discord_Client_SetAecDump(&instance_, on);
12585void Client::SetAutomaticGainControl(
bool on)
12587 assert(state_ == DiscordObjectState::Owned);
12588 Discord_Client_SetAutomaticGainControl(&instance_, on);
12592 assert(state_ == DiscordObjectState::Owned);
12593 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
12594 auto callback__userData = Tcallback__UserData::Create(std::move(callback));
12595 Discord_Client_DeviceChangeCallback callback__native =
12596 [](
auto inputDevices,
auto outputDevices,
void* userData__) {
12597 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
12599 inputDevices__vec.reserve(inputDevices.size);
12600 for (
size_t i__ = 0; i__ < inputDevices.size; ++i__) {
12601 inputDevices__vec.emplace_back(inputDevices.ptr[i__], DiscordObjectState::Owned);
12603 Discord_Free(inputDevices.ptr);
12605 outputDevices__vec.reserve(outputDevices.size);
12606 for (
size_t i__ = 0; i__ < outputDevices.size; ++i__) {
12607 outputDevices__vec.emplace_back(outputDevices.ptr[i__], DiscordObjectState::Owned);
12609 Discord_Free(outputDevices.ptr);
12610 userData__typed->delegate(std::move(inputDevices__vec), std::move(outputDevices__vec));
12612 Discord_Client_SetDeviceChangeCallback(
12614 (callback__userData->delegate ? callback__native :
nullptr),
12615 Tcallback__UserData::Free,
12616 callback__userData);
12618void Client::SetEchoCancellation(
bool on)
12620 assert(state_ == DiscordObjectState::Owned);
12621 Discord_Client_SetEchoCancellation(&instance_, on);
12623void Client::SetEngineManagedAudioSession(
bool isEngineManaged)
12625 assert(state_ == DiscordObjectState::Owned);
12626 Discord_Client_SetEngineManagedAudioSession(&instance_, isEngineManaged);
12630 assert(state_ == DiscordObjectState::Owned);
12631 Discord_String deviceId__str{(uint8_t*)(deviceId.data() !=
nullptr ? deviceId.data() :
""),
12633 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12634 auto cb__userData = Tcb__UserData::Create(std::move(cb));
12635 Discord_Client_SetInputDeviceCallback cb__native = [](
auto result,
void* userData__) {
12636 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12638 userData__typed->delegate(std::move(result__obj));
12640 Discord_Client_SetInputDevice(&instance_,
12642 (cb__userData->delegate ? cb__native :
nullptr),
12643 Tcb__UserData::Free,
12646void Client::SetInputVolume(
float inputVolume)
12648 assert(state_ == DiscordObjectState::Owned);
12649 Discord_Client_SetInputVolume(&instance_, inputVolume);
12653 assert(state_ == DiscordObjectState::Owned);
12654 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
12655 auto callback__userData = Tcallback__UserData::Create(std::move(callback));
12656 Discord_Client_NoAudioInputCallback callback__native = [](
auto inputDetected,
12657 void* userData__) {
12658 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
12659 userData__typed->delegate(inputDetected);
12661 Discord_Client_SetNoAudioInputCallback(
12663 (callback__userData->delegate ? callback__native :
nullptr),
12664 Tcallback__UserData::Free,
12665 callback__userData);
12667void Client::SetNoAudioInputThreshold(
float dBFSThreshold)
12669 assert(state_ == DiscordObjectState::Owned);
12670 Discord_Client_SetNoAudioInputThreshold(&instance_, dBFSThreshold);
12672void Client::SetNoiseCancellation(
bool on)
12674 assert(state_ == DiscordObjectState::Owned);
12675 Discord_Client_SetNoiseCancellation(&instance_, on);
12677void Client::SetNoiseSuppression(
bool on)
12679 assert(state_ == DiscordObjectState::Owned);
12680 Discord_Client_SetNoiseSuppression(&instance_, on);
12682void Client::SetOpusHardwareCoding(
bool encode,
bool decode)
12684 assert(state_ == DiscordObjectState::Owned);
12685 Discord_Client_SetOpusHardwareCoding(&instance_, encode, decode);
12687void Client::SetOutputDevice(std::string_view deviceId,
12690 assert(state_ == DiscordObjectState::Owned);
12691 Discord_String deviceId__str{(uint8_t*)(deviceId.data() !=
nullptr ? deviceId.data() :
""),
12693 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12694 auto cb__userData = Tcb__UserData::Create(std::move(cb));
12695 Discord_Client_SetOutputDeviceCallback cb__native = [](
auto result,
void* userData__) {
12696 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12698 userData__typed->delegate(std::move(result__obj));
12700 Discord_Client_SetOutputDevice(&instance_,
12702 (cb__userData->delegate ? cb__native :
nullptr),
12703 Tcb__UserData::Free,
12706void Client::SetOutputVolume(
float outputVolume)
12708 assert(state_ == DiscordObjectState::Owned);
12709 Discord_Client_SetOutputVolume(&instance_, outputVolume);
12711void Client::SetSelfDeafAll(
bool deaf)
12713 assert(state_ == DiscordObjectState::Owned);
12714 Discord_Client_SetSelfDeafAll(&instance_, deaf);
12716void Client::SetSelfMuteAll(
bool mute)
12718 assert(state_ == DiscordObjectState::Owned);
12719 Discord_Client_SetSelfMuteAll(&instance_, mute);
12721bool Client::SetSpeakerMode(
bool speakerMode)
12723 assert(state_ == DiscordObjectState::Owned);
12724 bool returnValue__;
12725 returnValue__ = Discord_Client_SetSpeakerMode(&instance_, speakerMode);
12726 return returnValue__;
12730 assert(state_ == DiscordObjectState::Owned);
12731 Discord_Client_SetThreadPriority(
12732 &instance_,
static_cast<Discord_Client_Thread
>(thread), priority);
12734void Client::SetVoiceParticipantChangedCallback(
12737 assert(state_ == DiscordObjectState::Owned);
12738 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
12739 auto cb__userData = Tcb__UserData::Create(std::move(cb));
12740 Discord_Client_VoiceParticipantChangedCallback cb__native =
12741 [](
auto lobbyId,
auto memberId,
auto added,
void* userData__) {
12742 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
12743 userData__typed->delegate(lobbyId, memberId, added);
12745 Discord_Client_SetVoiceParticipantChangedCallback(
12747 (cb__userData->delegate ? cb__native :
nullptr),
12748 Tcb__UserData::Free,
12751void Client::SetVoiceSettingsUpdatedCallback(
12754 assert(state_ == DiscordObjectState::Owned);
12755 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
12756 auto callback__userData = Tcallback__UserData::Create(std::move(callback));
12757 Discord_Client_VoiceSettingsUpdatedCallback callback__native = [](
auto settings,
12758 void* userData__) {
12759 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
12761 userData__typed->delegate(std::move(settings__obj));
12763 Discord_Client_SetVoiceSettingsUpdatedCallback(
12765 (callback__userData->delegate ? callback__native :
nullptr),
12766 Tcallback__UserData::Free,
12767 callback__userData);
12769bool Client::ShowAudioRoutePicker()
12771 assert(state_ == DiscordObjectState::Owned);
12772 bool returnValue__;
12773 returnValue__ = Discord_Client_ShowAudioRoutePicker(&instance_);
12774 return returnValue__;
12778 assert(state_ == DiscordObjectState::Owned);
12779 bool returnIsNonNull__;
12780 Discord_Call returnValueNative__{};
12781 returnIsNonNull__ = Discord_Client_StartCall(&instance_, channelId, &returnValueNative__);
12783 returnValueNative__,
12784 returnIsNonNull__ ? DiscordObjectState::Owned : DiscordObjectState::Invalid);
12785 return returnValue__;
12792 assert(state_ == DiscordObjectState::Owned);
12793 bool returnIsNonNull__;
12794 Discord_Call returnValueNative__{};
12795 using TreceivedCb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(receivedCb)>>;
12796 auto receivedCb__userData = TreceivedCb__UserData::Create(std::move(receivedCb));
12797 Discord_Client_UserAudioReceivedCallback receivedCb__native = [](
auto userId,
12799 auto samplesPerChannel,
12802 auto outShouldMute,
12803 void* userData__) {
12804 auto userData__typed =
static_cast<TreceivedCb__UserData*
>(userData__);
12805 userData__typed->delegate(
12806 userId, data, samplesPerChannel, sampleRate, channels, *outShouldMute);
12808 using TcapturedCb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(capturedCb)>>;
12809 auto capturedCb__userData = TcapturedCb__UserData::Create(std::move(capturedCb));
12810 Discord_Client_UserAudioCapturedCallback capturedCb__native =
12811 [](
auto data,
auto samplesPerChannel,
auto sampleRate,
auto channels,
void* userData__) {
12812 auto userData__typed =
static_cast<TcapturedCb__UserData*
>(userData__);
12813 userData__typed->delegate(data, samplesPerChannel, sampleRate, channels);
12815 returnIsNonNull__ = Discord_Client_StartCallWithAudioCallbacks(
12818 (receivedCb__userData->delegate ? receivedCb__native :
nullptr),
12819 TreceivedCb__UserData::Free,
12820 receivedCb__userData,
12821 (capturedCb__userData->delegate ? capturedCb__native :
nullptr),
12822 TcapturedCb__UserData::Free,
12823 capturedCb__userData,
12824 &returnValueNative__);
12826 returnValueNative__,
12827 returnIsNonNull__ ? DiscordObjectState::Owned : DiscordObjectState::Invalid);
12828 return returnValue__;
12830void Client::AbortAuthorize()
12832 assert(state_ == DiscordObjectState::Owned);
12833 Discord_Client_AbortAuthorize(&instance_);
12835void Client::AbortGetTokenFromDevice()
12837 assert(state_ == DiscordObjectState::Owned);
12838 Discord_Client_AbortGetTokenFromDevice(&instance_);
12843 assert(state_ == DiscordObjectState::Owned);
12844 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
12845 auto callback__userData = Tcallback__UserData::Create(std::move(callback));
12846 Discord_Client_AuthorizationCallback callback__native =
12847 [](
auto result,
auto code,
auto redirectUri,
void* userData__) {
12848 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
12853 userData__typed->delegate(
12854 std::move(result__obj), std::move(code__str), std::move(redirectUri__str));
12855 Discord_Free(redirectUri.ptr);
12856 Discord_Free(code.ptr);
12858 Discord_Client_Authorize(&instance_,
12860 (callback__userData->delegate ? callback__native :
nullptr),
12861 Tcallback__UserData::Free,
12862 callback__userData);
12864void Client::CloseAuthorizeDeviceScreen()
12866 assert(state_ == DiscordObjectState::Owned);
12867 Discord_Client_CloseAuthorizeDeviceScreen(&instance_);
12871 assert(state_ == DiscordObjectState::Owned);
12872 Discord_AuthorizationCodeVerifier returnValueNative__{};
12873 Discord_Client_CreateAuthorizationCodeVerifier(&instance_, &returnValueNative__);
12875 DiscordObjectState::Owned);
12876 return returnValue__;
12878void Client::ExchangeChildToken(std::string_view parentApplicationToken,
12879 uint64_t childApplicationId,
12882 assert(state_ == DiscordObjectState::Owned);
12883 Discord_String parentApplicationToken__str{
12884 (uint8_t*)(parentApplicationToken.data() !=
nullptr ? parentApplicationToken.data() :
""),
12885 parentApplicationToken.size()};
12886 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
12887 auto callback__userData = Tcallback__UserData::Create(std::move(callback));
12888 Discord_Client_ExchangeChildTokenCallback callback__native = [](
auto result,
12893 void* userData__) {
12894 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
12898 discordpp::String scopes__str(
reinterpret_cast<char*
>(scopes.ptr), scopes.size);
12899 userData__typed->delegate(std::move(result__obj),
12900 std::move(accessToken__str),
12903 std::move(scopes__str));
12904 Discord_Free(scopes.ptr);
12905 Discord_Free(accessToken.ptr);
12907 Discord_Client_ExchangeChildToken(&instance_,
12908 parentApplicationToken__str,
12909 childApplicationId,
12910 (callback__userData->delegate ? callback__native :
nullptr),
12911 Tcallback__UserData::Free,
12912 callback__userData);
12915 std::string_view token,
12918 assert(state_ == DiscordObjectState::Owned);
12919 Discord_String token__str{(uint8_t*)(token.data() !=
nullptr ? token.data() :
""),
12921 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
12922 auto callback__userData = Tcallback__UserData::Create(std::move(callback));
12923 Discord_Client_FetchCurrentUserCallback callback__native =
12924 [](
auto result,
auto id,
auto name,
void* userData__) {
12925 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
12928 userData__typed->delegate(std::move(result__obj),
id, std::move(name__str));
12929 Discord_Free(name.ptr);
12931 Discord_Client_FetchCurrentUser(&instance_,
12932 static_cast<Discord_AuthorizationTokenType
>(tokenType),
12934 (callback__userData->delegate ? callback__native :
nullptr),
12935 Tcallback__UserData::Free,
12936 callback__userData);
12938void Client::GetProvisionalToken(uint64_t applicationId,
12940 std::string_view externalAuthToken,
12943 assert(state_ == DiscordObjectState::Owned);
12944 Discord_String externalAuthToken__str{
12945 (uint8_t*)(externalAuthToken.data() !=
nullptr ? externalAuthToken.data() :
""),
12946 externalAuthToken.size()};
12947 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
12948 auto callback__userData = Tcallback__UserData::Create(std::move(callback));
12949 Discord_Client_TokenExchangeCallback callback__native = [](
auto result,
12955 void* userData__) {
12956 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
12961 refreshToken.size);
12962 discordpp::String scopes__str(
reinterpret_cast<char*
>(scopes.ptr), scopes.size);
12963 userData__typed->delegate(std::move(result__obj),
12964 std::move(accessToken__str),
12965 std::move(refreshToken__str),
12968 std::move(scopes__str));
12969 Discord_Free(scopes.ptr);
12970 Discord_Free(refreshToken.ptr);
12971 Discord_Free(accessToken.ptr);
12973 Discord_Client_GetProvisionalToken(
12976 static_cast<Discord_AuthenticationExternalAuthType
>(externalAuthType),
12977 externalAuthToken__str,
12978 (callback__userData->delegate ? callback__native :
nullptr),
12979 Tcallback__UserData::Free,
12980 callback__userData);
12982void Client::GetToken(uint64_t applicationId,
12983 std::string_view code,
12984 std::string_view codeVerifier,
12985 std::string_view redirectUri,
12988 assert(state_ == DiscordObjectState::Owned);
12989 Discord_String code__str{(uint8_t*)(code.data() !=
nullptr ? code.data() :
""), code.size()};
12990 Discord_String codeVerifier__str{
12991 (uint8_t*)(codeVerifier.data() !=
nullptr ? codeVerifier.data() :
""), codeVerifier.size()};
12992 Discord_String redirectUri__str{
12993 (uint8_t*)(redirectUri.data() !=
nullptr ? redirectUri.data() :
""), redirectUri.size()};
12994 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
12995 auto callback__userData = Tcallback__UserData::Create(std::move(callback));
12996 Discord_Client_TokenExchangeCallback callback__native = [](
auto result,
13002 void* userData__) {
13003 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
13008 refreshToken.size);
13009 discordpp::String scopes__str(
reinterpret_cast<char*
>(scopes.ptr), scopes.size);
13010 userData__typed->delegate(std::move(result__obj),
13011 std::move(accessToken__str),
13012 std::move(refreshToken__str),
13015 std::move(scopes__str));
13016 Discord_Free(scopes.ptr);
13017 Discord_Free(refreshToken.ptr);
13018 Discord_Free(accessToken.ptr);
13020 Discord_Client_GetToken(&instance_,
13025 (callback__userData->delegate ? callback__native :
nullptr),
13026 Tcallback__UserData::Free,
13027 callback__userData);
13032 assert(state_ == DiscordObjectState::Owned);
13033 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
13034 auto callback__userData = Tcallback__UserData::Create(std::move(callback));
13035 Discord_Client_TokenExchangeCallback callback__native = [](
auto result,
13041 void* userData__) {
13042 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
13047 refreshToken.size);
13048 discordpp::String scopes__str(
reinterpret_cast<char*
>(scopes.ptr), scopes.size);
13049 userData__typed->delegate(std::move(result__obj),
13050 std::move(accessToken__str),
13051 std::move(refreshToken__str),
13054 std::move(scopes__str));
13055 Discord_Free(scopes.ptr);
13056 Discord_Free(refreshToken.ptr);
13057 Discord_Free(accessToken.ptr);
13059 Discord_Client_GetTokenFromDevice(&instance_,
13061 (callback__userData->delegate ? callback__native :
nullptr),
13062 Tcallback__UserData::Free,
13063 callback__userData);
13065void Client::GetTokenFromDeviceProvisionalMerge(
13068 std::string_view externalAuthToken,
13071 assert(state_ == DiscordObjectState::Owned);
13072 Discord_String externalAuthToken__str{
13073 (uint8_t*)(externalAuthToken.data() !=
nullptr ? externalAuthToken.data() :
""),
13074 externalAuthToken.size()};
13075 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
13076 auto callback__userData = Tcallback__UserData::Create(std::move(callback));
13077 Discord_Client_TokenExchangeCallback callback__native = [](
auto result,
13083 void* userData__) {
13084 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
13089 refreshToken.size);
13090 discordpp::String scopes__str(
reinterpret_cast<char*
>(scopes.ptr), scopes.size);
13091 userData__typed->delegate(std::move(result__obj),
13092 std::move(accessToken__str),
13093 std::move(refreshToken__str),
13096 std::move(scopes__str));
13097 Discord_Free(scopes.ptr);
13098 Discord_Free(refreshToken.ptr);
13099 Discord_Free(accessToken.ptr);
13101 Discord_Client_GetTokenFromDeviceProvisionalMerge(
13104 static_cast<Discord_AuthenticationExternalAuthType
>(externalAuthType),
13105 externalAuthToken__str,
13106 (callback__userData->delegate ? callback__native :
nullptr),
13107 Tcallback__UserData::Free,
13108 callback__userData);
13110void Client::GetTokenFromProvisionalMerge(
13111 uint64_t applicationId,
13112 std::string_view code,
13113 std::string_view codeVerifier,
13114 std::string_view redirectUri,
13116 std::string_view externalAuthToken,
13119 assert(state_ == DiscordObjectState::Owned);
13120 Discord_String code__str{(uint8_t*)(code.data() !=
nullptr ? code.data() :
""), code.size()};
13121 Discord_String codeVerifier__str{
13122 (uint8_t*)(codeVerifier.data() !=
nullptr ? codeVerifier.data() :
""), codeVerifier.size()};
13123 Discord_String redirectUri__str{
13124 (uint8_t*)(redirectUri.data() !=
nullptr ? redirectUri.data() :
""), redirectUri.size()};
13125 Discord_String externalAuthToken__str{
13126 (uint8_t*)(externalAuthToken.data() !=
nullptr ? externalAuthToken.data() :
""),
13127 externalAuthToken.size()};
13128 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
13129 auto callback__userData = Tcallback__UserData::Create(std::move(callback));
13130 Discord_Client_TokenExchangeCallback callback__native = [](
auto result,
13136 void* userData__) {
13137 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
13142 refreshToken.size);
13143 discordpp::String scopes__str(
reinterpret_cast<char*
>(scopes.ptr), scopes.size);
13144 userData__typed->delegate(std::move(result__obj),
13145 std::move(accessToken__str),
13146 std::move(refreshToken__str),
13149 std::move(scopes__str));
13150 Discord_Free(scopes.ptr);
13151 Discord_Free(refreshToken.ptr);
13152 Discord_Free(accessToken.ptr);
13154 Discord_Client_GetTokenFromProvisionalMerge(
13160 static_cast<Discord_AuthenticationExternalAuthType
>(externalAuthType),
13161 externalAuthToken__str,
13162 (callback__userData->delegate ? callback__native :
nullptr),
13163 Tcallback__UserData::Free,
13164 callback__userData);
13166bool Client::IsAuthenticated()
13168 assert(state_ == DiscordObjectState::Owned);
13169 bool returnValue__;
13170 returnValue__ = Discord_Client_IsAuthenticated(&instance_);
13171 return returnValue__;
13173void Client::OpenAuthorizeDeviceScreen(uint64_t clientId, std::string_view userCode)
13175 assert(state_ == DiscordObjectState::Owned);
13176 Discord_String userCode__str{(uint8_t*)(userCode.data() !=
nullptr ? userCode.data() :
""),
13178 Discord_Client_OpenAuthorizeDeviceScreen(&instance_, clientId, userCode__str);
13180void Client::ProvisionalUserMergeCompleted(
bool success)
13182 assert(state_ == DiscordObjectState::Owned);
13183 Discord_Client_ProvisionalUserMergeCompleted(&instance_, success);
13185void Client::RefreshToken(uint64_t applicationId,
13186 std::string_view refreshToken,
13189 assert(state_ == DiscordObjectState::Owned);
13190 Discord_String refreshToken__str{
13191 (uint8_t*)(refreshToken.data() !=
nullptr ? refreshToken.data() :
""), refreshToken.size()};
13192 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
13193 auto callback__userData = Tcallback__UserData::Create(std::move(callback));
13194 Discord_Client_TokenExchangeCallback callback__native = [](
auto result,
13200 void* userData__) {
13201 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
13206 refreshToken.size);
13207 discordpp::String scopes__str(
reinterpret_cast<char*
>(scopes.ptr), scopes.size);
13208 userData__typed->delegate(std::move(result__obj),
13209 std::move(accessToken__str),
13210 std::move(refreshToken__str),
13213 std::move(scopes__str));
13214 Discord_Free(scopes.ptr);
13215 Discord_Free(refreshToken.ptr);
13216 Discord_Free(accessToken.ptr);
13218 Discord_Client_RefreshToken(&instance_,
13221 (callback__userData->delegate ? callback__native :
nullptr),
13222 Tcallback__UserData::Free,
13223 callback__userData);
13227 assert(state_ == DiscordObjectState::Owned);
13228 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
13229 auto callback__userData = Tcallback__UserData::Create(std::move(callback));
13230 Discord_Client_AuthorizeRequestCallback callback__native = [](
void* userData__) {
13231 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
13232 userData__typed->delegate();
13234 Discord_Client_RegisterAuthorizeRequestCallback(
13236 (callback__userData->delegate ? callback__native :
nullptr),
13237 Tcallback__UserData::Free,
13238 callback__userData);
13240void Client::RemoveAuthorizeRequestCallback()
13242 assert(state_ == DiscordObjectState::Owned);
13243 Discord_Client_RemoveAuthorizeRequestCallback(&instance_);
13245void Client::RevokeToken(uint64_t applicationId,
13246 std::string_view token,
13249 assert(state_ == DiscordObjectState::Owned);
13250 Discord_String token__str{(uint8_t*)(token.data() !=
nullptr ? token.data() :
""),
13252 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
13253 auto callback__userData = Tcallback__UserData::Create(std::move(callback));
13254 Discord_Client_RevokeTokenCallback callback__native = [](
auto result,
void* userData__) {
13255 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
13257 userData__typed->delegate(std::move(result__obj));
13259 Discord_Client_RevokeToken(&instance_,
13262 (callback__userData->delegate ? callback__native :
nullptr),
13263 Tcallback__UserData::Free,
13264 callback__userData);
13266void Client::SetAuthorizeDeviceScreenClosedCallback(
13269 assert(state_ == DiscordObjectState::Owned);
13270 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
13271 auto cb__userData = Tcb__UserData::Create(std::move(cb));
13272 Discord_Client_AuthorizeDeviceScreenClosedCallback cb__native = [](
void* userData__) {
13273 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
13274 userData__typed->delegate();
13276 Discord_Client_SetAuthorizeDeviceScreenClosedCallback(
13278 (cb__userData->delegate ? cb__native :
nullptr),
13279 Tcb__UserData::Free,
13282void Client::SetGameWindowPid(int32_t pid)
13284 assert(state_ == DiscordObjectState::Owned);
13285 Discord_Client_SetGameWindowPid(&instance_, pid);
13289 assert(state_ == DiscordObjectState::Owned);
13290 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
13291 auto callback__userData = Tcallback__UserData::Create(std::move(callback));
13292 Discord_Client_TokenExpirationCallback callback__native = [](
void* userData__) {
13293 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
13294 userData__typed->delegate();
13296 Discord_Client_SetTokenExpirationCallback(
13298 (callback__userData->delegate ? callback__native :
nullptr),
13299 Tcallback__UserData::Free,
13300 callback__userData);
13302void Client::UnmergeIntoProvisionalAccount(
13303 uint64_t applicationId,
13305 std::string_view externalAuthToken,
13308 assert(state_ == DiscordObjectState::Owned);
13309 Discord_String externalAuthToken__str{
13310 (uint8_t*)(externalAuthToken.data() !=
nullptr ? externalAuthToken.data() :
""),
13311 externalAuthToken.size()};
13312 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
13313 auto callback__userData = Tcallback__UserData::Create(std::move(callback));
13314 Discord_Client_UnmergeIntoProvisionalAccountCallback callback__native = [](
auto result,
13315 void* userData__) {
13316 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
13318 userData__typed->delegate(std::move(result__obj));
13320 Discord_Client_UnmergeIntoProvisionalAccount(
13323 static_cast<Discord_AuthenticationExternalAuthType
>(externalAuthType),
13324 externalAuthToken__str,
13325 (callback__userData->delegate ? callback__native :
nullptr),
13326 Tcallback__UserData::Free,
13327 callback__userData);
13329void Client::UpdateProvisionalAccountDisplayName(
13330 std::string_view name,
13333 assert(state_ == DiscordObjectState::Owned);
13334 Discord_String name__str{(uint8_t*)(name.data() !=
nullptr ? name.data() :
""), name.size()};
13335 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
13336 auto callback__userData = Tcallback__UserData::Create(std::move(callback));
13337 Discord_Client_UpdateProvisionalAccountDisplayNameCallback callback__native =
13338 [](
auto result,
void* userData__) {
13339 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
13341 userData__typed->delegate(std::move(result__obj));
13343 Discord_Client_UpdateProvisionalAccountDisplayName(
13346 (callback__userData->delegate ? callback__native :
nullptr),
13347 Tcallback__UserData::Free,
13348 callback__userData);
13351 std::string_view token,
13354 assert(state_ == DiscordObjectState::Owned);
13355 Discord_String token__str{(uint8_t*)(token.data() !=
nullptr ? token.data() :
""),
13357 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
13358 auto callback__userData = Tcallback__UserData::Create(std::move(callback));
13359 Discord_Client_UpdateTokenCallback callback__native = [](
auto result,
void* userData__) {
13360 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
13362 userData__typed->delegate(std::move(result__obj));
13364 Discord_Client_UpdateToken(&instance_,
13365 static_cast<Discord_AuthorizationTokenType
>(tokenType),
13367 (callback__userData->delegate ? callback__native :
nullptr),
13368 Tcallback__UserData::Free,
13369 callback__userData);
13371bool Client::CanOpenMessageInDiscord(uint64_t messageId)
13373 assert(state_ == DiscordObjectState::Owned);
13374 bool returnValue__;
13375 returnValue__ = Discord_Client_CanOpenMessageInDiscord(&instance_, messageId);
13376 return returnValue__;
13378void Client::DeleteUserMessage(uint64_t recipientId,
13379 uint64_t messageId,
13382 assert(state_ == DiscordObjectState::Owned);
13383 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
13384 auto cb__userData = Tcb__UserData::Create(std::move(cb));
13385 Discord_Client_DeleteUserMessageCallback cb__native = [](
auto result,
void* userData__) {
13386 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
13388 userData__typed->delegate(std::move(result__obj));
13390 Discord_Client_DeleteUserMessage(&instance_,
13393 (cb__userData->delegate ? cb__native :
nullptr),
13394 Tcb__UserData::Free,
13397void Client::EditUserMessage(uint64_t recipientId,
13398 uint64_t messageId,
13399 std::string_view content,
13402 assert(state_ == DiscordObjectState::Owned);
13403 Discord_String content__str{(uint8_t*)(content.data() !=
nullptr ? content.data() :
""),
13405 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
13406 auto cb__userData = Tcb__UserData::Create(std::move(cb));
13407 Discord_Client_EditUserMessageCallback cb__native = [](
auto result,
void* userData__) {
13408 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
13410 userData__typed->delegate(std::move(result__obj));
13412 Discord_Client_EditUserMessage(&instance_,
13416 (cb__userData->delegate ? cb__native :
nullptr),
13417 Tcb__UserData::Free,
13420std::optional<discordpp::ChannelHandle> Client::GetChannelHandle(uint64_t channelId)
const
13422 assert(state_ == DiscordObjectState::Owned);
13423 bool returnIsNonNull__;
13424 Discord_ChannelHandle returnValueNative__;
13425 returnIsNonNull__ =
13426 Discord_Client_GetChannelHandle(&instance_, channelId, &returnValueNative__);
13427 if (!returnIsNonNull__) {
13431 return returnValue__;
13433void Client::GetLobbyMessagesWithLimit(uint64_t lobbyId,
13437 assert(state_ == DiscordObjectState::Owned);
13438 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
13439 auto cb__userData = Tcb__UserData::Create(std::move(cb));
13440 Discord_Client_GetLobbyMessagesCallback cb__native =
13441 [](
auto result,
auto messages,
void* userData__) {
13442 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
13445 messages__vec.reserve(messages.size);
13446 for (
size_t i__ = 0; i__ < messages.size; ++i__) {
13447 messages__vec.emplace_back(messages.ptr[i__], DiscordObjectState::Owned);
13449 Discord_Free(messages.ptr);
13450 userData__typed->delegate(std::move(result__obj), std::move(messages__vec));
13452 Discord_Client_GetLobbyMessagesWithLimit(&instance_,
13455 (cb__userData->delegate ? cb__native :
nullptr),
13456 Tcb__UserData::Free,
13459std::optional<discordpp::MessageHandle> Client::GetMessageHandle(uint64_t messageId)
const
13461 assert(state_ == DiscordObjectState::Owned);
13462 bool returnIsNonNull__;
13463 Discord_MessageHandle returnValueNative__;
13464 returnIsNonNull__ =
13465 Discord_Client_GetMessageHandle(&instance_, messageId, &returnValueNative__);
13466 if (!returnIsNonNull__) {
13470 return returnValue__;
13474 assert(state_ == DiscordObjectState::Owned);
13475 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
13476 auto cb__userData = Tcb__UserData::Create(std::move(cb));
13477 Discord_Client_UserMessageSummariesCallback cb__native =
13478 [](
auto result,
auto summaries,
void* userData__) {
13479 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
13482 summaries__vec.reserve(summaries.size);
13483 for (
size_t i__ = 0; i__ < summaries.size; ++i__) {
13484 summaries__vec.emplace_back(summaries.ptr[i__], DiscordObjectState::Owned);
13486 Discord_Free(summaries.ptr);
13487 userData__typed->delegate(std::move(result__obj), std::move(summaries__vec));
13489 Discord_Client_GetUserMessageSummaries(&instance_,
13490 (cb__userData->delegate ? cb__native :
nullptr),
13491 Tcb__UserData::Free,
13494void Client::GetUserMessagesWithLimit(uint64_t recipientId,
13498 assert(state_ == DiscordObjectState::Owned);
13499 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
13500 auto cb__userData = Tcb__UserData::Create(std::move(cb));
13501 Discord_Client_UserMessagesWithLimitCallback cb__native =
13502 [](
auto result,
auto messages,
void* userData__) {
13503 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
13506 messages__vec.reserve(messages.size);
13507 for (
size_t i__ = 0; i__ < messages.size; ++i__) {
13508 messages__vec.emplace_back(messages.ptr[i__], DiscordObjectState::Owned);
13510 Discord_Free(messages.ptr);
13511 userData__typed->delegate(std::move(result__obj), std::move(messages__vec));
13513 Discord_Client_GetUserMessagesWithLimit(&instance_,
13516 (cb__userData->delegate ? cb__native :
nullptr),
13517 Tcb__UserData::Free,
13520void Client::OpenMessageInDiscord(
13521 uint64_t messageId,
13525 assert(state_ == DiscordObjectState::Owned);
13526 using TprovisionalUserMergeRequiredCallback__UserData =
13527 TDelegateUserData<std::remove_reference_t<
decltype(provisionalUserMergeRequiredCallback)>>;
13528 auto provisionalUserMergeRequiredCallback__userData =
13529 TprovisionalUserMergeRequiredCallback__UserData::Create(
13530 std::move(provisionalUserMergeRequiredCallback));
13531 Discord_Client_ProvisionalUserMergeRequiredCallback
13532 provisionalUserMergeRequiredCallback__native = [](
void* userData__) {
13533 auto userData__typed =
13534 static_cast<TprovisionalUserMergeRequiredCallback__UserData*
>(userData__);
13535 userData__typed->delegate();
13537 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
13538 auto callback__userData = Tcallback__UserData::Create(std::move(callback));
13539 Discord_Client_OpenMessageInDiscordCallback callback__native = [](
auto result,
13540 void* userData__) {
13541 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
13543 userData__typed->delegate(std::move(result__obj));
13545 Discord_Client_OpenMessageInDiscord(&instance_,
13547 (provisionalUserMergeRequiredCallback__userData->delegate
13548 ? provisionalUserMergeRequiredCallback__native
13550 TprovisionalUserMergeRequiredCallback__UserData::Free,
13551 provisionalUserMergeRequiredCallback__userData,
13552 (callback__userData->delegate ? callback__native :
nullptr),
13553 Tcallback__UserData::Free,
13554 callback__userData);
13556void Client::SendLobbyMessage(uint64_t lobbyId,
13557 std::string_view content,
13560 assert(state_ == DiscordObjectState::Owned);
13561 Discord_String content__str{(uint8_t*)(content.data() !=
nullptr ? content.data() :
""),
13563 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
13564 auto cb__userData = Tcb__UserData::Create(std::move(cb));
13565 Discord_Client_SendUserMessageCallback cb__native =
13566 [](
auto result,
auto messageId,
void* userData__) {
13567 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
13569 userData__typed->delegate(std::move(result__obj), messageId);
13571 Discord_Client_SendLobbyMessage(&instance_,
13574 (cb__userData->delegate ? cb__native :
nullptr),
13575 Tcb__UserData::Free,
13578void Client::SendLobbyMessageWithMetadata(uint64_t lobbyId,
13579 std::string_view content,
13583 assert(state_ == DiscordObjectState::Owned);
13584 Discord_String content__str{(uint8_t*)(content.data() !=
nullptr ? content.data() :
""),
13586 ConvertedProperties metadata__convert(metadata);
13587 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
13588 auto cb__userData = Tcb__UserData::Create(std::move(cb));
13589 Discord_Client_SendUserMessageCallback cb__native =
13590 [](
auto result,
auto messageId,
void* userData__) {
13591 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
13593 userData__typed->delegate(std::move(result__obj), messageId);
13595 Discord_Client_SendLobbyMessageWithMetadata(&instance_,
13598 metadata__convert.Properties,
13599 (cb__userData->delegate ? cb__native :
nullptr),
13600 Tcb__UserData::Free,
13603void Client::SendUserMessage(uint64_t recipientId,
13604 std::string_view content,
13607 assert(state_ == DiscordObjectState::Owned);
13608 Discord_String content__str{(uint8_t*)(content.data() !=
nullptr ? content.data() :
""),
13610 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
13611 auto cb__userData = Tcb__UserData::Create(std::move(cb));
13612 Discord_Client_SendUserMessageCallback cb__native =
13613 [](
auto result,
auto messageId,
void* userData__) {
13614 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
13616 userData__typed->delegate(std::move(result__obj), messageId);
13618 Discord_Client_SendUserMessage(&instance_,
13621 (cb__userData->delegate ? cb__native :
nullptr),
13622 Tcb__UserData::Free,
13625void Client::SendUserMessageWithMetadata(uint64_t recipientId,
13626 std::string_view content,
13630 assert(state_ == DiscordObjectState::Owned);
13631 Discord_String content__str{(uint8_t*)(content.data() !=
nullptr ? content.data() :
""),
13633 ConvertedProperties metadata__convert(metadata);
13634 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
13635 auto cb__userData = Tcb__UserData::Create(std::move(cb));
13636 Discord_Client_SendUserMessageCallback cb__native =
13637 [](
auto result,
auto messageId,
void* userData__) {
13638 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
13640 userData__typed->delegate(std::move(result__obj), messageId);
13642 Discord_Client_SendUserMessageWithMetadata(&instance_,
13645 metadata__convert.Properties,
13646 (cb__userData->delegate ? cb__native :
nullptr),
13647 Tcb__UserData::Free,
13652 assert(state_ == DiscordObjectState::Owned);
13653 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
13654 auto cb__userData = Tcb__UserData::Create(std::move(cb));
13655 Discord_Client_MessageCreatedCallback cb__native = [](
auto messageId,
void* userData__) {
13656 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
13657 userData__typed->delegate(messageId);
13659 Discord_Client_SetMessageCreatedCallback(&instance_,
13660 (cb__userData->delegate ? cb__native :
nullptr),
13661 Tcb__UserData::Free,
13666 assert(state_ == DiscordObjectState::Owned);
13667 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
13668 auto cb__userData = Tcb__UserData::Create(std::move(cb));
13669 Discord_Client_MessageDeletedCallback cb__native =
13670 [](
auto messageId,
auto channelId,
void* userData__) {
13671 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
13672 userData__typed->delegate(messageId, channelId);
13674 Discord_Client_SetMessageDeletedCallback(&instance_,
13675 (cb__userData->delegate ? cb__native :
nullptr),
13676 Tcb__UserData::Free,
13681 assert(state_ == DiscordObjectState::Owned);
13682 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
13683 auto cb__userData = Tcb__UserData::Create(std::move(cb));
13684 Discord_Client_MessageUpdatedCallback cb__native = [](
auto messageId,
void* userData__) {
13685 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
13686 userData__typed->delegate(messageId);
13688 Discord_Client_SetMessageUpdatedCallback(&instance_,
13689 (cb__userData->delegate ? cb__native :
nullptr),
13690 Tcb__UserData::Free,
13693void Client::SetShowingChat(
bool showingChat)
13695 assert(state_ == DiscordObjectState::Owned);
13696 Discord_Client_SetShowingChat(&instance_, showingChat);
13701 assert(state_ == DiscordObjectState::Owned);
13702 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
13703 auto callback__userData = Tcallback__UserData::Create(std::move(callback));
13704 Discord_Client_LogCallback callback__native = [](
13705 auto message,
auto severity,
void* userData__) {
13706 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
13707 discordpp::String message__str(
reinterpret_cast<char*
>(message.ptr), message.size);
13708 userData__typed->delegate(std::move(message__str),
13710 Discord_Free(message.ptr);
13712 Discord_Client_AddLogCallback(&instance_,
13713 (callback__userData->delegate ? callback__native :
nullptr),
13714 Tcallback__UserData::Free,
13715 callback__userData,
13716 static_cast<Discord_LoggingSeverity
>(minSeverity));
13721 assert(state_ == DiscordObjectState::Owned);
13722 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
13723 auto callback__userData = Tcallback__UserData::Create(std::move(callback));
13724 Discord_Client_LogCallback callback__native = [](
13725 auto message,
auto severity,
void* userData__) {
13726 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
13727 discordpp::String message__str(
reinterpret_cast<char*
>(message.ptr), message.size);
13728 userData__typed->delegate(std::move(message__str),
13730 Discord_Free(message.ptr);
13732 Discord_Client_AddVoiceLogCallback(&instance_,
13733 (callback__userData->delegate ? callback__native :
nullptr),
13734 Tcallback__UserData::Free,
13735 callback__userData,
13736 static_cast<Discord_LoggingSeverity
>(minSeverity));
13738void Client::Connect()
13740 assert(state_ == DiscordObjectState::Owned);
13741 Discord_Client_Connect(&instance_);
13743void Client::Disconnect()
13745 assert(state_ == DiscordObjectState::Owned);
13746 Discord_Client_Disconnect(&instance_);
13750 assert(state_ == DiscordObjectState::Owned);
13751 Discord_Client_Status returnValue__;
13752 returnValue__ = Discord_Client_GetStatus(&instance_);
13755void Client::OpenConnectedGamesSettingsInDiscord(
13758 assert(state_ == DiscordObjectState::Owned);
13759 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
13760 auto callback__userData = Tcallback__UserData::Create(std::move(callback));
13761 Discord_Client_OpenConnectedGamesSettingsInDiscordCallback callback__native =
13762 [](
auto result,
void* userData__) {
13763 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
13765 userData__typed->delegate(std::move(result__obj));
13767 Discord_Client_OpenConnectedGamesSettingsInDiscord(
13769 (callback__userData->delegate ? callback__native :
nullptr),
13770 Tcallback__UserData::Free,
13771 callback__userData);
13773void Client::SetApplicationId(uint64_t applicationId)
13775 assert(state_ == DiscordObjectState::Owned);
13776 Discord_Client_SetApplicationId(&instance_, applicationId);
13780 assert(state_ == DiscordObjectState::Owned);
13781 bool returnValue__;
13782 Discord_String path__str{(uint8_t*)(path.data() !=
nullptr ? path.data() :
""), path.size()};
13783 returnValue__ = Discord_Client_SetLogDir(
13784 &instance_, path__str,
static_cast<Discord_LoggingSeverity
>(minSeverity));
13785 return returnValue__;
13789 assert(state_ == DiscordObjectState::Owned);
13790 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
13791 auto cb__userData = Tcb__UserData::Create(std::move(cb));
13792 Discord_Client_OnStatusChanged cb__native =
13793 [](
auto status,
auto error,
auto errorDetail,
void* userData__) {
13794 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
13799 Discord_Client_SetStatusChangedCallback(&instance_,
13800 (cb__userData->delegate ? cb__native :
nullptr),
13801 Tcb__UserData::Free,
13806 assert(state_ == DiscordObjectState::Owned);
13807 Discord_String path__str{(uint8_t*)(path.data() !=
nullptr ? path.data() :
""), path.size()};
13808 Discord_Client_SetVoiceLogDir(
13809 &instance_, path__str,
static_cast<Discord_LoggingSeverity
>(minSeverity));
13813 assert(state_ == DiscordObjectState::Owned);
13814 bool returnValue__;
13815 returnValue__ = Discord_Client_CanManageGameOrganizationLink(&instance_, guild.instance());
13816 return returnValue__;
13820 assert(state_ == DiscordObjectState::Owned);
13821 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
13822 auto cb__userData = Tcb__UserData::Create(std::move(cb));
13823 Discord_Client_FetchUserGuildsCallback cb__native =
13824 [](
auto result,
auto guilds,
void* userData__) {
13825 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
13828 guilds__vec.reserve(guilds.size);
13829 for (
size_t i__ = 0; i__ < guilds.size; ++i__) {
13830 guilds__vec.emplace_back(guilds.ptr[i__], DiscordObjectState::Owned);
13832 Discord_Free(guilds.ptr);
13833 userData__typed->delegate(std::move(result__obj), std::move(guilds__vec));
13835 Discord_Client_FetchUserGuilds(&instance_,
13836 (cb__userData->delegate ? cb__native :
nullptr),
13837 Tcb__UserData::Free,
13840void Client::LinkGameOrganization(uint64_t guildId,
13841 std::string_view gameOrganizationId,
13844 assert(state_ == DiscordObjectState::Owned);
13845 Discord_String gameOrganizationId__str{
13846 (uint8_t*)(gameOrganizationId.data() !=
nullptr ? gameOrganizationId.data() :
""),
13847 gameOrganizationId.size()};
13848 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
13849 auto cb__userData = Tcb__UserData::Create(std::move(cb));
13850 Discord_Client_LinkGameOrganizationCallback cb__native = [](
auto result,
void* userData__) {
13851 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
13853 userData__typed->delegate(std::move(result__obj));
13855 Discord_Client_LinkGameOrganization(&instance_,
13857 gameOrganizationId__str,
13858 (cb__userData->delegate ? cb__native :
nullptr),
13859 Tcb__UserData::Free,
13862void Client::UnlinkGameOrganization(std::string_view gameOrganizationId,
13865 assert(state_ == DiscordObjectState::Owned);
13866 Discord_String gameOrganizationId__str{
13867 (uint8_t*)(gameOrganizationId.data() !=
nullptr ? gameOrganizationId.data() :
""),
13868 gameOrganizationId.size()};
13869 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
13870 auto cb__userData = Tcb__UserData::Create(std::move(cb));
13871 Discord_Client_UnlinkGameOrganizationCallback cb__native = [](
auto result,
void* userData__) {
13872 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
13874 userData__typed->delegate(std::move(result__obj));
13876 Discord_Client_UnlinkGameOrganization(&instance_,
13877 gameOrganizationId__str,
13878 (cb__userData->delegate ? cb__native :
nullptr),
13879 Tcb__UserData::Free,
13882void Client::CreateOrJoinLobby(std::string_view secret,
13885 assert(state_ == DiscordObjectState::Owned);
13886 Discord_String secret__str{(uint8_t*)(secret.data() !=
nullptr ? secret.data() :
""),
13888 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
13889 auto callback__userData = Tcallback__UserData::Create(std::move(callback));
13890 Discord_Client_CreateOrJoinLobbyCallback callback__native =
13891 [](
auto result,
auto lobbyId,
void* userData__) {
13892 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
13894 userData__typed->delegate(std::move(result__obj), lobbyId);
13896 Discord_Client_CreateOrJoinLobby(&instance_,
13898 (callback__userData->delegate ? callback__native :
nullptr),
13899 Tcallback__UserData::Free,
13900 callback__userData);
13902void Client::CreateOrJoinLobbyWithMetadata(std::string_view secret,
13907 assert(state_ == DiscordObjectState::Owned);
13908 Discord_String secret__str{(uint8_t*)(secret.data() !=
nullptr ? secret.data() :
""),
13910 ConvertedProperties lobbyMetadata__convert(lobbyMetadata);
13911 ConvertedProperties memberMetadata__convert(memberMetadata);
13912 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
13913 auto callback__userData = Tcallback__UserData::Create(std::move(callback));
13914 Discord_Client_CreateOrJoinLobbyCallback callback__native =
13915 [](
auto result,
auto lobbyId,
void* userData__) {
13916 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
13918 userData__typed->delegate(std::move(result__obj), lobbyId);
13920 Discord_Client_CreateOrJoinLobbyWithMetadata(
13923 lobbyMetadata__convert.Properties,
13924 memberMetadata__convert.Properties,
13925 (callback__userData->delegate ? callback__native :
nullptr),
13926 Tcallback__UserData::Free,
13927 callback__userData);
13931 assert(state_ == DiscordObjectState::Owned);
13932 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
13933 auto cb__userData = Tcb__UserData::Create(std::move(cb));
13934 Discord_Client_GetGuildChannelsCallback cb__native =
13935 [](
auto result,
auto guildChannels,
void* userData__) {
13936 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
13939 guildChannels__vec.reserve(guildChannels.size);
13940 for (
size_t i__ = 0; i__ < guildChannels.size; ++i__) {
13941 guildChannels__vec.emplace_back(guildChannels.ptr[i__], DiscordObjectState::Owned);
13943 Discord_Free(guildChannels.ptr);
13944 userData__typed->delegate(std::move(result__obj), std::move(guildChannels__vec));
13946 Discord_Client_GetGuildChannels(&instance_,
13948 (cb__userData->delegate ? cb__native :
nullptr),
13949 Tcb__UserData::Free,
13952std::optional<discordpp::LobbyHandle> Client::GetLobbyHandle(uint64_t lobbyId)
const
13954 assert(state_ == DiscordObjectState::Owned);
13955 bool returnIsNonNull__;
13956 Discord_LobbyHandle returnValueNative__;
13957 returnIsNonNull__ = Discord_Client_GetLobbyHandle(&instance_, lobbyId, &returnValueNative__);
13958 if (!returnIsNonNull__) {
13962 return returnValue__;
13966 assert(state_ == DiscordObjectState::Owned);
13967 Discord_UInt64Span returnValueNative__;
13968 Discord_Client_GetLobbyIds(&instance_, &returnValueNative__);
13970 returnValueNative__.ptr + returnValueNative__.size);
13971 Discord_Free(returnValueNative__.ptr);
13972 return returnValue__;
13976 assert(state_ == DiscordObjectState::Owned);
13977 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
13978 auto cb__userData = Tcb__UserData::Create(std::move(cb));
13979 Discord_Client_GetUserGuildsCallback cb__native =
13980 [](
auto result,
auto guilds,
void* userData__) {
13981 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
13984 guilds__vec.reserve(guilds.size);
13985 for (
size_t i__ = 0; i__ < guilds.size; ++i__) {
13986 guilds__vec.emplace_back(guilds.ptr[i__], DiscordObjectState::Owned);
13988 Discord_Free(guilds.ptr);
13989 userData__typed->delegate(std::move(result__obj), std::move(guilds__vec));
13991 Discord_Client_GetUserGuilds(&instance_,
13992 (cb__userData->delegate ? cb__native :
nullptr),
13993 Tcb__UserData::Free,
13996void Client::JoinLinkedLobbyGuild(
14001 assert(state_ == DiscordObjectState::Owned);
14002 using TprovisionalUserMergeRequiredCallback__UserData =
14003 TDelegateUserData<std::remove_reference_t<
decltype(provisionalUserMergeRequiredCallback)>>;
14004 auto provisionalUserMergeRequiredCallback__userData =
14005 TprovisionalUserMergeRequiredCallback__UserData::Create(
14006 std::move(provisionalUserMergeRequiredCallback));
14007 Discord_Client_ProvisionalUserMergeRequiredCallback
14008 provisionalUserMergeRequiredCallback__native = [](
void* userData__) {
14009 auto userData__typed =
14010 static_cast<TprovisionalUserMergeRequiredCallback__UserData*
>(userData__);
14011 userData__typed->delegate();
14013 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
14014 auto callback__userData = Tcallback__UserData::Create(std::move(callback));
14015 Discord_Client_JoinLinkedLobbyGuildCallback callback__native =
14016 [](
auto result,
auto inviteUrl,
void* userData__) {
14017 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
14019 discordpp::String inviteUrl__str(
reinterpret_cast<char*
>(inviteUrl.ptr), inviteUrl.size);
14020 userData__typed->delegate(std::move(result__obj), std::move(inviteUrl__str));
14021 Discord_Free(inviteUrl.ptr);
14023 Discord_Client_JoinLinkedLobbyGuild(&instance_,
14025 (provisionalUserMergeRequiredCallback__userData->delegate
14026 ? provisionalUserMergeRequiredCallback__native
14028 TprovisionalUserMergeRequiredCallback__UserData::Free,
14029 provisionalUserMergeRequiredCallback__userData,
14030 (callback__userData->delegate ? callback__native :
nullptr),
14031 Tcallback__UserData::Free,
14032 callback__userData);
14036 assert(state_ == DiscordObjectState::Owned);
14037 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
14038 auto callback__userData = Tcallback__UserData::Create(std::move(callback));
14039 Discord_Client_LeaveLobbyCallback callback__native = [](
auto result,
void* userData__) {
14040 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
14042 userData__typed->delegate(std::move(result__obj));
14044 Discord_Client_LeaveLobby(&instance_,
14046 (callback__userData->delegate ? callback__native :
nullptr),
14047 Tcallback__UserData::Free,
14048 callback__userData);
14050void Client::LinkChannelToLobby(uint64_t lobbyId,
14051 uint64_t channelId,
14054 assert(state_ == DiscordObjectState::Owned);
14055 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
14056 auto callback__userData = Tcallback__UserData::Create(std::move(callback));
14057 Discord_Client_LinkOrUnlinkChannelCallback callback__native = [](
auto result,
14058 void* userData__) {
14059 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
14061 userData__typed->delegate(std::move(result__obj));
14063 Discord_Client_LinkChannelToLobby(&instance_,
14066 (callback__userData->delegate ? callback__native :
nullptr),
14067 Tcallback__UserData::Free,
14068 callback__userData);
14072 assert(state_ == DiscordObjectState::Owned);
14073 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
14074 auto cb__userData = Tcb__UserData::Create(std::move(cb));
14075 Discord_Client_LobbyCreatedCallback cb__native = [](
auto lobbyId,
void* userData__) {
14076 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
14077 userData__typed->delegate(lobbyId);
14079 Discord_Client_SetLobbyCreatedCallback(&instance_,
14080 (cb__userData->delegate ? cb__native :
nullptr),
14081 Tcb__UserData::Free,
14086 assert(state_ == DiscordObjectState::Owned);
14087 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
14088 auto cb__userData = Tcb__UserData::Create(std::move(cb));
14089 Discord_Client_LobbyDeletedCallback cb__native = [](
auto lobbyId,
void* userData__) {
14090 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
14091 userData__typed->delegate(lobbyId);
14093 Discord_Client_SetLobbyDeletedCallback(&instance_,
14094 (cb__userData->delegate ? cb__native :
nullptr),
14095 Tcb__UserData::Free,
14100 assert(state_ == DiscordObjectState::Owned);
14101 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
14102 auto cb__userData = Tcb__UserData::Create(std::move(cb));
14103 Discord_Client_LobbyMemberAddedCallback cb__native =
14104 [](
auto lobbyId,
auto memberId,
void* userData__) {
14105 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
14106 userData__typed->delegate(lobbyId, memberId);
14108 Discord_Client_SetLobbyMemberAddedCallback(&instance_,
14109 (cb__userData->delegate ? cb__native :
nullptr),
14110 Tcb__UserData::Free,
14115 assert(state_ == DiscordObjectState::Owned);
14116 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
14117 auto cb__userData = Tcb__UserData::Create(std::move(cb));
14118 Discord_Client_LobbyMemberRemovedCallback cb__native =
14119 [](
auto lobbyId,
auto memberId,
void* userData__) {
14120 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
14121 userData__typed->delegate(lobbyId, memberId);
14123 Discord_Client_SetLobbyMemberRemovedCallback(&instance_,
14124 (cb__userData->delegate ? cb__native :
nullptr),
14125 Tcb__UserData::Free,
14130 assert(state_ == DiscordObjectState::Owned);
14131 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
14132 auto cb__userData = Tcb__UserData::Create(std::move(cb));
14133 Discord_Client_LobbyMemberUpdatedCallback cb__native =
14134 [](
auto lobbyId,
auto memberId,
void* userData__) {
14135 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
14136 userData__typed->delegate(lobbyId, memberId);
14138 Discord_Client_SetLobbyMemberUpdatedCallback(&instance_,
14139 (cb__userData->delegate ? cb__native :
nullptr),
14140 Tcb__UserData::Free,
14145 assert(state_ == DiscordObjectState::Owned);
14146 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
14147 auto cb__userData = Tcb__UserData::Create(std::move(cb));
14148 Discord_Client_LobbyUpdatedCallback cb__native = [](
auto lobbyId,
void* userData__) {
14149 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
14150 userData__typed->delegate(lobbyId);
14152 Discord_Client_SetLobbyUpdatedCallback(&instance_,
14153 (cb__userData->delegate ? cb__native :
nullptr),
14154 Tcb__UserData::Free,
14157void Client::UnlinkChannelFromLobby(uint64_t lobbyId,
14160 assert(state_ == DiscordObjectState::Owned);
14161 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
14162 auto callback__userData = Tcallback__UserData::Create(std::move(callback));
14163 Discord_Client_LinkOrUnlinkChannelCallback callback__native = [](
auto result,
14164 void* userData__) {
14165 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
14167 userData__typed->delegate(std::move(result__obj));
14169 Discord_Client_UnlinkChannelFromLobby(
14172 (callback__userData->delegate ? callback__native :
nullptr),
14173 Tcallback__UserData::Free,
14174 callback__userData);
14178 assert(state_ == DiscordObjectState::Owned);
14179 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
14180 auto callback__userData = Tcallback__UserData::Create(std::move(callback));
14181 Discord_Client_IsDiscordAppInstalledCallback callback__native = [](
auto installed,
14182 void* userData__) {
14183 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
14184 userData__typed->delegate(installed);
14186 Discord_Client_IsDiscordAppInstalled(
14188 (callback__userData->delegate ? callback__native :
nullptr),
14189 Tcallback__UserData::Free,
14190 callback__userData);
14195 assert(state_ == DiscordObjectState::Owned);
14196 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
14197 auto cb__userData = Tcb__UserData::Create(std::move(cb));
14198 Discord_Client_AcceptActivityInviteCallback cb__native = [](
auto result,
14200 void* userData__) {
14201 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
14203 discordpp::String joinSecret__str(
reinterpret_cast<char*
>(joinSecret.ptr), joinSecret.size);
14204 userData__typed->delegate(std::move(result__obj), std::move(joinSecret__str));
14205 Discord_Free(joinSecret.ptr);
14207 Discord_Client_AcceptActivityInvite(&instance_,
14209 (cb__userData->delegate ? cb__native :
nullptr),
14210 Tcb__UserData::Free,
14213void Client::ClearRichPresence()
14215 assert(state_ == DiscordObjectState::Owned);
14216 Discord_Client_ClearRichPresence(&instance_);
14218bool Client::RegisterLaunchCommand(uint64_t applicationId, std::string_view command)
14220 assert(state_ == DiscordObjectState::Owned);
14221 bool returnValue__;
14222 Discord_String command__str{(uint8_t*)(command.data() !=
nullptr ? command.data() :
""),
14224 returnValue__ = Discord_Client_RegisterLaunchCommand(&instance_, applicationId, command__str);
14225 return returnValue__;
14227bool Client::RegisterLaunchSteamApplication(uint64_t applicationId, uint32_t steamAppId)
14229 assert(state_ == DiscordObjectState::Owned);
14230 bool returnValue__;
14232 Discord_Client_RegisterLaunchSteamApplication(&instance_, applicationId, steamAppId);
14233 return returnValue__;
14235void Client::SendActivityInvite(uint64_t userId,
14236 std::string_view content,
14239 assert(state_ == DiscordObjectState::Owned);
14240 Discord_String content__str{(uint8_t*)(content.data() !=
nullptr ? content.data() :
""),
14242 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
14243 auto cb__userData = Tcb__UserData::Create(std::move(cb));
14244 Discord_Client_SendActivityInviteCallback cb__native = [](
auto result,
void* userData__) {
14245 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
14247 userData__typed->delegate(std::move(result__obj));
14249 Discord_Client_SendActivityInvite(&instance_,
14252 (cb__userData->delegate ? cb__native :
nullptr),
14253 Tcb__UserData::Free,
14256void Client::SendActivityJoinRequest(uint64_t userId,
14259 assert(state_ == DiscordObjectState::Owned);
14260 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
14261 auto cb__userData = Tcb__UserData::Create(std::move(cb));
14262 Discord_Client_SendActivityInviteCallback cb__native = [](
auto result,
void* userData__) {
14263 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
14265 userData__typed->delegate(std::move(result__obj));
14267 Discord_Client_SendActivityJoinRequest(&instance_,
14269 (cb__userData->delegate ? cb__native :
nullptr),
14270 Tcb__UserData::Free,
14276 assert(state_ == DiscordObjectState::Owned);
14277 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
14278 auto cb__userData = Tcb__UserData::Create(std::move(cb));
14279 Discord_Client_SendActivityInviteCallback cb__native = [](
auto result,
void* userData__) {
14280 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
14282 userData__typed->delegate(std::move(result__obj));
14284 Discord_Client_SendActivityJoinRequestReply(&instance_,
14286 (cb__userData->delegate ? cb__native :
nullptr),
14287 Tcb__UserData::Free,
14292 assert(state_ == DiscordObjectState::Owned);
14293 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
14294 auto cb__userData = Tcb__UserData::Create(std::move(cb));
14295 Discord_Client_ActivityInviteCallback cb__native = [](
auto invite,
void* userData__) {
14296 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
14298 userData__typed->delegate(std::move(invite__obj));
14300 Discord_Client_SetActivityInviteCreatedCallback(&instance_,
14301 (cb__userData->delegate ? cb__native :
nullptr),
14302 Tcb__UserData::Free,
14307 assert(state_ == DiscordObjectState::Owned);
14308 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
14309 auto cb__userData = Tcb__UserData::Create(std::move(cb));
14310 Discord_Client_ActivityInviteCallback cb__native = [](
auto invite,
void* userData__) {
14311 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
14313 userData__typed->delegate(std::move(invite__obj));
14315 Discord_Client_SetActivityInviteUpdatedCallback(&instance_,
14316 (cb__userData->delegate ? cb__native :
nullptr),
14317 Tcb__UserData::Free,
14322 assert(state_ == DiscordObjectState::Owned);
14323 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
14324 auto cb__userData = Tcb__UserData::Create(std::move(cb));
14325 Discord_Client_ActivityJoinCallback cb__native = [](
auto joinSecret,
void* userData__) {
14326 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
14327 discordpp::String joinSecret__str(
reinterpret_cast<char*
>(joinSecret.ptr), joinSecret.size);
14328 userData__typed->delegate(std::move(joinSecret__str));
14329 Discord_Free(joinSecret.ptr);
14331 Discord_Client_SetActivityJoinCallback(&instance_,
14332 (cb__userData->delegate ? cb__native :
nullptr),
14333 Tcb__UserData::Free,
14336void Client::SetActivityJoinWithApplicationCallback(
14339 assert(state_ == DiscordObjectState::Owned);
14340 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
14341 auto cb__userData = Tcb__UserData::Create(std::move(cb));
14342 Discord_Client_ActivityJoinWithApplicationCallback cb__native = [](
auto applicationId,
14344 void* userData__) {
14345 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
14346 discordpp::String joinSecret__str(
reinterpret_cast<char*
>(joinSecret.ptr), joinSecret.size);
14347 userData__typed->delegate(applicationId, std::move(joinSecret__str));
14348 Discord_Free(joinSecret.ptr);
14350 Discord_Client_SetActivityJoinWithApplicationCallback(
14352 (cb__userData->delegate ? cb__native :
nullptr),
14353 Tcb__UserData::Free,
14359 assert(state_ == DiscordObjectState::Owned);
14360 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
14361 auto callback__userData = Tcallback__UserData::Create(std::move(callback));
14362 Discord_Client_UpdateStatusCallback callback__native = [](
auto result,
void* userData__) {
14363 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
14365 userData__typed->delegate(std::move(result__obj));
14367 Discord_Client_SetOnlineStatus(&instance_,
14368 static_cast<Discord_StatusType
>(status),
14369 (callback__userData->delegate ? callback__native :
nullptr),
14370 Tcallback__UserData::Free,
14371 callback__userData);
14376 assert(state_ == DiscordObjectState::Owned);
14377 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
14378 auto cb__userData = Tcb__UserData::Create(std::move(cb));
14379 Discord_Client_UpdateRichPresenceCallback cb__native = [](
auto result,
void* userData__) {
14380 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
14382 userData__typed->delegate(std::move(result__obj));
14384 Discord_Client_UpdateRichPresence(&instance_,
14385 activity.instance(),
14386 (cb__userData->delegate ? cb__native :
nullptr),
14387 Tcb__UserData::Free,
14390void Client::AcceptDiscordFriendRequest(uint64_t userId,
14393 assert(state_ == DiscordObjectState::Owned);
14394 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
14395 auto cb__userData = Tcb__UserData::Create(std::move(cb));
14396 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
14397 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
14399 userData__typed->delegate(std::move(result__obj));
14401 Discord_Client_AcceptDiscordFriendRequest(&instance_,
14403 (cb__userData->delegate ? cb__native :
nullptr),
14404 Tcb__UserData::Free,
14407void Client::AcceptGameFriendRequest(uint64_t userId,
14410 assert(state_ == DiscordObjectState::Owned);
14411 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
14412 auto cb__userData = Tcb__UserData::Create(std::move(cb));
14413 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
14414 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
14416 userData__typed->delegate(std::move(result__obj));
14418 Discord_Client_AcceptGameFriendRequest(&instance_,
14420 (cb__userData->delegate ? cb__native :
nullptr),
14421 Tcb__UserData::Free,
14426 assert(state_ == DiscordObjectState::Owned);
14427 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
14428 auto cb__userData = Tcb__UserData::Create(std::move(cb));
14429 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
14430 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
14432 userData__typed->delegate(std::move(result__obj));
14434 Discord_Client_BlockUser(&instance_,
14436 (cb__userData->delegate ? cb__native :
nullptr),
14437 Tcb__UserData::Free,
14440void Client::CancelDiscordFriendRequest(uint64_t userId,
14443 assert(state_ == DiscordObjectState::Owned);
14444 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
14445 auto cb__userData = Tcb__UserData::Create(std::move(cb));
14446 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
14447 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
14449 userData__typed->delegate(std::move(result__obj));
14451 Discord_Client_CancelDiscordFriendRequest(&instance_,
14453 (cb__userData->delegate ? cb__native :
nullptr),
14454 Tcb__UserData::Free,
14457void Client::CancelGameFriendRequest(uint64_t userId,
14460 assert(state_ == DiscordObjectState::Owned);
14461 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
14462 auto cb__userData = Tcb__UserData::Create(std::move(cb));
14463 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
14464 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
14466 userData__typed->delegate(std::move(result__obj));
14468 Discord_Client_CancelGameFriendRequest(&instance_,
14470 (cb__userData->delegate ? cb__native :
nullptr),
14471 Tcb__UserData::Free,
14476 assert(state_ == DiscordObjectState::Owned);
14477 Discord_RelationshipHandle returnValueNative__{};
14478 Discord_Client_GetRelationshipHandle(&instance_, userId, &returnValueNative__);
14480 return returnValue__;
14484 assert(state_ == DiscordObjectState::Owned);
14485 Discord_RelationshipHandleSpan returnValueNative__;
14486 Discord_Client_GetRelationships(&instance_, &returnValueNative__);
14488 returnValue__.reserve(returnValueNative__.size);
14489 for (
size_t i__ = 0; i__ < returnValueNative__.size; ++i__) {
14490 returnValue__.emplace_back(returnValueNative__.ptr[i__], DiscordObjectState::Owned);
14492 Discord_Free(returnValueNative__.ptr);
14493 return returnValue__;
14498 assert(state_ == DiscordObjectState::Owned);
14499 Discord_RelationshipHandleSpan returnValueNative__;
14500 Discord_Client_GetRelationshipsByGroup(
14501 &instance_,
static_cast<Discord_RelationshipGroupType
>(groupType), &returnValueNative__);
14503 returnValue__.reserve(returnValueNative__.size);
14504 for (
size_t i__ = 0; i__ < returnValueNative__.size; ++i__) {
14505 returnValue__.emplace_back(returnValueNative__.ptr[i__], DiscordObjectState::Owned);
14507 Discord_Free(returnValueNative__.ptr);
14508 return returnValue__;
14510void Client::RejectDiscordFriendRequest(uint64_t userId,
14513 assert(state_ == DiscordObjectState::Owned);
14514 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
14515 auto cb__userData = Tcb__UserData::Create(std::move(cb));
14516 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
14517 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
14519 userData__typed->delegate(std::move(result__obj));
14521 Discord_Client_RejectDiscordFriendRequest(&instance_,
14523 (cb__userData->delegate ? cb__native :
nullptr),
14524 Tcb__UserData::Free,
14527void Client::RejectGameFriendRequest(uint64_t userId,
14530 assert(state_ == DiscordObjectState::Owned);
14531 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
14532 auto cb__userData = Tcb__UserData::Create(std::move(cb));
14533 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
14534 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
14536 userData__typed->delegate(std::move(result__obj));
14538 Discord_Client_RejectGameFriendRequest(&instance_,
14540 (cb__userData->delegate ? cb__native :
nullptr),
14541 Tcb__UserData::Free,
14544void Client::RemoveDiscordAndGameFriend(uint64_t userId,
14547 assert(state_ == DiscordObjectState::Owned);
14548 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
14549 auto cb__userData = Tcb__UserData::Create(std::move(cb));
14550 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
14551 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
14553 userData__typed->delegate(std::move(result__obj));
14555 Discord_Client_RemoveDiscordAndGameFriend(&instance_,
14557 (cb__userData->delegate ? cb__native :
nullptr),
14558 Tcb__UserData::Free,
14563 assert(state_ == DiscordObjectState::Owned);
14564 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
14565 auto cb__userData = Tcb__UserData::Create(std::move(cb));
14566 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
14567 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
14569 userData__typed->delegate(std::move(result__obj));
14571 Discord_Client_RemoveGameFriend(&instance_,
14573 (cb__userData->delegate ? cb__native :
nullptr),
14574 Tcb__UserData::Free,
14578 std::string_view searchStr)
const
14580 assert(state_ == DiscordObjectState::Owned);
14581 Discord_UserHandleSpan returnValueNative__;
14582 Discord_String searchStr__str{(uint8_t*)(searchStr.data() !=
nullptr ? searchStr.data() :
""),
14584 Discord_Client_SearchFriendsByUsername(&instance_, searchStr__str, &returnValueNative__);
14586 returnValue__.reserve(returnValueNative__.size);
14587 for (
size_t i__ = 0; i__ < returnValueNative__.size; ++i__) {
14588 returnValue__.emplace_back(returnValueNative__.ptr[i__], DiscordObjectState::Owned);
14590 Discord_Free(returnValueNative__.ptr);
14591 return returnValue__;
14593void Client::SendDiscordFriendRequest(std::string_view username,
14596 assert(state_ == DiscordObjectState::Owned);
14597 Discord_String username__str{(uint8_t*)(username.data() !=
nullptr ? username.data() :
""),
14599 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
14600 auto cb__userData = Tcb__UserData::Create(std::move(cb));
14601 Discord_Client_SendFriendRequestCallback cb__native = [](
auto result,
void* userData__) {
14602 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
14604 userData__typed->delegate(std::move(result__obj));
14606 Discord_Client_SendDiscordFriendRequest(&instance_,
14608 (cb__userData->delegate ? cb__native :
nullptr),
14609 Tcb__UserData::Free,
14612void Client::SendDiscordFriendRequestById(uint64_t userId,
14615 assert(state_ == DiscordObjectState::Owned);
14616 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
14617 auto cb__userData = Tcb__UserData::Create(std::move(cb));
14618 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
14619 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
14621 userData__typed->delegate(std::move(result__obj));
14623 Discord_Client_SendDiscordFriendRequestById(&instance_,
14625 (cb__userData->delegate ? cb__native :
nullptr),
14626 Tcb__UserData::Free,
14629void Client::SendGameFriendRequest(std::string_view username,
14632 assert(state_ == DiscordObjectState::Owned);
14633 Discord_String username__str{(uint8_t*)(username.data() !=
nullptr ? username.data() :
""),
14635 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
14636 auto cb__userData = Tcb__UserData::Create(std::move(cb));
14637 Discord_Client_SendFriendRequestCallback cb__native = [](
auto result,
void* userData__) {
14638 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
14640 userData__typed->delegate(std::move(result__obj));
14642 Discord_Client_SendGameFriendRequest(&instance_,
14644 (cb__userData->delegate ? cb__native :
nullptr),
14645 Tcb__UserData::Free,
14648void Client::SendGameFriendRequestById(uint64_t userId,
14651 assert(state_ == DiscordObjectState::Owned);
14652 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
14653 auto cb__userData = Tcb__UserData::Create(std::move(cb));
14654 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
14655 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
14657 userData__typed->delegate(std::move(result__obj));
14659 Discord_Client_SendGameFriendRequestById(&instance_,
14661 (cb__userData->delegate ? cb__native :
nullptr),
14662 Tcb__UserData::Free,
14667 assert(state_ == DiscordObjectState::Owned);
14668 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
14669 auto cb__userData = Tcb__UserData::Create(std::move(cb));
14670 Discord_Client_RelationshipCreatedCallback cb__native =
14671 [](
auto userId,
auto isDiscordRelationshipUpdate,
void* userData__) {
14672 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
14673 userData__typed->delegate(userId, isDiscordRelationshipUpdate);
14675 Discord_Client_SetRelationshipCreatedCallback(&instance_,
14676 (cb__userData->delegate ? cb__native :
nullptr),
14677 Tcb__UserData::Free,
14682 assert(state_ == DiscordObjectState::Owned);
14683 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
14684 auto cb__userData = Tcb__UserData::Create(std::move(cb));
14685 Discord_Client_RelationshipDeletedCallback cb__native =
14686 [](
auto userId,
auto isDiscordRelationshipUpdate,
void* userData__) {
14687 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
14688 userData__typed->delegate(userId, isDiscordRelationshipUpdate);
14690 Discord_Client_SetRelationshipDeletedCallback(&instance_,
14691 (cb__userData->delegate ? cb__native :
nullptr),
14692 Tcb__UserData::Free,
14697 assert(state_ == DiscordObjectState::Owned);
14698 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
14699 auto cb__userData = Tcb__UserData::Create(std::move(cb));
14700 Discord_Client_UpdateRelationshipCallback cb__native = [](
auto result,
void* userData__) {
14701 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
14703 userData__typed->delegate(std::move(result__obj));
14705 Discord_Client_UnblockUser(&instance_,
14707 (cb__userData->delegate ? cb__native :
nullptr),
14708 Tcb__UserData::Free,
14711std::optional<discordpp::UserHandle> Client::GetCurrentUserV2()
const
14713 assert(state_ == DiscordObjectState::Owned);
14714 bool returnIsNonNull__;
14715 Discord_UserHandle returnValueNative__;
14716 returnIsNonNull__ = Discord_Client_GetCurrentUserV2(&instance_, &returnValueNative__);
14717 if (!returnIsNonNull__) {
14721 return returnValue__;
14723void Client::GetDiscordClientConnectedUser(
14724 uint64_t applicationId,
14727 assert(state_ == DiscordObjectState::Owned);
14728 using Tcallback__UserData = TDelegateUserData<std::remove_reference_t<
decltype(callback)>>;
14729 auto callback__userData = Tcallback__UserData::Create(std::move(callback));
14730 Discord_Client_GetDiscordClientConnectedUserCallback callback__native =
14731 [](
auto result,
auto user,
void* userData__) {
14732 auto userData__typed =
static_cast<Tcallback__UserData*
>(userData__);
14734 std::optional<discordpp::UserHandle> user__opt{};
14738 userData__typed->delegate(std::move(result__obj), std::move(user__opt));
14740 Discord_Client_GetDiscordClientConnectedUser(
14743 (callback__userData->delegate ? callback__native :
nullptr),
14744 Tcallback__UserData::Free,
14745 callback__userData);
14747std::optional<discordpp::UserHandle> Client::GetUser(uint64_t userId)
const
14749 assert(state_ == DiscordObjectState::Owned);
14750 bool returnIsNonNull__;
14751 Discord_UserHandle returnValueNative__;
14752 returnIsNonNull__ = Discord_Client_GetUser(&instance_, userId, &returnValueNative__);
14753 if (!returnIsNonNull__) {
14757 return returnValue__;
14759void Client::SetRelationshipGroupsUpdatedCallback(
14762 assert(state_ == DiscordObjectState::Owned);
14763 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
14764 auto cb__userData = Tcb__UserData::Create(std::move(cb));
14765 Discord_Client_RelationshipGroupsUpdatedCallback cb__native = [](
auto userId,
14766 void* userData__) {
14767 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
14768 userData__typed->delegate(userId);
14770 Discord_Client_SetRelationshipGroupsUpdatedCallback(
14772 (cb__userData->delegate ? cb__native :
nullptr),
14773 Tcb__UserData::Free,
14778 assert(state_ == DiscordObjectState::Owned);
14779 using Tcb__UserData = TDelegateUserData<std::remove_reference_t<
decltype(cb)>>;
14780 auto cb__userData = Tcb__UserData::Create(std::move(cb));
14781 Discord_Client_UserUpdatedCallback cb__native = [](
auto userId,
void* userData__) {
14782 auto userData__typed =
static_cast<Tcb__UserData*
>(userData__);
14783 userData__typed->delegate(userId);
14785 Discord_Client_SetUserUpdatedCallback(&instance_,
14786 (cb__userData->delegate ? cb__native :
nullptr),
14787 Tcb__UserData::Free,
14790const CallInfoHandle CallInfoHandle::nullobj{{}, DiscordObjectState::Invalid};
14791CallInfoHandle::~CallInfoHandle()
14793 if (state_ == DiscordObjectState::Owned) {
14795 state_ = DiscordObjectState::Invalid;
14798CallInfoHandle::CallInfoHandle(CallInfoHandle&& other) noexcept
14799 : instance_(other.instance_)
14800 , state_(other.state_)
14802 other.state_ = DiscordObjectState::Invalid;
14804CallInfoHandle& CallInfoHandle::operator=(CallInfoHandle&& other)
noexcept
14806 if (
this != &other) {
14807 if (state_ == DiscordObjectState::Owned) {
14810 instance_ = other.instance_;
14811 state_ = other.state_;
14812 other.state_ = DiscordObjectState::Invalid;
14816CallInfoHandle::CallInfoHandle(
const CallInfoHandle& other)
14821 Discord_CallInfoHandle_Clone(&instance_, other.instance());
14823 state_ = DiscordObjectState::Owned;
14826CallInfoHandle& CallInfoHandle::operator=(
const CallInfoHandle& other)
14828 if (
this != &other) {
14829 if (state_ == DiscordObjectState::Owned) {
14831 state_ = DiscordObjectState::Invalid;
14833 if (other.state_ == DiscordObjectState::Owned) {
14834 Discord_CallInfoHandle_Clone(&instance_, other.instance());
14836 state_ = DiscordObjectState::Owned;
14841CallInfoHandle::CallInfoHandle(Discord_CallInfoHandle instance, DiscordObjectState state)
14842 : instance_(instance)
14846void CallInfoHandle::Drop()
14848 if (state_ != DiscordObjectState::Owned) {
14851 Discord_CallInfoHandle_Drop(&instance_);
14852 state_ = DiscordObjectState::Invalid;
14854uint64_t CallInfoHandle::ChannelId()
const
14856 assert(state_ == DiscordObjectState::Owned);
14857 uint64_t returnValue__;
14858 returnValue__ = Discord_CallInfoHandle_ChannelId(&instance_);
14859 return returnValue__;
14863 assert(state_ == DiscordObjectState::Owned);
14864 Discord_UInt64Span returnValueNative__;
14865 Discord_CallInfoHandle_GetParticipants(&instance_, &returnValueNative__);
14867 returnValueNative__.ptr + returnValueNative__.size);
14868 Discord_Free(returnValueNative__.ptr);
14869 return returnValue__;
14871std::optional<discordpp::VoiceStateHandle> CallInfoHandle::GetVoiceStateHandle(
14872 uint64_t userId)
const
14874 assert(state_ == DiscordObjectState::Owned);
14875 bool returnIsNonNull__;
14876 Discord_VoiceStateHandle returnValueNative__;
14877 returnIsNonNull__ =
14878 Discord_CallInfoHandle_GetVoiceStateHandle(&instance_, userId, &returnValueNative__);
14879 if (!returnIsNonNull__) {
14883 return returnValue__;
14885uint64_t CallInfoHandle::GuildId()
const
14887 assert(state_ == DiscordObjectState::Owned);
14888 uint64_t returnValue__;
14889 returnValue__ = Discord_CallInfoHandle_GuildId(&instance_);
14890 return returnValue__;
Struct which controls what your rich presence looks like in the Discord client. If you don't specify ...
Definition discordpp.h:1164
void SetLargeText(std::optional< std::string_view > LargeText)
Setter for ActivityAssets::LargeText.
void SetInviteCoverImage(std::optional< std::string_view > InviteCoverImage)
Setter for ActivityAssets::InviteCoverImage.
ActivityAssets(ActivityAssets &&other) noexcept
Move constructor for ActivityAssets.
std::optional< discordpp::String > SmallText() const
A tooltip string that is shown when the user hovers over the small image.
void SetLargeImage(std::optional< std::string_view > LargeImage)
Setter for ActivityAssets::LargeImage.
ActivityAssets(const ActivityAssets &arg0)
Copy constructor for ActivityAssets.
std::optional< discordpp::String > SmallUrl() const
A URL that opens when the user clicks/taps the small image.
void SetLargeUrl(std::optional< std::string_view > LargeUrl)
Setter for ActivityAssets::LargeUrl.
std::optional< discordpp::String > InviteCoverImage() const
The invite cover image identifier or URL, rendered as a banner image on activity invites.
std::optional< discordpp::String > LargeUrl() const
A URL that opens when the user clicks/taps the large image.
void SetSmallText(std::optional< std::string_view > SmallText)
Setter for ActivityAssets::SmallText.
ActivityAssets & operator=(const ActivityAssets &arg0)
Copy assignment operator for ActivityAssets.
static const ActivityAssets nullobj
Uninitialized instance of ActivityAssets.
Definition discordpp.h:1183
void SetSmallUrl(std::optional< std::string_view > SmallUrl)
Setter for ActivityAssets::SmallUrl.
std::optional< discordpp::String > LargeText() const
A tooltip string that is shown when the user hovers over the large image.
std::optional< discordpp::String > LargeImage() const
The primary image identifier or URL, rendered as a large square icon on a user's rich presence.
void SetSmallImage(std::optional< std::string_view > SmallImage)
Setter for ActivityAssets::SmallImage.
std::optional< discordpp::String > SmallImage() const
The secondary image, rendered as a small circle over the largeImage.
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:1066
static const ActivityInvite nullobj
Uninitialized instance of ActivityInvite.
Definition discordpp.h:1085
void SetIsValid(bool IsValid)
Setter for ActivityInvite::IsValid.
uint64_t ApplicationId() const
The target application of the invite.
void SetSessionId(std::string_view SessionId)
Setter for ActivityInvite::SessionId.
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 SetPartyId(std::string_view PartyId)
Setter for ActivityInvite::PartyId.
discordpp::String PartyId() const
The id of the party the invite was sent for.
discordpp::String SessionId() const
The session id of the user who sent the invite.
void SetSenderId(uint64_t SenderId)
Setter for ActivityInvite::SenderId.
void SetParentApplicationId(uint64_t ParentApplicationId)
Setter for ActivityInvite::ParentApplicationId.
bool IsValid() const
Whether or not this invite is currently joinable. An invite becomes invalid if it was sent more than ...
void SetChannelId(uint64_t ChannelId)
Setter for ActivityInvite::ChannelId.
uint64_t ChannelId() const
The id of the Discord channel in which the invite was sent.
void SetMessageId(uint64_t MessageId)
Setter for ActivityInvite::MessageId.
ActivityInvite & operator=(ActivityInvite &&other) noexcept
Move assignment operator for ActivityInvite.
ActivityInvite(const ActivityInvite &rhs)
Copy constructor for ActivityInvite.
void SetType(discordpp::ActivityActionTypes Type)
Setter for ActivityInvite::Type.
uint64_t ParentApplicationId() const
The application id of the parent - this is only applicable if there is a parent for a publisher's sui...
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:1305
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.
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 SetId(std::string_view Id)
Setter for ActivityParty::Id.
void SetPrivacy(discordpp::ActivityPartyPrivacy Privacy)
Setter for ActivityParty::Privacy.
discordpp::String Id() const
Specifies the id of the party. "Party" is used colloquially to refer to a group of players in a share...
discordpp::ActivityPartyPrivacy Privacy() const
The privacy of the party.
static const ActivityParty nullobj
Uninitialized instance of ActivityParty.
Definition discordpp.h:1324
ActivityParty & operator=(const ActivityParty &arg0)
Copy assignment operator for ActivityParty.
Definition discordpp.h:1367
ActivitySecrets & operator=(ActivitySecrets &&other) noexcept
Move assignment operator for ActivitySecrets.
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_view Join)
Setter for ActivitySecrets::Join.
static const ActivitySecrets nullobj
Uninitialized instance of ActivitySecrets.
Definition discordpp.h:1386
discordpp::String Join() const
A secret string that is shared with users who are accepted into the party so the game knows how to jo...
Definition discordpp.h:1251
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:1270
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:1636
void SetState(std::optional< std::string_view > State)
Setter for Activity::State.
std::optional< uint64_t > ParentApplicationId() const
The application ID of the parent application that the activity is associated with if it exists....
static const Activity nullobj
Uninitialized instance of Activity.
Definition discordpp.h:1655
void SetDetailsUrl(std::optional< std::string_view > DetailsUrl)
Setter for Activity::DetailsUrl.
std::optional< uint64_t > ApplicationId() const
The application ID of the game that the activity is associated with.
Activity & operator=(Activity &&other) noexcept
Move assignment operator for Activity.
void SetParentApplicationId(std::optional< uint64_t > ParentApplicationId)
Setter for Activity::ParentApplicationId.
void SetType(discordpp::ActivityTypes Type)
Setter for Activity::Type.
std::optional< discordpp::ActivityAssets > Assets() const
Images used to customize how the Activity is displayed in the Discord client.
void SetTimestamps(std::optional< discordpp::ActivityTimestamps > Timestamps)
Setter for Activity::Timestamps.
bool Equals(discordpp::Activity other) const
Compares each field of the Activity struct for equality.
void SetApplicationId(std::optional< uint64_t > ApplicationId)
Setter for Activity::ApplicationId.
std::optional< discordpp::String > DetailsUrl() const
A URL that opens when the user clicks/taps the details text.
discordpp::Vector< discordpp::ActivityButton > GetButtons() const
Returns the custom buttons for the rich presence.
std::optional< discordpp::String > Details() const
The state of the what the user is doing for this activity.
void SetSecrets(std::optional< discordpp::ActivitySecrets > Secrets)
Setter for Activity::Secrets.
Activity(const Activity &arg0)
Copy constructor for Activity.
discordpp::String Name() const
The name of the game or application that the activity is associated with.
void SetAssets(std::optional< discordpp::ActivityAssets > Assets)
Setter for Activity::Assets.
std::optional< discordpp::StatusDisplayTypes > StatusDisplayType() const
Controls which field is used for the user's status message.
std::optional< discordpp::String > State() const
The state of the party for this activity.
void SetName(std::string_view Name)
Setter for Activity::Name.
std::optional< discordpp::ActivityTimestamps > Timestamps() const
The timestamps struct can be used to render either:
void SetParty(std::optional< discordpp::ActivityParty > Party)
Setter for Activity::Party.
void SetDetails(std::optional< std::string_view > Details)
Setter for Activity::Details.
void SetStatusDisplayType(std::optional< discordpp::StatusDisplayTypes > StatusDisplayType)
Setter for Activity::StatusDisplayType.
Activity & operator=(const Activity &arg0)
Copy assignment operator for Activity.
std::optional< discordpp::ActivityParty > Party() const
The party struct is used to indicate the size and members of the people the current user is playing w...
void AddButton(discordpp::ActivityButton button)
Adds a custom button to the rich presence.
void SetStateUrl(std::optional< std::string_view > StateUrl)
Setter for Activity::StateUrl.
void SetSupportedPlatforms(discordpp::ActivityGamePlatforms SupportedPlatforms)
Setter for Activity::SupportedPlatforms.
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< discordpp::String > StateUrl() const
A URL that opens when the user clicks/taps the state text.
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:3367
std::optional< discordpp::String > Title() const
When the additional content is a poll or thread, this field will contain the name of the poll or thre...
AdditionalContent & operator=(AdditionalContent &&other) noexcept
Move assignment operator for AdditionalContent.
void SetTitle(std::optional< std::string_view > Title)
Setter for AdditionalContent::Title.
void SetCount(uint8_t Count)
Setter for AdditionalContent::Count.
void SetType(discordpp::AdditionalContentType Type)
Setter for AdditionalContent::Type.
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.
static discordpp::String TypeToString(discordpp::AdditionalContentType type)
Converts the AdditionalContentType enum to a string.
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.
static const AdditionalContent nullobj
Uninitialized instance of AdditionalContent.
Definition discordpp.h:3386
Represents a single input or output audio device available to the user.
Definition discordpp.h:3606
AudioDevice & operator=(const AudioDevice &arg0)
Copy assignment operator for AudioDevice.
bool Equals(discordpp::AudioDevice rhs)
Compares the ID of two AudioDevice objects for equality.
bool IsDefault() const
Whether the audio device is the system default device.
void SetId(std::string_view Id)
Setter for AudioDevice::Id.
AudioDevice(AudioDevice &&other) noexcept
Move constructor for AudioDevice.
AudioDevice & operator=(AudioDevice &&other) noexcept
Move assignment operator for AudioDevice.
discordpp::String Id() const
The ID of the audio device.
static const AudioDevice nullobj
Uninitialized instance of AudioDevice.
Definition discordpp.h:3625
void SetIsDefault(bool IsDefault)
Setter for AudioDevice::IsDefault.
void SetName(std::string_view Name)
Setter for AudioDevice::Name.
AudioDevice(const AudioDevice &arg0)
Copy constructor for AudioDevice.
discordpp::String Name() const
The display name of the audio device.
Arguments to the Client::Authorize function.
Definition discordpp.h:1977
void SetIntegrationType(std::optional< discordpp::IntegrationType > IntegrationType)
Setter for AuthorizationArgs::IntegrationType.
AuthorizationArgs & operator=(AuthorizationArgs &&other) noexcept
Move assignment operator for AuthorizationArgs.
std::optional< discordpp::String > Nonce() const
The nonce field is generally only useful for backend integrations using ID tokens.
void SetState(std::optional< std::string_view > State)
Setter for AuthorizationArgs::State.
discordpp::String Scopes() const
Scopes is a space separated string of the oauth scopes your game is requesting.
std::optional< discordpp::AuthorizationCodeChallenge > CodeChallenge() const
If using the Client::GetToken flow, you will need to generate a code challenge and verifier.
std::optional< discordpp::String > State() const
See https://discord.com/developers/docs/topics/oauth2#state-and-security for details on this field.
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.
static const AuthorizationArgs nullobj
Uninitialized instance of AuthorizationArgs.
Definition discordpp.h:1996
void SetClientId(uint64_t ClientId)
Setter for AuthorizationArgs::ClientId.
void SetNonce(std::optional< std::string_view > Nonce)
Setter for AuthorizationArgs::Nonce.
std::optional< discordpp::IntegrationType > IntegrationType() const
The type of integration the app will be installed as.
void SetCodeChallenge(std::optional< discordpp::AuthorizationCodeChallenge > CodeChallenge)
Setter for AuthorizationArgs::CodeChallenge.
AuthorizationArgs(AuthorizationArgs &&other) noexcept
Move constructor for AuthorizationArgs.
AuthorizationArgs & operator=(const AuthorizationArgs &arg0)
Copy assignment operator for AuthorizationArgs.
void SetCustomSchemeParam(std::optional< std::string_view > CustomSchemeParam)
Setter for AuthorizationArgs::CustomSchemeParam.
std::optional< discordpp::String > CustomSchemeParam() const
Custom URI scheme for mobile redirects.
void SetScopes(std::string_view Scopes)
Setter for AuthorizationArgs::Scopes.
Struct that encapsulates the challenge part of the code verification flow.
Definition discordpp.h:1885
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.
AuthorizationCodeChallenge & operator=(AuthorizationCodeChallenge &&other) noexcept
Move assignment operator for AuthorizationCodeChallenge.
void SetChallenge(std::string_view Challenge)
Setter for AuthorizationCodeChallenge::Challenge.
void SetMethod(discordpp::AuthenticationCodeChallengeMethod Method)
Setter for AuthorizationCodeChallenge::Method.
static const AuthorizationCodeChallenge nullobj
Uninitialized instance of AuthorizationCodeChallenge.
Definition discordpp.h:1905
AuthorizationCodeChallenge & operator=(const AuthorizationCodeChallenge &arg0)
Copy assignment operator for AuthorizationCodeChallenge.
AuthorizationCodeChallenge(AuthorizationCodeChallenge &&other) noexcept
Move constructor for AuthorizationCodeChallenge.
discordpp::String Challenge() const
The challenge value.
Struct that encapsulates both parts of the code verification flow.
Definition discordpp.h:1932
AuthorizationCodeVerifier(const AuthorizationCodeVerifier &arg0)
Copy constructor for AuthorizationCodeVerifier.
AuthorizationCodeVerifier & operator=(const AuthorizationCodeVerifier &arg0)
Copy assignment operator for AuthorizationCodeVerifier.
AuthorizationCodeVerifier(AuthorizationCodeVerifier &&other) noexcept
Move constructor for AuthorizationCodeVerifier.
void SetChallenge(discordpp::AuthorizationCodeChallenge Challenge)
Setter for AuthorizationCodeVerifier::Challenge.
static const AuthorizationCodeVerifier nullobj
Uninitialized instance of AuthorizationCodeVerifier.
Definition discordpp.h:1952
void SetVerifier(std::string_view Verifier)
Setter for AuthorizationCodeVerifier::Verifier.
discordpp::AuthorizationCodeChallenge Challenge() const
The challenge part of the code verification flow.
discordpp::String Verifier() const
The verifier 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:6113
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.
CallInfoHandle & operator=(const CallInfoHandle &other)
Copy assignment operator for CallInfoHandle.
CallInfoHandle(const CallInfoHandle &other)
Copy constructor for CallInfoHandle.
discordpp::Vector< uint64_t > GetParticipants() const
Returns a list of the user IDs of the participants in the call.
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:6132
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:2237
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...
static discordpp::String ErrorToString(discordpp::Call::Error type)
Converts the Error enum to a string.
static const Call nullobj
Uninitialized instance of Call.
Definition discordpp.h:2315
Call(Call &&other) noexcept
Move constructor for Call.
discordpp::Function< void(uint64_t userId, bool added)> OnParticipantChanged
Callback function for Call::SetParticipantChangedCallback.
Definition discordpp.h:2295
void SetOnVoiceStateChangedCallback(discordpp::Call::OnVoiceStateChanged cb)
Sets a callback function to generally be invoked whenever a field on a VoiceStateHandle object for a ...
discordpp::Function< void(uint64_t userId, bool isPlayingSound)> OnSpeakingStatusChanged
Callback function for Call::SetSpeakingStatusChangedCallback.
Definition discordpp.h:2298
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::Vector< uint64_t > GetParticipants() const
Returns a list of all of the user IDs of the participants in the call.
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.
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:2245
@ None
None.
Definition discordpp.h:2248
@ Forbidden
Forbidden.
Definition discordpp.h:2263
@ SignalingConnectionFailed
SignalingConnectionFailed.
Definition discordpp.h:2251
@ SignalingUnexpectedClose
SignalingUnexpectedClose.
Definition discordpp.h:2254
@ JoinTimeout
JoinTimeout.
Definition discordpp.h:2260
@ VoiceConnectionFailed
VoiceConnectionFailed.
Definition discordpp.h:2257
Status
Enum that respresents the state of the Call's network connection.
Definition discordpp.h:2267
@ Disconnecting
Disconnecting.
Definition discordpp.h:2288
@ Connected
Connected.
Definition discordpp.h:2282
@ Reconnecting
Reconnecting.
Definition discordpp.h:2285
@ Connecting
Connecting.
Definition discordpp.h:2276
@ SignalingConnected
SignalingConnected.
Definition discordpp.h:2279
@ Disconnected
Disconnected.
Definition discordpp.h:2270
@ Joining
Joining.
Definition discordpp.h:2273
void SetLocalMute(uint64_t userId, bool mute)
Locally mutes the given userId, so that the current user cannot hear them anymore.
discordpp::Function< void(discordpp::Call::Status status, discordpp::Call::Error error, int32_t errorDetail)> OnStatusChanged
Callback function for Call::SetStatusChangedCallback.
Definition discordpp.h:2301
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 ...
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.
static discordpp::String StatusToString(discordpp::Call::Status type)
Converts the Status enum to a string.
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.
bool GetSelfMute()
Returns whether the current user's microphone is muted.
discordpp::Function< void(uint64_t userId)> OnVoiceStateChanged
Callback function for Call::SetOnVoiceStateChangedCallback.
Definition discordpp.h:2292
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.
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.
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:2464
ChannelHandle(const ChannelHandle &other)
Copy constructor for ChannelHandle.
ChannelHandle & operator=(const ChannelHandle &other)
Copy assignment operator for ChannelHandle.
discordpp::Vector< uint64_t > Recipients() const
For DMs and GroupDMs, returns the user IDs of the members of the channel. For all other channels retu...
static const ChannelHandle nullobj
Uninitialized instance of ChannelHandle.
Definition discordpp.h:2483
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.
discordpp::String Name() const
Returns the name of the channel.
discordpp::ChannelType Type() const
Returns the type of the channel.
Options for creating a new Client instance.
Definition discordpp.h:3923
discordpp::String ApiBase() const
The base URL for the Discord API.
void SetApiBase(std::string_view ApiBase)
Setter for ClientCreateOptions::ApiBase.
void SetCpuAffinityMask(std::optional< uint64_t > CpuAffinityMask)
Setter for ClientCreateOptions::CpuAffinityMask.
discordpp::AudioSystem ExperimentalAudioSystem() const
The audio system to use. Defaults to AudioSystem::Standard.
static const ClientCreateOptions nullobj
Uninitialized instance of ClientCreateOptions.
Definition discordpp.h:3942
void SetWebBase(std::string_view WebBase)
Setter for ClientCreateOptions::WebBase.
ClientCreateOptions & operator=(const ClientCreateOptions &arg0)
Copy assignment operator for ClientCreateOptions.
bool ExperimentalAndroidPreventCommsForBluetooth() const
Whether to prevent communications mode on Android when Bluetooth is connected.
ClientCreateOptions(const ClientCreateOptions &arg0)
Copy constructor for ClientCreateOptions.
void SetExperimentalAudioSystem(discordpp::AudioSystem ExperimentalAudioSystem)
Setter for ClientCreateOptions::ExperimentalAudioSystem.
ClientCreateOptions(ClientCreateOptions &&other) noexcept
Move constructor for ClientCreateOptions.
std::optional< uint64_t > CpuAffinityMask() const
CPU affinity mask hint for certain platforms. Depending on platform support, may or may not be ignore...
discordpp::String WebBase() const
The base URL for the Discord web application.
void SetExperimentalAndroidPreventCommsForBluetooth(bool ExperimentalAndroidPreventCommsForBluetooth)
Setter for ClientCreateOptions::ExperimentalAndroidPreventCommsForBluetooth.
ClientCreateOptions & operator=(ClientCreateOptions &&other) noexcept
Move assignment operator for ClientCreateOptions.
Struct that stores information about the result of an SDK function call.
Definition discordpp.h:1792
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.
discordpp::String ToString() const
Returns the error message if any of the ClientResult.
void SetErrorCode(int32_t ErrorCode)
Setter for ClientResult::ErrorCode.
discordpp::String ResponseBody() const
The full HTTP response body, which will usually be a JSON string.
discordpp::String Error() const
A description of the error that occurred.
ClientResult & operator=(const ClientResult &arg0)
Copy assignment operator for ClientResult.
void SetStatus(discordpp::HttpStatusCode Status)
Setter for ClientResult::Status.
discordpp::ErrorType Type() const
The type of error that occurred. See ErrorType for more information.
ClientResult(ClientResult &&other) noexcept
Move constructor for ClientResult.
void SetResponseBody(std::string_view ResponseBody)
Setter for ClientResult::ResponseBody.
void SetSuccessful(bool Successful)
Setter for ClientResult::Successful.
static const ClientResult nullobj
Uninitialized instance of ClientResult.
Definition discordpp.h:1811
void SetError(std::string_view Error)
Setter for ClientResult::Error.
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 ...
discordpp::HttpStatusCode Status() const
The HTTP status code of the API call.
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:4004
discordpp::Function< void()> AuthorizeDeviceScreenClosedCallback
Callback function for Client::SetAuthorizeDeviceScreenClosedCallback.
Definition discordpp.h:4232
discordpp::Function< void(uint64_t channelId, uint64_t userId)> DiscordClientGuildVoiceMemberUpdatedCallback
A member changed.
Definition discordpp.h:4111
void SetRelationshipCreatedCallback(discordpp::Client::RelationshipCreatedCallback cb)
Sets a callback to be invoked whenever a relationship for this user is established or changes type.
void GetUserMessagesWithLimit(uint64_t recipientId, int32_t limit, discordpp::Client::UserMessagesWithLimitCallback cb)
Retrieves messages from the DM conversation with the specified user.
void GetTokenFromProvisionalMerge(uint64_t applicationId, std::string_view code, std::string_view codeVerifier, std::string_view redirectUri, discordpp::AuthenticationExternalAuthType externalAuthType, std::string_view externalAuthToken, discordpp::Client::TokenExchangeCallback callback)
This function should be used with the Client::Authorize function whenever a user with a provisional a...
void GetLobbyMessagesWithLimit(uint64_t lobbyId, int32_t limit, discordpp::Client::GetLobbyMessagesCallback cb)
Retrieves recent messages from the specified lobby.
void FetchUserGuilds(discordpp::Client::FetchUserGuildsCallback cb)
Fetches all of the guilds (also known as Discord servers) that the current user is a member Use this ...
void CreateOrJoinLobbyWithMetadata(std::string_view secret, discordpp::StringMap const &lobbyMetadata, discordpp::StringMap const &memberMetadata, discordpp::Client::CreateOrJoinLobbyCallback callback)
Variant of Client::CreateOrJoinLobby that also accepts developer-supplied metadata.
void SetVoiceLogDir(std::string_view path, discordpp::LoggingSeverity minSeverity)
Causes logs generated by the voice subsystem of the SDK to be written to disk in the specified direct...
discordpp::Function< void(discordpp::ClientResult result, uint64_t id, discordpp::String name)> FetchCurrentUserCallback
Callback function for Client::FetchCurrentUser.
Definition discordpp.h:4209
discordpp::Vector< uint64_t > GetLobbyIds() const
Returns a list of all the lobbies that the user is a member of and the SDK has loaded.
discordpp::Function< void()> AuthorizeRequestCallback
Callback invoked when a user requests to initiate the authorization flow from the discord app.
Definition discordpp.h:4226
void GetToken(uint64_t applicationId, std::string_view code, std::string_view codeVerifier, std::string_view redirectUri, discordpp::Client::TokenExchangeCallback callback)
Exchanges an authorization code that was returned from the Client::Authorize function for an access t...
discordpp::Call GetCall(uint64_t channelId)
Returns a reference to the currently active call, if any.
discordpp::Function< void(uint64_t messageId, uint64_t channelId)> MessageDeletedCallback
Callback function for Client::SetMessageDeletedCallback.
Definition discordpp.h:4286
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...
void UpdateProvisionalAccountDisplayName(std::string_view name, discordpp::Client::UpdateProvisionalAccountDisplayNameCallback callback)
Updates the display name of a provisional account to the specified name.
discordpp::Function< void(discordpp::Vector< discordpp::AudioDevice > inputDevices, discordpp::Vector< discordpp::AudioDevice > outputDevices)> DeviceChangeCallback
Callback function for Client::SetDeviceChangeCallback.
Definition discordpp.h:4154
void Disconnect()
Asynchronously disconnects the client.
discordpp::Function< void()> TokenExpirationCallback
Callback function for Client::SetTokenExpirationCallback.
Definition discordpp.h:4235
void SetDiscordClientVoiceChannelSelectedCallback(discordpp::Client::DiscordClientVoiceChannelSelectedCallback cb)
Sets the channel-selected callback. !group GuildVoice.
discordpp::Function< void(uint64_t channelId, uint64_t userId)> DiscordClientGuildVoiceSpeakingStoppedCallback
A member stopped speaking.
Definition discordpp.h:4119
discordpp::Function< void(discordpp::ClientResult result, discordpp::VoiceSettings settings)> GetVoiceSettingsCallback
Callback function for Client::GetVoiceSettings.
Definition discordpp.h:4150
void SetDiscordClientGuildVoiceSpeakingStoppedCallback(discordpp::Client::DiscordClientGuildVoiceSpeakingStoppedCallback cb)
Sets the speaking-stopped callback. !group GuildVoice.
void SetInputDevice(std::string_view deviceId, discordpp::Client::SetInputDeviceCallback cb)
Asynchronously changes the audio input device in use by the client to the specified device....
void JoinDiscordClientGuildVoiceChannel(uint64_t channelId, bool force, discordpp::Client::DiscordClientGuildVoiceResultCallback callback)
Joins desktop voice. Requires CONNECT. !group GuildVoice.
void OpenAuthorizeDeviceScreen(uint64_t clientId, std::string_view userCode)
This function is used to show the device authorization screen and is used for the case where the user...
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.
discordpp::Function< void(discordpp::AudioDevice device)> GetCurrentOutputDeviceCallback
Callback function for Client::GetCurrentOutputDevice.
Definition discordpp.h:4139
void SetVoiceSettingsUpdatedCallback(discordpp::Client::VoiceSettingsUpdatedCallback callback)
Sets a callback to be invoked whenever the user's voice settings change in the connected Discord clie...
void CancelGameFriendRequest(uint64_t userId, discordpp::Client::UpdateRelationshipCallback cb)
Cancels an outgoing game friend request to the target user.
discordpp::Function< void(discordpp::VoiceSettings settings)> VoiceSettingsUpdatedCallback
Callback function for Client::SetVoiceSettingsUpdatedCallback.
Definition discordpp.h:4172
discordpp::Function< void(uint64_t messageId)> MessageCreatedCallback
Callback function for Client::SetMessageCreatedCallback.
Definition discordpp.h:4283
void AbortGetTokenFromDevice()
This function is used to abort/cleanup the device authorization flow.
discordpp::Function< void(uint64_t applicationId, discordpp::String joinSecret)> ActivityJoinWithApplicationCallback
Callback function for Client::SetActivityJoinWithApplicationCallback.
Definition discordpp.h:4382
discordpp::Function< void(discordpp::String state)> DiscordClientVoiceConnectionStatusChangedCallback
The voice connection changed.
Definition discordpp.h:4126
void OpenConnectedGamesSettingsInDiscord(discordpp::Client::OpenConnectedGamesSettingsInDiscordCallback callback)
Opens the Connected Games settings in the Discord client, which is where users can manage their setti...
void UnmergeIntoProvisionalAccount(uint64_t applicationId, discordpp::AuthenticationExternalAuthType externalAuthType, std::string_view externalAuthToken, discordpp::Client::UnmergeIntoProvisionalAccountCallback callback)
This function is used to unlink/unmerge a external identity from a Discord account....
void SetDiscordClientGuildVoiceMemberAddedCallback(discordpp::Client::DiscordClientGuildVoiceMemberAddedCallback cb)
Sets the member-added callback. !group GuildVoice.
discordpp::Function< void(uint64_t lobbyId, uint64_t memberId, bool added)> VoiceParticipantChangedCallback
Callback function for Client::SetVoiceParticipantChangedCallback.
Definition discordpp.h:4168
void SetAuthorizeDeviceScreenClosedCallback(discordpp::Client::AuthorizeDeviceScreenClosedCallback cb)
Sets a callback function to be invoked when the device authorization screen is closed.
discordpp::Function< void(discordpp::ClientResult result)> UpdateRichPresenceCallback
Callback function for when Client::UpdateRichPresence completes.
Definition discordpp.h:4389
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.
void UnlinkChannelFromLobby(uint64_t lobbyId, discordpp::Client::LinkOrUnlinkChannelCallback callback)
Removes any existing channel link from the specified lobby.
discordpp::Function< void(discordpp::Vector< discordpp::AudioDevice > devices)> GetOutputDevicesCallback
Callback function for Client::GetOutputDevices.
Definition discordpp.h:4146
discordpp::Vector< discordpp::UserHandle > SearchFriendsByUsername(std::string_view searchStr) const
Searches all of your friends by both username and display name, returning a list of all friends that ...
discordpp::Function< void(discordpp::ClientResult result)> LinkOrUnlinkChannelCallback
Callback function for Client::LinkChannelToLobby.
Definition discordpp.h:4341
discordpp::Function< void(discordpp::ClientResult result)> EditUserMessageCallback
Callback function for Client::EditUserMessage.
Definition discordpp.h:4253
void SetMessageDeletedCallback(discordpp::Client::MessageDeletedCallback cb)
Sets a callback to be invoked whenever a message is deleted.
void FetchCurrentUser(discordpp::AuthorizationTokenType tokenType, std::string_view token, discordpp::Client::FetchCurrentUserCallback callback)
Fetches basic information about the user associated with the given auth token.
void GetProvisionalToken(uint64_t applicationId, discordpp::AuthenticationExternalAuthType externalAuthType, std::string_view 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 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.
discordpp::Function< void()> EndCallCallback
Callback invoked when Client::EndCall completes.
Definition discordpp.h:4130
discordpp::Function< void(discordpp::ClientResult result, discordpp::String accessToken, discordpp::String refreshToken, discordpp::AuthorizationTokenType tokenType, int32_t expiresIn, discordpp::String scopes)> TokenExchangeCallback
Callback function for the token exchange APIs such as Client::GetToken.
Definition discordpp.h:4213
discordpp::Function< void(uint64_t channelId, uint64_t userId)> DiscordClientGuildVoiceMemberAddedCallback
A member joined.
Definition discordpp.h:4103
discordpp::Function< void(discordpp::ClientResult result, discordpp::String accessToken, discordpp::AuthorizationTokenType tokenType, int32_t expiresIn, discordpp::String scopes)> ExchangeChildTokenCallback
Callback function for Client::ExchangeChildToken.
Definition discordpp.h:4201
discordpp::Function< void(discordpp::ClientResult result)> UpdateStatusCallback
Callback function for when Client::SetOnlineStatus completes.
Definition discordpp.h:4386
void LinkChannelToLobby(uint64_t lobbyId, uint64_t channelId, discordpp::Client::LinkOrUnlinkChannelCallback callback)
Links the specified channel on Discord to the specified in-game lobby.
void SetDeviceChangeCallback(discordpp::Client::DeviceChangeCallback callback)
Sets a callback function to be invoked when Discord detects a change in the available audio devices.
void GetUserMessageSummaries(discordpp::Client::UserMessageSummariesCallback cb)
Retrieves message conversation summaries for all users the current user has DM conversations with.
discordpp::Function< void(uint64_t userId, bool isDiscordRelationshipUpdate)> RelationshipDeletedCallback
Callback function for Client::SetRelationshipDeletedCallback.
Definition discordpp.h:4410
void RefreshToken(uint64_t applicationId, std::string_view refreshToken, discordpp::Client::TokenExchangeCallback callback)
Generates a new access token for the current user from a refresh token.
bool SetLogDir(std::string_view path, discordpp::LoggingSeverity minSeverity)
Causes logs generated by the SDK to be written to disk in the specified directory.
discordpp::Function< void(discordpp::ClientResult result)> SendFriendRequestCallback
Callback function for Client::SendDiscordFriendRequest and Client::SendGameFriendRequest.
Definition discordpp.h:4397
void SetUserUpdatedCallback(discordpp::Client::UserUpdatedCallback cb)
The UserUpdatedCallback is invoked whenever any user the current session knows about changes,...
discordpp::Function< void(discordpp::ClientResult result)> UpdateProvisionalAccountDisplayNameCallback
Callback function for Client::UpdateProvisionalAccountDisplayName.
Definition discordpp.h:4242
discordpp::Function< void()> ProvisionalUserMergeRequiredCallback
Callback function for when Client::ProvisionalUserMergeCompleted completes.
Definition discordpp.h:4271
void SetAecDump(bool on)
Enables or disables AEC diagnostic recording.
void SetActivityInviteCreatedCallback(discordpp::Client::ActivityInviteCallback cb)
Sets a callback function that is invoked when the current user receives an activity invite from anoth...
void GetVoiceSettings(discordpp::Client::GetVoiceSettingsCallback cb)
Asynchronously fetches the user's current voice settings from the connected Discord client.
discordpp::Function< void(discordpp::ClientResult result, discordpp::DiscordClientGuildVoiceSnapshot snapshot)> GetDiscordClientGuildVoiceChannelCallback
Receives a channel snapshot.
Definition discordpp.h:4085
discordpp::Function< void()> EndCallsCallback
Callback invoked when Client::EndCalls completes.
Definition discordpp.h:4133
Client & operator=(Client &&other) noexcept
Move assignment operator for Client.
void RevokeToken(uint64_t applicationId, std::string_view token, discordpp::Client::RevokeTokenCallback callback)
Revoke all application access/refresh tokens associated with a user with any valid access/refresh tok...
void GetDiscordClientGuildVoiceChannel(uint64_t channelId, discordpp::Client::GetDiscordClientGuildVoiceChannelCallback callback)
Gets watched state, fetching unwatched channels. !group GuildVoice.
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...
discordpp::Function< void(discordpp::ClientResult result)> LeaveLobbyCallback
Callback function for Client::LeaveLobby.
Definition discordpp.h:4338
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...
void SetDiscordClientGuildVoiceMemberUpdatedCallback(discordpp::Client::DiscordClientGuildVoiceMemberUpdatedCallback cb)
Sets the member-updated callback. !group GuildVoice.
void ExchangeChildToken(std::string_view parentApplicationToken, uint64_t childApplicationId, discordpp::Client::ExchangeChildTokenCallback callback)
Exchanges a parent application token for a child application token.
discordpp::Function< void(discordpp::ClientResult result)> SendActivityInviteCallback
Callback function for Client::SendActivityInvite, Client::SendActivityJoinRequest,...
Definition discordpp.h:4372
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...
discordpp::Function< void(discordpp::ClientResult result)> OpenMessageInDiscordCallback
Callback function for when Client::OpenMessageInDiscord completes.
Definition discordpp.h:4274
discordpp::Function< void(discordpp::String joinSecret)> ActivityJoinCallback
Callback function for Client::SetActivityJoinCallback.
Definition discordpp.h:4379
bool CanManageGameOrganizationLink(discordpp::UserGuild guild) const
Returns true if the current user has permission to link or unlink the given Discord guild to or from ...
void CloseAuthorizeDeviceScreen()
This function is used to hide the device authorization screen and is used for the case where the user...
void SetDiscordClientGuildVoiceMemberRemovedCallback(discordpp::Client::DiscordClientGuildVoiceMemberRemovedCallback cb)
Sets the member-removed callback. !group GuildVoice.
void SetOpusHardwareCoding(bool encode, bool decode)
Enables or disables hardware encoding and decoding for audio, if it is available.
discordpp::Function< void(uint64_t channelId, discordpp::ClientResult result)> DiscordClientGuildVoiceChannelErrorCallback
A channel subscription ended.
Definition discordpp.h:4099
discordpp::Function< void(discordpp::ClientResult result, discordpp::String joinSecret)> AcceptActivityInviteCallback
Callback function for Client::AcceptActivityInvite.
Definition discordpp.h:4367
void SetNoiseCancellation(bool on)
Enables or disables Krisp noise cancellation.
void JoinLinkedLobbyGuild(uint64_t lobbyId, discordpp::Client::ProvisionalUserMergeRequiredCallback provisionalUserMergeRequiredCallback, discordpp::Client::JoinLinkedLobbyGuildCallback callback)
Invites the current user to the Discord guild of the channel that is linked to the specified lobby....
bool ShowAudioRoutePicker()
On iOS devices, show the system audio route picker.
discordpp::Function< void(discordpp::Client::Status status, discordpp::Client::Error error, int32_t errorDetail)> OnStatusChanged
Callback function for Client::SetStatusChangedCallback.
Definition discordpp.h:4304
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.
void SetSelfDeafAll(bool deaf)
Mutes all audio from the currently active call for the current user in all calls. They will not be ab...
discordpp::Function< void(bool installed)> IsDiscordAppInstalledCallback
Callback invoked when the IsDiscordAppInstalled function completes.
Definition discordpp.h:4364
discordpp::Function< void(int16_t *data, uint64_t samplesPerChannel, int32_t sampleRate, uint64_t channels)> UserAudioCapturedCallback
Callback function for Client::StartCallWithAudioCallbacks.
Definition discordpp.h:4188
void SendDiscordFriendRequest(std::string_view username, discordpp::Client::SendFriendRequestCallback cb)
Sends a Discord friend request to the target user.
static discordpp::String GetDefaultPresenceScopes()
Returns the default set of OAuth2 scopes that should be used with the Discord SDK when leveraging bas...
Client()
Creates a new instance of the Client.
discordpp::Function< void(discordpp::ClientResult result, discordpp::String inviteUrl)> JoinLinkedLobbyGuildCallback
Callback function for Client::JoinLinkedLobbyGuild.
Definition discordpp.h:4334
void RegisterAuthorizeRequestCallback(discordpp::Client::AuthorizeRequestCallback callback)
Registers a callback to be invoked when a user requests to initiate the authorization flow.
void LeaveDiscordClientGuildVoiceChannel(uint64_t channelId, discordpp::Client::DiscordClientGuildVoiceResultCallback callback)
Leaves the specified desktop voice channel. !group GuildVoice.
discordpp::Function< void(uint64_t channelId, uint64_t userId)> DiscordClientGuildVoiceSpeakingStartedCallback
A member started speaking.
Definition discordpp.h:4115
void SetOutputVolume(float outputVolume)
Sets the speaker volume for the current user.
void UpdateToken(discordpp::AuthorizationTokenType tokenType, std::string_view token, discordpp::Client::UpdateTokenCallback callback)
Asynchronously sets a new auth token for this client to use.
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.
void UnsubscribeDiscordClientGuildVoiceChannel(uint64_t channelId)
Unsubscribes from channel events. !group GuildVoice.
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.
discordpp::Function< void(discordpp::ClientResult result)> DiscordClientGuildVoiceResultCallback
Receives a voice result.
Definition discordpp.h:4095
discordpp::Function< void(discordpp::ClientResult result, discordpp::Vector< discordpp::GuildMinimal > guilds)> GetUserGuildsCallback
Callback function for Client::GetUserGuilds.
Definition discordpp.h:4329
discordpp::Function< void(uint64_t channelId, uint64_t userId)> DiscordClientGuildVoiceMemberRemovedCallback
A member left.
Definition discordpp.h:4107
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:4047
@ Disconnecting
Disconnecting.
Definition discordpp.h:4065
@ Connected
Connected.
Definition discordpp.h:4056
@ HttpWait
HttpWait.
Definition discordpp.h:4068
@ Reconnecting
Reconnecting.
Definition discordpp.h:4062
@ Connecting
Connecting.
Definition discordpp.h:4053
@ Ready
Ready.
Definition discordpp.h:4059
@ Disconnected
Disconnected.
Definition discordpp.h:4050
discordpp::Function< void(discordpp::ActivityInvite invite)> ActivityInviteCallback
Callback function for Client::SetActivityInviteCreatedCallback and Client::SetActivityInviteUpdatedCa...
Definition discordpp.h:4376
discordpp::Vector< discordpp::RelationshipHandle > GetRelationships() const
Returns a list of all of the relationships the current user has with others, including all Discord re...
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...
discordpp::Function< void(uint64_t channelId)> DiscordClientVoiceChannelSelectedCallback
The selected channel changed.
Definition discordpp.h:4123
discordpp::Function< void(discordpp::ClientResult result)> UpdateRelationshipCallback
Callback function for most other Relationship functions such as Client::SendDiscordFriendRequestById.
Definition discordpp.h:4393
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.
discordpp::Function< void(discordpp::ClientResult result, discordpp::Vector< discordpp::GuildChannel > channels)> GetDiscordClientGuildVoiceChannelsCallback
Receives voice channels.
Definition discordpp.h:4090
void SetThreadPriority(discordpp::Client::Thread thread, int32_t priority)
Allows setting the priority of various SDK threads.
discordpp::UserHandle GetCurrentUser() const
(deprecated)
static discordpp::String ErrorToString(discordpp::Client::Error type)
Converts the Error enum to a string.
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.
discordpp::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:4178
void SendLobbyMessageWithMetadata(uint64_t lobbyId, std::string_view content, discordpp::StringMap const &metadata, discordpp::Client::SendUserMessageCallback cb)
Variant of Client::SendLobbyMessage that also accepts metadata to be sent with the message.
void SendActivityInvite(uint64_t userId, std::string_view content, discordpp::Client::SendActivityInviteCallback cb)
Sends a Discord activity invite to the specified user.
void Connect()
Asynchronously connects the client to Discord.
discordpp::Vector< discordpp::RelationshipHandle > GetRelationshipsByGroup(discordpp::RelationshipGroupType groupType) const
Returns a list of relationships that belong to the specified relationship group type....
discordpp::Function< void(discordpp::ClientResult result, std::optional< discordpp::UserHandle > user)> GetDiscordClientConnectedUserCallback
Callback function for when Client::GetDiscordClientConnectedUser completes.
Definition discordpp.h:4414
discordpp::Function< void(discordpp::ClientResult result)> SetInputDeviceCallback
Callback function for Client::SetInputDevice.
Definition discordpp.h:4159
discordpp::Function< void(discordpp::ClientResult result, discordpp::Vector< discordpp::MessageHandle > messages)> GetLobbyMessagesCallback
Callback function for Client::GetLobbyMessagesWithLimit.
Definition discordpp.h:4256
void SetOutputDevice(std::string_view deviceId, discordpp::Client::SetOutputDeviceCallback cb)
Asynchronously changes the audio output device in use by the client to the specified device....
static discordpp::String ThreadToString(discordpp::Client::Thread type)
Converts the Thread enum to a string.
void SetLobbyDeletedCallback(discordpp::Client::LobbyDeletedCallback cb)
Sets a callback to be invoked when a lobby is no longer available.
discordpp::Function< void(discordpp::ClientResult result, discordpp::Vector< discordpp::UserGuild > guilds)> FetchUserGuildsCallback
Callback function for Client::FetchUserGuilds.
Definition discordpp.h:4308
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,...
void SetDiscordClientGuildVoiceSpeakingStartedCallback(discordpp::Client::DiscordClientGuildVoiceSpeakingStartedCallback cb)
Sets the speaking-started callback. !group GuildVoice.
void LinkGameOrganization(uint64_t guildId, std::string_view gameOrganizationId, discordpp::Client::LinkGameOrganizationCallback cb)
Links a Discord guild to an in-game organization (a "game organization").
static int32_t GetVersionPatch()
Returns the patch version of the Discord Social SDK.
void EditUserMessage(uint64_t recipientId, uint64_t messageId, std::string_view content, discordpp::Client::EditUserMessageCallback cb)
Edits the specified message sent by the current user to the specified recipient.
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.
discordpp::Function< void(discordpp::ClientResult result)> LinkGameOrganizationCallback
Callback function for Client::LinkGameOrganization.
Definition discordpp.h:4313
void SetDiscordClientVoiceConnectionStatusChangedCallback(discordpp::Client::DiscordClientVoiceConnectionStatusChangedCallback cb)
Sets the connection-status callback. !group GuildVoice.
discordpp::Function< void(discordpp::ClientResult result, discordpp::String code, discordpp::String redirectUri)> AuthorizationCallback
Callback invoked when the Authorize function completes.
Definition discordpp.h:4197
static discordpp::String StatusToString(discordpp::Client::Status type)
Converts the Status enum to a string.
discordpp::Function< void(discordpp::AudioDevice device)> GetCurrentInputDeviceCallback
Callback function for Client::GetCurrentInputDevice.
Definition discordpp.h:4136
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.
void GetDiscordClientGuildVoiceChannels(uint64_t guildId, discordpp::Client::GetDiscordClientGuildVoiceChannelsCallback callback)
Lists desktop guild voice channels. Requires GetDefaultCommunicationScopes() (sdk....
discordpp::Function< void(discordpp::ClientResult result)> DeleteUserMessageCallback
Callback function for Client::DeleteUserMessage.
Definition discordpp.h:4250
discordpp::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:4279
void CancelDiscordFriendRequest(uint64_t userId, discordpp::Client::UpdateRelationshipCallback cb)
Cancels an outgoing Discord friend request to the target user.
void IsDiscordAppInstalled(discordpp::Client::IsDiscordAppInstalledCallback callback)
Checks whether the Discord mobile app is installed on this device. On desktop platforms,...
discordpp::Function< void(discordpp::ClientResult result)> UnmergeIntoProvisionalAccountCallback
Callback function for the Client::UnmergeIntoProvisionalAccount method.
Definition discordpp.h:4238
discordpp::Function< void(discordpp::ClientResult result, discordpp::Vector< discordpp::GuildChannel > guildChannels)> GetGuildChannelsCallback
Callback function for Client::GetGuildChannels.
Definition discordpp.h:4324
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.
discordpp::Function< void(uint64_t userId)> UserUpdatedCallback
Callback function for Client::SetUserUpdatedCallback.
Definition discordpp.h:4422
void SendUserMessageWithMetadata(uint64_t recipientId, std::string_view content, discordpp::StringMap const &metadata, discordpp::Client::SendUserMessageCallback cb)
Variant of Client::SendUserMessage that also accepts metadata to be sent with the message.
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.
discordpp::Function< void(uint64_t lobbyId)> LobbyCreatedCallback
Callback function for Client::SetLobbyCreatedCallback.
Definition discordpp.h:4344
discordpp::Function< void(discordpp::ClientResult result)> RevokeTokenCallback
Callback function for the Client::RevokeToken method.
Definition discordpp.h:4229
void SetMessageUpdatedCallback(discordpp::Client::MessageUpdatedCallback cb)
Sets a callback to be invoked whenever a message is edited.
void SendGameFriendRequest(std::string_view username, discordpp::Client::SendFriendRequestCallback cb)
Sends (or accepts) a game friend request to the target user.
void SendLobbyMessage(uint64_t lobbyId, std::string_view content, discordpp::Client::SendUserMessageCallback cb)
Sends a message in a lobby chat to all members of the lobby.
discordpp::Function< void(discordpp::ClientResult result)> OpenConnectedGamesSettingsInDiscordCallback
Callback function for when Client::OpenConnectedGamesSettingsInDiscord completes.
Definition discordpp.h:4297
discordpp::Function< void(discordpp::ClientResult result, uint64_t lobbyId)> CreateOrJoinLobbyCallback
Callback function for Client::CreateOrJoinLobby.
Definition discordpp.h:4320
void UnlinkGameOrganization(std::string_view gameOrganizationId, discordpp::Client::UnlinkGameOrganizationCallback cb)
Unlinks a Discord guild from an in-game organization (a "game organization").
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...
discordpp::Function< void(uint64_t lobbyId, uint64_t memberId)> LobbyMemberAddedCallback
Callback function for Client::SetLobbyMemberAddedCallback.
Definition discordpp.h:4350
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.
discordpp::Function< void(uint64_t lobbyId, uint64_t memberId)> LobbyMemberUpdatedCallback
Callback function for Client::SetLobbyMemberUpdatedCallback.
Definition discordpp.h:4357
discordpp::Function< void(uint64_t messageId)> MessageUpdatedCallback
Callback function for Client::SetMessageUpdatedCallback.
Definition discordpp.h:4290
void SetGameWindowPid(int32_t pid)
When users are linking their account with Discord, which involves an OAuth2 flow, the SDK can streaml...
void SetDiscordClientGuildVoiceChannelErrorCallback(discordpp::Client::DiscordClientGuildVoiceChannelErrorCallback cb)
Sets the channel-error callback. !group GuildVoice.
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::optional< discordpp::UserHandle > GetUser(uint64_t userId) const
Returns the UserHandle associated with the given user ID.
void RemoveAuthorizeRequestCallback()
Stops listening for the AUTHORIZE_REQUEST event and removes the registered callback.
discordpp::Function< void(discordpp::ClientResult result, discordpp::Vector< discordpp::MessageHandle > messages)> UserMessagesWithLimitCallback
Callback function for Client::GetUserMessagesWithLimit.
Definition discordpp.h:4266
void SendUserMessage(uint64_t recipientId, std::string_view content, discordpp::Client::SendUserMessageCallback cb)
Sends a direct message to the specified user.
discordpp::RelationshipHandle GetRelationshipHandle(uint64_t userId) const
Returns the RelationshipHandle that corresponds to the relationship between the current user and the ...
bool RegisterLaunchCommand(uint64_t applicationId, std::string_view command)
When a user accepts an activity invite for your game within the Discord client, Discord needs to know...
discordpp::AuthorizationCodeVerifier CreateAuthorizationCodeVerifier()
Helper function that can create a code challenge and verifier for use in the Client::Authorize + Clie...
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...
discordpp::Vector< discordpp::Call > GetCalls()
Returns a reference to all currently active calls, if any.
bool GetSelfDeafAll() const
Returns whether the current user is deafened in all calls.
bool SetSpeakerMode(bool speakerMode)
(deprecated) On mobile devices, enable speakerphone mode.
static int32_t GetVersionMinor()
Returns the minor version of the Discord Social SDK.
discordpp::Function< void(discordpp::Vector< discordpp::AudioDevice > devices)> GetInputDevicesCallback
Callback function for Client::GetInputDevices.
Definition discordpp.h:4142
Client(std::string_view apiBase, std::string_view webBase)
Creates a new instance of the Client but allows customizing the Discord URL to use.
void SubscribeDiscordClientGuildVoiceChannel(uint64_t channelId, discordpp::Client::DiscordClientGuildVoiceResultCallback callback)
Subscribes to channel events. Requires full social access. !group GuildVoice.
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...
discordpp::Function< void(discordpp::String message, discordpp::LoggingSeverity severity)> LogCallback
Callback function invoked when a new log message is generated.
Definition discordpp.h:4293
void AbortAuthorize()
This will abort the authorize flow if it is in progress and tear down any associated state.
discordpp::Function< void(bool inputDetected)> NoAudioInputCallback
Callback function for Client::SetNoAudioInputCallback.
Definition discordpp.h:4162
Error
Represents an error state for the socket connection that the Discord SDK maintains with the Discord b...
Definition discordpp.h:4018
@ None
None.
Definition discordpp.h:4021
@ ConnectionCanceled
ConnectionCanceled.
Definition discordpp.h:4030
@ ConnectionFailed
ConnectionFailed.
Definition discordpp.h:4024
@ UnexpectedClose
UnexpectedClose.
Definition discordpp.h:4027
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.
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 ...
void CreateOrJoinLobby(std::string_view secret, discordpp::Client::CreateOrJoinLobbyCallback callback)
Joins the user to the specified lobby, creating one if it does not exist.
discordpp::Function< void(discordpp::ClientResult result)> SetOutputDeviceCallback
Callback function for Client::SetOutputDevice.
Definition discordpp.h:4165
void AcceptActivityInvite(discordpp::ActivityInvite invite, discordpp::Client::AcceptActivityInviteCallback cb)
Accepts an activity invite that the current user has received.
discordpp::Function< void(uint64_t userId)> RelationshipGroupsUpdatedCallback
Callback function for Client::SetRelationshipGroupsUpdatedCallback.
Definition discordpp.h:4419
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...
discordpp::Function< void(discordpp::ClientResult result)> UnlinkGameOrganizationCallback
Callback function for Client::UnlinkGameOrganization.
Definition discordpp.h:4316
discordpp::Function< void(uint64_t lobbyId, uint64_t memberId)> LobbyMemberRemovedCallback
Callback function for Client::SetLobbyMemberRemovedCallback.
Definition discordpp.h:4353
void SetLobbyUpdatedCallback(discordpp::Client::LobbyUpdatedCallback cb)
Sets a callback to be invoked when a lobby is edited, for example if the lobby's metadata is changed.
Thread
Represents the type of thread to control thread priority on.
Definition discordpp.h:4072
@ Client
Client.
Definition discordpp.h:4075
@ Voice
Voice.
Definition discordpp.h:4078
@ Network
Network.
Definition discordpp.h:4081
void SendActivityJoinRequestReply(discordpp::ActivityInvite invite, discordpp::Client::SendActivityInviteCallback cb)
When another user requests to join the current user's party, this function is called to to allow that...
void GetGuildChannels(uint64_t guildId, discordpp::Client::GetGuildChannelsCallback cb)
Fetches all of the channels that the current user can access in the given guild. Channels are sorted ...
discordpp::Function< void(discordpp::ClientResult result, discordpp::Vector< discordpp::UserMessageSummary > summaries)> UserMessageSummariesCallback
Callback function for Client::GetUserMessageSummaries.
Definition discordpp.h:4261
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...
void SetEngineManagedAudioSession(bool isEngineManaged)
On mobile devices, set whether the audio environment is managed by the engine or the SDK....
void SetLobbyMemberUpdatedCallback(discordpp::Client::LobbyMemberUpdatedCallback cb)
Sets a callback function to be invoked whenever a member of a lobby is changed.
void SetActivityJoinWithApplicationCallback(discordpp::Client::ActivityJoinWithApplicationCallback cb)
Sets a callback function that is invoked when the current user also has Discord running on their comp...
bool GetSelfMuteAll() const
Returns whether the current user's microphone is muted in all calls.
static discordpp::String GetDefaultAudioDeviceId()
Returns the ID of the system default audio device if the user has not explicitly chosen one.
bool CanOpenMessageInDiscord(uint64_t messageId)
Returns true if the given message is able to be viewed in a Discord client.
void SetNoiseSuppression(bool on)
Enables basic background noise suppression.
std::optional< discordpp::UserHandle > GetCurrentUserV2() const
Unlike GetCurrentUser(), this method returns std::nullopt instead of a dummy object when no user is a...
void SetLobbyMemberAddedCallback(discordpp::Client::LobbyMemberAddedCallback cb)
Sets a callback function to be invoked whenever a user is added to a lobby.
void GetCurrentOutputDevice(discordpp::Client::GetCurrentOutputDeviceCallback cb)
Asynchronously fetches the current audio output device in use by the client.
void SetHttpRequestTimeout(int32_t httpTimeoutInMilliseconds)
This function is used to override the default HTTP timeout for the websocket client.
void EndCall(uint64_t channelId, discordpp::Client::EndCallCallback callback)
Ends any active call, if any. Any references you have to Call objects are invalid after they are ende...
void AcceptGameFriendRequest(uint64_t userId, discordpp::Client::UpdateRelationshipCallback cb)
Accepts an incoming game friend request from the target user.
static discordpp::String GetVersionHash()
Returns the git commit hash this version was built from.
void GetTokenFromDeviceProvisionalMerge(discordpp::DeviceAuthorizationArgs args, discordpp::AuthenticationExternalAuthType externalAuthType, std::string_view externalAuthToken, discordpp::Client::TokenExchangeCallback callback)
This function is a combination of Client::Authorize and Client::GetTokenFromProvisionalMerge,...
discordpp::Function< void(uint64_t lobbyId)> LobbyUpdatedCallback
Callback function for Client::SetLobbyUpdatedCallback.
Definition discordpp.h:4361
std::optional< discordpp::LobbyHandle > GetLobbyHandle(uint64_t lobbyId) const
Returns a reference to the Discord lobby object for the given ID.
discordpp::Call StartCall(uint64_t channelId)
Starts or joins a call in the lobby specified by channelId (For a lobby, simply pass in the lobbyId).
void UpdateRichPresence(discordpp::Activity activity, discordpp::Client::UpdateRichPresenceCallback cb)
Updates the rich presence for the current user.
void SetRelationshipGroupsUpdatedCallback(discordpp::Client::RelationshipGroupsUpdatedCallback cb)
The RelationshipGroupsUpdatedCallback is invoked whenever any user in the friends list changes....
Client(discordpp::ClientCreateOptions options)
Creates a new instance of the Client with custom options.
static discordpp::String GetDefaultCommunicationScopes()
Returns the default set of OAuth2 scopes that should be used with the Discord SDK when making use of ...
discordpp::Function< void(uint64_t lobbyId)> LobbyDeletedCallback
Callback function for Client::SetLobbyDeletedCallback.
Definition discordpp.h:4347
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...
discordpp::Function< void(uint64_t userId, bool isDiscordRelationshipUpdate)> RelationshipCreatedCallback
Callback function for Client::SetRelationshipCreatedCallback.
Definition discordpp.h:4403
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.
discordpp::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:4247
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:4435
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:2083
discordpp::String Scopes() const
Scopes is a space separated string of the oauth scopes your game is requesting.
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:2103
void SetClientId(uint64_t ClientId)
Setter for DeviceAuthorizationArgs::ClientId.
DeviceAuthorizationArgs & operator=(const DeviceAuthorizationArgs &arg0)
Copy assignment operator for DeviceAuthorizationArgs.
void SetScopes(std::string_view Scopes)
Setter for DeviceAuthorizationArgs::Scopes.
DeviceAuthorizationArgs & operator=(DeviceAuthorizationArgs &&other) noexcept
Move assignment operator for DeviceAuthorizationArgs.
void SetAvatarHash(std::optional< std::string_view > AvatarHash)
Setter for DiscordClientGuildVoiceMember::AvatarHash.
DiscordClientGuildVoiceMember(const DiscordClientGuildVoiceMember &arg0)
Copy constructor for DiscordClientGuildVoiceMember.
discordpp::String DisplayName() const
Display name.
bool SelfDeaf() const
Self deaf.
DiscordClientGuildVoiceMember(DiscordClientGuildVoiceMember &&other) noexcept
Move constructor for DiscordClientGuildVoiceMember.
void SetSpeaking(discordpp::DiscordClientGuildVoiceSpeakingState Speaking)
Setter for DiscordClientGuildVoiceMember::Speaking.
DiscordClientGuildVoiceMember & operator=(DiscordClientGuildVoiceMember &&other) noexcept
Move assignment operator for DiscordClientGuildVoiceMember.
void SetDeaf(bool Deaf)
Setter for DiscordClientGuildVoiceMember::Deaf.
DiscordClientGuildVoiceMember & operator=(const DiscordClientGuildVoiceMember &arg0)
Copy assignment operator for DiscordClientGuildVoiceMember.
discordpp::String Username() const
Username.
void SetMute(bool Mute)
Setter for DiscordClientGuildVoiceMember::Mute.
std::optional< discordpp::String > AvatarHash() const
Avatar hash.
bool SelfMute() const
Self mute.
void SetUsername(std::string_view Username)
Setter for DiscordClientGuildVoiceMember::Username.
void SetSelfMute(bool SelfMute)
Setter for DiscordClientGuildVoiceMember::SelfMute.
void SetDisplayName(std::string_view DisplayName)
Setter for DiscordClientGuildVoiceMember::DisplayName.
uint64_t UserId() const
User ID.
void SetSelfDeaf(bool SelfDeaf)
Setter for DiscordClientGuildVoiceMember::SelfDeaf.
void SetUserId(uint64_t UserId)
Setter for DiscordClientGuildVoiceMember::UserId.
bool Deaf() const
Server deaf.
static const DiscordClientGuildVoiceMember nullobj
Uninitialized instance of DiscordClientGuildVoiceMember.
Definition discordpp.h:3766
bool Mute() const
Server mute.
discordpp::DiscordClientGuildVoiceSpeakingState Speaking() const
Speaking state.
Channel snapshot.
Definition discordpp.h:3828
DiscordClientGuildVoiceSnapshot(const DiscordClientGuildVoiceSnapshot &arg0)
Copy constructor for DiscordClientGuildVoiceSnapshot.
void SetChannel(discordpp::GuildChannel Channel)
Setter for DiscordClientGuildVoiceSnapshot::Channel.
void SetSpeakingAvailable(bool SpeakingAvailable)
Setter for DiscordClientGuildVoiceSnapshot::SpeakingAvailable.
static const DiscordClientGuildVoiceSnapshot nullobj
Uninitialized instance of DiscordClientGuildVoiceSnapshot.
Definition discordpp.h:3848
DiscordClientGuildVoiceSnapshot & operator=(const DiscordClientGuildVoiceSnapshot &arg0)
Copy assignment operator for DiscordClientGuildVoiceSnapshot.
DiscordClientGuildVoiceSnapshot & operator=(DiscordClientGuildVoiceSnapshot &&other) noexcept
Move assignment operator for DiscordClientGuildVoiceSnapshot.
bool SpeakingAvailable() const
Speaking available.
discordpp::Vector< discordpp::DiscordClientGuildVoiceMember > Members() const
Channel members.
void SetSelected(bool Selected)
Setter for DiscordClientGuildVoiceSnapshot::Selected.
DiscordClientGuildVoiceSnapshot(DiscordClientGuildVoiceSnapshot &&other) noexcept
Move constructor for DiscordClientGuildVoiceSnapshot.
discordpp::GuildChannel Channel() const
Voice channel.
bool Selected() const
Channel selected.
Represents a channel in a guild that the current user is a member of and may be able to be linked to ...
Definition discordpp.h:2684
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.
GuildChannel(const GuildChannel &arg0)
Copy constructor for GuildChannel.
void SetId(uint64_t Id)
Setter for GuildChannel::Id.
std::optional< uint64_t > ParentId() const
The id of the parent category channel, if any.
void SetType(discordpp::ChannelType Type)
Setter for GuildChannel::Type.
void SetName(std::string_view Name)
Setter for GuildChannel::Name.
void SetPosition(int32_t Position)
Setter for GuildChannel::Position.
discordpp::ChannelType Type() const
The type of the channel.
GuildChannel & operator=(const GuildChannel &arg0)
Copy assignment operator for GuildChannel.
discordpp::String Name() const
The name of the channel.
GuildChannel & operator=(GuildChannel &&other) noexcept
Move assignment operator for GuildChannel.
GuildChannel(GuildChannel &&other) noexcept
Move constructor for GuildChannel.
bool IsLinkable() const
Whether the current user is able to link this channel to a lobby.
int32_t Position() const
The position of the channel in the guild's channel list.
void SetLinkedLobby(std::optional< discordpp::LinkedLobby > LinkedLobby)
Setter for GuildChannel::LinkedLobby.
void SetIsViewableAndWriteableByAllMembers(bool IsViewableAndWriteableByAllMembers)
Setter for GuildChannel::IsViewableAndWriteableByAllMembers.
static const GuildChannel nullobj
Uninitialized instance of GuildChannel.
Definition discordpp.h:2703
void SetParentId(std::optional< uint64_t > ParentId)
Setter for GuildChannel::ParentId.
void SetId(uint64_t Id)
Setter for GuildMinimal::Id.
static const GuildMinimal nullobj
Uninitialized instance of GuildMinimal.
Definition discordpp.h:2534
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.
discordpp::String Name() const
The name of the guild.
void SetName(std::string_view Name)
Setter for GuildMinimal::Name.
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:2826
uint64_t GuildId() const
The id of the guild (aka server) that owns the linked channel.
void SetName(std::string_view 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.
void SetGuildId(uint64_t GuildId)
Setter for LinkedChannel::GuildId.
static const LinkedChannel nullobj
Uninitialized instance of LinkedChannel.
Definition discordpp.h:2845
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.
discordpp::String Name() const
The name of the linked channel.
Struct that stores information about the game organization linked to a guild.
Definition discordpp.h:2636
static const LinkedGameOrganization nullobj
Uninitialized instance of LinkedGameOrganization.
Definition discordpp.h:2656
void SetApplicationId(std::optional< uint64_t > ApplicationId)
Setter for LinkedGameOrganization::ApplicationId.
LinkedGameOrganization(const LinkedGameOrganization &arg0)
Copy constructor for LinkedGameOrganization.
LinkedGameOrganization & operator=(LinkedGameOrganization &&other) noexcept
Move assignment operator for LinkedGameOrganization.
void SetGameOrganizationId(std::optional< std::string_view > GameOrganizationId)
Setter for LinkedGameOrganization::GameOrganizationId.
std::optional< discordpp::String > GameOrganizationId() const
The ID of the game organization.
std::optional< uint64_t > ApplicationId() const
The ID of the application that owns the game organization.
LinkedGameOrganization(LinkedGameOrganization &&other) noexcept
Move constructor for LinkedGameOrganization.
LinkedGameOrganization & operator=(const LinkedGameOrganization &arg0)
Copy assignment operator for LinkedGameOrganization.
Struct that stores information about the lobby linked to a channel.
Definition discordpp.h:2780
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:2799
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:3303
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:3322
discordpp::Vector< discordpp::LobbyMemberHandle > LobbyMembers() const
Returns a list of the LobbyMemberHandle objects for each member of this lobby.
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::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.
discordpp::Vector< uint64_t > LobbyMemberIds() const
Returns a list of the user IDs that are members of this lobby.
uint64_t Id() const
Returns the id of the lobby.
discordpp::StringMap Metadata() const
Returns any developer supplied metadata for 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:3158
LobbyMemberHandle & operator=(const LobbyMemberHandle &other)
Copy assignment operator for LobbyMemberHandle.
static const LobbyMemberHandle nullobj
Uninitialized instance of LobbyMemberHandle.
Definition discordpp.h:3177
uint64_t Id() const
The user id of the lobby member.
LobbyMemberHandle(const LobbyMemberHandle &other)
Copy constructor for LobbyMemberHandle.
discordpp::StringMap Metadata() const
Metadata is a set of string key/value pairs that the game developer can use.
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.
A MessageHandle represents a single message received by the SDK.
Definition discordpp.h:3479
uint64_t AuthorId() const
Returns the user ID of the user who sent this message.
discordpp::StringMap ModerationMetadata() const
Returns any moderation metadata the developer set on 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:3498
std::optional< discordpp::UserHandle > Recipient() const
Returns the UserHandle for the other participant in a DM, if this message was sent in a DM.
std::optional< uint64_t > ApplicationId() const
Returns the application ID associated with this message, if any. You can use this to identify if the ...
discordpp::String RawContent() const
Returns the content of this message, if any, but without replacing any markup from emojis and mention...
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::optional< discordpp::String > AdditionalName() const
Returns an additional display name for this message, if one was set.
discordpp::StringMap Metadata() const
Returns any metadata the developer included with this message.
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)....
discordpp::String Content() const
Returns the content of this message, if any.
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:2909
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:2928
bool IsSpamRequest() const
Returns whether this relationship is a spam request.
std::optional< discordpp::UserHandle > User() const
Returns a handle to the target user in this relationship, if one is available. This would be the user...
RelationshipHandle & operator=(RelationshipHandle &&other) noexcept
Move assignment operator for RelationshipHandle.
A copyable type-erased callable. See the R(Args...) specialization.
Definition discordpp.h:159
friend bool operator!=(const SdkFunction &function, std::nullptr_t) noexcept
Returns true if the function stores a callable.
Definition discordpp.h:252
SdkFunction & operator=(const SdkFunction &other)
Copy assignment. Copies the stored callable.
Definition discordpp.h:204
~SdkFunction()
Destroys the stored callable and returns its memory to the SDK's allocation backend.
Definition discordpp.h:201
friend bool operator==(std::nullptr_t, const SdkFunction &function) noexcept
Returns true if the function is empty.
Definition discordpp.h:247
SdkFunction(const SdkFunction &other)
Copy constructor. Copies the stored callable.
Definition discordpp.h:188
SdkFunction(F &&function)
Definition discordpp.h:176
SdkFunction(SdkFunction &&other) noexcept
Move constructor. Leaves other empty.
Definition discordpp.h:194
SdkFunction & operator=(std::nullptr_t) noexcept
Destroys the stored callable, leaving the function empty.
Definition discordpp.h:225
friend bool operator==(const SdkFunction &function, std::nullptr_t) noexcept
Returns true if the function is empty.
Definition discordpp.h:242
friend bool operator!=(std::nullptr_t, const SdkFunction &function) noexcept
Returns true if the function stores a callable.
Definition discordpp.h:257
SdkFunction & operator=(SdkFunction &&other) noexcept
Move assignment. Leaves other empty.
Definition discordpp.h:214
R operator()(Args... args) const
Invokes the stored callable. The function must not be empty.
Definition discordpp.h:235
SdkFunction() noexcept=default
Constructs an empty function.
static const UserApplicationProfileHandle nullobj
Uninitialized instance of UserApplicationProfileHandle.
Definition discordpp.h:2986
discordpp::String Username() const
Returns the user's in-game username.
discordpp::String Metadata() const
Returns any metadata set by the developer.
discordpp::String ProviderIssuedUserId() const
Returns the user's external identity provider issued user ID.
UserApplicationProfileHandle(UserApplicationProfileHandle &&other) noexcept
Move constructor for UserApplicationProfileHandle.
UserApplicationProfileHandle & operator=(const UserApplicationProfileHandle &other)
Copy assignment operator for UserApplicationProfileHandle.
discordpp::String AvatarHash() const
Returns the user's in-game avatar hash.
UserApplicationProfileHandle & operator=(UserApplicationProfileHandle &&other) noexcept
Move assignment operator for UserApplicationProfileHandle.
UserApplicationProfileHandle(const UserApplicationProfileHandle &other)
Copy constructor for UserApplicationProfileHandle.
std::optional< discordpp::String > ProviderId() const
Returns the user's external identity provider ID if it exists.
discordpp::ExternalIdentityProviderType ProviderType() const
Returns the type of the external identity provider.
Represents a guild (also known as a Discord server) that the current user is a member of,...
Definition discordpp.h:2560
UserGuild & operator=(const UserGuild &arg0)
Copy assignment operator for UserGuild.
void SetName(std::string_view Name)
Setter for UserGuild::Name.
UserGuild(UserGuild &&other) noexcept
Move constructor for UserGuild.
void SetPermissions(uint64_t Permissions)
Setter for UserGuild::Permissions.
UserGuild(const UserGuild &arg0)
Copy constructor for UserGuild.
discordpp::String Name() const
The name of the guild.
std::optional< discordpp::String > Icon() const
The hash of the guild's icon, if it has one.
std::optional< discordpp::LinkedGameOrganization > LinkedGameOrganization() const
Information about the game organization linked to this guild, if any.
void SetOwner(bool Owner)
Setter for UserGuild::Owner.
UserGuild & operator=(UserGuild &&other) noexcept
Move assignment operator for UserGuild.
void SetBanner(std::optional< std::string_view > Banner)
Setter for UserGuild::Banner.
static const UserGuild nullobj
Uninitialized instance of UserGuild.
Definition discordpp.h:2579
void SetIcon(std::optional< std::string_view > Icon)
Setter for UserGuild::Icon.
void SetLinkedGameOrganization(std::optional< discordpp::LinkedGameOrganization > LinkedGameOrganization)
Setter for UserGuild::LinkedGameOrganization.
std::optional< discordpp::String > Banner() const
The hash of the guild's banner, if it has one.
uint64_t Permissions() const
The current user's permissions in the guild, as a bitfield of Discord permission flags.
bool Owner() const
Whether the current user is the owner of the guild.
void SetId(uint64_t Id)
Setter for UserGuild::Id.
uint64_t Id() const
The id of the guild.
A UserHandle represents a single user on Discord that the SDK knows about and contains basic account ...
Definition discordpp.h:3028
uint64_t Id() const
Returns the ID of this user.
UserHandle & operator=(UserHandle &&other) noexcept
Move assignment operator for UserHandle.
static const UserHandle nullobj
Uninitialized instance of UserHandle.
Definition discordpp.h:3062
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.
discordpp::String AvatarUrl(discordpp::UserHandle::AvatarType animatedType, discordpp::UserHandle::AvatarType staticType) const
Returns a CDN url to the user's Discord profile avatar.
std::optional< discordpp::String > Avatar() const
Returns the hash of the user's Discord profile avatar, if one is set.
AvatarType
The desired type of avatar url to generate for a User.
Definition discordpp.h:3036
@ Jpeg
Jpeg.
Definition discordpp.h:3048
@ Gif
Gif.
Definition discordpp.h:3039
@ Webp
Webp.
Definition discordpp.h:3042
@ Png
Png.
Definition discordpp.h:3045
bool IsProvisional() const
Returns true if this user is a provisional account.
static discordpp::String AvatarTypeToString(discordpp::UserHandle::AvatarType type)
Converts the AvatarType enum to a string.
discordpp::String Username() const
Returns the globally unique username of this user.
std::optional< discordpp::String > GlobalName() const
Returns the preferred display name of this user, if one is set.
discordpp::Vector< discordpp::UserApplicationProfileHandle > UserApplicationProfiles() const
Returns a list of UserApplicationProfileHandles for this user. Currently, a user can only have a sing...
discordpp::String DisplayName() const
Returns the user's preferred name, if one is set, otherwise returns their unique username.
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.
discordpp::RelationshipHandle Relationship() const
Returns a reference to the RelationshipHandle between the currently authenticated user and this user,...
UserMessageSummary & operator=(const UserMessageSummary &arg0)
Copy assignment operator for UserMessageSummary.
static const UserMessageSummary nullobj
Uninitialized instance of UserMessageSummary.
Definition discordpp.h:3900
UserMessageSummary(UserMessageSummary &&other) noexcept
Move constructor for UserMessageSummary.
uint64_t LastMessageId() const
Returns the ID of the last message sent in the DM conversation.
uint64_t UserId() const
Returns the ID of the other user in the DM conversation.
UserMessageSummary(const UserMessageSummary &arg0)
Copy constructor for UserMessageSummary.
UserMessageSummary & operator=(UserMessageSummary &&other) noexcept
Move assignment operator for UserMessageSummary.
Settings for the void auto detection threshold for picking up activity from a user's mic.
Definition discordpp.h:2193
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:2212
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 read-only snapshot of the user's voice settings in the connected Discord desktop client.
Definition discordpp.h:3661
VoiceSettings & operator=(const VoiceSettings &arg0)
Copy assignment operator for VoiceSettings.
float InputVolume() const
Microphone volume, ranging from 0 to 100.
void SetSelfMute(bool SelfMute)
Setter for VoiceSettings::SelfMute.
float OutputVolume() const
Speaker volume, ranging from 0 to 200.
void SetPttKey(std::string_view PttKey)
Setter for VoiceSettings::PttKey.
bool NoiseSuppression() const
Noise suppression state.
discordpp::VoiceInputModeType InputMode() const
When the client transmits microphone audio.
void SetNoiseSuppression(bool NoiseSuppression)
Setter for VoiceSettings::NoiseSuppression.
bool EchoCancellation() const
Echo cancellation state.
void SetOutputVolume(float OutputVolume)
Setter for VoiceSettings::OutputVolume.
VoiceSettings & operator=(VoiceSettings &&other) noexcept
Move assignment operator for VoiceSettings.
void SetInputMode(discordpp::VoiceInputModeType InputMode)
Setter for VoiceSettings::InputMode.
VoiceSettings(VoiceSettings &&other) noexcept
Move constructor for VoiceSettings.
static const VoiceSettings nullobj
Uninitialized instance of VoiceSettings.
Definition discordpp.h:3680
discordpp::String PttKey() const
Display string for the push-to-talk key, such as "SHIFT + F". Empty when nothing is bound.
VoiceSettings(const VoiceSettings &arg0)
Copy constructor for VoiceSettings.
bool SelfMute() const
Self-mute state.
bool AutomaticGainControl() const
Automatic gain control state.
void SetEchoCancellation(bool EchoCancellation)
Setter for VoiceSettings::EchoCancellation.
bool SelfDeaf() const
Self-deafen state.
void SetInputVolume(float InputVolume)
Setter for VoiceSettings::InputVolume.
void SetSelfDeaf(bool SelfDeaf)
Setter for VoiceSettings::SelfDeaf.
void SetNoiseCancellation(bool NoiseCancellation)
Setter for VoiceSettings::NoiseCancellation.
bool NoiseCancellation() const
Noise cancellation state.
void SetAutomaticGainControl(bool AutomaticGainControl)
Setter for VoiceSettings::AutomaticGainControl.
A VoiceStateHandle represents the state of a single participant in a Discord voice call.
Definition discordpp.h:2151
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:2170
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:22
ActivityPartyPrivacy
Allows your game to control the privacy of the party the user is in.
Definition discordpp.h:374
@ Public
The party is public, which means that the user is in a party which could be joinable by either friend...
Definition discordpp.h:388
@ 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:382
DisclosureTypes
Enum that represents various informational disclosures that Discord may make to users,...
Definition discordpp.h:944
@ MessageDataVisibleOnDiscord
This disclosure type happens the first time a user sends a message in game, and that message will be ...
Definition discordpp.h:950
const char * EnumToString(discordpp::ActivityActionTypes value)
Converts a discordpp::ActivityActionTypes to a string.
Definition discordpp.h:6159
std::function< Signature > Function
The callback type used throughout the discordpp API.
Definition discordpp.h:351
HttpStatusCode
Enum that represents the various HTTP status codes that can be returned.
Definition discordpp.h:527
@ RequestHeaderFieldsTooLarge
RequestHeaderFieldsTooLarge.
Definition discordpp.h:674
@ PayloadTooLarge
PayloadTooLarge.
Definition discordpp.h:635
@ MultiStatus
MultiStatus.
Definition discordpp.h:566
@ VariantAlsoNegotiates
VariantAlsoNegotiates.
Definition discordpp.h:695
@ Gone
Gone.
Definition discordpp.h:626
@ BadGateway
BadGateway.
Definition discordpp.h:683
@ Created
Created.
Definition discordpp.h:548
@ TemporaryRedirect
TemporaryRedirect.
Definition discordpp.h:590
@ ServiceUnavailable
ServiceUnavailable.
Definition discordpp.h:686
@ MovedPermanently
MovedPermanently.
Definition discordpp.h:578
@ PreconditionFailed
PreconditionFailed.
Definition discordpp.h:632
@ RequestTimeout
RequestTimeout.
Definition discordpp.h:620
@ Accepted
Accepted.
Definition discordpp.h:551
@ NonAuthoritativeInfo
NonAuthoritativeInfo.
Definition discordpp.h:554
@ NotFound
NotFound.
Definition discordpp.h:608
@ FailedDependency
FailedDependency.
Definition discordpp.h:659
@ PaymentRequired
PaymentRequired.
Definition discordpp.h:602
@ PreconditionRequired
PreconditionRequired.
Definition discordpp.h:668
@ ResetContent
ResetContent.
Definition discordpp.h:560
@ SwitchingProtocols
SwitchingProtocols.
Definition discordpp.h:536
@ HttpVersionNotSupported
HttpVersionNotSupported.
Definition discordpp.h:692
@ Found
Found.
Definition discordpp.h:581
@ Processing
Processing.
Definition discordpp.h:539
@ None
None.
Definition discordpp.h:530
@ ExpectationFailed
ExpectationFailed.
Definition discordpp.h:647
@ Forbidden
Forbidden.
Definition discordpp.h:605
@ PartialContent
PartialContent.
Definition discordpp.h:563
@ SeeOther
SeeOther.
Definition discordpp.h:584
@ EarlyHints
EarlyHints.
Definition discordpp.h:542
@ LengthRequired
LengthRequired.
Definition discordpp.h:629
@ MethodNotAllowed
MethodNotAllowed.
Definition discordpp.h:611
@ NotExtended
NotExtended.
Definition discordpp.h:704
@ RangeNotSatisfiable
RangeNotSatisfiable.
Definition discordpp.h:644
@ NotImplemented
NotImplemented.
Definition discordpp.h:680
@ BadRequest
BadRequest.
Definition discordpp.h:596
@ Continue
Continue.
Definition discordpp.h:533
@ LoopDetected
LoopDetected.
Definition discordpp.h:701
@ UnsupportedMediaType
UnsupportedMediaType.
Definition discordpp.h:641
@ NetworkAuthorizationRequired
NetworkAuthorizationRequired.
Definition discordpp.h:707
@ ImUsed
ImUsed.
Definition discordpp.h:572
@ MultipleChoices
MultipleChoices.
Definition discordpp.h:575
@ Ok
Ok.
Definition discordpp.h:545
@ TooManyRequests
TooManyRequests.
Definition discordpp.h:671
@ ProxyAuthRequired
ProxyAuthRequired.
Definition discordpp.h:617
@ UnprocessableEntity
UnprocessableEntity.
Definition discordpp.h:653
@ MisdirectedRequest
MisdirectedRequest.
Definition discordpp.h:650
@ PermanentRedirect
PermanentRedirect.
Definition discordpp.h:593
@ NotModified
NotModified.
Definition discordpp.h:587
@ AlreadyReported
AlreadyReported.
Definition discordpp.h:569
@ NoContent
NoContent.
Definition discordpp.h:557
@ Locked
Locked.
Definition discordpp.h:656
@ GatewayTimeout
GatewayTimeout.
Definition discordpp.h:689
@ Unauthorized
Unauthorized.
Definition discordpp.h:599
@ UpgradeRequired
UpgradeRequired.
Definition discordpp.h:665
@ InsufficientStorage
InsufficientStorage.
Definition discordpp.h:698
@ InternalServerError
InternalServerError.
Definition discordpp.h:677
@ TooEarly
TooEarly.
Definition discordpp.h:662
@ Conflict
Conflict.
Definition discordpp.h:623
@ UriTooLong
UriTooLong.
Definition discordpp.h:638
@ NotAcceptable
NotAcceptable.
Definition discordpp.h:614
AuthorizationTokenType
Represents the type of auth token used by the SDK, either the normal tokens produced by the Discord d...
Definition discordpp.h:955
@ Bearer
Bearer.
Definition discordpp.h:961
@ User
User.
Definition discordpp.h:958
ChannelType
Enum that represents the various channel types on Discord.
Definition discordpp.h:732
@ GuildForum
GuildForum.
Definition discordpp.h:771
@ Dm
Dm.
Definition discordpp.h:738
@ Lobby
Lobby.
Definition discordpp.h:777
@ GuildNews
GuildNews.
Definition discordpp.h:750
@ GuildVoice
GuildVoice.
Definition discordpp.h:741
@ GuildPublicThread
GuildPublicThread.
Definition discordpp.h:759
@ GuildNewsThread
GuildNewsThread.
Definition discordpp.h:756
@ GuildDirectory
GuildDirectory.
Definition discordpp.h:768
@ GuildCategory
GuildCategory.
Definition discordpp.h:747
@ GuildStageVoice
GuildStageVoice.
Definition discordpp.h:765
@ GuildMedia
GuildMedia.
Definition discordpp.h:774
@ GuildStore
GuildStore.
Definition discordpp.h:753
@ GuildText
GuildText.
Definition discordpp.h:735
@ GroupDm
GroupDm.
Definition discordpp.h:744
@ EphemeralDm
EphemeralDm.
Definition discordpp.h:780
@ GuildPrivateThread
GuildPrivateThread.
Definition discordpp.h:762
AuthenticationCodeChallengeMethod
Represents the crypto method used to generate a code challenge.
Definition discordpp.h:713
@ S256
S256.
Definition discordpp.h:716
RelationshipType
Enum that represents the possible types of relationships that can exist between two users.
Definition discordpp.h:855
@ PendingIncoming
The current user has received a friend request from the target user, but it is not yet accepted.
Definition discordpp.h:870
@ Implicit
The Implicit type is documented for visibility, but should be unused in the SDK.
Definition discordpp.h:877
@ Suggestion
The Suggestion type is documented for visibility, but should be unused in the SDK.
Definition discordpp.h:880
@ PendingOutgoing
The current user has sent a friend request to the target user, but it is not yet accepted.
Definition discordpp.h:874
@ Blocked
The current user has blocked the target user, and so certain actions such as sending messages between...
Definition discordpp.h:865
@ None
The user has no relationship with the other user.
Definition discordpp.h:858
@ Friend
The user is friends with the other user.
Definition discordpp.h:861
DiscordClientGuildVoiceSpeakingState
Speaking state.
Definition discordpp.h:819
@ Speaking
Speaking.
Definition discordpp.h:828
@ Silent
Silent.
Definition discordpp.h:825
@ Unavailable
Unavailable.
Definition discordpp.h:822
bool operator!=(const SdkAllocator< T > &, const SdkAllocator< U > &) noexcept
SdkAllocator instances never compare unequal.
Definition discordpp.h:129
std::vector< T, SdkAllocator< T > > SdkVector
A vector whose storage comes from the SDK's allocation backend.
Definition discordpp.h:139
AuthenticationExternalAuthType
Represents the various identity providers that can be used to authenticate a provisional account user...
Definition discordpp.h:966
@ EpicOnlineServicesIdToken
EpicOnlineServicesIdToken.
Definition discordpp.h:975
@ DiscordBotIssuedAccessToken
DiscordBotIssuedAccessToken.
Definition discordpp.h:984
@ EpicOnlineServicesAccessToken
EpicOnlineServicesAccessToken.
Definition discordpp.h:972
@ SteamSessionTicket
SteamSessionTicket.
Definition discordpp.h:978
@ OIDC
OIDC.
Definition discordpp.h:969
@ UnityServicesIdToken
UnityServicesIdToken.
Definition discordpp.h:981
@ PlayStationNetworkIdToken
PlayStationNetworkIdToken.
Definition discordpp.h:990
@ AppleIdToken
AppleIdToken.
Definition discordpp.h:987
LoggingSeverity
Enum that represents the various log levels supported by the SDK.
Definition discordpp.h:994
@ Warning
Warning.
Definition discordpp.h:1003
@ Info
Info.
Definition discordpp.h:1000
@ None
None.
Definition discordpp.h:1009
@ Error
Error.
Definition discordpp.h:1006
@ Verbose
Verbose.
Definition discordpp.h:997
RelationshipGroupType
Enum that represents the logical groups of relationships based on online status and game activity.
Definition discordpp.h:1014
@ OnlinePlayingGame
Users who are online and currently playing the game.
Definition discordpp.h:1017
@ Offline
Users who are offline.
Definition discordpp.h:1023
@ OnlineElsewhere
Users who are online but not playing the game.
Definition discordpp.h:1020
IntegrationType
Represents the type of integration the app will be installed as.
Definition discordpp.h:720
@ GuildInstall
GuildInstall.
Definition discordpp.h:723
@ UserInstall
UserInstall.
Definition discordpp.h:726
AudioSystem
The Discord Voice audio system to use.
Definition discordpp.h:832
@ Game
Use the game audio system.
Definition discordpp.h:838
@ Standard
Use the standard audio system.
Definition discordpp.h:835
ActivityGamePlatforms
Represents the type of platforms that an activity invite can be accepted on.
Definition discordpp.h:437
@ Embedded
Embedded.
Definition discordpp.h:455
@ Xbox
Xbox.
Definition discordpp.h:443
@ Desktop
Desktop.
Definition discordpp.h:440
@ Samsung
Samsung.
Definition discordpp.h:446
@ PS5
PS5.
Definition discordpp.h:461
@ PS4
PS4.
Definition discordpp.h:458
@ IOS
IOS.
Definition discordpp.h:449
@ Android
Android.
Definition discordpp.h:452
std::string String
Definition discordpp.h:343
std::unordered_map< SdkString, SdkString, SdkStringHash, std::equal_to< SdkString >, SdkAllocator< std::pair< const SdkString, SdkString > > > SdkStringMap
A string-to-string map whose nodes and strings come from the SDK's allocation backend.
Definition discordpp.h:151
VoiceInputModeType
Describes how the Discord client decides when to transmit the user's microphone audio.
Definition discordpp.h:809
@ PushToTalk
Transmit while the push-to-talk shortcut is held.
Definition discordpp.h:815
@ VoiceActivity
Transmit when voice activity is detected.
Definition discordpp.h:812
ActivityTypes
Discord RichPresence supports multiple types of activities that a user can be doing.
Definition discordpp.h:397
@ Watching
Watching.
Definition discordpp.h:409
@ Competing
Competing.
Definition discordpp.h:415
@ HangStatus
HangStatus.
Definition discordpp.h:418
@ Listening
Listening.
Definition discordpp.h:406
@ Streaming
Streaming.
Definition discordpp.h:403
@ CustomStatus
CustomStatus.
Definition discordpp.h:412
@ Playing
Playing.
Definition discordpp.h:400
StatusType
Enum that specifies the various online statuses for a user.
Definition discordpp.h:912
@ Blocked
Blocked.
Definition discordpp.h:921
@ Online
The user is online and recently active.
Definition discordpp.h:915
@ Dnd
The user is online, but wishes to suppress notifications for the time being.
Definition discordpp.h:928
@ Unknown
Unknown.
Definition discordpp.h:937
@ Invisible
The user is online, but wishes to appear as if they are offline to other users.
Definition discordpp.h:931
@ Offline
The user is offline and not connected to Discord.
Definition discordpp.h:918
@ Streaming
The user is online and is actively streaming content.
Definition discordpp.h:934
@ Idle
The user is online, but has not been active for a while and may be away from their computer.
Definition discordpp.h:925
std::unordered_map< std::string, std::string > StringMap
The string map type used throughout the discordpp API.
Definition discordpp.h:348
StatusDisplayTypes
Controls which Discord RichPresence field is displayed in the user's status.
Definition discordpp.h:424
@ Details
Details.
Definition discordpp.h:433
@ State
State.
Definition discordpp.h:430
@ Name
Name.
Definition discordpp.h:427
ExternalIdentityProviderType
The type of external identity provider.
Definition discordpp.h:884
@ EpicOnlineServices
EpicOnlineServices.
Definition discordpp.h:890
@ OIDC
OIDC.
Definition discordpp.h:887
@ Steam
Steam.
Definition discordpp.h:893
@ None
None.
Definition discordpp.h:902
@ Unity
Unity.
Definition discordpp.h:896
@ Unknown
Unknown.
Definition discordpp.h:905
@ DiscordBot
DiscordBot.
Definition discordpp.h:899
void RunCallbacks()
Definition discordpp.h:35
bool operator==(const SdkAllocator< T > &, const SdkAllocator< U > &) noexcept
SdkAllocator instances always compare equal, since memory from one can be freed by any other.
Definition discordpp.h:122
AudioModeType
Represents whether a voice call is using push to talk or auto voice detection.
Definition discordpp.h:842
@ MODE_PTT
MODE_PTT.
Definition discordpp.h:851
@ MODE_VAD
MODE_VAD.
Definition discordpp.h:848
@ MODE_UNINIT
MODE_UNINIT.
Definition discordpp.h:845
Discord_AllocatorInstallStatus InstallAllocator(const Discord_Allocator &allocator)
Definition discordpp.h:48
ErrorType
Enum representing various types of errors the SDK returns.
Definition discordpp.h:465
@ HTTPError
An HTTP call was made to Discord's servers but a non success HTTP status code was returned....
Definition discordpp.h:480
@ NetworkError
The user is offline or there was some network issue that prevented an underlying HTTP call from succe...
Definition discordpp.h:472
@ AuthorizationFailed
An authorization function failed, but not necessarily as the result of an HTTP call that returned an ...
Definition discordpp.h:514
@ ClientNotReady
An operation such as sending a friend request or joining a lobby was attempted but the Client is not ...
Definition discordpp.h:490
@ None
No error, the operation was successful.
Definition discordpp.h:468
@ Aborted
The user or developer aborted an operation, such as an authorization flow.
Definition discordpp.h:509
@ RPCError
An RPC call was made to Discord's desktop application, but it returned a non-success result....
Definition discordpp.h:519
@ ValidationError
Used when an SDK method is called but the inputs don't pass local validation. For example if one atte...
Definition discordpp.h:506
@ ClientDestroyed
The Client has been destroyed and so this operation cannot complete.
Definition discordpp.h:496
@ Disabled
An operation was temporarily disabled for stability reasons.
Definition discordpp.h:493
std::basic_string< char, std::char_traits< char >, SdkAllocator< char > > SdkString
A string whose storage comes from the SDK's allocation backend.
Definition discordpp.h:135
DiscordObjectState
Represents the memory state of a Discord object.
Definition discordpp.h:25
@ Invalid
The object has been freed.
Definition discordpp.h:27
@ Owned
The object is owned by the C++ wrapper and methods can be called on it.
Definition discordpp.h:29
AdditionalContentType
Represents the type of additional content contained in a message.
Definition discordpp.h:784
@ Sticker
Sticker.
Definition discordpp.h:805
@ VoiceMessage
VoiceMessage.
Definition discordpp.h:796
@ Other
Other.
Definition discordpp.h:787
@ Poll
Poll.
Definition discordpp.h:793
@ Thread
Thread.
Definition discordpp.h:799
@ Attachment
Attachment.
Definition discordpp.h:790
@ Embed
Embed.
Definition discordpp.h:802
std::vector< T > Vector
The vector type used throughout the discordpp API.
Definition discordpp.h:346
ActivityActionTypes
ActivityActionTypes represents the type of invite being sent to a user.
Definition discordpp.h:361
@ Invalid
Invalid.
Definition discordpp.h:364
@ Join
Join.
Definition discordpp.h:367
@ JoinRequest
JoinRequest.
Definition discordpp.h:370
Definition discordpp.h:93
T value_type
The type of object this allocator allocates.
Definition discordpp.h:95
SdkAllocator() noexcept=default
Constructs an allocator. The allocator is stateless, so all instances are interchangeable.
T * allocate(size_t count)
Allocates storage for count objects of type T from the SDK's allocation backend.
Definition discordpp.h:106
void deallocate(T *ptr, size_t) noexcept
Returns storage obtained from allocate to the SDK's allocation backend.
Definition discordpp.h:117
Hashes an SdkString by its contents.
Definition discordpp.h:142
size_t operator()(const SdkString &value) const noexcept
Returns the hash of the string's characters.
Definition discordpp.h:144