Cvandia / nonebot-plugin-fakemsg

适用于onebotv11的`合并转发`伪造消息
MIT License
22 stars 2 forks source link

[BUG] 伪造消息失败 #13

Open SZ2528 opened 2 months ago

SZ2528 commented 2 months ago

描述bug 伪造消息失败

怎么出现的 1.在bot.py中成功加载插件 1.在群内输入伪造消息指令 1.伪造失败,后台报错 ……

异常情况 文字报错说明 bot.py

06-30 15:25:20 [INFO] nonebot | Matcher(type='message', module=nonebot_plugin_fakemsg, lineno=62) running complete
06-30 15:25:20 [ERROR] nonebot | Running Matcher(type='message', module=nonebot_plugin_fakemsg, lineno=62) failed.
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Program Files\Python310\lib\multiprocessing\spawn.py", line 116, in spawn_main
    exitcode = _main(fd, parent_sentinel)
  File "C:\Program Files\Python310\lib\multiprocessing\spawn.py", line 129, in _main
    return self._bootstrap(parent_sentinel)
  File "C:\Program Files\Python310\lib\multiprocessing\process.py", line 314, in _bootstrap
    self.run()
  File "C:\Program Files\Python310\lib\multiprocessing\process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\rain1\AppData\Roaming\Python\Python310\site-packages\uvicorn\_subprocess.py", line 76, in subprocess_started
    target(sockets=sockets)
  File "C:\Users\rain1\AppData\Roaming\Python\Python310\site-packages\uvicorn\server.py", line 61, in run
    return asyncio.run(self.serve(sockets=sockets))
  File "C:\Program Files\Python310\lib\asyncio\runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "C:\Program Files\Python310\lib\asyncio\base_events.py", line 636, in run_until_complete
    self.run_forever()
  File "C:\Program Files\Python310\lib\asyncio\base_events.py", line 603, in run_forever
    self._run_once()
  File "C:\Program Files\Python310\lib\asyncio\base_events.py", line 1909, in _run_once
    handle._run()
  File "C:\Program Files\Python310\lib\asyncio\events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "C:\Users\rain1\AppData\Roaming\Python\Python310\site-packages\nonebot\message.py", line 476, in check_and_run_matcher
    await _run_matcher(
> File "C:\Users\rain1\AppData\Roaming\Python\Python310\site-packages\nonebot\message.py", line 428, in _run_matcher
    await matcher.run(bot, event, state, stack, dependency_cache)
  File "C:\Users\rain1\AppData\Roaming\Python\Python310\site-packages\nonebot\internal\matcher\matcher.py", line 850, in run
    await self.simple_run(bot, event, state, stack, dependency_cache)
  File "C:\Users\rain1\AppData\Roaming\Python\Python310\site-packages\nonebot\internal\matcher\matcher.py", line 825, in simple_run
    await handler(
  File "C:\Users\rain1\AppData\Roaming\Python\Python310\site-packages\nonebot\dependencies\__init__.py", line 94, in __call__
    return await cast(Callable[..., Awaitable[R]], self.call)(**values)
  File "C:\Users\rain1\AppData\Roaming\Python\Python310\site-packages\nonebot_plugin_fakemsg\__init__.py", line 92, in _
    await send_forward_msg(bot, event, fake_msg_list)
  File "C:\Users\rain1\AppData\Roaming\Python\Python310\site-packages\nonebot_plugin_fakemsg\__init__.py", line 124, in send_forward_msg
    return await bot.call_api(
  File "C:\Users\rain1\AppData\Roaming\Python\Python310\site-packages\nonebot\internal\adapter\bot.py", line 122, in call_api
    raise exception
  File "C:\Users\rain1\AppData\Roaming\Python\Python310\site-packages\nonebot\internal\adapter\bot.py", line 97, in call_api
    result = await self.adapter._call_api(self, api, **data)
  File "C:\Users\rain1\AppData\Roaming\Python\Python310\site-packages\nonebot\adapters\onebot\v11\adapter.py", line 146, in _call_api
    raise NetworkError(f"WebSocket call api {api} timeout") from None
nonebot.adapters.onebot.v11.exception.NetworkError: NetWorkError(message='WebSocket call api send_group_forward_msg timeout')

go-cqhttp

[2024-06-30 15:27:00] [ERROR]: 处置WS命令时发生无法恢复的异常:runtime error: index out of range [0] with length 0
goroutine 703 [running]:
runtime/debug.Stack()
        runtime/debug/stack.go:24 +0x65
github.com/Mrs4s/go-cqhttp/server.(*wsConn).handleRequest.func1()
        github.com/Mrs4s/go-cqhttp/server/websocket.go:471 +0x46
panic({0x1113040, 0xc000486390})
        runtime/panic.go:884 +0x213
github.com/Mrs4s/MiraiGo/client/internal/highway.(*Session).nextAddr(0xc000357310?)
        github.com/Mrs4s/MiraiGo@v0.0.0-20230823050531-a8213e127b2b/client/internal/highway/highway.go:227 +0xfd
github.com/Mrs4s/MiraiGo/client/internal/highway.(*Session).selectConn(0x0?)
        github.com/Mrs4s/MiraiGo@v0.0.0-20230823050531-a8213e127b2b/client/internal/highway/highway.go:248 +0xe5
github.com/Mrs4s/MiraiGo/client/internal/highway.(*Session).uploadSingle(0xc00016cea0, {0x1b, {0x1263600, 0xc0003390e0}, {0xc000366ef0, 0x10, 0x10}, 0x12e, {0xc0000920e0, 0x68, ...}, ...})
        github.com/Mrs4s/MiraiGo@v0.0.0-20230823050531-a8213e127b2b/client/internal/highway/bdh.go:39 +0x68
github.com/Mrs4s/MiraiGo/client/internal/highway.(*Session).Upload(0xc00016cea0, {0x1b, {0x1263600, 0xc0003390e0}, {0xc000366ef0, 0x10, 0x10}, 0x12e, {0xc0000920e0, 0x68, ...}, ...})
        github.com/Mrs4s/MiraiGo@v0.0.0-20230823050531-a8213e127b2b/client/internal/highway/bdh.go:117 +0x425
github.com/Mrs4s/MiraiGo/client.(*ForwardMessageBuilder).Main(0xc000357868, 0xc00049a798)
        github.com/Mrs4s/MiraiGo@v0.0.0-20230823050531-a8213e127b2b/client/multimsg.go:316 +0x5b8
github.com/Mrs4s/go-cqhttp/coolq.(*CQBot).uploadForwardElement(0xc0000b8180, {0x5, {0xc00034ec53, 0x9b}, {0x0, 0x0}, 0x0, 0x53, {0x0, 0x0, ...}}, ...)
        github.com/Mrs4s/go-cqhttp/coolq/api.go:962 +0x1e5
github.com/Mrs4s/go-cqhttp/coolq.(*CQBot).CQSendGroupForwardMessage(0xc0000b8180, 0x0?, {0x5, {0xc00034ec53, 0x9b}, {0x0, 0x0}, 0x0, 0x53, {0x0, ...}})
        github.com/Mrs4s/go-cqhttp/coolq/api.go:978 +0x7d
github.com/Mrs4s/go-cqhttp/modules/api.(*Caller).call(0xc0003f88e0, {0xc00034ec0c, 0x16}, 0x1615620, {0x1265100, 0xc0001427d0})
        github.com/Mrs4s/go-cqhttp/modules/api/api.go:38 +0x1ac5
github.com/Mrs4s/go-cqhttp/modules/api.(*Caller).Call(0xc0003f88e0, {0xc00034ec0c, 0x16}, 0xc00034ec00?, {0x1265100, 0xc0001427d0})
        github.com/Mrs4s/go-cqhttp/modules/api/caller.go:35 +0xc5
github.com/Mrs4s/go-cqhttp/server.(*wsConn).handleRequest(0xc0001e4060, 0x1625680?, {0xc00034ec00?, 0xc000008288?, 0xc00021d960?})
        github.com/Mrs4s/go-cqhttp/server/websocket.go:480 +0x41c
github.com/Mrs4s/go-cqhttp/server.(*websocketClient).listenAPI.func2(0xc0004ba0c0?)
        github.com/Mrs4s/go-cqhttp/server/websocket.go:325 +0x95
created by github.com/Mrs4s/go-cqhttp/server.(*websocketClient).listenAPI
        github.com/Mrs4s/go-cqhttp/server/websocket.go:323 +0x1b2

[2024-06-30 15:27:00] [WARNING]: 监听反向WS Universal时出现错误: read tcp 127.0.0.1:62608->127.0.0.1:8081: use of closed network connection

屏幕截图 这里是截图

版本情况 python:3.10.11 nb-cli:1.4.1 pip:24.1.1 ……

额外的说明 这里是额外的描述

Cvandia commented 1 month ago

由于gocq签名问题,无法复现,现阶段可使用Lagrange和LLonebot尝试构造