tg-parser

module
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 4, 2020 License: MIT

README

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL