Skip to content

Commit

Permalink
Fix discord notifications (#96)
Browse files Browse the repository at this point in the history
* Fix discord moon mining notifications while import missing

* Fix discord sov notifications while solar system loaded instead of MapDenormalize item.
  • Loading branch information
zenobio93 authored Jan 30, 2024
1 parent 3a1952e commit 77150a7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

use Seat\Eveapi\Models\Character\CharacterNotification;
use Seat\Eveapi\Models\Sde\InvType;
use Seat\Eveapi\Models\Sde\SolarSystem;
use Seat\Eveapi\Models\Sde\MapDenormalize;
use Seat\Notifications\Notifications\AbstractDiscordNotification;
use Seat\Notifications\Services\Discord\Messages\DiscordEmbed;
use Seat\Notifications\Services\Discord\Messages\DiscordEmbedField;
Expand Down Expand Up @@ -68,7 +68,7 @@ public function populateMessage(DiscordMessage $message, $notifiable)
$embed->author('SeAT Sovereignty Health', asset('web/img/favico/apple-icon-180x180.png'));

$embed->field(function (DiscordEmbedField $field) {
$system = SolarSystem::find($this->notification->text['solarSystemID']);
$system = MapDenormalize::find($this->notification->text['solarSystemID']);

$field->name('System')
->value(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
namespace Seat\Notifications\Notifications\Sovereignties\Discord;

use Seat\Eveapi\Models\Character\CharacterNotification;
use Seat\Eveapi\Models\Sde\SolarSystem;
use Seat\Eveapi\Models\Sde\MapDenormalize;
use Seat\Notifications\Notifications\AbstractDiscordNotification;
use Seat\Notifications\Services\Discord\Messages\DiscordEmbed;
use Seat\Notifications\Services\Discord\Messages\DiscordEmbedField;
Expand Down Expand Up @@ -67,12 +67,12 @@ public function populateMessage(DiscordMessage $message, $notifiable)
$embed->author('SeAT Sovereignty Health', asset('web/img/favico/apple-icon-180x180.png'));

$embed->field(function (DiscordEmbedField $field) {
$system = SolarSystem::find($this->notification->text['solarSystemID']);
$system = MapDenormalize::find($this->notification->text['solarSystemID']);

$field->name('System')
->value($this->zKillBoardToDiscordLink(
'system',
$system->itemID,
$system->itemId,
sprintf('%s (%s)', $system->itemName, number_format($system->security, 2))));
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@

namespace Seat\Notifications\Notifications\Structures\Traits;

use Seat\Eveapi\Models\Sde\InvType;

trait MoonMiningNotificationTrait
{
const GAZ_MARKET_GROUP_ID = 2396;
Expand Down

0 comments on commit 77150a7

Please sign in to comment.