GramIO API Reference / @gramio/files/dist / FileSource
Type Alias: FileSource
FileSource =
"auto"|"url"|"disk"|"rewrite"| ((file) =>Promise<ArrayBuffer> |ArrayBuffer)
Defined in: files/index.d.ts:216
Strategy for how downloadFile obtains file bytes — mainly relevant with a local Bot API server (--local), where getFile returns an absolute path on the server's disk instead of a URL.
"auto"(default) — absolutefile_path→baseURLrewrite if set, else read from disk; relativefile_path→ classic download URL."url"— classic<baseURL>/file/bot<token>/<path>download."disk"— read the absolutefile_pathstraight from the local filesystem."rewrite"— fetch${files.baseURL}/<relative path>over HTTP (token-less).- a function — full custom resolution.