Skip to main content

Built and signed on GitHub Actions

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.

This package works with Node.js, Deno, BunIt is unknown whether this package works with Cloudflare Workers, Browsers
It is unknown whether this package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
It is unknown whether this package works with Browsers
JSR Score
100%
Published
8 months ago (0.0.4)

@gramio/media-cache

npm JSR JSR Score

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.

Usage

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();
Built and signed on
GitHub Actions
View transparency log

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";