Вот моя прога:
def adc_2(message):
bot.send_photo(config.worker, message.photo[0].file_id)
bot.send_message(message.chat.id, mess1, reply_markup=keyboard)
bot.register_next_step_handler(message, menu)
Вот ошибка
Ошибка2020-11-29 21:52:18,659 (util.py:75 WorkerThread1) ERROR - TeleBot: "TypeError occurred, args=("'NoneType' object is not subscriptable",)
Traceback (most recent call last):
File "C:\Program Files\Python38\lib\site-packages\telebot\util.py", line 69, in run
task(*args, **kwargs)
File "D:/Emil Programm/Telegram_bot/main.py", line 328, in adc_2
bot.send_photo(config.worker, message.photo[0].file_id)
TypeError: 'NoneType' object is not subscriptable
"
Traceback (most recent call last):
File "D:/Emil Programm/Telegram_bot/main.py", line 944, in
bot.polling()
File "C:\Program Files\Python38\lib\site-packages\telebot\__init__.py", line 427, in polling
self.__threaded_polling(none_stop, interval, timeout)
File "C:\Program Files\Python38\lib\site-packages\telebot\__init__.py", line 451, in __threaded_polling
self.worker_pool.raise_exceptions()
File "C:\Program Files\Python38\lib\site-packages\telebot\util.py", line 118, in raise_exceptions
six.reraise(self.exc_info[0], self.exc_info[1], self.exc_info[2])
File "C:\Program Files\Python38\lib\site-packages\six.py", line 703, in reraise
raise value
File "C:\Program Files\Python38\lib\site-packages\telebot\util.py", line 69, in run
task(*args, **kwargs)
File "D:/Emil Programm/Telegram_bot/main.py", line 328, in adc_2
bot.send_photo(config.worker, message.photo[0].file_id)
TypeError: 'NoneType' object is not subscriptable
Process finished with exit code 1
Данная программа на подобие эхо бота, только пересылает фото не человеку который только что прислал его а человеку чье айди это config.worker в чем ошибка