Public
Script
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
1
2
3
4
5
6
7
8
9
10
11
12
import { dms } from "https://esm.town/v/me/dms";
import { verifyAPIAuth } from "https://esm.town/v/stevekrouse/verifyAPIAuth?v=13";
export async function dm(message, auth) {
let { handle, error } = await verifyAPIAuth(auth);
if (!handle)
return error;
dms.push({ handle, message });
console.email(message, `New message from @${handle}`);
return "Thanks for your message :)";
}
// Forked from @stevekrouse.dm
October 23, 2023