apt-get install libreadline-dev libconfig-dev libssl-dev lua5.2 liblua5.2-dev libevent-dev libjansson-dev make git -y
cd /usr/src
git clone --recursive https://github.com/vysheng/tg.git
cd tg
# The latest build seems broken
#git checkout -b tgviacron 01f5d9a3b671edc15a5cff285601115845489985
#git submodule update --init --recursive
./configure
make
mkdir viacron
cp bin/telegram-cli viacron/
cp tg-server.pub viacron/
cd viacron
default_profile = "viacron";
viacron = {
config_directory = "/usr/src/tg/viacron/";
};
./telegram-cli -k tg-server.pub -c telegram.config
This guide send a message for user or group id because this decrease the errors.
user_info User_Name_In_Contact_list
User User Name updated photo
User User Name updated name
User User Name @userFoo (#1234567):
real name: User Name
phone: 551122223333
online (was online [2015/05/03 07:16:54])
1234567 in this case
> chat_info Enterprise_Name_In_Contact_List
Chat Enterprise 123 updated admin
Chat Enterprise 123 updated members
Chat Enterprise 123 (id 1234567) members:
Usuario Tal invited by Tobias Sette at [2015/05/14 02:48:45]
Tobias Sette invited by Tobias Sette at [2015/05/14 02:48:45] admin
User Tobias Sette offline (was online [2015/05/14 02:53:59])
1234567 in this case
#!/bin/bash
# See
# https://github.com/gnumoksha/zabbix_utils/blob/master/gnu%2Blinux/alertscripts/
MAIN_DIRECTORY="/usr/src/tg/viacron/"
USER=$1
SUBJECT=$2
TEXT=$3
cd $MAIN_DIRECTORY
if [[ $? -ne 0 ]]; then
echo "Error to enter in the main directory"
exit 1
fi
./telegram-cli -k tg-server.pub -c telegram.config -WR -e "msg $USER $SUBJECT" || exit 1
exit 0
Note: is better to use parameter -U yourSystemUser in telegram-cli. Reduces the possibilities of error.
chmod +x /usr/src/tg/viacron/telegram_standalone.sh
chown -R yourUser: /usr/src/tg/
Use user# prefix for users, for groups use chat#.
/usr/src/tg/viacron/telegram_standalone.sh user#12345 "GNU is not unix"
Hi gnumoshka, are you ok?
Sorry, I have a question about some tasks in telegram-cli.
I develop with Golang, using mtproto framework. I can not implement method for add new contact :((
can you help me to Solve this problem? The language is not matter, I can Convert between languages myself.
Please Help me @gnumoshka