Skip to content

Commit

Permalink
update to latest dpp
Browse files Browse the repository at this point in the history
  • Loading branch information
braindigitalis committed Jun 9, 2024
1 parent abacf17 commit 2408be4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion modules/trivia/commands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
10 changes: 5 additions & 5 deletions modules/trivia/trivia.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions modules/trivia/webrequest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 2408be4

Please sign in to comment.