tencent-connect / botpy

QQ频道机器人PythonSDK
MIT License
467 stars 79 forks source link

WSL2 Ubuntu 22.04.2 LTS下登录机器人账号请求超时 #149

Open keyblues opened 7 months ago

keyblues commented 7 months ago
[INFO]  (client.py:159)_bot_login       [botpy] 登录机器人账号中...
[WARNING]       (http.py:188)request    请求超时,请求连接: https://api.sgroup.qq.com/gateway/bot
Traceback (most recent call last):
  File "/home/keyblue/PythonProject/qqbot-demo/bot2.py", line 331, in <module>
    client.run(appid=config['qqbot']['appid'], token=config['qqbot']['token'])
  File "/home/keyblue/.conda/envs/qqbot/lib/python3.10/site-packages/botpy/client.py", line 132, in run
    self.loop.run_until_complete(runner())
  File "/home/keyblue/.conda/envs/qqbot/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
    return future.result()
  File "/home/keyblue/.conda/envs/qqbot/lib/python3.10/site-packages/botpy/client.py", line 129, in runner
    await self.start(*args, **kwargs)
  File "/home/keyblue/.conda/envs/qqbot/lib/python3.10/site-packages/botpy/client.py", line 155, in start
    await self._bot_login(token)
  File "/home/keyblue/.conda/envs/qqbot/lib/python3.10/site-packages/botpy/client.py", line 168, in _bot_login
    max_async=self._ws_ap["session_start_limit"]["max_concurrency"],
TypeError: 'NoneType' object is not subscriptable

windows下没有这个问题

cuckoo711 commented 7 months ago

请确保您的网络连接是稳定的,并且可以访问 https://api.sgroup.qq.com

keyblues commented 6 months ago

请确保您的网络连接是稳定的,并且可以访问 https://api.sgroup.qq.com

在提出问题前,我经过测试,确保该域名可以访问。并且物理主机是正常登录的,wsl主机ping测试也正常。

zanderzhng commented 1 month ago

相同问题,应该 wsl / websocket 有关