Answer the question
In order to leave comments, you need to log in
When the queue reaches the last block, choosing 1 does nothing. Why doesn't the last block of code work?
import telebot
from telebot import types
client = telebot.TeleBot("1963852427:AAFuzigy74HooXQk9XolCB3SPuZalEo1A")
@client.message_handler(commands="start")
def start (message):
button = types.ReplyKeyboardMarkup (resize_keyboard = True)
item1 = types.KeyboardButton ("начать")
button.add(item1)
client.send_message(message.chat.id, "Привет,{0.first_name}".format(message.from_user), reply_markup=button)
@client.message_handler(content_types="text")
def send_message (message):
if message.chat.type == "private":
if message.text == "начать":
button = types.ReplyKeyboardMarkup(resize_keyboard=True)
item1 = types.KeyboardButton("Один")
item2 = types.KeyboardButton("Два")
item3 = types.KeyboardButton("Три")
item4 = types.KeyboardButton("Четыре")
button.add(item1, item2, item3, item4)
client.send_message(message.chat.id, "Выберите число", reply_markup=button)
@client.message_handler(content_types="text")
def lalala (message):
if message.text == "Один":
client.send_message(message.chat.id, "1")
client.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