Live-verify the puppet DM path and expose the backend choice
This commit is contained in:
@@ -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 = [];
|
||||
|
||||
Reference in New Issue
Block a user