diff --git a/docpages/example_code/coro_awaiting_events.cpp b/docpages/example_code/coro_awaiting_events.cpp index f5be22b681..469d1bcf94 100644 --- a/docpages/example_code/coro_awaiting_events.cpp +++ b/docpages/example_code/coro_awaiting_events.cpp @@ -20,7 +20,7 @@ int main() { ); co_await event.co_reply(m); - dpp::button_click_t click_event = co_await event.from->creator->on_button_click.when( + dpp::button_click_t click_event = co_await event.owner->on_button_click.when( // Note!! Due to a bug in g++11 and g++12, id must be captured as a reference here or the compiler will destroy it twice. This is fixed in g++13 [&id] (dpp::button_click_t const &b) { return b.custom_id == id; diff --git a/docpages/example_code/coro_expiring_buttons.cpp b/docpages/example_code/coro_expiring_buttons.cpp index ed58bdadad..4b5f585d59 100644 --- a/docpages/example_code/coro_expiring_buttons.cpp +++ b/docpages/example_code/coro_expiring_buttons.cpp @@ -21,10 +21,10 @@ int main() { co_await event.co_reply(m); auto result = co_await dpp::when_any{ // Whichever completes first... - event.from->creator->on_button_click.when([&id](const dpp::button_click_t &b) { // Button clicked + event.owner->on_button_click.when([&id](const dpp::button_click_t &b) { // Button clicked return b.custom_id == id; }), - event.from->creator->co_sleep(5) // Or sleep 5 seconds + event.owner->co_sleep(5) // Or sleep 5 seconds }; // Note!! Due to a bug in g++11 and g++12, id must be captured as a reference above or the compiler will destroy it twice. This is fixed in g++13 if (result.index() == 0) { // Awaitable #0 completed first, that is the button click event diff --git a/docpages/example_code/coro_intro.cpp b/docpages/example_code/coro_intro.cpp index c48128547e..0018943b67 100644 --- a/docpages/example_code/coro_intro.cpp +++ b/docpages/example_code/coro_intro.cpp @@ -9,7 +9,7 @@ int main() { bot.on_slashcommand([](const dpp::slashcommand_t& event) -> dpp::task { if (event.command.get_command_name() == "file") { /* Request the image from the URL specified and co_await the response */ - dpp::http_request_completion_t result = co_await event.from->creator->co_request("https://dpp.dev/DPP-Logo.png", dpp::m_get); + dpp::http_request_completion_t result = co_await event.owner->co_request("https://dpp.dev/DPP-Logo.png", dpp::m_get); /* Create a message and attach the image on success */ dpp::message msg(event.command.channel_id, "This is my new attachment:"); diff --git a/docpages/example_code/coro_simple_commands1.cpp b/docpages/example_code/coro_simple_commands1.cpp index 09891ea125..0891684131 100644 --- a/docpages/example_code/coro_simple_commands1.cpp +++ b/docpages/example_code/coro_simple_commands1.cpp @@ -7,7 +7,7 @@ int main() { bot.on_slashcommand([](const dpp::slashcommand_t& event) -> dpp::task { if (event.command.get_command_name() == "addemoji") { - dpp::cluster *cluster = event.from->creator; + dpp::cluster *cluster = event.owner; // Retrieve parameter values dpp::snowflake file_id = std::get(event.get_parameter("file")); std::string emoji_name = std::get(event.get_parameter("name")); diff --git a/docpages/example_code/coro_simple_commands2.cpp b/docpages/example_code/coro_simple_commands2.cpp index ac4683eb45..40a46e4e5f 100644 --- a/docpages/example_code/coro_simple_commands2.cpp +++ b/docpages/example_code/coro_simple_commands2.cpp @@ -32,7 +32,7 @@ int main() { } } // Finally if everything else failed, request API - dpp::confirmation_callback_t confirmation = co_await event.from->creator->co_guild_get_member(event.command.guild_id, user_id); + dpp::confirmation_callback_t confirmation = co_await event.owner->co_guild_get_member(event.command.guild_id, user_id); if (confirmation.is_error()) { co_return std::nullopt; // Member not found, return empty } else { @@ -53,7 +53,7 @@ int main() { std::string avatar_url = member->get_avatar_url(512); if (avatar_url.empty()) { // Member does not have a custom avatar for this server, get their user avatar - dpp::confirmation_callback_t confirmation = co_await event.from->creator->co_user_get_cached(member->user_id); + dpp::confirmation_callback_t confirmation = co_await event.owner->co_user_get_cached(member->user_id); if (confirmation.is_error()) { // Wait for the thinking response to arrive to make sure we can edit co_await thinking; diff --git a/docpages/example_code/join_voice.cpp b/docpages/example_code/join_voice.cpp index 6dc771f9ae..18dd5926c1 100644 --- a/docpages/example_code/join_voice.cpp +++ b/docpages/example_code/join_voice.cpp @@ -18,7 +18,7 @@ int main() { dpp::guild* g = dpp::find_guild(event.command.guild_id); /* Get the voice channel that the bot is currently in from this server (will return nullptr if we're not in a voice channel!) */ - auto current_vc = event.from->get_voice(event.command.guild_id); + auto current_vc = event.from()->get_voice(event.command.guild_id); bool join_vc = true; @@ -38,7 +38,7 @@ int main() { /* We are on a different voice channel. We should leave it, then join the new one * by falling through to the join_vc branch below. */ - event.from->disconnect_voice(event.command.guild_id); + event.from()->disconnect_voice(event.command.guild_id); join_vc = true; } diff --git a/docpages/example_code/mp3.cpp b/docpages/example_code/mp3.cpp index 83cc555116..1daf9e5d8c 100644 --- a/docpages/example_code/mp3.cpp +++ b/docpages/example_code/mp3.cpp @@ -75,7 +75,7 @@ int main() { event.reply("Joined your channel!"); } else if (event.command.get_command_name() == "mp3") { /* Get the voice channel the bot is in, in this current guild. */ - dpp::voiceconn* v = event.from->get_voice(event.command.guild_id); + dpp::voiceconn* v = event.from()->get_voice(event.command.guild_id); /* If the voice channel was invalid, or there is an issue with it, then tell the user. */ if (!v || !v->voiceclient || !v->voiceclient->is_ready()) { diff --git a/docpages/example_code/oggopus.cpp b/docpages/example_code/oggopus.cpp index 5c5d3e8952..7cfa65ae41 100644 --- a/docpages/example_code/oggopus.cpp +++ b/docpages/example_code/oggopus.cpp @@ -39,7 +39,7 @@ int main(int argc, char const *argv[]) { } else if (event.command.get_command_name() == "play") { /* Get the voice channel the bot is in, in this current guild. */ - dpp::voiceconn* v = event.from->get_voice(event.command.guild_id); + dpp::voiceconn* v = event.from()->get_voice(event.command.guild_id); /* If the voice channel was invalid, or there is an issue with it, then tell the user. */ if (!v || !v->voiceclient || !v->voiceclient->is_ready()) { diff --git a/docpages/example_code/oggopus2.cpp b/docpages/example_code/oggopus2.cpp index 46956a553c..ea969c9bf9 100644 --- a/docpages/example_code/oggopus2.cpp +++ b/docpages/example_code/oggopus2.cpp @@ -37,7 +37,7 @@ int main() { event.reply("Joined your channel!"); } else if (event.command.get_command_name() == "play") { /* Get the voice channel the bot is in, in this current guild. */ - dpp::voiceconn* v = event.from->get_voice(event.command.guild_id); + dpp::voiceconn* v = event.from()->get_voice(event.command.guild_id); /* If the voice channel was invalid, or there is an issue with it, then tell the user. */ if (!v || !v->voiceclient || !v->voiceclient->is_ready()) { diff --git a/docpages/example_code/record_user.cpp b/docpages/example_code/record_user.cpp index 9b98af56c7..7de36710f3 100644 --- a/docpages/example_code/record_user.cpp +++ b/docpages/example_code/record_user.cpp @@ -36,7 +36,7 @@ int main() { /* Tell the user we joined their channel. */ event.reply("Joined your channel, now recording!"); } else if (event.command.get_command_name() == "stop") { - event.from->disconnect_voice(event.command.guild_id); + event.from()->disconnect_voice(event.command.guild_id); fclose(fd); event.reply("Stopped recording."); diff --git a/docpages/example_code/soundboard.cpp b/docpages/example_code/soundboard.cpp index 77602afd53..457a44a9f7 100644 --- a/docpages/example_code/soundboard.cpp +++ b/docpages/example_code/soundboard.cpp @@ -47,7 +47,7 @@ int main() { event.reply("Joined your channel!"); } else if (event.command.get_command_name() == "robot") { /* Get the voice channel the bot is in, in this current guild. */ - dpp::voiceconn* v = event.from->get_voice(event.command.guild_id); + dpp::voiceconn* v = event.from()->get_voice(event.command.guild_id); /* If the voice channel was invalid, or there is an issue with it, then tell the user. */ if (!v || !v->voiceclient || !v->voiceclient->is_ready()) {