Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Readme

A simple poe bot

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import serve, { events, forward, sleep } from "https://esm.town/v/jeffreyyoung/poe_bot?v=45";
export default serve({
async *handleMessage(req) {
yield "echo " + req.query.at(-1)?.content;
if (Math.random() > 0.5) {
yield events.error({
allow_retry: false,
text: "Something went wrong",
});
}
yield events.done();
},
settings: {
allow_attachments: true,
introduction_message: "hello",
},
});
jeffreyyoung-identicalpeachdamselfly.web.val.run
September 11, 2024