Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@a-x-
Created November 6, 2017 18:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save a-x-/2530f94f838f7fc910563786269ebe03 to your computer and use it in GitHub Desktop.
Save a-x-/2530f94f838f7fc910563786269ebe03 to your computer and use it in GitHub Desktop.
telegram-cli

setup tg-cli

https://github.com/vysheng/tg

vysheng/tg#781

vysheng/tg#1339

vysheng/tg#1189

sudo apt-get install libreadline-dev libconfig-dev libssl-dev lua5.2 liblua5.2-dev libevent-dev libjansson-dev libpython-dev make
git clone --recursive https://github.com/vysheng/tg.git && cd tg
cd tgl
git remote set-url origin  git@github.com:a-x-/tgl.git
git fetch && git checkout patch-1
cd ..
./configure && make
ln -s ~/services/tg/bin/telegram-cli ~/bin
sudo mkdir -p /etc/telegram-cli
sudo cp tg-server.pub /etc/telegram-cli/server.pub

telegram-cli -W

send-tg-msg

~/bin/send-tg-msg:

#!/bin/sh
# send-tg-msg @someuser hi

to=$1
msg=$2

(echo "get_self"; sleep 2; echo "msg $to $msg"; sleep 2;echo "safe_quit") | telegram-cli -DWR -l0 >/dev/null
@johngh
Copy link

johngh commented Feb 4, 2018

Thanks a-x- !!!

If you don't have SSH keys set up for github (see below) you get a fatal error when you do:

git remote set-url origin git@github.com:a-x-/tgl.git

It dies with:

Permission denied (publickey).
fatal: The remote end hung up unexpectedly

If you get that error, and you don't want to setup SSH keys from the account you're on, you can use this instead:

git remote set-url origin https://github.com/a-x-/tgl.git

and that works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment