Fix Discord webhook URLs

This commit is contained in:
Nabeel Shahzad 2022-02-09 13:20:57 -05:00
parent cb38f2ad90
commit 9e080d544a
5 changed files with 9 additions and 4 deletions

View File

@ -24,6 +24,7 @@ use Illuminate\Support\Collection;
* @property Collection subfleets
* @property int days
* @property int distance
* @property int planned_distance
* @property int flight_time
* @property string route
* @property string dpt_time

View File

@ -31,7 +31,8 @@ class NewsAdded extends Notification implements ShouldQueue
public function toDiscordChannel($news): ?DiscordMessage
{
$dm = new DiscordMessage();
return $dm->success()
return $dm->url(setting('notifications.discord_public_webhook_url'))
->success()
->title('News: '.$news->subject)
->author([
'name' => $news->user->ident.' - '.$news->user->name_private,

View File

@ -64,7 +64,8 @@ class PirepFiled extends Notification implements ShouldQueue
}
$dm = new DiscordMessage();
return $dm->success()
return $dm->url(setting('notifications.discord_public_webhook_url'))
->success()
->title($title)
->description($pirep->user->discord_id ? 'Flight by <@'.$pirep->user->discord_id.'>' : '')
->url(route('frontend.pireps.show', [$pirep->id]))

View File

@ -110,7 +110,8 @@ class PirepStatusChanged extends Notification implements ShouldQueue
}
$dm = new DiscordMessage();
return $dm->success()
return $dm->url(setting('notifications.discord_public_webhook_url'))
->success()
->title($title)
->description($pirep->user->discord_id ? 'Flight by <@'.$pirep->user->discord_id.'>' : '')
->url(route('frontend.pireps.show', [$pirep->id]))

View File

@ -49,7 +49,8 @@ class UserRegistered extends Notification implements ShouldQueue
public function toDiscordChannel($notifiable): ?DiscordMessage
{
$dm = new DiscordMessage();
return $dm->success()
return $dm->url(setting('notifications.discord_private_webhook_url'))
->success()
->title('New User Registered: '.$this->user->ident)
->author([
'name' => $this->user->ident.' - '.$this->user->name_private,