ошибка:
Traceback (most recent call last):
File "C:\Users\Admin\PycharmProjects\Вызовv2\main.py", line 32, in
bot.polling()
File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\site-packages\telebot\__init__.py", line 617, in polling
self.__threaded_polling(none_stop, interval, timeout, long_polling_timeout, allowed_updates)
File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\site-packages\telebot\__init__.py", line 676, in __threaded_polling
raise e
File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\site-packages\telebot\__init__.py", line 639, in __threaded_polling
self.worker_pool.raise_exceptions()
File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\site-packages\telebot\util.py", line 130, in raise_exceptions
raise self.exception_info
File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\site-packages\telebot\util.py", line 82, in run
task(*args, **kwargs)
File "C:\Users\Admin\PycharmProjects\Вызовv2\main.py", line 30, in menu
time.sleep(2)(bot.send_message(1113732336, text="Отправлено"))
TypeError: 'NoneType' object is not callable
Код:
bot = telebot.TeleBot("")
i = 0
while i != 1:
@bot.message_handler(commands=['start'])
def send_welcome(message):
markup = types.ReplyKeyboardMarkup(resize_keyboard=True)
but1 = types.KeyboardButton("0")
but2 = types.KeyboardButton("9")
but3 = types.KeyboardButton("4")
but4 = types.KeyboardButton("2")
but5 = types.KeyboardButton("Своё сообщение")
markup.add(but1, but2, but3, but4, but5)
bot.reply_to(message, "Бот запущен".format(message.from_user)
,parse_mode='html',reply_markup=markup)
@bot.message_handler(func=lambda message: True)
def menu(message):
if message.chat.type == 'private':
sendmsg = message.text
bot.send_message(xxx, text=sendmsg)
time.sleep(2)(bot.send_message(xxx, text="Отправлено"))