Skip to content

Commit

Permalink
docs: made the setting_status page use the latest ready_t feature (#1039
Browse files Browse the repository at this point in the history
)
  • Loading branch information
Jaskowicz1 authored Dec 10, 2023
1 parent 4eabe3b commit e52ed92
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docpages/example_code/setting_status2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<struct register_bot_commands>()) {
/* 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) {
Expand Down
3 changes: 3 additions & 0 deletions docpages/example_programs/misc/setting_status.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e52ed92

Please sign in to comment.