Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

📦 Simple HTTP API for unlimited Telegram storage

License

NotificationsYou must be signed in to change notification settings

Morb0/tgbucket

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.

Features

  • Upload any files
  • Download uploaded files
  • Resend message with file

Requirements

  • node
  • postgres
  • pnpm

Docker

Deploy ready container avaiable onDockerHub

Getting Started

Environment variables

envrequireddescription
DATABASE_URLyesDatabase connection URL
TELEGRAM_API_IDyesApplication ID from your Telegram App
TELEGRAM_API_HASHyesApplication hash from your Telegram App
TELEGRAM_BOT_TOKENyesTelegram bot token
TELEGRAM_CHAT_IDyesChat ID to upload files

Installation

  • Copy.env.example, rename to.env and setup all variables

  • Install dependencies

    pnpm install
  • Build project

    pnpm build:prod
  • Start application

    pnpm start:prod
  • Openlocalhost:3000 and seeok message(default port: 3000)

API

POST / - File upload

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

GET /:id - Download file

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.

POST /:id/resend - Send file in message

Request:
Require id of uploaded file in url and JSON body:

{"peerId":"myTgUsername","message":"optional" }

Response:
Nothing

How to Contribute

  • Fork and clone this repository
  • Commit your changes
  • Create a pull request tomaster branch

Or, just send us anissue for reporting bugs or ask questions and share your ideas, etc indiscussions.


[8]ページ先頭

©2009-2025 Movatter.jp