Skip to content

This is a personal telegram bot. Hosted locally on a 'Raspberry Pi 4 Model-B 4GB' and an 'Android Mobile Device' (for battery backup).

Notifications You must be signed in to change notification settings

thesarthakjain/telegram_bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Telegram Bot

Description

This is a telegram bot that can be used as a template for personal telegram bot.

Telegram API Token Generation

  1. First you will need to create a personal telegram account and then search for @BotFather. Then type the command - /newbot

  2. After that, enter the username for the bot.

  3. The @BotFather will give you the API Token for the bot.

Getting started with the Telegram-Bot

  1. Make sure you are in the project directory:

     cd /path/to/telegram_bot
    
  2. Install the requirements:

     pip3 install -r requirements.txt
    
  3. Creating config.yaml file manually - This step could be skipped as running the bot without this file will automatically generate it for you.

    token: <put the bot token here>
    bot_admin: <bot admin username>
    trusted_users: <trusted user's username>

    The bot.py will also generate the saved folder inside the project directory. All the files that the trusted_users and admins send to the bot via telegram chat will be stored here.

  4. Run the bot:

     python3 bot.py
    
  5. To Stop the bot:

     ctrl + c
    

Bot Functions

There are 3 levels of privileges for the functions:

  1. General User - U
  2. Trusted User - TU
  3. Admin - AU
Function Name Description Privilege
/start Welcome message U
/help help message U
/contact Bot Admin Info U
/ig_dp <insta username> Download Instagram DP U
/list List all the saved files TU
/print <S.No. of file in list> Print a saved file TU
/print_range <S.No. of file> <Range> Print a range of pages from a saved file TU
Upload a file Downloads and saves the file locally TU
/add_trusted <username> Add new trusted user to list AU
/add_admin <username> Add new bot admin to list AU

About

This is a personal telegram bot. Hosted locally on a 'Raspberry Pi 4 Model-B 4GB' and an 'Android Mobile Device' (for battery backup).

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages