move footer_notice from lang files to source code

This commit is contained in:
Kaaninchen
2026-08-23 16:09:52 +02:00
parent 10b6ee560e
commit dc2f9dade0
4 changed files with 7 additions and 16 deletions
+2 -3
View File
@@ -4,7 +4,7 @@ Gleiswechsel [ˈɡlaɪsvɛksəl] (german for "platform change") is a selfhostabl
![Example Channel](.github/preview_kanal.png) ![Example Channel](.github/preview_kanal.png)
## Features ## 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 - 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) - 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 - 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. 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 ##### 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 ```sh
22:44:47: INFO: Agency: GVB, mode: TRAM 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 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
-2
View File
@@ -4,8 +4,6 @@ channel:
train_via: "{train_name} to {goes_to} via {from_station}" train_via: "{train_name} to {goes_to} via {from_station}"
short_name: "{train_name} to {goes_to}" short_name: "{train_name} to {goes_to}"
embeds: embeds:
footer:
notice: "Data provided by https://transitous.org/sources/ • Maps (C) CARTO (C) OpenStreetMap.org contributors"
info: info:
description: "Departure from {station} at {departure}. Arrival by {arrival}" description: "Departure from {station} at {departure}. Arrival by {arrival}"
via: "via" via: "via"
+4 -4
View File
@@ -7,8 +7,8 @@ from src.lang.locales import lang
lang_embed = lang.embeds lang_embed = lang.embeds
def build_embed_footer(mode: str, slogans): def build_embed_footer(slogans):
footer_notice = f"{lang.embeds.footer.notice()} • mode: {mode}" 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" icon = "https://raw.githubusercontent.com/kaaninchen/Gleiswechsel/refs/heads/main/src/data/assets/transitous-logo.png"
if slogans is not None: if slogans is not None:
@@ -55,7 +55,7 @@ def build_info_embed() -> discord.Embed:
for field_name, field_value in route_fields: for field_name, field_value in route_fields:
embed.add_field(name=field_name, value=field_value, inline=False) 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_footer(text=footer["text"], icon_url=footer["icon"])
embed.set_author(name=agency) embed.set_author(name=agency)
@@ -78,7 +78,7 @@ def build_announcement_embed(msg):
embed.set_author(name=agency) embed.set_author(name=agency)
embed.set_thumbnail(url=metadata["logo"]) 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"]) embed.set_footer(text=footer["text"], icon_url=footer["icon"])
return embed return embed
+1 -7
View File
@@ -1,6 +1,6 @@
# generated by datamodel-codegen: # generated by datamodel-codegen:
# filename: en.yaml # filename: en.yaml
# timestamp: 2026-08-20T10:40:43+00:00 # timestamp: 2026-08-23T14:08:25+00:00
from __future__ import annotations from __future__ import annotations
@@ -19,11 +19,6 @@ class Channel:
short_name: str short_name: str
@dataclass
class Footer:
notice: str
@dataclass @dataclass
class Info: class Info:
description: str description: str
@@ -45,7 +40,6 @@ class Announcement:
@dataclass @dataclass
class Embeds: class Embeds:
footer: Footer
info: Info info: Info
announcement: Announcement announcement: Announcement