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

+1-1
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

+6-1
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

+1-1
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

+1-1
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

+1-1
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

+1-1
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

+1-1
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

+1-1
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

+24-14
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

+25-2
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

include/dpp/cluster_sync_calls.h

+33-2
Original file line numberDiff line numberDiff line change
@@ -2621,7 +2621,7 @@ DPP_DEPRECATED("Please use coroutines instead of sync functions: https://dpp.dev
26212621
/**
26222622
* @brief Get all guild stickers
26232623
* @see dpp::cluster::guild_stickers_get
2624-
* @see https://discord.com/developers/docs/resources/sticker#get-guild-stickers
2624+
* @see https://discord.com/developers/docs/resources/sticker#list-guild-stickers
26252625
* @param guild_id Guild ID of the guild where the sticker is
26262626
* @return sticker_map returned object on completion
26272627
* \memberof dpp::cluster
@@ -2649,7 +2649,7 @@ DPP_DEPRECATED("Please use coroutines instead of sync functions: https://dpp.dev
26492649
/**
26502650
* @brief Get a list of available sticker packs
26512651
* @see dpp::cluster::sticker_packs_get
2652-
* @see https://discord.com/developers/docs/resources/sticker#list-nitro-sticker-packs
2652+
* @see https://discord.com/developers/docs/resources/sticker#list-sticker-packs
26532653
* @return sticker_pack_map returned object on completion
26542654
* \memberof dpp::cluster
26552655
* @throw dpp::rest_exception upon failure to execute REST function
@@ -3095,6 +3095,21 @@ DPP_DEPRECATED("Please use coroutines instead of sync functions: https://dpp.dev
30953095
*/
30963096
DPP_DEPRECATED("Please use coroutines instead of sync functions: https://dpp.dev/coro-introduction.html") confirmation current_user_set_voice_state_sync(snowflake guild_id, snowflake channel_id, bool suppress = false, time_t request_to_speak_timestamp = 0);
30973097

3098+
/**
3099+
* @brief Get the bot's voice state in a guild without a Gateway connection
3100+
*
3101+
* @see dpp::cluster::current_user_get_voice_state
3102+
* @see https://discord.com/developers/docs/resources/voice#get-current-user-voice-state
3103+
* @param guild_id Guild to get the voice state for
3104+
* @return voicestate returned object on completion
3105+
* \memberof dpp::cluster
3106+
* @throw dpp::rest_exception upon failure to execute REST function
3107+
* @deprecated This function is deprecated, please use coroutines instead.
3108+
* @warning This function is a blocking (synchronous) call and should only be used from within a separate thread.
3109+
* Avoid direct use of this function inside an event handler.
3110+
*/
3111+
DPP_DEPRECATED("Please use coroutines instead of sync functions: https://dpp.dev/coro-introduction.html") voicestate current_user_get_voice_state_sync(snowflake guild_id);
3112+
30983113
/**
30993114
* @brief Set a user's voice state on a stage channel
31003115
*
@@ -3123,6 +3138,22 @@ DPP_DEPRECATED("Please use coroutines instead of sync functions: https://dpp.dev
31233138
*/
31243139
DPP_DEPRECATED("Please use coroutines instead of sync functions: https://dpp.dev/coro-introduction.html") confirmation user_set_voice_state_sync(snowflake user_id, snowflake guild_id, snowflake channel_id, bool suppress = false);
31253140

3141+
/**
3142+
* @brief Get a user's voice state in a guild without a Gateway connection
3143+
*
3144+
* @see dpp::cluster::user_get_voice_state
3145+
* @see https://discord.com/developers/docs/resources/voice#get-user-voice-state
3146+
* @param guild_id Guild to get the voice state for
3147+
* @param user_id The user to get the voice state of
3148+
* @return voicestate returned object on completion
3149+
* \memberof dpp::cluster
3150+
* @throw dpp::rest_exception upon failure to execute REST function
3151+
* @deprecated This function is deprecated, please use coroutines instead.
3152+
* @warning This function is a blocking (synchronous) call and should only be used from within a separate thread.
3153+
* Avoid direct use of this function inside an event handler.
3154+
*/
3155+
DPP_DEPRECATED("Please use coroutines instead of sync functions: https://dpp.dev/coro-introduction.html") voicestate user_get_voice_state_sync(snowflake guild_id, snowflake user_id);
3156+
31263157
/**
31273158
* @brief Get current user's connections (linked accounts, e.g. steam, xbox).
31283159
* This call requires the oauth2 `connections` scope and cannot be executed

include/dpp/collector.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -470,4 +470,4 @@ class scheduled_event_collector : public scheduled_event_collector_t {
470470
virtual ~scheduled_event_collector() = default;
471471
};
472472

473-
} // namespace dpp
473+
}

include/dpp/commandhandler.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -425,4 +425,4 @@ class DPP_EXPORT DPP_DEPRECATED("commandhandler should not be used. Please consi
425425

426426
};
427427

428-
} // namespace dpp
428+
}

include/dpp/coro/async.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,6 @@ class async : public awaitable<R> {
184184

185185
DPP_CHECK_ABI_COMPAT(async<>, async_dummy);
186186

187-
} // namespace dpp
187+
}
188188

189189
#endif /* DPP_CORO */

include/dpp/coro/coroutine.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ namespace detail::coroutine {
393393
DPP_CHECK_ABI_COMPAT(coroutine<void>, coroutine_dummy)
394394
DPP_CHECK_ABI_COMPAT(coroutine<uint64_t>, coroutine_dummy)
395395

396-
} // namespace dpp
396+
}
397397

398398
/**
399399
* @brief Specialization of std::coroutine_traits, helps the standard library figure out a promise type from a coroutine function.

include/dpp/coro/task.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ std_coroutine::coroutine_handle<> final_awaiter<R>::await_suspend(handle_t<R> ha
433433
DPP_CHECK_ABI_COMPAT(task<void>, task_dummy)
434434
DPP_CHECK_ABI_COMPAT(task<uint64_t>, task_dummy)
435435

436-
} // namespace dpp
436+
}
437437

438438
/**
439439
* @brief Specialization of std::coroutine_traits, helps the standard library figure out a promise_t type from a coroutine function.

include/dpp/discordclient.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -533,4 +533,4 @@ class DPP_EXPORT discord_client : public websocket_client
533533
voiceconn* get_voice(snowflake guild_id);
534534
};
535535

536-
} // namespace dpp
536+
}

include/dpp/discordevents.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -229,4 +229,4 @@ std::string DPP_EXPORT base64_encode(unsigned char const* buf, unsigned int buff
229229
*/
230230
std::string DPP_EXPORT ts_to_string(time_t ts);
231231

232-
} // namespace dpp
232+
}

0 commit comments

Comments
 (0)