Skip to content

Commit

Permalink
GUILD_MEMBER_UPDATE bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
valzargaming committed Feb 5, 2024
1 parent a4e944b commit 60edec2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions verifier_functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@

$civ13->discord->on('GUILD_MEMBER_UPDATE', function (Member $member, Discord $discord, ?Member $member_old) use ($civ13): void
{
if (! $member_old) { // Not enough information is known about the change, so we will update everything
$civ13->whitelistUpdate();
$civ13->getVerified();
$civ13->factionlistUpdate();
$civ13->adminlistUpdate();
return;
}
if ($member->roles->has($civ13->role_ids['veteran']) !== $member_old->roles->has($civ13->role_ids['veteran'])) $civ13->whitelistUpdate();
if ($member->roles->has($civ13->role_ids['infantry']) !== $member_old->roles->has($civ13->role_ids['infantry'])) $civ13->getVerified();
$faction_roles = [
Expand Down

0 comments on commit 60edec2

Please sign in to comment.