Something went wrong. Try again.
Schedule posts and reposts to Bluesky (and other PDSes) with Cloudflare workers. skyscheduler.work
scheduling social-media cloudflare bsky service cloudflare-workers bsky-tool bluesky
Something went wrong. Try again.
764 B · 26 lines
TypeScript
at main
123456789101112131415161718192021222324252627/* eslint-disable @typescript-eslint/no-explicit-any */import type { ExecutionContext } from "hono";import { getDrizzle } from "../utils/db/get";
export class ScheduledContext { executionCtx: ExecutionContext; env: Env; // used for parameters wrappings such as "isAdmin" or "session" // as a proxy for Context #map: Map<string, any>; constructor(env: Env, executionCtx: ExecutionContext) { this.#map = new Map<string, any>(); this.env = env; this.executionCtx = executionCtx; this.set("db", getDrizzle(env.DB)); this.set("ssg", false); } get(name: string): any { if (this.#map.has(name)) return this.#map.get(name); return null; } set(name: string, value: any): void { this.#map.set(name, value); }}