1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export function discordMessages({ botToken, channelId }) {
4 return fetchJSON(
5 `https://discord.com/api/channels/${channelId}/messages`,
18 //
19 // Note 1: If I referenced @stevekrouse.threadsafeStateEx here
20 // it would return the value of that val at the beginning of this function,
21 // before I acquired the lock. I fetch it's value now to get the most up-to-date
22 // value of it, now that I know it can't be updated until I release this lock.
1export function myApi(name) {
2 return "hi " + name;
3}
1export function myApi(name) {
2 return "hi " + name;
3}
1export function myApi(name) {
2 return "hi " + name;
3}
1export function test() {
2 return new Date();
3}
5import { stopDeparturesCache } from "https://esm.town/v/kognise/stopDeparturesCache";
6
7export async function stopDepartures(globalStopId: string) {
8 const cached = stopDeparturesCache[globalStopId];
9 if (cached && Date.now() - cached.time < transitCacheExpiry) {
2let { nameList } = await import("https://esm.town/v/acmu/nameList");
3
4export async function myApiAdd(name) {
5 if (Array.isArray(nameList)) {
6 nameList.push(name);
1export function myApi(name) {
2 return "hi " + name;
3}
1export function myApi(name) {
2 return "hi " + name;
3}
A helper function to build a file's email
Simple functional CSS library for Val Town
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.
import { OpenAI } from "https://esm.town/v/std/openai";
export default async function(req: Request): Promise<Response> {
if (req.method === "OPTIONS") {
return new Response(null, {
headers: {
"Access-Control-Allow-Origin": "*",