Merge pull request #25 from paul-nameless/update-readme

Update documentation with instructions about how to run tg
This commit is contained in:
Nameless 2020-05-09 18:48:50 +08:00 committed by GitHub
commit c247b119c6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4,41 +4,38 @@ Console telegram client.
(!) currently in development
More documentation and plans for this project at [wiki](https://github.com/paul-nameless/tg/wiki)
## Requirements
- [tdlib](https://tdlib.github.io/td/build.html?language=Python)
For macOS:
```sh
brew install tdlib
```
- `python3.8`
- `pip3 install python-telegram`
- config file at `~/.config/tg/tg.conf`
```ini
[DEFAULT]
api_id = [api id]
api_hash = [api hash]
phone = [phone]
enc_key = [random key for encrypting your database]
notify_cmd = /usr/local/bin/terminal-notifier -title "{title}" -subtitle "{subtitle}" -message "{msg}" -appIcon "{icon_path}" -sound default
```
Where:
- `app_id` and `api_hash` is keys from [telegram](https://core.telegram.org/api/obtaining_api_id)
- `phone` your phone number (or login)
- `notify_cmd` can be any executable
## Usage
Clone repository.
Run this command.
Clone repository and run it
```sh
git clone git@github.com:paul-nameless/tg.git
cd tg
PYTHONPATH=. python3 tg/main.py
```
docker run -i -t --rm \
-v /tmp/docker-python-telegram/:/tmp/ \
-e API_ID=[id]
-e API_HASH=[hash]
-e PHONE=[phone] \
-e PYTHONPATH=/app -v $PWD:/app \
akhmetov/python-telegram python3 /app/tg/main.py
```
Where:
- `APP_ID` and `API_HASH` is keys from [telegram](https://core.telegram.org/api/obtaining_api_id)
- `PHONE` your phone number (or login)
If you don't want to run it using docker, install `tdlib` and `python-telegram`
For example, macOS:
```
brew install tdlib
pip3 install python-telegram
```
## Links
Usefull links to help develop this project.
- tdlib python wrapper: https://github.com/alexander-akhmetov/python-telegram
- tdlib official repo: https://github.com/tdlib/td/tree/master/example#python
- Build tdlib instructions: https://tdlib.github.io/td/build.html?language=Python