Skip to content

Commit d70cef2

Browse files
Merge branch 'dev' of github.com:brainboxdotcc/DPP
2 parents fde5da0 + 8f26e78 commit d70cef2

File tree

138 files changed

+491
-410
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

138 files changed

+491
-410
lines changed

include/dpp/appcommand.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1591,4 +1591,4 @@ typedef std::unordered_map<snowflake, slashcommand> slashcommand_map;
15911591
*/
15921592
typedef std::unordered_map<snowflake, guild_command_permissions> guild_command_permissions_map;
15931593

1594-
} // namespace dpp
1594+
}

include/dpp/application.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,11 @@ class DPP_EXPORT application : public managed, public json_interface<application
325325
*/
326326
uint64_t approximate_guild_count;
327327

328+
/**
329+
* @brief Optional: Approximate count of users that have installed the app
330+
*/
331+
uint64_t approximate_user_install_count;
332+
328333
/**
329334
* @brief Optional: Array of redirect URIs for the app.
330335
*/
@@ -467,4 +472,4 @@ class DPP_EXPORT application : public managed, public json_interface<application
467472
*/
468473
typedef std::unordered_map<snowflake, application> application_map;
469474

470-
} // namespace dpp
475+
}

include/dpp/auditlog.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,4 +478,4 @@ class DPP_EXPORT auditlog : public json_interface<auditlog> {
478478
virtual ~auditlog() = default;
479479
};
480480

481-
} // namespace dpp
481+
}

include/dpp/automod.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,4 +400,4 @@ class DPP_EXPORT automod_rule : public managed, public json_interface<automod_ru
400400
*/
401401
typedef std::unordered_map<snowflake, automod_rule> automod_rule_map;
402402

403-
} // namespace dpp
403+
}

include/dpp/ban.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,4 @@ class DPP_EXPORT ban : public json_interface<ban> {
6666
*/
6767
typedef std::unordered_map<snowflake, ban> ban_map;
6868

69-
} // namespace dpp
69+
}

include/dpp/bignum.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,4 +98,4 @@ class DPP_EXPORT bignumber {
9898
[[nodiscard]] std::vector<uint64_t> get_binary() const;
9999
};
100100

101-
} // namespace dpp
101+
}

include/dpp/cache.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,5 +270,5 @@ cache_decl(role, find_role, get_role_cache, get_role_count);
270270
cache_decl(channel, find_channel, get_channel_cache, get_channel_count);
271271
cache_decl(emoji, find_emoji, get_emoji_cache, get_emoji_count);
272272

273-
} // namespace dpp
273+
}
274274

include/dpp/channel.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -878,5 +878,5 @@ void to_json(nlohmann::json& j, const permission_overwrite& po);
878878
*/
879879
typedef std::unordered_map<snowflake, channel> channel_map;
880880

881-
} // namespace dpp
881+
}
882882

include/dpp/cluster.h

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1334,17 +1334,6 @@ class DPP_EXPORT cluster {
13341334
event_router_t<voice_buffer_send_t> on_voice_buffer_send;
13351335

13361336

1337-
/**
1338-
* @brief Called when a user is talking on a voice channel.
1339-
*
1340-
* @warning If the cache policy has disabled guild caching, the pointer to the guild in this event may be nullptr.
1341-
*
1342-
* @note Use operator() to attach a lambda to this event, and the detach method to detach the listener using the returned ID.
1343-
* The function signature for this event takes a single `const` reference of type voice_user_talking_t&, and returns void.
1344-
*/
1345-
event_router_t<voice_user_talking_t> on_voice_user_talking;
1346-
1347-
13481337
/**
13491338
* @brief Called when a voice channel is connected and ready to send audio.
13501339
* Note that this is not directly attached to the READY event of the websocket,
@@ -3662,7 +3651,7 @@ class DPP_EXPORT cluster {
36623651

36633652
/**
36643653
* @brief Get all guild stickers
3665-
* @see https://discord.com/developers/docs/resources/sticker#get-guild-stickers
3654+
* @see https://discord.com/developers/docs/resources/sticker#list-guild-stickers
36663655
* @param guild_id Guild ID of the guild where the sticker is
36673656
* @param callback Function to call when the API call completes.
36683657
* On success the callback will contain a dpp::sticker_map object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().
@@ -3671,7 +3660,7 @@ class DPP_EXPORT cluster {
36713660

36723661
/**
36733662
* @brief Get a list of available sticker packs
3674-
* @see https://discord.com/developers/docs/resources/sticker#list-nitro-sticker-packs
3663+
* @see https://discord.com/developers/docs/resources/sticker#list-sticker-packs
36753664
* @param callback Function to call when the API call completes.
36763665
* On success the callback will contain a dpp::sticker_pack_map object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().
36773666
*/
@@ -3821,6 +3810,16 @@ class DPP_EXPORT cluster {
38213810
*/
38223811
void current_user_set_voice_state(snowflake guild_id, snowflake channel_id, bool suppress = false, time_t request_to_speak_timestamp = 0, command_completion_event_t callback = utility::log_error());
38233812

3813+
/**
3814+
* @brief Get the bot's voice state in a guild without a Gateway connection
3815+
*
3816+
* @see https://discord.com/developers/docs/resources/voice#get-current-user-voice-state
3817+
* @param guild_id Guild to get the voice state for
3818+
* @param callback Function to call when the API call completes.
3819+
* On success the callback will contain a dpp::voicestate object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().
3820+
*/
3821+
void current_user_get_voice_state(snowflake guild_id, command_completion_event_t callback);
3822+
38243823
/**
38253824
* @brief Set a user's voice state on a stage channel
38263825
*
@@ -3844,6 +3843,17 @@ class DPP_EXPORT cluster {
38443843
*/
38453844
void user_set_voice_state(snowflake user_id, snowflake guild_id, snowflake channel_id, bool suppress = false, command_completion_event_t callback = utility::log_error());
38463845

3846+
/**
3847+
* @brief Get a user's voice state in a guild without a Gateway connection
3848+
*
3849+
* @see https://discord.com/developers/docs/resources/voice#get-user-voice-state
3850+
* @param guild_id Guild to get the voice state for
3851+
* @param user_id The user to get the voice state of
3852+
* @param callback Function to call when the API call completes.
3853+
* On success the callback will contain a dpp::voicestate object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().
3854+
*/
3855+
void user_get_voice_state(snowflake guild_id, snowflake user_id, command_completion_event_t callback);
3856+
38473857
/**
38483858
* @brief Get all auto moderation rules for a guild
38493859
*
@@ -3972,4 +3982,4 @@ class DPP_EXPORT cluster {
39723982

39733983
};
39743984

3975-
} // namespace dpp
3985+
}

include/dpp/cluster_coro_calls.h

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2009,7 +2009,7 @@
20092009
/**
20102010
* @brief Get all guild stickers
20112011
* @see dpp::cluster::guild_stickers_get
2012-
* @see https://discord.com/developers/docs/resources/sticker#get-guild-stickers
2012+
* @see https://discord.com/developers/docs/resources/sticker#list-guild-stickers
20132013
* @param guild_id Guild ID of the guild where the sticker is
20142014
* @return sticker_map returned object on completion
20152015
* \memberof dpp::cluster
@@ -2029,7 +2029,7 @@
20292029
/**
20302030
* @brief Get a list of available sticker packs
20312031
* @see dpp::cluster::sticker_packs_get
2032-
* @see https://discord.com/developers/docs/resources/sticker#list-nitro-sticker-packs
2032+
* @see https://discord.com/developers/docs/resources/sticker#list-sticker-packs
20332033
* @return sticker_pack_map returned object on completion
20342034
* \memberof dpp::cluster
20352035
*/
@@ -2367,6 +2367,17 @@
23672367
*/
23682368
[[nodiscard]] async<confirmation_callback_t> co_current_user_set_voice_state(snowflake guild_id, snowflake channel_id, bool suppress = false, time_t request_to_speak_timestamp = 0);
23692369

2370+
/**
2371+
* @brief Get the bot's voice state in a guild without a Gateway connection
2372+
*
2373+
* @see dpp::cluster::current_user_get_voice_state
2374+
* @see https://discord.com/developers/docs/resources/voice#get-current-user-voice-state
2375+
* @param guild_id Guild to get the voice state for
2376+
* @return voicestate returned object on completion
2377+
* \memberof dpp::cluster
2378+
*/
2379+
[[nodiscard]] async<confirmation_callback_t> co_current_user_get_voice_state(snowflake guild_id);
2380+
23702381
/**
23712382
* @brief Set a user's voice state on a stage channel
23722383
*
@@ -2391,6 +2402,18 @@
23912402
*/
23922403
[[nodiscard]] async<confirmation_callback_t> co_user_set_voice_state(snowflake user_id, snowflake guild_id, snowflake channel_id, bool suppress = false);
23932404

2405+
/**
2406+
* @brief Get a user's voice state in a guild without a Gateway connection
2407+
*
2408+
* @see dpp::cluster::user_get_voice_state
2409+
* @see https://discord.com/developers/docs/resources/voice#get-user-voice-state
2410+
* @param guild_id Guild to get the voice state for
2411+
* @param user_id The user to get the voice state of
2412+
* @return voicestate returned object on completion
2413+
* \memberof dpp::cluster
2414+
*/
2415+
[[nodiscard]] async<confirmation_callback_t> co_user_get_voice_state(snowflake guild_id, snowflake user_id);
2416+
23942417
/**
23952418
* @brief Get current user's connections (linked accounts, e.g. steam, xbox).
23962419
* This call requires the oauth2 `connections` scope and cannot be executed

0 commit comments

Comments
 (0)