foxwhite25 / qq.py

A Python wrapper for the QQ Channel API
MIT License
65 stars 8 forks source link

client.run报错 #14

Closed starryeye-0001 closed 10 months ago

starryeye-0001 commented 10 months ago

摘要

client.run报错

复现步骤

最小的复现代码

client.run(token=token)

预期结果

实际结果

Traceback (most recent call last): File "c:\Users\13801\Documents\GitHub\Apocalypse-Barrier\qqbot.py", line 1306, in client.run(token=token) File "C:\Users\13801\AppData\Local\Programs\Python\Python311\Lib\site-packages\qq\client.py", line 458, in run return future.result() ^^^^^^^^^^^^^^^ File "C:\Users\13801\AppData\Local\Programs\Python\Python311\Lib\site-packages\qq\client.py", line 437, in runner await self.start(**kwargs) File "C:\Users\13801\AppData\Local\Programs\Python\Python311\Lib\site-packages\qq\client.py", line 473, in start await self.connect(reconnect=reconnect) File "C:\Users\13801\AppData\Local\Programs\Python\Python311\Lib\site-packages\qq\client.py", line 516, in connect await self.ws.poll_event() File "C:\Users\13801\AppData\Local\Programs\Python\Python311\Lib\site-packages\qq\gateway.py", line 491, in poll_event await self.received_message(msg.data) File "C:\Users\13801\AppData\Local\Programs\Python\Python311\Lib\site-packages\qq\gateway.py", line 368, in received_message data["msg_id"] = msg_id


TypeError: 'str' object does not support item assignment

### Intents

default + interaction

### 系统信息

- Python v3.11.3-final
- qq.py v1.3.19-final
- aiohttp v3.8.4
- system info: Windows 10 10.0.22000

### 核对清单

- [X] 我已经搜索了开放的问题,寻找重复的问题。
- [X] 如果有的话,我已经显示了整个 traceback。
- [X] 如果可见的话我已将我的 token 从代码中移除。

### 额外背景

_No response_
foxwhite25 commented 10 months ago

抓个这个报错之前收到的payload

starryeye-0001 commented 10 months ago

好像刚刚上头我写的 async def message_getter(guild): @client.event async def on_message(message: qq.Message): print(message.content)

starryeye-0001 commented 10 months ago

啊找到了,不是那个(那个刚刚根本没跑)

DEBUG:qq.client:分派事件 socket_event_type DEBUG:qq.client:分派事件 user_update DEBUG:qq.client:分派事件 member_update DEBUG:qq.gateway:使用序列 60 保持分片 ID None websocket 处于活动状态。 DEBUG:qq.gateway:分片 ID None:WebSocket 事件:{'op': 11} DEBUG:qq.gateway:分片 ID None:WebSocket 事件:{'op': 0, 's': 61, 't': 'PUBLIC_MESSAGE_DELETE', 'id': 'PUBLIC_MESSAGE_DELETE:12539778-5a93-4119-ab1a-7dff9b5d9eb8', 'd': {'message': {'author': {'bot': False, 'id': '1775357071882651195', 'username': '童话镇里的七彩河'}, 'channel_id': '1370006', 'guild_id': '6318270414311592983', 'id': '0897a89cbff5aec0d7571096cf533899dba40348c78af1ab06'}, 'op_user': {'id': '1775357071882651195'}}} DEBUG:qq.client:分派事件 socket_event_type DEBUG:qq.client:分派事件 raw_message_delete DEBUG:qq.gateway:分片 ID None:WebSocket 事件:{'op': 7} DEBUG:qq.gateway:收到 RECONNECT 操作码。 INFO:qq.client:收到了 RESUME websocket 的请求。 DEBUG:qq.client:分派事件 disconnect DEBUG:qq.http:GET https://api.sgroup.qq.com/gateway 与 None 已返回 200 Trace ID: f1de54bd5b81ba337cc92b59922dc4c0 DEBUG:qq.http:GET https://api.sgroup.qq.com/gateway 已收到 {'url': 'wss://api.sgroup.qq.com/websocket'} DEBUG:qq.gateway:创建连接到 wss://api.sgroup.qq.com/websocket 的 websocket DEBUG:qq.gateway:分片 ID None:WebSocket 事件:{'d': {'heartbeat_interval': 41250}, 'op': 10} INFO:qq.gateway:分片 ID None 已发送 RESUME 负载。 DEBUG:qq.gateway:分片 ID None:WebSocket 事件:{'op': 0, 's': 62, 't': 'RESUMED', 'd': ''} DEBUG:qq.client:分派事件 socket_event_type INFO:qq.client:清理任务。 INFO:qq.client:在 2 个任务后清理。 INFO:qq.client:所有任务都取消了。 INFO:qq.client:关闭事件循环。 Traceback (most recent call last): File "c:\Users\13801\Documents\GitHub\Apocalypse-Barrier\qqbot.py", line 1347, in
client.run(token=token) File "C:\Users\13801\AppData\Local\Programs\Python\Python311\Lib\site-packages\qq\client.py", line 458, in run return future.result() ^^^^^^^^^^^^^^^ File "C:\Users\13801\AppData\Local\Programs\Python\Python311\Lib\site-packages\qq\client.py", line 437, in runner await self.start(**kwargs) File "C:\Users\13801\AppData\Local\Programs\Python\Python311\Lib\site-packages\qq\client.py", line 473, in start await self.connect(reconnect=reconnect) File "C:\Users\13801\AppData\Local\Programs\Python\Python311\Lib\site-packages\qq\client.py", line 516, in connect await self.ws.poll_event() File "C:\Users\13801\AppData\Local\Programs\Python\Python311\Lib\site-packages\qq\gateway.py", line 491, in poll_event await self.received_message(msg.data) File "C:\Users\13801\AppData\Local\Programs\Python\Python311\Lib\site-packages\qq\gateway.py", line 368, in received_message data["msg_id"] = msg_id


TypeError: 'str' object does not support item assignment