fix: shorten channel name if it's too long for discords limit

This commit is contained in:
Kaaninchen
2026-08-20 13:22:14 +02:00
parent 999fe141b9
commit 054ab7fc42
8 changed files with 25 additions and 16 deletions
+2 -6
View File
@@ -30,11 +30,7 @@ async def rename_vc(bot: discord.Bot, voice_channel, from_scheduler: bool = Fals
generate_static_map(trip["stops"], trip["mode"], trip["agency"], trip["route_color"])
arrival = trip["arrival"]
if len(trip["long_name"]) >= 100:
channel_name = trip["short_name"]
else:
channel_name = trip["long_name"]
channel_name = trip["channel_name"]
mode = trip["mode"]
@@ -156,7 +152,7 @@ async def _update_next_loop(voice_channel: discord.VoiceChannel):
wait_seconds = (next_stop["arrival"] - datetime.now(LOCAL_TZ)).total_seconds()
if wait_seconds > 0:
await (wait_seconds)
await asyncio.sleep(wait_seconds)
except asyncio.CancelledError:
raise