Skip to content

Commit

Permalink
feat: added auto-generated cluster and coro calls
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaskowicz1 committed Jan 12, 2024
1 parent bd3ab2d commit 283dd5e
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 0 deletions.
12 changes: 12 additions & 0 deletions include/dpp/cluster_coro_calls.h
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,18 @@
*/
[[nodiscard]] async<confirmation_callback_t> 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<confirmation_callback_t> co_channel_set_voice_status(snowflake channel_id, const std::string& status);

/**
* @brief Create a dm channel
* @see dpp::cluster::create_dm_channel
Expand Down
15 changes: 15 additions & 0 deletions include/dpp/cluster_sync_calls.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions src/dpp/cluster_coro_calls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,10 @@ async<confirmation_callback_t> cluster::co_channels_get(snowflake guild_id) {
return async{ this, static_cast<void (cluster::*)(snowflake, command_completion_event_t)>(&cluster::channels_get), guild_id };
}

async<confirmation_callback_t> cluster::co_channel_set_voice_status(snowflake channel_id, const std::string& status) {
return async{ this, static_cast<void (cluster::*)(snowflake, const std::string&, command_completion_event_t)>(&cluster::channel_set_voice_status), channel_id, status };
}

async<confirmation_callback_t> cluster::co_create_dm_channel(snowflake user_id) {
return async{ this, static_cast<void (cluster::*)(snowflake, command_completion_event_t)>(&cluster::create_dm_channel), user_id };
}
Expand Down
4 changes: 4 additions & 0 deletions src/dpp/cluster_sync_calls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,10 @@ channel_map cluster::channels_get_sync(snowflake guild_id) {
return dpp::sync<channel_map>(this, static_cast<void (cluster::*)(snowflake, command_completion_event_t)>(&cluster::channels_get), guild_id);
}

confirmation cluster::channel_set_voice_status_sync(snowflake channel_id, const std::string& status) {
return dpp::sync<confirmation>(this, static_cast<void (cluster::*)(snowflake, const std::string&, command_completion_event_t)>(&cluster::channel_set_voice_status), channel_id, status);
}

channel cluster::create_dm_channel_sync(snowflake user_id) {
return dpp::sync<channel>(this, static_cast<void (cluster::*)(snowflake, command_completion_event_t)>(&cluster::create_dm_channel), user_id);
}
Expand Down

0 comments on commit 283dd5e

Please sign in to comment.