Fix await TypeError in do_end_session and show lastError in status summary
This commit is contained in:
parent
ff11dd7ebd
commit
74f701fb04
1 changed files with 4 additions and 1 deletions
|
|
@ -50,6 +50,9 @@ def format_watch_party_summary(payload: dict[str, Any]) -> str:
|
||||||
f"Status: `{session.get('status', 'unknown')}`",
|
f"Status: `{session.get('status', 'unknown')}`",
|
||||||
f"Worker: `{worker.get('workerStatus', 'idle')}` · Playback: `{worker.get('playbackState', 'idle')}`",
|
f"Worker: `{worker.get('workerStatus', 'idle')}` · Playback: `{worker.get('playbackState', 'idle')}`",
|
||||||
]
|
]
|
||||||
|
last_error = str(worker.get("lastError", "") or "").strip()
|
||||||
|
if last_error:
|
||||||
|
lines.append(f"Error: `{last_error}`")
|
||||||
current_title = str(worker.get("currentTitle", "") or "").strip()
|
current_title = str(worker.get("currentTitle", "") or "").strip()
|
||||||
if current_title:
|
if current_title:
|
||||||
lines.append(f"Now playing: `{current_title}`")
|
lines.append(f"Now playing: `{current_title}`")
|
||||||
|
|
@ -387,7 +390,7 @@ class DiscordGatewayManager:
|
||||||
|
|
||||||
async def do_end_session(interaction: Any) -> None:
|
async def do_end_session(interaction: Any) -> None:
|
||||||
session = ensure_session(interaction, create_if_missing=False)
|
session = ensure_session(interaction, create_if_missing=False)
|
||||||
await end_watch_party_session(int(session["id"]))
|
end_watch_party_session(int(session["id"]))
|
||||||
await respond(
|
await respond(
|
||||||
interaction,
|
interaction,
|
||||||
f"Ended the watch-party session `{session['title']}`.",
|
f"Ended the watch-party session `{session['title']}`.",
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue