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 25, 2024
1 parent 5854dfa commit e71446f
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions app/Jobs/DiscordAccountCheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,23 @@ public function handle()
$discord_uid = $user->discord_user_id;
$in_discord++;

$discord_member_details = false;

foreach($discord_member_contents as $discord_members2){
if ($discord_members2['user']['id'] === $discord_uid) {
$discord_member = $discord_members2;

$discord_member_details = true;

break;
}
}

// // Get Discord Member Information
// $discord_member = $discord->getClient()->get('guilds/'.env('DISCORD_GUILD_ID').'/members/'.$discord_uid);
// $discord_member = json_decode($discord_member->getBody(), true);
if($discord_member_details === false){
// Get Discord Member Information
$discord_member = $discord->getClient()->get('guilds/'.env('DISCORD_GUILD_ID').'/members/'.$discord_uid);
$discord_member = json_decode($discord_member->getBody(), true);
}

// Discord Account is Linked. Remove from Check
$key = array_search($user->discord_user_id, $discord_uids);
Expand Down

0 comments on commit e71446f

Please sign in to comment.