@gramio/media-cache
TypeScript icon, indicating that this package has built-in type declarations

0.0.4 • Public • Published

@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();

Package Sidebar

Install

npm i @gramio/media-cache

Weekly Downloads

67

Version

0.0.4

License

MIT

Unpacked Size

22.1 kB

Total Files

7

Last publish

Collaborators

  • skravets