У меня все работает, но когда я вызываю await discord.create_session(), я получаю ошибку, связанную с сессией.
P.S Операционная система: Linux mint cinnamon, последняя версия quart-discord.
Код:
@app.route("/login")
async def login():
try:
return await discord.create_session()
except Exception as e:
print(e)
return "Sorry, error"
Ошибка:
object Response can't be used in 'await' expression
[2022-03-22 20:21:33,825] Request handling exception
Traceback (most recent call last):
File "/home/xpeawey/.local/lib/python3.8/site-packages/quart/serving.py", line 130, in _handle_request
await self.send_response(stream_id, response)
File "/home/xpeawey/.local/lib/python3.8/site-packages/quart/serving.py", line 229, in send_response
self._send(h11.Response(status_code=response.status_code, headers=headers))
File "/home/xpeawey/.local/lib/python3.8/site-packages/h11/_events.py", line 55, in __init__
self.headers = _headers.normalize_and_validate(
File "/home/xpeawey/.local/lib/python3.8/site-packages/h11/_headers.py", line 77, in normalize_and_validate
validate(_field_value_re, value, "Illegal header value {!r}", value)
File "/home/xpeawey/.local/lib/python3.8/site-packages/h11/_util.py", line 108, in validate
raise LocalProtocolError(msg)
h11._util.LocalProtocolError: Illegal header value b' session=eyJESVNDT1JEX09BVVRIMl9TVEFURSI6ImV5SjBlWEFpT2lKS1YxUWlMQ0poYkdjaU9pSklVekkxTmlKOS5lMzAuSU1YT3I4S0ZqOHRZWDlmS2h5X19fNFJsM2tZVXZBeEZ4bWhsaE5KV3dOQSJ9.YjoFnQ.AAHmvAk-ZeUMVVEX0lD1irMRzKE; HttpOnly; Path=/'