Skip to content

Commit

Permalink
Add mention about driving tranports in Search command
Browse files Browse the repository at this point in the history
  • Loading branch information
Korbeil committed May 15, 2024
1 parent c76663d commit 5655920
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/src/Discord/Command/SearchCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,11 @@ public function callback(Discord $discord): void

$content = $this->translator->trans('discord.search.intro') . "\n";
foreach ($transports as $transport) {
$content .= $this->translator->trans('discord.search.row', ['transport_id' => $transport->shortId, 'direction' => Direction::EVENT === $transport->direction ? 'From' : 'To', 'postal_code' => $transport->postalCode, 'hour' => $transport->startAt->format('H\hi'), 'date' => $transport->startAt->format('j F Y'), 'seats_remaining' => $transport->availableSeats(), 'seats_total' => $transport->seats]) . "\n";
$content .= $this->translator->trans('discord.search.row', ['transport_id' => $transport->shortId, 'direction' => Direction::EVENT === $transport->direction ? 'From' : 'To', 'postal_code' => $transport->postalCode, 'hour' => $transport->startAt->format('H\hi'), 'date' => $transport->startAt->format('j F Y'), 'seats_remaining' => $transport->availableSeats(), 'seats_total' => $transport->seats]);
if ((string) $transport->getDriver()->userId === $interaction->user->id) {
$content .= $this->translator->trans('discord.search.row_driver');
}
$content .= "\n";
}

$interaction->respondWithMessage(MessageBuilder::new()->setContent($content), true);
Expand Down
1 change: 1 addition & 0 deletions app/translations/messages+intl-icu.en.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@
],
'intro' => 'Transports found:',
'row' => '- [`{transport_id}`] {direction} {postal_code} leaving at {hour} on {date} - {seats_remaining}/{seats_total} passenger seats available',
'row_driver' => '(you are driving this transport)',
'empty' => 'No transport found.',
],
'status' => [
Expand Down
1 change: 1 addition & 0 deletions app/translations/messages+intl-icu.fr.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@
],
'intro' => 'Transports trouvés:',
'row' => '- [`{transport_id}`] {direction} {postal_code} part à {hour} le {date} - {seats_remaining}/{seats_total} places disponibles',
'row_driver' => '(vous conduisez ce transport)',
'empty' => 'Aucun transport trouvé.',
],
'status' => [
Expand Down

0 comments on commit 5655920

Please sign in to comment.