Auto-sync: 2026-03-03 05:00:01

This commit is contained in:
Windmill Bot
2026-03-03 05:00:01 +00:00
parent 72483e045b
commit 873d834dad
5 changed files with 77 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
export async function main(
device: string = "オフィスの右エコー",
prefix: string = "現在時刻は",
suffix: string = "です"
) {
const now = new Date();
const hhmm = new Intl.DateTimeFormat("ja-JP", {
timeZone: "Asia/Tokyo",
hour: "2-digit",
minute: "2-digit",
hour12: false,
}).format(now); // 例: 09:30
const [h, m] = hhmm.split(":");
const text = `${prefix}${Number(h)}${Number(m)}${suffix}`;
const res = await fetch("http://alexa_api:3500/speak", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ device, text }),
});
if (!res.ok) {
const body = await res.text();
throw new Error(`alexa-api error ${res.status}: ${body}`);
}
return { ok: true, device, text };
}