diff --git a/main.py b/main.py index 3cad824..638ffb6 100644 --- a/main.py +++ b/main.py @@ -7,7 +7,6 @@ from src.commands import setup_commands from src.embeds import build_error_embed from src.data.status import discord_status - bot = discord.Bot(intents=discord.Intents.all()) setup_commands(bot) @@ -28,7 +27,6 @@ async def on_application_command_error(ctx, error): embed = build_error_embed(f"Ein Fehler ist aufgetreten: {error}") await ctx.respond(embed=embed) - try: bot.run(config['token']) except: diff --git a/src/embeds.py b/src/embeds.py index c3fab8a..204a177 100644 --- a/src/embeds.py +++ b/src/embeds.py @@ -20,6 +20,7 @@ def build_info_embed() -> discord.Embed | None: conn = handlers.current operator = operator_infos(conn["train"]) + embed = discord.Embed( title=handlers.train_name, description=f"Abfahrt von {conn['station']} um {format_timestamp(conn['departure'])}", @@ -29,7 +30,14 @@ def build_info_embed() -> discord.Embed | None: if len(conn['via']) > 0: embed.add_field(name="Über", value=format_via_list(conn['via']), inline=False) - embed.set_author(name=operator["name"]) + if operator["name"] == "Unbekannter Anbieter": + anbieter = conn['train'].split()[0] + print(f"INFO: Unbekannter Anbieter für Typ {anbieter}") + operator_name = f"{operator['name']} (Typ: {anbieter})" + else: + operator_name = operator["name"] + + embed.set_author(name=operator_name) embed.set_thumbnail(url=operator["logo"]) route_lines = [] diff --git a/src/handlers.py b/src/handlers.py index 7c85a7a..0402d99 100644 --- a/src/handlers.py +++ b/src/handlers.py @@ -25,7 +25,6 @@ async def rename_vc(bot: discord.Bot) -> bool: train = current['train'].split()[1] train_name = f"{train} nach {current['destination']}" - print(f"Info: {train_name} from {current['station']} \n via: {current['via']}") - + print(f"Umstieg: {train_name} von {current['station']} \nüber: {current['via']}") await channel.edit(name=f"{config['formatting']}{train_name}",) return True \ No newline at end of file diff --git a/src/utils.py b/src/utils.py index 5ec9615..8a1a952 100644 --- a/src/utils.py +++ b/src/utils.py @@ -39,7 +39,6 @@ def operator_infos(train): return OPERATORS["fallback"] train_type = train.split()[0] - print(train_type) return OPERATORS.get(train_type, OPERATORS["fallback"]) def format_via_list(via: list[str]):