Skip to content

Bot installation

Sahri Riza Umami edited this page Jul 22, 2016 · 15 revisions

Dependencies

Merbot is telegram-cli based bot. Before installing merbot, we need to satisfied telegram-cli dependencies.
The following is how to install the telegram-cli dependencies as stated on 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++

Ubuntu

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 make unzip git redis-server g++ libjansson-dev libpython-dev expat libexpat1-dev

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

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/rizaumami/merbot.git
cd merbot
./merbot install

After tg compilation has finished, run merbot, it will ask you for phone number & confirmation code;

./merbot

Type quit or safe_quit inside telegram-cli instance to quit, then rerun merbot, it will then will ask you for bot API key:

./merbot

asciicast

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/rizaumami/merbot.git && cd merbot && ./merbot install && ./merbot

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 and confirmation code.
Type quit or safe_quit inside telegram-cli instance to quit, then rerun ./merbot, it will then will ask you for bot API key.

Pre-compiled package

Starting from v0.3, merbot also provide a pre-compiled package so you don't have to compile it manually. Just download the pre-compiled package, extract then start to using it.

  • install dependencies as usual
  • download the latest release, i.e v0.4;
wget https://github.com/rizaumami/merbot/releases/download/v0.4/merbot_0.4_amd64.tar.gz
  • extract the pre-compiled package using following command;
    tar xf merbot_0.4_amd64.tar.gz
  • enter extracted merbot folder;
    cd merbot
  • start merbot, it then will ask you for phone number & confirmation code;
    ./merbot
  • type quit or safe_quit inside telegram-cli instance to quit, then rerun merbot, it then will ask you for bot API key:
    ./merbot
Clone this wiki locally