N
N
negeevmaksim2021-02-12 11:33:22
Bots
negeevmaksim, 2021-02-12 11:33:22

TelegramBotAPI how to make a keyboard?

I need to make a button that will be attached to the message, how to do it? Help

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alex K, 2021-02-12
@negeevmaksim

This is done as a parameter reply_markupin the method sendMessage. Read more here: https://core.telegram.org/bots/api#sendmessage

K
Kilisami, 2021-02-14
@Kilisami

import telebot
  #keyboard
  markup = types.ReplyKeyboardMarkup(resize_keyboard=True)
  item1 = types.KeyboardButton("Понедельник")
  item2 = types.KeyboardButton("Вторник")
  item3 = types.KeyboardButton("Среда")
  item4 = types.KeyboardButton("Четверг")
  item5 = types.KeyboardButton("Пятница")
  item6 = types.KeyboardButton("Суббота")
  tim = types.KeyboardButton('Расписание звонков')

  markup.add(item1, item2, item3, item4, item5, item6, tim)

  bot.send_message(message.chat.id, reply_markup=markup)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question