Media cache
plugin for GramIO.
This plugin caches the sent file_id
's and prevents files from being uploaded again.
Currently, sendMediaGroup is not cached.
import { Bot } from "gramio"; import { mediaCache } from "@gramio/media-cache"; const bot = new Bot(process.env.token!) .extend(mediaCache()) .command("start", async (context) => { return context.sendDocument( MediaUpload.url( "https://raw.githubusercontent.com/gramiojs/types/main/README.md" ) ); }) .onStart(console.log); bot.start();
Add Package
deno add jsr:@gramio/media-cache
Import symbol
import * as media_cache from "@gramio/media-cache";
---- OR ----
Import directly with a jsr specifier
import * as media_cache from "jsr:@gramio/media-cache";
Add Package
npx jsr add @gramio/media-cache
Import symbol
import * as media_cache from "@gramio/media-cache";
Add Package
yarn dlx jsr add @gramio/media-cache
Import symbol
import * as media_cache from "@gramio/media-cache";
Add Package
pnpm dlx jsr add @gramio/media-cache
Import symbol
import * as media_cache from "@gramio/media-cache";
Add Package
bunx jsr add @gramio/media-cache
Import symbol
import * as media_cache from "@gramio/media-cache";