Comando /agy:vocal per toggle feedback vocale + template aggiornato
This commit is contained in:
@@ -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
|
||||
// =========================================================================
|
||||
|
||||
Reference in New Issue
Block a user