From ecb55b515158da1ed47aba881c600b03c4ec9f6b Mon Sep 17 00:00:00 2001 From: JoshuaMicallefYBSU <91457812+JoshuaMicallefYBSU@users.noreply.github.com> Date: Fri, 23 Aug 2024 16:33:15 +1000 Subject: [PATCH] Update Discord Training Embeds --- app/Http/Controllers/Community/DiscordController.php | 1 + app/Http/Controllers/Training/SessionsController.php | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/Community/DiscordController.php b/app/Http/Controllers/Community/DiscordController.php index 8d36aeac..3907d57b 100644 --- a/app/Http/Controllers/Community/DiscordController.php +++ b/app/Http/Controllers/Community/DiscordController.php @@ -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(); diff --git a/app/Http/Controllers/Training/SessionsController.php b/app/Http/Controllers/Training/SessionsController.php index 4e437708..25afe592 100644 --- a/app/Http/Controllers/Training/SessionsController.php +++ b/app/Http/Controllers/Training/SessionsController.php @@ -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 get('scheduled_time'))->timestamp.':F>. @@ -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 get('new_time'))->timestamp.':F> @@ -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.