From f5873e6bfa6088d8cf1648bcc587d9cc35a42f5a Mon Sep 17 00:00:00 2001 From: JoshuaMicallefYBSU <91457812+JoshuaMicallefYBSU@users.noreply.github.com> Date: Sun, 20 Oct 2024 20:36:43 +1000 Subject: [PATCH 1/2] Nope, Try Again --- app/Console/Kernel.php | 2 +- app/Jobs/DiscordAccountCheck.php | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index df1d0ffa..3e7b8b6e 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -43,7 +43,7 @@ protected function schedule(Schedule $schedule) $schedule->job(new ProcessSessionLogging())->everyMinute(); //Inactivity checks - $schedule->job(new DiscordAccountCheck())->dailyAt('10:30'); + $schedule->job(new DiscordAccountCheck())->dailyAt('10:40'); //Inactivity checks $schedule->job(new ProcessRosterInactivity())->daily(); diff --git a/app/Jobs/DiscordAccountCheck.php b/app/Jobs/DiscordAccountCheck.php index aae0a2d9..df5f12c3 100644 --- a/app/Jobs/DiscordAccountCheck.php +++ b/app/Jobs/DiscordAccountCheck.php @@ -113,8 +113,9 @@ public function handle() $discordRoleIds = [ 'guest' => 482835389640343562, 'training' => 482824058141016075, - 'gander_certified' => 482819739996127259, - 'shanwick_certified' => 482819739996127259, + 'certified' => 482819739996127259, + 'gander_certified' => 1297507926222573568, + 'shanwick_certified' => 1297508027280396349, 'supervisor' => 720502070683369563, ]; @@ -128,6 +129,7 @@ public function handle() switch ($rosterProfile->certification) { case 'certified': array_push($rolesToAdd, $discordRoleIds['certified']); + array_push($rolesToAdd, $discordRoleIds['gander_certified']); break; case 'training': array_push($rolesToAdd, $discordRoleIds['training']); @@ -139,6 +141,7 @@ public function handle() $shanwickRoster = ShanwickController::where('controller_cid', $user->id)->first(); if ($shanwickRoster) { array_push($rolesToAdd, $discordRoleIds['certified']); + array_push($rolesToAdd, $discordRoleIds['shanwick_certified']); } //Supervisor? @@ -218,7 +221,7 @@ public function handle() $update_content .= "\n- Script Time: " . $start_time->diffForHumans($end_time, ['parts' => 2, 'short' => true, 'syntax' => Carbon::DIFF_ABSOLUTE]) . "."; - $discord->sendMessageWithEmbed(env('DISCORD_WEB_LOGS'), 'WEEKLY: Discord User Update', $update_content); + $discord->sendMessageWithEmbed(env('DISCORD_WEB_LOGS'), 'DAILY: Discord User Update', $update_content); } } From 6d6c3a20ab2f56167e55125d9402aff09c650d52 Mon Sep 17 00:00:00 2001 From: JoshuaMicallefYBSU <91457812+JoshuaMicallefYBSU@users.noreply.github.com> Date: Sun, 20 Oct 2024 20:37:26 +1000 Subject: [PATCH 2/2] Update DiscordAccountCheck.php --- app/Jobs/DiscordAccountCheck.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Jobs/DiscordAccountCheck.php b/app/Jobs/DiscordAccountCheck.php index df5f12c3..f801f0d7 100644 --- a/app/Jobs/DiscordAccountCheck.php +++ b/app/Jobs/DiscordAccountCheck.php @@ -193,10 +193,10 @@ public function handle() foreach($discord_uids as $discord_uid){ $accounts_not_linked++; //records that Account Not Linked Role Assigned - // sleep(3); + sleep(3); - // // add role - // $discord->getClient()->put('guilds/'.env('DISCORD_GUILD_ID').'/members/'.$discord_uid.'/roles/1297422968472997908'); + // add role + $discord->getClient()->put('guilds/'.env('DISCORD_GUILD_ID').'/members/'.$discord_uid.'/roles/1297422968472997908'); }