Как добавить многоуровневое меню в телеге?

Как добавить в телегу многоуровнивую клавиатуру чтобы при нажатии на кнопку Мой создатель вылазила новая клавиатура с кнопками "Вк" и "Телега" с возможностью вернуться назад с помощью python
Вод код
import telebot
import config
import random
import time
import pyowm


from random import choice
from telebot import types

owm = pyowm.OWM(config.owmm, language = "ru")

observation = owm.weather_at_place(config.place)
w = observation.get_weather()

temp = w.get_temperature('celsius')["temp"] 

adv = ['В разработке']
Creator = 'Меня создал Илья Бугаец'
groups = ['Создатель', 'Модер', 'Помощник', 'Смертный']

bot = telebot.TeleBot(config.TOKEN)

@bot.message_handler(commands=['start'])
def send_welcome(message):

	markup = types.ReplyKeyboardMarkup(resize_keyboard=True)
	item1 = types.KeyboardButton("☁️Погода☁️")
	item2 = types.KeyboardButton("Мой создатель")
	item3 = types.KeyboardButton("Test")

	markup.add(item1, item2, item3)

	bot.send_message(message.chat.id, "Привет, {0.first_name}!\nЯ - <b>{1.first_name}</b>".format(message.from_user, bot.get_me()),
	parse_mode='html', reply_markup=markup)

@bot.message_handler(commands=['help'])
def welcome_help(message):
    bot.send_message(message.chat.id, Creator)

@bot.message_handler(commands=['groups'])
def welcome_help(message):
    bot.send_message(message.chat.id, groups)


@bot.message_handler(content_types=['text'])
def lalka(message):
	if message.chat.type == 'private':
		if message.text == "☁️Погода☁️":
			bot.send_message(message.chat.id, "В судаке сейчас " + w.get_detailed_status() + "\n" + "Температура в районе " + str(temp))
		elif message.chat.type == 'private':
			if message.text == "Мой создатель":
				bot.send_message(message.chat.id, Creator)



bot.polling( none_stop=True )
  • Вопрос задан
  • 248 просмотров
Пригласить эксперта
Ответы на вопрос 1
@Taus
Идея состоит в использовании InlineKeyboardMarkup с callback_data в сообщении бота вместо ReplyKeyboardMarkup и редактировании сообщения edit_message_text при нажатии на кнопку пользователем.
Ответ написан
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы