@bot.message_handler(commands=['start'])
def start_message(message):
markup = types.ReplyKeyboardMarkup(resize_keyboard=True)
item1 = types.KeyboardButton("Начать")
markup.add(item1)
bot.send_message(
message.chat.id, 'Здравствуйте', parse_mode='html', reply_markup=markup)
@bot.message_handler(content_types=['text'])
def lalala(message):
if message.chat.type == 'private':
markup = types.InlineKeyboardMarkup(row_width=2)
item1 = types.InlineKeyboardButton("Красиво", callback_data='good')
item2 = types.InlineKeyboardButton("Не очень", callback_data='bad')
markup.add(item1, item2)
photo = open('/static/braslet.jpg', 'rb')
bot.send_photo(
message.chat.id, photo, reply_markup=markup)
@bot.callback_query_handler(func=lambda call: True)
def callback_inline(call):
try:
if call.message:
if
call.data == 'good':
bot.send_message(
call.message.chat.id, 'Спасибо😊')
elif
call.data == 'bad':
bot.send_message(
call.message.chat.id, 'Бывает😢')