Skip to content

Commit

Permalink
Update DiscordAccountCheck.php
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaMicallefYBSU committed Oct 22, 2024
1 parent ac397e4 commit b741573
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions app/Jobs/DiscordAccountCheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -230,10 +230,6 @@ public function handle()
}

$discord_roles = array_unique($rolesToAdd);

// Check if the roles are different between Discord and the DB
$diff1 = array_diff($discord_member['roles'], $rolesToAdd);
$diff2 = array_diff($rolesToAdd, $discord_member['roles']);
}

// Name Format for ZQO Members and Other Members
Expand All @@ -243,20 +239,13 @@ public function handle()
$name = $user->FullName('FLC');
}


// Name is same on Discord, as well as roles
if ($name == $discord_member['nick'] && (!empty($diff1) || !empty($diff2))) {
// Sleep API Check
sleep(2);

// Update user
$discord->getClient()->patch('guilds/'.env('DISCORD_GUILD_ID').'/members/'.$user->discord_user_id, [
'json' => [
'nick' => $name,
'roles' => $rolesToAdd,
'roles' => $discord_roles,
]
]);
}


} else {
Expand Down

0 comments on commit b741573

Please sign in to comment.