Skip to content

Commit

Permalink
Merge pull request #328 from czqoocavatsim/JoshuaBranch
Browse files Browse the repository at this point in the history
Some Little Updates
  • Loading branch information
JoshuaMicallefYBSU authored Aug 23, 2024
2 parents bbb5b89 + 2d6f132 commit ccbf602
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ protected function schedule(Schedule $schedule)
$schedule->job(new DiscordTrainingWeeklyUpdates())->weeklyOn(6, '6:00');

// Discord role updating
//$schedule->job(new UpdateDiscordUserRoles)->twiceDaily(6, 18);
$schedule->job(new UpdateDiscordUserRoles)->twiceDaily(2, 14);
}

/**
Expand Down
10 changes: 8 additions & 2 deletions app/Http/Controllers/Training/InstructingController.php
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ public function certifyStudent($cid)
}

// Unassign Instructor from Student
$instructor_link = InstructorStudentAssignment::where('student_id', $cid);
$instructor_link = InstructorStudentAssignment::where('student_id', $student->id);
$instructor_link->delete();

// Create new certification (for home page)
Expand Down Expand Up @@ -613,7 +613,7 @@ public function assignStudentToInstructor(Request $request, $student_id)
$link->save();

// Update Thread Tag
if ($student->user->hasDiscord() && $student->user->member_of_czqo) {
if ($student->user->member_of_czqo) {
$discord = new DiscordClient();
$discord->EditThreadTag('In Progress', $student->user->id);
}
Expand Down Expand Up @@ -642,6 +642,12 @@ public function dropStudentFromInstructor($student_id)
$label->delete();
}

// Update Thread Tag
if ($student->user->member_of_czqo) {
$discord = new DiscordClient();
$discord->EditThreadTag('Ready For Pick-Up', $student->user->id);
}

//Assign it with link
$link = new StudentStatusLabelLink([
'student_id' => $student->id,
Expand Down
4 changes: 2 additions & 2 deletions app/Jobs/UpdateDiscordUserRoles.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public function handle()
//Modify
$discord->guild->modifyGuildMember($arguments);

/* //Notify them if roles/nickname were change
//Notify them if roles/nickname were change
if ($user->fullName('FLC') != $guildMember->nick) {
$discord->channel->createMessage([
'channel.id' => intval($user->discord_dm_channel_id),
Expand All @@ -115,7 +115,7 @@ public function handle()
'content' => 'Hi there! Your roles on the Gander Oceanic Discord have been updated in line with your roster status. If there is a mistake, please contact the Web Team.'
]);
}
*/

//Counter!
$counter++;
}
Expand Down

0 comments on commit ccbf602

Please sign in to comment.