1import { type WriterOptions } from "https://esm.town/v/nbbaier/WriterOptions";
2import { fetch } from "https://esm.town/v/std/fetch?v=4";
3import OpenAI, { type ClientOptions } from "npm:openai";
4
32 private async getVal(username: string, valName: string) {
33 try {
34 const res = await fetch(`https://api.val.town/v1/alias/${username}/${valName}`, {
35 method: "GET",
36 headers: {
72 private async updateReadme(id: string, readme: string) {
73 try {
74 const res = await fetch(`https://api.val.town/v1/vals/${id}`, {
75 method: "PUT",
76 headers: {
151 fillBlank: FILL_BLANK,
152 quiz: QUIZ,
153 fetchHtml: (email: string, lesson: number) =>
154 generateLessonHtml({
155 email,
43 replyTo: "pete@petemillspaugh.com",
44 subject: `Lesson ${nextLesson + 1}: ${lessons[nextLesson].title}`,
45 html: lessons[nextLesson].fetchHtml(emailAddress, nextLesson),
46 });
47 }
26 replyTo: "pete@petemillspaugh.com",
27 subject: `Lesson ${lesson + 1}: ${lessons[lesson].title}`,
28 html: lessons[lesson].fetchHtml(emailAddress, lesson),
29 });
30}
61 fillBlank: FILL_BLANK,
62 quiz: QUIZ,
63 fetchHtml: (email: string, lesson: number) =>
64 generateLessonHtml({
65 email,
82 fillBlank: FILL_BLANK,
83 quiz: QUIZ,
84 fetchHtml: (email: string, lesson: number) =>
85 generateLessonHtml({
86 email,
31 fillBlank: FILL_BLANK,
32 quiz: QUIZ,
33 fetchHtml: (email: string, lesson: number) =>
34 generateLessonHtml({
35 email,
61 fillBlank: FILL_BLANK,
62 quiz: QUIZ,
63 fetchHtml: (email: string, lesson: number) =>
64 generateLessonHtml({
65 email,
42 fillBlank: FILL_BLANK,
43 quiz: QUIZ,
44 fetchHtml: (email: string, lesson: number) =>
45 generateLessonHtml({
46 email,
52 fillBlank: FILL_BLANK,
53 quiz: QUIZ,
54 fetchHtml: (email: string, lesson: number) =>
55 generateLessonHtml({
56 email,