diff --git a/src/Notifications/Structures/Discord/StructureFuelAlert.php b/src/Notifications/Structures/Discord/StructureFuelAlert.php index cfdf2d6..cb4e4fe 100644 --- a/src/Notifications/Structures/Discord/StructureFuelAlert.php +++ b/src/Notifications/Structures/Discord/StructureFuelAlert.php @@ -71,8 +71,14 @@ public function populateMessage(DiscordMessage $message, $notifiable): void $embed->field(function (DiscordEmbedField $field) { $type = InvType::find($this->notification->text['structureShowInfoData'][1]); + + $title = 'Structure'; - $field->name('Structure') + if (! is_null($structure)) { + $title = $structure->name; + } + + $field->name($title) ->value($type->typeName); }); }) diff --git a/src/Notifications/Structures/Discord/StructureLostArmor.php b/src/Notifications/Structures/Discord/StructureLostArmor.php index 2a5ab4d..bae9d11 100644 --- a/src/Notifications/Structures/Discord/StructureLostArmor.php +++ b/src/Notifications/Structures/Discord/StructureLostArmor.php @@ -73,13 +73,16 @@ public function populateMessage(DiscordMessage $message, $notifiable): void }); $embed->field(function (DiscordEmbedField $field) { - $type = InvType::firstOrNew( - ['typeID' => $this->notification->text['structureTypeID']], - ['typeName' => trans('web::seat.unknown')] - ); + $type = InvType::find($this->notification->text['structureShowInfoData'][1]); + + $title = 'Structure'; + + if (! is_null($structure)) { + $title = $structure->name; + } - $field->name('Structure') - ->value($this->zKillBoardToDiscordLink('ship', $type->typeID, $type->typeName)); + $field->name($title) + ->value($type->typeName); }); }) ->warning(); diff --git a/src/Notifications/Structures/Discord/StructureLostShields.php b/src/Notifications/Structures/Discord/StructureLostShields.php index 87bd072..f0a3f7b 100644 --- a/src/Notifications/Structures/Discord/StructureLostShields.php +++ b/src/Notifications/Structures/Discord/StructureLostShields.php @@ -73,13 +73,16 @@ public function populateMessage(DiscordMessage $message, $notifiable): void }); $embed->field(function (DiscordEmbedField $field) { - $type = InvType::firstOrNew( - ['typeID' => $this->notification->text['structureTypeID']], - ['typeName' => trans('web::seat.unknown')] - ); + $type = InvType::find($this->notification->text['structureShowInfoData'][1]); + + $title = 'Structure'; + + if (! is_null($structure)) { + $title = $structure->name; + } - $field->name('Structure') - ->value($this->zKillBoardToDiscordLink('ship', $type->typeID, $type->typeName)); + $field->name($title) + ->value($type->typeName); }); }) ->warning(); diff --git a/src/Notifications/Structures/Discord/StructureWentHighPower.php b/src/Notifications/Structures/Discord/StructureWentHighPower.php index 1777366..da2564b 100644 --- a/src/Notifications/Structures/Discord/StructureWentHighPower.php +++ b/src/Notifications/Structures/Discord/StructureWentHighPower.php @@ -74,13 +74,16 @@ public function populateMessage(DiscordMessage $message, $notifiable): void }); $embed->field(function (DiscordEmbedField $field) { - $type = InvType::firstOrNew( - ['typeID' => $this->notification->text['structureTypeID']], - ['typeName' => trans('web::seat.unknown')] - ); + $type = InvType::find($this->notification->text['structureShowInfoData'][1]); + + $title = 'Structure'; + + if (! is_null($structure)) { + $title = $structure->name; + } - $field->name('Structure') - ->value($this->zKillBoardToDiscordLink('ship', $type->typeID, $type->typeName)); + $field->name($title) + ->value($type->typeName); }); }); } diff --git a/src/Notifications/Structures/Discord/StructureWentLowPower.php b/src/Notifications/Structures/Discord/StructureWentLowPower.php index 04e3437..84f2fca 100644 --- a/src/Notifications/Structures/Discord/StructureWentLowPower.php +++ b/src/Notifications/Structures/Discord/StructureWentLowPower.php @@ -73,13 +73,16 @@ public function populateMessage(DiscordMessage $message, $notifiable): void }); $embed->field(function (DiscordEmbedField $field) { - $type = InvType::firstOrNew( - ['typeID' => $this->notification->text['structureTypeID']], - ['typeName' => trans('web::seat.unknown')] - ); + $type = InvType::find($this->notification->text['structureShowInfoData'][1]); + + $title = 'Structure'; + + if (! is_null($structure)) { + $title = $structure->name; + } - $field->name('Structure') - ->value($this->zKillBoardToDiscordLink('ship', $type->typeID, $type->typeName)); + $field->name($title) + ->value($type->typeName); }); }); }