Skip to content

Run fully functional bot API

Sahri Riza Umami edited this page Jul 16, 2016 · 1 revision

Merbot use bot API account to send its messages as formatted text.
Starting from v0.4, merbot has rewriten to enable fully function API bot, not just only to send formatted text messages. This is works by running bot API to relay messages into telegram-cli bot account. It's kind of slow, but better than nothing 😅

If you want to enable this feature, please follow these steps:

Running bot API on your local machine

We're going to run bot API in another terminal. We can use terminal multiplexer such as tmux or screen for this purpose.
These follwing steps using tmux as example.

  • install tmux
sudo apt install tmux
  • open new tmux session/windows
tmux
  • run botapi.lua
lua botapi.lua
  • exit/detach from tmux by pressing Ctrl+B and then D

More on how to use tmux.

Using hook.io service

hook.io is an open-source Hosting for Webhooks and Microservices. By using hook.io service we could get webhook feature and reduce load on our vps by not running another service.

Follow How to easily build a Telegram Bot with Hook.io tutorial, except for the source code part.
Use libs/hookio.js code instead:

  • copy the content of libs/hookio.js, and
  • paste into the hook source window.