Skip to content

Commit

Permalink
Merge pull request #422 from czqoocavatsim/JoshuaBranch
Browse files Browse the repository at this point in the history
JobUpdates
  • Loading branch information
JoshuaMicallefYBSU authored Dec 4, 2024
2 parents 8aec1f9 + 5e44823 commit 90043d6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
22 changes: 11 additions & 11 deletions app/Jobs/DiscordAccountCheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ public function handle()
$discord->getClient()->put('guilds/'.env('DISCORD_GUILD_ID').'/members/'.$discord_uid.'/roles/'.$role);
}

$discord->sendMessageWithEmbed('1299248165551210506', 'USER: '.$name, $message);
// $discord->sendMessageWithEmbed('1299248165551210506', 'USER: '.$name, $message);

}

Expand Down Expand Up @@ -340,37 +340,37 @@ public function handle()
$discord->getClient()->patch('guilds/'.env('DISCORD_GUILD_ID').'/members/'.$user->discord_user_id, [
'json' => [
'nick' => $user->discord_username,
'roles' => 1297422968472997908,
'roles' => [1297422968472997908],
]
]);
}

if($user_updated > 0){
// Record Information for Discord
// Beginning
$update_content = "Updates were conducted for Discord.";
// $update_content = "Updates were conducted for Discord.";

$update_content .= "\n\n **__Updated Users:__**";
foreach($in_discord_name as $name){
$update_content .= "\n- ".$name;
}

$update_content .= "\n\n **__General Information:__**";
// $update_content .= "\n\n **__General Information:__**";

// Users which are linked in Discord
$update_content .= "\n- Accounts Linked in Core: ".$checked_users;
$update_content .= "\n- Linked - in Discord: ".$in_discord;
$update_content .= "\n- Linked - not in Discord: ".$not_in_discord;
// // Users which are linked in Discord
// $update_content .= "\n- Accounts Linked in Core: ".$checked_users;
// $update_content .= "\n- Linked - in Discord: ".$in_discord;
// $update_content .= "\n- Linked - not in Discord: ".$not_in_discord;

// Accounts not linked
$update_content .= "\n- Not Linked - in Discord: ".$accounts_not_linked." (No Account Role Assigned)";
// // Accounts not linked
// $update_content .= "\n- Not Linked - in Discord: ".$accounts_not_linked." (No Account Role Assigned)";

// Completion Time
$end_time = Carbon::now();
$update_content .= "\n\n**__Script Time:__**";
$update_content .= "\n- Script Time: " . $start_time->diffForHumans($end_time, ['parts' => 2, 'short' => true, 'syntax' => Carbon::DIFF_ABSOLUTE]) . ".";

$discord->sendMessageWithEmbed(env('DISCORD_SERVER_LOGS'), 'DAILY: Discord User Update', $update_content);
$discord->sendMessageWithEmbed('1299248165551210506', 'HOURLY: Discord User Update', $update_content);
}
}

Expand Down
4 changes: 2 additions & 2 deletions app/Jobs/ProcessSessionLogging.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,10 @@ public function handle()
}

// Add Discord Role
if($log->user && $log->user->hasDiscord() && $log->user->member_of_czqo){
if($session->user && $session->user->hasDiscord() && $session->user->member_of_czqo){
$discord = new DiscordClient();

$discord->assignRole($log->user->discord_user_id, '1278868454606377040');
$discord->assignRole($session->user->discord_user_id, '1278868454606377040');
}
}
} else {
Expand Down

0 comments on commit 90043d6

Please sign in to comment.