MCPcopy Index your code
hub / github.com/csznet/tgState

github.com/csznet/tgState @v1.4.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.4.1 ↗ · + Follow
15 symbols 42 edges 6 files 2 documented · 13%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

tgState

==

中文

A file external link system using Telegram as storage.

No restrictions on file size and format.

Can be used as a Telegram image hosting service or a Telegram cloud drive.

Supports web and Telegram direct file uploads.

Use with CloudFlare: https://github.com/csznet/tgState/blob/main/CloudFlare.md

For any questions, consult TG @tgstate123

Demo

https://tgstate.vercel.app / https://tgstate.ikun123.com/

Hosted on Vercel, resource limitations - files larger than 5MB are not supported.

Demo image:

tgState

Parameter Description

Mandatory parameters:

  • target
  • token

Optional parameters:

  • pass
  • mode
  • url
  • port

target

The target can be a channel, group, or individual.

When the target is a channel, the bot needs to be added to the channel as an administrator, make the channel public, and customize the channel link. The target value should be filled with the link, such as @xxxx.

When the target is a group, the bot needs to be added to the group, make the group public, and customize the group link. The target value should be filled with the link, such as @xxxx.

When the target is an individual, it is the Telegram ID (obtained from @getmyid_bot).

token

Fill in your bot token.

pass

Fill in the access password. If not needed, fill in none directly.

mode

  • p represents running in cloud drive mode, with no restriction on uploaded suffixes.
  • m On top of the p mode, web upload is disabled, and upload can be done via private chat (if the target is an individual, only specified users can upload via private chat).

url

The pre-domain address that bot obtains FileID is automatically filled in.

port

Customize the running port.

Management

Get FIleID

Replying with get to the file reference in the bot's chat can get the FileID. Access the resource by combining the built address and the obtained path.

If the url parameter is configured, the complete address will be returned directly.

image

Deployment

Binary

Download for Linux amd64

wget https://github.com/csznet/tgState/releases/latest/download/tgState.zip && unzip tgState.zip && rm tgState.zip

Download for Linux arm64

wget https://github.com/csznet/tgState/releases/latest/download/tgState_arm64.zip && unzip tgState_arm64.zip && rm tgState_arm64.zip

Usage

./tgState parameters

Example

./tgState -token xxxx -target @xxxx

Run in the background

nohup ./tgState parameters &

Docker

Pull the image

docker pull csznet/tgstate:latest

Start

docker run -d -p 8088:8088 --name tgstate parameters --net=host csznet/tgstate:latest

Where docker parameters need to be set as environment variables.

Example

docker run -d -p 8088:8088 --name tgstate -e token=aaa -e target=@bbb --net=host csznet/tgstate:latest

Vercel

Does not support files larger than 5MB and does not support Telegram in getting file paths.

Click here to go to the Vercel configuration page

API Description

POST method to the path /api

Form transmission, field name is image, content is binary data.

Core symbols most depended-on inside this repo

Middleware
called by 4
control/control.go
errJsonMsg
called by 3
control/control.go
GetDownloadUrl
called by 2
utils/utils.go
web
called by 1
main.go
D
called by 1
control/control.go
Pwd
called by 1
control/control.go
TgFileData
called by 1
utils/utils.go
UpDocument
called by 1
utils/utils.go

Shape

Function 14
Struct 1

Languages

Go100%

Modules by API surface

control/control.go6 symbols
utils/utils.go4 symbols
main.go3 symbols
conf/conf.go1 symbols
api/vercel.go1 symbols

For agents

$ claude mcp add tgState \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact