mirror of
https://github.com/kaaninchen/Gleiswechsel.git
synced 2026-07-21 19:52:47 +00:00
Fix leftover state mentions
This commit is contained in:
+1
-2
@@ -20,9 +20,8 @@ def build_info_embed() -> discord.Embed | None:
|
|||||||
|
|
||||||
conn = handlers.current
|
conn = handlers.current
|
||||||
operator = operator_infos(conn["train"])
|
operator = operator_infos(conn["train"])
|
||||||
name = f"{conn['train']} nach {conn['destination']}"
|
|
||||||
embed = discord.Embed(
|
embed = discord.Embed(
|
||||||
title=name,
|
title=handlers.train_name,
|
||||||
description=f"Abfahrt von {conn['station']} um {format_timestamp(conn['departure'])}",
|
description=f"Abfahrt von {conn['station']} um {format_timestamp(conn['departure'])}",
|
||||||
color=operator["color"]
|
color=operator["color"]
|
||||||
)
|
)
|
||||||
|
|||||||
+9
-4
@@ -5,7 +5,7 @@ from src.utils import random_connection
|
|||||||
current = None
|
current = None
|
||||||
|
|
||||||
async def rename_vc(bot: discord.Bot) -> bool:
|
async def rename_vc(bot: discord.Bot) -> bool:
|
||||||
global current, name
|
global current, train_name
|
||||||
|
|
||||||
guild = bot.get_guild(int(config["server"]))
|
guild = bot.get_guild(int(config["server"]))
|
||||||
if guild is None:
|
if guild is None:
|
||||||
@@ -18,9 +18,14 @@ async def rename_vc(bot: discord.Bot) -> bool:
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
current = random_connection()
|
current = random_connection()
|
||||||
name = f"{current['train']} nach {current['destination']}"
|
|
||||||
|
|
||||||
print(f"Info: {name} from {current['station']} \n via: {current['via']}")
|
if current['train'].split()[0] == "IC" or current['train'].split()[0] == "ICE":
|
||||||
|
train = current['train']
|
||||||
|
else:
|
||||||
|
train = current['train'].split()[1]
|
||||||
|
train_name = f"{train} nach {current['destination']}"
|
||||||
|
|
||||||
await channel.edit(name=f"{config['formatting']}{name}",)
|
print(f"Info: {train_name} from {current['station']} \n via: {current['via']}")
|
||||||
|
|
||||||
|
await channel.edit(name=f"{config['formatting']}{train_name}",)
|
||||||
return True
|
return True
|
||||||
+1
-1
@@ -39,7 +39,7 @@ def operator_infos(train):
|
|||||||
return OPERATORS["fallback"]
|
return OPERATORS["fallback"]
|
||||||
|
|
||||||
train_type = train.split()[0]
|
train_type = train.split()[0]
|
||||||
|
print(train_type)
|
||||||
return OPERATORS.get(train_type, OPERATORS["fallback"])
|
return OPERATORS.get(train_type, OPERATORS["fallback"])
|
||||||
|
|
||||||
def format_via_list(via: list[str]):
|
def format_via_list(via: list[str]):
|
||||||
|
|||||||
Reference in New Issue
Block a user