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
+1 -2
View File
@@ -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
-2
View File
@@ -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"
+4 -4
View File
@@ -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
+1 -7
View File
@@ -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