Module

x/grammy/platform.deno.ts

The Telegram Bot Framework.
Go to Latest
File
/** Are we running on Deno or in a web browser? */export const isDeno = typeof Deno !== "undefined";
// === Export all API typesexport * from "https://esm.sh/@grammyjs/types@2.8.2";
// === Export debugimport d from "https://cdn.skypack.dev/debug@4.3.4";export { d as debug };const DEBUG = "DEBUG";if (isDeno) { d.useColors = () => !Deno.noColor; const env = { name: "env", variable: DEBUG } as const; const res = await Deno.permissions.query(env); if (res.state === "granted") { const val = Deno.env.get(DEBUG); if (val) d.enable(val); }}
// === Export system-specific operations// Turn an AsyncIterable<Uint8Array> into a streamexport { readableStreamFromIterable as itrToStream } from "https://deno.land/std@0.150.0/streams/mod.ts";
// === Base configuration for `fetch` callsexport const baseFetchConfig = (_apiRoot: string) => ({});
// === InputFile handling and File augmenting// Accessor for file data in `InputFile` instancesexport const toRaw = Symbol("InputFile data");