diff --git a/app/Jobs/ProcessSessionLogging.php b/app/Jobs/ProcessSessionLogging.php index b5247aca..4b068324 100644 --- a/app/Jobs/ProcessSessionLogging.php +++ b/app/Jobs/ProcessSessionLogging.php @@ -72,10 +72,10 @@ public function handle() if($session->discord_id == null){ $discord = new DiscordClient(); $discord_id = $discord->ControllerConnection($controller->callsign, $name); - } - $session->discord_id = $discord_id; - $session->save(); + $session->discord_id = $discord_id; + $session->save(); + } array_push($positionsFound, $controller->callsign); } diff --git a/app/Models/Network/SessionLog.php b/app/Models/Network/SessionLog.php index 26e7fc0b..3f0f043a 100644 --- a/app/Models/Network/SessionLog.php +++ b/app/Models/Network/SessionLog.php @@ -53,7 +53,7 @@ class SessionLog extends Model public function user() { - return $this->belongsTo(User::class); + return $this->belongsTo(User::class, 'cid', 'id'); } public function position() diff --git a/app/Services/DiscordClient.php b/app/Services/DiscordClient.php index 248486f1..f1ea5649 100644 --- a/app/Services/DiscordClient.php +++ b/app/Services/DiscordClient.php @@ -63,11 +63,11 @@ public function ControllerConnection($callsign, $name) "tts" => false, "embeds" => [ [ - 'title' => $callsign.' Just Connected!', - 'description' => 'A new controller has just connected to the network! + 'title' => $callsign.' is currently online!', + 'description' => 'There is currently ATC being provided over the Ocean! -Controller Name: '.$name.' -Online from: timestamp.':t>', +**Controller:** '.$name.' +**Online from:** timestamp.':t>', 'color' => hexdec('6EC40C'), ] ]