From 2408be4d27c82888c013b96bc5be7937232cfcc5 Mon Sep 17 00:00:00 2001 From: Craig Edwards Date: Sun, 9 Jun 2024 16:36:50 +0000 Subject: [PATCH] update to latest dpp --- modules/trivia/commands.cpp | 2 +- modules/trivia/trivia.cpp | 10 +++++----- modules/trivia/webrequest.cpp | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/modules/trivia/commands.cpp b/modules/trivia/commands.cpp index 50d8e24..e75b35f 100644 --- a/modules/trivia/commands.cpp +++ b/modules/trivia/commands.cpp @@ -505,7 +505,7 @@ void TriviaModule::handle_command(const in_cmd &cmd, const dpp::interaction_crea if (g) { for (auto modrole = settings.moderator_roles.begin(); modrole != settings.moderator_roles.end(); ++modrole) { /* Check for when user cache is off, and guild member passed in via the message */ - for (auto role = cmd.member.roles.begin(); role != cmd.member.roles.end(); ++role) { + for (auto role = cmd.member.get_roles().begin(); role != cmd.member.get_roles().end(); ++role) { if (*role == *modrole) { moderator = true; break; diff --git a/modules/trivia/trivia.cpp b/modules/trivia/trivia.cpp index 0bbd9dd..8810a9e 100644 --- a/modules/trivia/trivia.cpp +++ b/modules/trivia/trivia.cpp @@ -283,15 +283,15 @@ bool TriviaModule::OnChannelDelete(const dpp::channel_delete_t &cd) bool TriviaModule::OnGuildDelete(const dpp::guild_delete_t &gd) { /* Unavailable guilds means an outage. We don't remove them if it's just an outage */ - if (!gd.deleted->is_unavailable()) { + if (!gd.deleted.is_unavailable()) { { std::unique_lock locker(settingcache_mutex); - settings_cache.erase(gd.deleted->id); + settings_cache.erase(gd.deleted.id); } - db::backgroundquery("UPDATE trivia_guild_cache SET kicked = 1 WHERE snowflake_id = ?", {gd.deleted->id}); - bot->core->log(dpp::ll_info, fmt::format("Kicked from guild id {}", gd.deleted->id)); + db::backgroundquery("UPDATE trivia_guild_cache SET kicked = 1 WHERE snowflake_id = ?", {gd.deleted.id}); + bot->core->log(dpp::ll_info, fmt::format("Kicked from guild id {}", gd.deleted.id)); } else { - bot->core->log(dpp::ll_info, fmt::format("Outage on guild id {}", gd.deleted->id)); + bot->core->log(dpp::ll_info, fmt::format("Outage on guild id {}", gd.deleted.id)); } return true; } diff --git a/modules/trivia/webrequest.cpp b/modules/trivia/webrequest.cpp index 4f8d8a6..b96aebb 100644 --- a/modules/trivia/webrequest.cpp +++ b/modules/trivia/webrequest.cpp @@ -426,11 +426,11 @@ void cache_user(const dpp::user *_user, const dpp::guild *_guild, const dpp::gui {user_id, _user->username, _user->discriminator, _user->avatar.to_string(), _user->username, _user->discriminator, _user->avatar.to_string()}); db::backgroundquery("INSERT INTO trivia_guild_cache (snowflake_id, name, icon, owner_id) VALUES('?', '?', '?', '?') ON DUPLICATE KEY UPDATE name = '?', icon = '?', owner_id = '?', kicked = 0", - {guild_id, _guild->name, _guild->icon.to_string(), _guild->owner_id, _guild->name, _guild->icon.to_string(), _guild->owner_id}); + {guild_id, _guild->name, _guild->icon.as_iconhash().to_string(), _guild->owner_id, _guild->name, _guild->icon.as_iconhash().to_string(), _guild->owner_id}); std::string member_roles; std::string comma_roles; - for (auto r = gi->roles.begin();r != gi->roles.end(); ++r) { + for (auto r = gi->get_roles().begin();r != gi->get_roles().end(); ++r) { member_roles.append(std::to_string(*r)).append(" "); } member_roles = trim(member_roles);