Telbot can run on ARM-based OpenWrt routers to provide a 24/7 Telegram bot or auto-buy monitor.
Make sure your are in root user
ssh root@your-router-ip- SSH into your router and download the ARM binary directly from GitHub:
wget https://github.com/0xtbug/telbot/releases/latest/download/telbot-linux-arm -O /tmp/telbot
- Move it to
/usr/bin/and make it executable:mv /tmp/telbot /usr/bin/telbot
Create .env in /root/ directory
# Create .env in /root/ directory
nano .envHere is the content of .env
TELKOMSEL_BOT_TOKEN=your_bot_token
TELEGRAM_ADMIN_ID=your_admin_id
# Optional: Enable auto re-login via OTP webhook from SMS Forwarder
# OTP_WEBHOOK_PORT=8081
# OTP_WEBHOOK_SECRET=your_secretThen copy .env to /.config/telbot/ directory
mkdir -p /.config/telbot/
cp /root/.env /.config/telbot/.env
To ensure Telbot starts automatically and restarts on crashes, create a procd init script at /etc/init.d/telbot:
Create file /etc/init.d/telbot
nano /etc/init.d/telbot#!/bin/sh /etc/rc.common
USE_PROCD=1
START=99
STOP=10
PROG=/usr/bin/telbot
ENV_FILE=/root/.env
start_service() {
[ -f "$ENV_FILE" ] || {
echo "❌ File $ENV_FILE tidak ditemukan!"
return 1
}
procd_open_instance
procd_set_param chdir "/root"
procd_set_param command "$PROG" --bot --verbose
while IFS= read -r line || [ -n "$line" ]; do
case "$line" in
\#*|"") continue ;;
esac
key=$(echo "$line" | cut -d '=' -f 1)
val=$(echo "$line" | cut -d '=' -f 2- | tr -d '"' | tr -d "'")
procd_set_param env "$key"="$val"
done < "$ENV_FILE"
procd_set_param respawn
procd_set_param stdout 1
procd_set_param stderr 1
procd_close_instance
}Enable and start the service:
chmod +x /etc/init.d/telbot
/etc/init.d/telbot enable
/etc/init.d/telbot startCheck the system logs to see if the bot is running correctly:
logread -f | grep telbot