Comando /agy:vocal per toggle feedback vocale + template aggiornato

This commit is contained in:
dev
2026-08-09 23:20:22 +02:00
parent 0807660212
commit 1c1a175512
2 changed files with 36 additions and 0 deletions
+35
View File
@@ -1266,6 +1266,41 @@ export default function agyExtension(pi: ExtensionAPI) {
},
});
pi.registerCommand("agy:vocal", {
description: "Attiva/disattiva il feedback vocale TTS. Uso: /agy:vocal [on|off|status]",
handler: async (args, ctx) => {
const arg = (args ?? "").trim().toLowerCase();
const current = getConfig("ttsNotify") ?? "true";
if (arg === "on") {
setConfig("ttsNotify", "true");
ctx.ui.notify("🔊 Feedback vocale ATTIVATO", "info");
ttsSpeak("Feedback vocale attivato.").catch(() => {});
return;
}
if (arg === "off") {
setConfig("ttsNotify", "false");
ctx.ui.notify("🔇 Feedback vocale DISATTIVATO", "info");
return;
}
if (arg === "status" || !arg) {
const on = current !== "false";
ctx.ui.notify(on ? "🔊 Feedback vocale: ATTIVO" : "🔇 Feedback vocale: DISATTIVO", "info");
return;
}
// toggle
if (current === "false") {
setConfig("ttsNotify", "true");
ctx.ui.notify("🔊 Feedback vocale ATTIVATO", "info");
ttsSpeak("Feedback vocale attivato.").catch(() => {});
} else {
setConfig("ttsNotify", "false");
ctx.ui.notify("🔇 Feedback vocale DISATTIVATO", "info");
}
},
});
// =========================================================================
// Comando: /agy:config — gestione configurazione persistente
// =========================================================================