Live-verify the puppet DM path and expose the backend choice

This commit is contained in:
Fisto
2026-09-16 10:53:51 +02:00
parent 9113bafe28
commit b94031d816
6 changed files with 45 additions and 12 deletions
+19
View File
@@ -95,6 +95,25 @@
});
}
}
// DMs and group DMs: the bot cannot see them, so they always use the puppet.
try {
const dms = await window.VK.api.get("/api/dms?limit=50");
for (const dm of dms ?? []) {
const names = (dm.recipients ?? [])
.map(recipient => recipient.username)
.filter(Boolean)
.join(", ");
state.channels.push({
id: dm.id,
guildId: null,
label: `${dm.name || names || "DM"} (${dm.type === 3 ? "group DM" : "DM"})`
});
}
} catch {
// no cached DMs yet
}
state.loadedChannels = true;
} catch {
state.channels = [];