- Notifications
You must be signed in to change notification settings - Fork0
📦 Simple HTTP API for unlimited Telegram storage
License
Morb0/tgbucket
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Open source project that provide simple HTTP API to upload and download files to/from Telegram.
Use directlyMTProto protocol to upload files up to 2GB with a simple bot token.
Based onNestJS framework.
- Upload any files
- Download uploaded files
- Resend message with file
- node
- postgres
- pnpm
Deploy ready container avaiable onDockerHub
- CreateTelegram application
- Create Telegram bot withBotFather
- Install or run incontainer PostgreSQL
- Create Telegram chat for bot uploads and get chat id byguide
env | required | description |
---|---|---|
DATABASE_URL | yes | Database connection URL |
TELEGRAM_API_ID | yes | Application ID from your Telegram App |
TELEGRAM_API_HASH | yes | Application hash from your Telegram App |
TELEGRAM_BOT_TOKEN | yes | Telegram bot token |
TELEGRAM_CHAT_ID | yes | Chat ID to upload files |
Copy
.env.example
, rename to.env
and setup all variablesInstall dependencies
pnpm install
Build project
pnpm build:prod
Start application
pnpm start:prod
Open
localhost:3000
and seeok
message(default port: 3000)
Request:
Accept binary file
RequireContent-Type
andContent-Length
headers.
Optionally can be passedX-Filename
header to save filename to uploaded file. Saved file name will be used when downloading.
Max file size -2000MiB
Response:
Return JSON serializedFileEntity
Request:
Require id of uploaded file in url\
Response:
Return binary file stream withContent-Type
and timestamp in filename.OR use custom filename if wass passedX-Filename
header on upload.
Request:
Require id of uploaded file in url and JSON body:
{"peerId":"myTgUsername","message":"optional" }
Response:
Nothing
- Fork and clone this repository
- Commit your changes
- Create a pull request to
master
branch
Or, just send us anissue for reporting bugs or ask questions and share your ideas, etc indiscussions.
About
📦 Simple HTTP API for unlimited Telegram storage