1import process from "node:process";
2import { discordAPI } from "https://esm.town/v/joey/discordAPI";
3
4// add the bot to your server before calling:
8// await @joey.sendDiscordMessage('some-channel-id', 'hello world!');
9export const sendDiscordMessage = (channelId: string, message: string) =>
10 discordAPI({
11 path: `/channels/${channelId}/messages`,
12 method: "POST",
4export let boredActivities = async () => {
5 const { activity } = await fetchJSON(
6 "https://www.boredapi.com/api/activity",
7 );
8 return activity;
1export function myApi(name) {
2 return "hi " + name;
3}
1export function myApi(name) {
2 return "hi " + name;
3}
58 </div>
59
60 <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
61 <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
62</body>
1export function myApi(name) {
2 return "hi " + name;
3}
3export async function TodayForTyler(req: express.Request, res: express.Response) {
4 const { activity } = await fetchJSON(
5 "https://www.boredapi.com/api/activity",
6 );
7 return res.send(`
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function fetchFigmaFile(apiToken, fileKey) {
4 const url = `https://api.figma.com/v1/files/${fileKey}`;
5 const response = await fetch(url, {
6 headers: {
7 "X-FIGMA-TOKEN": apiToken,
8 },
9 });
1export function myApi(name) {
2 return "hi " + name;
3}
1export function myApi(name) {
2 return "hi " + name;
3}