transitous rewrite: via

This commit is contained in:
Kaaninchen
2026-08-16 15:59:08 +02:00
parent 1b0546ff4d
commit a75b12ea31
4 changed files with 19 additions and 2 deletions
+11 -1
View File
@@ -31,8 +31,18 @@ def build_info_embed() -> discord.Embed:
color = metadata["color"]
)
stops = trip["stops"]
if len(stops) > 2:
count = min(3, len(stops))
random_stops = random.sample(list(stops), k=count)
via = ", ".join(random_stops[:-1]) + " und " + random_stops[-1]
embed.add_field(name="Über", value=via, inline=False)
route_lines = []
for stop_name, stop_arrival in trip["stops"].items():
for stop_name, stop_arrival in stops.items():
if stop_name == trip["station"]:
route_lines.append(f"**• {stop_name} ({stop_arrival} Uhr)**")
else: