N
N
NestaBill2020-06-25 14:50:56
Python
NestaBill, 2020-06-25 14:50:56

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, 5ef48e4886524351314927.jpegand I need a message. 5ef48e596d845793469875.jpegI 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

1 answer(s)
S
soremix, 2020-06-25
@NestaBill

InlineMarkup = types.InlineKeyboardMarkup()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question