From e52ed92d722a648874406579f0aae6cd8fc6fa5f Mon Sep 17 00:00:00 2001 From: Archie Jaskowicz Date: Sun, 10 Dec 2023 21:44:45 +0000 Subject: [PATCH] docs: made the setting_status page use the latest ready_t feature (#1039) --- docpages/example_code/setting_status2.cpp | 2 +- docpages/example_programs/misc/setting_status.md | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docpages/example_code/setting_status2.cpp b/docpages/example_code/setting_status2.cpp index 36949868a9..7eaccaac4e 100644 --- a/docpages/example_code/setting_status2.cpp +++ b/docpages/example_code/setting_status2.cpp @@ -10,7 +10,7 @@ int main() { /* We put our status updating inside "run_once" so that multiple shards don't try do this as "set_presence" updates all the shards. */ if (dpp::run_once()) { /* We update the presence now as the timer will do the first execution after the x amount of seconds we specify */ - bot.set_presence(dpp::presence(dpp::presence_status::ps_online, dpp::activity_type::at_game, "with " + std::to_string(dpp::get_guild_cache()->count()) + " guilds!")); + bot.set_presence(dpp::presence(dpp::presence_status::ps_online, dpp::activity_type::at_game, "with " + std::to_string(event.guild_count) + " guilds!")); /* Create a timer that runs every 120 seconds, that sets the status */ bot.start_timer([&bot](const dpp::timer& timer) { diff --git a/docpages/example_programs/misc/setting_status.md b/docpages/example_programs/misc/setting_status.md index 2ef25a5e2b..088d7a1dfc 100644 --- a/docpages/example_programs/misc/setting_status.md +++ b/docpages/example_programs/misc/setting_status.md @@ -12,6 +12,9 @@ If all went well, your bot should now be online and say this on members list! \image html botonlinestatus.png +If you want to make your bot show as Do Not Disturb, then you could change dpp::ps_online to dpp::ps_dnd. +You can also play around with dpp::at_game, changing it to something like dpp::at_custom or dpp::at_listening! + Now, let's cover setting the bot status to say `Playing with x guilds!` every two minutes. \include{cpp} setting_status2.cpp