tg-broadcast is a Telegram broadcast & auto response script (a.k.a. robot) for telegram-cli(unofficial).
There are a few Telegram bot scripts out there. Go find one that fits you. If you want to broadcast messages with Telegram, I recommend to use this script.
tg-broadcast is tested on telegram-cli 1.3.1.
GitHub repository: https://github.com/bakyeono/tg-broadcast
You can broadcast to multiple subscribers. Your friends can subscribe or unsubscribe by simply sending a message to you.
stdout omitting program can be used to send reply message. Adding new response rules is easy.
DBMS / no DBMS
Use SQLite, MySQL, MariaDB, or just text files for subscriber management.
Install telegram-cli (if you didn't already)
Clone and compile telegram-cli. Follow the instruction in telegram-cli(unofficial) page.
$ cd ~ $ git clone --recursive email@example.com:vysheng/tg.git $ cd tg $ sudo apt-get install libreadline-dev libconfig-dev libssl-dev lua5.2 liblua5.2-dev libevent-dev libjansson-dev libpython-dev $ ./configure $ make
Done? Copy the compiled binary and key file into
$ mkdir ~/telegram-cli $ cp bin/telegram-cli tg-server.pub ~/telegram-cli
Now you can run telegram-cli. Run it first time and do the authorization.
$ cd ~/telegram-cli $ ./telegram-cli
Type "help" on the telegram-cli prompt to see available commands.
Clone this repo into your home.
$ cd ~ $ git clone firstname.lastname@example.org:bakyeono/tg-broadcast.git $ cd tg-broadcast
Install SQLite3. (Recommended. If you don't want use SQLite3, see
$ sudo apt-get install sqlite3
Now you can run the script:
$ ~/tg-broadcast/test # run REPL mode $ ~/tg-broadcast/start # run daemon mode $ ~/tg-broadcast/stop # kill running telegram-cli process
When the script is running, send
help message to yourself and you'll get this reply:
help : This help ip : Server's IP address time : Server's time calendar : Calendar weather CITY: Weather for CITY subscribe : Subscribe my news unsubscribe : Unsubscribe my news ------------------------- (admin only) broadcast : Force broadcast now notify : Send a message to subscribers safequit : Turn off robot
config.lua to edit broadcast message and add your own commands to the robot.