We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Would you like assistance or advice? assistance
Issue description in the example below, trying to call an async function from within "def message(self, message):"
Steps to reproduce insert "await inside the "def message(self, message):" where is a function defined as async
Traceback or other info
The text was updated successfully, but these errors were encountered:
I followed the advice given here: https://stackoverflow.com/questions/31866796/making-an-asynchronous-task-in-flask
Basically I had to change the Flask harness like so:
@app.route('/webhook', methods=['GET', 'POST']) **async** def webhook(): if request.method == 'GET': logger.debug(f"checking that {request.args.get('hub.verify_token')} == {configuration.cfg['FB_VERIFY_TOKEN']}") if (request.args.get('hub.verify_token') == configuration.cfg['FB_VERIFY_TOKEN']): return request.args.get('hub.challenge') raise ValueError('FB_VERIFY_TOKEN does not match.') elif request.method == 'POST': **await** messenger.handle(request.get_json(force=True)) return ''
as well as install pip3 install asgiref
pip3 install asgiref
is this correct?
Sorry, something went wrong.
No branches or pull requests
Would you like assistance or advice?
assistance
Issue description
in the example below, trying to call an async function from within "def message(self, message):"
Steps to reproduce
insert "await inside the "def message(self, message):" where is a function defined as async
Traceback or other info
The text was updated successfully, but these errors were encountered: