n8wachT / telegram_bot

My personal telegram bot, hosted locally on a raspberry pi.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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 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>
  1. The bot.py will also generate the saved folder inside the project directory.

    • Here all the files will be stored that the trusted_users and admins send to the bot via telegram.
  2. Run the bot:

     python3 bot.py
    
  3. 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

My personal telegram bot, hosted locally on a raspberry pi.


Languages

Language:Python 100.0%