Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions Bobo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import requests

import telegram



# create a Telegram bot instance

bot = telegram.Bot(token='5857821445:AAHrCIPNR2rbxB0b4g2iXsIbWn56DYkSy7c')



# specify the URL of the file to download

file_url = 'https://www.example.com/file.pdf'



# make a GET request to download the file

response = requests.get(file_url)



# create a file-like object from the response content

file_obj = response.content



# send the file to a Telegram chat

chat_id = 'https://t.me/Bokokoto_bot'

bot.send_document(chat_id=chat_id, document=file_obj)