1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import { receivedCommentsEmail } from "https://esm.town/v/andreterron/receivedCommentsEmail";
import process from "node:process";
import { comments as comments2 } from "https://esm.town/v/andreterron/comments";
export const receivedNewComments = async (interval: Interval) => {
const comments = await comments2({
token: process.env.vt_token,
since: interval.lastRunAt,
relationship: "received",
});
if (comments?.data?.length) {
console.email({
html: receivedCommentsEmail(comments),
}, "Val Town Comments");
}
return comments;
};