Skip to content
This repository has been archived by the owner on Oct 14, 2018. It is now read-only.
mehrab-wj edited this page Dec 22, 2015 · 4 revisions

Welcome to the telegram-bot wiki!

Set up a user

If you are connecting via SSH to a VPS, chances are you are logged in as root. tg (telegram-cli) doesn't run if you try to run it as root, so we need to set up a new user:

adduser telegram-bot
adduser telegram-bot sudo

The first adduser command should set up user info eg. password.

Now close the SSH session and log in to the new user that you set up (or logout and back in).

Installation

Dependencies

(from vysheng/tg/README.md: Linux and BSDs)

Debian

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install libreadline-dev libconfig-dev libssl-dev lua5.2 liblua5.2-dev libevent-dev libjansson-dev libpython-dev make unzip git redis-server g++

Gentoo

sudo emerge -av sys-libs/readline dev-libs/libconfig dev-libs/openssl dev-lang/lua dev-libs/libevent dev-libs/jansson

Fedora

sudo yum install lua-devel openssl-devel libconfig-devel readline-devel libevent-devel libjansson-devel git redis gcc make unzip gcc-c++ expat-devel

Arch Linux

sudo pacman -S autoconf patch readline libconfig lua libevent jansson python make unzip redis gcc git

FreeBSD

pkg install libconfig libexecinfo lua52

OpenBSD

pkg_add libconfig libexecinfo lua

Mac OS X

Check out vysheng/tg/README.md: Mac OS X

Required packages

If you use a different package manager than the ones above, the following is a list of required packages:

libreadline-dev (readline)
libconfig-dev (libconfig)
libssl-dev (openssl)
lua5.2
liblua5.2-dev (liblua)
libevent-dev
libjansson-dev (libjansson)
libpython-dev
make
unzip
git
redis-server (redis)
g++

Bot installation

cd $HOME
git clone https://github.com/yagop/telegram-bot.git
cd telegram-bot
./launch.sh install
./launch.sh # Will ask you for a phone number & confirmation code.

One command

To install everything on this page (except new user) in one command on debian-based distros, use: (useful for VPS deployment)

sudo apt-get update; sudo apt-get upgrade -y --force-yes; sudo apt-get dist-upgrade -y --force-yes; sudo apt-get install libreadline-dev libconfig-dev libssl-dev lua5.2 liblua5.2-dev libevent-dev libjansson* libpython-dev make unzip git redis-server g++ -y --force-yes && git clone https://github.com/yagop/telegram-bot.git && cd telegram-bot && ./launch.sh install && ./launch.sh

After running that command, leave the VPS for a few minutes (depends on the speed of the VPS) to download and compile everything and when you come back you should just have to enter your phone number 😄