btcinfo  

Hic inserere motto

tgbot - a Telegram bot in Bash

March 14, 2020 — shinohai

tgbot is, as the title says, a extensible Telegram bot written in Bash. It is what telegram-bot-bash was originally supposed to be before it became a bloated clusterfuck.

But why Bash? Because it's everywhere. This bot is mainly useful for folks that want to quickly set up a bot to automate tasks or announce rss feeds in a Telegram group. This functionality isn't included in this vpatch, but instead the user is invited to write their own commands and functions. Examples are included in the "commands" script.

To use:

Grab the vpatch and seal from here and press using a keccak-based vtron.

Make the following files executable:

  • commands
  • global
  • sendNotify
  • JSON.sh
  • tgbot

Create a new bot by sending a message to @BotFather. After completing the creation steps, copy your token to the "token" file, and save with user-readable permissions.

Then start the bot in a tmux or screen session by simply running `./tgbot`. The bot writes it's logfile to "logfile.txt" in the directory it is running in.

Don't:

Run this bot with root permissions, even if "just testing"! Telegram is a cesspool and you will quickly come to grief.

Otherwise, enjoy.

Tags: News, UNIX