Skip to content

Commit

Permalink
Merge pull request #327 from czqoocavatsim/JoshuaBranch
Browse files Browse the repository at this point in the history
Update Discord Training Embeds
  • Loading branch information
JoshuaMicallefYBSU authored Aug 23, 2024
2 parents 0dda15c + ecb55b5 commit bbb5b89
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions app/Http/Controllers/Community/DiscordController.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ public function linkCallbackDiscord(Request $request)
//Edit user
$user->discord_user_id = $discord_user['id'];
$user->discord_username = $discord_user['username'];
$user->member_of_czqo = true;
$user->discord_avatar = $discord_user['avatar'] ? 'https://cdn.discordapp.com/avatars/'.$discord_user['id'].'/'.$discord_user['avatar'].'.png' : null;
$user->save();

Expand Down
6 changes: 3 additions & 3 deletions app/Http/Controllers/Training/SessionsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function createTrainingSession(Request $request)

//Discord Notification in Training Thread
$discord = new DiscordClient();
$discord->sendEmbedInTrainingThread($session->student->user->fullName('FLC'), 'Training Session Booked',
$discord->sendEmbedInTrainingThread($session->student->user->id, 'Training Session Booked',
'Hello, '. $session->student->user->fullName('F').'!
A training session has been created for you on <t:'.Carbon::parse($request->get('scheduled_time'))->timestamp.':F>.
Expand Down Expand Up @@ -136,7 +136,7 @@ public function editTrainingSessionTime(Request $request, $session_id)

//Discord Notification in Training Thread
$discord = new DiscordClient();
$discord->sendEmbedInTrainingThread($session->student->user->fullName('FLC'), 'Training Session Time Changed',
$discord->sendEmbedInTrainingThread($session->student->user->id, 'Training Session Time Changed',
'Hello, '. $session->student->user->fullName('F').'!
A training session time has been updated. The new time is now <t:'.Carbon::parse($request->get('new_time'))->timestamp.':F>
Expand Down Expand Up @@ -238,7 +238,7 @@ public function cancelTrainingSession(Request $request, $session_id)

//Discord Notification in Training Thread
$discord = new DiscordClient();
$discord->sendEmbedInTrainingThread($session->student->user->fullName('FLC'), 'Training Session Cancelled',
$discord->sendEmbedInTrainingThread($session->student->user->id, 'Training Session Cancelled',
'Hello, '. $session->student->user->fullName('F').'!
A training session which was planned has been cancelled.
Expand Down

0 comments on commit bbb5b89

Please sign in to comment.