1export function myApi(name) {
2 return "hi " + name;
3}
3// Activity suggestions for when you're bored
4export let boredActivities = fetchJSON(
5 "https://www.boredapi.com/api/activity"
6);
1export function myApi(name) {
2 return "hi " + name;
3}
1export function myApi(name) {
2 return "hi " + name;
3}
8 // Verify this webhook came from our bot
9 if (
10 req.get("x-telegram-bot-api-secret-token") !==
11 process.env.telegramWebhookSecret
12 ) {
3export const telegramGetMe = async (botToken: string) =>
4 fetchJSON(
5 `https://api.telegram.org/bot${botToken}/getMe`,
6 );
3// GitHub gists
4export let githubGists = fetchJSON(
5 "https://api.github.com/users/stevekrouse/gists"
6);
2
3export let fetchBinance = (payType: string) =>
4 fetch("https://p2p.binance.com/bapi/c2c/v2/friendly/c2c/adv/search", {
5 method: "POST",
6 body: JSON.stringify({
6 id: string;
7 error?: boolean;
8 source?: ("api" | "ui" | "interval" | "email")[];
9 since?: Date;
10 until?: Date;
38}> {
39 return fetchJSON(
40 `https://api.val.town/v1/vals/${id}/runs?` +
41 searchParams({
42 error: error?.toString(),
6 const chatID = secretToTelegramChat[secret];
7 const resp = await fetch(
8 `https://api.telegram.org/bot${process.env.telegramToken}/sendMessage?chat_id=${chatID}&text=${message}`,
9 {
10 method: "POST",