const CAMPSITE_API_KEY = Deno.env.get("CAMPBOT_API_KEY");
const DAILY_UPDATES_PROJECT_ID = "izu9x0b54xy2";
const MEMBERS = [
"3her0vv6fb75",
"mqssgn0wm7so",
"ntodpqcg879d",
"zwvznmxcpiel",
"el8fwvr2jttt",
];
const MENTIONS = MEMBERS.map((id) => `<@${id}>`).join(" ");
const CONTENT = `What did you work on today?\n\n${MENTIONS}`;
export default async function(interval: Interval) {
const title = new Date().toLocaleDateString("en-US", {
month: "long",
day: "numeric",
year: "numeric",
});
const body = {
title,
content_markdown: CONTENT,
project_id: DAILY_UPDATES_PROJECT_ID,
};
const campsiteResponse = await fetch("https://api.campsite.com/v2/posts", {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${CAMPSITE_API_KEY}`,
},
body: JSON.stringify(body),
});
}