From 283dd5e767a677ae0280853ef52df55fe6acda69 Mon Sep 17 00:00:00 2001 From: Jaskowicz1 Date: Fri, 12 Jan 2024 14:15:22 +0000 Subject: [PATCH] feat: added auto-generated cluster and coro calls --- include/dpp/cluster_coro_calls.h | 12 ++++++++++++ include/dpp/cluster_sync_calls.h | 15 +++++++++++++++ src/dpp/cluster_coro_calls.cpp | 4 ++++ src/dpp/cluster_sync_calls.cpp | 4 ++++ 4 files changed, 35 insertions(+) diff --git a/include/dpp/cluster_coro_calls.h b/include/dpp/cluster_coro_calls.h index 22cdcef0c4..21431c9dfa 100644 --- a/include/dpp/cluster_coro_calls.h +++ b/include/dpp/cluster_coro_calls.h @@ -576,6 +576,18 @@ */ [[nodiscard]] async co_channels_get(snowflake guild_id); +/** + * @brief Set the status of a voice channel. + * + * @see dpp::cluster::channel_set_voice_status + * @see https://github.com/discord/discord-api-docs/pull/6400 (please replace soon). + * @param channel_id The channel to update. + * @param status The new status for the channel. + * @return confirmation returned object on completion + * \memberof dpp::cluster + */ +[[nodiscard]] async co_channel_set_voice_status(snowflake channel_id, const std::string& status); + /** * @brief Create a dm channel * @see dpp::cluster::create_dm_channel diff --git a/include/dpp/cluster_sync_calls.h b/include/dpp/cluster_sync_calls.h index 26e81f111a..140b9ba5a1 100644 --- a/include/dpp/cluster_sync_calls.h +++ b/include/dpp/cluster_sync_calls.h @@ -714,6 +714,21 @@ confirmation channel_typing_sync(snowflake cid); */ channel_map channels_get_sync(snowflake guild_id); +/** + * @brief Set the status of a voice channel. + * + * @see dpp::cluster::channel_set_voice_status + * @see https://github.com/discord/discord-api-docs/pull/6400 (please replace soon). + * @param channel_id The channel to update. + * @param status The new status for the channel. + * @return confirmation returned object on completion + * \memberof dpp::cluster + * @throw dpp::rest_exception upon failure to execute REST function + * @warning This function is a blocking (synchronous) call and should only be used from within a separate thread. + * Avoid direct use of this function inside an event handler. + */ +confirmation channel_set_voice_status_sync(snowflake channel_id, const std::string& status); + /** * @brief Create a dm channel * @see dpp::cluster::create_dm_channel diff --git a/src/dpp/cluster_coro_calls.cpp b/src/dpp/cluster_coro_calls.cpp index d03183cdeb..28f0eca82a 100644 --- a/src/dpp/cluster_coro_calls.cpp +++ b/src/dpp/cluster_coro_calls.cpp @@ -219,6 +219,10 @@ async cluster::co_channels_get(snowflake guild_id) { return async{ this, static_cast(&cluster::channels_get), guild_id }; } +async cluster::co_channel_set_voice_status(snowflake channel_id, const std::string& status) { + return async{ this, static_cast(&cluster::channel_set_voice_status), channel_id, status }; +} + async cluster::co_create_dm_channel(snowflake user_id) { return async{ this, static_cast(&cluster::create_dm_channel), user_id }; } diff --git a/src/dpp/cluster_sync_calls.cpp b/src/dpp/cluster_sync_calls.cpp index 66e057c1ee..876c0d0327 100644 --- a/src/dpp/cluster_sync_calls.cpp +++ b/src/dpp/cluster_sync_calls.cpp @@ -217,6 +217,10 @@ channel_map cluster::channels_get_sync(snowflake guild_id) { return dpp::sync(this, static_cast(&cluster::channels_get), guild_id); } +confirmation cluster::channel_set_voice_status_sync(snowflake channel_id, const std::string& status) { + return dpp::sync(this, static_cast(&cluster::channel_set_voice_status), channel_id, status); +} + channel cluster::create_dm_channel_sync(snowflake user_id) { return dpp::sync(this, static_cast(&cluster::create_dm_channel), user_id); }