Good afternoon.
Before the bot functioned in good faith. Now from time to time when sending a command, it hangs for 1-2 minutes and, instead of the correct result of the execution returns the result + text "Expecting value: line 1 column 1 (char 0)"
Moreover, this error is of a floating character
import telebot
token = 'my token'
botan_token = 'token nerd'
print(bot.get_me())
def log(message):
print("\n ---------")
from datetime import datetime
print(datetime.now())
print(" Message from {0} to {1}. (id = {2}) \n Text - {3}".format(message.from_user.first_name,
message.from_user.last_name,
message.from_user.id
message.text))
@bot.message_handler(commands=['start'])
def handle_start(message):
user_markup = telebot.types.ReplyKeyboardMarkup(True, False)
user_markup.row('Change', 'Adjustment')
user_markup.row('Closure', 'Return')
user_markup.row('Hide', 'Help')
bot.send_message(message.from_user.id, 'Welcome to..', reply_markup=user_markup)
@bot.message_handler(content_types=['text'])
def handle_text(message):
log(message)
if message.text == "Change":
user_markup = telebot.types.ReplyKeyboardMarkup()
user_markup.row('case 1')
user_markup.row('In case 2')
user_markup.row('main menu')
bot.send_message(message.from_user.id, 'Select item', reply_markup=user_markup)
botan.track(botan_key, message.chat.id, message, 'Change')
<code in the same spirit>
.....
bot.polling(none_stop=True, interval=0)
Itself error from the console:
