From 5c53850cbf7487f22bb76920d34c7e6fa6e579de Mon Sep 17 00:00:00 2001 From: Logan Cusano Date: Mon, 5 Oct 2026 00:38:58 -0400 Subject: [PATCH] Discord admin Add form: say so when the system already plays in that channel (#213) Re-adding the same system to a voice channel returns the running stream untouched (already_on). The form closed as if a stream had been added and the new label/bot was silently dropped; it now stays open and explains. Co-Authored-By: Claude Opus 5.5 --- drb-frontend/components/discord/StreamsPanel.tsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drb-frontend/components/discord/StreamsPanel.tsx b/drb-frontend/components/discord/StreamsPanel.tsx index bf05d9e..1fe4121 100644 --- a/drb-frontend/components/discord/StreamsPanel.tsx +++ b/drb-frontend/components/discord/StreamsPanel.tsx @@ -71,7 +71,7 @@ function AddChannelForm({ setSaving(true); setError(null); try { - await c2api.startDiscordStream({ + const res = await c2api.startDiscordStream({ guild_id: guildId, channel_id: channelId.trim(), system_id: systemId, @@ -79,6 +79,16 @@ function AddChannelForm({ channel_name: channelName.trim() || undefined, preferred_token_id: botId || undefined, }); + if (res?.already_on) { + // Same system re-added to a channel that already plays it: c2-core + // returns that stream untouched (label, mode and bot kept). Say so + // instead of closing as if a stream had been added. + setError({ + message: `${res.system_name || "That system"} is already playing in this voice channel, so nothing was added or changed. Pick another system to add a second stream, or Remove the existing row to change its label or bot.`, + invite: [], + }); + return; + } onDone(); } catch (err) { setError(parseC2Error(err));