Skip to content
New issue

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

[Bug]: 对接 Koishi 的 server-satori 时出现 Unknown payload from server #29

Open
3 of 4 tasks
su226 opened this issue Sep 16, 2024 · 2 comments
Open
3 of 4 tasks
Labels
bug Something isn't working

Comments

@su226
Copy link

su226 commented Sep 16, 2024

确认项

  • 问题的标题明确
  • 我翻阅过其他的 issue 并且找不到类似的问题
  • 我已经阅读了相关文档 并仍然认为这是一个 Bug
  • 我已经尝试过在最新的代码中修复这个问题

操作系统

Linux

Python 版本

3.12.6

NoneBot 版本

2.3.3

适配器

0.12.5

协议端

@koishijs/plugin-server-satori 2.7.1

描述问题

在使用 Koishi 的 server-satori 插件开启协议端时,无法正常接收到事件,日志中出现“Unknown payload from server”

复现步骤

  1. 使用 Koishi 的 server-satori 插件开启协议端
  2. 向机器人帐号发送消息、命令等(示例中发送了“/start”和“test”)
  3. 日志中出现“Unknown payload from server”

期望的结果

正常接收到 message-created、interaction/command 等事件

截图或日志

日志中的 Bot ID 和 User ID 已隐去

09-16 17:40:01 [SUCCESS] nonebot | NoneBot is initializing...
09-16 17:40:01 [INFO] nonebot | Current Env: prod
09-16 17:40:01 [SUCCESS] nonebot | Succeeded to load plugin "idhagnbot_epicgames" from "idhagnbot.plugins.idhagnbot_epicgames"
09-16 17:40:01 [SUCCESS] nonebot | Running NoneBot...
09-16 17:40:01 [INFO] nonebot | Application startup completed.
09-16 17:40:01 [INFO] nonebot | Satori | Bot [Bot ID] connected
09-16 17:40:09 [WARNING] nonebot | Satori | Unknown payload from server: Payload(op=<Opcode.EVENT: 0>, body={'login': {'platform': 'telegram', 'user': {}}, 'type': 'internal', '_type': 'telegram/message', '_data': {'message_id': 340, 'from': {'id': [User ID], 'is_bot': False, 'first_name': 'su226', 'username': 'thesu226', 'language_code': 'zh-hans'}, 'chat': {'id': [User ID], 'first_name': 'su226', 'username': 'thesu226', 'type': 'private'}, 'date': 1726479609, 'text': '/start', 'entities': [{'offset': 0, 'length': 6, 'type': 'bot_command'}]}, 'self_id': '[Bot ID]', 'platform': 'telegram', 'timestamp': 1726479609562, 'id': 4})
09-16 17:40:09 [WARNING] nonebot | Satori | Unknown payload from server: Payload(op=<Opcode.EVENT: 0>, body={'login': {'platform': 'telegram', 'user': {'id': '[User ID]'}}, 'self_id': '[Bot ID]', 'platform': 'telegram', 'timestamp': 1726479609000, '_type': 'telegram', '_data': {'update_id': 718178704, 'message': {'message_id': 340, 'from': {'id': [User ID], 'is_bot': False, 'first_name': 'su226', 'username': 'thesu226', 'language_code': 'zh-hans'}, 'chat': {'id': [User ID], 'first_name': 'su226', 'username': 'thesu226', 'type': 'private'}, 'date': 1726479609, 'text': '/start', 'entities': [{'offset': 0, 'length': 6, 'type': 'bot_command'}]}}, 'type': 'interaction/command', 'message': {'elements': [{'type': 'text', 'attrs': {'content': 'start'}, 'children': []}], 'content': '/start', 'message_id': '340', 'id': '340'}, 'user': {'id': '[User ID]', 'name': 'thesu226', 'nick': 'su226', 'is_bot': False}, 'channel': {'id': '[User ID]', 'type': 1}, 'id': 5})
09-16 17:40:21 [WARNING] nonebot | Satori | Unknown payload from server: Payload(op=<Opcode.EVENT: 0>, body={'login': {'platform': 'telegram', 'user': {}}, 'type': 'internal', '_type': 'telegram/message', '_data': {'message_id': 341, 'from': {'id': [User ID], 'is_bot': False, 'first_name': 'su226', 'username': 'thesu226', 'language_code': 'zh-hans'}, 'chat': {'id': [User ID], 'first_name': 'su226', 'username': 'thesu226', 'type': 'private'}, 'date': 1726479621, 'text': 'test'}, 'self_id': '[Bot ID]', 'platform': 'telegram', 'timestamp': 1726479621760, 'id': 6})
09-16 17:40:21 [WARNING] nonebot | Satori | Unknown payload from server: Payload(op=<Opcode.EVENT: 0>, body={'login': {'platform': 'telegram', 'user': {'id': '[User ID]'}}, 'self_id': '[Bot ID]', 'platform': 'telegram', 'timestamp': 1726479621000, '_type': 'telegram', '_data': {'update_id': 718178705, 'message': {'message_id': 341, 'from': {'id': [User ID], 'is_bot': False, 'first_name': 'su226', 'username': 'thesu226', 'language_code': 'zh-hans'}, 'chat': {'id': [User ID], 'first_name': 'su226', 'username': 'thesu226', 'type': 'private'}, 'date': 1726479621, 'text': 'test'}}, 'type': 'message-created', 'message': {'elements': [{'type': 'text', 'attrs': {'content': 'test'}, 'children': []}], 'content': 'test', 'message_id': '341', 'id': '341'}, 'user': {'id': '[User ID]', 'name': 'thesu226', 'nick': 'su226', 'is_bot': False}, 'channel': {'id': '[User ID]', 'type': 1}, 'id': 7})

Nonebot 配置项

DRIVER=~aiohttp
SATORI_CLIENTS='[
  {
    "host": "localhost",
    "port": "5140",
    "path": "/satori",
    "token": ""
  }
]'
@su226 su226 added the bug Something isn't working label Sep 16, 2024
@RF-Tar-Railt
Copy link
Member

RF-Tar-Railt commented Sep 16, 2024

这是一个koishi 的 bug
Login 对象内应该有必需字段 status:
image
请去 koishi 仓库开这个issue

@RF-Tar-Railt
Copy link
Member

与 Shigma 讨论后确认这是satori 的 新 feature
你可以安装 https://github.com/nonebot/adapter-satori/releases/tag/v0.13.0rc1 来暂时解决你的问题

@RF-Tar-Railt RF-Tar-Railt reopened this Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants