Answer the question
In order to leave comments, you need to log in
How to add buttons under a message in a telegram bot?
I just started learning python, I decided to make a bot for training, but I ran into difficulty due to inexperience and lack of knowledge. I googled how to make buttons, but they come out like a keyboard for me, and I need a message. I will be glad to help
import telebot
from telebot import types
bot = telebot.TeleBot('1236262988:AAGwrrnHLWbBxjLR3JDXdf6-rc74')
@bot.message_handler(commands=['start'])
def start_message(message):
bot.send_message(message.chat.id,'Чудово! Оберіть сервіс, яким Ви хотіли б скористатися', reply_markup=keyboard())
def keyboard():
InlineMarkup = types.ReplyKeyboardMarkup(one_time_keyboard=True, resize_keyboard=True)
Inlinebutton1 = types.InlineKeyboardButton(' Електронна черга')
Inlinebutton2 = types.InlineKeyboardButton('⁉ Консультація')
Inlinebutton3 = types.InlineKeyboardButton(' Перевірка стану оформлення ')
Inlinebutton4 = types.InlineKeyboardButton(' Супутні послуги')
Inlinebutton5 = types.InlineKeyboardButton(' Контакти')
InlineMarkup.add(Inlinebutton1, Inlinebutton2, Inlinebutton3, Inlinebutton4, Inlinebutton5)
return InlineMarkup
if __name__== "__main__":
bot.polling(none_stop=True)
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