0.0.4 • Published 1 year ago
@gramio/media-cache
Licence
MIT
Version
0.0.4
Deps
1
Size
22 kB
Vulns
0
Weekly
0
@gramio/media-cache
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();