Skip to content

Commit

Permalink
Merge pull request #352 from czqoocavatsim/JoshuaBranch
Browse files Browse the repository at this point in the history
Update DiscordTrainingWeeklyUpdates.php
  • Loading branch information
JoshuaMicallefYBSU authored Oct 17, 2024
2 parents 7c6e009 + 07cc3f8 commit ea7694b
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions app/Jobs/DiscordTrainingWeeklyUpdates.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ public function handle()
$threads_activated["names"][] = $thread['name'];

// Thread should be active, so lets activate it.
$discord = new DiscordClient();
$data = $discord->getClient()->patch('channels/'.$thread['id'], [
'json' => [
'locked' => false,
Expand All @@ -93,9 +92,6 @@ public function handle()

// Function for Training Thread Availability Updates
{
// Initialize the DiscordClient inside the handle method
$discord = new DiscordClient();

// Get Active Threads
$response = $discord->getClient()->get('guilds/'.env('DISCORD_GUILD_ID').'/threads/active');
$all_threads2 = json_decode($response->getBody(), true);
Expand Down Expand Up @@ -217,9 +213,6 @@ public function handle()

//Discord Updates
if ($s->user->hasDiscord() && $s->user->member_of_czqo) {
//Get Discord client
$discord = new DiscordClient();

//remove student discord role
$discord->removeRole($s->user->discord_user_id, 482824058141016075);

Expand All @@ -232,9 +225,6 @@ public function handle()
$discord->sendMessageWithEmbed(config('app.env') == 'local' ? intval(config('services.discord.web_logs')) : intval(config('services.discord.instructors')), 'Training Terminated', $s->user->fullName('FLC').' has had their training terminated. `Exam not completed within 60 days.`', 'error');

} else {
//Get Discord client
$discord = new DiscordClient();

// Notify Senior Team that training has been terminated
$discord->sendMessageWithEmbed(config('app.env') == 'local' ? intval(config('services.discord.web_logs')) : intval(config('services.discord.instructors')), 'Training Terminated', $s->user->fullName('FLC').' has had their training terminated. `Exam not completed within 60 days.`', 'error');
}
Expand Down

0 comments on commit ea7694b

Please sign in to comment.