From dc2f9dade0c9ba6f419ee95abe2cd599a526eaa0 Mon Sep 17 00:00:00 2001 From: Kaaninchen <124433727+kaaninchen@users.noreply.github.com> Date: Sun, 23 Aug 2026 16:09:52 +0200 Subject: [PATCH] move footer_notice from lang files to source code --- README.md | 5 ++--- src/data/locales/en.yaml | 2 -- src/dc/embeds.py | 8 ++++---- src/lang/language_models.py | 8 +------- 4 files changed, 7 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 2cfa9ae..428886a 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Gleiswechsel [ˈɡlaɪsvɛksəl] (german for "platform change") is a selfhostabl ![Example Channel](.github/preview_kanal.png) ## Features -- [International support](https://transitous.org/sources/) for countries aswell as and cities +- [International support](https://transitous.org/sources/) for countries as well as and cities - Support for various types of transportations, including but not limited to Subways, Busses, Funiculars, Trams and Trains - Multi language support (+ option to easily add more languages) - Announcements, including the option to join the voice chat and play an audio file while arriving at a specific station @@ -122,11 +122,10 @@ For every station inside of the `stations.json` you'll find an ID. You can add t This is especially useful if you want to add a station whose name isn't unique and also used by other stations. The bot would falsely use the first station with the same name and consider it an exact match, even if you wanted a different one. This won't happen with the ID, as every ID is uniquely assigned to only one station. ##### blacklist -You can blacklist specific types of transport, the bot would then skip them while selecting a connection. You can get the type either in your console (mode) +You can blacklist specific types of transport, the bot would then skip them while selecting a connection. You can get the type in your console (mode) ```sh 22:44:47: INFO: Agency: GVB, mode: TRAM ``` -or in the `/info` embed. I highly recommend keeping `"OTHER"` blacklisted, if the API doesn't know what that is then we probably shouldn't use it. Also, it would probably a good idea to keep `"RIDE_SHARING"` blacklisted as they have weird timetables diff --git a/src/data/locales/en.yaml b/src/data/locales/en.yaml index 9f108ec..da7afa6 100644 --- a/src/data/locales/en.yaml +++ b/src/data/locales/en.yaml @@ -4,8 +4,6 @@ channel: train_via: "{train_name} to {goes_to} via {from_station}" short_name: "{train_name} to {goes_to}" embeds: - footer: - notice: "Data provided by https://transitous.org/sources/ • Maps (C) CARTO (C) OpenStreetMap.org contributors" info: description: "Departure from {station} at {departure}. Arrival by {arrival}" via: "via" diff --git a/src/dc/embeds.py b/src/dc/embeds.py index b43e001..34f90a8 100644 --- a/src/dc/embeds.py +++ b/src/dc/embeds.py @@ -7,8 +7,8 @@ from src.lang.locales import lang lang_embed = lang.embeds -def build_embed_footer(mode: str, slogans): - footer_notice = f"{lang.embeds.footer.notice()} • mode: {mode}" +def build_embed_footer(slogans): + footer_notice = f"https://transitous.org/sources/ • Maps (C) CARTO (C) OpenStreetMap.org contributors" icon = "https://raw.githubusercontent.com/kaaninchen/Gleiswechsel/refs/heads/main/src/data/assets/transitous-logo.png" if slogans is not None: @@ -55,7 +55,7 @@ def build_info_embed() -> discord.Embed: for field_name, field_value in route_fields: embed.add_field(name=field_name, value=field_value, inline=False) - footer = build_embed_footer(trip["mode"], metadata["slogans"]) + footer = build_embed_footer(metadata["slogans"]) embed.set_footer(text=footer["text"], icon_url=footer["icon"]) embed.set_author(name=agency) @@ -78,7 +78,7 @@ def build_announcement_embed(msg): embed.set_author(name=agency) embed.set_thumbnail(url=metadata["logo"]) - footer = build_embed_footer(trip["mode"], metadata.get("slogan")) + footer = build_embed_footer(metadata.get("slogan")) embed.set_footer(text=footer["text"], icon_url=footer["icon"]) return embed diff --git a/src/lang/language_models.py b/src/lang/language_models.py index 6dd2c6e..51b61c9 100644 --- a/src/lang/language_models.py +++ b/src/lang/language_models.py @@ -1,6 +1,6 @@ # generated by datamodel-codegen: # filename: en.yaml -# timestamp: 2026-08-20T10:40:43+00:00 +# timestamp: 2026-08-23T14:08:25+00:00 from __future__ import annotations @@ -19,11 +19,6 @@ class Channel: short_name: str -@dataclass -class Footer: - notice: str - - @dataclass class Info: description: str @@ -45,7 +40,6 @@ class Announcement: @dataclass class Embeds: - footer: Footer info: Info announcement: Announcement