diff --git a/src/handlers.py b/src/handlers.py index 152af06..493c01f 100644 --- a/src/handlers.py +++ b/src/handlers.py @@ -22,7 +22,7 @@ async def rename_vc(bot: discord.Bot, scheduled = False) -> bool: current = random_connection() train_type = current['train'].split()[0] - if train_type in ("IC", "ICE", "NJ", "ES"): + if train_type in ("IC", "ICE", "NJ", "ES", "DZ"): train = current['train'] train_ID = current['train'].split()[1] else: diff --git a/src/utils.py b/src/utils.py index c855356..a13c543 100644 --- a/src/utils.py +++ b/src/utils.py @@ -15,10 +15,10 @@ def random_connection(): data = response.json() except requests.RequestException: continue - + departures = [ d for d in data.get("departures", []) - if d.get("scheduledDeparture") and d.get("destination") != station + if d.get("scheduledDeparture") and d.get("destination") != station ] if not departures: @@ -52,7 +52,6 @@ def format_via_list(via: list[str]): def get_train_info(station, train_ID, train_type): url = f"https://dbf.finalrewind.org/z/{train_type}%20{train_ID}/{station}.json" - try: response = requests.get(url) response.raise_for_status()