Answer the question
In order to leave comments, you need to log in
Telegram bot in Python. How to send a photo from a computer?
How to make it so that the photo is sent in response?
Implemented via url, but how to make it sent from the local computer?
And from google drive.
Already climbed everything.
And the second question: how to make a back button? So that in ReplyKeyboardMarkup each time the button sends the user to the pre menu?
THE CODE:
import config
import telebot
from telebot import types
from requests import get
bot = telebot.TeleBot(config.token)
@bot.message_handler(commands=['start'])
def welcome(message):
markup = types.ReplyKeyboardMarkup(resize_keyboard=True)
item1 = types.KeyboardButton ("Початок")
item2 = types.KeyboardButton ("Кінець")
markup.add(item1, item2)
bot.send_photo(message.chat.id, get("https://tms1.visicom.ua/2.0.0/planet3/base/17/76697/86864.png").content)
bot.send_message(message.chat.id, "Доброго дня " + message.from_user.first_name + ", Я бот-консультант ", reply_markup=markup)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question