Skip to content

revilon1991/tg-parser

Repository files navigation

Telegram parser

This repository golang wrapper for Telegram Database Library. Contains docker build, web server and REST api interface for call C functions of tdlib.

Installation

Download latest release for your OS

Create Telegram Application and get TELEGRAM_APP_ID TELEGRAM_APP_HASH

After create Telegram bot and get TELEGRAM_BOT_TOKEN set it to .env. Locate it beside with binary

Installation with docker from source

You must prepend install Docker Desktop.

git clone https://github.com/revilon1991/tg-parser.git
cd tg-parser
cp .env.dist .env

Create Telegram Application and get TELEGRAM_APP_ID TELEGRAM_APP_HASH

After create Telegram bot and get TELEGRAM_BOT_TOKEN set it to .env and run

docker-compose up -d
docker-compose exec go make
docker-compose exec go make install

INFO Build docker image it is long process. Wait ~40 minutes. You can see progress bar from terminal.

Usage

./tg-parser [command]

# or if installation with docker from source
docker-compose exec go go run cmd/tg-parser/main.go [command]
Commands:
# API server
# You can see updates telegram from terminal.
./tg-parser run-server
# Fetch members id from channels
./tg-parser fetch-members
API end-points:

INFO
When you call end-point, api server must be running
channel_id - get from database after invite bot to channel
photo_id - get from /getUser end-point

About

REST api wrapper Telegram Database Library

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages