Использую WebHook в своем TelegramBot`е
В нем есть так скажем форма (имя и номер телефона)
Так вот при заполнении `имени` выходит ошибка :
2019-02-01 13:06:42,362: Exception on /`secret` [POST]
Traceback (most recent call last):
File "/home/PyRayman/venv/lib/python3.6/site-packages/flask/app.py", line 2292, in wsgi_app
response = self.full_dispatch_request()
File "/home/PyRayman/venv/lib/python3.6/site-packages/flask/app.py", line 1815, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/PyRayman/venv/lib/python3.6/site-packages/flask/app.py", line 1718, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/PyRayman/venv/lib/python3.6/site-packages/flask/_compat.py", line 35, in reraise
raise value
File "/home/PyRayman/venv/lib/python3.6/site-packages/flask/app.py", line 1813, in full_dispatch_request
rv = self.dispatch_request()
File "/home/PyRayman/venv/lib/python3.6/site-packages/flask/app.py", line 1799, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/home/PyRayman/TelegramBot/mainbot.py", line 85, in webhook
bot.process_new_updates([update])
File "/home/PyRayman/venv/lib/python3.6/site-packages/telebot/__init__.py", line 314, in process_new_updates
self.process_new_messages(new_messages)
File "/home/PyRayman/venv/lib/python3.6/site-packages/telebot/__init__.py", line 333, in process_new_messages
self._notify_next_handlers(new_messages)
File "/home/PyRayman/venv/lib/python3.6/site-packages/telebot/__init__.py", line 1299, in _notify_next_handlers
self._exec_task(handler["callback"], message, *handler["args"], **handler["kwargs"])
File "/home/PyRayman/venv/lib/python3.6/site-packages/telebot/__init__.py", line 464, in _exec_task
task(*args, **kwargs)
TypeError: 'str' object is not callable
вот собственно часть кода где выходит ошибка: @app.route('/{}'.format(secret),methods=['POST'])
def webhook():
print(flask.request.headers)
if flask.request.headers.get('content-type') == 'application/json':
json_string = flask.request.get_data().decode('utf-8')
update = telebot.types.Update.de_json(json_string)
bot.process_new_updates([update])
return ''
else:
print('You NOT made it!')
flask.abort(403)