diff --git a/src/api/transitous.py b/src/api/transitous.py index 14b14a7..09f1855 100644 --- a/src/api/transitous.py +++ b/src/api/transitous.py @@ -92,7 +92,7 @@ def get_random_connection(stop_id: str) -> str | None: if not trip_ids: logger("Couldn't find any connection", "error") return None - + print(trip_ids) trip_id = random.choice(trip_ids) from_station = None diff --git a/src/data/emojis.py b/src/data/emojis.py index 4238dfe..f5f8827 100644 --- a/src/data/emojis.py +++ b/src/data/emojis.py @@ -5,6 +5,7 @@ emoji_list = { "TRAM": "🚈", "REGIONAL_RAIL": "🚊", "HIGHSPEED_RAIL": "🚅", + "LONG_DISTANCE": "🚅", "METRO": "🚇", "SUBWAY": "🚇" } \ No newline at end of file diff --git a/src/data/operators.py b/src/data/operators.py index 6dc3a9f..5a09541 100644 --- a/src/data/operators.py +++ b/src/data/operators.py @@ -98,6 +98,10 @@ OPERATORS = { "enno": { "logo": "https://upload.wikimedia.org/wikipedia/commons/thumb/a/a5/Enno_logo.svg/960px-Enno_logo.svg.png", "color": 0x88216F + }, + "DSB": { + "logo": "https://upload.wikimedia.org/wikipedia/commons/thumb/8/87/DSB_company_logo.svg/960px-DSB_company_logo.svg.png", + "color": 0xB22B32 } } @@ -111,10 +115,12 @@ OPERATOR_ALIASES = { "DB Regio AG NRW": OPERATORS["db_allgemein"], "DB Regio AG Südost": OPERATORS["db_allgemein"], "DB Regio AG Nordost": OPERATORS["db_allgemein"], + "DB Regio AG Nord": OPERATORS["db_allgemein"], "DB Regio AG Mitte": OPERATORS["db_allgemein"], "NS International": OPERATORS["NS"], "SBB GmbH": OPERATORS["SBB"], "Schweizerische Bundesbahnen SBB": OPERATORS["SBB"], + "Dänische Staatsbahnen": OPERATORS["DSB"] } diff --git a/src/dc/embeds.py b/src/dc/embeds.py index b2b4db7..854388a 100644 --- a/src/dc/embeds.py +++ b/src/dc/embeds.py @@ -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: