From b741573ddb7a88e09883912f8ed7a5586ffce34d Mon Sep 17 00:00:00 2001 From: JoshuaMicallefYBSU <91457812+JoshuaMicallefYBSU@users.noreply.github.com> Date: Tue, 22 Oct 2024 15:10:09 +1000 Subject: [PATCH] Update DiscordAccountCheck.php --- app/Jobs/DiscordAccountCheck.php | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/app/Jobs/DiscordAccountCheck.php b/app/Jobs/DiscordAccountCheck.php index e81949f9..c059fe10 100644 --- a/app/Jobs/DiscordAccountCheck.php +++ b/app/Jobs/DiscordAccountCheck.php @@ -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 @@ -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 {