Skip to content

A telegram bot assistant that runs bash commands in the end machine as well as send files from the machine (MAC-OS, Linux) to your phone/other devices

Notifications You must be signed in to change notification settings

trypzz/Personal-Telegram-Bot

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Personal Telegram Bot to run bash commands and send files to end user

Code is pretty simple

Steps to run

  • Create new telegram bot using @BotFather from telegram. The @BotFather will send you an API token then you can insert in the code, check below

  • Insert your password and paths to two files last_date and whitelist

    lastdate contains the date of the last message processed by the bot

    whitelist contains ids of telegram accounts that can access the functionalities

bash_handler = BashCommandHandler(
    api_token='14*******:A****************VRyeikcHqlqbbI', # Here is your API_TOKEN
    password='*********', # password of the device that you run the code on
    whitelist='/home/jafar/PycharmProjects/Personal-Telegram-Bot/whitelist' # path of the file where you store that 
    # whitelisted accounts
)
last_date_path = '/home/jafar/PycharmProjects/Personal-Telegram-Bot/last_date'

Using the bot

  • jlogin *password* you type password of the device

    You will get a verdict

  • jlogout to logout from this account

  • sendme file relative_path where relative_path is the relative path for the file required to be sent

  • sendme photo relative_path to send as a photo

  • sendme video relative_path to send as a video

  • sudo nordvpn connect germany this is just a bash command to run on your server machine

  • Any other command is possible here is an animated gif for the possibility

Demo

About

A telegram bot assistant that runs bash commands in the end machine as well as send files from the machine (MAC-OS, Linux) to your phone/other devices

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%