nonebot / adapter-qq

NoneBot2 QQ 适配器 / QQ adapter for nonebot2
MIT License
202 stars 16 forks source link

请问报错Received invalid session event from server. Try to reconnect...怎么办 #108

Closed WhyPilotXia closed 2 months ago

WhyPilotXia commented 2 months ago

启动机器人后始终报错Received invalid session event from server. Try to reconnect... 频道机器人

05-25 12:57:33 [SUCCESS] nonebot | NoneBot is initializing...
05-25 12:57:33 [INFO] nonebot | Current Env: dev
05-25 12:57:33 [DEBUG] nonebot | Loaded Config: {'driver': '~httpx+~websockets', 'host': IPv4Address('127.0.0.1'), 'port': 8080, 'log_level': 'DEBUG', 'api_timeout': 30.0, 'superusers': set(), 'nickname': set(), 'command_start': {'/'}, 'command_sep': {'.'}, 'session_expire_timeout': datetime.timedelta(seconds=120), 'qq_is_sandbox': True, 'qq_bots': [{'id': 'xxx', 'token': 'xxx', 'secret': 'xxx', 'intent': {'guild_messages': True, 'at_messages': False}}], 'environment': 'dev'}
05-25 12:57:34 [DEBUG] nonebot | Succeeded to load adapter "QQ"
05-25 12:57:34 [DEBUG] nonebot | OneBot V12 | Model for key "" <class 'nonebot.adapters.onebot.v12.event.BotEvent'> is overridden by <class 'nonebot.adapters.onebot.v12.event.Event'>
05-25 12:57:35 [SUCCESS] nonebot | Succeeded to load plugin "综合" from "src.综合"
05-25 12:57:35 [SUCCESS] nonebot | Running NoneBot...
05-25 12:57:35 [DEBUG] nonebot | Loaded adapters: QQ
05-25 12:57:35 [DEBUG] nonebot | QQ | QQ run in sandbox mode: True
05-25 12:57:35 [DEBUG] nonebot | QQ | QQ api base url: https://sandbox.api.sgroup.qq.com
05-25 12:57:35 [INFO] nonebot | Application startup completed.
05-25 12:57:35 [DEBUG] nonebot | QQ | Bot 102113039 calling API shard_url_get
05-25 12:57:35 [DEBUG] nonebot | QQ | WebSocket Connection to wss://sandbox.api.sgroup.qq.com/websocket established
05-25 12:57:35 [WARNING] nonebot | QQ | Received invalid session event from server. Try to reconnect...
05-25 12:57:38 [DEBUG] nonebot | QQ | WebSocket Connection to wss://sandbox.api.sgroup.qq.com/websocket established
05-25 12:57:38 [WARNING] nonebot | QQ | Received invalid session event from server. Try to reconnect...
05-25 12:57:41 [DEBUG] nonebot | QQ | WebSocket Connection to wss://sandbox.api.sgroup.qq.com/websocket established
05-25 12:57:42 [WARNING] nonebot | QQ | Received invalid session event from server. Try to reconnect...
05-25 12:57:45 [DEBUG] nonebot | QQ | WebSocket Connection to wss://sandbox.api.sgroup.qq.com/websocket established
05-25 12:57:45 [WARNING] nonebot | QQ | Received invalid session event from server. Try to reconnect...
05-25 12:57:48 [DEBUG] nonebot | QQ | WebSocket Connection to wss://sandbox.api.sgroup.qq.com/websocket established
05-25 12:57:48 [WARNING] nonebot | QQ | Received invalid session event from server. Try to reconnect...
05-25 12:57:51 [DEBUG] nonebot | QQ | WebSocket Connection to wss://sandbox.api.sgroup.qq.com/websocket established
05-25 12:57:51 [WARNING] nonebot | QQ | Received invalid session event from server. Try to reconnect...
he0119 commented 2 months ago

https://github.com/nonebot/adapter-qq/issues/35#issuecomment-1474336180

建议检查一下 intent 配置。

WhyPilotXia commented 2 months ago

请问个人机器人频道用的可以这样填吗,我是这样填的 "intent": { "guild_messages": true, "at_messages": false }

he0119 commented 2 months ago

请问个人机器人频道用的可以这样填吗,我是这样填的 "intent": { "guild_messages": true, "at_messages": false }

如果你是公域机器人就不能这么填。

WhyPilotXia commented 2 months ago

使用默认配置登上了,谢谢大佬 { "guilds": true, "guild_members": true, "guild_messages": false, "guild_message_reactions": true, "direct_message": false, "open_forum_event": false, "audio_live_member": false, "c2c_group_at_messages": false, "interaction": false, "message_audit": true, "forum_event": false, "audio_action": false, "at_messages": true }

he0119 commented 2 months ago

Duplicate of #35