26 lines
570 B
TypeScript
26 lines
570 B
TypeScript
import * as dotenv from "dotenv";
|
|
import { format } from "date-fns";
|
|
|
|
import type * as types from "../types";
|
|
|
|
dotenv.config();
|
|
|
|
export default async function timeNotice() {
|
|
const now = format(new Date(), "HH:mm");
|
|
|
|
const resUeuse = await fetch(
|
|
`https://${process.env.SERVER}/api/ueuse/create`,
|
|
{
|
|
method: "POST",
|
|
body: JSON.stringify({
|
|
token: process.env.TOKEN,
|
|
text: `${now}になりました`,
|
|
}),
|
|
},
|
|
);
|
|
|
|
const ueuseData: types.ueuseCreateApi = await resUeuse.json();
|
|
|
|
console.log(JSON.stringify(ueuseData));
|
|
}
|