PHPTeleBotWrt - Telegram bot framework written in PHP for OpenWRT



PHPTeleBotWrt

Telegram bot framework written in PHP for OpenWRT


Video Preview

Features

Requirements

Video Installation

Installation

  1. Open Putty/Terminal/TTYD/XTERM or similar apps like these.
  2. Run commands below to download phpbotmgr - PHPTeleBotWrt Manager to your OpenWRT (choose one of installation method below):

    wget installation:

     wget https://raw.githubusercontent.com/helmiau/PHPTeleBotWrt/master/phpbotmgr -O /root/phpbotmgr && chmod +x /root/phpbotmgr
    

    curl installation:

     curl -sL https://raw.githubusercontent.com/helmiau/PHPTeleBotWrt/master/phpbotmgr > /root/phpbotmgr && chmod +x /root/phpbotmgr
    
  3. Run ./phpbotmgr i with Putty/Terminal/TTYD/XTERM to install PHPTeleBotWrt

     ./phpbotmgr i
    
  4. Copy Telegram Bot API Token from @BotFather, paste to terminal when 💬 Enter Your Bot Token: appeared. Token bot example: 52123745:ABeN1H9jc0I_7lIeyu_4aE8BZiV_fXt9TGk.
  5. Copy your Telegram Bot Username from bot profile, paste to terminal when 🤖 Enter Your Bot Username (without @): appeared. Bot username example: mamanxwrt_bot.
  6. Copy your Telegram Account User ID from @userinfobot, paste to terminal when 🤖Enter Your Personal Account UID: appeared. User ID example: 234321234.

Usage

Read usage information of phpbotmgr command.

About databot file inside PHPTeleBotWrt path

This file contain your Telegram Bot API Token and Bot Username. You must update this file if you want to change to another bot.

Sample contents of databot file (click to see screenshots)

bottoken

Here some command previews:

Install PHPTeleBotWrt

./phpbotmgr i

Update PHPTeleBotWrt

./phpbotmgr u

Edit PHPTeleBotWrt databot

./phpbotmgr e

Run/Start PHPTeleBotWrt

./phpbotmgr r

If not work, just run cd PHPTeleBotWrt && nohup php8-cli index.php &>/dev/null & && cd manually

Check PHPTeleBotWrt running status (maybe not work sometimes)

./phpbotmgr c

Stop PHPTeleBotWrt

./phpbotmgr s

Full Remove/Uninstall PHPTeleBotWrt with all datas.

./phpbotmgr ra

Remove/Uninstall PHPTeleBotWrt without databot.

./phpbotmgr rx

Add/remove PHPTeleBotWrt to Auto-startup LuCI - System - Startup - Local Startup - rc.local.

./phpbotmgr a

Add/remove PHPTeleBotWrt to Auto-startup LuCI - System - Scheduled Tasks.

./phpbotmgr t

Command lists

📁PHPTeleBotWrt Manager
 ↳/botup : Update bot binaries
 ↳/botas : Add/remove bot to/from auto start on boot [$boot_stat]
 ↳/botcr : Add/remove bot to/from cron job [$cron_stat]
 
 📁Aria2 Commands
 ↳/aria2add : Add task
 ↳/aria2stats : Aria2 status
 ↳/aria2pause : Pause all
 ↳/aria2resume : Resume all
 
📁OpenClash Commands
 ↳/oc : OC Information
 ↳/ocst : Start/Restart Openclash
 ↳/ocsp : Stop Openclash
 ↳/ocpr : Proxies status 
 ↳/ocrl : Rule list 
 ↳/ocup : Update Openclash app only
 ↳/ocua : Update Openclash and all cores

📁MyXL Commands
 ↳/myxl : Bandwidth usage 
 ↳/setxl 087 : Set default number

📁File Manager
 ↳/upf : Upload a file to OpenWrt
 ↳/dlf : Get/retrieve a file from OpenWrt
 ↳/cp : Copy a file to another folder
 ↳/mv : Move a file to another folder
 ↳/rm : Delete a file

📁System
 ↳/sysinfo : System Information
 ↳/memory : Memory status 
 ↳/sh commandSample : Run custom command in bash terminal
 ↳/rs ls : List of compatible app restart
 ↳/rs appname : Restart app in init.d
 
📁Power System
 ↳/reboot : Reboot OpenWrt
 ↳/turnoff : Turn off OpenWrt
 
📁Network Information
 ↳/netcl : Lists of connected client devices
 ↳/fwlist : Firewall lists
 ↳/ifcfg interface : List of device interface 
 ↳/vnstat : Bandwidth usage 
 ↳/vnstati : Better Bandwidth usage 
 ↳/myip : Get ip details 
 ↳/speedtest : Speedtest 
 ↳/ping : Ping bot

Screenshots

start on terminal
(click to see screenshot)

Startingbot

/start | /cmdlist
(click to see screenshot)

Start cmdlist

/memory
(click to see screenshot)

Memory

/myip
(click to see screenshot)

Myip

/myxl number
(click to see screenshot)

MyXL

/ping
(click to see screenshot)

ping

/oc
(click to see screenshot)

OCInfo

/ocpr
(click to see screenshot)

OCProxies

/ocrl
(click to see screenshot)

OCRules

/ocst
(click to see screenshot)

OCStart

/ocsp
(click to see screenshot)

OCStop

/ocup
(click to see screenshot)

OCUpIPK

/ocua
(click to see screenshot)

OCUpALL

/speedtest (depend on what speedtest installed)
(click to see screenshot)

Speedtest

/sysinfo
(click to see screenshot)

sysinfo

/vnstat -d or -h or -m
(click to see screenshot)

vnstat

/vnstati -d or -h or -m
(click to see screenshot)

vnstati1


vnstati2

/upload
(click to see screenshot)

upload1


upload2


upload3

/update
(click to see screenshot)

vnstati1

Tested on

Known Bugs

Reports

Join our Telegram Group.

Developers