Answer the question
In order to leave comments, you need to log in
How to make the bot send photos to Telegram?
I am writing a Telegram bot. How to make the bot send a photo with the word "Photo", for example, this is https://imbt.ga/hwq4tukOvf i.e. from the Internet. Or you can from the directory. In general, it doesn’t matter what method the main thing is to send a photo)
Answer the question
In order to leave comments, you need to log in
import telebot
bot = telebot.TeleBot("BOT_TOKEN")
@bot.message_handler(regexp="Photo")
def send_echolalia(message):
file_id = "AgADAgADMaoxG94MWEnecVWaFaBvVi0_OQ8ABOlKCYOLocyNOy4BAAEC" #file_id of the photo itself
bot.send_photo(message.chat.id, file_id) #sending this photo to the user
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question