S
S
stamdyscias2016-07-01 08:29:17
Python
stamdyscias, 2016-07-01 08:29:17

Why doesn't the bot answer appear in telegram?

The bot should send a response

@bot.message_handler(content_types=['www'])
def find_answer(message):
  markup = types.ReplyKeyboardMarkup(True, True)
  item_b = types.KeyboardButton("w")
  markup.add(item_b)
  item_g = types.KeyboardButton("ww")
  markup.add(item_g)
  item_v = types.KeyboardButton("www")
  markup.add(item_v)
  bot.send_message(message.from_user.id, "Choose, what you need", reply_markup=markup)
  x = message.location.longitude #долгота
  y = message.location.latitude #широта


@bot.message_handler(content_types=['text'])
def handle_text(message):
  if message.text == "w":
    bot.send_message(message.from_user.id, "Результат 1")

A little higher, according to the logic of the bot, I added the following and after that he stopped responding Result 1
if message.text == 'I need...':
    bot.send_message(message.from_user.id, "Where are you?", reply_markup=markup)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Igor Nikolaev, 2016-07-01
@nightvich

Who knows "her"...

N
nllm, 2016-07-01
@nllm

The surest way is to log all steps and look for where he stumbles.
When sending a response to the telegram server, you will receive a response with an error code (if any) and understand it.
It is possible that the bot is not receiving a request from the user.
You need all the code, you need to look at the logs, do debugging. Look for a bug in the code

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question