From 5e448234885790d9d168159f6131d31557003d9f Mon Sep 17 00:00:00 2001 From: JoshuaMicallefYBSU <91457812+JoshuaMicallefYBSU@users.noreply.github.com> Date: Wed, 4 Dec 2024 11:46:42 +1000 Subject: [PATCH] JobUpdates --- app/Jobs/DiscordAccountCheck.php | 22 +++++++++++----------- app/Jobs/ProcessSessionLogging.php | 4 ++-- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/app/Jobs/DiscordAccountCheck.php b/app/Jobs/DiscordAccountCheck.php index b0351fda..efb4715a 100644 --- a/app/Jobs/DiscordAccountCheck.php +++ b/app/Jobs/DiscordAccountCheck.php @@ -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); } @@ -340,7 +340,7 @@ 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], ] ]); } @@ -348,29 +348,29 @@ public function handle() 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); } } diff --git a/app/Jobs/ProcessSessionLogging.php b/app/Jobs/ProcessSessionLogging.php index 6f020046..15bcae73 100644 --- a/app/Jobs/ProcessSessionLogging.php +++ b/app/Jobs/ProcessSessionLogging.php @@ -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 {